Repository navigation
Closed as not planned
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1833"
goal_ref: "digest-bound な subagent task packet の schema/builder/validator を実装し、#790 の agent preflight bundle / task packet generator を統合する"
change_kind: codeParent Issue
Parent Goal Ref
- Goal: Codex CLI の Multi-Agent V2 を有効化し、main session を唯一の control-plane とする明示的な委譲グラフを、新規 enforcing hook を追加せず導入する。
- Desired Destination: 単独改善(parent 導入: Codex CLI Multi-Agent V2 へ移行し、明示的な委譲グラフとbounded nested delegation harnessを導入する #1833 の context packet 基盤)。実装: agent preflight bundle と task packet generator を追加する #790「実装: agent preflight bundle と task packet generator を追加する」を supersede する。 実装: agent preflight bundle と task packet generator を追加する #790 は未着手のまま本 Issue に統合し、起票後 実装: agent preflight bundle と task packet generator を追加する #790 へ統合提案コメントを残す(close は人間判断)。
Current Validated Scope
scripts/agent-guards/codex_subagent_task_packet.schema.jsonを新規作成し、CODEX_SUBAGENT_TASK_PACKET_V1を digest-bound context ref(sha256)付きで表現する。scripts/agent-guards/build_codex_subagent_task_packet.pyを新規作成し、実装: agent preflight bundle と task packet generator を追加する #790 が提案していた compact stdout フィールド(STATUS/SUMMARY/NEXT_ACTION/MUST_READ/DO_NOT_READ/COMMANDS/EVIDENCE/BLOCKERS)をobjective/context_refs/constraintsへ統合したうえで packet を生成する。scripts/agent-guards/validate_codex_subagent_task_packet.pyを新規作成し、fork_turns != noneの拒否、digest 不一致の拒否、raw transcript / raw diff 混入の拒否を検査する。.codex/hooks.jsonは変更しない。実装: agent preflight bundle と task packet generator を追加する #790 が提案していたscripts/agent_ops/agent_preflight_bundle.py/scripts/agent_ops/generate_task_packet.pyという別名スクリプトは作成しない(本 Issue の builder に一本化)。
Remaining Parent Gaps
- 実際の skill dispatch site への組み込みは Child 5 で扱う。
- agent 定義側の delegation metadata は Child 6 で扱う。
Outcome
codex_subagent_task_packet.schema.json / build_codex_subagent_task_packet.py / validate_codex_subagent_task_packet.py が追加され、offline fixture(issue番号・contract snapshot・LOOP_STATE のサンプル)から digest-bound packet を生成でき、fork_turns 欠落・digest 不一致・raw transcript 混入のいずれも validator が拒否することが unit test で検証されている状態。
In Scope
codex_subagent_task_packet.schema.jsonにtask_name/parent_role/agent_type/fork_turns(enum:noneのみ許可) /loop(kind/issue_number/iteration/phase) /objective.summary/context_refs[](path/sha256/purpose) /inputs/constraints(allowed_paths/verification_commands/write_lease/allowed_child_roles/max_child_count) /expected_output.schema/join_policy(required/consume_only_after_validation)を定義する。build_codex_subagent_task_packet.pyに、Issue 番号・contract snapshot path・LOOP_STATE path を入力として、実装: agent preflight bundle と task packet generator を追加する #790 相当の compact stdout フィールド(MUST_READ/DO_NOT_READ/COMMANDS/EVIDENCE/BLOCKERS)をcontext_refs[].purposeとconstraintsへ写像したうえでCODEX_SUBAGENT_TASK_PACKET_V1JSON を stdout に出力する処理を実装する。validate_codex_subagent_task_packet.pyに、fork_turnsがnone以外なら拒否、context_refs[].sha256が実ファイルのハッシュと不一致なら拒否、objective.summaryに生の issue comment 本文や diff 全体が含まれる場合(閾値文字数超過のヒューリスティック)は拒否する処理を実装する。tests/agent-guards/test_build_codex_subagent_task_packet.py/tests/agent-guards/test_validate_codex_subagent_task_packet.pyを追加する。
Out of Scope
- graph policy JSON・graph validator 本体(Child 3、依存として利用のみ)。
- canonical skill dispatch site への組み込み(Child 5)。
.codex/agents/*.tomlの delegation metadata(Child 6)。- 実装: agent preflight bundle と task packet generator を追加する #790 が Out of Scope としていた「issue-contract-review の自動投稿」「contract snapshot locator 専用 script」「VC baseline blocker の自動修正」「PR checks / CI logs / TEST_VERDICT digest」は本 Issue でも引き続き Out of Scope。
.codex/hooks.jsonの変更。
Acceptance Criteria
- AC1:
codex_subagent_task_packet.schema.jsonがfork_turnsをenum: ["none"]として定義する。 - AC2:
build_codex_subagent_task_packet.pyが offline fixture からCODEX_SUBAGENT_TASK_PACKET_V1JSON を stdout に出力する。 - AC3: 生成された packet の
context_refs[]にsha256が付与される。 - AC4:
validate_codex_subagent_task_packet.pyがfork_turns: allを含む fixture を拒否する(非ゼロ exit)。 - AC5: 同スクリプトが digest 不一致の fixture を拒否する(非ゼロ exit)。
- AC6: 同スクリプトが
objective.summaryに raw diff 相当の長文を含む fixture を拒否する(非ゼロ exit)。 - AC7:
scripts/agent_ops/agent_preflight_bundle.pyおよびscripts/agent_ops/generate_task_packet.pyが本リポジトリに存在しない(実装: agent preflight bundle と task packet generator を追加する #790 の別名実装を作らないことの確認)。 - AC8: 新規 unit test が全て PASS する。
Verification Commands
# AC1
$ rg -n "\"enum\": \\[\"none\"\\]" scripts/agent-guards/codex_subagent_task_packet.schema.json
# AC2
$ uv run --locked python3 scripts/agent-guards/build_codex_subagent_task_packet.py --offline-fixture tests/fixtures/agent-guards/task-packet/sample-issue.json
# AC3
$ rg -n "\"sha256\":" tests/fixtures/agent-guards/task-packet/sample-issue.json
# AC4
$ uv run --locked python3 scripts/agent-guards/validate_codex_subagent_task_packet.py --fixture tests/fixtures/agent-guards/task-packet/violation-fork-turns-all.json
# AC5
$ uv run --locked python3 scripts/agent-guards/validate_codex_subagent_task_packet.py --fixture tests/fixtures/agent-guards/task-packet/violation-digest-mismatch.json
# AC6
$ uv run --locked python3 scripts/agent-guards/validate_codex_subagent_task_packet.py --fixture tests/fixtures/agent-guards/task-packet/violation-raw-diff.json
# AC7
$ test ! -e scripts/agent_ops/agent_preflight_bundle.py
# AC8
$ uv run --locked python3 -m pytest tests/agent-guards/test_build_codex_subagent_task_packet.py tests/agent-guards/test_validate_codex_subagent_task_packet.py -qAllowed Paths
scripts/agent-guards/codex_subagent_task_packet.schema.jsonscripts/agent-guards/build_codex_subagent_task_packet.pyscripts/agent-guards/validate_codex_subagent_task_packet.pytests/agent-guards/test_build_codex_subagent_task_packet.pytests/agent-guards/test_validate_codex_subagent_task_packet.pytests/fixtures/agent-guards/task-packet/**
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
.codex/hooks.jsonの変更が必要と判明した場合(即停止し 実装: Codex enforcing harness を quarantine し、advisory session recorder のみ維持して標準 sandbox / approval workflow に戻す #1830 との調整を人間へ確認する)- 実装: agent preflight bundle と task packet generator を追加する #790 の scope が本 Issue の統合方針と食い違うことが実装中に判明した場合
Required Skills
なし
Required Design References
- docs/dev/agent-skill-boundaries.md
- 実装: agent preflight bundle と task packet generator を追加する #790(統合元、supersede される)
Scope Delta(任意)
N/A
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity
squne121 commentedon Aug 1, 2026
not planned への整理
digest-bound task packet は #1836 の独自control-planeと同系統であり採用しません。packet欠落、digest不一致、snapshot欠落を新たなblocking authorityにはしません。必要なcontextはmain/rootが各dispatchへ直接かつboundedに渡します。
#790を実装完了させた成果物は存在しません。必要な最小instructionは改訂後の #1838 / #1839 に吸収し、packet schema、builder、validator、digest、publisherは作成しません。