Repository navigation
Closed
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#776"
goal_ref: ".codex/agents/issue-author.toml と .codex/agents/issue-reviewer.toml の developer_instructions を validator 要件に揃え、check-codex-agents.mjs の既存 failure を deterministic に解消する"
change_kind: mixedParent Issue
Parent Goal Ref
- Goal:
.codex/agents/issue-author.tomlと.codex/agents/issue-reviewer.tomlの developer_instructions をscripts/check-codex-agents.mjsの要求に一致させ、issue-author / issue-reviewer の既存 failure を消す - Desired Destination:
node scripts/check-codex-agents.mjsが issue-author / issue-reviewer に対する既存 failure を出さずに exit 0 になる
Current Validated Scope
.codex/agents/issue-author.toml.codex/agents/issue-reviewer.tomlscripts/check-codex-agents.mjstests/fixtures/codex-agent-config/**
Remaining Parent Gaps
なし
Outcome
issue-author.toml と issue-reviewer.toml の developer_instructions が、既存 compact output / context budget / artifact 保存方針と矛盾しない形で validator 要求語彙に揃い、node scripts/check-codex-agents.mjs が既存 failure なしで通る状態。
In Scope
.codex/agents/issue-author.tomlのdeveloper_instructionsを更新し、OUTPUT_CONTRACT相当の節でstructured output/context budget/raw transcript/raw diff/raw logsを行単位の出力契約または禁止事項として明示する.codex/agents/issue-reviewer.tomlのdeveloper_instructionsを更新し、同じくOUTPUT_CONTRACT相当の節で上記語彙を compact result / artifact 保存方針と整合する形で明示する- まず
.codex/agents/issue-author.tomlと.codex/agents/issue-reviewer.tomlのみでnode scripts/check-codex-agents.mjsを通すことを目標にする - TOML-only 修正後にも failure が残る場合に限り、
scripts/check-codex-agents.mjsまたはtests/fixtures/codex-agent-config/**の必要最小限の調整可否を確認する
Out of Scope
.codex/skills/の導入や変更.agents/skills/**の thin-bridge / shared-surface 変更.claude/skills/**の scope 拡張や docs rewritescripts/check_codex_agent_config.pyの変更- issue-author / issue-reviewer 以外の
.codex/agents/*.tomlの不要な文言変更 - validator 以外の runtime / hook / permission policy 変更
- live spawn 実証、runtime override 証明、外部サービス依存の runtime 実効性検証
Acceptance Criteria
- AC1:
.codex/agents/issue-author.tomlのdeveloper_instructionsにstructured output/context budget/raw transcript/raw diff/raw logsが含まれている - AC2:
.codex/agents/issue-reviewer.tomlのdeveloper_instructionsにstructured output/context budget/raw transcript/raw diff/raw logsが含まれている - AC3:
node scripts/check-codex-agents.mjsが issue-author と issue-reviewer の既存 failure を出さずに exit 0 になる - AC4: 必須文言は
developer_instructions内のOUTPUT_CONTRACTまたはCONTEXT_POLICY相当の節に、出力契約または禁止事項として記載されている。無関係な末尾メモ・コメント・description だけでは満たさない - AC5: 原則として変更は
.codex/agents/issue-author.tomlと.codex/agents/issue-reviewer.tomlに限定する。scripts/check-codex-agents.mjsまたはtests/fixtures/codex-agent-config/**を変更する場合は、TOML-only 修正後にも残る failure の before/after を PR 本文に記録する - AC6:
.codex/skills/、.agents/skills/**、.claude/skills/**、runtime hook / permission policy は変更しない
Verification Commands
# AC1
$ rg -Pzo "OUTPUT_CONTRACT(?s:.*)structured output(?s:.*)context budget(?s:.*)raw transcript(?s:.*)raw diff(?s:.*)raw logs" .codex/agents/issue-author.toml
# AC2
$ rg -Pzo "OUTPUT_CONTRACT(?s:.*)structured output(?s:.*)context budget(?s:.*)raw transcript(?s:.*)raw diff(?s:.*)raw logs" .codex/agents/issue-reviewer.toml
# AC3
# preflight-scope: runtime_only
$ node scripts/check-codex-agents.mjs
# AC4
$ rg -Pzo "OUTPUT_CONTRACT(?s:.*)structured output(?s:.*)context budget(?s:.*)raw transcript(?s:.*)raw diff(?s:.*)raw logs" .codex/agents/issue-author.toml .codex/agents/issue-reviewer.toml
# AC5
# preflight-scope: pr_review_only
$ git diff --exit-code -- scripts/check-codex-agents.mjs tests/fixtures/codex-agent-config/expected-runtime-contract.json
# AC6
# preflight-scope: pr_review_only
$ git diff --exit-code -- .agents/skills .claude/skills .codex/hooks.json .codex/config.tomlAllowed Paths
.codex/agents/issue-author.toml.codex/agents/issue-reviewer.tomlscripts/check-codex-agents.mjstests/fixtures/codex-agent-config/**tests/fixtures/codex-agent-config/expected-runtime-contract.json
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
scripts/check-codex-agents.mjsまたは fixture 変更が必要で、TOML-only 修正後の残存 failure を PR 本文で説明できない場合- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
scripts/check-codex-agents.mjsの failure が current blocker 以外に広がる場合は停止して切り出す
Required Skills
- TOML
- JavaScript / Node.js
- JSON
Runtime Verification Applicability
decision: not_applicable
reason: "この Issue は `.codex/agents/*.toml` の静的 contract wording と validator 通過条件を扱う。live spawn 実証や runtime override の実効性検証は #601 など別スコープで扱う"Notes for Reviewer
- 最小実装は
.codex/agents/issue-author.tomlと.codex/agents/issue-reviewer.tomlのOUTPUT_CONTRACT追記であること scripts/check-codex-agents.mjsは validator を弱めるために変更しないこと。変更する場合は TOML-only 修正後にも残る failure の before/after を PR 本文に記録することtests/fixtures/codex-agent-config/expected-runtime-contract.jsonは原則不変であり、diff が出た時点で schema 拡張化していないか再確認すること.codex/skills/、.agents/skills/**、.claude/skills/**、runtime hook / permission policy へ波及させないこと
Delivery Rule
- 1 Issue = 1 PR
- worktree 指定で実装する
- Draft PR 既定
Scope Delta
- 追加: 必須語彙を
OUTPUT_CONTRACT/CONTEXT_POLICY相当節の意味ある出力契約として記載する制約 - 追加: TOML-only first の実装方針と、checker / fixture 変更時の before/after 記録要件
- 削除:
.agents/skills/**/.claude/skills/**に波及する thin-bridge scope
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity
[-]実装: Codex custom subagent 定義を thin runtime contract 化し不要コンテキストを lint で禁止する[/-][+]実装: .codex/agents の check-codex-agents.mjs 既存 failure を解消する[/+]squne121 commentedon Jun 12, 2026
実装: .codex/agents の check-codex-agents.mjs 既存 failure を解消するに更新.codex/agents/issue-author.toml/.codex/agents/issue-reviewer.toml/scripts/check-codex-agents.mjs/tests/fixtures/codex-agent-config/**に収束check_vc_scope.py: PASSguard-issue-body.py: PASSissue_contract_hygiene_autofix.py: exit 2 (unsafe / scope whitelist 外)contract_readiness_check.py --mode static: status=gortk pnpm exec node scripts/check-codex-agents.mjs: 10 failures 再現済みsqune121 commentedon Jun 12, 2026
判定: REQUEST_CHANGES
#780 は「2つの agent TOML に validator が要求する文言を追加して、既存 10 failure を消す」という方向性自体は妥当です。ただし、現状の Issue 契約は “意味のある runtime contract 改善” ではなく “magic word をどこかに貼るだけ” でも通る 形になっています。実装前に Issue 本文を少し締めるべきです。
#780 の baseline では
check-codex-agents.mjsの 10 failures は再現済みで、対象 scope も.codex/agents/issue-author.toml/issue-reviewer.toml/scripts/check-codex-agents.mjs/ fixtures に絞られています。 ただし現在の validator は各 TOML のdeveloper_instructionsに対してstructured output/context budget/raw transcript/raw diff/raw logsなどの 単純 substring を要求しているだけです。ブロッカー
1. AC1/AC2 が「意味」ではなく「文字列出現」しか見ていない
現行の
issue-author.tomlはすでに compact output、2048 bytes 制限、raw body/diff/logs を artifact に保存する方針を持っています。issue-reviewer.tomlも同様に compact result、2048 bytes 制限、raw review/body/diff/logs の artifact 保存を持っています。つまり実害は「設計がない」ではなく、validator の要求語彙と TOML の語彙がズレていることです。ここで単に
structured output context budget raw transcript raw diff raw logsを末尾に貼ると、将来の reader / agent には何も改善されません。修正要求: AC に次を追加してください。
2.
scripts/check-codex-agents.mjsを変更対象に含めるのは危険#780 の目的なら、第一候補は 2 TOML だけの修正です。現在の
check-codex-agents.mjsはすでにstructured output、context budget、raw transcript、raw diff、raw logsを要求しています。 ここを変えると、既存 failure を「直す」のではなく「validator を弱める」実装になり得ます。また #776 は #783 との ordered overlap を明記しており、共有 path は
scripts/check-codex-agents.mjsです。 #783 は PreToolUse guard の reason 分類や active handler inventory を扱っており、同じファイルへの不用意な編集は regression リスクが高いです。修正要求: AC に次を追加してください。
3. fixtures 変更は原則不要
expected-runtime-contract.jsonのrequired_instruction_tokensはROLE/INPUT_CONTRACT/OUTPUT_CONTRACT/EXECUTION_POLICY/RUNTIME/FAIL_CLOSED/Known limitationだけです。 #780 の5語はcheck-codex-agents.mjs側の追加 guard であり、fixture の runtime contract にはまだ入っていません。したがって fixtures を変更すると、#780 の「既存 failure 解消」から「contract schema の拡張」に見えます。実装 PR では fixture diff が出た時点でかなり疑うべきです。
4. runtime 実効性の証明に広げてはいけない
OpenAI Codex の custom agents は
.codex/agents/に TOML として置け、name/description/developer_instructionsが必須で、modelやmodel_reasoning_effortなどは optional です。([OpenAI Developer]1) ただし subagent は明示依頼時に spawn され、単一 agent より token / latency / resource cost が増えます。([OpenAI Developer]1) さらに子 agent spawn 時には親ターンの runtime override が再適用され得るため、TOML の静的値だけでは live runtime の実効性を証明できません。([OpenAI Developer]1)この live spawn 実証は #601 に残っています。 #780 は静的 contract の failure 修正に閉じるべきで、モデル実効性・spawn 実測・runtime override 証明を混ぜるべきではありません。
5. skill surface / 配布物設計に波及させない
Codex の repo skill discovery surface は
.agents/skillsです。([OpenAI Developer]2) Codex skills は workflow 用の authoring format で、再利用配布単位としては plugin が説明されています。([OpenAI Developer]2) #776 / #779 でも、Codex repo-shared skill entrypoint は.agents/skills/*/SKILL.md、Claude project skill は.claude/skills/*/SKILL.mdという方針に寄っています。したがって #780 で
.codex/skillsを導入したり、.agents/skillsの本文をいじったりするのは scope violation です。#780 は.codex/agents/*.tomlの thin runtime contract 文言修正に留めるべきです。推奨する最小修正
issue-author.tomlとissue-reviewer.tomlのOUTPUT_CONTRACT付近に、次のような行を入れるのが最小です。issue-authorならISSUE_AUTHOR_RESULT_COMPACT_V1、issue-reviewerならISSUE_REVIEW_RESULT_COMPACT_V1に合わせて少しだけ言い換えれば十分です。既存の artifact 保存方針と矛盾しません。#780 の Issue 本文に追加すべき文言
実装レビュー時の見るべき差分
合格ラインは次です。
git diff -- .codex/agents/issue-author.toml .codex/agents/issue-reviewer.toml rtk pnpm exec node scripts/check-codex-agents.mjs git diff --exit-code -- scripts/check-codex-agents.mjs tests/fixtures/codex-agent-config/expected-runtime-contract.json#787/#789 で、
rg -Fの部分一致や「成果物ではない対象を検証する VC」が実際に問題化しています。 #780 でもrgは smoke としてはよいですが、最終判断はcheck-codex-agents.mjsの通過と、差分が TOML-only に収まっているかで見るべきです。結論
#780 は実装してよいですが、現状のままでは validator を通すための語彙貼り付け Issue です。Issue 本文に「どの節に、どの意味で、どこまで変更してよいか」を追加してから実装させるのが安全です。最小実装は 2 TOML の
OUTPUT_CONTRACT追記だけで足ります。squne121 commentedon Jun 13, 2026
更新内容
developer_instructionsのOUTPUT_CONTRACT/CONTEXT_POLICY相当の節に line-level contract として置く前提に締めました。.codex/agents/issue-author.toml/.codex/agents/issue-reviewer.tomlのみでcheck-codex-agents.mjsを通す形にし、scripts/fixtures fallback は before/after 証跡付きに限定しました。.codex/skills//.agents/skills/**/.claude/skills/**/ runtime hook / permission policy を変更しない境界を明記しました。## Runtime Verification Applicabilityをnot_applicableで追加しました。検証
check_vc_scope.py: PASSguard-issue-body.py: PASSissue_contract_hygiene_autofix.py: no_changecontract_readiness_check.py --mode static: gosqune121 commentedon Jun 13, 2026
Refinement Loop: Approved
The issue has been approved and is ready for implementation.
approvedsqune121 commentedon Jun 13, 2026
CodexCLI作業ログ
squne121 commentedon Jun 13, 2026
Contract Review Result
fix: align codex agent output contract wording (#780) (#834)
squne121 commentedon Jun 13, 2026
Closed as completed.
Implemented by merged PR #834. The PR satisfies AC1-AC6 for #780, and the current main branch contains the required OUTPUT_CONTRACT wording in both
.codex/agents/issue-author.tomland.codex/agents/issue-reviewer.toml.