Repository navigation
Closed
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "Codex が LOOP_PROTOCOL で `.claude/settings.json` の単純移植ではなく、rtk 前提の stricter project-local guardrail を repo から読めるようにする"
change_kind: workflowParent Issue
none
Parent Goal Ref
- Goal: Codex が
.claude/settings.jsonの意図を踏まえつつ、rtkに集約した stricter repo-local permission / execution policy を読めるようにする - Desired Destination:
.codex/config.toml/.codex/rules/default.rules/ repo ルートAGENTS.md/ 関連 SSOT に Codex 用の運用境界と trusted-project 前提が反映されている
Current Validated Scope
.codex/config.tomlに GitHub 最小 network allowlist を持つ project-local permission profile を追加する.codex/config.tomlに npm registry を含む bootstrap profile を分離追加する.codex/rules/default.rulesに documentedrtksubcommand allow と directpnpm/ mutatinggit/ directghforbid を追加する- repo ルート
AGENTS.mdに Codex の作業入口、CLAUDE.md読み順、保護領域を追加する docs/dev/directory-structure.mdとdocs/dev/github-ops.mdに Codex surface、trusted project 前提、sandbox_mode競合を追記する
Remaining Parent Gaps
なし
Outcome
.codex/config.toml、.codex/rules/default.rules、repo ルート AGENTS.md、関連 SSOT が追加・更新され、Codex が rtk 前提の stricter project-local guardrail と GitHub 最小 network profile を repo から読める状態。
In Scope
- Codex の project-local config / rules / AGENTS surface を追加・更新する
assets/とLICENSES/を read-only / 非編集領域として Codex 側にも反映する- Codex の実行入口を
rtkに寄せつつ、allow 対象を documented subcommand に絞る - GitHub 操作に必要な network allowlist を default profile に含め、npm registry は bootstrap profile に分離する
- trusted project 前提、
sandbox_mode競合、CLAUDE.md読み順を docs に明記する
Out of Scope
~/.codex/config.tomlなど user-global 設定の変更- Codex のインストール方法そのものの変更
.claude/settings.json/.claude/settings.local.jsonの変更assets//LICENSES/の中身の編集
Acceptance Criteria
-
.codex/config.tomlにapproval_policy = "on-request"、default_permissions、workspace write、assets/LICENSESread-only、GitHub 最小 network allowlist を持つloop-protocol-rtkprofile が追加されている -
.codex/config.tomlに npm registry allow を分離したloop-protocol-bootstrapprofile が追加されている -
.codex/rules/default.rulesに documentedrtksubcommand allow と directpnpm/ directgh/ mutatinggitforbid が定義されている - repo ルート
AGENTS.mdにCLAUDE.md読み順、rtk経由実行、assets//LICENSES/非編集、read-only git inspection の方針が記載されている -
docs/dev/directory-structure.mdとdocs/dev/github-ops.mdから Codex の project-local config / rules surface、trusted project 前提、sandbox_mode競合方針を発見できる -
codex sandbox linux --permissions-profile loop-protocol-rtk -C . -- rtk gh issue list --repo squne121/loop-protocol --limit 1 --json number,titleとcodex sandbox linux --permissions-profile loop-protocol-rtk -C . -- rtk gh api repos/squne121/loop-protocolが成功し、GitHub network allowlist の実効性を確認できる
Verification Commands
# AC1
test -f .codex/config.toml && rg -n '^approval_policy = "on-request"$' .codex/config.toml && rg -n '^default_permissions = "loop-protocol-rtk"$' .codex/config.toml && rg -n '^\[permissions\.loop-protocol-rtk\.network\]$' .codex/config.toml && rg -n '^"api.github.com" = "allow"$' .codex/config.toml
# AC2
rg -n '^\[permissions\.loop-protocol-bootstrap\.network\.domains\]$' .codex/config.toml && rg -n '^"registry.npmjs.org" = "allow"$' .codex/config.toml && rg -n '^"\*\.npmjs.org" = "allow"$' .codex/config.toml
# AC3
test -f .codex/rules/default.rules && rg -n 'pattern = \["rtk", "--help"\]' .codex/rules/default.rules && rg -n 'pattern = \["rtk", \["git", "gh", "pnpm"\]\]' .codex/rules/default.rules && rg -n 'pattern = \["gh"\]' .codex/rules/default.rules && rg -n 'pattern = \["git", \["push", "commit", "checkout", "switch", "worktree", "stash", "merge", "rebase", "cherry-pick", "reset", "restore", "add", "rm", "mv", "clean", "apply", "am", "pull", "fetch", "remote", "tag", "config", "submodule"\]\]' .codex/rules/default.rules
# AC4
test -f AGENTS.md && rg -n '^- After this file, read `CLAUDE.md` and follow its read order\.' AGENTS.md && rg -n '^- Run project work through `rtk`\.$' AGENTS.md && rg -n '^- Treat this as a stricter Codex profile than `\.claude/settings\.json`, not a byte-for-byte translation\.$' AGENTS.md
# AC5
rg -n '^- `AGENTS.md`: Codex project-local の実行方針。$' docs/dev/directory-structure.md && rg -n '^- `\.codex/`: Codex project-local config / rules surface。$' docs/dev/directory-structure.md && rg -n '^### 有効化前提$' docs/dev/github-ops.md && rg -n '`sandbox_mode` が有効な場合' docs/dev/github-ops.md
# AC6
codex sandbox linux --permissions-profile loop-protocol-rtk -C . -- rtk gh issue list --repo squne121/loop-protocol --limit 1 --json number,title
codex sandbox linux --permissions-profile loop-protocol-rtk -C . -- rtk gh api repos/squne121/loop-protocolAllowed Paths
- .codex/config.toml
- .codex/rules/default.rules
- AGENTS.md
- docs/dev/directory-structure.md
- docs/dev/github-ops.md
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
なし
Scope Delta(任意)
N/A
Runtime Verification Applicability
decision: not_applicable
reason: product runtime の動作検証ではなく、Codex project-local permission / rules / docs surface の検証を行う
applicable_acs: []Delivery Rule
- 1 Issue = 1 PR
- Worktree:
.claude/worktrees/issue-343-codex-project-local-permissions - Branch:
worktree-issue-343-codex-project-local-permissions - Draft PR を既定とし、人間が最終マージ判断を行う
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Activity
squne121 commentedon May 24, 2026
Contract Snapshot (2026-05-24T03:00:00Z)
.codex/config.toml、.codex/rules/default.rules、repo ルートAGENTS.md、関連 SSOT が追加され、Codex が Claude 相当の project-local guardrail とrtk前提を repo から読める状態。.codex/config.tomlに project-local permission profile を追加する.codex/rules/default.rulesにrtkallow / directpnpm・mutatinggit・directghforbid を追加するAGENTS.mdに Codex の作業入口と保護領域を追加するdocs/dev/directory-structure.mdとdocs/dev/github-ops.mdから新規 surface を発見できる.codex/config.toml.codex/rules/default.rulesAGENTS.mddocs/dev/directory-structure.mddocs/dev/github-ops.md.claude/worktrees/issue-343-codex-project-local-permissionsworktree-issue-343-codex-project-local-permissionsCONTRACT_REVIEW_RESULT_V1:
status: go
generated_at: 2026-05-24T03:00:00Z
generated_by: main-thread-manual
issue_url: #343
checks:
template_compliance: pass
state_label: ok
allowed_paths_present: pass
vc_present: pass
stop_conditions_complete: pass
vc_preflight:
passed: true
vc_failed_as_expected: 4
vc_passed_unexpectedly: 0
vc_unrunnable: 0
ac_verifiability: pass
worktree_branch_collision: clear
next_action: implement_issue
blocked_reasons: []
warnings:
- triage-required ラベルは残っているが、依存 blocker はなく main thread で即時実装に進む
squne121 commentedon May 24, 2026
impl-review-loop: iteration 1 完了 (2026-05-24T03:00:00Z)
worktree-issue-343-codex-project-local-permissions8cf36f4codex execpolicy checkでrtk --help/git statusが allow、pnpm test/gh issue view 1が forbiddenpnpm typecheckPASSpnpm lintPASSpnpm testPASSpnpm buildPASSLOOP_STATE:
issue_number: 343
contract_snapshot_url: #343 (comment)
iteration: 0
max_iterations: 1
worktree: .claude/worktrees/issue-343-codex-project-local-permissions
branch: worktree-issue-343-codex-project-local-permissions
last_step: judgment
last_loop_verdict: APPROVE
blockers_history: []
external_research_skip_basis: "OpenAI 公式 Codex docs を参照して config/rules/AGENTS を実装"
termination_reason: approved
fix(#343): REQUEST_CHANGES iteration 1 — remove curl/env allow, docum…
squne121 commentedon May 24, 2026
impl-review-loop: iteration 1 完了 (2026-05-24T04:08:46Z)
PR #345 に REQUEST_CHANGES の対応を commit しました。
対応内容の要約
VC / AC 状況
AC6: 環境制約で未達成
次のステップ
AC6(network 実効確認)について以下の選択肢を提案:
PR 本文と comment に詳細なログを貼っています。
squne121 commentedon May 24, 2026
PR #345 を impl-review-loop iter1 で REQUEST_CHANGES 対応 (commit 97dd72e) 後、Ready for review に変更しました。AC6 (codex sandbox 経由の GitHub network 実効確認) は Codex 0.133.0 の sandbox bug で達成不可だったため human_escalation で loop を終了します。詳細は #345 (comment) 参照。
fix(#343): iter2 — add git status/diff rules, clarify rtk trust bound…
squne121 commentedon May 24, 2026
impl-review-loop iter2 完了 (2026-05-24T14:00:00Z)
reviewer の REQUEST_CHANGES 5-item fix list に対応完了。
対応内容
.codex/rules/default.rulesにgit status/git diffallow rule を追加 — AGENTS.md の read-only git inspection と rules の整合性を復元rtk ghtrust boundary をdocs/dev/github-ops.mdに明文化 — GitHub write 操作の安全性は rtk 実装に依存することを記録Verification Status
Repository health checks ✓
Policy checks ✓
rtk pnpm test→ allow ✓pnpm test→ forbidden ✓git status→ allow ✓git diff→ allow ✓rtk curl→ prompt ✓rtk env→ prompt ✓gh issue view→ forbidden ✓AC Status
Changed Files (Allowed Paths only)
.codex/rules/default.rules(git status/diff allow)docs/dev/github-ops.md(rtk trust boundary)Follow-up Issue
Next Steps
feat(codex): add project-local permissions and rtk rules (#345)
squne121 commentedon May 24, 2026
PR #345 が merge され AC1-AC5 達成。AC6 (codex sandbox 経由の GitHub network 実効確認) は Codex 0.133.0 の sandbox self-binary bind bug により本環境では達成不可と判定し、human 承認のもと deferred として follow-up Issue #350 で追跡する。