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: none
goal_ref: "Codex の3つの repo-local 権限プロファイルが standalone package の release 実行ファイルを read-only で参照できるようにする"
change_kind: workflowParent Issue
なし(単独改善)
Parent Goal Ref
- Goal: WSL2 の standalone Codex 実行時に、必要な package 実体への read-only アクセスを各 repo-local 権限プロファイルで明示する。
- Desired Destination:
.codex/config.tomlの3プロファイルに~/.codex/packages/standalone/releasesへの最小 read-only 許可を追加し、sandbox 内から既存の standalone バイナリを実行できる状態にする。
Current Validated Scope
.codex/config.tomlのloop-protocol-rtk、loop-protocol-readonly、loop-protocol-bootstrapfilesystem profile
Remaining Parent Gaps
docs/dev/agent-runtime-ops.mdに記載されている/usr/local/bin/codexコピー方式のワークアラウンドと、本 Issue の read 許可拡張との関係整理は本 Issue のスコープ外。follow-up: 実装: docs/dev/agent-runtime-ops.md の standalone 実行時ワークアラウンド記述を permission profile 方式と整合させる #1499(docs/dev/agent-runtime-ops.md との整合)を起票済み。マージ前に 実装: docs/dev/agent-runtime-ops.md の standalone 実行時ワークアラウンド記述を permission profile 方式と整合させる #1499 の内容を確認し、本 Issue および関連 PR (実装: Codex standalone package の read-only 参照を許可する #1495) から参照する。
Outcome
.codex/config.toml の3つの repo-local 権限プロファイルが ~/.codex/packages/standalone を read-only で参照でき、設定差分が main へマージ可能な PR として検証済みの状態。
In Scope
- 各 filesystem profile の
:minimal許可と同じ階層に~/.codex/packages/standalone/releases = readを追加する(~/.codex/packages/standalone全体ではなくreleases配下に narrow化する)。 - プロファイルごとの追加を、baseline(origin/main)との semantic diff(追加キー以外に差分がないことの検証)で確認する。
- 正しい codex sandbox の構文(サブコマンド sandbox、-P でプロファイル指定、-C で作業ディレクトリ指定、-- の後に実行コマンド)を用いた実機検証で、read-only mount 上の既存 standalone バイナリが3プロファイル全てで実行できることを確認する。
Out of Scope
approval_policy、network domain、workspace write 権限、[agents] max_depthの変更。- standalone package 配下への write 権限、および read-only mount 外のファイルシステムへの新規 execute 権限の追加。
.codex/hooks.json、.codex/rules/、system-wide Codex インストールの変更。~/.local/bin/codexの symlink chain 経由(PATH 経由)起動の対応。:minimalプリセットに~/.local/binが含まれないため、この起動経路は本 Issue の修正では解決しない別問題として扱う。
Threat Model Correction(脅威モデルの訂正)
Codex の read 権限は、ホストファイルの作成・変更・削除を禁止するものであり、read-only mount 上に既に存在する実行ファイルの実行までは禁止しない。bwrap --ro-bind で直接バインドされた standalone バイナリは、read-only mount 上でも正常に実行できることを実機検証済み(codex 0.144.1 / WSL2 / bwrap 環境)。本変更は、Codex 本体および同一 readable root 内の helper binary をサンドボックス内から実行可能にする能力拡張であり、単なる read 参照の追加という説明は不正確である。
Not controlled(本変更が保証しない範囲)
- standalone package 配下に配置された既存バイナリの実行そのもの
- package のインストール時・更新時の完全性(署名検証・改ざん検知)
- 過去バージョンの release directory に残存する実行ファイルの取り扱い
~/.local/bin/codex経由の symlink chain 実行(:minimalプリセットに~/.local/binが含まれず、本修正の対象外。別途未解決)- user-global config や CLI オプションによる profile override
Acceptance Criteria
- AC1:
loop-protocol-rtkprofile は~/.codex/packages/standalone/releasesにのみreadを追加し、それ以外の filesystem 設定を変更しない(baseline との semantic diff で検証する)。 - AC2:
loop-protocol-readonlyprofile は~/.codex/packages/standalone/releasesにのみreadを追加し、それ以外の filesystem 設定を変更しない(baseline との semantic diff で検証する)。 - AC3:
loop-protocol-bootstrapprofile は~/.codex/packages/standalone/releasesにのみreadを追加し、それ以外の filesystem 設定を変更しない(baseline との semantic diff で検証する)。 - AC4: baseline(origin/main)と head の
.codex/config.tomlの差分は、3プロファイルへの同一キー(~/.codex/packages/standalone/releases = read)追加のみであり、approval_policy/ network /[agents]等の他設定は一切変更されない。 - AC5: 正しい codex sandbox 構文を用いた実機検証で、3プロファイル全てにおいて read-only mount 上の standalone バイナリが実行できる。
Verification Commands
# AC1
# preflight-scope: pr_review_only
$ uv run python3 -c 'print("AC1 OK") if ((tomllib := __import__("tomllib")) and (subprocess := __import__("subprocess")) and (base := tomllib.loads(subprocess.run(["git", "show", "origin/main:.codex/config.toml"], capture_output=True, text=True, check=True).stdout)) and (head := tomllib.load(open(".codex/config.toml", "rb"))) and ({k: v for k, v in head["permissions"]["loop-protocol-rtk"]["filesystem"].items() if base["permissions"]["loop-protocol-rtk"]["filesystem"].get(k) != v} == {"~/.codex/packages/standalone/releases": "read"})) else exit(1)'
# AC2
# preflight-scope: pr_review_only
$ uv run python3 -c 'print("AC2 OK") if ((tomllib := __import__("tomllib")) and (subprocess := __import__("subprocess")) and (base := tomllib.loads(subprocess.run(["git", "show", "origin/main:.codex/config.toml"], capture_output=True, text=True, check=True).stdout)) and (head := tomllib.load(open(".codex/config.toml", "rb"))) and ({k: v for k, v in head["permissions"]["loop-protocol-readonly"]["filesystem"].items() if base["permissions"]["loop-protocol-readonly"]["filesystem"].get(k) != v} == {"~/.codex/packages/standalone/releases": "read"})) else exit(1)'
# AC3
# preflight-scope: pr_review_only
$ uv run python3 -c 'print("AC3 OK") if ((tomllib := __import__("tomllib")) and (subprocess := __import__("subprocess")) and (base := tomllib.loads(subprocess.run(["git", "show", "origin/main:.codex/config.toml"], capture_output=True, text=True, check=True).stdout)) and (head := tomllib.load(open(".codex/config.toml", "rb"))) and ({k: v for k, v in head["permissions"]["loop-protocol-bootstrap"]["filesystem"].items() if base["permissions"]["loop-protocol-bootstrap"]["filesystem"].get(k) != v} == {"~/.codex/packages/standalone/releases": "read"})) else exit(1)'
# AC4
# preflight-scope: pr_review_only
$ uv run python3 -c 'print("AC4 OK") if ((tomllib := __import__("tomllib")) and (subprocess := __import__("subprocess")) and (base := tomllib.loads(subprocess.run(["git", "show", "origin/main:.codex/config.toml"], capture_output=True, text=True, check=True).stdout)) and (head := tomllib.load(open(".codex/config.toml", "rb"))) and (profiles := ("loop-protocol-rtk", "loop-protocol-readonly", "loop-protocol-bootstrap")) and (head == {**base, "permissions": {**base["permissions"], **{p: {**base["permissions"][p], "filesystem": {**base["permissions"][p]["filesystem"], "~/.codex/packages/standalone/releases": "read"}} for p in profiles}}})) else exit(1)'
# AC5
# runtime-verification
# preflight-scope: pr_review_only
$ uv run python3 -c 'print("SKIP: codex CLI not installed in this environment", file=__import__("sys").stderr) if not (codex_path := __import__("shutil").which("codex")) else (print("SKIP: unexpected Codex installation path " + target, file=__import__("sys").stderr) if not (target := __import__("os").path.realpath(codex_path)).startswith(__import__("os").path.expanduser("~/.codex/packages/standalone/releases")) else [__import__("subprocess").run(["codex", "sandbox", "-P", p, "-C", ".", "--", target, "--version"], check=True) for p in ("loop-protocol-rtk", "loop-protocol-readonly", "loop-protocol-bootstrap")])'Allowed Paths
.codex/config.toml
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- read-only 以外の standalone package 権限が必要と判明した場合
Required Skills
なし
Required Design References
docs/dev/agent-runtime-ops.md#WSL2 / standalone install の self-binary ENOENT 復旧docs/dev/agent-skill-boundaries.md#Parallel Agent Runtime Safety
Runtime Verification Applicability
decision: immediate
applicable_acs: [AC5]
execution_environment: WSL2 + bwrap sandbox (codex sandbox CLI), codex 0.144.1 standalone install
skip_conditions: codex CLI not found in PATH, or resolved binary is not under ~/.codex/packages/standalone/releases (exit 77)
fallback_policy: no fallback PASS is accepted. Any exit code other than 0 (pass) or 77 (SKIP) is treated as a fail
artifact_requirements: PR must attach the codex sandbox stdout and exit code for all 3 profiles as evidence
reason: 静的な TOML semantic diff(AC1-AC4)だけでは sandbox 内での実際の実行可否を保証できないため、AC5 として codex sandbox を用いた実機検証を要求する。誤った CLI 構文(存在しない codex sandbox linux サブコマンド)による過去の検証失敗を踏まえ、正しい構文を明記する。- if immediate: AC5 に runtime-verification タグを付与済み。VC は codex CLI 未導入、または standalone releases バイナリ以外の installation path の環境では SKIP exit 77 を返す fallback を含む。3プロファイル分の codex sandbox 実行結果(成功ログまたは baseline との比較)を PR に証跡として添付する。
Scope Delta
N/A
Delivery Rule
1 Issue = 1 PR- worktree:
.claude/worktrees/issue-1486-codex-standalone-read - Draft PR を既定とする。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity
squne121 commentedon Jul 12, 2026
Contract Review Result
squne121 commentedon Jul 12, 2026
impl-review-loop: open-pr hard gate による停止
E_OVERLAP_PREFLIGHT_DRIFT--limit 500で収集したため、complete: true・saturated: false・decision_inputs_sha256: sha256:e6f6f0d17049350a493e8fe3a34b4d1a93d788469822ce3996c3702f67f2cce3。open_pr.pyが既定の--limit 100で再収集し、saturated: true・decision_inputs_sha256: sha256:d995e580b5f20ee6fa305834e54e78b419b3c6d1cc8894550e08126818e0e2a4となり、同一 collection chain を証明できません。worktree-issue-1486-codex-standalone-package-read-only5d1fe030304f64b728a8da285c38c6cb54867beegh pr createを実行していません)。squne121 commentedon Jul 13, 2026
implement-issue: 実装完了 (2026-07-13T14:21:00Z)
.claude/worktrees/issue-1486-codex-standalone-readworktree-issue-1486-codex-standalone-readrg3件 +tomllib静的検証)proceed(衝突候補なし、全152件 OPEN implementation issue collection complete)squne121 commentedon Jul 13, 2026
Contract Review Result
fix: narrow codex standalone read scope to releases only (#1486)
squne121 commentedon Jul 13, 2026
implement-issue: fix_delta 対応完了 (2026-07-14)
人間レビュアーの REQUEST_CHANGES(PR #1495 (comment))を受けた fresh contract に追従し、以下を実施した。
.codex/config.tomlの3プロファイル(loop-protocol-rtk/loop-protocol-readonly/loop-protocol-bootstrap)の filesystem 許可を"~/.codex/packages/standalone" = "read"から"~/.codex/packages/standalone/releases" = "read"へ narrow 化(commitd13c6423)。AC1-AC4: baseline(origin/main) との tomllib semantic diff で PASS(3プロファイルとも差分は
releasesキー追加のみ)。AC5:
codex sandbox -P <profile> -C <dir> -- <command>で3プロファイル全て実機検証 PASS(codex-cli 0.144.1、exit 0)。narrowed scope でも成功を確認。PR 本文の脅威モデル記述・Safety Claim Matrix・Runtime Verification Applicability(
immediate)を訂正し、follow-up 実装: docs/dev/agent-runtime-ops.md の standalone 実行時ワークアラウンド記述を permission profile 方式と整合させる #1499 への参照を追加。PR: 実装: Codex standalone package の read-only 参照を許可する #1495
Worktree:
.claude/worktrees/issue-1486-codex-standalone-readBranch:
worktree-issue-1486-codex-standalone-readHead SHA:
d13c64236ea36bbc7d31ac9da6a80b0e6beb3fe7後続: PR レビュー(再レビュー依頼済み)→ マージ → post-merge-cleanup
実装: Codex standalone package の read-only 参照を許可する (#1495)