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: "controlled contract snapshot の strict parser 契約を維持し、PyYAML 非利用時にも producer が出力する JSON flow mapping を型損失なく authority comparator へ渡す"
change_kind: codeParent Issue
none(#1153 の終了コメントを発見元として参照する単独改善)
Parent Goal Ref
- Goal: generic contract snapshot parser の fallback 経路で、既存 producer 出力と authority comparator の型契約を一致させる。
- Desired Destination: 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 の本文を変更せず、修正が default branch に入った後の fresh execution だけで新しい snapshot を検証できる状態にする。
Current Validated Scope
contract_review_result_parser.pyの PyYAML 不可時 fallback scalar parsing に限定する。ensure_contract_snapshot.pyproducer はexpected_contract_fingerprint: {<strict JSON object>}を出力し、authority comparator は fingerprint がdictであることを要求する現行契約を維持する。- 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 の OWNER
goコメント(body_sha256: sha256:2875f1a5982e327face1b5fdcd3b7d76a89cdd6459b21a1147d7a18d5b31323f)は発見根拠であり、再利用して impl-ready と判定しない。
Remaining Parent Gaps
なし。この修正のマージ後、#1153 は別の fresh execution で再検証する。
Outcome
PyYAML が利用できない環境でも strict JSON flow mapping を dict / list として保持し、malformed 又は Python literal を fail-closed に拒否する parser と回帰テストが追加され、指定 test・lint・diff check が PASS する Draft PR が作成されている状態。
In Scope
- fallback scalar の trim 後の先頭が
{または[の場合だけjson.loads()で strict JSON を解析し、JSON object / array をそれぞれdict/listとして保持する。 - malformed JSON flow collection は通常文字列へ降格せず、明示的な parse failure にする。
- PyYAML 無効化時の parser unit regression と、producer comment body → parser →
verify_snapshot_authority_postcondition()のネットワークなし回帰を追加する。 - 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 と同じ body SHA と 7 key fingerprint shape を fixture として使い、1 field mismatch、string fingerprint、key 欠落・余分な key の拒否を固定する。
Out of Scope
ensure_contract_snapshot.pyの producer、authority comparator、authority_comment_fingerprint_mismatchの緩和または削除。- fingerprint schema・キー集合・比較規則の変更。
- 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 の本文又は既存
goコメントの編集・削除・再利用、PR マージ前の snapshot 再試行。 - Latitude / EntireCLI 固有の実装変更、任意 YAML parser 又は
ast.literal_eval()の導入。
Acceptance Criteria
- AC1: PyYAML import/load を強制的に使えない状態で、実 producer と同形式の inline JSON object が
expected_contract_fingerprintのdictとして保持され、7 key と値が損失しない。 - AC2: fallback で inline JSON array は
listとして保持し、plain scalar、boolean、null、integer、quoted string、既存product_spec_gatenested scalar mapping を回帰させない。 - AC3: malformed
{...}/[...]は文字列成功へ降格せず parse failure となる。 - AC4: Python dict literal、tuple、set、single quote 依存構文、arbitrary Python literal、曖昧 YAML tag を strict JSON として受理しない。
- AC5: 値の途中に
{を含む通常 plain string を JSON flow collection と誤解析しない。 - AC6: 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 の body SHA / fingerprint shape を使う networkless producer comment → fallback parser → authority postcondition 統合テストが成功し、comparator を mock しない。
- AC7: fingerprint の1値変更、string 型、key 欠落、余分な key は
authority_comment_fingerprint_mismatch又は fingerprint readiness failure として fail-closed になる。 - AC8: body SHA、product gate fingerprint、base binding、trusted publisher binding の既存検証を回帰させない。
Verification Commands
# AC1
# baseline-expect: pass
$ uv run --locked pytest .claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py -q
# AC2
# baseline-expect: pass
$ uv run --locked pytest .claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py -q
# AC3
# baseline-expect: pass
$ uv run --locked pytest .claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py -q
# AC4
# baseline-expect: pass
$ uv run --locked pytest .claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py -q
# AC5
# baseline-expect: pass
$ uv run --locked pytest .claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py -q
# AC6
# baseline-expect: pass
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot_fingerprint_patch.py .claude/skills/impl-review-loop/tests/test_contract_snapshot_author_binding.py -q
# AC7
# baseline-expect: pass
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot_fingerprint_patch.py .claude/skills/impl-review-loop/tests/test_contract_snapshot_author_binding.py -q
# AC8
# baseline-expect: pass
# preflight-scope: pr_review_only
$ uv run --locked ruff check .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/tests/test_ensure_contract_snapshot.py .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot_fingerprint_patch.py .claude/skills/impl-review-loop/tests/test_contract_snapshot_author_binding.py
# AC8
# baseline-expect: pass
$ git diff --checkAllowed Paths
.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/tests/test_ensure_contract_snapshot.py.claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot_fingerprint_patch.py.claude/skills/impl-review-loop/tests/test_contract_snapshot_author_binding.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合。
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合。
- fingerprint schema、producer/comparator 比較規則の変更が必要になった場合。
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)。
- 後続 Phase / 別スコープへの波及が判明した場合。
- nested SubAgent delegation が必要になった場合。
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合。
- producer が無効な serialization を出している、又は comparator の緩和が必要と判明した場合。
- PyYAML と fallback の出力を同一型契約へ収束できない、又は malformed input を成功扱いしないと既存テストを通せない場合。
- 同一問題を修正する OPEN PR が発見された、又は unrelated な既存失敗との因果を証明できない場合。
Required Skills
- Python
- pytest
- JSON
Required Design References
docs/dev/workflow.md#Issue 駆動開発フローdocs/dev/agent-skill-boundaries.md#Loop Sequencing & Preconditionshttps://github.com/squne121/loop-protocol/issues/1153#issuecomment-5150887495
Scope Collision
- decision: overlap_requires_comment(C1)
- related_issue: 実装: issue-refinement-loop の Final Gate を delivery-rollup / 非実装 parent issue_kind に適用しないようにする #1914, 実装: 両review loopの人間向けGitHub作業履歴をphase-awareに整理し推奨理由を記録する #1908, 実装: stale base-bound contract snapshot をfresh materializationする #1655, 実装: ensure_contract_snapshot.py の go コメント binding 検証が実際に投稿済みの go コメントを恒久的に検出できないバグを修正する #1513, 実装: contract snapshot既存再利用パスにpublish receipt bindingを追加する #1490, 実装: feat(impl-review-loop): no-diff / superseded の終了処理を再実行可能なfinalizerに集約する #1116, 実装: issue-contract-review scripts の CLI alias compatibility を追加する #1053, feat(agent-ops): broad regex VC を検出する vc_text_assert.py を追加し、positive assertion の unexpected_pass を事前に潰す #996, 実装: concurrent work ledger で active worktree / dirty main / overlapping paths を loop 前に検出する #966, 実装: model capability router で Haiku fallback の編集・成功判定スコープを制限する #962, 実装: SubAgent result evidence gate で証跡なし成功報告を fail-closed にする #961
- overlapping_paths:
.claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py,.claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py,.claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot_fingerprint_patch.py,.claude/skills/impl-review-loop/tests/test_contract_snapshot_author_binding.py - non_conflict_reason: 実装: stale base-bound contract snapshot をfresh materializationする #1655 は stale base binding の refresh routing、実装: ensure_contract_snapshot.py の go コメント binding 検証が実際に投稿済みの go コメントを恒久的に検出できないバグを修正する #1513 は送信バイト列と publisher binding、実装: 両review loopの人間向けGitHub作業履歴をphase-awareに整理し推奨理由を記録する #1908/実装: issue-refinement-loop の Final Gate を delivery-rollup / 非実装 parent issue_kind に適用しないようにする #1914 と他候補は広域 test directory 又は別 workflow concern を所有する。本 Issue は
contract_review_result_parser.pyfallback の strict JSON 型保持だけを production change とし、ensure_contract_snapshot.pyは変更しない。 - edit_intent: PyYAML 非利用時にも producer の JSON flow mapping を dict/list として復元し、既存の strict fingerprint/comparator をそのまま通す networkless regression を追加する。
- dependency_ordering: 実装直前に 実装: stale base-bound contract snapshot をfresh materializationする #1655 と 実装: ensure_contract_snapshot.py の go コメント binding 検証が実際に投稿済みの go コメントを恒久的に検出できないバグを修正する #1513 の current Issue/PR を再読し、同じ test case への未マージ差分があれば停止する。
Runtime Verification Applicability
decision: not_applicable
reason: "strict parser と authority-bound snapshot contract の networkless unit/integration regression で完結し、外部 runtime は変更しない"Delivery Rule
1 Issue = 1 Draft PR。auto merge は禁止する。default branch へ修正が反映された後だけ、#1153 の current body SHA を再取得し、fresh contract review と controlled ensure_contract_snapshot --mode auto --post を1回実行する。その新しい authority comment が fingerprint を dict として parse でき、body SHA・product gate・base binding・fingerprint postcondition を満たしたときだけ #1153 の issue-refinement-loop を再開する。
Notes for Reviewer
- 発見元: 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 の終了コメント 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 (comment) 。これは generic contract snapshot parser の不具合であり、Latitude / EntireCLI 固有ではない。
- producer は strict JSON flow mapping を出力する。fallback parser のみが同じ型契約を保持できず、
ensure_contract_snapshotauthority postcondition が fail-closed になった。 - 実装: issue-contract-review fingerprint refresh path を明示する #1329 は
allowed_paths_review_gate.pyの missing fingerprint に対する recovery message を所有し、parser fallback の型保持・authority integration を扱わないため重複しない。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Activity
squne121 commentedon Aug 1, 2026
Contract Review Result
squne121 commentedon Aug 1, 2026
Contract Review Result
fix(issue-contract-review): harden fallback JSON parsing (#1927)
fix(issue-contract-review): fallback parserでcontract fingerprintのJSON…