Repository navigation
Open
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: "Sonnet 不在時の Haiku fallback を『証跡収集専用』に制限し、safety-sensitive な編集・成功判定は high-reasoning worker へ route する capability router を追加して、Haiku による不完全実装・虚偽 docs 同期報告を構造的に防ぐ"
change_kind: workflowParent Issue
none(単独改善)
Parent Goal Ref
- Goal: worker route を model capability と change の safety 度で deterministic に決め、Haiku を read-only inventory / evidence collection のみに限定する
- Desired Destination:
route_worker_by_capability.pyがWORKER_CAPABILITY_ROUTE_V1を返し、結果を intake capsule / LOOP_STATE に記録する
Current Validated Scope
.claude/skills/impl-review-loop/scripts/route_worker_by_capability.pyを新規追加するpr-reviewer-liteの deny-list と重複する safety-sensitive 判定を helper function 化して共有する.claude/skills/impl-review-loop/tests/test_route_worker_by_capability.pyを新規追加する
Remaining Parent Gaps
- evidence gate(証跡なし成功報告の fail-closed)は別 Issue で扱う
- intake capsule の
agent_runtimeフィールドへの route 反映は capsule 側 Issue(実装: impl-review-loop intake capsule で Issue/contract/worktree/agent 状態を一括収集する #958)と整合させる
Outcome
Issue の changed target / model availability を入力に、route_worker_by_capability.py が WORKER_CAPABILITY_ROUTE_V1(route / reason_codes / haiku_allowed_actions / haiku_disallowed_actions)を返し、safety-sensitive かつ high-reasoning 不在のとき Haiku を codebase-investigator(証跡収集のみ)に制限し、route 結果を intake capsule / LOOP_STATE に記録する。新規 pytest と pnpm typecheck/lint/test/build が PASS する状態。
In Scope
- safety_sensitive prefix 判定(
.claude/skills/**,.claude/hooks/**,.claude/agents/**,.codex/**, permissions / sandbox / auth / gh api allowlist / CI/CD) - safety_sensitive かつ high-reasoning 不在時、Haiku を証跡収集のみに制限(実装停止 or control-plane deterministic 限定修正)
- Haiku 出力を
EVIDENCE_REPORT_V1のみに限定しIMPLEMENT_RESULT_V1.status: okを不可にする pr-reviewer-litedeny-list と重複する条件の helper 化- route 結果の intake capsule / LOOP_STATE への記録
- 対応するテスト追加
Out of Scope
- 新規 SubAgent / Skill の追加(既存 codebase-investigator を fallback 正本とする)
- evidence gate 本体(別 Issue)
- model 選択そのものの harness 変更
- Allowed Paths を impl-review-loop skill + 共有 helper 以外へ拡張すること
Acceptance Criteria
- AC1:
.claude/skills/issue-contract-review/scripts/baseline_vc_preflight.pyを含む Issue は Haiku implementation route を拒否する。 - AC2: Haiku route 時は Edit / Write / MultiEdit / push / PR create を
haiku_disallowed_actionsに入れ許可しない。 - AC3: Haiku evidence report に command output / file counts / exact paths が無ければ fail-closed と判定する。
- AC4:
pr-reviewer-liteの deny-list と重複する safety-sensitive 判定が helper function に共通化され、二重定義されない。 - AC5: route 結果を intake capsule の
agent_runtimeと LOOP_STATE に記録する(テストで保存先を確認できる)。 - AC6:
uv run pytest .claude/skills/impl-review-loop/tests/test_route_worker_by_capability.py,pnpm typecheck,pnpm lint,pnpm test,pnpm buildが PASS する。
Runtime Verification Applicability
decision: not_applicable
reason: "routing 判定 script + helper 共有化であり、外部 service 実行を成功条件に含まない。全 AC は fixtures + pytest で静的検証可能"Verification Commands
baseline では新規 script / test が未作成のため、AC1〜AC5 の pytest は file not found(pytest exit 4)で baseline-fail する(baseline-expect: fail)。実装後に PASS する。AC6 は regression gate。
# AC1
# baseline-expect: fail
$ uv run pytest .claude/skills/impl-review-loop/tests/test_route_worker_by_capability.py -k "safety_sensitive_rejects_haiku" -v# AC2
# baseline-expect: fail
$ uv run pytest .claude/skills/impl-review-loop/tests/test_route_worker_by_capability.py -k "haiku_disallowed_actions" -v# AC3
# baseline-expect: fail
$ uv run pytest .claude/skills/impl-review-loop/tests/test_route_worker_by_capability.py -k "evidence_report_fail_closed" -v# AC4
# baseline-expect: fail
$ uv run pytest .claude/skills/impl-review-loop/tests/test_route_worker_by_capability.py -k "shared_denylist_helper" -v# AC5
# baseline-expect: fail
$ uv run pytest .claude/skills/impl-review-loop/tests/test_route_worker_by_capability.py -k "route_recorded" -v# AC6
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm buildAllowed Paths
.claude/skills/impl-review-loop/scripts/route_worker_by_capability.py.claude/skills/impl-review-loop/tests/(capability router 関連テスト / fixtures のみ)- safety-sensitive 判定 helper の共有先(実装時に
pr-reviewer-liteと impl-review-loop が共参照できる位置を Scope Delta で確定する)
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合(特に helper 共有先が
pr-reviewer-lite配下に及ぶ場合は Scope Delta + contract 再レビュー) - 新規 SubAgent / Skill の追加が必要になった場合
- intake capsule / LOOP_STATE スキーマの破壊的変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割)
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
- Python 3(routing ロジック / helper 共有 / fixtures ベーステスト)
- pr-reviewer-lite deny-list と impl-review-loop の worker contract の理解
Scope Delta(任意)
helper 共有先(pr-reviewer-lite と impl-review-loop の共参照位置)を実装時に確定し、pr-reviewer-lite 配下へ及ぶ場合は Allowed Paths 拡張として contract 再レビューを通す。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity
squne121 commentedon Aug 1, 2026
Disposition: #1860 の結論待ち(OPEN のまま維持)
親 Issue #1889(parent, delivery-rollup)の owner comment(https://github.com/squne121/loop-protocol/issues/1889#issuecomment-5149813241)に基づく敵対的レビューは、本 Issue が提案する新規スクリプト・新規
LOOP_STATE永続化が、#1860(「導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する」、現在 OPEN)の方向性と整合しない可能性を指摘し、not planned候補としました。ただし #1860 自体がまだ結論に至っていないため、本 Issue を close するかどうかは #1860 の結論確定後に人間が判断します。本コメントは disposition 保留の記録であり、Issue の状態・内容は変更しません。