Repository navigation
実装: GitHub Issue labels を presentation-only metadata として SSOT 化する - #2092
Conversation
) 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)から除去し、readiness authority を non-label evidence(native issue open/closed state、GitHub native dependency close 状態、CONTRACT_REVIEW_RESULT_V1 status)のみで 再定義する。triage-required remove / phase/implementation・ agent/implementer add は readiness decision 後の best-effort presentation sync(apply_triage_label_transition.py、新規)として 再定義する。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Preview URLPreview removed (PR #2092 closed). |
PR Body Japanese Check の per-block 検査で「既存 Issue の native parent/blockedBy/blocking 同期」見出しが ratio=0.089 (jp=5, total=56) となり閾値 0.1 未達だったため、意味を変えずに日本語の助詞・説明を 補って比率を引き上げる。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
判定: REQUEST_CHANGESPR #2092 の方向性は妥当ですが、「labels は readiness/control-flow authority ではない」という最重要 invariant が、上流 consumer に残っています。現状はマージ不可と判定します。 P0 —
|
…out/readbackを追加する (#2084) PR #2092 への OWNER REQUEST_CHANGES(comment #5251894253)に基づく fix_delta。 - issue-contract-review/SKILL.md・contract-compliance.md から state/needs-human label を BLOCKED authority として扱う記述を除去し、readiness authority は label 非依存の non-label evidence のみである契約に揃えた(AC11)。 - issue-contract-review 自体の実行経路(run_once() / check_product_spec_contract.py の実 decision pipeline)を通す regression test を追加し、label permutation でも readiness が不変であることを固定した(AC12)。 - apply_triage_label_transition.py の subprocess 呼び出しに bounded timeout (30秒)を追加し、TimeoutExpired 時は result: failed + warning + exit 0 で 終了するようにした。また label mutation 後に readback を行い、実際に delta が適用されたことを確認してから applied を返すよう変更した(AC13)。 - docs/dev/workflows/impl-review-loop-design.md の Invocation Contract / Failure Mode / Escalation 記述を label-authority 契約に整合させた(AC14)。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
CI ruff check の F401 unused-import 指摘を解消。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
pr-reviewer REQUEST_CHANGES対応。AC1 VC(`! grep required_routing_labels/hard_stop_labels`)が SSOT原則の否定文脈の説明文中に残っていたliteral語でfailしていたため、 意味を変えずに婉曲表現へ書き換えた。
Summary
この PR は Issue #2084 の実装です。GitHub Issue labels を presentation-only / non-authoritative metadata として SSOT 化し、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)から除去しました。docs/dev/workflow.mdのimplementation_consumer_ready_contractからrequired_routing_labels/hard_stop_labelsを除去し、「labels are presentation-only」の SSOT 原則を明記しました。docs/dev/github-ops.mdに、既存のstate/blocked/state/queuedの「補助・派生表示」原則を全ラベル種別へ一般化した SSOT セクションを追加しました。build_intake_capsule.pyのready_status(_next_action_routeが参照する readiness gate)からphase_label_ok依存を除去しました(ready_tuple.phase_label_presentは観測用フィールドとして残しています)。impl-review-loop/steps/preparation.mdの Intake Gatemetadata_not_readyからphase/implementationlabel 欠落条件を除去しました。issue-refinement-loop/SKILL.mdStep 0 の hard stop 条件からstate/needs-human/state/doneの label 単独判定を除去し、停止には OWNER の明示指示やhuman_judgment_requiredが必要である旨を明記、state/doneの代替として GitHub native Issueclosedstate を参照するようにしました。termination-policy.mdのLOOP_HANDOFF_RESULT_V1からmetadata.phase_label_readyをimpl_ready条件から除去し、label_sync_observation(kind: presentation_sync)を non-authoritative telemetry として再定義、auto_fixes.requiredに triage label 遷移を追加しない契約を明記しました。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 authority フィールドは一切含みません)。implement-issue/SKILL.mdのphase/implementation依存記述を、readiness gate ではなく routing/classification 用の非authoritative 参照であることが分かるよう更新しました。Checks
docs/dev/workflow.mdからrequired_routing_labels/hard_stop_labels除去 + presentation-only SSOT 明記):! grep -n -e "required_routing_labels" -e "hard_stop_labels" docs/dev/workflow.md(exit 0, no match) /grep -n -e "presentation-only" -e "presentation_only" docs/dev/workflow.md(1 件マッチ) を実行し、両方 PASS しました。docs/dev/github-ops.mdに全ラベル種別 SSOT セクション追加):grep -n -e "presentation-only" -e "presentation_only" docs/dev/github-ops.mdを実行し、2 件マッチしました。ready_statusがphase_label_okに非依存。runtime-verification: true):uv run --locked pytest .claude/skills/impl-review-loop/tests/test_label_authority_invariants.py::test_ready_status_independent_of_phase_label -vを実行し、1 件成功しました(labels=[] / labels=["phase/implementation"] の両方でissue_ready_tuple.status == "pass"、next_action.routeも同一であることを end-to-end で確認)。preparation.mdのmetadata_not_readyから label 条件除去 +test_intake_gate.py整合。runtime-verification: true):uv run --locked pytest .claude/skills/impl-review-loop/tests/test_intake_gate.py -vを実行し、26 件すべて成功しました(新規test_ac3_metadata_not_ready_excludes_phase_implementation_labelを含む)。SKILL.mdStep 0 hard stop から label 単独判定除去 +test_loop_policy.py整合。runtime-verification: true):uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_loop_policy.py -k "hard_stop" -vを実行し、12 件すべて成功しました。termination-policy.mdからphase_label_ready除去 +presentation_sync再定義):! grep -n "phase_label_ready" .claude/skills/issue-refinement-loop/references/termination-policy.md(exit 1, no match) /grep -n -e "presentation_sync" -e "label_sync_observation" .claude/skills/issue-refinement-loop/references/termination-policy.md(4 件マッチ) を実行し、両方 PASS しました。apply_triage_label_transition.pyの applied/noop/failed 契約。runtime-verification: true):uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_apply_triage_label_transition.py -vを実行し、9 件すべて成功しました(idempotency、unrelated label 保持、permission/network/API failure の warning-only 化、readiness authority フィールド非混入を含む)。uv run --locked pytest .claude/skills/impl-review-loop/tests/test_label_authority_invariants.py::test_ready_status_label_permutation_matrix -vを実行し、8 件すべて成功しました([]/triage-required/phase/implementation/state/needs-humanの全組み合わせで baseline と同一のready_status/next_action.route)。## Runtime Verification Applicabilityセクションが Issue 本文に存在):gh issue view 2084 --repo squne121/loop-protocol --json body -q .bodyで本文中に該当セクションの存在を確認しました(Issue 自身の自己参照チェック)。implement-issue/SKILL.mdのphase/implementation言及が非authoritative 化されている):grep -n "phase/implementation" .claude/skills/implement-issue/SKILL.mdを実行し、1 件マッチ(readiness gate ではなく routing/classification 用の非authoritative 参照である旨を明記した文言)を確認しました。uv run --locked pytest .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py -vを実行し、14 件すべて成功しました。uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_loop_policy.py -qを実行し、26 件すべて成功しました(全件、-k hard_stop限定でない)。pnpm typecheck(PASS)、pnpm lint(PASS)、pnpm test(1872 件すべて成功、112 test files)、pnpm build(PASS、dist/生成)をすべて実行し PASS しました。Runtime Verification Artifacts(動作検証証跡)
decision: immediate、applicable_acs: [AC3, AC4, AC5, AC7, AC8](Issue 本文の## Runtime Verification Applicability節)に従い、以下を pytest subprocess / fixture-backed 挙動として実測しました(mock-only route ではなくbuild_intake_capsule.py/apply_triage_label_transition.pyの実関数呼び出し)。test_label_authority_invariants.pyはbuild_intake_capsule()を_run_commandの副作用差し替えのみで end-to-end 実行し、label permutation(8 パターン)ごとのissue_ready_tuple.status/next_action.routeが baseline(labels=[])と同一であることを assert しています。test_intake_gate.py::test_ac3_metadata_not_ready_excludes_phase_implementation_labelはpreparation.mdのmetadata_not_readyセクション本文(条件リスト部分のみを code-fence 前で切り出し)にphase/implementationが含まれないことを固定しています。test_loop_policy.py::test_hard_stop_state_needs_human/test_hard_stop_state_doneは、SKILL.md に別 authority(human_judgment_required/ OWNER)と nativeclosedstate 参照が明記されていることを固定しています。test_apply_triage_label_transition.pyは scripted gh CLI 応答(rc/stdout/stderr)を注入する_ScriptedRunnerでapply_triage_label_transition()を直接実行し、applied/noop/failed の 3 分岐、idempotency(2 回目実行が noop)、unrelated label 保持、permission/network/API failure が例外を投げずwarningsに記録されること、戻り値にstatus/routing_action/implementation_allowedキーが一切含まれないことを固定しています。Schema Change Applicability
.claude/skills/issue-refinement-loop/references/termination-policy.mdのLOOP_HANDOFF_RESULT_V1スキーマ定義からmetadata.phase_label_ready: boolフィールドを削除し、label_sync_observation(新規ブロック)を追加しました。またapply_triage_label_transition.pyの新規APPLY_TRIAGE_LABEL_TRANSITION_RESULT_V1スキーマを追加しています。Schema Consumer Inventory
.claude/skills/issue-refinement-loop/references/termination-policy.md(LOOP_HANDOFF_RESULT_V1SSOT 定義自体)metadata.phase_label_ready削除、label_sync_observation追加、impl_ready条件式から該当項目を除去.claude/skills/issue-refinement-loop/scripts/*.py(decide_next_loop_action.py/publish_termination_report.py/validate_issue_execution_decision.py等)grep -rn "phase_label_ready" .claude/skills/issue-refinement-loop/scripts/で現行 main に該当フィールドをキーとして parse する production コードが存在しないことを確認済み(marker は LLM orchestrator が prose として読む契約であり、構造化 JSON パーサーの consumer が存在しない).claude/skills/issue-refinement-loop/tests/test_publish_termination_report.pyphase_label_readyの参照なし(grepで確認済み)render_termination_report.py/test_render_termination_report.py/test_loop_handoff_result.pyapply_triage_label_transition.py(新規スキーマAPPLY_TRIAGE_LABEL_TRANSITION_RESULT_V1の producer)Before / After(
LOOP_HANDOFF_RESULT_V1.metadataフィールド変更)Safety Claim Matrix
build_intake_capsule.pyのready_status/next_action.routeが label 構成に依存せず不変であるtest_label_authority_invariants.py全 10 件 PASS)preparation.mdIntake Gate のmetadata_not_readyがphase/implementationlabel 欠落を理由に停止しないtest_intake_gate.py全 26 件 PASS、新規test_ac3_metadata_not_ready_excludes_phase_implementation_label)issue-refinement-loopStep 0 の hard stop がstate/needs-human/state/donelabel 単独では発動しない(別 authority が必要)test_loop_policy.py -k hard_stop全 12 件 PASS)apply_triage_label_transition.pyの label mutation 失敗(permission/network/API)が readiness/status/routing_action/implementation_allowedを一切変化させないtest_apply_triage_label_transition.py全 9 件 PASS、test_result_schema_does_not_contain_readiness_authority_fields含む)apply_triage_label_transition.pyのrun_fn差し替えテストで gh CLI 失敗が例外を投げずwarningsに記録されることを確認、termination-policy.mdのlabel_sync_observation契約記述Notes
issue-refinement-loopapproved 終了時のtriage-requiredラベル遷移という狭いスコープで起票されましたが、OWNER directive(実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 comment #5249582962 / #5249734344)により、label→gate 結合の全面除去へスコープ拡張されました。Issue 本文の Scope Delta(OWNER_DIRECTIVE_MATERIALIZED_FROM_INTERACTIVE_PROMPT_V1)に基づく承認済み拡張です。#2053/ Draft PR fix(issue-refinement-loop): bind freeform OWNER scope authority end-to-end and expose routing telemetry #2068 との overlap は Issue 本文 Notes for Reviewer で non-conflict と確認済みです(gh pr diff 2068の実差分ファイルが本 PR の Allowed Paths と無関係)。