Repository navigation
Open
Labels
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: research
parent_issue: "none"
goal_ref: "実行ホスト環境へ publish guard を注入できる sanctioned executor を復旧し、#1671 / PR #1685 の live runtime trust 証跡を偽装不能な経路で取得可能にする"
change_kind: research-onlyParent Issue
none(単独改善)
Outcome
sanctioned executor の実行ホスト・注入境界・証跡 schema・権限モデルを current runtime で確認し、偽装可能な environment/payload を PASS 根拠にしない implementation Issue を起票できる状態。
In Scope
- 実行ホストで publish guard を注入できる sanctioned executor の有無、呼出し権限、入力/出力 schema、artifact 保存先を read-only で確認する。
- Codex 子 agent が親 session の runtime override を継承する挙動と、custom agent TOML/payload/environment の自己申告が effective permission/hook trust の証明にならない境界を記録する。
- trusted host provenance を持つ executor が存在する場合は、再現可能な implementation Issue の Allowed Paths、AC、VC、host artifact binding を設計する。存在しない場合は復旧 owner と必要な host-side operation を具体化する。
Out of Scope
- 実装: Codex native scope-rollup-runner を追加し SubagentStop capture を接続する #1671 / PR feat(codex): scope-rollup-runner native agentを追加 (#1671) #1685 のコードまたは本文の直接変更。
- 未承認の user/global runtime 設定変更、権限昇格、publish guard の無効化。
- fixture、環境変数、payload 内 provenance、偽装可能な
codex --version出力を live trust の PASS 根拠にすること。
Acceptance Criteria
- AC1: sanctioned executor の host provenance(実行元、権限境界、publish guard 注入可否、artifact path)が一次証跡で記録される。
- AC2: environment/payload/TOML の自己申告だけでは effective permission profile・hook trust・nested delegation disable を PASS 判定できないことが検証される。
- AC3: 実装可能な場合は後続 implementation Issue を起票し、不可の場合は host-side recovery operation と担当境界を本 Issue に記録する。
Verification Commands
# AC1
$ codex --version
# AC2
$ rg -n "parent turn's live runtime overrides" /tmp/openai-docs-cache/codex-manual.md
# AC3
$ gh issue list --repo squne121/loop-protocol --state open --search "sanctioned executor"Allowed Paths
- 読み取り専用。リポジトリ変更なし(実行ホストと Issue/PR metadata の readback に限定)
Stop Conditions
- Outcome / Scope / AC が検索可能な形で記載されていない場合は即停止
- Allowed Paths 外への書き込みを試みた場合は即停止
- 権限不足(permission denied)により操作が完了できない場合は即停止
- 成果物の書き込みに失敗した場合(I/O エラー等)は即停止
- host-side executor の復旧に未承認の権限昇格または user/global runtime 設定変更が必要になった場合は即停止
Handoff Contract
- Current Objective: publish guard を実行ホストへ注入する sanctioned executor の復旧可能性を確定する。
- Bounded Current Context: 実装: Codex native scope-rollup-runner を追加し SubagentStop capture を接続する #1671 / PR feat(codex): scope-rollup-runner native agentを追加 (#1671) #1685 は live runtime trust が
not_provenで、static/fixture/CI の PASS は live trust に昇格できない。 - Open Questions: trusted host provenance を出力できる executor の名称、権限、artifact binding、復旧 owner。
- Next Action: AC1–AC3 を満たす implementation Issue を起票するか、host-side recovery operation を routing する。
- Artifact Refs: 実装: Codex native scope-rollup-runner を追加し SubagentStop capture を接続する #1671、PR feat(codex): scope-rollup-runner native agentを追加 (#1671) #1685、実装: Codex native named-spawn/runtime trust evidence follow-up #1686、Codex manual の Subagents runtime override 記述。
Notes for Reviewer
- 起票前の OPEN Issue 検索では
sanctioned executor publish guard host runtimeに一致する canonical Issue はなかった。 - 実装: impl-review-loop preparation から scope rollup preflight(Step 2.5)を除去し、issue-refinement-loop の判定を再実行しない #1676 は C1 の migration decision を専有する。本調査は scope-rollup runner の削除・移設・置換を提案しない。
Activity
squne121 commentedon Jul 24, 2026
確認結果
確認時点は 2026年7月25日(JST) です。
Issue #1703 は OPEN の research Issue で、リポジトリ変更は明示的に Out of Scope、コメントもまだありません。したがって、#1703 自体を実装PRで直接
Closesするより、まずホスト側の一次証跡を記録して AC1〜AC3 を満たし、その結果に基づく implementation Issue を別途実行する構成が適切です。依存先の PR #1685 は、確認時点の head が
8641cc2d193bd0a0678467289e0e5f7e7f8ed329で、ci、日本語チェック、hook integrity、session manifest、Pages deploy はすべて成功しています。Allowed Paths の問題や通常のコード・CI blocker は解消済みです。最新レビューの実質的な blocker は live runtime trust がnot_provenのままであることだけで、fixture・E2E・CI の成功は live named-spawn/hook trust の代替として認められていません。既存の担当先 #1686 は既に CLOSED /
not_plannedです。一方、#1688 は「existing-branch publish guard の実行ホスト context 注入」を扱う OPEN implementation Issue で、codex-hook-adapter.mjs、git_mutation_command_policy.py、subprocess tests、docs という変更範囲が #1703 と直接重なります。ただし、#1688 の現在の契約は fixture/subprocess 検証に限定されており、それだけでは PR #1685 が要求する live host provenance を満たしません。原則として #1688 を改訂・再利用し、host-owned receipt/managed executor 側だけを別 Issue に分割する必要がある場合に限って新規 Issue を作るのが重複の少ない進め方です。#1676 は scope-rollup capability の削除・移設・保持に関する C1 migration decision を専有しています。今回の対応では、#1676 の判断を回避して capability を削除・置換してはいけません。明示的な反対根拠がない場合は、最も非破壊的な retain を暫定判断として記録し、#1685 の runtime trust 修復を先に進めるのが安全です。
コード上も #1703 の問題設定は妥当です。publish context は現在
LOOP_PUBLISH_*のプロセス環境から読み込まれますが、Codex adapter は terminal command のenv VAR=...prefix を除去して分類し、policy subprocess は hook 実行ホスト側の環境を継承します。このため、terminal 側の自己申告で trusted host context を注入することはできず、host-owned executor または managed hook が必要です。現在の
mainは5d659231ed34036d3b4cc80277d6ef6c4bc16018です。Claude 側では PR #1691 によりlocal_main_branch_guardとworktree_scope_guardが一時的に外されていますが、Codex 側の.codex/hooks.jsonでは両 guard と session-recording adapter が引き続き有効です。そのため、実装やGitHub操作を Claude Code が統括することはできますが、live trust の証明だけは実際の Codex CLI runtime で取得する必要があります。OpenAI の現行仕様でも、Codex subagent は親ターンの sandbox、permission mode、セッション中の runtime override を継承します。custom agent TOML の宣言だけでは実効状態を証明できません。また、project hook は現在の定義ハッシュごとに trust が必要で、managed hook は system・MDM・cloud・
requirements.toml由来の policy-trusted source として扱われます。--yoloや--dangerously-bypass-hook-trustを使った実行は、今回必要な trust 証明をむしろ無効化します。([OpenAI Developers]1) ([OpenAI Developers]2)実行用プロンプト
Codex CLI への投入を推奨します。 Claude Code に投入する場合も、live runtime verification の工程では、実際の Codex CLI とその host hook/executor を起動させてください。
────────────────────────────────────
3. Issue #1703 の research AC1〜AC3
────────────────────────────────────
リポジトリ変更前に、#1703 の read-only 調査を完了する。
3.1 sanctioned executor / host trust source の探索
実行中の Codex host について、秘密情報を読まずに次を確認する。
実際に起動された Codex executable の host-resolved realpath、ファイルdigest、version
active config layers と各 source の種別
active hook sources、hook definition hash、trust status
managed hook または managed launcher の有無
project hook が trust済みである場合、その trust scope と hash
effective permission mode
effective sandbox policy
parent turn の runtime override
named subagent の agent type、agent id、turn id
child が親 runtime override を継承したこと
nested delegation が実効的に無効であること
host-only artifact root または host-only file descriptor/capability の有無
agent/workspace から同じ証跡を偽造できない理由
executor の入力schema、出力schema、artifact path、所有者、mode、lifecycle
codex --versionは inventory として記録してよいが、単独では PASS に使わない。3.2 live probe
可能なら実際の Codex named subagent を一度起動し、以下を満たす無害な live probe を実行する。
3.3 research outcome の公開
調査結果を #1703 に、controlled issue comment/body-update laneを優先して公開する。
最低限、次の形式を含める。
#1703 の AC1〜AC3 をチェック可能な形で本文またはコメントに記録する。
────────────────────────────────────
4. 実装Issueの重複判定
────────────────────────────────────
#1688 を最初の canonical implementation candidate とする。ただし機械的に新規Issueを作らない。
次の順序で決定する。
A. #1688 が未着手で、既存branch publish context consumerとhost provenance producerを同一の正確な契約で扱える場合:
Closes #1688とする。B. host-managed producer がリポジトリ外の管理対象であり、#1688 の repo-side consumer と同一Issueに含めると契約が虚偽または過大になる場合:
最大2つの非重複 implementation Issue に分割する。
dependency orderと各成果物を明記する。
それぞれ 1 Issue = 1 PR とし、順番に完遂する。
新規IssueのPRには
Closes #<new issue>、#1688のPRにはCloses #1688を含める。C. trusted host producer の作成・復旧が現在の権限では不可能な場合:
not_provenのままと明示し、偽装証跡で解除しない。Allowed Paths が不足する場合は、実装前に controlled Issue update で正確なパスを追加する。Allowed Paths 外を黙って変更しない。
────────────────────────────────────
5. 実装設計の必須条件
────────────────────────────────────
実装可能な場合は、次の境界を満たす。
5.1 trust source
LOOP_PUBLISH_*env prefixをtrust sourceにしない。5.2 transaction boundary
existing-branch publish は可能な限り次の単一transactionとして実装する。
初回branch create laneと同様にexecutor自身が push を完了した場合、hookを発火させた元コマンドは抑止し、二重pushを防ぐ。
pass-through方式を残す場合は、allow返却とshell実行の間のTOCTOU、nonce再利用、二重実行、postcondition欠落を解消したことをテストで証明する。証明できなければtransaction方式を採る。
5.3 保持する拒否境界
以下は引き続きfail-closedで拒否する。
git push--all5.4 host receipt
必要なら次に相当するclosed-key schemaを導入する。
要件:
────────────────────────────────────
6. テストとlive verification
────────────────────────────────────
最低限、以下を実行する。
uv run --locked pytest scripts/agent-guards/tests/test_git_mutation_command_policy.py -q uv run --locked pytest tests/session_recording/codex/test_hook_adapter.py -q pnpm typecheck pnpm lint pnpm test pnpm build git diff --check追加したexecutor、receipt、materializer、managed-hook adapterには専用testを追加する。
必須negative matrix:
env VAR=...imitationpositive matrix:
fixture/subprocess testの成功と、実Codex hostのlive PASSを別々に記録する。
PR #1685 の blockerを解消するためのlive evidenceは、必ずその時点のcurrent PR headに束縛する。
SKIP、not_proven、fixture-only、別headのPASSは成功扱いしない。────────────────────────────────────
7. 実装PRの作成と完遂
────────────────────────────────────
dedicated issue worktreeを作る。
current origin/mainをbaseにする。
既存のcontrolled stage/commit executorを使用する。
protected pathsを変更しない。
commitは意味のある単位に分ける。
branch publishにはcanonical exact refspecを使用する。
Draft PRを作成する。
PR本文に必ず次を含める。
[x]とcurrent-head evidenceCloses #<implementation issue number>Refs #1703 #1671 #1676Refs PR #1685PR headに対するCIを完走させる。
失敗したcheckはログを調査し、scope内で修正し、再pushする。
unrelated failureと判断して放置せず、再現、base比較、必要なら別Issue化まで行う。
impl-review-loop / pr-review-judge等のリポジトリ標準レビューを実行する。
すべてのreview comment、REQUEST_CHANGES、inline threadに対応する。
headが変わるたびにAllowed Paths、CI、runtime evidence、reviewを再拘束する。
merge-readyになったら通常の非破壊的なrepository-approved merge方式でマージする。
force push、履歴書換え、branch/tag削除はしない。
Closes #NによりIssueが実際にcloseされたことをreadbackする。自動closeされなければ最終証跡コメントを投稿して通常のIssue closeを行う。────────────────────────────────────
8. PR #1685 の blocker 解消
────────────────────────────────────
implementation PRのマージ後、PR #1685を再取得する。
PR feat(codex): scope-rollup-runner native agentを追加 (#1671) #1685 branchへ必要なmain変更をrepository-approvedな非破壊的方法で取り込む。
rebase/force pushは使わない。
current 実装: Codex native scope-rollup-runner を追加し SubagentStop capture を接続する #1671 contract snapshotを再取得する。
current PR feat(codex): scope-rollup-runner native agentを追加 (#1671) #1685 headに対してlive named-spawn/hook trust probeを再実行する。
次の項目がすべてhost-owned provenanceでPASSであることを確認する。
PR #1685本文をcurrent snapshot、current head、current CI、current changed files、live artifactへ更新する。
#1686が既にclosedでcanonical ownerでない場合は、#1688または新しいhost implementation Issueへの参照に更新する。
fresh TEST_VERDICT_MACHINEとLOOP_VERDICTをcurrent headに対して発行する。
reviewを再実行し、
not_proven/SKIPblockerが消えるまで修正する。#1676のC1 decisionを最新状態で確認する。明示的な反対根拠がなければ、capabilityを削除・置換せず
retainを非破壊的な暫定decisionとして#1676に記録する。PR #1685をreadyにし、全required checksとreview gateが満たされたらマージする。
PR本文の
Closes #1671を維持し、マージ後に #1671がcloseされたことをreadbackする。GitHubが別principalによるformal approvalを必須とし、リポジトリの自動review laneでは満たせない場合のみ、後述の「権限不足」に該当する。
────────────────────────────────────
9. Issue #1703 の完了
────────────────────────────────────
#1703をcloseする前に次を確認する。
AC1: executorの実行元、権限境界、guard注入可否、artifact pathが一次証跡付きで記録済み
AC2: env/payload/TOML/self-reported versionだけではPASSにできないnegative evidenceが記録済み
AC3:
#1688または分割したimplementation Issueの最終状態が記録済み
PR feat(codex): scope-rollup-runner native agentを追加 (#1671) #1685 / #1671への影響が記録済み
#1676のC1関係が記録済み
fixtureとlive evidenceが混同されていない
最終コメントを投稿し、AC1〜AC3をチェックしたうえで #1703をcloseする。
#1686は必要がない限りreopenせず、canonical successorを示すsuperseded noteだけを追加する。
────────────────────────────────────
10. 停止条件
────────────────────────────────────
停止条件は次の4種類だけとする。該当しない問題では停止・質問・承認待ちをしない。
破壊的操作
通常のcommit、branch作成、canonical push、Issue/PR編集、通常merge、Issue closeは破壊的操作に含めない。
秘密情報
外部課金
権限不足
停止する場合も、それまでに可能なread-only調査、Issueへの証跡記録、テスト、PR作成、CI修正は完了させる。
────────────────────────────────────
11. 最終報告
────────────────────────────────────
最後に次の形式で報告する。
stop_conditionは4種類の停止条件に該当しない限り null とする。