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: "check-codex-agents.mjs へ graph policy / agent delegation metadata の双方向整合チェックを CLI subcommand として追加する(既存 hook 配線は変更しない)"
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 の checker 統合)。Child 8 の loop integration がこの subcommand を前提にする。
Current Validated Scope
scripts/check-codex-agents.mjsに新規 CLI subcommand(例:--validate-delegation-graph)を追加し、codex_subagent_graph_policy.v1.jsonの schema 検証、.codex/agents/*.tomlのDELEGATION_POLICYmetadata 検証、両者の双方向整合(policy のedges[]に存在する child role が対応する agent のallowed_child_rolesと一致するか等)を検査する。- 既存の
--hook-pretool経路(.codex/hooks.jsonの active PreToolUse wiring)は一切変更しない。 新規 subcommand は orchestrator skill が明示的に呼び出す独立した検証専用モードとして追加する。 .codex/hooks.jsonは変更しない。
Remaining Parent Gaps
- 実際の loop skill からの呼び出し組み込みは Child 8 で扱う。
- read-only nested canary の有効化は Child 9 で扱う。
Outcome
check-codex-agents.mjs --validate-delegation-graph が graph policy と agent delegation metadata の不整合(unknown child role、read-only agent の write lease 要求、write-capable edge の single-writer policy 違反)を検出して非ゼロ exit を返し、既存の --hook-pretool 挙動が回帰していないことがテストで確認されている状態。
In Scope
scripts/check-codex-agents.mjsに--validate-delegation-graphsubcommand を追加し、codex_subagent_graph_policy.v1.jsonを読み込んで schema 妥当性を検証する。- 同 subcommand が
.codex/agents/*.tomlのDELEGATION_POLICYblock を parse し、graph policy のedges[]とallowed_child_rolesの双方向整合を検査する(graph policy にあって agent 定義にない child role、agent 定義にあって graph policy にない child role をそれぞれ検出)。 read_onlypermission の agent(implementation-designer等)がwrite_lease: exclusiveを要求する定義になっていないかを検査する。- 既存の
--hook-pretoolモードのテスト(tests/**/test_check_codex_agents*.{mjs,js}相当)が変更なしで PASS することを確認する回帰テストを追加する。
Out of Scope
.codex/hooks.jsonの active hook wiring 変更。- graph policy JSON・validator 本体の変更(Child 3、依存として参照のみ)。
- 実際の skill からの呼び出し組み込み(Child 8)。
- SubagentStart launch evidence の hook-time 記録(本 parent 全体で採用しない方針、導入: Codex CLI Multi-Agent V2 へ移行し、明示的な委譲グラフとbounded nested delegation harnessを導入する #1833 本文参照)。
Acceptance Criteria
- AC1:
check-codex-agents.mjs --validate-delegation-graphサブコマンドが実装されている。 - AC2: graph policy にあって agent 定義にない child role を含む fixture に対して非ゼロ exit を返す。
- AC3: read-only agent が
write_lease: exclusiveを要求する fixture に対して非ゼロ exit を返す。 - AC4: 正常系 fixture(現行 導入: Codex CLI Multi-Agent V2 へ移行し、明示的な委譲グラフとbounded nested delegation harnessを導入する #1833 child 6 成果物相当)に対してゼロ exit を返す。
- AC5: 既存
--hook-pretoolの既存テストが変更なしで PASS する(回帰なし)。 - AC6:
.codex/hooks.jsonが本 Issue の diff に含まれない。
Verification Commands
# AC1
$ rg -n "validate-delegation-graph" scripts/check-codex-agents.mjs
# AC2
$ node scripts/check-codex-agents.mjs --validate-delegation-graph --fixture tests/fixtures/check-codex-agents/violation-unknown-child-role.json
# AC3
$ node scripts/check-codex-agents.mjs --validate-delegation-graph --fixture tests/fixtures/check-codex-agents/violation-readonly-write-lease.json
# AC4
$ node scripts/check-codex-agents.mjs --validate-delegation-graph --fixture tests/fixtures/check-codex-agents/valid-graph-agent-parity.json
# AC5
$ pnpm test -- check-codex-agents
# AC6
$ git diff --name-only main -- .codex/hooks.jsonAllowed Paths
scripts/check-codex-agents.mjstests/fixtures/check-codex-agents/**tests/**/check-codex-agents*.test.*
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 との調整を人間へ確認する)- 既存
--hook-pretool挙動に回帰が生じた場合
Required Skills
なし
Required Design References
- docs/dev/session-recording-policy.md
- docs/dev/agent-skill-boundaries.md
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 への整理
本Issue全体は廃止した graph policy と独自
DELEGATION_POLICYの双方向checkerを目的としており、独立した残存scopeはありません。native config、最小agent instruction、実runtime smokeへ置き換えます。scripts/check-codex-agents.mjsに代替graph subsystemを追加せず、.codex/hooks.jsonも変更しません。