Repository navigation
feat: issue-refinement-loop の structural repair producer に known_scalars/source_spans の実抽出を配線する - #2469
Conversation
…ars/source_spans の実抽出を配線する (#2431) run_refinement_preflight.py の Step 0f が build_structural_repair_bundle() を known_scalars/source_spans 未指定のまま呼んでいたため、derivation 可能な missing section が不要に human_judgment_required へ落ちていた(#2426)。 - parent_issue スカラーを MRC / `## Parent Issue` heading / (人間ラベル付き trusted anchor comment のみ) から解決し、parent-issue と machine-readable-contract.parent_issue の両方へ供給する (_resolve_parent_issue_known_scalar) - `## Proposed Allowed Paths` -> `## Allowed Paths` の closed / one-way / exact heading alias から same-body source_span_exact を生成する (_resolve_current_issue_heading_alias_source_spans)。source_revision は sha256(body) を束縛し、alias 複数出現・canonical 既存・空内容では 発火しない - repair_issue_contract.py の _SOURCE_SPAN_AUTHORITY_KINDS に same-body 専用の additive extension `current_issue` を追加 (両 schema の enum も同期) - 新規 derivation 種別・新規 structural schema model は追加していない - agent-authored / unlabeled anchor は既存の _resolve_scope_delta_source_kind() lane classifier を再利用し、 引き続き fail-closed のまま人間レビューへ落ちる Co-Authored-By: Claude Sonnet 5 <[email protected]>
Preview URLPreview removed (PR #2469 closed). |
pr-review-judge 判定 (iteration 0)Mergeability: mergeable=MERGEABLE, merge_state_status=BEHIND(実 conflict ではない) Blockers:
Non-blockers:
verdict: REQUEST_CHANGES
reviewed_head_sha: "2f61fadefa70891a114783aabb7d9815802495ef"
blockers:
- "PR 本文に必須セクション `## 受け入れ条件の達成状況`(AC1-AC10 個別の [x]/[ ] + 根拠)が存在しない"
- "PR 本文に必須セクション `## 検証コマンド結果` が存在しない"
- "PR 本文に必須セクション `## Allowed Paths 遵守` の明示的申告が存在しない"
warnings:
- "技術的実装・CI・Allowed Paths・テスト証拠は独立検証済みで問題なし。missing sections は本文フォーマットの不備であり、実装内容自体への疑義ではない" |
pr-review-judge 判定 (iteration 1, head a737bd6)Mergeability: mergeable=MERGEABLE, merge_state_status=BEHIND(実 conflict ではない。main がさらに先行したため control-plane が再度 update_branch を実行) Blockers: なし verdict: APPROVE
reviewed_head_sha: "a737bd64610049d4c088601b0fd42c9513df6f67"
blockers: []
warnings:
- "merge_state_status=BEHIND at review time; control-plane will re-run mechanical update_branch"
- "PR is Draft; not a reviewer blocker per policy"
- "Advisory full regression run reports 3 pre-existing failures, unrelated to this PR" |
pr-review-judge 判定 (iteration 2, head 91f9a9b)Mergeability: mergeable=MERGEABLE, merge_state_status=CLEAN Blockers: なし Warnings:
verdict: APPROVE
reviewed_head_sha: "91f9a9b4a6a00472d5a3513557e30843810930ee"
blockers: []
warnings:
- "PR body's 検証コマンド結果 section text still cites the prior head; substantively superseded by exact-head-bound independent re-verification, non-blocking"live mergeability: mergeable=MERGEABLE, merge_state_status=CLEAN → route_loop_verdict_v2() の判定は |
判定: |
| 優先度 | Finding | 判定 |
|---|---|---|
| P1 | current_issue の source_span 行範囲が通常の Markdown で本文と一致しない |
修正推奨・merge blocker |
| P1 | current_issue の厳しい意味制約が assembler にしかなく、generic producer は偽の current_issue を auto_apply_safe にできる |
修正推奨・merge blocker |
| P1 | Issue #2431 が要求する source assembly より実装が狭い | 実装するか Issue 契約を狭める必要あり |
| P2 | 「exact heading」なのに実装は casefold() で case-insensitive |
契約か実装のどちらかを合わせる |
| P2 | enum 追加を単純に backward_compatible としている |
表現修正で十分 |
P1 — source_span.line_start/line_end が実際の text を指していません
ここが一番具体的なバグです。
既存 _parse_h2_sections() は section content を最後に .strip() しています。つまり、
## Proposed Allowed Paths
- src/foo.py
なら、返る content は - src/foo.py です。先頭の空行は除去されます。
一方、今回追加された assembler は、
line_start = alias_matches[0]["start_line"] + 1
line_end = line_start + ...としているため、line_start は 見出し直後の空行を指します。しかし text は strip 後の - src/foo.py です。
したがって正常な Markdown ですでに、
source_span[line_start:line_end] != source_span["text"]
になります。
現 consumer はこの provenance を厳格に再構成していないので今すぐ mutation が壊れるとは限りませんが、source_span_exact と名乗る evidence としては不正確です。
最小修正は parser から strip 後 content の実際の content_start_line / content_end_line を返すことです。あるいは assembler 内で content_lines の leading/trailing blank を考慮して offset を計算するだけでも構いません。
追加テストは1本で十分です。
actual = "\n".join(body.splitlines()[line_start - 1:line_end])
assert actual == span["text"]通常の「heading → blank line → bullets」と、複数行 content の2ケースを通せば十分です。新しい provenance harness は不要です。
P1 — current_issue が producer/schema 上では広すぎます
Issue #2431 の owner review で要求された current_issue は、「same-body heading relocation 専用」です。source object は target Issue の body、digest は同じ body、closed alias からの byte-exact copy、という限定でした。
今回の assembler はかなり忠実にそれを守っています。問題は 制約を assembler だけが持っていることです。
repair_issue_contract.py 側では current_issue を enum に追加しただけで、コメントにも「狭い precondition は caller が責任を持つ」と明記されています。
generic provenance validator が確認しているのは、
- authority が enum 内
- object kind が
issue_body | issue_comment | git_blob - required fields が非空
- line range が妥当
までです。
そして _classify_missing_field() はこの generic validation が通れば source_span_exact → auto_apply_safe にします。
つまり別 caller が理論上、
{
"authority_kind": "current_issue",
"source_object_kind": "issue_comment",
"source_object_id": "999999",
"source_repo": "other/repo",
...
}のような provenance を渡しても、generic classifier 自体は「current issue ではない」と拒否できません。
これはセキュリティ問題というより 型/契約の表現力不足です。しかも build_structural_repair_bundle() 自身は body, repo, issue_number と original_body_sha256 をすでに持っています。
したがって追加 infrastructure は不要です。build_structural_repair_bundle() / detect_missing_template_sections() の境界で current_issue の場合だけ、
source_object_kind == issue_body
source_repo == repo
source_object_id == str(issue_number)
source_revision == original_body_sha256
を確認してください。さらに alias relation は assembler のままでも構いません。
JSON Schema 側にも最低限、
authority_kind == current_issue
→ source_object_kind == issue_body
という conditional を入れれば、schema 自体が嘘をつかなくなります。
direct producer test で forged current_issue を1件拒否できれば十分です。
P1 — PR は Issue #2431 の AC1 を完全には実装していません
これは実害とは別の、scope/claim の不一致です。
#2431 は known_scalars / source_spans を、
parent Issue body / current Issue body / trusted anchor comment
から assemble することを In Scope / AC1 にしています。また複数 source candidate は bytes で exact dedup し、distinct content のみ conflict にする契約です。 Owner review でも同値 candidate を assembler 側で dedup することが明記されています。
しかし今回の実装は実質、
-
parent_issuescalar:- current body MRC
- current body
## Parent Issue - trusted anchor の
## Parent Issue
-
source_spans:- current body の
Proposed Allowed Pathsのみ
- current body の
です。
parent Issue body を source として assemble していませんし、trusted anchor から一般的な source span を作ってもいません。source-span candidate の exact dedup machinery もありません。
ここは個人開発前提なら、実装を広げるより Issue #2431 の契約を狭める方を推します。
実インシデント #2426 を閉じるために必要なのが、
current Issue の Proposed Allowed Paths
→ missing Allowed Paths
だけなら、parent Issue の追加 fetch や多元 source resolution を今作る費用対効果は低いです。#2206 で producer、#2400 で single-mutation / stale guard / fresh validation を含む consumer はすでに成立しています。
したがって二択です。
- 推奨: 実装: issue-refinement-loop の structural repair producer に known_scalars/source_spans の実抽出を配線する #2431 の AC1 / Outcome / In Scope を、今回本当に実装する current-body + parent scalar assembly に狭める。
- 契約を維持するなら、parent body / anchor source span collection と exact dedup を実装する。
後者のために新しい GitHub provenance framework を作る必要はありません。
P2 — 「exact heading」ではなく case-insensitive matching です
alias table 自体は、
{"Proposed Allowed Paths": "Allowed Paths"}という closed mapping ですが、lookup は双方に .casefold() をかけています。したがって、
## proposed allowed paths
## PROPOSED ALLOWED PATHS
もマッチします。
テストは Suggested Allowed Paths のような near-match は検証していますが、case variant は検証していません。
CommonMark の ATX heading は heading raw content の前後 whitespace を strip しますが、大文字小文字を同一視する仕様ではありません。([CommonMark仕様]1)
一方、このリポジトリの既存 required-heading 検出も casefold() を使っています。
なので私は実装を変えるより、AC5 の「exact」を、
CommonMark heading normalization 後の case-insensitive exact match
など、実装に合う定義へ修正する方を選びます。これなら workflow を悪化させません。
P2 — current_issue enum 追加は「完全な backward compatibility」ではありません
PR本文は schema change を additive / backward_compatible / migration_required: no としています。既存 payload が新 schema で引き続き valid、という意味なら正しいです。
ただし JSON Schema の enum は「列挙された値だけが valid」という closed validation です。([JSON Schema]2)
したがって旧 schema snapshot、
["parent_issue", "owner_anchor", "design_reference", null]を持つ consumer は、新 producer が出す "current_issue" を reject します。
つまり正確には、
existing payloads → new schema は backward-compatible。
newcurrent_issuepayload → stale schema/consumer は forward-compatible ではない。
です。
リポジトリ内検索上、authority_kind の direct consumer はかなり限定されているので、実務上 migration は不要でよいと思います。ここは PR 本文の Compatibility Decision の表現だけ直せば十分です。
最小修正セット
私なら merge 前の変更を次の4点だけに絞ります。
source_spanの line range を実際の strippedtextと一致させ、slice == text の regression test を追加する。- generic producer 境界で
current_issueのissue_body / repo / issue_number / digestを検証し、forged span の negative test を1本追加する。 - 実装: issue-refinement-loop の structural repair producer に known_scalars/source_spans の実抽出を配線する #2431 の source scope を今回の実装に合わせて狭める。parent-Issue fetch / multi-source machinery は、実際に必要な incident が出るまで作らない。
- AC5 の case sensitivity と Schema Compatibility の文言だけ実装実態に合わせる。
この修正なら、新しい permission gate、署名、ledger、history fetch、mutation harness、CI 全suite zero-failure gateは一切不要です。既存 #2400 の controlled consumer をそのまま利用できます。
総評としては、実装の中心部分は良く、#2426 の実用上の gap を閉じるところまではほぼできています。ただし今のまま APPROVE すると、source_span_exact の provenance が実際の行を指していない点と、current_issue の schema/producer 契約が assembler より広い点を後で負債として拾うことになります。そこだけ狭く直してから merge が適切です。
…#2431 fix_delta iteration 3) human adversarial review (PR #2469 REQUEST_CHANGES) の P1 blocker 2件を解消する: - `_resolve_current_issue_heading_alias_source_spans()` の line_start/line_end が heading 直後の行を content 開始位置と誤って仮定していたため、heading -> blank line -> bullets という通常の Markdown 構造で `body.splitlines()[line_start-1:line_end] != span["text"]` になっていた。 `_section_line_bounds()` を再利用して raw content の実際の開始/終了行を 計算するよう修正し、byte-exact reconstruction を regression test で検証する。 - `current_issue` authority_kind の same-issue/same-repo/body-digest 一致という narrow precondition が assembler 側にしか無く、`repair_issue_contract.py` の generic provenance validator は forged な current_issue span (例: source_object_kind: issue_comment)を拒否できなかった。 `build_structural_repair_bundle()` の generic producer boundary に `_validate_current_issue_source_span_authority()` / `_reject_forged_current_issue_source_spans()` を追加し、precondition を 満たさない current_issue span は auto_apply_safe/source_span_exact に 昇格させず human_review_required のまま fail-closed とする。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
pr-review-judge 判定 (iteration 3, head 0942672)人間オーナーの敵対的 REQUEST_CHANGES(https://github.com/squne121/loop-protocol/pull/2469#issuecomment-5485342004)に対する fix_delta 対応の再レビュー。 対応内容の独立検証:
CI: 全 required checks green(head Blockers: なし verdict: APPROVE
reviewed_head_sha: "0942672a049c361d32a44b433e469fec47a2de08"
blockers: []
warnings: []live mergeability: mergeable=MERGEABLE, merge_state_status=CLEAN → route_loop_verdict_v2() の判定は |
Summary
run_refinement_preflight.pyの Step 0f がbuild_structural_repair_bundle()をknown_scalars/source_spans未指定のまま呼んでいたため、derivation 可能な missing section が不要にhuman_judgment_requiredへ落ちていた(実装: Claude-GPT を既存 Latitude project に接続し Native Claude Code と runtime source を識別可能にする #2426 で発現)。本 PR でknown_scalars/source_spansの実抽出関数を配線する。parent_issueスカラーを Machine-Readable Contract のキー /## Parent Issueheading / (人間ラベル付き trusted anchor comment のみ)から解決し、parent-issueとmachine-readable-contract.parent_issueの両方の consumer field-id へ供給する(_resolve_parent_issue_known_scalar)。## Proposed Allowed Paths->## Allowed Pathsの closed / one-way / exact heading alias から same-bodysource_span_exactを生成する(_resolve_current_issue_heading_alias_source_spans)。source_revisionはsha256(body)を束縛し、alias 複数出現・canonical heading 既存・空内容のいずれでも発火しない。repair_issue_contract.pyの_SOURCE_SPAN_AUTHORITY_KINDSに same-body 専用の additive extensioncurrent_issueを追加し、両 schema(repair_issue_contract_result_v1.schema.json/refinement_preflight_result_v1.schema.json)の enum も同期した。新規 derivation 種別・新規 structural schema model は追加していない。_resolve_scope_delta_source_kind()lane classifier をそのまま再利用し、新規の trust 判定ロジックは追加していない(引き続き fail-closed で human review へ落ちる)。_resolve_current_issue_heading_alias_source_spans()のline_start/line_endが、heading 直後の行を content 開始位置と誤って仮定していたため、heading → blank line → bullets という通常の Markdown 構造(この Issue テンプレート自体が使っている構造)でbody.splitlines()[line_start-1:line_end] != span["text"]になっていた。repair_issue_contract.pyの_section_line_bounds()(_apply_insertion_decision()が使っているのと同じ helper)を再利用し、raw content の実際の開始/終了行を計算するよう修正した。byte-exact reconstruction を正常系(単一行)・複数行content系の2パターンで regression test 化した。current_issueauthority_kind の「same issue / same repo / body digest 一致」という narrow precondition が assembler(run_refinement_preflight.py)側にしか実装されておらず、repair_issue_contract.pyの generic provenance validator(_validate_source_span_provenance())は forged な current_issue span(例:source_object_kind: issue_commentを騙る span)を拒否できなかった。build_structural_repair_bundle()の generic producer boundary(assembler 固有ロジックではない箇所)に_validate_current_issue_source_span_authority()/_reject_forged_current_issue_source_spans()を追加し、precondition を満たさないcurrent_issuespan は auto_apply_safe/source_span_exact に昇格させず human_review_required のまま fail-closed とする。forged provenance negative test を追加した。Checks
pnpm typecheckpnpm lintpnpm testpnpm build本 PR は
.claude/skills/issue-refinement-loop/配下の Python スクリプト(issue-refinement-loop skill 自体のツール実装)のみを変更しており、フロントエンドアプリ(pnpm対象)には影響しないため、上記 4 コマンドは対象外(N/A)。代わりに Issue #2431 の Verification Commands(下記)をローカルで実行し、すべて PASS を確認済み。advisory broad regression check(PR review 時、merge 基準は main baseline との差分で new failure = 0):
uv run ruff checkは変更した3スクリプト/テストファイルで clean。受け入れ条件の達成状況
run_refinement_preflight.pyにknown_scalars/source_spansを assemble する新規関数(_resolve_parent_issue_known_scalar/_resolve_current_issue_heading_alias_source_spans)を追加し、build_structural_repair_bundle()呼び出しへ配線した(source_spansは current-body の heading alias relocation のみ、known_scalars/parent_issueは current body MRC / current body## Parent Issueheading / trusted anchor comment から解決 -- narrow 済み Issue 実装: issue-refinement-loop の structural repair producer に known_scalars/source_spans の実抽出を配線する #2431 AC1 と一致)。根拠:test_known_scalars_and_source_spans_reach_build_structural_repair_bundle_kwargsPASS(production 経路で kwargs を観測)parent_issueの解決値がknown_scalarsのparent-issueとmachine-readable-contract.parent_issueの両方の consumer field-id へ供給される。根拠:test_parent_issue_scalar_cross_populates_both_consumer_field_ids/test_parent_issue_via_mrc_cross_populates_missing_heading_field_via_real_preflightPASSsource_span_exact.authority_kindにcurrent_issueを追加し、Python_SOURCE_SPAN_AUTHORITY_KINDSと両 schema(repair_issue_contract_result_v1.schema.json/refinement_preflight_result_v1.schema.json)の enum が一致。根拠:test_current_issue_authority_kind_enum_consistent_across_python_and_schemasPASScurrent_issueauthority は全条件(same issue / body digest 一致 / closed alias exact match / alias exactly once / canonical heading missing / byte-exact copy / 複数候補時 conflict)を満たす場合のみ有効。fix_delta iteration 3 で追加: (a)line_start/line_endがbody.splitlines()[line_start-1:line_end] == textを byte-exact に満たすことの regression test、(b) forged provenance(source_object_kind/source_repo/source_object_id/source_revisionの不一致)がbuild_structural_repair_bundle()の generic producer boundary で拒否されることの negative test。根拠:test_current_issue_source_span_only_emitted_when_every_precondition_holds/test_current_issue_source_span_digest_binds_to_original_body_sha256/test_current_issue_source_span_line_range_reconstructs_text_single_line/test_current_issue_source_span_line_range_reconstructs_text_multi_line/test_forged_current_issue_source_span_rejected_at_generic_producer_boundary/test_current_issue_source_span_authority_validator_rejects_each_forgeable_fieldPASSProposed Allowed Paths -> Allowed Pathsの closed / one-way / exact string マッピングのみで fuzzy/substring/semantic matching を行わない(CommonMark heading normalization 後の case-insensitive exact match。実装の既存casefold()挙動を変更せず、narrow 済み Issue 実装: issue-refinement-loop の structural repair producer に known_scalars/source_spans の実抽出を配線する #2431 AC5 の定義と一致)。根拠:test_heading_alias_table_is_closed_one_way_exact_match_onlyPASSauto_apply_safe/source_span_exactに分類される。根拠:test_combined_positive_fixture_classifies_auto_apply_safe_via_real_preflightPASSTestNegativeFixturesStayFailClosed配下 5 テスト全 PASS(test_no_source_authority_stays_human_review_required/test_multiple_distinct_byte_candidates_conflict_to_none/test_agent_only_anchor_never_backs_auto_apply_safe/test_unlabeled_anchor_never_backs_auto_apply_safe/test_malformed_machine_readable_contract_stays_fail_closed)test_regression_unknown_issue_kind_still_leaves_structural_repair_action_absentPASS、既存test_template_section_repair.pyも全件 PASSrepair_issue_contract.pyに新規 derivation 種別・新規 structural schema model を追加していない(current_issueadditive extension を除く)。fix_delta iteration 3 で追加した_validate_current_issue_source_span_authority()/_reject_forged_current_issue_source_spans()は既存 3 derivation mode /current_issueauthority_kind の枠組み内での provenance 検証強化のみで、新規 derivation mode・新規 structural schema model は追加していない。根拠:test_no_new_derivation_mode_addedPASS。独立再検証としてrg -n -e DERIVATION_TEMPLATE_VALUE_EXACT -e DERIVATION_SOURCE_SPAN_EXACT -e DERIVATION_DERIVED_SCALAR_EXACTの結果、既存3種(DERIVATION_TEMPLATE_VALUE_EXACT/DERIVATION_SOURCE_SPAN_EXACT/DERIVATION_DERIVED_SCALAR_EXACT)以外の新規追加は無しtest_structural_repair_known_scalars_wiring.py)が PASS する。根拠: 独立再実行で19 passed(下記 検証コマンド結果 参照。fix_delta iteration 3 で 15 -> 19 に4本追加)検証コマンド結果
Issue #2431 の Verification Commands 3件を worktree(head
0942672a049c361d32a44b433e469fec47a2de08、fix_delta iteration 3 反映後)で独立再実行した結果:VC1(AC1-AC10 focused test):
結果:
19 passed in 1.58s(19/19 全件 PASS。fix_delta iteration 3 で追加した4本の regression/negative test を含む)VC2(AC9 regression invariant grep、baseline-expect: pass):
結果: exit 0、既存3種の定義・使用箇所(1009-1015行目付近および各
_classify_*関数内)が全て一致(新規 derivation 種別なし)VC3(
.claude/skills/issue-refinement-loop/tests/全 suite advisory broad regression check、preflight-scope: pr_review_only):結果:
1953 passed, 3 failed in 328.52s。3 failed はいずれもtest_command_registry.py::TestAuthorityTransportPrivilegedExecutorRealSubprocessDispatch系(本 PR のスコープと無関係な main baseline 既存 failure。Issue 実装: issue-refinement-loop の structural repair producer に known_scalars/source_spans の実抽出を配線する #2431 Notes for Reviewer 記載の既知3件と一致)。merge 基準「main baseline との差分で new failure = 0」を満たすAllowed Paths 遵守
本 PR の diff は Issue #2431(narrow 済み)の Allowed Paths に列挙された以下 5 パスのみを変更しており、それ以外のファイルへのスコープ拡張は無い(
git diff --name-only main...HEADで確認済み)。fix_delta iteration 3 での追加変更もこの範囲内(新規ファイル追加なし、既存3ファイルの追加編集のみ):.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py.claude/skills/issue-refinement-loop/scripts/repair_issue_contract.py.claude/skills/issue-refinement-loop/schemas/repair_issue_contract_result_v1.schema.json.claude/skills/issue-refinement-loop/schemas/refinement_preflight_result_v1.schema.json.claude/skills/issue-refinement-loop/tests/test_structural_repair_known_scalars_wiring.py(Allowed Paths の.claude/skills/issue-refinement-loop/tests/ディレクトリ配下)Schema Change Applicability
schema_changerepair_issue_contract_result_v1.schema.json/refinement_preflight_result_v1.schema.jsonのsource_span_exact.authority_kindenum にcurrent_issueを additive extension として追加した(fix_delta iteration 3 での変更はこの schema 自体には影響しない。Python 側の provenance 検証強化のみ)。互換性の非対称性については下記 Compatibility Decision を参照。Schema Consumer Inventory
変更対象 schema:
repair_issue_contract_result_v1.schema.json/refinement_preflight_result_v1.schema.json(.../source_span_exact.authority_kind.enum)before/after 差分:
Consumer 列挙(rg コマンド例と結果):
Consumer 更新状況:
run_refinement_preflight.py(refinement_preflight_result_v1.schema.jsonを自己検証)current_issueを発火させる同ファイル内の producer 変更と同時に schema を更新。_validate_against_result_schema()(新規テスト)で緑を確認済みtest_template_section_repair.pytest_structural_repair_known_scalars_wiring.py(本 PR で新規追加)_SOURCE_SPAN_AUTHORITY_KINDSと両 schema enum の一致を機械検証docs/dev/workflow.mdauthority_kindの値集合そのものへの参照ではない)Compatibility Decision(互換性判定)
additivebackward_compatible(下記の方向限定の注記を参照)noN/Aparent_issue/owner_anchor/design_reference/null)は変更せず、新規値current_issueを追加しただけの enum 拡張。非対称性の明記(PR feat: issue-refinement-loop の structural repair producer に known_scalars/source_spans の実抽出を配線する #2469 fix_delta iteration 3, P2、human adversarial review 指摘): 「backward_compatible」は「既存 payload(current_issueを含まない)→ 新 schema」の方向にのみ成立する(既存 producer/consumer はcurrent_issueを出力しない限りこれまで通り動作する)。逆方向、すなわち「新しいcurrent_issueを含む payload → 旧 schema/current_issueを認識しない旧 consumer ロジック」は forward-compatible ではない(旧 schema の enum にcurrent_issueが無いため旧 schema でのバリデーションは失敗し、current_issueを想定しない旧 consumer ロジックは未知の値として扱う)。この非対称性は additive enum extension 一般に共通する性質であり、本 PR 固有の欠陥ではない。上記 Consumer Inventory のとおりリポジトリ内の direct consumer は限定的(run_refinement_preflight.py自身と本 PR で追加したテストのみ)で、いずれも本 PR と同時に更新済みのため、実務上の migration は不要(migration_required: noは維持する)。Visual Impact Declaration(視覚影響申告)
UI(DOM/CSS)変更を含まないため省略。
Safety Claim Matrix
current_issueauthority のsource_span_exactは AC4 の全条件(alias exactly once / canonical heading missing / 非空 / same-body digest 束縛)を満たす場合のみ生成されるtest_current_issue_source_span_only_emitted_when_every_precondition_holds/test_current_issue_source_span_digest_binds_to_original_body_sha256(PASS)current_issuesource_span のline_start/line_endはbody.splitlines()[line_start-1:line_end]がtextを byte-exact に再構成する範囲を指す(fix_delta iteration 3 で修正)test_current_issue_source_span_line_range_reconstructs_text_single_line/test_current_issue_source_span_line_range_reconstructs_text_multi_line(新規テスト、PASS)current_issueprovenance(source_object_kind/source_repo/source_object_id/source_revisionの不一致)はbuild_structural_repair_bundle()の generic producer boundary で拒否され、auto_apply_safe/source_span_exact に昇格しない(fix_delta iteration 3 で追加)test_forged_current_issue_source_span_rejected_at_generic_producer_boundary/test_current_issue_source_span_authority_validator_rejects_each_forgeable_field(新規テスト、PASS)parent_issueknown_scalars 解決に使われない(fail-closed のまま human review)test_agent_only_anchor_never_backs_auto_apply_safe/test_unlabeled_anchor_never_backs_auto_apply_safe(PASS)Noneに解決され、いずれの値も採用しないtest_multiple_distinct_byte_candidates_conflict_to_none(PASS)_resolve_parent_issue_known_scalar/_resolve_current_issue_heading_alias_source_spansはいずれもbody: str(と repo/issue_number の静的値)のみを引数に取り、gh/ GitHub REST を一切呼ばないgh/ API クライアント引数が存在しない)記載ルール確認:
Not controlledは空であり、すべての claim をyes(完全実装)としている。「safe」「read-only」等の無限定 claim は使用していない。Notes
docs/dev/current-focus.mdの M4 milestone boundary の外側にある issue-refinement-loop 自体のツール改善(Issue 実装: issue-refinement-loop の structural repair producer に known_scalars/source_spans の実抽出を配線する #2431 Notes for Reviewer 記載のとおり)## Runtime Verification Applicabilityはdecision: not_applicable(純粋 Python ロジックの静的検証のみで完結、Issue 実装: issue-refinement-loop の structural repair producer に known_scalars/source_spans の実抽出を配線する #2431 本文参照)。CI_TEST_PERFORMANCE_ADVISORY(schemas/path 一致)に対する応答: 本 PR は.claude/skills/issue-refinement-loop/schemas/配下の JSON Schema の additive enum 拡張のみで、.github/workflows/**/pyproject.toml/uv.lock/ CI lane 構成は変更していない。lane classification はcontract_artifact(schema・contract 変更)であり、既存のpython-test-plan.jsonの.claude/skills/issue-refinement-loop/tests/ディレクトリ target にそのまま含まれるため、CI 実行時間・lane 構成への影響はない。current_issuesource_span の line range 誤り/forged provenance が generic producer boundary で拒否されない)を解消した。P2 guidance(Schema Change Applicability の互換性方向の非対称性の明記)も反映した。AC1/AC5 は reviewer 推奨に沿って narrow 済みの Issue 実装: issue-refinement-loop の structural repair producer に known_scalars/source_spans の実抽出を配線する #2431 本文に整合させた(実装側の追加変更は line range 修正と forged provenance 拒否の2点のみ)。