Skip to content

実装: runner_unavailable を identity 検証付き deferred route にする #1805

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "impl-review-loop Step 2.5 の runner_unavailable を、必要な marker identity だけ検証して安全に deferred route へ送る"
change_kind: workflow

Parent Issue

none(単独改善)

Parent Goal Ref

  • Goal: なし(単独改善)
  • Desired Destination: scope-rollup preflight の runner unavailable を、不要な artifact/capture 要件なしに deferred として記録できる実装 Issue

Current Validated Scope

  • parse_scope_rollup_run_result.py の runner_unavailable 分岐で、repo/current issue/invocation/requested_at/generated_at の一致と時系列だけを検証する
  • runner_unavailable では script SHA、result payload、capture sidecar の存在・内容を要求しない
  • ok / failed / malformed marker と capture-sidecar failures は既存の stop_human semantics を維持する
  • preparation.md に上記 route 条件を明記し、既存 parser tests に回帰ケースを追加する

Remaining Parent Gaps

  • scope-rollup runner が unavailable になる根本原因、起動経路、SubagentStop hook の改善は扱わない
  • marker schema、capture sidecar の生成仕様、session-recording / permission / credential 検査の追加は扱わない

Outcome

.claude/skills/impl-review-loop/scripts/parse_scope_rollup_run_result.py、対応 pytest、preparation.md が更新され、identity 一致済みの runner_unavailable marker は script SHA・payload・capture sidecar がなくても routing_action: deferred へ決定論的に route され、その他の marker/sidecar failure は stop_human のまま targeted pytest が PASS する状態。

In Scope

  • runner_unavailable marker について repo、current_issue、invocation_id、requested_at、generated_at の一致および generated_at > requested_at を検証する処理
  • runner_unavailable の検証順序を調整し、script SHA、result payload/hash/verify、capture sidecar を要求せず deferred を返す処理
  • ok / failed / malformed marker および capture-sidecar failures が従来どおり stop_human になる回帰テスト
  • preparation.md の route 表と runner_unavailable の条件説明の更新

Out of Scope

Acceptance Criteria

  • AC1: repo/current issue/invocation/requested_at/generated_at が一致し generated_at > requested_at の status: runner_unavailable marker は、script SHA 不在・result payload 不在・capture sidecar 不在でも status: runner_unavailable かつ routing_action: deferred を返す
  • AC2: status: ok と status: failed の marker は既存の script SHA/payload/capture 検証と route を維持し、成功 marker は continue、failed marker は stop_human を返す
  • AC3: repo/current issue/invocation/requested_at/generated_at の不一致、malformed marker、stale timestamp、capture-sidecar missing/invalid/mismatch は stop_human を返す
  • AC4: preparation.md に、runner_unavailable は identity と timestamp 順序のみを検証して deferred、その他の marker/sidecar failures は stop_human とする条件が明記される
  • AC5: 対応する targeted pytest が全件 PASS する

Verification Commands

# AC1
# preflight-scope: pr_review_only
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py -q -k runner_unavailable
# AC2
# baseline-expect: pass
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py -q -k failed_marker_stops_human
# AC3
# baseline-expect: pass
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py -q -k "marker or capture or runner_unavailable"
# AC4
# baseline-expect: pass
$ rg -n "runner_unavailable" .claude/skills/impl-review-loop/steps/preparation.md
# AC5
# baseline-expect: pass
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py -q

Allowed Paths

  • .claude/skills/impl-review-loop/scripts/parse_scope_rollup_run_result.py
  • .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py
  • .claude/skills/impl-review-loop/steps/preparation.md

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • ok / failed / malformed marker または capture-sidecar failure の既存 stop_human semantics を弱める必要が生じた場合

Required Skills

なし

Required Design References

  • .claude/skills/impl-review-loop/steps/preparation.md
  • .claude/skills/impl-review-loop/scripts/parse_scope_rollup_run_result.py
  • .claude/skills/issue-refinement-loop/references/scope-rollup-policy.md

Scope Delta(該当時のみ記載)

N/A

Runtime Verification Applicability

本 Issue の変更対象はワークフロー文書・スクリプトのみです。ゲームの実行時動作には影響しません。

decision: not_applicable
reason: "Workflow documentation and script changes only. No runtime game behavior changed."

Delivery Rule

  • 1 Issue = 1 PR
  • 実装着手前に fresh CONTRACT_REVIEW_RESULT_V1 status: go を取得する
  • 専用 worktree で実装し、Draft PR を既定とする

