Skip to content

Goalplan decisions record offered options; recommendation must be one of them (#262 follow-up) - #280

Merged
lidge-jun merged 4 commits into
devfrom
codex/issue-train-0930-wp5
Sep 29, 2026
Merged

lidge-jun merged 4 commits into
devfrom
codex/issue-train-0930-wp5

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Problem

#271 let goalplans record a pending user decision, but not the options that were offered. The #262 acceptance list also asks that the recommendation be one of those options, which could not be checked.

Change

  • GoalplanDecision gains an optional options?: string[]. cxc loop ask takes a repeatable --option <text>. When options are given, they must be non-empty and distinct after trimming, and --recommendation must be one of them; otherwise ask refuses without writing.
  • The reviver validates options when present and fails closed on malformed data (field 'decisions' did not satisfy the schema), like every other goalplan field. Stored strings are kept as written and compared after trimming.
  • ready --json and show include the options (show prints options: A | B (recommended: A)), and the help text explains the flag.
  • The decide answer stays free text. The host's question tool always offers a free-form reply, so requiring the answer to be one of the options would strand the linked phases.
  • durable-goalplan.md and async-questions.md are synced.

Plans without options read and write unchanged; ask without --option stores no options key. withdrawn is not part of this change, so #262 stays open for it.

Compatibility

Builds older than this one rebuild decisions field by field and drop options if they rewrite such a plan. There is no schema-version bump.

Verification

  • Seven new tests plus added assertions in goalplan-public-surface.test.ts (41 in the file). Red check: with goalplan.ts and goalplan-cli.ts from 58a8a174, 6 of 41 fail (every new behavior test); the seventh is a compatibility test that passes on both. New source: 41/41.
  • npm test (3737 tests, 0 failures), inventory, gate.mjs and platform-smoke.mjs pass under cxc receipt test. The hook diff is empty.

Refs #262.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T18:27:46.017959Z 7e4b90a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 24 / 80

이 PR의 바탕은 dev예요. 목표 계획(goalplan)에 “지금 기다리는 질문”은 이미 적을 수 있었는데, 그때 보여 준 선택지 목록은 저장되지 않았어요. 그래서 추천이 그 선택지 안에 있는지도 확인할 수 없었어요. 이번 변경은 GoalplanDecision에 선택적 options 칸을 넣고, cxc loop ask에 반복 가능한 --option을 붙입니다. 선택지를 넣으면 비어 있거나 같은 말이 두 번이면 거절하고, --recommendation이 있으면 반드시 그 목록 안이어야 파일을 씁니다. ready --json과 show에도 선택지가 나오고, 도움말·durable-goalplan.md·async-questions.md도 맞춰 두었어요. decide의 답은 여전히 자유 문장입니다. 호스트 질문 도구가 항상 자유 입력을 받기 때문에, 답을 선택지로만 막으면 묶인 단계가 멈출 수 있어서예요. 선택지 없는 옛 계획은 그대로 읽고 씁니다. withdrawn은 이번 범위가 아니라 #262는 열린 채로 둡니다. 테스트 7개를 더했고, 본문 기준으로 로컬 npm test 3737이 통과했다고 적혀 있어요. CI는 아직 돌아가는 중입니다.

라인 - plugins/codexclaw/components/pabcd-state/src/goalplan.ts reviveDecisionOptions / 호환성 — 스키마 버전을 올리지 않았어요. 이 빌드보다 옛 코드가 decisions를 필드마다 다시 쓰면 options를 조용히 버릴 수 있어요. PR 본문과 wp5 C 기록에도 적혀 있지만, 여러 버전이 같은 계획 파일을 만지면 선택지가 사라질 수 있습니다.
라인 - askGoalplanDecision vs decideGoalplanDecision — 물어볼 때는 추천이 선택지 안인지 막고, 답할 때는 선택지 밖 문장도 받습니다. 의도한 설계이지만, 디스크에 적힌 선택지와 최종 답이 어긋난 채로 남을 수 있어요. 읽는 쪽이 “답 ⊆ 선택지”를 가정하면 깨집니다.
라인 - writeGoalplan 직접 호출 — ask의 검사를 건너뛸 수 있어요. 다음 읽기에서 reviver가 잘못된 options를 막지만, “호스트에 그 선택지를 정말 보여 줬는지”는 이 계층이 증명하지 않습니다. 플랜의 E2 잔여 위험과 같습니다.

메인테이너의 판단이 필요한 지점

옛 빌드가 options를 떨어뜨리는 일을 CHANGELOG/wp4에만 적어 둘지, 스키마 버전을 올려 읽기 실패로 드러낼지. 또 decide 답을 선택지 안으로 강제할지, 지금처럼 자유 문장으로 둘지(#262 수용 목록과의 거리).

너의 추천

dev 베이스로 merge해도 됩니다. 닫을 중복 types/config PR은 없습니다. 머지 전에 hosted CI가 초록인지 보고, #262에는 “options+recommendation 검증은 들어왔고, withdrawn은 남음” 한 줄을 남기세요. 스키마 버전 없이도 가려면 wp4 CHANGELOG에 “옛 빌드 rewrite 시 options 유실”을 꼭 적으세요. preview deploy 이야기는 불필요합니다.

이 댓글은 grok-bot이 작성했습니다

@lidge-jun
lidge-jun merged commit 99c9df6 into dev Sep 29, 2026
14 checks passed
@lidge-jun
lidge-jun deleted the codex/issue-train-0930-wp5 branch September 29, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant