Skip to content

実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "#2084 comment #5249734344 で顕在化した、明示された human-context anchor に対して構造化 ANCHOR_SCOPE_REFRAME_V1 を要求し、かつ人間が指示した scope expansion 自体を Stop Condition として human_escalation する workflow defect を解消する"
change_kind: workflow

Parent Issue

なし(workflow-level の単独改善)。

Parent Goal Ref

  • Goal: N/A(単独改善のため親 Issue なし)
  • Desired Destination: N/A

Current Validated Scope

  • 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 comment #5251322440(OWNER review, NEEDS_REFRAME 判定)で指摘された、operator-selected human-context anchor の freeform directive を scope mutation authority として扱う workflow policy と production routing の完成
  • 具体的には Issue 本文の ## Outcome / ## In Scope / ## Acceptance Criteria に定義される範囲(preflight.run.with_human_context の canonical authority 明文化、AC3 の agent-derived exact path 導出、#2053/PR #2068 transport の再利用、skill_runtime_exec.py の privileged dispatch gap 解消)に限定する

Remaining Parent Gaps

なし(単独改善のため親 Issue に紐づく残課題はない)

Background

Issue #2084 の refinement では、OWNER が freeform コメントで Issue の前提変更と scope expansion を明示したにもかかわらず、以下を理由に human_escalation で停止した。

  • コメントに構造化 ANCHOR_SCOPE_REFRAME_V1 payload がない
  • 必要な変更範囲が現 Issue の Allowed Paths / architecture layer を超える
  • 新規 Issue 分割または scope reframe 内容を人間が再度決める必要がある

しかし current repository には既に以下の境界が存在する。

したがって本 Issue は、freeform authority の schema/transport を再発明するのではなく、**「operator が human-context lane として明示した same-target anchor の semantic directive を scope mutation authority として扱い、必要な technical inventory を agent が導出して contract rewrite を継続する」**という workflow policy と production routing を完成させる。

起点:

Accepted Trust Model / Provenance Limitation

本 repository は個人趣味開発であり、同一 GitHub principal が人間のブラウザ操作と AI agent の GitHub mutation の双方に使われ得る。GitHub comment metadata だけから「この文字列を物理的に人間が入力したか、AI が生成・投稿したか」を完全に識別することは本 Issue では解決しない。

本 Issue では次を明示的に採用する。

  1. preflight.run.with_human_context / contract_update.run.with_human_context の origin は operator が runtime invocation で宣言する。
  2. GitHub の author_association: OWNER|MEMBER|COLLABORATOR は principal trust の補助情報であり、verified_human=true の証明には使わない。
  3. same-target の canonical issue-comment URL を operator が human-context lane に明示投入した場合、その anchor は operator_asserted_human_context として扱う。
  4. telemetry / docs はこれを「verified human comment」と表現せず、operator assertion に基づく operational trust であることを明記する。
  5. with_agent_report / unlabeled anchor は同じ URL であっても scope mutation authority を得ない。

この trade-off は security guarantee ではなく、個人趣味開発で autonomous workflow を優先する明示的な運用方針である。

Outcome

operator-selected human-context anchor が same Issue の goal / scope / Allowed Paths / architecture layer の拡張を freeform prose で指示した場合、ANCHOR_SCOPE_REFRAME_V1 の手書き YAML を人間に要求せず、agent が read-only investigation から必要な exact technical inventory を導出し、controlled Issue contract rewrite へ進める。

scope expansion そのものは human escalation の理由にしない。contract rewrite 後は必ず live body readback、fresh preflight、fresh review、fresh readiness を再実行し、implementation authorization はその fresh gate が通るまで false を維持する。

実際に停止するのは、semantic ambiguity/conflict、cross-target direct mutation、secret/credential、destructive operation、external paid service、permission boundary escalation 等の安全上または意味上の理由に限定する。

In Scope

  • preflight.run.with_human_context を operator-selected human-context の canonical authority lane として docs / skill / runtime policy で明文化する。
  • freeform human directive に scope expansion signal がある場合、構造化 ANCHOR_SCOPE_REFRAME_V1 不在だけを理由に no_anchor_scope_reframe_v1_payload / human_judgment_required へ落とさない。
  • human directive が「この Issue の問題を workflow 全体で直す」「関連 consumer も修正する」等の high-level semantic scope を指定し、exact path 一覧を列挙していない場合、codebase-investigator / current-main inventory から bounded exact paths を導出できるようにする。人間へ exact path YAML の再入力を要求しない。
  • same-target human-context directive と整合する Allowed Paths / In Scope / Out of Scope / Required Design References の追加は contract update として許可し、「現在の Allowed Paths 外」「別 architecture layer」という事実だけで停止しない。
  • exact section-bound patch が作れない場合は既存 issue_editor_required / full rewrite controlled lane へ route し、human escalation を default fallback にしない。
  • 実装: 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 の existing freeform authority transport / receipt / controlled consumer を再利用し、新規 provenance schema・ledger・sidecar を追加しない。
  • PR fix(issue-refinement-loop): bind freeform OWNER scope authority end-to-end and expose routing telemetry #2068 で確認された scripts/agent-guards/skill_runtime_exec.py の privileged executor dispatch gap を解消し、authority transport / contract update の canonical command shape が実 subprocess から production consumer へ到達できるようにする。
  • 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 comment #5249734344 の failure profile を regression fixture として固定し、構造化 payload なし + architecture-level scope expansion のケースが autonomous contract rewrite route へ進むことを検証する。
  • docs に、same GitHub principal 上の human/agent physical-origin 判別は保証しないことと、その代わり operator-selected lane を trust boundary とすることを明記する。

Out of Scope

Design Invariants

  1. Operator assertion ≠ verified human identity
    • command profile が origin を宣言する。GitHub comment metadata から physical author を推測しない。
  2. Semantic authority ≠ exact-path authorship
    • 人間は goal/scope change を自然言語で指示できる。exact file inventory は agent が current repo evidence から導出してよい。
  3. Scope expansion ≠ implementation authorization
    • Issue contract の Allowed Paths を広げることと、その path を実装で変更してよいことを同一 gate にしない。rewrite 後の fresh review/readiness が implementation authorization を決める。
  4. Same-target only
    • human-context authority は指定 Issue の contract mutationに限定する。cross-target direct mutation は従来どおり拒否する。
  5. Agent/unlabeled lane remains non-authoritative
    • 同じ comment URL でも origin lane が agent/unlabeled なら scope mutation authority を得ない。
  6. Minimal harness
    • 新しい provenance service / approval ledger / hand-written structured approval payload を要求せず、existing runtime profile + live GitHub readback + fresh review を authority とする。

Acceptance Criteria

  • AC1: same-target canonical Issue comment を preflight.run.with_human_context で与え、freeform prose が scope expansion を明示している場合、ANCHOR_SCOPE_REFRAME_V1 不在だけを理由に reason: no_anchor_scope_reframe_v1_payload / human_judgment_required にならない。
  • AC2: operator-selected human-context origin は command invocation による assertion として扱われ、docs/telemetry が verified_human を主張しない。GitHub principal が同じでも human/AI physical-origin を判別しないことが明記される。
  • AC3: freeform directive が exact path を列挙せず architecture/workflow-level scope expansion を要求する場合、read-only repo inventory から same-goal の exact path delta を導出し、contract_update_required または issue_editor_required に route できる。人間に手書き ANCHOR_SCOPE_REFRAME_V1 を要求しない。
  • AC4: trusted same-target human-context directive に整合する Allowed Paths / architecture layer の追加は、それ自体を Stop Condition にしない。controlled rewrite 後に fresh body readback → fresh preflight → fresh review → fresh readiness を必須とする。
  • AC5: human directive が semantic ambiguity/conflict、cross-target direct mutation、destructive operation、secret/credential、paid external service、permission escalation を含む場合は従来どおり fail-closed / human escalation する。
  • AC6: 同じ anchor URL を preflight.run.with_agent_report または unlabeled profile に渡した場合、scope mutation authority は付与されず、human-context lane への暗黙昇格も起きない。
  • AC7: exact section patch を作れない approved scope expansion は issue_editor_required full-rewrite lane へ到達し、scope expansion だけを理由とする termination report を出さない。
  • AC8: 実装: issue-refinement-loop の approved 終了時に triage-required ラベル遷移を実行する #2084 comment #5249734344 相当の regression fixture(freeform operator directive、structured payload なし、docs/impl-review-loop/build_intake_capsule/implement-issue 等への scope expansion)で autonomous contract rewrite route が選ばれる。
  • AC9: 実装: 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 の existing SCOPE_DELTA_AUTHORITY_* transport/receipt を再利用し、本 Issue のための新規 provenance schema / ledger / sidecar を追加しない。
  • AC10: scripts/agent-guards/skill_runtime_exec.py が 実装: 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 の canonical authority transport / contract update command shape を実 subprocess dispatch でき、registry/policy 宣言だけの false-green を残さない。
  • AC11: contract rewrite が完了しても fresh preflight/review/readiness が完了する前は implementation_allowed=false を維持する。
  • AC12: targeted Python tests と agent-guard tests が PASS し、既存 structured ANCHOR_SCOPE_REFRAME_V1、agent-report、untrusted/cross-target fail-closed regression を壊さない。

