Repository navigation
Open
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "session manifest / preflight artifact / termination artifact から next-agent prompt draft を deterministic に生成し、重複調査・token 消費・判断ブレを削減する"
change_kind: codeBackground
Claude Code / Codex CLI の作業ログを人間が貼り付けてから、次に何を指示するかを毎回 LLM が再構築している。これは重複調査、token 消費、判断ブレの原因になる。
Issue #907 の停止時も、次のアクション(anchor reframe / follow-up split)を人間が手動で整理してプロンプトを組み立てた。
Outcome
scripts/generate_next_agent_prompt.py が存在し、issue number / termination artifact / optional session manifest を入力として、next action / required URLs / must-read files / do-not-read-initial paths / safe command list / ready-to-copy prompt を出力する。
In Scope
scripts/generate_next_agent_prompt.pyを追加する- 入力: issue number, latest termination artifact path, optional session manifest path, optional planner_input path
- 出力: next action / required URLs / must-read files / do-not-read-initial paths / safe command list / ready-to-copy prompt
scope_signal_guard停止時は anchor reframe / follow-up split の 2 案を出す- raw transcript 全文を出力しない
- prompt 内に absolute local path や private artifact content を漏らさない
tests/test_generate_next_agent_prompt.pyを追加する- Issue 実装: issue-refinement-loop が baseline-passing VC を自動修復できず human_escalation する問題を修正する #907 型の
scope_signal_guard停止で、validtermination_causeを使う prompt が生成される max_iterations停止、contract-review blocked、environment_failure でも別 template が出る
- Issue 実装: issue-refinement-loop が baseline-passing VC を自動修復できず human_escalation する問題を修正する #907 型の
Allowed Paths
scripts/generate_next_agent_prompt.pytests/test_generate_next_agent_prompt.py
Acceptance Criteria
- AC1: Issue 実装: issue-refinement-loop が baseline-passing VC を自動修復できず human_escalation する問題を修正する #907 型の
scope_signal_guard停止で、validtermination_causeを使う prompt が生成される - AC2:
max_iterations停止 /contract-review blocked/environment_failureでも別 template が出る - AC3: raw transcript 全文を出力しない(出力が 8192 bytes 以下の fixture で固定)
- AC4: prompt 内に absolute local path を含まない
- AC5:
scope_signal_guard停止時に anchor reframe と follow-up split の 2 案が含まれる
Verification Commands
# AC1 / AC2 / AC3 / AC4 / AC5
uv run pytest tests/test_generate_next_agent_prompt.py -v
# smoke test
uv run python3 scripts/generate_next_agent_prompt.py \
--issue 907 \
--termination-artifact <fixture-path>
pnpm typecheck
pnpm lintNon-Goals
- next-agent prompt の自動実行
- session transcript の解析・要約(別責務)
- LLM を使った prompt 生成(deterministic のみ)
Metadata
Metadata
Assignees
Labels
No labels
Activity