Notes for Reviewer

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    on Jul 26, 2026
  2. squne121 commented on Jul 26, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-26T16:15:53Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1805
      body_sha256: "sha256:c9c94a7d7b7b68da15c44081bcc39ef67d0a065bc9abb8d7d191995c7a3e613d"
      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:c9c94a7d7b7b68da15c44081bcc39ef67d0a065bc9abb8d7d191995c7a3e613d","source_provenance":{"source_type":"github_api","body_file":null}}
        vc_preflight:
          decision: pass
          classifications: [{"ac":"AC1","line":3,"raw_command":"uv run --locked pytest .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py -q -k runner_unavailable","command_hash":"sha256:1475104c88323912888f10465cf17e002acdf5322f00fdfed10df468b31a71e6","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_pr_review_only","decision":"go","scope_class":"pr_review_only","confidence":"low","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,"verification_owner":"pr-review-judge","deferred_reason":"VC marked pr_review_only; verification deferred to PR review","runtime_verification_required":false},{"ac":"AC2","line":3,"raw_command":"uv run --locked pytest .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py -q -k failed_marker_stops_human","command_hash":"sha256:c8f6aa9470a157e2afbe7767ab3fa39cb44611324904bec14e5f4116ded5ca19","execution_key_hash":"sha256:c2eb0bf4377ef44fd744eb52d9c5e9ce35a306dc4eea5293aae70e07b8b6a993","runner":"exec","exit_code":0,"classification":"expected_pass","category":"baseline_expect_pass","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":[".                                                                        [100%]","1 passed, 28 deselected in 0.07s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":266,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"pass","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"raw":"# baseline-expect: pass"},"strict":null,"repair":null},{"ac":"AC3","line":3,"raw_command":"uv run --locked pytest .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py -q -k \"marker or capture or runner_unavailable\"","command_hash":"sha256:5395188e2c9344191a79261f14b6452991cc8f5d35523fad520c6287cee821b3","execution_key_hash":"sha256:9501183b3e7ba88023d5fc53cd97a3dff54690d69746c622d434e7b84a376d86","runner":"exec","exit_code":0,"classification":"expected_pass","category":"baseline_expect_pass","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["........................                                                 [100%]","24 passed, 5 deselected in 1.01s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":1197,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"pass","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"raw":"# baseline-expect: pass"},"strict":null,"repair":null},{"ac":"AC4","line":3,"raw_command":"rg -n \"runner_unavailable\" .claude/skills/impl-review-loop/steps/preparation.md","command_hash":"sha256:b390b41bd771f07f593d1601481b5105692532f0b27bb0164e8b8341290cdf47","execution_key_hash":"sha256:d86be4cb90c2b111cbce7b1e37def8b663c681c7f671ab04f1630eb8294eaf7c","runner":"exec","exit_code":0,"classification":"expected_pass","category":"baseline_expect_pass","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["413:  status: ok | failed | runner_unavailable","462:- `status: runner_unavailable` → `routing_action: deferred`","489:### runner_unavailable / marker 違反の扱い","498:- runner が `status: runner_unavailable` を返し、marker 検証が構文上有効な場合は、従来どおり `decision: deferred` を許容する(必要に応じて `human_escalation`)","522:    status: ok | failed | runner_unavailable | rejected | marker_missing | marker_malformed | marker_ambiguous"],"stdout_truncated":false,"stdout_original_line_count":6,"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":2,"raw":"# baseline-expect: pass"},"strict":null,"repair":null},{"ac":"AC5","line":3,"raw_command":"uv run --locked pytest .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py -q","command_hash":"sha256:230c871d93a0d37ee4cd4e1193e7d97693be8395e0f2e1c6c2404da9e1546e9e","execution_key_hash":"sha256:71c80e10cdc37a04c412dee3a0e852d76da1e49fa8dc2f2e98c92815240c27c9","runner":"exec","exit_code":0,"classification":"expected_pass","category":"baseline_expect_pass","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":[".............................                                            [100%]","29 passed in 1.15s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":1349,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"pass","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"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":"adfb8a8402e9ecb09defcf770a669d52a3530ec8","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":1801,"title":"実装: review-issue の structured_blockers を compact_review_result.py の REVIEW_ISSUE_RESULT_V1 スキーマに一致させる (#1791)","base_ref_name":"main","head_ref_name":"worktree-issue-1791-review-issue-structured-blockers-compact","head_ref_oid":"7c81000137828ca490b769d5ea24e169e73e636f","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/1801","changed_files_count_graphql":3}],"fetched_count":2,"totalCount":2,"has_next_page":false,"complete":true,"saturated":false,"limit":200,"page_count":1,"inventory_digest":"sha256:61ae1f252ea533e0b7b4af1f05f8f930fb442b05bad3bf9128cfc98975f6f927","errors":[]},"inventory_digest_extended":"sha256:8b6f6a00bdcd94afc893daebfbff2eea22d2289ca62665d5bbe1ed243bc29e1f","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":1805,"contract_source_kind":"issue_comment","contract_source_id":"5084311131","contract_body_sha256":"sha256:c9c94a7d7b7b68da15c44081bcc39ef67d0a065bc9abb8d7d191995c7a3e613d","allowed_paths_normalized_sha256":"9e77893af00967b8a1bbde963fde5dbec389b814cc8707429a3c3e640584e672","base_ref":"main","base_sha_at_snapshot":"adfb8a8402e9ecb09defcf770a669d52a3530ec8"}
  3. squne121 commented on Jul 26, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了

    • PR: fix(impl-review-loop): identity-bound runner unavailable をdeferredにする #1809
    • Worktree: .claude/worktrees/issue-1805-runner-unavailable-identity-deferred
    • Branch: worktree-issue-1805-runner-unavailable-identity-deferred
    • Head SHA: b3a01c8ed6819ee13ce7f5d363180c05711a84b2
    • Verification: AC1 7 PASS、AC2 1 PASS、AC3 30 PASS、AC4 PASS、AC5 35 PASS
    • 後続: PR レビュー(pr-review-judge)→ マージ → post-merge-cleanup
  4. squne121 commented on Jul 26, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了

    Issue #1805 の実装レビュー・ループを終了します。

    IMPL_REVIEW_LOOP_RESULT_V1:
      schema_version: 1
      status: draft_pr_ready
      termination_reason: approved
      merge_ready: true
      pr_url: "https://github.com/squne121/loop-protocol/pull/1809"
      head_sha: "01356052ee1d396b3df1dd8ef1b32cde23478a0c"
      issue_number: 1805
      iteration: 0
      required_auto_actions: []
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      follow_ups: []
      notes: []
    ISSUE_SCOPE_ROLLUP_DECISION_V2:
      schema_version: 2
      decision: deferred
      reason_code: runner_unavailable
      rationale: "named runner returned valid runner_unavailable; parsed by PR worktree parser"
      follow_ups: []
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/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions