Skip to content

Goalplan pending decisions: cxc loop ask/decide and decision-aware readiness (#262) - #271

Merged
lidge-jun merged 12 commits into
devfrom
codex/issue-train-wp4
Sep 27, 2026
Merged

lidge-jun merged 12 commits into
devfrom
codex/issue-train-wp4

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Goalplans can now record user decisions a loop is waiting on, so work that depends on an answer stops looking runnable and the rest of the plan keeps moving (#262).

Behavior

  • cxc loop ask --session <id> --id <q> --question <text> [--recommendation <text>] [--work-phase <id>]... records a question the agent has already asked (it never sends anything) and links the phases that wait on it. Duplicate open question text, unknown phases and done phases are refused without writing.
  • cxc loop decide --session <id> --id <q> --answer <text> records the answer. It is idempotent for the same answer, refuses a different one, and refuses an ambiguous id.
  • Readiness, cursor selection, successor choice and absent-target recovery skip phases with an open decision (and their dependents). A decision reference counts as answered only when exactly one decision has that id and it is decided, so missing or duplicate ids fail closed.
  • loop ready and loop show list open decisions and waiting phases. E8 validation and the goal-complete gate reject unfinished linked phases.
  • The Stop hook lets an IDLE turn end, instead of asking to start another phase, only when every remaining phase and every unmet criterion waits on an open decision and the plan has no structural E8 problem. The goal stays active and cannot be completed early.
  • Plans without the new fields load and validate as before. The decision record uses the small open | decided contract. The issue's options[] and withdrawn states were not adopted; a withdrawn question is decided with an answer that says so.

Verification

  • Red-first regression tests for the CLI verbs, readiness, recovery, duplicate and missing ids, the Stop release and its refusals (independent phases, independent criteria, broken references, dependency-completion and supersede problems).
  • Local on the head: npm test 3708 tests, 3703 pass, 0 fail, 5 skipped (receipt at e59c9d8); npm run gate OK; inventory.mjs --check --tests 3708 OK; platform smoke OK on darwin.
  • Plan devlog/_plan/260927_issue_train/030: architect consultation and two audit rounds. Implementation: four review rounds by an independent gpt-6-sol reviewer, final PASS.

Residual risk

  • ask cannot prove the question reached the user. An agent could park a goal by recording a question it never asked; the goal-complete gate still prevents closing it.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 27, 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-27T18:34:05.609443Z e59c9d8 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e59c9d8ee8

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1979 to +1983
if (!workPhaseReadyConditionsMet(plan, current)) {
return { kind: "dependencies_unmet", unmet: [
...unmetPhaseDependencyIds(plan, current),
...openDecisionIdsForPhase(plan, current).map((id) => `decision:${id}`),
] };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Let an in-progress phase yield for its pending decision

When cxc loop ask --work-phase links an open decision to the currently in_progress phase, this readiness check prevents that phase from closing, while effectiveActiveWorkPhaseId() also stops selecting it. Consequently the C→D close reports no active phase/deadlock and the FSM cannot reach IDLE; because the new decision-aware Stop release runs only at IDLE, the agent receives repeated continuations until the absolute cap instead of yielding for the user's answer. Distinguish whether a phase may execute from whether its current cycle may close, or allow the in-flight Stop path to yield on this state.

Useful? React with 👍 / 👎.

@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 70 / 80

이 PR의 바탕은 dev예요. 같은 주제로 열린 다른 PR은 없어요.

목표 계획에 사람 답을 기다리는 질문을 적을 수 있어요. cxc loop ask는 질문을 보내지 않아요. 이미 물어본 질문만 적고, 그 답을 기다리는 작업 단계를 연결해요. 연결된 단계는 답이 오기 전에 실행 목록에서 빠져요. 연결되지 않은 단계는 그대로 진행할 수 있어요. 답이 오면 cxc loop decide로 적어요. 같은 답은 다시 적어도 파일이 바뀌지 않고, 다른 답은 거절해요. 없는 질문 번호, 겹친 번호, 없는 단계는 파일을 고치지 않아요.

남은 작업 단계와 아직 안 채운 기준이 전부 열린 질문을 기다릴 때만, IDLE에서 Stop이 다음 단계를 시작하라고 하지 않아요. 목표는 켜진 채로 남고, 일찍 끝나지도 않아요. 예전 계획 파일은 새 칸 없이 그대로 읽혀요.

plugins/codexclaw/components/pabcd-state/src/goalplan.ts 1979 - 진행 중인 단계에 열린 질문이 걸리면 그 단계를 끝낼 수 없어요. 같은 파일 2228은 그 단계를 지금 할 일로 고르지 않아요. orchestrate-cli.ts 925는 그래서 뒤의 다른 대기 단계를 끝낼 대상으로 잡거나, 937에서 끝낼 단계가 없다고 해요. 947은 대상이 다르면 아무것도 저장하지 않아요. 상태는 C에 남아요.

plugins/codexclaw/components/pabcd-state/src/hook.ts 1819 - 양보는 단계가 IDLE일 때만 1828에서 해요. C에 남아 있으면 Stop은 답을 기다리는 동안에도 일을 이어 가라고 하고, 한 말당 24번까지 가요. work-phase-states.test.ts의 "open decision excludes linked phase"는 질문 걸린 단계를 진행 중으로 둔 채 뒤의 대기 단계를 끝난 것으로 계산해요. hook-continuation.test.ts의 IDLE 해제는 이미 IDLE인 경우만 봐요. C에서 IDLE로 돌아오는 길은 테스트에 없어요.

plugins/codexclaw/components/pabcd-state/src/orchestrate-cli.ts 877 - 복구가 막힌 이유를 아직 "다른 작업 단계를 기다린다"로만 적어요. 같은 파일 822는 "선행 조건이나 결정"이라고 해요. 질문 때문에 막혀도 877은 질문이라고 말하지 않아요.

plugins/codexclaw/components/pabcd-state/src/goalplan.ts askGoalplanDecision - --work-phase가 없어도 질문만 저장해요. 그때는 어떤 단계도 멈추지 않아서 Stop이 다음 일을 계속 시켜요.

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

진행 중인 단계에 질문을 걸면, 그 주기를 닫지 않은 채 Stop만 멈출지, 단계를 잠시 멈추고 IDLE로 돌아갈지 정해 주세요. --work-phase 없는 ask를 거절할지도 같이 정해 주세요. 질문을 실제로 보냈는지는 ask가 증명하지 못한다는 점은 본문에 있어요. 그 위험은 이번에도 남아요.

너의 추천

바탕 dev는 유지하세요. 닫을 중복 PR은 없어요. 합치기 전에, 진행 중 단계에 ask한 뒤 D가 다른 단계를 끝난 것으로 치지 않고 Stop이 양보하게 고치세요. 877 문구는 822와 같게 맞추세요. --work-phase가 없으면 ask를 거절하는 쪽이 안전해요.

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

@lidge-jun
lidge-jun merged commit c4f1767 into dev Sep 27, 2026
14 checks passed
@lidge-jun
lidge-jun deleted the codex/issue-train-wp4 branch September 27, 2026 18:42
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