Repository navigation
Closed
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: "ISSUE_SCOPE_SNAPSHOT_V1 materializer と contract snapshot publisher が、同一 Allowed Paths を Markdown 表現に依存せず同じ fingerprint として扱う"
change_kind: codeParent Issue
none
Parent Goal Ref
- Goal: materializer の live contract 検証を fail-closed のまま、canonical contract parser と同じ Allowed Paths 正規化規則へ統一する。
- Desired Destination: backtick 付き・なしの同一 Allowed Paths が同じ SHA-256 となり、既存の有効な contract snapshot を不必要に拒否しない。
Current Validated Scope
- Issue 実装: protected TEST_VERDICT execution artifact producer を追加する #1646 で、contract snapshot publisher は backtick を除去して
allowed_paths_normalized_sha256を計算した。 materialize_issue_scope_snapshot.pyの_allowed_paths()は Markdown code span を保持したため、同一7パスが別ハッシュとなりallowed_paths_fingerprint_mismatchで fail-closed した。- fail-closed の拒否自体は正しい。修正対象は Markdown 表現の正規化差だけである。
Remaining Parent Gaps
なし
Outcome
materializer が canonical contract-review の Allowed Paths extractor / normalizer と同じ結果を使用し、Markdown code span の有無で fingerprint が変わらない。実際に異なるパス、unsafe path、空の Allowed Paths は従来どおり拒否する。
In Scope
materialize_issue_scope_snapshot.pyの Allowed Paths 抽出を canonical extractor と整合させる。- backtick 付き・なしの同一 Allowed Paths が同じ hash で accepted となる単体テストを追加する。
- 異なる Allowed Paths hash が引き続き拒否される回帰を固定する。
Out of Scope
- ISSUE_SCOPE_SNAPSHOT_V1 の field schema 変更。
- contract snapshot publisher の trust / two-phase publish 手順変更。
- 実装: protected TEST_VERDICT execution artifact producer を追加する #1646 の workflow、schema、producer 実装変更。
Acceptance Criteria
- AC1: backtick 付きの Allowed Paths を含む live Issue body で、materializer が canonical publisher と同じ normalized hash を計算する。
- AC2: backtick なしの同一 Allowed Paths は AC1 と同じ hash になり、同一 fingerprint の contract snapshot を受理する。
- AC3: 正規化後に異なる Allowed Paths を持つ contract snapshot は、従来どおり
allowed_paths_fingerprint_mismatchで拒否する。 - AC4: unsafe path または空の Allowed Paths を受理しない既存 fail-closed 挙動を維持する。
Verification Commands
# AC1
$ uv run --locked pytest scripts/agent-guards/tests/test_materialize_issue_scope_snapshot.py -q# AC2
$ uv run --locked pytest scripts/agent-guards/tests/test_materialize_issue_scope_snapshot.py -q# AC3
$ uv run --locked pytest scripts/agent-guards/tests/test_materialize_issue_scope_snapshot.py -q# AC4
$ uv run --locked pytest scripts/agent-guards/tests/test_materialize_issue_scope_snapshot.py -qAllowed Paths
- scripts/agent-guards/materialize_issue_scope_snapshot.py
- scripts/agent-guards/tests/test_materialize_issue_scope_snapshot.py
Runtime Verification Applicability
decision: not_applicable
reason: fixture-based unit tests validate parser and hash parity without external runtime execution.Required Design References
docs/dev/agent-runtime-ops.mddocs/dev/workflow.md
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- contract snapshot publisher の trust / two-phase publish 変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
なし
Scope Collision
- related_issue: 実装: protected TEST_VERDICT execution artifact producer を追加する #1646
- overlapping_paths: scripts/agent-guards/materialize_issue_scope_snapshot.py, scripts/agent-guards/tests/test_materialize_issue_scope_snapshot.py
- non_conflict_reason: 実装: protected TEST_VERDICT execution artifact producer を追加する #1646 は protected execution artifact producer を実装する。本 Issue はその実装を変更せず、control-plane の Allowed Paths normalization parity に限定する。
- edit_intent: canonical extractor と materializer extractor の Markdown code span 正規化を統一し、hash parity の回帰テストを追加する。
- dependency_ordering: 実装: protected TEST_VERDICT execution artifact producer を追加する #1646 の未コミット実装を変更せず、main にある current materializer を基準に着手する。
Delivery Rule
- 1 Issue = 1 PR。
- 実装着手前に fresh
CONTRACT_REVIEW_RESULT_V1 status: goを取得する。 - normal commit / push のみを使用し、force push、hook disable、guard bypass を行わない。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity
squne121 commentedon Jul 24, 2026
#1675 で再現した追加証跡
#1675 の Scope Repair で、Allowed Paths の同一内容に対して次の2つの parser 差異を確認しました。
allowed_paths_fingerprint_mismatchになった。## Allowed Paths内の非 bullet 説明文は publisher が path として hash する一方、materializer は無視し、同じくallowed_paths_fingerprint_mismatchになった。最終的に、Allowed Paths section を raw bullet のみ(説明文・heading は Notes 等へ移動)にする必要がありました。#1675 の fresh snapshot はこの修復を束縛しています: 5073264037, 5073290928, 5073319352。
期待する修正は canonical parser の共有または完全一致であり、bare bullet / backtick+suffix / section 内 explanatory prose / heading の回帰テストと、異なる path・unsafe path・空 section の fail-closed 維持を含めてください。
allowed-paths-parser-evidence-1675
squne121 commentedon Jul 26, 2026
Contract Review Result
fix: materializer の Allowed Paths 正規化を統一する (#1653) (#1802)