Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "#2084 OWNER directive(comment #5249582962 / #5249734344): GitHub Issue labels は人間向け presentation metadata であり、AI の readiness・quality・implementation permission・handoff・stop condition の authority にしてはならない。label→gate 結合を production consumer から除去し、label sync は readiness decision 後の best-effort presentation sync として再定義する。"
change_kind: workflowParent Issue
なし(単独改善)
Parent Goal Ref
- Goal: N/A(単独改善のため親 Issue なし)
- Desired Destination: N/A
Current Validated Scope
- OWNER directive(comment #5249582962 / #5249734344)により、GitHub Issue labels を presentation-only / non-authoritative metadata として SSOT 化する contract へ scope reframe することが承認されている
- label→gate 結合が実在する production consumer(docs/dev/workflow.md、build_intake_capsule.py、impl-review-loop/steps/preparation.md、issue-refinement-loop/SKILL.md・termination-policy.md、implement-issue/SKILL.md)から結合を除去する
Remaining Parent Gaps
なし(単独改善のため親 Issue に紐づく残課題はない)
Background
本 Issue は当初「issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する」という狭い実装として起票された(背景: #2076)。しかし OWNER が以下のコメントで前提を覆した。
- 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 (comment) — 「ラベルは人間向け表示情報であり、AI の着手可否・品質を保証する何かではない。ラベルに何らかの制限を発生させないでほしい」
- 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 (comment) — label→gate 結合が本番コードに複数実在することの技術的指摘と、Readiness Plane / Presentation Plane 分離の推奨設計
- 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 (comment) — 上記方針の再確認と、workflow defect(構造化 payload 要求・scope expansion を stop 条件にする不備)を別 Issue(実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086)として起票する指示
codebase-investigator による現行 main(HEAD 9aa2cb4)の直接検証で、以下の label→gate 結合が実在することを確認済み。
docs/dev/workflow.md:189-203—implementation_consumer_ready_contract.required_routing_labels: [phase/implementation]/hard_stop_labels: [state/needs-human].claude/skills/impl-review-loop/scripts/build_intake_capsule.py:300-303—phase_label_ok = "phase/implementation" in label_namesがready_status(_next_action_route(同ファイル L771-783)が参照する readiness gate)に直結.claude/skills/impl-review-loop/steps/preparation.md:106-118— Intake Gate のmetadata_not_ready(最高優先)がphase/implementationlabel 欠落を停止条件にしている.claude/skills/issue-refinement-loop/SKILL.mdStep 0 —state/needs-human/state/doneを hard stop として確認する記述.claude/skills/issue-refinement-loop/references/termination-policy.md:276-393—LOOP_HANDOFF_RESULT_V1.metadata.phase_label_readyがimpl_ready条件 4 の必須項目.claude/skills/implement-issue/SKILL.md—phase/implementation依存の記述が残存
一方、docs/dev/github-ops.md:187-204(#211 由来)には既に state/blocked / state/queued を「補助・派生表示であり AI 着手可否の primary signal ではない」とする先例が存在する。本 Issue はこの先例を全ラベル種別(phase/implementation / state/needs-human / state/done / triage-required / agent/implementer)へ一般化する。
なお、ワークフロー本体の欠陥(構造化 ANCHOR_SCOPE_REFRAME_V1 要求・scope expansion を stop 条件にする問題)は既存 OPEN Issue #2086 が扱う。本 Issue はその修正の完了を前提条件にしない(OWNER 指示)。#2053 / Draft PR #2068(未マージ、freeform OWNER authority transport が主題)は、gh pr diff 2068 で確認した変更ファイル一覧(schemas、command_registry.py / decide_next_loop_action.py / run_refinement_preflight.py / scope_signal_delta.py、関連 test)が本 Issue の Allowed Paths と一切重複しないため、依存関係なし。
Outcome
GitHub Issue labels を presentation-only / non-authoritative metadata として SSOT 化し、labels と readiness/control-flow の結合を production consumer(docs/dev/workflow.md、build_intake_capsule.py、impl-review-loop/steps/preparation.md、issue-refinement-loop/SKILL.md・termination-policy.md、implement-issue/SKILL.md)から除去する。その後、triage-required remove、phase/implementation / agent/implementer add 等の label mutation は、readiness decision 後にのみ実行される best-effort presentation sync として再定義する。
Readiness Plane(readiness の authority)
Issue native open/closed state、Machine-Readable Contract、GitHub native dependency(Depends on #N fallback 含む)close 状態、explicit operator/OWNER directive、CONTRACT_REVIEW_RESULT_V1 / review / test / CI 結果を authority とする。
Presentation Plane(label の位置づけ)
GitHub labels は人間の認知・分類・検索補助に限定する。label mutation の失敗は warning/telemetry にはできるが、readiness failure にしてはならない。
不変条件: label_sync.result(applied | noop | failed)の値を変えても status / routing_action / implementation_allowed が変化してはならない。
In Scope
docs/dev/workflow.mdのimplementation_consumer_ready_contractからrequired_routing_labels/hard_stop_labelsの label-based gate 定義を除去し、readiness authority を non-label evidence(dependency close 状態・contract review status・GitHub native issue state)のみで再定義する。「Issue labels are presentation-only」の SSOT 原則を明記する。docs/dev/github-ops.mdに、既存のstate/blocked/state/queued「補助・派生表示」原則を全ラベル種別へ一般化した SSOT 原則セクションを追加する。.claude/skills/impl-review-loop/scripts/build_intake_capsule.pyのready_status/_next_action_routeからphase_label_ok依存を除去する(ready_tupleのフィールド自体は観測用に残してよいが、ready_statusの pass/fail 判定には使わない)。.claude/skills/impl-review-loop/steps/preparation.mdの Intake Gatemetadata_not_readyサブ理由からphase/implementationlabel 欠落条件を除去する。.claude/skills/issue-refinement-loop/SKILL.mdStep 0 の hard stop 条件からstate/needs-human/state/doneの label 単独判定を除去し、停止には OWNER の明示指示やhuman_judgment_required(scope-signal-guard 等の別 authority)が必要である旨を明記する。.claude/skills/issue-refinement-loop/references/termination-policy.mdのLOOP_HANDOFF_RESULT_V1からmetadata.phase_label_readyをimpl_ready条件から除去し、label sync をpresentation_sync(non-authoritative telemetry)として再定義する。auto_fixes.requiredに triage label 遷移を追加しない契約を明記する。.claude/skills/issue-refinement-loop/scripts/apply_triage_label_transition.py(新規)を追加し、triage-requiredremove・phase/implementation/agent/implementeradd を readiness decision 後の best-effort presentation sync として実行する(既存のcreate_issue_txn.py reconcile --labelは add 専用で remove 非対応のため、新規スクリプトとする)。.claude/skills/implement-issue/SKILL.mdのphase/implementation依存記述を、readiness gate ではなく routing/classification 用の非authoritative 参照であることが分かるよう更新する。- 上記変更を固定する既存テスト(
.claude/skills/impl-review-loop/tests/test_intake_gate.py、.claude/skills/issue-refinement-loop/tests/test_loop_policy.py)を新しい契約に整合させる。label permutation([]/triage-required/phase/implementation/state/needs-human等)でも readiness result が変わらないことを固定する negative/parameterized test は新規ファイル.claude/skills/impl-review-loop/tests/test_label_authority_invariants.pyに追加する。
Out of Scope
- GitHub comment が人間入力か AI 投稿かを判別する仕組み(実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 の Out of Scope と同じ理由で扱わない。個人趣味開発として受容する)。
issue-refinement-loopの anchor comment / scope reframe workflow 自体の修正(実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 の担当)。#2053/ Draft PR fix(issue-refinement-loop): bind freeform OWNER scope authority end-to-end and expose routing telemetry #2068 の freeform OWNER authority transport スキーマの再実装。- cross-repository mutation、destructive operation、secret/credential exposure、paid external service、repository permission escalation。
state/blocked/state/queuedの cleanup ロジック自体の変更(既に 改善: state/blocked/state/queued を着手判定から除外し、refinement 時の stale state label 掃除に縮退する #211 で hygiene 化済みであり、本 Issue はその原則を他ラベルへ一般化するのみ)。- independent な新しい product goal の追加。
Acceptance Criteria
- AC1:
docs/dev/workflow.mdのimplementation_consumer_ready_contractからrequired_routing_labels/hard_stop_labelsキーが除去され、readiness authority が non-label evidence のみで再定義されている。「labels are presentation-only」の SSOT 原則文が明記されている。 - AC2:
docs/dev/github-ops.mdに、state/blocked/state/queuedの既存「補助・派生表示」原則を全ラベル種別へ一般化した SSOT セクションが追加されている。 - AC3:
build_intake_capsule.pyのready_status(_next_action_routeが参照する readiness gate)がphase_label_okに依存しなくなっている。同一 body/dependency/contract-review 状態で labels が[]でも["phase/implementation"]でもready_statusが変わらないことを pytest(test_label_authority_invariants.py::test_ready_status_independent_of_phase_label、新規テストファイル)で固定する。 - AC4:
impl-review-loop/steps/preparation.mdの Intake Gatemetadata_not_readyからphase/implementationlabel 欠落条件が除去されている。test_intake_gate.pyの該当 assertion が新しい契約に整合するよう更新されている。 - AC5:
issue-refinement-loop/SKILL.mdStep 0 の hard stop 条件からstate/needs-human/state/doneの label 単独判定が除去され、停止には別 authority(OWNER 明示指示・human_judgment_required)が必要である旨が明記されている。state/doneの代わりに GitHub native Issueclosedstate を参照する。test_loop_policy.pyの該当 assertion が新しい契約に整合するよう更新されている。 - AC6:
termination-policy.mdのLOOP_HANDOFF_RESULT_V1からmetadata.phase_label_readyがimpl_ready条件から除去され、label sync がpresentation_sync(non-authoritative telemetry)として再定義されている。auto_fixes.requiredに triage label 遷移を追加しない契約が明記されている。 - AC7:
apply_triage_label_transition.py(新規)が、triage-requiredremove・phase/implementation/agent/implementeradd を readiness decision 後の best-effort presentation sync として実行し、applied | noop | failedを返す。permission/network/API failure が warning として観測可能であり、readiness/status/routing_action/implementation_allowedを変えないこと、unrelated labels を保持し idempotent であることを pytest で固定する。 - AC8: label permutation(
[]/triage-required/phase/implementation/state/needs-humanの各組み合わせ)で readiness result が変わらないことを固定する parameterized test(test_label_authority_invariants.py::test_ready_status_label_permutation_matrix、新規テストファイル)が追加されている。 - AC9:
## Runtime Verification Applicabilityセクションが本文に追加されている(レガシー Issue の C9 対応)。 - AC10:
implement-issue/SKILL.mdのphase/implementation依存記述が、readiness gate ではなく routing/classification 用の非authoritative 参照であることを明記する形に更新されている。
Runtime Verification Applicability
decision: immediate
reason: "本 Issue の核心は build_intake_capsule.py の ready_status / _next_action_route、preparation.md の Intake Gate、issue-refinement-loop の hard stop、LOOP_HANDOFF_RESULT_V1 の impl_ready 判定という複数 production consumer の routing 挙動を変更することであり、grep 等の静的検査だけでは label 除去後も readiness/routing が意図通り不変であることを証明できないため。"
applicable_acs: [AC3, AC4, AC5, AC7, AC8]
execution_environment:
- "uv run --locked pytest による local subprocess / fixture-backed 挙動検証"
live_github_mutation: prohibited
network_required: false
skip_conditions:
- "uv / pytest / python3 が利用できない場合は exit 77 とし PASS に変換しない"
fallback_policy:
fallback_success_is_pass: false
notes: "grep のみの static check や mock-only route だけで AC3/AC5/AC7/AC8 の behavior invariance を PASS としない"
artifact_requirements:
- "label permutation([] / triage-required / phase/implementation / state/needs-human)ごとの readiness/ready_status 結果"
- "apply_triage_label_transition.py の applied/noop/failed 各分岐での status/routing_action/implementation_allowed 不変性の証跡"Verification Commands
# AC1
$ ! grep -n -e "required_routing_labels" -e "hard_stop_labels" docs/dev/workflow.md
$ grep -n -e "presentation-only" -e "presentation_only" docs/dev/workflow.md# AC2
$ grep -n -e "presentation-only" -e "presentation_only" docs/dev/github-ops.md# AC3
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_label_authority_invariants.py::test_ready_status_independent_of_phase_label -v# AC4
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_intake_gate.py -v# AC5
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_loop_policy.py -k "hard_stop" -v# AC6
$ ! grep -n "phase_label_ready" .claude/skills/issue-refinement-loop/references/termination-policy.md
$ grep -n -e "presentation_sync" -e "label_sync_observation" .claude/skills/issue-refinement-loop/references/termination-policy.md# AC7
$ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_apply_triage_label_transition.py -v# AC8
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_label_authority_invariants.py::test_ready_status_label_permutation_matrix -v# AC9
# (本 Issue 自身が既に Runtime Verification Applicability セクションを含むための自己参照チェック)
# baseline-expect: pass
$ gh issue view 2084 --repo squne121/loop-protocol --json body -q .body# AC10
# (phase/implementation への言及自体は残存する。削除ではなく非authoritative化の明記のため既存記述で現在も一致する)
# baseline-expect: pass
$ grep -n "phase/implementation" .claude/skills/implement-issue/SKILL.mdAllowed Paths
docs/dev/workflow.mddocs/dev/github-ops.md.claude/skills/impl-review-loop/steps/preparation.md.claude/skills/impl-review-loop/scripts/build_intake_capsule.py.claude/skills/impl-review-loop/tests/test_intake_gate.py.claude/skills/impl-review-loop/tests/test_build_intake_capsule.py.claude/skills/impl-review-loop/tests/test_label_authority_invariants.py(新規).claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/references/termination-policy.md.claude/skills/issue-refinement-loop/tests/test_loop_policy.py.claude/skills/issue-refinement-loop/scripts/apply_triage_label_transition.py.claude/skills/issue-refinement-loop/scripts/tests/test_apply_triage_label_transition.py.claude/skills/implement-issue/SKILL.md
Stop Conditions
以下は停止条件として維持する(標準テンプレート項目に加え、本 Issue 固有の項目を追加する)。
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- OWNER directive 自体が意味的に矛盾・曖昧で、same-goal の実装を一意に導出できない場合
- cross-repository / cross-target direct mutation が必要になった場合
- independent な新しい product goal を追加する必要があり、現在の OWNER directive から同一 Issue scope と合理的に結び付けられない場合
#2053/ Draft PR fix(issue-refinement-loop): bind freeform OWNER scope authority end-to-end and expose routing telemetry #2068 が merge され、本 Issue の Allowed Paths(下記)と実際に衝突する変更を含んでいた場合(現時点では無衝突を確認済み。merge 後は再確認する)
次は停止条件にしない(今回の OWNER directive で明示的に承認済み): 本 Issue の Allowed Paths が当初の狭い triage-label-transition スコープを超え、docs/dev/workflow.md / docs/dev/github-ops.md / impl-review-loop / implement-issue という別 architecture layer / 別 skill を含むこと自体(下記 Allowed Paths として既に確定済みのスコープ内の変更に限る。それを超える追加拡張は上記「Allowed Paths 外の変更が必要と判明した場合」の対象とする)。
Required Skills
なし
Required Design References
- docs/dev/workflow.md#implementation-issue-canonical-contract実装-issue-の正規契約
- docs/dev/github-ops.md#ラベル運用
- .claude/skills/issue-refinement-loop/references/termination-policy.md#loop_handoff_result_v1--terminal-contract終端契約-ssot
- 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 comment #5249582962(技術指摘・Readiness/Presentation Plane 設計)
- 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 comment #5249734344(方針再確認・実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 起票指示)
- 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086(workflow-level defect の follow-up、依存はしないが同じ問題文脈)
- 改善: state/blocked/state/queued を着手判定から除外し、refinement 時の stale state label 掃除に縮退する #211(
state/blocked/state/queuedhygiene 化の先例)
Scope Delta(任意)
本 Issue は operator が interactive session で issue-refinement-loop に対し、OWNER directive(comment #5249734344 と、その場の operator 指示)を preflight.run.with_human_context の operator-asserted human-context として明示投入した上で in-place reframe した。scope 拡張(Allowed Paths を issue-refinement-loop 配下のみから docs/dev・impl-review-loop・implement-issue へ拡張)は、今回の明示的な OWNER/operator 承認に基づく。
OWNER_DIRECTIVE_MATERIALIZED_FROM_INTERACTIVE_PROMPT_V1:
- source: 2026-08-11 の interactive operator instruction + 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 comment #5249734344
- target: 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084
- scope expansion 自体は stop condition にしない
implementation_allowed=falseを維持し、本 rewrite 後の fresh gate(preflight/review/readiness)通過まで実装は許可しない- destructive / secrets / paid service / permission escalation は承認していない
- 本 assertion は physical human provenance を保証するものではなく、operator が選択した human-context lane に基づく運用上の trust boundary である(実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 と同じ Trust Model を適用)
Scope Delta 追記(PR #2092 comment #5251894253 由来、2026-08-11)
OWNER が実装 PR #2092 に対し REQUEST_CHANGES を投稿した
(#2092 (comment) 、OWNER, 2026-08-11)。
以下は当該 comment の P0/P1/P2 指摘に基づく 追記型 Scope Delta である(既存内容は削除・改変しない)。
P0 blocker(Allowed Paths 拡張): 現行 main の .claude/skills/issue-contract-review/SKILL.md は
今も state/needs-human label があると BLOCKED 判定する記述を残しており、
.claude/skills/issue-contract-review/references/contract-compliance.md も State Label を
compliance check(fail で BLOCKED)に含めている。結果として
state/needs-human label → issue-contract-review BLOCKED → CONTRACT_REVIEW_RESULT_V1 != go
→ readiness 不成立、という transitive な label→readiness 結合が上流に残存しており、
本 Issue の OWNER directive(label は readiness authority にしない)と矛盾する。
既存の permutation test は CONTRACT_SNAPSHOT_ENSURE_RESULT_V1.status="go" を固定注入して
issue-contract-review 自体をバイパスしており、この上流経路の invariant を証明していない。
OWNER 指示に基づき、Allowed Paths を以下 4 項目拡張する。
.claude/skills/issue-contract-review/SKILL.md.claude/skills/issue-contract-review/references/contract-compliance.md.claude/skills/issue-contract-review/tests/(既存 test ファイル。具体パスは実装時に repo を検索して特定する)docs/dev/workflows/impl-review-loop-design.md(derived design doc)
checks.state_label を残す場合は observational telemetry に限定し、
CONTRACT_REVIEW_RESULT_V1.status の算出に寄与させない契約とする。
追加 Acceptance Criteria:
- AC11:
issue-contract-review/SKILL.mdとcontract-compliance.mdからstate/needs-humanlabel(および他の label)を readiness/BLOCKED 判定の authority として使う記述が除去され、CONTRACT_REVIEW_RESULT_V1.statusの算出が label に依存しなくなっている。label を observational telemetry として残す場合は「readiness status 算出には使わない」契約が明記されている。 - AC12: labels を変えても
issue-contract-reviewの最終 readiness(CONTRACT_REVIEW_RESULT_V1.status)が不変であることを固定する regression test が追加されている(既存のstatus: go固定注入ではなく、issue-contract-review自体を実行する経路で検証する)。 - AC13:
apply_triage_label_transition.pyの_default_run()のsubprocess.run()に bounded timeout が設定され、TimeoutExpired時にresult: failed+ warning telemetry を返し exit 0 で終了することを pytest で固定する。また label mutation 後にgh issue view --json labels相当の readback を行い、requested delta が実際に成立したことを確認してからappliedを返す実装に更新され、これも pytest で固定する。 - AC14:
docs/dev/workflows/impl-review-loop-design.mdの Invocation Contract 記述が、新しい label-authority 契約(labels は readiness gate ではない)に整合するよう更新されている。
P1(production 配線の契約明確化): 新設 apply_triage_label_transition.py は現時点で production consumer に
一度も配線されていない。Outcome の記述を明確化する。本 Issue の成果物は standalone utility の提供であり、
orchestrator(issue-refinement-loop 等)への配線は follow-up とする。配線自体は Out of Scope として明記する。
P1(timeout 未設定)/ P2(readback なし): 上記 AC13 に反映済み。
P2(derived design doc の追随): 上記 AC14 に反映済み。
Verification Commands の扱い: AC11-AC14 用の Verification Commands 追加は本 edit では行わない
(実装時に issue-contract-review 配下の実際のテストファイル名を確認してから追記する必要があるため)。
実装 worker が issue-contract-review 配下の既存テスト構成を確認した上で、Issue コメントとして
AC11-AC14 の Verification Commands を追記すること。
CI 状況(参考): PR #2092 head e2c7d3f3 の CI は green だったが、その後 main が #2081 マージで
21501ba に進み、PR branch が diverged / behind_by: 1 になっている。current main 取り込み後の
fresh CI が必要。
出典: PR #2092 comment #2092 (comment)
(OWNER, 2026-08-11)。
Notes for Reviewer(レビュアー向け補足)
Scope Collision (C1) advisory: check_issue_overlap.py(新 Allowed Paths で実行)は多数の OPEN Issue を候補として検出したが、大半は SKILL.md / termination-policy.md という共有 hub ファイルへの無関係な別セクション追記であり false positive(既存 #2084 body の Notes for Reviewer と同じパターン)。個別に確認した主要候補:
- 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086:
docs/dev/workflow.md/SKILL.md/termination-policy.mdで overlap。ただし 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 は anchor comment / scope reframe workflow の defect 修正が主題で、本 Issue は label authority contract が主題。異なる関数・異なるセクション。non-conflict。 - 実装: fix(issue-refinement-loop): bind freeform OWNER scope authority end-to-end and expose routing telemetry #2053 / Draft PR fix(issue-refinement-loop): bind freeform OWNER scope authority end-to-end and expose routing telemetry #2068:
SKILL.md/termination-policy.mdで overlap(宣言上の Allowed Paths のみ)。gh pr diff 2068で確認した実差分ファイル(schemas、command_registry.py等)は本 Issue の Allowed Paths と無関係。non-conflict、依存なし。 - 実装: root mission と completion predicates を run-state に固定し、follow-up/compaction 後の短期 goal 置換と未完了 finalization を防止する #2051(root mission / completion predicates):
SKILL.md/termination-policy.mdで overlap。finalization gate(reject terminal response if completion predicates not met)セクションであり、label authority セクションとは別。non-conflict。 - consumer 側で CONTRACT_REVIEW_ONCE_RESULT_V1.applicability フィールドを読むよう更新する #1944(
CONTRACT_REVIEW_ONCE_RESULT_V1.applicability読み取り):preparation.mdの同一 Intake Gate セクション、implement-issue/SKILL.mdで overlap。要調整: 両 Issue とも Intake Gate ロジックに触れるため、実装順序(どちらが先行マージするか)とマージ時の rebase を実装時に明示する。ただし変更対象の具体ロジック(applicability field 読み取り vsphase_label_okgate 除去)は異なる。 - 実装: issue-contract-review の human_judgment に対する人間 override を CONTRACT_REVIEW_HUMAN_OVERRIDE_V1 スキーマで記録・検出できるようにする #1348(human override 記録):
build_intake_capsule.pyの同一ファイルだが_next_action_route/ready_statusとは別関数(override 記録ロジック)。non-conflict。 - 実装: fix(issue-refinement-loop): no-human-approval autonomy mode を loop state routing に明示する #1007(
autonomy_modefield 追加):SKILL.md/termination-policy.md/workflow.mdで overlap するが、LOOP_STATE_V1.autonomy_modeという別フィールド。non-conflict。
edit_intent: 追記・置換型(既存セクションの意味を変更する箇所は AC に明記した該当セクションのみ)。
Activity
squne121 commentedon Aug 11, 2026
そもそもGitHub Issueのラベルは、人間向けに分かりやすくするものであって、GitHub Issueの品質を保証する何かではないので、AIの作業によってラベルを付与してもいいけど、そのラベルに対して何らかの制限を発生させないようにしてほしいです。あくまで人間の認知を助けるために付与しているものとして、ドキュメントにも明記してほしいです。
squne121 commentedon Aug 11, 2026
判定
NEEDS_REFRAME / implementation_go = falseです。指定コメントによって、Issue #2084 の問題設定そのものが変わっています。OWNER の要求は「
triage-requiredの後処理を自動化する」ではなく、GitHub Issue のラベル全般を人間向け表示情報に限定し、ラベルの有無から AI の着手可否・品質・handoff・停止を決めないことです。さらに、その原則をドキュメントへ明記するよう明示されています。現行 #2084 はこの要求を満たせません。むしろ、そのまま実装すると既存の label→gate 結合を強化する危険があります。
P0-1 — #2084 の Contract が OWNER コメントより古い
現在の Issue は
triage_label_transitionをLOOP_HANDOFF_RESULT_V1.metadataへ接続し、approved/impl_ready時にtriage-requiredを除去してphase/implementation/agent/implementerを preserve/add する設計です。AC もほぼすべて「ラベル遷移を実装したか」に集中しています。しかし OWNER はその後、「ラベルは品質保証ではない」「ラベルによって何らかの制限を発生させない」「人間の認知補助であることを docs に明記」と要求しています。
ところが Allowed Paths には
docs/dev/workflow.mdもdocs/dev/github-ops.mdもありません。またimpl-review-loop等は明示的に Out of Scope です。したがって、これは軽微な AC 追記ではなく scope reframe 必須です。現 Contract のまま implementation に進ませるべきではありません。
P0-2 — 実際には
phase/implementationが今も hard gate になっているOWNER の懸念は仮説ではなく、current main で実際に起きています。
docs/dev/workflow.mdは一方で「auto-label は AI 着手可否 state machine に使わない」「triage-requiredは consumer ready contract の必須条件ではない」としています。ところが同じ SSOT の
implementation_consumer_ready_contractでは、required_routing_labels: [phase/implementation]hard_stop_labels: [state/needs-human]と定義されています。
さらに production-facing な箇所にも残っています。
impl-review-loop/steps/preparation.mdはphase/implementationがないだけでintake_gate_failed: metadata_not_readyとし、do_not_continue_to_step_1: trueにします。build_intake_capsule.pyも、ready_status = pass iff title_prefix_ok && phase_label_ok && issue_state_openとしており、ラベル欠落で routing を変えています。
issue-refinement-loop自身も Step 0 でstate/needs-human/state/doneを hard stop としています。implement-issueにも consumer ready contract の一部としてphase/implementationが残っています。ただしこちらはすでにstate/needs-human単独では停止しない方向に部分修正されています。つまり #2084 の Out of Scope にしている箇所こそ、OWNER コメントを満たすための本体です。
P0-3 —
triage_label_transitionを handoff のauto_fixes.requiredに入れてはいけない特に危険なのは #2084 Notes の「既存
metadata_hygiene/stale_state_label_cleanupauto-fix pattern に揃える」という案です。現在の
LOOP_HANDOFF_RESULT_V1はmetadata.phase_label_readyを持ち、impl_ready条件 4 で phase label または auto-fix evidence を要求します。さらに skipped auto-fix があるとimpl_readyを禁止します。これは PR #635 / Issue #628 で導入された設計です。実際に PR #635 の diff は
phase_label_readyとmetadata_hygieneをimpl_readyinvariant に組み込みました。したがって
triage_label_transitionを同じauto_fixes.requiredに追加すると、「ラベル更新に失敗したので impl_ready になれない」
という、OWNER が禁止した構造を新しく増やします。
ラベル同期は handoff invariant の外側へ出す必要があります。
P1 — これは過去の #211 方針をラベル全般へ一般化する変更
Issue #211 はすでに
state/blocked/state/queuedを AI 着手判定から除外し、「dependency close 状態を primary signal とする」「state label は hygiene / derived display」とする修正を実施済みです。一方、その後の Issue #564 / PR #568 が
phase/implementation欠落をmetadata_not_readyhard gate として導入しました。PR #568 の diff に明示されています。さらに #628 / #635 で
phase_label_readyが handoff invariant へ入りました。今回の OWNER コメントは、この歴史的な split-brain を整理して、
と一本化する契機と読むのが自然です。
P1 — 現行 AC / VC では「非 authoritative」を証明できない
#2084 の AC1〜AC4 はほぼ
grepです。文字列を追加すれば通るので、「label mutation failure → impl_ready=false」
という実装でも AC を満たせます。
最低限、修正後は次の振る舞いを machine test で固定すべきです。
[]、triage-required、phase/implementation、state/needs-humanのどれでも readiness result が変わらない。phase/implementation欠落でimpl-review-loopがintake_gate_failedにならない。state/needs-humanラベル単独では refinement が停止しない。停止には OWNER の明示指示や structuredhuman_judgment_requiredなど別 authority が必要。LOOP_HANDOFF_RESULT_V1.status/routing_actionは変わらない。state/doneではなく GitHub native Issueclosedstate を終了判断に使う。P1 — #2084 自身が「ラベルは readiness 証拠にならない」反例になっている
現在の #2084 には
phase/implementation、agent/implementer、triage-requiredが同時に付いています。つまり
phase/implementationやagent/implementerが付いていること自体から「triage 済み」「implementation-ready」を証明できません。template auto-label と workflow state が既に重なっているためです。これは OWNER の「人間の認知補助」というモデルの方が、現実のリポジトリ状態を正確に表しています。
外部仕様との照合
GitHub 公式も labels を work の categorize / track 用機能として説明しており、品質保証 primitive とは位置付けていません。([GitHub Docs]1)
実装面では、新しい専用 mutation mechanism を発明する必要もありません。現行 GitHub CLI の
gh issue editは同一 command で--add-labelと--remove-labelの両方を正式に提供しています。([GitHub CLI]2)REST API も「既存 labels に追加」と「特定 label の除去」を個別 endpoint として提供しています。一方
Set labels for an issueは既存 labels 全体を置換します。したがって unrelated label を保持する本用途では、incremental add/remove の方が安全です。後者は stale な read-modify-write で他 label を上書きし得る、という推論です。([GitHub Docs]3)label mutation には Issues write 権限が必要ですが、その権限不足は今回の設計では display sync warning に留め、implementation readiness を block させるべきではありません。([GitHub Docs]3)
なお GitHub Actions 自体は
issues.labeled/issues.unlabeledを workflow trigger にできます。したがって「skill から gate を消したから完了」ではなく、将来的な Actions も含め「label event を品質/着手 authority にしない」という SSOT が必要です。([GitHub Docs]4) 現在の repo code search ではgithub.event.labelやcontains(github.event.issue.labels...)による workflow gate は検出しませんでしたが、これは恒久保証ではありません。推奨する再設計
最も安全なのは Readiness Plane と Presentation Plane を明確に分離することです。
LOOP_HANDOFF_RESULT_V1に残すならmetadataやauto_fixes.requiredではなく、例えばpresentation_sync/label_sync_observationのような non-authoritative telemetry にすべきです。重要な invariant はこれです。
label_sync.resultの値を変えてもstatus・routing_action・implementation_allowedが変化してはならない。#2084 の修正方針
現状の Issue はそのまま実装せず、少なくとも以下へ reframe するのが妥当です。
P0 scope は
docs/dev/workflow.md/docs/dev/github-ops.mdを Allowed Paths に追加して「Issue labels are presentation-only / non-authoritative」を SSOT 化し、phase/implementationとstate/needs-humanを readiness/hard-stop contract から除外することです。impl-review-loop/steps/preparation.md、build_intake_capsule.py、issue-refinement-loop/SKILL.md、implement-issue/SKILL.mdと関連テストも consumer inventory に入ります。そのうえで、現在 #2084 が目的としている
triage-required → removeとphase/implementation/agent/implementer → addは best-effort presentation sync として実装するのがよいです。新しい script を作るなら、read current labels → delta 計算 →gh issue edit --remove-label ... --add-label ...→ readback の薄い wrapper で十分です。失敗は明示的に記録しますが、caller が warning に降格させます。現 #2084 の最大の問題は「ラベル遷移が足りない」ことではなく、「ラベルを readiness の複製 state として扱う古い契約がまだ複数 consumer に残っている」ことです。 指定コメントを正しく反映するなら、こちらを先に解消する必要があります。
squne121 commentedon Aug 11, 2026
issue-refinement-loop: human_escalation
## Runtime Verification Applicabilityセクションが本文にない(レガシー Issue、機械的に修正可能)scope_delta_decision.status: fail_closed(reason: no_anchor_scope_reframe_v1_payload、構造化ANCHOR_SCOPE_REFRAME_V1payload なし、allowed_path_deltas: [])のため自動 contract patch の対象にならない事実確認(codebase-investigator による検証、すべて confirmed)
OWNER コメントが主張する「GitHub Issue ラベルが readiness/gate として本番コードに結合している」という claim は、以下すべて実在を確認済みです。
docs/dev/workflow.mdのimplementation_consumer_ready_contract(required_routing_labels: [phase/implementation]/hard_stop_labels: [state/needs-human]).claude/skills/impl-review-loop/steps/preparation.mdの Intake Gate(phase/implementation欠落 →intake_gate_failed: metadata_not_ready→do_not_continue_to_step_1: true)build_intake_capsule.pyのready_status = pass iff title_prefix_ok && phase_label_ok && issue_state_openissue-refinement-loop/SKILL.mdStep 0 のstate/needs-human/state/donehard stopimplement-issueskill のphase/implementation依存(state/needs-human単独では停止しない方向に部分修正済み)LOOP_HANDOFF_RESULT_V1(termination-policy.md)のmetadata.phase_label_readyとimpl_ready条件4/5(auto-fix skipped でimpl_ready禁止)なぜ自動継続せず停止するか
現 #2084 は「
triage-requiredラベル遷移をLOOP_HANDOFF_RESULT_V1.auto_fixes.requiredに追加する」設計です。しかし OWNER の要求は「ラベルは人間向け表示情報であり、AI の着手可否・readiness を左右してはならない」という正反対の原則です。OWNER コメントが提案する修正範囲は本 Issue の Allowed Paths(issue-refinement-loop 配下のみ)を大きく超え、docs/dev/workflow.md、docs/dev/github-ops.md、impl-review-loop/steps/preparation.md、build_intake_capsule.py、implement-issueskill など複数 skill にまたがる architecture-level の変更を要求します。これは本 skill の Scope Change Stop Conditions(
## Allowed Paths に新規ディレクトリや別アーキテクチャ層が追加された、新規 Issue の起票が必要と判断した場合)に該当するため、issue-editor による自動書き換えではなく human judgment に委ねます(loop_iteration_approval_gate.default_required: falseは反復継続の承認のみを制御し、本 Stop Condition を上書きしません)。推奨する方針(human 判断待ち)
docs/dev/workflow.md/docs/dev/github-ops.mdを Allowed Paths に含む新規 Issue を起票し、「Issue labels are presentation-only(Readiness Plane と Presentation Plane の分離、label_sync.resultはstatus/routing_action/implementation_allowedを変えない)」という SSOT 原則を明文化し、phase/implementationのrequired_routing_labels化・state/needs-humanの hard-stop 化を consumer 側(build_intake_capsule.py、impl-review-loop/steps/preparation.md、issue-refinement-loop/SKILL.md等)から除去する。triage-required→ remove、phase/implementation/agent/implementer→ add を best-effort presentation sync(失敗しても readiness に影響しない telemetry)として再定義する形へ scope reframe する。あるいは 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 をこの P0 Issue の child として再構成する。Iteration 2 以降は、human が上記方針(新規 Issue 分割 / #2084 の scope reframe 内容)を確定した後に再開してください。
squne121 commentedon Aug 11, 2026
人間が与えているコメントに対して構造化 ANCHOR_SCOPE_REFRAME_V1 payloadを要求しているという実装の不備があります。
人間が与えているコメントにてスコープ拡張が指示されているのに、それを停止条件としている実装の不備があります。
このGitHub Issueの範囲だけでなく、そもそものワークフローに問題があるので、修正 GitHub Issueを起票してほしいです。
AIエージェントには、人間がGitHubに行ったコメントか、AIエージェントが出力したコメントか判別できないという問題があるので、しかしこれは個人趣味開発の範疇として、その問題を解消しないまま実装を進めていきたいです。
squne121 commentedon Aug 11, 2026
提唱アクションは、#2084 を別 Issue 待ちにせず、その場で architecture-level に reframe して refinement を完了させる方針が適切です。#2084 には現在
phase/implementation・agent/implementer・triage-requiredが同時に付いており、ラベル自体が readiness の証拠にならないことも live state から確認できます。 最新 OWNER コメント #5249734344 は、「構造化ANCHOR_SCOPE_REFRAME_V1を人間に要求すること」と「人間が指示した scope expansion 自体を停止条件にすること」を workflow defect と明示し、human/AI の物理的投稿者判別は個人開発では未解決のまま進める意思も示しています。その workflow defect 用 Issue は新規起票不要です。すでに #2086「operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する」が存在し、operator-selected human-context、exact path の agent 導出、scope expansion を停止条件にしないこと、#2084 の再現ケースまで AC に含んでいます。 また、その下位 transport 問題を扱う #2053 / PR #2068 はまだ OPEN / Draft / 未マージなので、current main に入った前提にはしない方がよいです。
current main にはすでに freeform human directive の互換経路がありますが、回帰テスト上、exact Allowed Path が書かれた directive は
contract_update_requiredへ進む一方、単なる「Allowed Paths を expand」は human escalation のままです。 したがって今回のプロンプトでは、まず SubAgent に exact inventory を作らせて全員の完了を待ち、それを root control-plane が operator-selected human context として controlled rewrite に接続するよう指定します。以下を Claude Code / 同等の repo-aware control-plane に渡すのがよいです。
対象リポジトリ:
squne121/loop-protocol対象:
issue-refinement-loopを実行し、Issue #2084 の contract refinement を完了してください。人間への反復承認確認は不要です。
loop_iteration_approval_gate.default_required: falseとして bounded loop を自動継続してください。ただし secret/credential exposure、destructive operation、cross-repository direct mutation、repository permission escalation、paid external service、または意味的に一意に解消不能な OWNER directive の衝突は従来どおり停止条件です。今回の OWNER decision は次のように解釈してください。
phase/implementation、agent/implementer、triage-required、state/needs-human、state/done等の label の有無だけで control flow を変更してはならない。applied / noop / failedがstatus、routing_action、implementation_allowedを変えてはならない。ANCHOR_SCOPE_REFRAME_V1を人間へ再要求しない。with_human_contextlane に明示投入した same-target comment を operational authority として扱い、「verified human」とは表現しない。最初に live state を取得する。Issue 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 の本文、全 OWNER comments、関連 Issue 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086、実装: fix(issue-refinement-loop): bind freeform OWNER scope authority end-to-end and expose routing telemetry #2053、PR fix(issue-refinement-loop): bind freeform OWNER scope authority end-to-end and expose routing telemetry #2068、current main SHA、関連する既存 tests / docs / skills / scripts を読み直す。古い pasted snapshot より live GitHub/current main を優先する。
mutation 前に read-only SubAgent を起動する。最低 1 体の
codebase-investigatorを使用し、必要なら独立した追加 read-only investigator を使う。SubAgent 自身による nested delegation は禁止する。SubAgent には少なくとも以下を調査させる。
docs/dev/workflow.mddocs/dev/github-ops.md.claude/skills/impl-review-loop/steps/preparation.md.claude/skills/impl-review-loop/scripts/build_intake_capsule.py.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/references/termination-policy.md.claude/skills/implement-issue/SKILL.md全 selected SubAgent の terminal result を待つこと。
一部の SubAgent が未完了の状態で Issue mutation に進んではならない。各結果について schema/terminal status、current-main relevance、source evidence、相互矛盾を root control-plane が確認する。矛盾があれば repository facts / live diff / tests を authority として root が解決する。解決不能な semantic conflict のみ停止する。
実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 の refinement authority は latest OWNER directive #5249734344 を canonical human-context source とする。#5249684194 は historical escalation evidence として保持するが、最新 OWNER decision を上書きさせない。
まず canonical
preflight.run.with_human_contextlane を使用する。command argv はcommand_registry.pyの current-main definition を materialize し、手書きの stale argv を優先しない。current main が、構造化
ANCHOR_SCOPE_REFRAME_V1不在または high-level scope expansion に exact path が無いことだけを理由にno_anchor_scope_reframe_v1_payload/expands_allowed_pathsで停止する場合、それを今回の OWNER decision を覆す新しい human judgment と解釈しない。これは 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 で既知の workflow defect である。current-main compatibility のため exact path authority が必要な場合は、root control-plane が Step 2 の confirmed inventory から exact path delta を導出し、controlled comment lane を用いて 1 件の operator-asserted human-context directive として materialize する。
materialized directive には以下を明示する。
OWNER_DIRECTIVE_MATERIALIZED_FROM_INTERACTIVE_PROMPT_V1squne121/loop-protocol#2084implementation_allowed=falseのまま contract rewrite と fresh gates のみを許可すること投稿後は live readback で body / comment id / target Issue を確認し、その URL を必ず
preflight.run.with_human_contextとして渡す。agent-report lane や unlabeled anchor に暗黙変換しない。Issue 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 は新規 P0 Issue に分割せず、原則として in-place reframe する。新しい contract の中心は次とする。
Goal / Outcome
GitHub Issue labels を presentation-only / non-authoritative metadata として SSOT 化し、labels と readiness/control-flow の結合を production consumer から除去する。その後、
triage-requiredremove、phase/implementation/agent/implementeradd 等は readiness decision 後の best-effort presentation sync としてのみ実行できるようにする。Readiness Plane
Issue native open/closed state、Machine-Readable Contract、dependency state、explicit operator/OWNER directive、review/test/CI 等の非-label evidence を authority とする。
Presentation Plane
GitHub labels は人間の認知・分類・検索補助に限定する。label mutation failure は warning/telemetry にはできるが readiness failure にしてはならない。
Acceptance Criteria は grep 中心ではなく behavior regression を要求する。最低限、以下を固定する。
[]、triage-required、phase/implementation、state/needs-human等に変化しても readiness result が変わらない。phase/implementation欠落だけで impl-review-loop intake がmetadata_not_ready/ stop にならない。state/needs-humanlabel 単独で issue-refinement-loop が停止しない。state/donelabel 単独を terminal authority にせず、GitHub native Issue state または別の authoritative termination state を使う。LOOP_HANDOFF_RESULT_V1.status、routing_action、implementation_allowedを変えない。triage-required → remove、phase/implementation/agent/implementer → addは decision 後の best-effort sync とし、permission/network/API failure は warning として観測可能にする。## Runtime Verification Applicabilitysection を追加する。decision は repository policy と実際の AC に基づいて investigator/reviewer が決定し、推測で固定しない。Allowed Paths は Step 2 の confirmed inventory を使って exact に更新する。少なくとも上記 docs / impl-review-loop / issue-refinement-loop / implement-issue consumer と、実際にその behavior を固定する test files を候補に含める。存在しない test path を捏造しない。新規 test が必要なら canonical test placement policy を確認してから Allowed Paths と AC/VC を同時に追加する。
実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 の Stop Conditions も新しい scope に整合させる。今回すでに OWNER が承認した same-goal の docs / consumer / test layer 追加を、rewrite 後に再度「Allowed Paths 外」「別 architecture layer」だけで停止させない。ただし independent product goal、cross-target mutation、destructive operation、secret/credential、paid external service、permission escalation、意味的に一意でない competing OWNER directive は停止条件として維持する。
controlled contract update lane を使用して本文を更新する。trusted plan が section-bound update を生成できる場合は canonical
contract_update.run.with_human_contextを使う。NEXT_ACTION: issue_editor_requiredの場合は既存issue-editor/edit-issuecontrolled full-rewrite lane に進み、同じ mutation を no-progress retry しない。mutation 後は必ず live Issue body/title readback を行い、fresh snapshot に対して次を再実行する。
stale pre-mutation review を最終 verdict に使わない。
reviewer が
needs-fixを返した場合は max_iterations の範囲で人間承認なしに rewrite → fresh review を継続する。各 iteration でも必要な read-only SubAgent を使う場合は、必ず全 result の completion を待ってから mutation する。refinement の最終状態が fresh
approve/goになるまで implementation code、worktree、implementation branch、commit、PR は作成しない。この依頼は Issue refinement の完了まで が対象である。最終報告には次を含める。
「scope が広がったので人間に決めてもらう」「ANCHOR_SCOPE_REFRAME_V1 を人間に書いてもらう」という理由だけで終了してはならない。今回の operator/OWNER decision は、それらを自動 refinement の対象として扱うことを明示している。
この構成なら、#2084 は label/readiness architecture の本体、#2086 は refinement authority/control-plane の欠陥修正と責務が分離され、#2053/#2068 の未マージ実装とも重複しにくくなります。特に「SubAgent が exact scope を導出 → 全員完了待ち → root が human-context lane で controlled rewrite」という順序が、現在の main の制約と今回の OWNER 方針の両方を満たしやすいです。
squne121 commentedon Aug 11, 2026
operator-asserted human-context directive
preflight.run.with_human_contextlane への明示投入)と、本 Issue の OWNER コメント 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 (comment) (および 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 (comment) の技術指摘)squne121/loop-protocol#2084(in-place reframe。新規 Issue 分割は行わない)applied / noop / failedはstatus/routing_action/implementation_allowedを変えない。docs/dev/workflow.mddocs/dev/github-ops.md.claude/skills/impl-review-loop/steps/preparation.md.claude/skills/impl-review-loop/scripts/build_intake_capsule.py.claude/skills/impl-review-loop/tests/test_intake_gate.py.claude/skills/impl-review-loop/tests/test_build_intake_capsule.py.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/references/termination-policy.md.claude/skills/issue-refinement-loop/tests/test_loop_policy.py.claude/skills/issue-refinement-loop/scripts/apply_triage_label_transition.py(新規).claude/skills/issue-refinement-loop/scripts/tests/test_apply_triage_label_transition.py(新規).claude/skills/implement-issue/SKILL.mdauthor_association: OWNERの GitHub principal が同一セッションで人間操作・AI agent 操作の双方に使われ得ることを踏まえ、operator がwith_human_contextlane を選択した事実そのものを operational authority として扱う(実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 の Accepted Trust Model と同じ扱い。「verified human」とは表現しない)。squne121 commentedon Aug 11, 2026
Contract Review Result
squne121 commentedon Aug 11, 2026
issue-refinement-loop: approved
Issue #2084 の contract rewrite を、OWNER directive(comment #5249582962、comment #5249734344)と、operator が
preflight.run.with_human_contextへ明示投入した materialized directive(comment #5250516679、OWNER_DIRECTIVE_MATERIALIZED_FROM_INTERACTIVE_PROMPT_V1)に基づき in-place reframe し、fresh review/readiness でapprove/goを確認しました。Iteration ごとの review verdict
1474ecb2...): needs-fix — 7 blockers(C11 decision tag consistency 欠落、AC1/AC6 VC の unexpected pass、AC3/AC8 pytest-kfilter が collected 0 tests)dd1e46f2...): needs-fix — 4 blockers(AC3/AC8 pytest VC が既存ファイル上の未作成 test 関数参照で non-canonical VC shapeexisting_file_missing_node_id_noncanonical、AC9/AC10 の# baseline-expect: pass -- <説明文>が invalid annotation format)94ab3a5d...): approve — blockers 0Final gate
check_issue_contract.py --issue 2084 --repo squne121/loop-protocol --json:verdict: approve, C1〜C11 pass、blocking_issues: [].claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py(evidence-mode current-head, head9aa2cb45):status: pass, expected_fail 8 / expected_pass 4 / unexpected_pass 0 / blocked 0 / human_judgment 0run_contract_review_once.py --mode execute:CONTRACT_REVIEW_ONCE_RESULT_V1.status: go, body_sha256 一致確認済みCONTRACT_REVIEW_RESULT_V1.status: go)Non-blocking improvements(人間向け参考情報)
! grep ...)に removed-literal のインベントリ明示がない(advisory)参照情報
docs/dev/workflow.md:189-203、build_intake_capsule.py:300-303,771-783、impl-review-loop/steps/preparation.md:106-118、issue-refinement-loop/SKILL.mdStep 0、termination-policy.md:276-393(phase_label_readyinimpl_ready条件4)、implement-issue/SKILL.md#2086(workflow-level defect follow-up)は duplicate 作成せず既存 OPEN Issue のまま参照#2053/ Draft PR fix(issue-refinement-loop): bind freeform OWNER scope authority end-to-end and expose routing telemetry #2068: 現時点で OPEN/Draft・未マージ。gh pr diff 2068確認済み diff(schemas、command_registry.py/decide_next_loop_action.py/run_refinement_preflight.py/scope_signal_delta.py、関連 test)は本 Issue の Allowed Paths と無衝突。merge 後は Stop Conditions に従い再確認するdecision: immediate(applicable_acs: AC3, AC4, AC5, AC7, AC8)本ループの依頼範囲は Issue refinement の完了までであり、実装コード・worktree・branch・commit・PR は作成していません。次の実装着手(
impl-review-loop)は別途の明示的な指示で行ってください。squne121 commentedon Aug 11, 2026
implement-issue: 実装完了 (2026-08-11T09:42:42Z)
.claude/worktrees/issue-2084-label-authorityworktree-issue-2084-label-authority4b45508fa67ef9962a51f05280825ce5a1e65e86fix: docs/dev/github-ops.md の見出し日本語比率不足を解消する (#2084)
squne121 commentedon Aug 11, 2026
pr-reviewer REQUEST_CHANGES fix_delta 対応(PR #2092)
CI の
PR Body Japanese Check(changed Markdown per-block 検査)がdocs/dev/github-ops.mdで FAILURE していた件を修正した。原因の再特定
validate_japanese_content.py --file docs/dev/github-ops.md --threshold 0.1を直接再現した結果、fix_delta 指摘で想定されていた新規追加の「Readiness Plane / Presentation Plane」箇条書きブロックではなく、既存の見出しブロック## 既存 Issue の native parent/blockedBy/blocking 同期(issue_relationship.update、Issue #1883)(ratio=0.089 (jp=5, total=56))が per-block 閾値未達であることが判明した。この見出しは本 Issue の変更差分に含まれていなかったが、PR でdocs/dev/github-ops.mdに変更行があるため CI がファイル全体を検査し、既存見出しの日本語比率不足が顕在化していた。修正内容
意味を変えずに日本語の助詞・説明を補い、見出しを以下に改訂した(Markdown anchor 参照は repo 内に存在しないことを確認済み)。
## 既存 Issue の native parent/blockedBy/blocking 同期(issue_relationship.update、Issue #1883)## 既存の Issue に対して native な parent・blockedBy・blocking の関係性を同期する仕組み(issue_relationship.update、Issue #1883)(ratio=0.224)docs/dev/github-ops.md以外は変更していない(Allowed Paths 準拠)。検証結果
uv run python3 .claude/skills/create-issue/scripts/validate_japanese_content.py --file docs/dev/github-ops.md --threshold 0.1→ PASS(全 block 通過)grep -n -e "presentation-only" -e "presentation_only" docs/dev/github-ops.md)→ 引き続き PASS(既存の Readiness/Presentation Plane 節は変更なし)pnpm typecheck/pnpm lint/pnpm test(1872 tests pass)/pnpm build→ 全て PASSuv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py→ 21 passedPR Body Japanese Checkpass。他の全ジョブも pass(visual-impact-policy-trustedのみ既存 infra bug として 実装: visual-impact-trusted-consumer.yml の gh api --output 未対応バグを修正する #2076 で別トラック済み、本修正とは無関係)。commit
e2c7d3f3(branchworktree-issue-2084-label-authority、PR 実装: GitHub Issue labels を presentation-only metadata として SSOT 化する #2092)fix: issue-contract-review の label→readiness結合を除去しlabel mutationにtime…
fix: 未使用の pytest import を削除する (#2084)
squne121 commentedon Aug 11, 2026
fix_delta 実装完了報告(PR #2092 comment #5251894253 の REQUEST_CHANGES 対応)
PR #2092 head
63568f9aに反映済み。CI 全チェック green(mergeStateStatus: CLEAN)。対応内容
P0 / AC11(issue-contract-review の label→readiness transitive coupling 除去)
.claude/skills/issue-contract-review/SKILL.mdとreferences/contract-compliance.mdから、state/needs-humanlabel を BLOCKED authority として扱う記述を削除しました。checks.state_labelを observational telemetry としてのみ残す場合もstatus(go/blocked/human_judgment)の判定には寄与させない契約を明記しました。run_contract_review_once.py/contract_readiness_check.py/check_product_spec_contract.py)を調査した結果、readiness の実判定ロジックはそもそも label を一切参照していないことを確認しました(check_product_spec_contract.pyのrun_gh_api()はlabelsフィールドを取得するが decision には未使用)。今回の変更はこの事実に整合させる形で、ドキュメント側(SKILL.md・contract-compliance.md)の記述を実コードの契約に揃えるものです。AC12(label permutation でも readiness 不変であることの regression test)
新規ファイル
.claude/skills/issue-contract-review/tests/test_state_label_readiness_invariant.pyを追加しました。既存のstatus: go固定注入バイパスとは異なり、以下 3 つのテストで issue-contract-review の実際の判定ロジックを通す経路を検証しています。test_run_gh_api_labels_do_not_affect_product_spec_decision:check_product_spec_contract.pyの実run_gh_api()→ decision pipeline を、gh CLI サブプロセス境界のみをスタブして実行し、labels のみが異なる 2 つの GitHub API レスポンス([]/["state/needs-human"]/ 複合ラベル)で applicability/triggers/checks が完全に一致することを確認。test_run_once_status_stable_across_label_permutation_matrix:run_contract_review_once.pyの実run_once()(issue-contract-review 自身のエントリポイント)を label permutation([]/["state/needs-human"]/["triage-required"]/["phase/implementation", "state/needs-human"])ごとに実行し、CONTRACT_REVIEW_RESULT_V1.statusが全 permutation でgoに固定されることを確認。test_run_once_signature_has_no_label_parameter:run_once()のシグネチャが labels 相当のパラメータを一切持たないことを構造的に固定(fossil guard)。AC13(apply_triage_label_transition.py の timeout + readback)
_default_run()に bounded timeout(30秒)を追加しました。subprocess.TimeoutExpiredを捕捉し、(rc=124, "", "timeout_expired: ...")へ変換して既存のエラーハンドリング経路(result: failed+warnings記録、exit 0)に流し込みます。例外は一切伝播しません。gh issue edit)実行後にgh issue view --json labels相当の readback を追加しました。read → delta → mutation → readbackの順で実行し、readback で確認できた実際の label 状態からのみremoved/added/unrelated_labels_preserved/result(applied | noop | failed)を計算するよう変更しました。gh CLI の mutation コール自体がrc=0を返しても、readback で delta が確認できなければappliedにしません。test_apply_triage_label_transition.pyは全 15 件 PASS しています。P1(production 配線): PR #2092 本文の Schema Consumer Inventory を確認したところ、既に「本 PR で新規追加するスクリプト自身。既存の consumer は現時点で存在せず(orchestrator への配線は対象外)」と記載済みで、Issue #2084 本文の Scope Delta(標準ユーティリティ提供のみ、配線は follow-up)と整合していました。コード変更は不要でした。
AC14(derived design doc の追随)
docs/dev/workflows/impl-review-loop-design.mdの以下を label-authority 契約に整合させました。## Invocation Contractの前提条件行からstate/needs-human非存在の記述を削除state/needs-human存在を単独の Hard stop 行として除去CI main 追従:
origin/main(#2081 → #2087 まで進行)を 2 回 merge して追従させました(conflict なし)。AC11-14 Verification Commands
# AC12: label permutation でも issue-contract-review 自体の readiness が不変(実判定ロジック経由) $ uv run --locked pytest .claude/skills/issue-contract-review/tests/test_state_label_readiness_invariant.py -v# AC13: subprocess timeout の failed+warning+exit0 化、および readback による applied 確定 $ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_apply_triage_label_transition.py -v検証結果サマリ
pnpm typecheck/pnpm lint/pnpm test(1872件)/pnpm build: 全 PASSuv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py: 21件 PASS.claude/skills/issue-contract-review/配下 全 807 件中 805 PASS(既存の環境依存 flake 1 件は本 PR と無関係。unrelated ファイルtest_baseline_vc_preflight_current_head_non_regression.pyのrgunreadable-file テストで、root 権限では chmod 000 が効かない環境依存の pre-existing flake であることを pristine main 側でも再現確認済み).claude/skills/issue-refinement-loop/配下 全 1332 件中 1330 PASS(test_repair_issue_contract.pyの2件は pristine main(本 fix_delta 適用前)でも再現する既存の順序依存 flake で、本 PR の Allowed Paths 外・無関係).claude/skills/issue-contract-review/SKILL.md、references/contract-compliance.md、tests/test_state_label_readiness_invariant.py(新規)、.claude/skills/issue-refinement-loop/scripts/apply_triage_label_transition.py、scripts/tests/test_apply_triage_label_transition.py、docs/dev/workflows/impl-review-loop-design.mdのみで、いずれも拡張後の Allowed Paths 内63568f9a13c85f26690dc97a83fb41f5640203f8(mergeStateStatus: CLEAN,mergeable: MERGEABLE)fix: workflow.md のSSOT説明文からAC1禁止語のliteral残存を除去する (#2084)
squne121 commentedon Aug 11, 2026
PR #2092 への軽微修正対応(pr-reviewer REQUEST_CHANGES 対応)
pr-reviewer から AC1 の Verification Command が literal 一致で fail する指摘を受け、修正しました。
問題
docs/dev/workflow.md:202の SSOT 原則説明文の中で、「required_routing_labels/hard_stop_labelsのような label-based gate は本 contract に含めない」という否定文脈での言及として、これらの語自体が literal に残っていました。意味上は AC1 の意図(スキーマキーとしての除去)を満たしていましたが、AC1 の VC コマンド! grep -n -e "required_routing_labels" -e "hard_stop_labels" docs/dev/workflow.mdが意図せずマッチし fail していました。対応
該当箇所を、意味を変えずに婉曲表現へ書き換えました。
`required_routing_labels` / `hard_stop_labels` のような label-based gate は本 contract に含めない。routing 可否や停止条件を label 名そのもので表現するスキーマキー(label-based gate)は本 contract に含めない。「labels are presentation-only」の SSOT 原則、readiness authority が non-label evidence のみで再定義されるという AC1 の意図は変更していません。
検証結果
両方 PASS を確認しました。
標準4コマンド(
pnpm typecheck/pnpm lint/pnpm test(1872件成功) /pnpm build)も再実行しすべて PASS しました。docs/dev/workflow.md1ファイルのみの変更です(既存 Allowed Paths 内)。コミット・CI
0fc1e1aef641a7c0bb2a6f5cd966bee14a8169dbworktree-issue-2084-label-authority(PR 実装: GitHub Issue labels を presentation-only metadata として SSOT 化する #2092 更新、新規 PR は作成せず)typecheck/lint/test/build/python-test/validate-generated-artifact): すべて PASSvisual-impact-policy-trustedは fail していますが、これは既存の infra 問題(実装: visual-impact-trusted-consumer.yml の gh api --output 未対応バグを修正する #2076 で既知トラック済み)であり本変更とは無関係、かつ branch protection の required check には含まれていません。PR: #2092
実装: GitHub Issue labels を presentation-only metadata として SSOT 化する (#2092
実装: operator-selected human context の scope reframe を自動継続し scope expa…