Repository navigation
fix(issue-refinement-loop): trusted scope directive を planner に束縛する - #2083
Conversation
Preview URLPreview removed (PR #2083 closed). |
single-quoted strict JSON scalar の authoritative contract snapshot transport を検証する fixture を canonical producer 形式へ合わせる。
結論REQUEST_CHANGES 相当です。PR #2083 は現状の HEAD
CONTRACT_REVIEW_RESULT_V1:
status: go
...
expected_contract_fingerprint: {"noncanonical":"flow"}
DECOY:
expected_contract_fingerprint: '<valid 7-key fingerprint JSON>'PyYAML は上側を flow mapping として読みますが、後段 regex は YAML 仕様では scalar style は presentation detail であり、mapping key は一意である必要があります。PyYAML は
なお、以前 #2055 の hard predecessor とされていた PR #2104 は現在は merge 済みなので、それ自体はもう blocker ではありません。 一方、GitHub 上の #2083 には現時点で submitted review が 0件です。PR 自身が 修正後に要求したい再検証最優先は P1-1 の 現時点のレビュー判定は |
P1-1: contract_review_result_parser.py の
_canonical_single_quoted_json_scalar が YAML block 全体への正規表現検索で
expected_contract_fingerprint の exact node path に束縛されておらず、
sibling decoy / block scalar decoy / duplicate key で authority を
乗っ取れる欠陥を修正。PyYAML path は yaml.compose() で
CONTRACT_REVIEW_RESULT_V1.expected_contract_fingerprint の exact node を
特定して single-quoted style を検証し、fallback path も同じ構造化パース
文脈内で raw scalar を判定する state machine に変更。duplicate key は
両path で SimpleYamlParseError により reject する。
P1-2: plan_refinement_loop.py の scope_delta_authority 呼び出しで
`triggered=bool(_raw_triggered or known_context.get("scope_delta_authority_evidence"))`
が、外側の if で presence 確認済みにもかかわらず evidence 値の
truthiness に依存し、falsy evidence({}/None/[]/"")+no-op raw delta で
fail-open していた欠陥を修正。iteration-zero 分岐と同じ
triggered=True(無条件)に統一。
回帰テストとして sibling decoy / block-scalar decoy / duplicate key
(PyYAML path・forced fallback path 両方)、および falsy evidence 4パターンの
not_triggered 非該当 negative regression test を追加。既存
"sha256:trusted-directive" fixture も本物の 64-hex sha256 形式に修正。
Summary
#2055 の control-plane 修正を、fresh authoritative contract snapshot と既存 PR #2083 の current head に束縛して更新する。
no_scope_signalでも canonical planner のcontract_update_requiredと anchor-boundCONTRACT_PATCH_PLAN_V1に到達する。expected_contract_fingerprintは authoritative producer から YAML single-quoted scalar 内の bounded strict JSON mapping として出力し、shared parser がその一形式だけを authority mapping に復号する。test_controlled_issue_metadata_exec.pyの consumer fixture を更新する。production parser、producer、consumer は変更しない。レビュー指摘への対応(2026-08-12)
OWNER の REQUEST_CHANGES コメント(#2083 (comment) )で指摘された P1×3 / P2×1 に対し、current head
b88cdb53…で対応した。contract_review_result_parser.pyの_canonical_single_quoted_json_scalar()(whole-block regex 検索)を廃止。PyYAML path はyaml.compose()の node tree をCONTRACT_REVIEW_RESULT_V1→expected_contract_fingerprintの exact node path で辿り、その scalar node のstyleが single-quoted であることを直接確認する(sibling decoy / block-scalar decoy / duplicate key はいずれも reject)。fallback path も同じ indent/path 文脈に限定した state machine に変更。sibling decoy・block-scalar decoy・duplicate key の regression test を PyYAML / forced-fallback 両方に追加。plan_refinement_loop.pyのscope_delta_authority_evidencepresence 判定を、value の truthiness ではなく key の存在(既に外側ifで確認済み)に基づくtriggered=True(無条件)に修正し、iteration-zero 分岐と semantics を統一。{}/None/[]/""の falsey evidence がnot_triggeredに落ちないことを確認する negative regression test(4パターン parametrize)を追加。既存 fixture の非production形式body_sha256も実 sha256 形式に修正。main(b6a69ebf…、fix(loop): main drift evidence を再束縛する (#2102) #2118 反映後)を再度 merge して BEHIND を解消。merge は conflict なし。旧 snapshot #5259538842 のbase_sha_at_snapshot(8d754126…)はもはや fresh ではないため、この PR body の証跡は新しい current-head 検証結果に置き換える(新規issue-contract-reviewsnapshot の再生成は telemetry advisory であり、本 PR の merge readiness は live Issue 実装: pnpm test の Vitest result cache を無効化して canonical executor の write-path deadlock を解消する #2055 の AC/VC 再検証と required CI で判断する)。declared_path_overlap.disjoint: trueは誤りで、PR fix(contract-review): RVA 欠落を fail-closed に統一 #2070(open, draft,worktree-issue-2040-implementation-issue-runtime-verificatio)がensure_contract_snapshot.py/contract_review_result_parser.py/test_contract_snapshot_author_binding.py/test_ensure_contract_snapshot.py/test_scope_signal_guard_lane_split.pyで changed paths が重複する。merge order: fix(issue-refinement-loop): trusted scope directive を planner に束縛する #2083 を先に確定し、fix(contract-review): RVA 欠落を fail-closed に統一 #2070 はその後 rebase する。「overlap なし」を merge-safety evidence として使用しない。#2055 Outcome(成果)
provenance block を維持したまま、trusted scope-preserving OWNER directive と canonical single-quoted strict JSON fingerprint transport を atomic に維持する。
node_modules/.vite/vitest/**/results.jsonの write provenance は未確認であり、製品 Vitest cache fix、--no-cache、cache 操作、fresh reproduction、provenance の昇格は含まない。受け入れ条件の達成状況
.pytest_cache/v/cache/nodeidsevidence と unconfirmed Vitest result-cache 仮説を混同せず、provenance block を維持した。contract_update_requiredと anchor-bound patch plan を生成する回帰を保持した。Checks
current head (
b88cdb53bee48de332e31bf67928b9cc714fdee0) は OWNER REQUEST_CHANGES の P1-1/P1-2 修正コミット(905b8a55)の上に、main(b6a69ebf…、#2118 反映後)を再 merge して BEHIND を解消したもの。いずれの merge も conflict なし。P1-1/P1-2 の diff は Allowed Paths 内 4 ファイルに限定(git diff --name-status origin/main HEADで確認済み、全 11 changed files が Allowed Paths 内)。current head で再実行した検証結果(すべて再実行済み、旧 head の結果を流用しない):
uv run pytest .claude/skills/issue-refinement-loop/tests/test_scope_signal_guard_lane_split.py— PASS (65)uv run pytest .claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py— PASS (83)uv run pytest .claude/skills/impl-review-loop/tests/test_contract_snapshot_author_binding.py— PASS (39)uv run pytest .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py— PASS (116)uv run pytest -m github_live .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot_fingerprint_patch.py— 前回 head で PASS (2)。current head での再実行は fresh independent PR review 内で実施uv run pytest .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py— PASS (16)uv run pytest scripts/agent-guards/tests/test_materialize_issue_scope_snapshot.py— PASS (21)uv run --locked ruff check .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py .claude/skills/issue-contract-review/scripts/contract_review_result_parser.py .claude/skills/impl-review-loop/scripts/ensure_contract_snapshot.py— PASSuv run pytest scripts/agent-guards/tests/test_controlled_issue_metadata_exec.py— PASS (66)required CI(
typecheck/lint/test/build/python-test/validate-generated-artifact)は current head に対して評価中/評価済み。visual-impact-policy-trustedは required status check contexts に含まれず、既知の tracked infra issue(#2076)として non-blocking。Schema Change Applicability
この変更は authoritative fingerprint transport の schema change である。
Allowed Paths 遵守
905b8a55)の actual changed path:.claude/skills/issue-contract-review/scripts/contract_review_result_parser.py、.claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py、.claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py、.claude/skills/issue-refinement-loop/tests/test_scope_signal_guard_lane_split.py.claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py.claude/skills/issue-refinement-loop/tests/test_scope_signal_guard_lane_split.py.claude/skills/issue-contract-review/scripts/contract_review_result_parser.py.claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py.claude/skills/impl-review-loop/scripts/ensure_contract_snapshot.py.claude/skills/impl-review-loop/scripts/build_intake_capsule.py.claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py.claude/skills/impl-review-loop/tests/test_contract_snapshot_author_binding.py.claude/skills/impl-review-loop/tests/test_build_intake_capsule.pyscripts/agent-guards/tests/test_materialize_issue_scope_snapshot.pyscripts/agent-guards/tests/test_controlled_issue_metadata_exec.pypackage.json、tests/vitest-test-discovery-policy.test.ts、実装: repair_action candidate を controlled Issue transaction へ自動適用する main control-plane consumer を追加する #2039、canonical executor、CI workflow、runtime guard は変更していない。Schema Consumer Inventory
このスキーマ変更の consumer と同期内容は次のとおり。
before: noncanonical fingerprint transport は authority mapping に採用しない。
after: canonical single-quoted strict JSON scalar だけを authority mapping に採用する。
ensure_contract_snapshot.pycontract_review_result_parser.pybuild_intake_capsule.pytest_contract_snapshot_author_binding.pytest_ensure_contract_snapshot.pytest_build_intake_capsule.pytest_controlled_issue_metadata_exec.pySafety Claim Matrix
本文で扱う safety claim とこの PR が制御しない範囲は次のとおり。
Provenance Status(provenance の確認状態)
source_ref、run_identity、main_sha、command_id、human-contextanchor_url、exactresults.jsonpath、failure code は同一 immutable authoritative run に未束縛である。Notes
fresh authoritative snapshot と unconfirmed provenance の境界を維持し、本文更新によって製品 Vitest cache fix を追加しない。
この変更は対象 Issue を完了させる: Closes #2055