Repository navigation
Open
Labels
agent/implementerAI implementer agentarea/ai-opsAI operations and agent tooling areakind/implementationImplementation issuephase/implementationImplementation phase
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "557"
goal_ref: "GitHub Actions の unprivileged pull_request で git diff --name-only base...head × Allowed Paths を評価する boundary audit を required check として追加し、privileged context での untrusted checkout を避ける"
change_kind: ciParent Issue
#557(design + parent)
Parent Goal Ref
- Goal: Allowed Paths boundary audit を CI required check として独立させ、手順書依存でなく機械的に enforce する defense-in-depth を加える。
- Desired Destination: review subagent gate(child B)に加え、CI でも PR の changed files × Allowed Paths を検査する二重化。
Current Validated Scope
.github/workflows/に、pull_request(unprivileged)でgit diff --name-only <base>...<head>の changed files を linked issue の Allowed Paths と照合する workflow を追加する。- 照合ロジックは child B の評価スクリプト(
allowed_paths_review_gate.py)を CLI 再利用する。 pull_request_target等の privileged context で untrusted PR code を checkout/実行しない。
Remaining Parent Gaps
- worker-side hook 配線(child A spike → A-impl)。
- review-subagent gate 本体(child B)。
Outcome
PR ごとに GitHub Actions の pull_request(unprivileged)trigger で git diff --name-only <base>...<head> の changed files が linked issue の Allowed Paths snapshot と機械照合され、逸脱があれば check が fail する required boundary audit が存在する。workflow は pull_request_target 等の privileged context で untrusted PR code を checkout/実行せず、CodeQL の untrusted-checkout guidance に沿う。
In Scope
.github/workflows/allowed-paths-boundary-audit.yml(新規)を追加し、pull_requestで changed files × Allowed Paths を評価する。- 評価は child B の
allowed_paths_review_gate.pyを CLI として呼ぶ(ロジック二重実装を避ける)。 - workflow は unprivileged で動作し、untrusted code を privileged に checkout しない。
Out of Scope
- worker-side PreToolUse hook(child A/A-impl)。
- review-subagent gate スクリプト本体の実装(child B。本 child はその CLI を再利用するのみ)。
- branch protection の required check 登録設定(リポジトリ管理者の手動操作。本 child は workflow の追加まで)。
- production game code(
src/**)の変更。
Acceptance Criteria
- AC1:
.github/workflows/allowed-paths-boundary-audit.ymlが追加され、on: pull_requestで trigger される - AC2: workflow が
git diff --name-onlyの changed files を Allowed Paths と照合する step を含む - AC3: workflow が
pull_request_targetを使わず、untrusted PR code を privileged context で checkout しない - AC4: workflow が child B の
allowed_paths_review_gate.pyを CLI として再利用する(照合ロジックを二重実装しない)
Verification Commands
# AC1
$ grep -qE "^on:|pull_request" .github/workflows/allowed-paths-boundary-audit.yml# AC2
$ grep -q "git diff --name-only" .github/workflows/allowed-paths-boundary-audit.yml# AC3
$ ! grep -q "pull_request_target" .github/workflows/allowed-paths-boundary-audit.yml# AC4
$ grep -q "allowed_paths_review_gate.py" .github/workflows/allowed-paths-boundary-audit.ymlStop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- child B の
allowed_paths_review_gate.pyがまだ存在せず CLI 再利用できない場合(child B 完了を待つ依存) - 新規 Issue の起票(スコープ分割)が必要と判断した場合
- privileged workflow が不可避と判明した場合(人間判断へ差し戻し)
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存 workflow 大規模改変が必要になった場合
Required Skills
なし
Runtime Verification Applicability
- decision: not_applicable
- reason: 本 Issue の AC は workflow YAML の静的検証(grep / actionlint)で完結する。workflow の実 trigger 挙動は PR の Checks タブで人間が確認するが、それは本 Issue の AC ではない。
Allowed Paths
.github/workflows/allowed-paths-boundary-audit.yml
Scope Delta(任意)
N/A
Delivery Rule
1 Issue = 1 PR- 専用 worktree で作業し、Draft PR を既定とする
- production game code(
src/**)には触れない
Notes for Reviewer
- child B(
allowed_paths_review_gate.py)に依存する。child B 完了後に着手するのが望ましい(Stop Conditions 参照)。 - CodeQL guidance:
pull_request_targetで untrusted code を checkout/実行しないこと。本 child は unprivilegedpull_requestで完結させる。 - 関連: 実装: implementation-worker の Allowed Paths を worker-side hook と PR境界 audit で決定論的に enforcement する #557, child A(hook spike), child B(review gate)。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentarea/ai-opsAI operations and agent tooling areakind/implementationImplementation issuephase/implementationImplementation phase
Activity