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: "PR #2326 (Closes #2316) 人間レビュー P2-1 (non-blocking) の完全解消。producer-shaped fixture の checked_body_sha256 を実 producer shape(64桁hex)に揃え、回帰検出可能な pytest assertion として残す"
change_kind: codeParent Issue
none(単独改善・post-merge-cleanup の follow-up candidate)
Parent Goal Ref
- Goal: 該当なし(単独 follow-up Issue)
- Desired Destination: 該当なし(単独 follow-up Issue)
Current Validated Scope
.claude/skills/edit-issue/tests/test_edit_issue_txn.py内の producer-shaped fixture におけるchecked_body_sha256の値を、実際の SEMANTIC_REVIEW_RESULT_V1 producer(semantic_review_transport.py)が生成する 64 桁 16 進文字列の shape に揃える- 同ファイル内の既存 positive test(
test_rewrite_lane_semantic_with_producer_shaped_constraints_accepted)に、fixture のchecked_body_sha256が 64 桁 16 進文字列であることを検証する runtime shape assertion を追加し、同種の fixture drift を pytest が回帰検出できるようにする
Remaining Parent Gaps
なし
Outcome
.claude/skills/edit-issue/tests/test_edit_issue_txn.py 内の producer-shaped fixture の checked_body_sha256 値が、実測 62 桁の hex 文字列から "a" * 64(64 桁の hex 文字列)に修正され、かつ既存の test_rewrite_lane_semantic_with_producer_shaped_constraints_accepted に len(digest) == 64 および全文字が [0-9a-f] であることを検証する assertion が追加されたコミットが作成され、既存の関連テストが pass している状態
Runtime Verification Applicability
- decision: not_applicable
- reason: 静的検証(テストfixture文字列の桁数・文字種検証を pytest assertion として組み込み、既存 pytest を実行するのみ)で完結するため
In Scope
.claude/skills/edit-issue/tests/test_edit_issue_txn.py内の_semantic_producer_shaped_constraints()が返す fixture(checked_body_sha256フィールド)の値を、"a" * 64に修正する- 同ファイル内の既存 test
test_rewrite_lane_semantic_with_producer_shaped_constraints_acceptedに、fixture のchecked_body_sha256の長さ(64)と文字種([0-9a-f])を検証する assertion を追加する
Out of Scope
.claude/skills/edit-issue/scripts/edit_issue_txn.pyの実装ロジック変更(同スクリプトはsemantic_rewrite_constraintsを opaque envelope として扱い、schema_version以外は深く検証しない consumer であり、本 Issue の対象外)- 新規テストファイル・schema validation harness の追加
- fixture 内の
no_progress_route/ finding 構造のidフィールド(既に fix_delta で修正済みのため対象外) .claude/skills/edit-issue/tests/test_edit_issue_txn.py以外のファイル変更
Acceptance Criteria
- AC1:
_semantic_producer_shaped_constraints()のchecked_body_sha256fixture 値が"a" * 64(64 桁の 16 進文字列)である - AC2:
test_rewrite_lane_semantic_with_producer_shaped_constraints_acceptedにlen(digest) == 64かつ全文字が[0-9a-f]であることを検証する assertion が追加されている - AC3: 既存の関連テストが引き続き pass する
Verification Commands
# AC1
$ rg -n "checked_body_sha256.: .a. \* 64" .claude/skills/edit-issue/tests/test_edit_issue_txn.py# AC2
$ uv run --locked pytest .claude/skills/edit-issue/tests/test_edit_issue_txn.py -k "rewrite_lane_semantic_with_producer_shaped_constraints_accepted" -v# AC3
$ uv run --locked pytest .claude/skills/edit-issue/tests/test_edit_issue_txn.py -vAllowed Paths
.claude/skills/edit-issue/tests/test_edit_issue_txn.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
なし
Required Design References
schemas/semantic_review_result_v1.schema.json(body_sha256を^[0-9a-f]{64}$と定義する canonical contract。SEMANTIC_REVIEW_RESULT_V1 の正本).claude/skills/issue-refinement-loop/scripts/semantic_review_transport.py(hashlib.sha256(...).hexdigest()でbody_sha256を実際に生成する producer).claude/skills/issue-refinement-loop/scripts/join_review_results.py(caller から受け取ったchecked_body_sha256をそのままsemantic_rewrite_constraintsへ転記する forwarding 経路。自身では生成・検証しない).claude/skills/issue-refinement-loop/tests/test_join_review_results.py(producer-shaped fixture の実装例).claude/skills/issue-refinement-loop/references/semantic-design-review.md(checked_body_sha256を含む semantic review の producer/consumer フロー設計ドキュメント)
(.claude/skills/edit-issue/scripts/edit_issue_txn.py は semantic_rewrite_constraints を opaque envelope として扱う consumer であり、checked_body_sha256 の producer shape の正本ではない。前版 Issue 本文の Required Design References 記載は誤りであったため訂正した)
Scope Delta(任意)
N/A
Source
- dedupe_key:
follow-up:squne121/loop-protocol:pr/2326:1 - 起票元: post-merge-cleanup(PR fix: edit_issue_txn.py に rewrite_lane / semantic_rewrite_constraints の input validation parity を追加する #2326 マージ後クリーンアップ時の follow-up candidate 検出)
- 元コメント: pr-reviewer の P2-1 (non-blocking finding, PR fix: edit_issue_txn.py に rewrite_lane / semantic_rewrite_constraints の input validation parity を追加する #2326 レビュー時) fix: edit_issue_txn.py に rewrite_lane / semantic_rewrite_constraints の input validation parity を追加する #2326 (comment)
- 背景: Issue 実装: edit_issue_txn.py に rewrite_lane / semantic_rewrite_constraints の input validation parity を追加する #2316 / PR fix: edit_issue_txn.py に rewrite_lane / semantic_rewrite_constraints の input validation parity を追加する #2326(マージ済み、merge commit
a72b8a0193a8a0005c8e4f4e164bc51d88e82492)で追加された producer-shaped fixture のchecked_body_sha256値が、fix_delta 適用後も実測 62 桁 hex のままであり、実 producer/既存テストが要求する 64 桁 hex と一致していないことが post-merge-cleanup 検証で判明した。 - Refinement 反映: OWNER レビュー 実装: edit_issue_txn.py semantic_rewrite_constraints テストfixtureのchecked_body_sha256を実producer shape(64桁hex)に揃える #2329 (comment) (REQUEST_CHANGES) の P1-1(Required Design References の producer/consumer 誤認訂正)・P1-2(AC1 が source grep のみで pytest による回帰検出がないことの是正。既存 positive test への shape assertion 追加)・P2-1(修正値を手数え64文字でなく
"a" * 64にする非blocking提案)を本文へ反映した。P2-2(overlap 評価は妥当、追加対応不要)はそのまま維持。
Notes for Reviewer
- Allowed Paths overlap preflight(
check_issue_overlap.py)が.claude/skills/edit-issue/tests/test_edit_issue_txn.pyに対して 実装: edit-issue の native relationship pagination reader を controlled executor に一本化し totalCount 検証を追加する #1916(native relationship pagination reader 統合)と 実装: guard-issue-body.py の AC/VC alignment を共有パーサーへ統合し VC grammar parity/LP010/authoring reference を同期する #1719(AC/VC alignment 共有パーサー統合)の OPEN Issue との overlap を検出した(policy_class C1, decision: overlap_requires_comment)。 - non_conflict_reason: 本 Issue は fixture 内の
checked_body_sha256値の修正と既存 positive test への shape assertion 追加のみに限定した最小差分であり、実装: edit-issue の native relationship pagination reader を controlled executor に一本化し totalCount 検証を追加する #1916 の pagination reader 統合や 実装: guard-issue-body.py の AC/VC alignment を共有パーサーへ統合し VC grammar parity/LP010/authoring reference を同期する #1719 の AC/VC alignment parser 統合とは変更対象の関数・行が異なる想定。導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860 Owner Decision により Allowed Paths の文字列重複は起票停止理由にしないため、起票を継続する。 - 実際の Git conflict が発生した場合は worktree/PR 作成時に検出されるため、マージ順の調整はその時点で行う。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Activity
squne121 commentedon Aug 24, 2026
判定
REQUEST_CHANGES— 小規模な契約修正後に実装するのが妥当です。P0 はありません。実装自体は非常に小さく、production code・runtime smoke・live GitHub test・追加ハーネスは不要です。
Issue #2329 の問題認識そのものは正しいです。現在の
_semantic_producer_shaped_constraints()のchecked_body_sha256は 62桁で、コメントでは^[0-9a-f]{64}$を満たすと説明しているのに実データが一致していません。 Issue 本文も、この残存 P2 を単独 follow-up として直す意図になっています。ただし、Issue 契約には2点直した方がよい箇所があります。
Severity | Finding | 判定 -- | -- | -- P1-1 | producer shape の SSOT を誤認している | blocker P1-2 | 今回の不具合を pytest が回帰検出しない | blocker P2-1 | 64文字リテラルを再度手で数える設計 | non-blocking P2-2 | overlap は実質 false positive | 問題なしP1-1: Required Design References が逆です
Issue #2329 は Required Design References で
edit_issue_txn.pyを「`SEMANTIC_REVIEW_RESULT_V1 producer shape の正本」としています。これは実装と一致しません。
edit_issue_txn.pyは consumer であり、PR #2326 自身もsemantic_rewrite_constraintsの nested payload を opaque envelope として扱い、schema_version以外は深く検証しない、としています。実際の authority は次の流れです。
semantic_review_transport.pyが pinned body に対してhashlib.sha256(...).hexdigest()を生成します。そして完成した artifact を canonical JSON Schema で検証します。その schema が
body_sha256を明示的に^[0-9a-f]{64}$と定義しています。その後
join_review_results.pyは、caller から受け取ったchecked_body_sha256をsemantic_rewrite_constraintsにそのまま転記するだけです。自身では SHA-256 を生成も検証もしていません。 production 手順でも、transport が保存した artifact と pinnedbody_sha256を joiner に渡す構成です。したがって Required Design References は少なくとも、
schemas/semantic_review_result_v1.schema.json— 64 lowercase hex の canonical contract.claude/skills/issue-refinement-loop/scripts/semantic_review_transport.py— 実 hash producer.claude/skills/issue-refinement-loop/scripts/join_review_results.py— checked_body_sha256 への forwarding.claude/skills/issue-refinement-loop/tests/test_join_review_results.py— producer-side test exampleへ直すべきです。
Python の公式仕様でも
hexdigest()は digest の2倍長の16進文字列を返し、sha256(...).hexdigest()の出力は64文字になります。(Python documentation) JSON Schema 側で^[0-9a-f]{64}$とアンカーする方法も公式ガイドと整合しています。(JSON Schema)P1-2: AC1 が source grep にしか存在せず、pytest は現在の62桁でも通る
ここが実用上の主問題です。
現在の PR #2326 系テストは、この62桁 fixture が存在する状態でも 59 tests pass としてマージされています。 これはバグではなく、
edit_issue_txn.pyが nested envelope を意図的に opaque としているからです。つまり Issue #2329 の現在の VC は、
だけが AC1 を検証し、続く pytest は AC1 を一切検証していません。
今回の defect はまさに「producer-shaped とコメントしている fixture が実は producer-shaped でなかった」ことです。ここをもう一度 source grep だけで直すと、一度は直っても regression test にはなりません。
しかも #1719 では、このリポジトリ自身が Verification Commands の実装文字列への強結合を behavior-based test に置き換える方向を明記しています。
ただし、新しいテストファイルや schema validation harness は不要です。既存の positive test に3行程度足せば十分です。
対象は既存の
でよいです。これなら現行62桁では red、修正後は green になり、AC1 が実際の pytest suite に残ります。
P2-1: 修正値は「別の手数え64文字」にしない方がよい
PR #2326 の元レビューでも推奨例は
"a" * 64でしたし、producer 側の既存テストもすでにchecked_body_sha256="a" * 64を使っています。 同じtest_edit_issue_txn.py自体にも"0" * 64という書き方があります。したがって、
で十分です。
今回の defect は「64文字のつもりで手書きしたら62文字だった」です。もう一度63/64/65文字を人間が数えるリテラルを置くより、長さをコードで表現した方が明瞭で、保守コストもゼロに近いです。
pytest の考え方としても fixture はテストへ reliable / consistent な context を提供するものなので、fixture 自体の前提を executable assertion にしておく方が自然です。(pytestドキュメント)
overlap の評価
#1916 は同じ
test_edit_issue_txn.pyを触りますが、対象は native relationship pagination /totalCount検証です。 #1719 は AC/VC parser parity です。したがって #2329 の Notes にある
non_conflict_reasonは妥当です。fixture helper 周辺だけなら意味的 conflict はほぼありません。worktree 作成時の通常の Git conflict 検出で十分です。また #1860 は live Issue/PR、実 diff、実 test、CI、独立 review を authority とし、独自 checker や digest control-plane の追加を避ける方針です。 この Issue で新規 schema、security validation、live canary、専用 CI lane を追加する必要はありません。
推奨する Issue #2329 の着地点
スコープは1ファイルのままでよいです。
Runtime Verification Applicability: not_applicableも維持して問題ありません。uv run --locked pytestも、lockfile を勝手に更新せず実行するという意味で現在の uv の仕様に適合しています。(Astral Docs)修正内容だけ次のように変えるのが最も軽量です。
既存 positive test に runtime shape assertion を追加し、Verification Commands は source
rgを主証拠にするのではなく、とするのを推奨します。
結論として、Issue の方向性・Allowed Paths・scope size は良好です。修正すべきなのは「producer SSOT の誤記」と「同じ種類の fixture drift を再発検出できない VC」の2点だけです。 ここを直せば、余計なハーネスを増やさず、#2326 の P2-1 を実質的に閉じられます。
## 判定REQUEST_CHANGES— 小規模な契約修正後に実装するのが妥当です。P0 はありません。実装自体は非常に小さく、production code・runtime smoke・live GitHub test・追加ハーネスは不要です。
Issue #2329 の問題認識そのものは正しいです。現在の
_semantic_producer_shaped_constraints()のchecked_body_sha256は 62桁で、コメントでは^[0-9a-f]{64}$を満たすと説明しているのに実データが一致していません。 Issue 本文も、この残存 P2 を単独 follow-up として直す意図になっています。ただし、Issue 契約には2点直した方がよい箇所があります。
P1-1: Required Design References が逆です
Issue #2329 は Required Design References で
edit_issue_txn.pyを「`SEMANTIC_REVIEW_RESULT_V1 producer shape の正本」としています。これは実装と一致しません。
edit_issue_txn.pyは consumer であり、PR #2326 自身もsemantic_rewrite_constraintsの nested payload を opaque envelope として扱い、schema_version以外は深く検証しない、としています。実際の authority は次の流れです。
semantic_review_transport.pyが pinned body に対してhashlib.sha256(...).hexdigest()を生成します。そして完成した artifact を canonical JSON Schema で検証します。その schema が
body_sha256を明示的に^[0-9a-f]{64}$と定義しています。その後
join_review_results.pyは、caller から受け取ったchecked_body_sha256をsemantic_rewrite_constraintsにそのまま転記するだけです。自身では SHA-256 を生成も検証もしていません。 production 手順でも、transport が保存した artifact と pinnedbody_sha256を joiner に渡す構成です。したがって Required Design References は少なくとも、
schemas/semantic_review_result_v1.schema.json— 64 lowercase hex の canonical contract.claude/skills/issue-refinement-loop/scripts/semantic_review_transport.py— 実 hash producer.claude/skills/issue-refinement-loop/scripts/join_review_results.py— checked_body_sha256 への forwarding.claude/skills/issue-refinement-loop/tests/test_join_review_results.py— producer-side test exampleへ直すべきです。
Python の公式仕様でも
hexdigest()は digest の2倍長の16進文字列を返し、sha256(...).hexdigest()の出力は64文字になります。([Python documentation]1) JSON Schema 側で^[0-9a-f]{64}$とアンカーする方法も公式ガイドと整合しています。([JSON Schema]2)P1-2: AC1 が source grep にしか存在せず、pytest は現在の62桁でも通る
ここが実用上の主問題です。
現在の PR #2326 系テストは、この62桁 fixture が存在する状態でも 59 tests pass としてマージされています。 これはバグではなく、
edit_issue_txn.pyが nested envelope を意図的に opaque としているからです。つまり Issue #2329 の現在の VC は、
rg -o "checked_body_sha256\": \"[0-9a-f]{64}\"" ...だけが AC1 を検証し、続く pytest は AC1 を一切検証していません。
今回の defect はまさに「producer-shaped とコメントしている fixture が実は producer-shaped でなかった」ことです。ここをもう一度 source grep だけで直すと、一度は直っても regression test にはなりません。
しかも #1719 では、このリポジトリ自身が Verification Commands の実装文字列への強結合を behavior-based test に置き換える方向を明記しています。
ただし、新しいテストファイルや schema validation harness は不要です。既存の positive test に3行程度足せば十分です。
対象は既存の
test_rewrite_lane_semantic_with_producer_shaped_constraints_acceptedでよいです。これなら現行62桁では red、修正後は green になり、AC1 が実際の pytest suite に残ります。
P2-1: 修正値は「別の手数え64文字」にしない方がよい
PR #2326 の元レビューでも推奨例は
"a" * 64でしたし、producer 側の既存テストもすでにchecked_body_sha256="a" * 64を使っています。 同じtest_edit_issue_txn.py自体にも"0" * 64という書き方があります。したがって、
で十分です。
今回の defect は「64文字のつもりで手書きしたら62文字だった」です。もう一度63/64/65文字を人間が数えるリテラルを置くより、長さをコードで表現した方が明瞭で、保守コストもゼロに近いです。
pytest の考え方としても fixture はテストへ reliable / consistent な context を提供するものなので、fixture 自体の前提を executable assertion にしておく方が自然です。([pytestドキュメント]3)
overlap の評価
#1916 は同じ
test_edit_issue_txn.pyを触りますが、対象は native relationship pagination /totalCount検証です。 #1719 は AC/VC parser parity です。したがって #2329 の Notes にある
non_conflict_reasonは妥当です。fixture helper 周辺だけなら意味的 conflict はほぼありません。worktree 作成時の通常の Git conflict 検出で十分です。また #1860 は live Issue/PR、実 diff、実 test、CI、独立 review を authority とし、独自 checker や digest control-plane の追加を避ける方針です。 この Issue で新規 schema、security validation、live canary、専用 CI lane を追加する必要はありません。
推奨する Issue #2329 の着地点
スコープは1ファイルのままでよいです。
Runtime Verification Applicability: not_applicableも維持して問題ありません。uv run --locked pytestも、lockfile を勝手に更新せず実行するという意味で現在の uv の仕様に適合しています。([Astral Docs]4)修正内容だけ次のように変えるのが最も軽量です。
既存 positive test に runtime shape assertion を追加し、Verification Commands は source
rgを主証拠にするのではなく、uv run --locked pytest \ .claude/skills/edit-issue/tests/test_edit_issue_txn.py \ -k "rewrite_lane_semantic_with_producer_shaped_constraints_accepted" -v uv run --locked pytest \ .claude/skills/edit-issue/tests/test_edit_issue_txn.py -vとするのを推奨します。
結論として、Issue の方向性・Allowed Paths・scope size は良好です。修正すべきなのは「producer SSOT の誤記」と「同じ種類の fixture drift を再発検出できない VC」の2点だけです。 ここを直せば、余計なハーネスを増やさず、#2326 の P2-1 を実質的に閉じられます。
squne121 commentedon Aug 24, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Aug 24, 2026
issue-refinement-loop 終了報告(1 iteration・approve)
VERDICT: approve(deterministic checker、
ISSUE_REVIEW_RESULT_COMPACT_V2、blockers: 0)反映内容
参照コメント(OWNER,
REQUEST_CHANGES, #2329 (comment) )の指摘をすべて本文へ反映しました。Required Design Referencesの producer/consumer 誤認を訂正。edit_issue_txn.py(consumer / opaque envelope)から、実際の producer chain(schemas/semantic_review_result_v1.schema.json/semantic_review_transport.py/join_review_results.py/test_join_review_results.py/references/semantic-design-review.md)へ差し替えrgのみで pytest による回帰検出がなかった問題を是正。既存 positive testtest_rewrite_lane_semantic_with_producer_shaped_constraints_acceptedへlen(digest) == 64/ 文字種[0-9a-f]の shape assertion を追加する AC2 を新設し、VC も-k指定の pytest 実行へ変更"a" * 64に変更また Step 2 の deterministic checker が検出した
RDR001(Required Design References が実質空/非design-doc)blocker も、上記の訂正で同時に解消しました。実行証跡
STATUS: warn/NEXT_ACTION: proceed_with_notes(preflight.run.with_human_context)issue-editor経由で本文置換。STATUS: ok、BODY_HASH: sha256:e99f1228742fbdead31440f0dfefdb530f61e8e9c544ae69f2fa294506b0442crun_root_review_pipeline.py produce→VERDICT: approve、REVIEWED_BODY_SHA256が readback hash と一致semantic_review_trigger.py→semantic_review_applicable: false(スキップ)参考(Final Gate 情報)
root_entry_router.pyによる current-run 判定:route: invoke_impl_review_loop,reason: fresh_review_go_live_equality(fresh contract-review go かつ live body/base SHA 一致)。実装ハンドオフ(impl-review-loop起動)は本タスクの依頼スコープ(refinement loop のみ)外のため、本セッションでは起動していません。実装着手が必要な場合は別途impl-review-loopを起動してください。squne121 commentedon Aug 25, 2026
implement-issue: 実装完了 (2026-08-25T11:10:38Z)
.claude/worktrees/issue-2329-fixture-sha256-shapeworktree-issue-2329-fixture-sha256-shapeb6e912d4417e583d3e212bcd11cc1db71800d5aatest: producer-shaped fixture の checked_body_sha256 を実 shape(64桁hex)に…