Runtime Verification Applicability

decision: immediate
reason: "本 Issue の主要欠陥は privileged executor → preflight/router/controlled rewrite の production routing と scope-decision behavior であり、direct function fixture だけでは registry/policy/dispatcher の実到達性を証明できないため。"
applicable_acs: [AC1, AC3, AC4, AC6, AC7, AC8, AC10, AC11]
execution_environment:
  - "uv run --locked pytest による local subprocess / fixture-backed GitHub payload"
  - "scripts/agent-guards/skill_runtime_exec.py の registry-rendered argv 実 subprocess"
live_github_mutation: prohibited
network_required: false
skip_conditions:
  - "uv / pytest / python3 が利用できない場合は exit 77 とし PASS に変換しない"
fallback_policy:
  fallback_success_is_pass: false
  notes: "direct function test や mock-only route だけで privileged executor の AC10 を PASS としない"
artifact_requirements:
  - "registry-rendered argv と dispatcher reason/status"
  - "operator-selected human-context fixture の scope decision と final route"
  - "fresh post-rewrite gate が implementation_allowed=false→fresh go 後のみ true となる証跡"

Verification Commands

# AC1
# AC3
# AC4
# AC7
# AC8
# AC11
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_operator_selected_scope_reframe.py .claude/skills/issue-refinement-loop/tests/test_scope_signal_guard_lane_split.py .claude/skills/issue-refinement-loop/tests/test_decide_next_loop_action_contract_update.py -q
# AC2
# AC6
# AC10
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py scripts/agent-guards/tests/test_skill_runtime_policy_anchor.py .claude/skills/issue-refinement-loop/tests/test_anchor_scope_reframe_preflight.py -q
# AC5
# AC9
# AC12
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_scope_delta_authority.py .claude/skills/issue-refinement-loop/tests/test_issue_1952_trusted_directive_regression.py -q

Allowed Paths

  • docs/dev/workflow.md
  • docs/dev/agent-skill-boundaries.md
  • docs/dev/workflows/issue-refinement-loop-design.md
  • .claude/skills/issue-refinement-loop/SKILL.md
  • .claude/skills/issue-refinement-loop/references/anchor-comment-handling.md
  • .claude/skills/issue-refinement-loop/references/scope-signal-guard.md
  • .claude/skills/issue-refinement-loop/references/termination-policy.md
  • .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py
  • .claude/skills/issue-refinement-loop/scripts/scope_signal_delta.py
  • .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py
  • .claude/skills/issue-refinement-loop/scripts/decide_next_loop_action.py
  • .claude/skills/issue-refinement-loop/scripts/command_registry.py
  • .claude/skills/issue-refinement-loop/tests/test_scope_delta_authority.py
  • .claude/skills/issue-refinement-loop/tests/test_issue_1952_trusted_directive_regression.py
  • .claude/skills/issue-refinement-loop/tests/test_anchor_scope_reframe_preflight.py
  • .claude/skills/issue-refinement-loop/tests/test_decide_next_loop_action_contract_update.py
  • .claude/skills/issue-refinement-loop/tests/test_scope_signal_guard_lane_split.py
  • .claude/skills/issue-refinement-loop/tests/test_operator_selected_scope_reframe.py
  • scripts/agent-guards/skill_runtime_exec.py
  • scripts/agent-guards/skill_runtime_command_policy.py
  • scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py
  • scripts/agent-guards/tests/test_skill_runtime_policy_anchor.py

Stop Conditions

以下は停止条件とする。

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • explicit human directive 自体が意味的に矛盾・曖昧で、same-goal の contract rewrite を一意に導出できない場合
  • cross-repository / cross-target direct mutation が必要な場合
  • destructive operation、secret/credential exposure、paid external service、repository permission escalation が必要な場合
  • independent product goal を新たに追加する必要があり、現在の human directive から同一 Issue scope と合理的に結び付けられない場合
  • current-main drift により 実装: 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 の transport contract と互換性がなく、reuse ではなく新規 schema migration が必要になった場合

次は停止条件にしない: human-context directive を満たすための same-repository technical inventory の追加、Allowed Paths の追加、別 architecture layer の追加、既存 consumer の追加。これらは explicit human semantic scope と整合する限り contract rewrite 対象として扱い、fresh review/readiness を再実行して継続する。

Required Skills

  • Python(argparse / subprocess / pytest)
  • GitHub Issue/PR ワークフロー設計(authority provenance / scope semantics)

Required Design References

Delivery Rule

Notes for Reviewer

Activity

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

    @squne121
    OwnerAuthor

    総合判定

    NEEDS_REFRAME / implementation-blocked です。

    #2086 が狙っている問題自体は実在します。現行の human-context lane は caller が明示した origin を保持しており、unlabeled / agent-report と区別する設計になっています。一方、current classifier は high-level な Allowed Paths expansion を exact path directive がない限り自動承認しません。したがって「自然言語の OWNER/operator 指示なのに、構造化 payload や exact path の再入力を要求して停止する」という failure profile は妥当です。

    ただし、現在の #2086 はその defect を直す過程で、#2053 が意図的に設けた authority boundary を曖昧にしています。 このまま実装すると「human が goal を承認した」ことを「agent が推測した任意の exact path まで human が承認した」ことへ昇格させる false authority が成立します。#2086 自身には現時点でコメントもなく、この矛盾を解消する補足 authority はありません。

    P0 — #2053 AC4 と #2086 AC3 が authority semantics 上で衝突している

    ここが最大の blocker です。

    #2053 は明示的に、exact inventory が不足する場合を inventory_candidate とし、candidate facts に Issue mutation authority を与えない契約にしています。一方 #2086 AC3 は、人間が exact path を書かなかった場合に agent が repo inventory から path delta を導出し、その結果で contract_update_required または issue_editor_required まで自動継続することを要求しています。

    この2つは、そのままでは両立しません。

    たとえば OWNER が「この問題を workflow 全体で直して」とだけ書いたとします。agent が docs/dev/workflow.md は必要、さらに .claude/skills/foo/SKILL.md も必要、と推論した場合、後者の path は human directive ではなく agent-derived fact です。それを既存 SCOPE_DELTA_AUTHORITY_* transport の human authority と一体化すると、provenance を偽装することになります。

    逆に agent-derived inventory を authority として扱わないなら、#2086 が要求する自動 contract mutation へ進むための「semantic authorization × derived technical facts」の合成規則が必要です。しかし #2086 は AC9 で新規 provenance schema / ledger / sidecar を禁止しており、#2053 の schema 群も Allowed Paths に入れていません。つまり 現在の AC3 は、AC9 を守ると実装契約が足りません。

    推奨は、「high-level human directive → inventory_candidate → root control-plane が same-goal / bounded / safe を検証 → controlled full-body rewrite」の二段階にすることです。agent-derived paths は authorization ではなく transaction-local evidence と明記してください。contract_update_required を許可するのは、元の human directive 自身に exact path がある場合か、#2053 側で provenance-preserving composition が正式に実装された場合に限定するのが安全です。

    P0 — #2068 を「再利用する」と言いつつ、実装 base が成立していない

    current main は ee641da1a8ff3aa916cabc57e59dca0d0274bb85 です。PR #2068 もこの SHA を base にしていますが、現在 open / Draft / unmerged です。

    さらに #2068 自身の fresh review では、decide.run / authority_transport.produce / authority_transport.consume が registry/policy に登録されても、skill_runtime_exec.py の privileged dispatcher から実 subprocess 到達できない P0-B が未解消と明記されています。まさに #2086 AC10 が引き取ろうとしている欠陥です。

    問題は #2086 の Delivery Rule が「#2068 が未マージなら duplicate implementation を持ち込まず merge-order/rebase condition を明示」としか規定していないことです。これでは実装 worker にとって正本がありません。

    #2086 は #2068 merge 後にのみ実装可能とするか、明示的な stacked PR とする必要があります。「未マージでも実装開始可、ただし duplicate は不可」は矛盾しています。

    SHA 固定より capability precondition の方が適切です。たとえば実装開始条件を「SCOPE_DELTA_AUTHORITY_TRANSPORT_V1 / router receipt / consumption receipt と authority_transport.produce|consume command が current base に存在すること」と定義し、未充足なら dependency_not_materialized で停止させるべきです。

    P0 — operator_asserted_human_context を新しい route status にすると既存 consumer と互換性がない

    #2086 は operator_asserted_human_context という概念を導入していますが、これが provenance/origin のラベルなのか、scope decision status なのかが未定義です。

    既存 production consumer は approved scope reframe を status == "approved_by_trusted_anchor" で認識します。既存 full-rewrite routing もこの前提に乗っています。

    したがって実装者が素直に新 status operator_asserted_human_context を追加すると、freeform lane の authority を構築したのに既存 issue_editor_required 判定へ到達しない可能性があります。しかも decide_rewrite_route.py は #2086 の Allowed Paths にありません。

    ここは明示的に、

    operator_asserted_human_context は provenance/origin classification であり、routing status の新 enum ではない

    と固定するのが最小変更です。routing 上は既存 canonical status を維持し、「trusted」の意味が physical-human verification ではないことを docs で限定する方が #1860 の minimal harness 方針にも整合します。#1860 自身も agent-local instruction/profile を security boundary としない方針です。

    P1 — Trust Model は許容可能だが、「誰でも human lane を自己申告できる」ことまで明記すべき

    GitHub 公式仕様の CommentAuthorAssociation は、その author と repository の関係を表す値です。OWNER は repository owner、MEMBER は organization member、COLLABORATOR は collaborator という意味であって、「ブラウザから物理的な人間が入力した」という証明ではありません。#2086 のこの認識は正しいです。([GitHub Docs]1)

    現行コードでも origin は URL metadata から推測せず、control-plane から渡された human_context_comment_urls / agent_report_comment_urls で決まります。同じ URL が両 lane にある場合や unlabeled の場合は generated_by_agent に倒しています。

    ただし #2086 はもう一歩明記すべきです。runtime profile を選択できる caller 自体を認証していない限り、with_human_context は caller assertion にすぎません。 これは #2086 が受容している hobby-project trade-off なら問題ありませんが、「operator-selected lane が security boundary」とだけ表現すると強すぎます。

    「operational routing boundary であり authentication / non-repudiation boundary ではない」と固定すると誤読がなくなります。

    P1 — AC10 の「real subprocess」と network_required: false / live mutation prohibited を分離すべき

    PR #2068 は authority_transport.consume が最終的に real GitHub mutation lane に到達するため、network_effect を github_mutation に訂正しています。

    GitHub の Issue update 自体も write permission が必要な mutation endpoint です。([GitHub Docs]2)

    ところが #2086 の Runtime Verification は network_required: false、live_github_mutation: prohibited としながら、AC10 では privileged executor から production consumer への「実 subprocess dispatch」を要求し、mock-only では PASS にしないとしています。これは dispatch reachability の証明なら可能ですが、実 GitHub mutation/readback の証明ではありません。

    テストの claim を分離すべきです。offline test では skill_runtime_exec.py → exact classifier → registry argv → run_refinement_preflight.py → mutation adapter まで real subprocess で通し、PATH 上に deterministic な gh fixture executable を置いて実 argv を捕捉する。そのテストは「production mutation boundary へ到達した」ことだけを証明し、「GitHub への mutation が成功した」とは主張しない。この線引きなら network prohibited と矛盾しません。

    P1 — privileged executor の修正を generic registry passthrough にしてはいけない

    現行 runtime policy は exact argv grammar をかなり強く意識しており、human-context lane も caller-selected command-id を argv に残しています。

    AC10 を最短で直そうとして skill_runtime_exec.py に「registry にある任意 command_id を render して実行する」汎用分岐を追加すると、これまでの exact command boundary を大幅に弱めます。

    decide.run / authority_transport.produce / authority_transport.consume ごとに closed command shape を持たせ、required/optional flags、duplicate flag、--flag=value、path traversal、symlink、repo/issue/invocation/head binding を個別検証すべきです。Python の argparse はデフォルトでは long option abbreviation を許すため、境界用 CLI は allow_abbrev=False を明示するのが妥当です。subprocess(..., shell=False) も維持すべきですが、これは shell expansion を避ける性質であって authority validation の代替ではありません。([Python documentation]3)

    P1 — mutation 直前の anchor freshness が AC として弱い

    #2086 AC4/AC11 は rewrite 後の live readback と fresh preflight/review/readiness を強く要求しています。これは必要です。しかし scope mutation authority の source comment が inventory 調査後〜mutation 前に編集された場合の扱いが AC に固定されていません。

    既存 controlled transaction には anchor を再取得して source identity を比較する設計がすでにあります。また #2068 も stale structured anchor を fail-closed にする対応を追加しています。

    freeform operator lane でも mutation 直前に comment ID、canonical URL、body hash、association、lane binding、base Issue body SHA を再検証し、1つでも drift したら write 0 件で fresh preflight に戻す、と AC に昇格させるべきです。

    Issue #2086 に入れるべき修正

    1. AC3 を二段階化する。 「high-level semantic directive → inventory_candidate」までは 実装: fix(issue-refinement-loop): bind freeform OWNER scope authority end-to-end and expose routing telemetry #2053 を維持し、agent-derived exact paths は mutation authority を持たない transaction-local evidence とする。root が same-goal/bounded/safe を検証した後、provenance を偽らずに使える既存 consumer がなければ issue_editor_required へ送る。contract_update_required は exact path が human authority に直接束縛できるケースに限定する。

    2. Dependency Contract を追加する。 fix(issue-refinement-loop): bind freeform OWNER scope authority end-to-end and expose routing telemetry #2068 が merge 済み、または stacked base に transport/receipt command と schema が存在することを実装 precondition にする。current main に capability がなければ 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 側へ duplicate transport 実装をコピーせず停止する。

    3. operator_asserted_human_context の型を固定する。 provenance/origin telemetry の値であり、scope_delta_decision.status の新値ではない、と明文化する。status を変更したいなら decide_rewrite_route.py と全 consumer を Allowed Paths に加えた明示的 schema migration が必要。

    4. AC10 を「offline dispatch reachability」と「live GitHub effect」に分離する。 本 Issue で必須なのは前者のみ。real subprocess + fake gh executable で mutation adapter 到達を検証し、live mutation 成功を claim しない。

    5. pre-mutation freshness AC を追加する。 inventory 完了後に anchor が編集、削除、association 変更、wrong-target 化、human/agent dual-lane 化した場合は write 0 件で fail-closed。さらに decoy unrelated path、複数の同程度 candidate inventory、unsafe path/symlink、permission-boundary path、agent-report 同一 URL を negative regression に追加する。

    この修正後なら #2086 の主題はかなり明確になります。特に **「human semantic authority と agent-derived technical inventory は別物」**を不変条件に置くことが重要です。そこを固定せず scope-expansion stop だけ除去すると、停止過多を直す代わりに authority laundering を導入する形になります。

  3. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告(human_judgment_required)

    anchor: https://github.com/squne121/loop-protocol/issues/2086#issuecomment-5251322440(OWNER review, NEEDS_REFRAME 判定)

    Step 0f(preflight)

    初回 preflight は STATUS: blocked / BLOCKERS: missing_required_section(Parent Goal Ref / Current Validated Scope / Remaining Parent Gaps / Required Skills の4セクション欠落、.github/ISSUE_TEMPLATE/implementation.yml 準拠チェック)で停止した。override_policy.overridable_in_current_result に含まれる reason code のため、フォーマットのみの構造的修復(意味内容は変更しない4セクション追加+ Verification Commands の AC marker 記法修正+ Stop Conditions 標準6項目追加)を issue-editor 経由で適用し、STATUS: pass / NEXT_ACTION: proceed を確認した(body sha256: 2620025f... → 現在の live body)。

    Step 1(investigation)/ Step 1b(web research)

    判定

    termination_cause: human_judgment_required

    停止理由は二重である。

    1. web-researcher が capability_unavailable で fail closed し、critical claims を未検証のまま Step 2 review へ進めない(loop policy 上の hard stop)。
    2. OWNER レビューコメント(issuecomment-5251322440)が指摘する構造的 P0 3点(AC3 の authority-semantics 二段階化、PR fix(issue-refinement-loop): bind freeform OWNER scope authority end-to-end and expose routing telemetry #2068 unmerged に対する Dependency Contract、operator_asserted_human_context の型固定)は codebase-investigator の調査で現状も未解消であることが裏付けられた。これらは Issue 本文の Outcome / AC / Delivery Rule / Stop Conditions の実質的な書き換えを要する semantic 判断であり、freeform_rewrite_forbidden 制約下の機械的 rewrite では解消できない。

    推奨アクション(人間判断待ち)

    1. AGY quota リセット(約51時間後)後に本ループを再実行し、web research を完了させる。
    2. それとは独立に、OWNER レビューコメントの「Issue 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 に入れるべき修正」5点(AC3二段階化 / Dependency Contract 追加 / operator_asserted_human_context 型固定 / AC10 の offline dispatch reachability と live effect の分離 / pre-mutation freshness AC 追加)を Issue 本文へ反映する方針を人間が確定させたうえで、issue-editor による本文改訂を進めることを推奨する。

    (Step 0f のフォーマット修復のみ適用済み。上記の意味論的な指摘は未反映。実装着手は不可のまま。)

  4. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-08-11T10:01:41Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/2086
      body_sha256: "sha256:90df683ebc60bde1ccb8716fed6777a63b9f6a5b572dd07db884713de82675f7"
      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:90df683ebc60bde1ccb8716fed6777a63b9f6a5b572dd07db884713de82675f7","source_provenance":{"source_type":"body_file","body_file":"/tmp/contract_review_once_body_kt1i_vyb.md"}}
        vc_preflight:
          decision: pass
          classifications: '[{"ac":"AC11","line":7,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_operator_selected_scope_reframe.py .claude/skills/issue-refinement-loop/tests/test_scope_signal_guard_lane_split.py .claude/skills/issue-refinement-loop/tests/test_decide_next_loop_action_contract_update.py -q","command_hash":"sha256:7ef1f184a69a441cdd284ea4d61775120dfa03d4847d0ba9a9af8907fe09cba1","execution_key_hash":"sha256:ba5ab0d3b166ab87003c4fc7dd4ce40f6a0b0b0dd424f3884d15406c8f6081cf","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["no tests ran in 0.00s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: file or directory not found: .claude/skills/issue-refinement-loop/tests/test_operator_selected_scope_reframe.py"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":172,"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":"AC10","line":4,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py scripts/agent-guards/tests/test_skill_runtime_policy_anchor.py .claude/skills/issue-refinement-loop/tests/test_anchor_scope_reframe_preflight.py -q","command_hash":"sha256:04e9125318bc52ac4cbcfa7e588b9ea65ee69832849ed06fc2d3081ba9cfe822","execution_key_hash":"sha256:1f6ef1b5efc91a0d514e109538debd388ba81895f19a082f1ba5b8009b2ed946","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["no tests ran in 0.00s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: file or directory not found: scripts/agent-guards/tests/test_skill_runtime_policy_anchor.py"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":160,"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":"AC12","line":4,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_scope_delta_authority.py .claude/skills/issue-refinement-loop/tests/test_issue_1952_trusted_directive_regression.py -q","command_hash":"sha256:0a28c9f339d7e0ce869cef57776a89d248bfcbb5037e841123bba4f5f5a67126","execution_key_hash":"sha256:a3acc50a54b5c39a1c1a9b7862cf42faf924306b98d04bed9bfcc5aa77a3c3ff","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["...........................................................              [100%]","59 passed in 0.38s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":548,"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}]'
        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":"efd9f807e0695f7f40d1bc353b34f0cf39c5d5d0","is_draft":false,"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":"f8d0be45da464d0d43edc1d44f45b1faf41295c1","is_draft":false,"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":"23ca87f3b909e56c01051fd7be09a50f899bca42","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},{"number":2092,"title":"実装: GitHub Issue labels を presentation-only metadata として SSOT 化する","base_ref_name":"main","head_ref_name":"worktree-issue-2084-label-authority","head_ref_oid":"e2c7d3f3792992917600340bcf1be1d16a99a1e8","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2092","changed_files_count_graphql":12}],"fetched_count":9,"totalCount":9,"has_next_page":false,"complete":true,"saturated":false,"limit":200,"page_count":1,"inventory_digest":"sha256:0952e1846be9f13a701a192e6287cd0da0e3885f017d85cd8024f596c1b98cb6","errors":[]},"inventory_digest_extended":"sha256:5524a1756a4419cf9d5039b66ed8fa2d2f0dd5a3876c2b2fb5b2feb92f8f5c26","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":2086,"contract_source_kind":"issue_comment","contract_source_id":"5251692632","contract_body_sha256":"sha256:90df683ebc60bde1ccb8716fed6777a63b9f6a5b572dd07db884713de82675f7","allowed_paths_normalized_sha256":"011d1b302ad4a7545f04956cc380e99982aba5e2196466dac07b2960877784b0","base_ref":"main","base_sha_at_snapshot":"ee641da1a8ff3aa916cabc57e59dca0d0274bb85"}
  5. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告(approved)

    Issue #2086 は issue-refinement-loop の全ステップを完了した。Step 0f でフォーマットを修復し、Step1/1b で investigation と web research を実施、Step2 の初回 review は C11 blocker(runtime-verification tag 欠落)により needs-fix、Step4 の rewrite で runtime-verification tag を追加し、Step2 の再 review で approve に到達した。続けて issue-contract-review skill の正規手順(run_contract_review_once.py --mode execute → scripts/agent-guards/controlled_skill_mutation_exec.py --command-id contract_snapshot.publish)で Final Gate を実行し、Contract Snapshot コメント(status: go)を controlled metadata executor 経由で投稿した。

    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/2086#issuecomment-5251692632
        generated_at: "2026-08-11T10:02:04Z"
        body_sha256: "sha256:90df683ebc60bde1ccb8716fed6777a63b9f6a5b572dd07db884713de82675f7"
      metadata:
        title_prefix_ready: true
        phase_label_ready: true
      auto_fixes:
        result: auto_fixed
        required: []
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: "2026-08-11T10:02:04Z"
      checked_body_sha256: "sha256:90df683ebc60bde1ccb8716fed6777a63b9f6a5b572dd07db884713de82675f7"
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []
  6. self-assigned this
    on Aug 11, 2026
  7. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-08-11T10:45:14Z)

  8. added 5 commits that reference this issue on Aug 11, 2026
    c969e43
    50b791d
    14eca37
    cfdb64e
    fe4f242
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent/implementerenhancementphase/implementation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions