Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: research
parent_issue: "none"
goal_ref: "#2734 / #2736 / #2759 で反復した numeric contract_schema_version を発生させる Issue authoring 経路を特定し、GitHub write 前に canonical literal v1 を保証できる再発防止策を確定する"
change_kind: research-only
dedupe_key: "issue-authoring:mrc-contract-schema-version-numeric-1-recurrence:v1"Parent Issue
なし(Issue #2734 の refinement 前 OWNER review で発見した repository-wide authoring recurrence の調査 follow-up)。
Outcome
最近作成された Issue #2734 / #2736 / #2759 が contract_schema_version: 1 を保持している一方、repository の canonical authoring reference・materializer・guard/readiness contract は contract_schema_version: v1 を要求/生成している。この不一致を生じさせた実際の Issue creation/materialization/write 経路を current main と GitHub provenance から特定し、同種の malformed MRC が GitHub に永続化される前に exact string v1 を保証する最小の再発防止策を決定する。
原因が repository-owned write path の欠陥であり、修正が必要と確認された場合は、既存 Issue を dedupe したうえで bounded な implementation follow-up を materialize できる状態にする。既存 guard が十分で non-canonical write のみが原因なら、その事実と enforceable な canonical route / detection point を記録する。
Current Validated Scope
.claude/skills/create-issue/references/body-authoring.mdはcontract_schema_version: v1を例示している。.claude/skills/create-issue/scripts/materialize_child_issues.pyと.claude/skills/issue-refinement-loop/scripts/retrospective_candidate_handoff.pyは"v1"を生成する。.claude/skills/edit-issue/scripts/guard-issue-body.pyと.claude/skills/issue-contract-review/scripts/contract_readiness_check.pyはv1を canonical value として扱う。- 一方で live Issue 実装: check_session_recording_runtime_safety.py の ghs_ redaction パターンを新形式トークンに対応させる #2734 / 実装: summarize_agent_transcript.py の GitHub token redaction パターンを fine-grained PAT (github_pat_) に対応させる #2736 / 実装: get_ci_failed_log.py の diagnostic/error 出力を redact_tokens() 経由に統一する #2759 は
contract_schema_version: 1を保持しており、同時期の 実装: persist_retrospective_run.py の secret redaction パターンを新形式 ghs_ App installation token に対応させる #2727 / 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728 等はv1である。 - したがって、authoring guidance の不足だけでは説明できず、実際の mutation path / bypass / serialization 境界の inventory が必要である。
In Scope
- 実装: check_session_recording_runtime_safety.py の ghs_ redaction パターンを新形式トークンに対応させる #2734 / 実装: summarize_agent_transcript.py の GitHub token redaction パターンを fine-grained PAT (github_pat_) に対応させる #2736 / 実装: get_ci_failed_log.py の diagnostic/error 出力を redact_tokens() 経由に統一する #2759 の作成経路・関連 comment / agent workflow / repository-owned authoring or materialization path を調査し、numeric
1が GitHub write に到達した経路を特定する。 - 正常対照として 実装: persist_retrospective_run.py の secret redaction パターンを新形式 ghs_ App installation token に対応させる #2727 / 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728 等の
v1Issue と authoring path を比較する。 create_issue_txn.py、validate_issue_body.py、MRC shared parser、follow-up/materialization producer、direct GitHub issue-create consumer のうち、実際に関与した boundary を inventory する。- YAML scalar
1(int)と canonical string"v1"を区別し、最終 mutation 前に exact canonical value を保証するための最小 enforcement point を決定する。 - malformed MRC が refinement に流入した場合に、body-author-fixable な deterministic repair / rewrite として回収可能かを確認し、不必要な operator-only stop がある場合は別 follow-up 候補として記録する。
- 再発防止 implementation が必要なら、既存 Issue を dedupe したうえで 1 Issue = 1 PR の bounded follow-up を起票する。
Out of Scope
- MRC schema version 自体の変更(
v1を別値へ移行しない)。 - Machine-Readable Contract 全体の parser / schema governance の大規模再設計。
- 実装: check_session_recording_runtime_safety.py の ghs_ redaction パターンを新形式トークンに対応させる #2734 / 実装: summarize_agent_transcript.py の GitHub token redaction パターンを fine-grained PAT (github_pat_) に対応させる #2736 / 実装: get_ci_failed_log.py の diagnostic/error 出力を redact_tokens() 経由に統一する #2759 の各 feature scope を本 Issue で修正・実装すること。
- 既存 malformed Issue を一括書き換えする migration。
- 新しい汎用 approval harness / security framework の追加。
Acceptance Criteria
- AC1: 実装: check_session_recording_runtime_safety.py の ghs_ redaction パターンを新形式トークンに対応させる #2734 / 実装: summarize_agent_transcript.py の GitHub token redaction パターンを fine-grained PAT (github_pat_) に対応させる #2736 / 実装: get_ci_failed_log.py の diagnostic/error 出力を redact_tokens() 経由に統一する #2759 について、
contract_schema_version: 1が GitHub に永続化された実際の authoring/materialization/write 経路を evidence 付きで分類し、正常対照 実装: persist_retrospective_run.py の secret redaction パターンを新形式 ghs_ App installation token に対応させる #2727 / 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728 との差分を説明できる。 - AC2: canonical
v1を既に生成・検証する repository assets と、malformed value を許した/迂回された boundary の ownership を明確にする。単に body-authoring docs を再記述するだけで完了扱いにしない。 - AC3:
contract_schema_versionが YAML int1/ string"1"/ unknown value の場合に GitHub write 前に拒否または canonical repair され、string"v1"のみが通る最小 enforcement design を決定する。 - AC4: malformed value が既存 Issue の refinement に入った場合の current routing を確認し、body-author-fixable な修正が不要な human/operator escalation に分類されないことを確認する。ギャップがあれば別 follow-up として dedupe/materialize する。
- AC5: 実装が必要と判定した場合、affected path・regression test・verification command・dedupe_key を持つ bounded implementation follow-up が起票済みである。実装不要なら、その根拠と canonical route enforcement が再現可能な evidence として記録されている。
Verification Commands
本 Issue は research-only のため、調査結果で exact affected path が確定してから implementation follow-up の VC を定義する。最低限、以下を evidence として取得する。
# canonical authoring / validation assets
rg -n 'contract_schema_version.*v1' .claude/skills/create-issue .claude/skills/edit-issue .claude/skills/issue-contract-review .claude/skills/issue-refinement-loopGitHub 側では #2734 / #2736 / #2759 と正常対照 #2727 / #2728 の body・timeline・関連 authoring/materialization evidence を比較する。
Allowed Paths
.claude/skills/create-issue/.claude/skills/edit-issue/.claude/skills/issue-contract-review/.claude/skills/issue-refinement-loop/scripts/agent-guards/schemas/docs/dev/
research-only のため、上記は read-only investigation scope。production file の変更は本 Issue では行わない。
Stop Conditions
- 原因が repository-owned path ではなく外部クライアント/手動操作にしか存在せず、repository 側で enforceable な boundary がないと evidence 付きで確定した場合。
- secret / credential の新規取得・利用が必要になる場合。
- destructive operation が必要になる場合。
- 調査結果から bounded implementation scope を確定できず、複数の独立問題へ分割が必要になった場合は、dedupe 後に個別 follow-up を materialize して本 research を結論化する。
Required Skills
- issue-refinement-loop(調査結果を implementation-ready contract へ materialize する場合)
Required Design References
.claude/skills/create-issue/references/body-authoring.mdschemas/catalog.yaml
Source
- Source finding: 実装: check_session_recording_runtime_safety.py の ghs_ redaction パターンを新形式トークンに対応させる #2734 OWNER review comment 実装: check_session_recording_runtime_safety.py の ghs_ redaction パターンを新形式トークンに対応させる #2734 (comment)
- Reproductions: 実装: check_session_recording_runtime_safety.py の ghs_ redaction パターンを新形式トークンに対応させる #2734 / 実装: summarize_agent_transcript.py の GitHub token redaction パターンを fine-grained PAT (github_pat_) に対応させる #2736 / 実装: get_ci_failed_log.py の diagnostic/error 出力を redact_tokens() 経由に統一する #2759
- Valid controls: 実装: persist_retrospective_run.py の secret redaction パターンを新形式 ghs_ App installation token に対応させる #2727 / 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728
- Existing non-duplicate follow-ups:
- 再発防止: ghs_ installation token の synthetic fixture / terminology を共通化する #2753:
ghs_synthetic fixture / terminology 共通化 - 再発防止: follow-up Issue 起票時に既存テストと CI coverage を repository-wide preflight する #2757: follow-up Issue 起票時の既存 test / CI coverage preflight
- 調査: secret-pattern migration の Issue authoring/refinement で consumer semantics 混同と false-pass VC を検査する regression/gate を設計する #2769: secret-pattern migration の consumer semantics / false-pass VC authoring regression
- 再発防止: ghs_ installation token の synthetic fixture / terminology を共通化する #2753:
Activity