Skip to content

実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084

Closed

Description

@squne121

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: workflow

Parent 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 が以下のコメントで前提を覆した。

codebase-investigator による現行 main(HEAD 9aa2cb4)の直接検証で、以下の label→gate 結合が実在することを確認済み。

  1. docs/dev/workflow.md:189-203 — implementation_consumer_ready_contract.required_routing_labels: [phase/implementation] / hard_stop_labels: [state/needs-human]
  2. .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)に直結
  3. .claude/skills/impl-review-loop/steps/preparation.md:106-118 — Intake Gate の metadata_not_ready(最高優先)が phase/implementation label 欠落を停止条件にしている
  4. .claude/skills/issue-refinement-loop/SKILL.md Step 0 — state/needs-human / state/done を hard stop として確認する記述
  5. .claude/skills/issue-refinement-loop/references/termination-policy.md:276-393 — LOOP_HANDOFF_RESULT_V1.metadata.phase_label_ready が impl_ready 条件 4 の必須項目
  6. .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 Gate metadata_not_ready サブ理由から phase/implementation label 欠落条件を除去する。
  • .claude/skills/issue-refinement-loop/SKILL.md Step 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-required remove・phase/implementation / agent/implementer add を 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

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 Gate metadata_not_ready から phase/implementation label 欠落条件が除去されている。test_intake_gate.py の該当 assertion が新しい契約に整合するよう更新されている。
  • AC5: issue-refinement-loop/SKILL.md Step 0 の hard stop 条件から state/needs-human / state/done の label 単独判定が除去され、停止には別 authority(OWNER 明示指示・human_judgment_required)が必要である旨が明記されている。state/done の代わりに GitHub native Issue closed state を参照する。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-required remove・phase/implementation / agent/implementer add を 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.md

Allowed Paths

  • docs/dev/workflow.md
  • docs/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

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:

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-human label(および他の 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 と同じパターン)。個別に確認した主要候補:

edit_intent: 追記・置換型(既存セクションの意味を変更する箇所は AC に明記した該当セクションのみ)。

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    triage-required
    on Aug 11, 2026
  2. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    そもそもGitHub Issueのラベルは、人間向けに分かりやすくするものであって、GitHub Issueの品質を保証する何かではないので、AIの作業によってラベルを付与してもいいけど、そのラベルに対して何らかの制限を発生させないようにしてほしいです。あくまで人間の認知を助けるために付与しているものとして、ドキュメントにも明記してほしいです。

  3. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    判定

    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_cleanup auto-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_ready invariant に組み込みました。

    したがって 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_ready hard gate として導入しました。PR #568 の diff に明示されています。

    さらに #628 / #635 で phase_label_ready が handoff invariant へ入りました。

    今回の OWNER コメントは、この歴史的な split-brain を整理して、

    state label だけでなく phase / agent / triage を含む全 Issue label は presentation metadata。authority ではない

    と一本化する契機と読むのが自然です。

    P1 — 現行 AC / VC では「非 authoritative」を証明できない

    #2084 の AC1〜AC4 はほぼ grep です。文字列を追加すれば通るので、

    「label mutation failure → impl_ready=false」

    という実装でも AC を満たせます。

    最低限、修正後は次の振る舞いを machine test で固定すべきです。

    1. 同じ body / contract review / dependency 状態なら、labels が []、triage-required、phase/implementation、state/needs-human のどれでも readiness result が変わらない。
    2. phase/implementation 欠落で impl-review-loop が intake_gate_failed にならない。
    3. state/needs-human ラベル単独では refinement が停止しない。停止には OWNER の明示指示や structured human_judgment_required など別 authority が必要。
    4. label sync が permission/network/API error になっても LOOP_HANDOFF_RESULT_V1.status / routing_action は変わらない。
    5. label sync は idempotent かつ unrelated labels を保持する。
    6. state/done ではなく GitHub native Issue closed state を終了判断に使う。

    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 を明確に分離することです。

    Authoritative / readiness
      Issue open/closed
      Machine-Readable Contract
      Allowed Paths
      GitHub native dependency / Depends on
      explicit OWNER instruction
      contract/review/test/CI result
               │
               ▼
         readiness decision
               │
               ├── impl_ready / human_judgment / blocked
               │
               └── AFTER decision
                      ↓ best effort
                 presentation label sync
                 triage-required remove
                 phase/implementation add
                 agent/implementer add
                      ↓
                 applied | noop | failed(warning)
    

    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 に残っている」ことです。 指定コメントを正しく反映するなら、こちらを先に解消する必要があります。

  4. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: human_escalation

    • Cause: scope_reframe_requires_human_decision
    • Issue: 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084
    • Iteration: 1
    • Blockers:
      • C9: ## Runtime Verification Applicability セクションが本文にない(レガシー Issue、機械的に修正可能)
      • OWNER コメント(#2084 comment)が Issue の前提そのものを覆す scope reframe を要求しており、scope_delta_decision.status: fail_closed(reason: no_anchor_scope_reframe_v1_payload、構造化 ANCHOR_SCOPE_REFRAME_V1 payload なし、allowed_path_deltas: [])のため自動 contract patch の対象にならない

    事実確認(codebase-investigator による検証、すべて confirmed)

    OWNER コメントが主張する「GitHub Issue ラベルが readiness/gate として本番コードに結合している」という claim は、以下すべて実在を確認済みです。

    1. docs/dev/workflow.md の implementation_consumer_ready_contract(required_routing_labels: [phase/implementation] / hard_stop_labels: [state/needs-human])
    2. .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)
    3. build_intake_capsule.py の ready_status = pass iff title_prefix_ok && phase_label_ok && issue_state_open
    4. issue-refinement-loop/SKILL.md Step 0 の state/needs-human / state/done hard stop
    5. implement-issue skill の phase/implementation 依存(state/needs-human 単独では停止しない方向に部分修正済み)
    6. 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-issue skill など複数 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 判断待ち)

    1. P0(新規・別 Issue 推奨): 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 等)から除去する。
    2. 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 自体: 上記 P0 の完了後、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 として再構成する。
    3. 現状のまま C9 のみ機械的に直しても、OWNER の核心的な懸念(label→gate 結合の危険な追加)は解消されないため、単純な rewrite loop 続行は推奨しない。

    Iteration 2 以降は、human が上記方針(新規 Issue 分割 / #2084 の scope reframe 内容)を確定した後に再開してください。

  5. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor
    Issue #2084 の refinement loop を実行し、Step 0(preflight)→ Step 2(review)→ Step 1(investigation)まで進めた結果、human judgment 待ちで停止(human_escalation) しました。終了コメントを投稿済みです。
    
    経緯:
    - OWNER コメント(comment #5249582962)は構造化 ANCHOR_SCOPE_REFRAME_V1 payload ではないため自動 contract patch の対象外
    - issue-reviewer は機械的な C9 blocker(Runtime Verification Applicability セクション欠落)のみ検出したが、OWNER コメントの本質的な指摘(「GitHub Issue ラベルは人間向け表示情報であり、AI の着手可否・readiness を左右してはならない」)が Issue の前提を覆している
    - codebase-investigator で OWNER の技術的主張を検証した結果、6件すべて事実確認できた: docs/dev/workflow.md の implementation_consumer_ready_contract、impl-review-loop/steps/preparation.md の intake gate、build_intake_capsule.py の phase_label_ok、issue-refinement-loop/SKILL.md Step 0 の hard stop、implement-issue の label 依存、LOOP_HANDOFF_RESULT_V1 の phase_label_ready 条件が、いずれも label→gate 結合として本番コードに実在
    
    なぜ自動継続しなかったか:
    必要な修正範囲が現 #2084 の Allowed Paths(issue-refinement-loop 配下のみ)を大きく超え、docs/dev/workflow.md / docs/dev/github-ops.md / impl-review-loop / build_intake_capsule.py / implement-issue にまたがる architecture-level の変更を要求します。これは skill の Scope Change Stop Conditions(新規 Allowed Paths ディレクトリ・別アーキテクチャ層・Issue 分割の要否)に該当するため、人間承認不要(反復継続の承認ゲート)とは別の安全策として、issue-editor による自動書き換えを行わず停止しました。
    
    Issue #2084 に投稿した推奨方針:
    1. P0として docs/dev/workflow.md/docs/dev/github-ops.md を対象とする新規 Issue を起票し、「ラベルは presentation-only」原則を SSOT 化、label→gate 結合を各 consumer から除去
    2. #2084 自体は、その完了後に「best-effort presentation sync(readiness に影響しない telemetry)」として scope reframe する
    
    続きを進める場合は、上記方針(新規 Issue 分割 or #2084 の reframe 内容)を決めてから教えてください。
    

    人間が与えているコメントに対して構造化 ANCHOR_SCOPE_REFRAME_V1 payloadを要求しているという実装の不備があります。
    人間が与えているコメントにてスコープ拡張が指示されているのに、それを停止条件としている実装の不備があります。
    このGitHub Issueの範囲だけでなく、そもそものワークフローに問題があるので、修正 GitHub Issueを起票してほしいです。
    AIエージェントには、人間がGitHubに行ったコメントか、AIエージェントが出力したコメントか判別できないという問題があるので、しかしこれは個人趣味開発の範疇として、その問題を解消しないまま実装を進めていきたいです。

  6. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    提唱アクションは、#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 は次のように解釈してください。

    1. 最初に 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 を優先する。

    2. mutation 前に read-only SubAgent を起動する。最低 1 体の codebase-investigator を使用し、必要なら独立した追加 read-only investigator を使う。SubAgent 自身による nested delegation は禁止する。

      SubAgent には少なくとも以下を調査させる。

      • GitHub Issue label が readiness / gate / stop / handoff / implementation permission に影響している production consumer の完全な inventory
      • confirmed 起点:
        docs/dev/workflow.md
        docs/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
      • 上記 contract を固定している既存 tests
      • label event を authoritative gate とする GitHub Actions / scripts が他にないか
      • 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 の新しい Outcome / AC を実装可能にする exact Allowed Paths
      • OPEN Issue / PR との真の scope collision と単なる同一ファイル overlap の区別
      • Runtime Verification Applicability の適切な decision と根拠
    3. 全 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 のみ停止する。

    4. 実装: 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_context lane を使用する。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 には以下を明示する。

      • source は今回の interactive operator instruction と #5249734344
      • OWNER_DIRECTIVE_MATERIALIZED_FROM_INTERACTIVE_PROMPT_V1
      • target は squne121/loop-protocol#2084
      • 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 を in-place reframe すること
      • confirmed exact Allowed Path deltas
      • scope expansion は承認済みであり、それ自体を stop condition にしないこと
      • implementation_allowed=false のまま contract rewrite と fresh gates のみを許可すること
      • destructive / secrets / paid service / permission escalation は承認していないこと
      • physical human provenance を保証するものではなく operator-selected lane であること

      投稿後は live readback で body / comment id / target Issue を確認し、その URL を必ず preflight.run.with_human_context として渡す。agent-report lane や unlabeled anchor に暗黙変換しない。

    5. 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-required remove、phase/implementation / agent/implementer add 等は 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 を要求する。最低限、以下を固定する。

      • 同一 body / dependency / review state なら labels が []、triage-required、phase/implementation、state/needs-human 等に変化しても readiness result が変わらない。
      • phase/implementation 欠落だけで impl-review-loop intake が metadata_not_ready / stop にならない。
      • state/needs-human label 単独で issue-refinement-loop が停止しない。
      • state/done label 単独を terminal authority にせず、GitHub native Issue state または別の authoritative termination state を使う。
      • label sync failure が LOOP_HANDOFF_RESULT_V1.status、routing_action、implementation_allowed を変えない。
      • presentation label sync は idempotent で unrelated labels を保持する。
      • triage-required → remove、phase/implementation / agent/implementer → add は decision 後の best-effort sync とし、permission/network/API failure は warning として観測可能にする。
      • label permutations を用いた negative/parameterized tests を追加し、将来 label→gate coupling が再導入されることを防ぐ。
      • C9 を解消するため canonical ## Runtime Verification Applicability section を追加する。decision は repository policy と実際の AC に基づいて investigator/reviewer が決定し、推測で固定しない。
    6. 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 を同時に追加する。

    7. 実装: 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 は停止条件として維持する。

    8. controlled contract update lane を使用して本文を更新する。trusted plan が section-bound update を生成できる場合は canonical contract_update.run.with_human_context を使う。NEXT_ACTION: issue_editor_required の場合は既存 issue-editor / edit-issue controlled full-rewrite lane に進み、同じ mutation を no-progress retry しない。

    9. mutation 後は必ず live Issue body/title readback を行い、fresh snapshot に対して次を再実行する。

      • refinement preflight
      • issue review
      • contract readiness / contract review
      • Allowed Paths gate
      • applicability があるその他の policy validator

      stale pre-mutation review を最終 verdict に使わない。

    10. reviewer が needs-fix を返した場合は max_iterations の範囲で人間承認なしに rewrite → fresh review を継続する。各 iteration でも必要な read-only SubAgent を使う場合は、必ず全 result の completion を待ってから mutation する。

    11. refinement の最終状態が fresh approve/go になるまで implementation code、worktree、implementation branch、commit、PR は作成しない。この依頼は Issue refinement の完了まで が対象である。

    12. 最終報告には次を含める。

    「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 方針の両方を満たしやすいです。

  7. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    operator-asserted human-context directive

    • source: 2026-08-11 の interactive operator instruction(preflight.run.with_human_context lane への明示投入)と、本 Issue の OWNER コメント 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 (comment) (および 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 (comment) の技術指摘)
    • target: squne121/loop-protocol#2084(in-place reframe。新規 Issue 分割は行わない)
    • directive: GitHub Issue labels は presentation-only / non-authoritative metadata であり、AI の readiness・quality・implementation permission・handoff・stop condition の authority にしてはならない。label synchronization 自体は許可するが、readiness decision の後に行う best-effort presentation sync に限る。label sync の applied / noop / failed は status / routing_action / implementation_allowed を変えない。
    • confirmed exact Allowed Path deltas(codebase-investigator による現行 main HEAD 9aa2cb4 での直接検証済み):
      • docs/dev/workflow.md
      • docs/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.md
    • scope expansion is approved: 上記 Allowed Paths が現行 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 本文の Allowed Paths(issue-refinement-loop 配下 4 ファイルのみ)を超えることは、本 directive に整合する限り単独では stop condition としない。
    • implementation_allowed remains false: 本 directive は Issue 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 の contract rewrite のみを許可する。rewrite 後に fresh preflight / fresh review / fresh readiness が pass するまで、実装コード・worktree・branch・commit・PR は作成しない。
    • not approved: destructive operation、secret/credential exposure、paid external service、repository permission escalation は本 directive の対象外であり、承認していない。
    • provenance disclaimer: 本 assertion は physical human provenance を証明するものではない。author_association: OWNER の GitHub principal が同一セッションで人間操作・AI agent 操作の双方に使われ得ることを踏まえ、operator が with_human_context lane を選択した事実そのものを operational authority として扱う(実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 の Accepted Trust Model と同じ扱い。「verified human」とは表現しない)。
  8. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-08-11T08:47:28Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/2084
      body_sha256: "sha256:94ab3a5de9570254e04265f34341450e890e6d46e96f85defb29d5ab635f5afc"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        product_spec_check: {"schema":"product_spec_check/v1","applicability":"applicable","decision":"pass","triggers":{"docs_product_allowed_paths":false,"tasks_md_mentioned":false,"specify_artifact_mentioned":false,"generated_task_mentioned":false,"product_spec_context_present":false,"machine_readable_contract_present":true},"conditions":{"docs_product_requires_spec_evidence":{"status":"pass","evidence":[]},"tasks_md_not_direct_source":{"status":"pass","evidence":[]},"specify_not_canonical":{"status":"pass","evidence":[]},"diff_first_rationale_present":{"status":"pass","evidence":[]},"generated_task_trace_present":{"status":"pass","evidence":[]},"task_dependencies_materialized":{"status":"pass","evidence":[]}},"blocked_reasons":[],"body_sha256":"sha256:94ab3a5de9570254e04265f34341450e890e6d46e96f85defb29d5ab635f5afc","source_provenance":{"source_type":"body_file","body_file":"/tmp/contract_review_once_body_y3hstru_.md"}}
        vc_preflight:
          decision: pass
          classifications: '[{"ac":"AC1","line":2,"raw_command":"! grep -n -e \"required_routing_labels\" -e \"hard_stop_labels\" docs/dev/workflow.md","command_hash":"sha256:d8992f58d7669c9a540c30f1929f9d44ff2ab14cfe7af279c797e88e0b8e0f1a","execution_key_hash":null,"runner":"exec","exit_code":null,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC1","line":3,"raw_command":"grep -n -e \"presentation-only\" -e \"presentation_only\" docs/dev/workflow.md","command_hash":"sha256:7694d295e6e93bb08321a92c572b5d13f82fe2f98e842eefcb2b8ec125e2d657","execution_key_hash":"sha256:624c6a8319752efcc5d5e839a9df3f6800bac72c2909fa8061dbcd9c5cde3483","runner":"exec","exit_code":1,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":2,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC2","line":2,"raw_command":"grep -n -e \"presentation-only\" -e \"presentation_only\" docs/dev/github-ops.md","command_hash":"sha256:da07a2b3f0f4c7acd0dee39b0379d1cb746ad9a45df59abeef9b61455e993d3d","execution_key_hash":"sha256:b6c6913822efa58fb6611651bb02e692b573ae1ec3b00062cd6a7467d42e21c4","runner":"exec","exit_code":1,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":1,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC3","line":2,"raw_command":"uv run --locked pytest .claude/skills/impl-review-loop/tests/test_label_authority_invariants.py::test_ready_status_independent_of_phase_label -v","command_hash":"sha256:73763705a80b16de8d1594325e8c1d9e5ab3c8730ea3a2ea30ac578db3465ec4","execution_key_hash":"sha256:f7091808cfcf7f99b81b9e9e3336596380179d244b49ccc600db2301245dd862","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["============================= test session starts ==============================","platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.6.0 -- /home/squne/projects/LOOP_PROTOCOL/.venv/bin/python","cachedir: .pytest_cache","rootdir: /home/squne/projects/LOOP_PROTOCOL","configfile: pyproject.toml","plugins: xdist-3.8.0","collecting ... collected 0 items","============================ no tests ran in 0.01s ============================="],"stdout_truncated":false,"stdout_original_line_count":10,"stderr_head":["ERROR: file or directory not found: .claude/skills/impl-review-loop/tests/test_label_authority_invariants.py::test_ready_status_independent_of_phase_label"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":192,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC4","line":2,"raw_command":"uv run --locked pytest .claude/skills/impl-review-loop/tests/test_intake_gate.py -v","command_hash":"sha256:051be680337384246291ec5c067f65a336ee95f84b339043fa688960614d418b","execution_key_hash":"sha256:0a14e101400aee216de94a6f278667b7fb14ac16898634a157daec35f464cf70","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["============================= test session starts ==============================","platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.6.0 -- /home/squne/projects/LOOP_PROTOCOL/.venv/bin/python","cachedir: .pytest_cache","rootdir: /home/squne/projects/LOOP_PROTOCOL","configfile: pyproject.toml","plugins: xdist-3.8.0","collecting ... collected 26 items",".claude/skills/impl-review-loop/tests/test_intake_gate.py::test_ac1_refinement_approved_gate_pending_defined PASSED [  3%]",".claude/skills/impl-review-loop/tests/test_intake_gate.py::test_ac1_implementation_ready_defined PASSED [  7%]",".claude/skills/impl-review-loop/tests/test_intake_gate.py::test_ac1_approve_alone_does_not_imply_implementation_ready PASSED [ 11%]",".claude/skills/impl-review-loop/tests/test_intake_gate.py::test_ac2_intake_gate_failed_defined PASSED [ 15%]",".claude/skills/impl-review-loop/tests/test_intake_gate.py::test_ac2_contract_review_result_go_required PASSED [ 19%]",".claude/skills/impl-review-loop/tests/test_intake_gate.py::test_ac2_subreason_priority_order_defined PASSED [ 23%]",".claude/skills/impl-review-loop/tests/test_intake_gate.py::test_ac2_priority_ordering_metadata_not_ready_first PASSED [ 26%]",".claude/skills/impl-review-loop/tests/test_intake_gate.py::test_ac2_priority_ordering_request_changes_last PASSED [ 30%]",".claude/skills/impl-review-loop/tests/test_intake_gate.py::test_ac3_metadata_not_ready_covers_title_prefix PASSED [ 34%]",".claude/skills/impl-review-loop/tests/test_intake_gate.py::test_ac3_metadata_not_ready_covers_phase_implementation_label PASSED [ 38%]",".claude/skills/impl-review-loop/tests/test_intake_gate.py::test_ac4_body_sha256_freshness_defined PASSED [ 42%]",".claude/skills/impl-review-loop/tests/test_intake_gate.py::test_ac4_generated_at_fallback_defined PASSED [ 46%]"],"stdout_truncated":true,"stdout_original_line_count":37,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":256,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC5","line":2,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_loop_policy.py -k \"hard_stop\" -v","command_hash":"sha256:19614c0e5203548f4bf4917aa1ccd991ff640f0004b6c1a61df2a39947d60e7b","execution_key_hash":"sha256:6eff33833cf9c333f0626b3c3d8044fc253d0e864c633210c0f19333c0283433","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["============================= test session starts ==============================","platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.6.0 -- /home/squne/projects/LOOP_PROTOCOL/.venv/bin/python","cachedir: .pytest_cache","rootdir: /home/squne/projects/LOOP_PROTOCOL","configfile: pyproject.toml","plugins: xdist-3.8.0","collecting ... collected 26 items / 14 deselected / 12 selected",".claude/skills/issue-refinement-loop/tests/test_loop_policy.py::test_hard_stop_state_needs_human PASSED [  8%]",".claude/skills/issue-refinement-loop/tests/test_loop_policy.py::test_hard_stop_scope_change PASSED [ 16%]",".claude/skills/issue-refinement-loop/tests/test_loop_policy.py::test_hard_stop_state_done PASSED [ 25%]",".claude/skills/issue-refinement-loop/tests/test_loop_policy.py::test_hard_stop_fail_closed_contract_malformation PASSED [ 33%]",".claude/skills/issue-refinement-loop/tests/test_loop_policy.py::test_hard_stop_required_external_research_unresolved PASSED [ 41%]",".claude/skills/issue-refinement-loop/tests/test_loop_policy.py::test_hard_stop_overrides_continue[state/needs-human] PASSED [ 50%]",".claude/skills/issue-refinement-loop/tests/test_loop_policy.py::test_hard_stop_overrides_continue[state/done] PASSED [ 58%]",".claude/skills/issue-refinement-loop/tests/test_loop_policy.py::test_hard_stop_overrides_continue[scope_change_signal] PASSED [ 66%]",".claude/skills/issue-refinement-loop/tests/test_loop_policy.py::test_hard_stop_overrides_continue[contract_malformation] PASSED [ 75%]",".claude/skills/issue-refinement-loop/tests/test_loop_policy.py::test_hard_stop_overrides_continue[required_external_research_unresolved] PASSED [ 83%]",".claude/skills/issue-refinement-loop/tests/test_loop_policy.py::test_hard_stop_overrides_continue[unsafe_mutation] PASSED [ 91%]",".claude/skills/issue-refinement-loop/tests/test_loop_policy.py::test_loop_policy_v1_hard_stop_overrides_continue PASSED [100%]"],"stdout_truncated":true,"stdout_original_line_count":23,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":237,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC6","line":2,"raw_command":"! grep -n \"phase_label_ready\" .claude/skills/issue-refinement-loop/references/termination-policy.md","command_hash":"sha256:b19bf177e360548d95cd0b66094c74d438f264b45299e8fffb2085a9fd05973c","execution_key_hash":null,"runner":"exec","exit_code":null,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC6","line":3,"raw_command":"grep -n -e \"presentation_sync\" -e \"label_sync_observation\" .claude/skills/issue-refinement-loop/references/termination-policy.md","command_hash":"sha256:5a5447b05360714cdd4426fbccc144c9eb77c743b09220f554a0246a7d974c55","execution_key_hash":"sha256:5b265c0c03cb1d584b63b2c2e4df682df7541f1cbc70cb4eb58b93990fbb9d41","runner":"exec","exit_code":1,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":1,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC7","line":2,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_apply_triage_label_transition.py -v","command_hash":"sha256:c1ab7d966ea0525acc5a3409061a24e038cc243b4ccdc5b1be3476e7ad1ee939","execution_key_hash":"sha256:81ca7775ff770589c611501bad1486687d5951b401c4e48e0ff34f925c8c9c4b","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["============================= test session starts ==============================","platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.6.0 -- /home/squne/projects/LOOP_PROTOCOL/.venv/bin/python","cachedir: .pytest_cache","rootdir: /home/squne/projects/LOOP_PROTOCOL","configfile: pyproject.toml","plugins: xdist-3.8.0","collecting ... collected 0 items","============================ no tests ran in 0.00s ============================="],"stdout_truncated":false,"stdout_original_line_count":10,"stderr_head":["ERROR: file or directory not found: .claude/skills/issue-refinement-loop/scripts/tests/test_apply_triage_label_transition.py"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":192,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC8","line":2,"raw_command":"uv run --locked pytest .claude/skills/impl-review-loop/tests/test_label_authority_invariants.py::test_ready_status_label_permutation_matrix -v","command_hash":"sha256:5c8fea5ea74554bcb75645bec60a6b60f5f78b06de0a8bef64980cf880e2c9f4","execution_key_hash":"sha256:f4c93b944cfbdfd27a71f995ef4ec7e28ed6dd970f54af7d28b145dc53fc6fbb","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["============================= test session starts ==============================","platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.6.0 -- /home/squne/projects/LOOP_PROTOCOL/.venv/bin/python","cachedir: .pytest_cache","rootdir: /home/squne/projects/LOOP_PROTOCOL","configfile: pyproject.toml","plugins: xdist-3.8.0","collecting ... collected 0 items","============================ no tests ran in 0.00s ============================="],"stdout_truncated":false,"stdout_original_line_count":10,"stderr_head":["ERROR: file or directory not found: .claude/skills/impl-review-loop/tests/test_label_authority_invariants.py::test_ready_status_label_permutation_matrix"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":206,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC9","line":4,"raw_command":"gh issue view 2084 --repo squne121/loop-protocol --json body -q .body","command_hash":"sha256:eb861284c8b161f397b20e91c397af657f8c6179bf904e75e4ecb0e06b2ff516","execution_key_hash":"sha256:9955e6647c5b635a9510fed21cf0115cc3a8a6e71c4555312716c989aca4b9ed","runner":"exec","exit_code":0,"classification":"expected_pass","category":"baseline_expect_pass","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["## Machine-Readable Contract","```yaml","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: workflow","```","## Parent Issue","なし(単独改善)","## Parent Goal Ref","- Goal: N/A(単独改善のため親 Issue なし)","- Desired Destination: N/A","## Current Validated Scope"],"stdout_truncated":true,"stdout_original_line_count":250,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":670,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"pass","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":3,"raw":"# baseline-expect: pass"},"strict":null,"repair":null},{"ac":"AC10","line":4,"raw_command":"grep -n \"phase/implementation\" .claude/skills/implement-issue/SKILL.md","command_hash":"sha256:ef27cfbcf76b4ad2041418e9563d4f4ea6b22e159df867ffa78e22440164bc3b","execution_key_hash":"sha256:ea50af46eb20f3a1c147cd0239796d107a20ad8b7c14c44d4243dc186ff5cd8d","runner":"exec","exit_code":0,"classification":"expected_pass","category":"baseline_expect_pass","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["37:consumer ready contract(title `実装:` または `implement:`、routing label `phase/implementation`、dependency all closed)が揃っているかを確認する。legacy state label の有無や `state/needs-human` の付与だけを理由に停止してはならない。最新 `CONTRACT_REVIEW_RESULT_V1 status` は任意の telemetry として記録するのみで、`go` 以外(missing/stale/invalid を含む)でも実装を停止しない(#1860 Owner Decision)。live Issue 本文・Allowed Paths・実テストが正本である。"],"stdout_truncated":false,"stdout_original_line_count":2,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":2,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"pass","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":3,"raw":"# baseline-expect: pass"},"strict":null,"repair":null}]'
        declared_path_overlap: '{"schema":"declared_path_overlap/v1","advisory":true,"blocking":false,"decision":"advisory_only","disjoint":true,"overlapping_prs":[],"inventory":{"schema":"OPEN_PR_INVENTORY_V1","repo":"squne121/loop-protocol","state":"open","base_ref":"main","base_sha":"ee641da1a8ff3aa916cabc57e59dca0d0274bb85","draft_policy":"include_drafts","prs":[{"number":1528,"title":"feat(cleanup): 同一実行内の branch-only fallback を追加","base_ref_name":"main","head_ref_name":"worktree-issue-1403-post-merge-cleanup-dedicated-branch-forc","head_ref_oid":"b29007580ae225eb9676c7f32c878ee2bb9ccaa9","is_draft":false,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/1528","changed_files_count_graphql":4},{"number":2068,"title":"fix(issue-refinement-loop): bind freeform OWNER scope authority end-to-end and expose routing telemetry","base_ref_name":"main","head_ref_name":"worktree-issue-2053-bind-freeform-authority-transport","head_ref_oid":"d623bf60758b2e145b454bb39b20f6acbf267480","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2068","changed_files_count_graphql":16},{"number":2070,"title":"fix(contract-review): RVA 欠落を fail-closed に統一","base_ref_name":"main","head_ref_name":"worktree-issue-2040-implementation-issue-runtime-verificatio","head_ref_oid":"9d5c639de9e3d01c6260939c3b790f40616b911e","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2070","changed_files_count_graphql":32},{"number":2072,"title":"fix: test_issue_1952回帰テストのrepo_root誤指定による.claude/.claude迷子ディレクトリ生成を修正する","base_ref_name":"main","head_ref_name":"worktree-issue-2071-repo-root-fix","head_ref_oid":"488bc8554a6f2d6e5187d0ea374034d19954a14f","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2072","changed_files_count_graphql":1},{"number":2081,"title":"fix-bootstrap-refs","base_ref_name":"main","head_ref_name":"worktree-issue-2040-trusted-current-main","head_ref_oid":"276cc950c8897969ab7fa960e49acb23ba8036a5","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2081","changed_files_count_graphql":10},{"number":2083,"title":"fix(issue-refinement-loop): trusted scope directive を planner に束縛する","base_ref_name":"main","head_ref_name":"worktree-issue-2055-planner-binding","head_ref_oid":"f6aef52ca3722a79205a344cdf1222042be9148d","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2083","changed_files_count_graphql":4},{"number":2087,"title":"fix: AC10 pid_proof flake の診断精度を修正し root cause 調査基盤を強化する (#2073)","base_ref_name":"main","head_ref_name":"worktree-issue-2073-test-ac10-real-executor-chain-ci-pid-pro","head_ref_oid":"544e48037ed76a6dd63ed64a3e59493305d91bb6","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2087","changed_files_count_graphql":5},{"number":2089,"title":"fix: CI verdict status checks をページネーションする","base_ref_name":"main","head_ref_name":"worktree-issue-2088-ci-status-check-pagination","head_ref_oid":"08f22ed039fe7146ab12b1eac1adfea0f3d6c60b","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2089","changed_files_count_graphql":2}],"fetched_count":8,"totalCount":8,"has_next_page":false,"complete":true,"saturated":false,"limit":200,"page_count":1,"inventory_digest":"sha256:fb98fce04aacae15e6ec48f61655d0a90d1f349a4eeaa77553b618b88af4b3bb","errors":[]},"inventory_digest_extended":"sha256:3431649adf357ab1185aeefdd8de44d2816c32fdc9699502f7888015ee3b85ac","errors":[],"note":"changed-file 名の単純な重なりのみを証明する advisory check。3-way merge・hunk 競合・rename/delete 競合は評価しない(実 Git merge 競合の判定は Issue #1792 の PAIRWISE_MERGE_OBSERVATION_V1 producer の責務)。単独では blocking にしない。disjoint は tri-state(true/false/null)— 観測が不完全な場合は null。"}'
      source: ensure_contract_snapshot_auto
      expected_contract_fingerprint: {"issue_number":2084,"contract_source_kind":"issue_comment","contract_source_id":"5250979909","contract_body_sha256":"sha256:94ab3a5de9570254e04265f34341450e890e6d46e96f85defb29d5ab635f5afc","allowed_paths_normalized_sha256":"0851e4beacd1897f22c6619e29d65c5f7779c8d7f1cb370ad37e97513e9c7a9a","base_ref":"main","base_sha_at_snapshot":"ee641da1a8ff3aa916cabc57e59dca0d0274bb85"}
  9. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    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

    1. iteration 1(body_sha256 1474ecb2...): needs-fix — 7 blockers(C11 decision tag consistency 欠落、AC1/AC6 VC の unexpected pass、AC3/AC8 pytest -k filter が collected 0 tests)
    2. iteration 2(body_sha256 dd1e46f2...): needs-fix — 4 blockers(AC3/AC8 pytest VC が既存ファイル上の未作成 test 関数参照で non-canonical VC shape existing_file_missing_node_id_noncanonical、AC9/AC10 の # baseline-expect: pass -- <説明文> が invalid annotation format)
    3. iteration 3(body_sha256 94ab3a5d...): approve — blockers 0

    Final 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, head 9aa2cb45): status: pass, expected_fail 8 / expected_pass 4 / unexpected_pass 0 / blocked 0 / human_judgment 0
    • run_contract_review_once.py --mode execute: CONTRACT_REVIEW_ONCE_RESULT_V1.status: go, body_sha256 一致確認済み
    • go snapshot: comment #5250979909(CONTRACT_REVIEW_RESULT_V1.status: go)

    Non-blocking improvements(人間向け参考情報)

    • scope token jaccard 0.205 < 0.3(Current Validated Scope と In Scope の語彙的重なりが低い。意味的には整合しているが、Jaccard heuristic の閾値未達)
    • AC1 / AC6 の削除確認 VC(! grep ...)に removed-literal のインベントリ明示がない(advisory)

    参照情報

    • confirmed label→gate consumer inventory: 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.md Step 0、termination-policy.md:276-393(phase_label_ready in impl_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 に従い再確認する
    • Runtime Verification Applicability: decision: immediate(applicable_acs: AC3, AC4, AC5, AC7, AC8)
    LOOP_HANDOFF_RESULT_V1:
      status: impl_ready
      routing_action: run_impl_review_loop
      contract_review:
        status: go
        gate_result: fresh_go
        latest_comment_url: "https://github.com/squne121/loop-protocol/issues/2084#issuecomment-5250979909"
        generated_at: "2026-08-11T08:47:28Z"
        body_sha256: "sha256:94ab3a5de9570254e04265f34341450e890e6d46e96f85defb29d5ab635f5afc"
      metadata:
        title_prefix_ready: true
        phase_label_ready: true
      auto_fixes:
        result: auto_fixed
        required: []
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: "2026-08-11T08:50:00Z"
      checked_body_sha256: "sha256:94ab3a5de9570254e04265f34341450e890e6d46e96f85defb29d5ab635f5afc"

    本ループの依頼範囲は Issue refinement の完了までであり、実装コード・worktree・branch・commit・PR は作成していません。次の実装着手(impl-review-loop)は別途の明示的な指示で行ってください。

  10. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-08-11T09:42:42Z)

    • PR: 実装: GitHub Issue labels を presentation-only metadata として SSOT 化する #2092
    • Worktree: .claude/worktrees/issue-2084-label-authority
    • Branch: worktree-issue-2084-label-authority
    • Head SHA: 4b45508fa67ef9962a51f05280825ce5a1e65e86
    • Verification: AC1-AC10 すべて PASS(AC3/AC4/AC5/AC7/AC8 は runtime-verification: true として pytest 実行済み)。標準 4 コマンド(typecheck/lint/test/build)も PASS。
    • 後続: PR レビュー(pr-review-judge)→ マージ → post-merge-cleanup
  11. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    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 内に存在しないことを確認済み)。

    • Before: ## 既存 Issue の native parent/blockedBy/blocking 同期(issue_relationship.update、Issue #1883)
    • After: ## 既存の Issue に対して native な parent・blockedBy・blocking の関係性を同期する仕組み(issue_relationship.update、Issue #1883)(ratio=0.224)

    docs/dev/github-ops.md 以外は変更していない(Allowed Paths 準拠)。

    検証結果

    commit

  12. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    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-human label を BLOCKED authority として扱う記述を削除しました。
    • readiness authority は Issue native open/closed state・Machine-Readable Contract・GitHub native dependency close 状態・explicit operator/OWNER directive・review/test/CI 結果のみである旨を明記しました(実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 Outcome の Readiness Plane 定義に整合)。
    • 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 の実際の判定ロジックを通す経路を検証しています。

    1. 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 が完全に一致することを確認。
    2. 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 に固定されることを確認。
    3. 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)に流し込みます。例外は一切伝播しません。
    • label mutation(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 にしません。
    • 既存 9 テストの scripted response に readback 呼び出しを追加、新規 6 テスト(timeout 変換 2 件、timeout 時の failed+warning 1 件、readback 成功 1 件、readback が mutation の偽陽性を検出する 1 件、readback 自体の失敗 1 件)を追加し、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 非存在の記述を削除
    • 着手条件の設計根拠セクションに、label が readiness 判定に一切関与しない旨の説明を追加
    • Failure Mode 分類表から state/needs-human 存在を単独の Hard stop 行として除去
    • Human Escalation Classification 表の記述を「contract 未取得(label は判定に用いない)」に修正

    CI main 追従: origin/main(#2081 → #2087 まで進行)を 2 回 merge して追従させました(conflict なし)。

    AC11-14 Verification Commands

    # AC11: state/needs-human を readiness authority として扱う記述が除去されている
    $ ! grep -n "state/needs-human.*BLOCKED\|BLOCKED.*state/needs-human" .claude/skills/issue-contract-review/SKILL.md
    $ grep -n "presentation-only\|non-authoritative" .claude/skills/issue-contract-review/SKILL.md
    $ grep -n "presentation-only\|non-authoritative" .claude/skills/issue-contract-review/references/contract-compliance.md
    # 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
    # AC14: derived design doc が label-authority 契約に整合
    $ ! grep -n "state/needs-human.*非存在" docs/dev/workflows/impl-review-loop-design.md
    $ grep -n "label は判定に用いない\|readiness authority" docs/dev/workflows/impl-review-loop-design.md

    検証結果サマリ

    • pnpm typecheck / pnpm lint / pnpm test(1872件)/ pnpm build: 全 PASS
    • uv 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 の rg unreadable-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 外・無関係)
    • 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 内
    • PR 実装: GitHub Issue labels を presentation-only metadata として SSOT 化する #2092 head: 63568f9a13c85f26690dc97a83fb41f5640203f8(mergeStateStatus: CLEAN, mergeable: MERGEABLE)
  13. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    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 の意図は変更していません。

    検証結果

    $ ! grep -n -e "required_routing_labels" -e "hard_stop_labels" docs/dev/workflow.md
    (no match, exit 0)
    
    $ grep -n -e "presentation-only" -e "presentation_only" docs/dev/workflow.md
    202:- **SSOT 原則(#2084): GitHub Issue labels は presentation-only(...)...
    (exit 0)
    

    両方 PASS を確認しました。

    標準4コマンド(pnpm typecheck / pnpm lint / pnpm test(1872件成功) / pnpm build)も再実行しすべて PASS しました。

    docs/dev/workflow.md 1ファイルのみの変更です(既存 Allowed Paths 内)。

    コミット・CI

    PR: #2092

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/implementerenhancementphase/implementationtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions