Skip to content

実装: orchestrate_runtime_smoke() の aggregate status=pass が、必須 scenario が skipped でも AC の PASS 証跡として使える欠陥を防ぐ #2841

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "orchestrate_runtime_smoke() の aggregate status=pass が、必須 scenario の未実行(skipped)を隠して AC の PASS 証跡になることを防ぐ"
change_kind: code

Parent Issue

none

Parent Goal Ref

  • Goal: Task Context runtime smoke の aggregate 判定が「必須 scenario が全て実行され pass した」ことを、呼び出し側が opt-in で機械的に確認できる状態にする
  • Desired Destination: 単独改善(親 Issue なし)

Current Validated Scope

  • scripts/task-context/task_context_runtime_smoke_verifier.py の orchestrate_runtime_smoke() と RuntimeSmokeOrchestrationResult に、必須 scenario 集合を宣言する opt-in 引数と出力フィールドを追加する
  • tests/task-context/test_runtime_smoke_required_scenarios.py(新規)に focused test を追加する
  • docs/dev/runtime-verification-policy.md に「aggregate pass は必須 leaf の代替にならない」節を 1 つ追加する

Remaining Parent Gaps

なし

Outcome

orchestrate_runtime_smoke() が opt-in の required_scenarios 宣言を受け取り、宣言された scenario が skipped/未供給なら aggregate status を fail にして required_scenarios_satisfied=false と未実行 scenario 名を出力し、宣言なしの既定出力は従来と byte-identical のまま、focused test が PASS し、docs/dev/runtime-verification-policy.md に当該原則が明記された状態。

Runtime Verification Applicability

  • decision: not_applicable
  • reason: 判定は pure な集約ロジックであり、既存 Evidence dataclass を渡す hermetic な unit test で完結し、実 runtime の起動・通信を要しないため

Background

In Scope

  • orchestrate_runtime_smoke() に keyword 引数 required_scenarios(既定 None。値は wrong_primary_target / clear_scenario / clear_causal の部分集合)を追加する
    • 未知の scenario 名は、seed / subprocess の副作用より前に ValueError で拒否する
    • 宣言された scenario が skipped(evidence が None)の場合、violations に理由を追加して aggregate status を fail にする
  • RuntimeSmokeOrchestrationResult に required_scenarios_satisfied(bool)と missing_required_scenarios(scenario 名の list)を追加し、required_scenarios 宣言時のみ to_dict() に出力する
  • required_scenarios 未指定時の to_dict() と status は現行と byte-identical に保つ
  • focused test を新規 file tests/task-context/test_runtime_smoke_required_scenarios.py に追加する(宣言あり+skipped は pass にならない / 宣言なし+skipped は従来どおり pass / 宣言あり+全 pass は pass / 未知名は拒否)
  • docs/dev/runtime-verification-policy.md に、aggregate pass は必須 leaf の代替にならず、必須 scenario の skipped は SKIP 規約(SKIP は PASS を意味しない)と整合して PASS 証跡として扱わない旨の節を 1 つ追加する

Out of Scope

Acceptance Criteria

  • AC1: required_scenarios 宣言あり かつ宣言 scenario が skipped の場合、aggregate status が pass にならず(fail)、violations に未実行理由が含まれる
  • AC2: required_scenarios 宣言なし かつ scenario が skipped の場合、従来どおり status="pass" で to_dict() に新フィールドが含まれない
  • AC3: required_scenarios 宣言あり かつ宣言 scenario が全て pass の場合、status="pass" かつ required_scenarios_satisfied=true かつ missing_required_scenarios=[] になる
  • AC4: 宣言時の出力に required_scenarios_satisfied(bool)と未実行 scenario 名の一覧 missing_required_scenarios が含まれる。未知の scenario 名は ValueError で拒否される
  • AC5: docs/dev/runtime-verification-policy.md に「aggregate pass は必須 leaf の代替にならない」節が追加されている
  • AC6: 既存の runtime smoke verifier 関連 test が変更なしで PASS する

Verification Commands

# AC1
$ uv run --locked pytest tests/task-context/test_runtime_smoke_required_scenarios.py::test_required_declared_and_skipped_is_not_pass
# AC2
$ uv run --locked pytest tests/task-context/test_runtime_smoke_required_scenarios.py::test_no_declaration_and_skipped_keeps_legacy_pass_and_output
# AC3
$ uv run --locked pytest tests/task-context/test_runtime_smoke_required_scenarios.py::test_required_declared_and_all_pass_is_pass
# AC4
$ uv run --locked pytest tests/task-context/test_runtime_smoke_required_scenarios.py::test_declared_output_fields_and_unknown_name_rejected
# AC5
$ rg -c "aggregate pass は必須 leaf の代替にならない" docs/dev/runtime-verification-policy.md
# AC6
$ uv run --locked pytest tests/task-context/test_runtime_smoke_verifier.py tests/task-context/test_runtime_smoke_verifier_canonical_carrier_regression.py tests/task-context/test_runtime_smoke_verifier_live_shadow_isolation.py -q
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm build

Allowed Paths

  • scripts/task-context/task_context_runtime_smoke_verifier.py
  • tests/task-context/test_runtime_smoke_required_scenarios.py
  • docs/dev/runtime-verification-policy.md

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • 既定(宣言なし)の to_dict() 出力を変えずに実装できないと判明した場合

Required Skills

なし

Required Design References

  • docs/dev/runtime-verification-policy.md
  • docs/dev/agent-skill-boundaries.md

Scope Delta(任意)

N/A

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    on Sep 29, 2026
  2. squne121 commented on Sep 30, 2026

    @squne121
    OwnerAuthor

    判定:REQUEST_CHANGES。ただし、opt-in で小さく直す方針は支持します

    問題は「もっと厳しいハーネスが必要」なことではなく、追加する判定の意味と、その判定を検証する条件がまだ揃っていないことです。 現状のまま実装すると、「必須 scenario の欠落」は検出できても、別の失敗を成功で上書きしたり、実行していないテストを検証済みと報告したりする余地が残ります。

    コードは取得時点の main 4d7646f753d8dfd99727989c68eb0d3f7d0cf4d5 に固定し、Issue 本文、関連する #2827・#2771、PR #2749 の差分とレビューコメント、verifier・既存テスト・運用ポリシー、Python/pytest の公式資料・実装を照合しました。#2841 自体には取得時点でコメントはありません。以下は契約・コードのレビューであり、pytest や Claude/Herdr 実機を再実行した結果ではありません。


    1. P1:AC3 が、既存の失敗を成功へ上書きできる契約になっています

    対象:Outcome、AC2・AC3、新規テストの条件

    AC3 は「宣言 scenario が全て pass なら status="pass"」としています。しかし、必須 scenario が成功していても、runner、canonical DB の差分検査、statusLine、その他の供給済み scenario が失敗する場合があります。現行実装はそれぞれの失敗を violations に追加し、最後に全体の成否を決めています。AC3 には、この既存条件を維持するという限定が必要です。

    例えば、次は契約上の反例です。

    required_scenarios = {"clear_scenario"}
    clear_scenario_evidence.status = "pass"
    runner_returncode = 1

    この場合の正しい結果は、次の組み合わせです。

    required_scenarios_satisfied = true
    missing_required_scenarios = []
    status = "fail"

    「選択した必須集合が充足した」と「検証全体が成功した」は別の判定です。

    これは抽象的な懸念ではありません。関連する PR #2749 では、statusLine の executed_degenerate を広く not_applicable にすると本物の障害まで隠れる、という OWNER 指摘を受けています。最終差分では Unbound だけを限定的に扱い、Degraded・空文字や runner failure が aggregate failure に残るようにしています。#2841 の新しい分岐で、この性質を巻き戻してはいけません。

    もう一つ、必須 scenario 自体が fail の場合が未定義です

    現在の仕様・focused test は、主に「未供給」と「全て pass」を扱い、供給済みの必須 evidence が fail の場合に、新しい bool がどうなるかを固定していません。

    ここを単純に、

    required_scenarios_satisfied = not missing_required_scenarios

    と実装すると、「欠落はないが必須検査は失敗した」場合にも true になります。

    最小修正

    契約を次のように定義してください。

    required_scenarios_satisfied は、宣言された全 scenario の evidence が供給され、全ての status が pass の場合に限り true とする。aggregate status は、既存の失敗条件と追加の必須 scenario 条件を合わせて判定し、既存の fail を pass に昇格させない。

    提案する判定表は次のとおりです。

    宣言 | 必須 evidence | その他の既存検査 | aggregate | satisfied | missing -- | -- | -- | -- | -- | -- 未指定 | 未供給 | 成功 | 従来どおり pass | 出力しない | 出力しない 未指定 | 未供給 | 失敗 | 従来どおり fail | 出力しない | 出力しない あり | 未供給/skipped | 成功 | fail | false | 該当名 あり | 供給済みだが fail | 成功 | fail | false | [] あり | 全て pass | 成功 | pass | true | [] あり | 全て pass | 失敗 | fail | true | []

    これは決定論的なテストで扱える範囲です。新しい実機マトリクスや、毎回の人間確認を追加する理由にはなりません。


    推奨する着地点

    #2841 は撤回せず、既存の三ファイルを中心とする小さな変更として進めるのが適切です。 ただし、実装前に Outcome と AC を次の意味へ揃えてください。

    required_scenarios は追加の必須 evidence 条件を宣言する opt-in API とする。宣言された evidence の欠落または非 pass は aggregate failure とし、既存の failure は一切 pass に昇格させない。充足結果は評価した集合とともに出力し、未宣言時の既存出力・挙動は維持する。

    本機能は供給 evidence の充足を判定するものであり、実 runtime の実行由来や AC との意味的対応を単独で証明しない。既存 caller の移行は今回の完了条件に含めず、未移行経路の誤用防止まで達成したとは報告しない。

    検証は focused test と既存の非 live 回帰テストで行い、既定で除外される live test を PASS 根拠に数えない。

    優先順位は、失敗判定の維持と satisfied の定義 → AC6 の未実行問題 → 宣言集合の可視化 → 境界テストです。

    目指すべきなのは、**「全ての作業で全 scenario を実行させる仕組み」ではなく、「必要と宣言した検証だけは、未実行や失敗を成功と取り違えない仕組み」**です。これなら、品質を上げながら通常の開発フローを重くせずに済みます。

    ## 判定:REQUEST_CHANGES。ただし、opt-in で小さく直す方針は支持します

    問題は「もっと厳しいハーネスが必要」なことではなく、追加する判定の意味と、その判定を検証する条件がまだ揃っていないことです。 現状のまま実装すると、「必須 scenario の欠落」は検出できても、別の失敗を成功で上書きしたり、実行していないテストを検証済みと報告したりする余地が残ります。

    コードは取得時点の main 4d7646f753d8dfd99727989c68eb0d3f7d0cf4d5 に固定し、Issue 本文、関連する #2827・#2771、PR #2749 の差分とレビューコメント、verifier・既存テスト・運用ポリシー、Python/pytest の公式資料・実装を照合しました。#2841 自体には取得時点でコメントはありません。以下は契約・コードのレビューであり、pytest や Claude/Herdr 実機を再実行した結果ではありません。


    1. P1:AC3 が、既存の失敗を成功へ上書きできる契約になっています

    対象:Outcome、AC2・AC3、新規テストの条件

    AC3 は「宣言 scenario が全て pass なら status="pass"」としています。しかし、必須 scenario が成功していても、runner、canonical DB の差分検査、statusLine、その他の供給済み scenario が失敗する場合があります。現行実装はそれぞれの失敗を violations に追加し、最後に全体の成否を決めています。AC3 には、この既存条件を維持するという限定が必要です。

    例えば、次は契約上の反例です。

    required_scenarios = {"clear_scenario"}
    clear_scenario_evidence.status = "pass"
    runner_returncode = 1
    

    この場合の正しい結果は、次の組み合わせです。

    required_scenarios_satisfied = true
    missing_required_scenarios = []
    status = "fail"
    

    「選択した必須集合が充足した」と「検証全体が成功した」は別の判定です。

    これは抽象的な懸念ではありません。関連する PR #2749 では、statusLine の executed_degenerate を広く not_applicable にすると本物の障害まで隠れる、という OWNER 指摘を受けています。最終差分では Unbound だけを限定的に扱い、Degraded・空文字や runner failure が aggregate failure に残るようにしています。#2841 の新しい分岐で、この性質を巻き戻してはいけません。

    もう一つ、必須 scenario 自体が fail の場合が未定義です

    現在の仕様・focused test は、主に「未供給」と「全て pass」を扱い、供給済みの必須 evidence が fail の場合に、新しい bool がどうなるかを固定していません。

    ここを単純に、

    required_scenarios_satisfied = not missing_required_scenarios

    と実装すると、「欠落はないが必須検査は失敗した」場合にも true になります。

    最小修正

    契約を次のように定義してください。

    required_scenarios_satisfied は、宣言された全 scenario の evidence が供給され、全ての status が pass の場合に限り true とする。aggregate status は、既存の失敗条件と追加の必須 scenario 条件を合わせて判定し、既存の fail を pass に昇格させない。

    提案する判定表は次のとおりです。

    宣言 必須 evidence その他の既存検査 aggregate satisfied missing
    未指定 未供給 成功 従来どおり pass 出力しない 出力しない
    未指定 未供給 失敗 従来どおり fail 出力しない 出力しない
    あり 未供給/skipped 成功 fail false 該当名
    あり 供給済みだが fail 成功 fail false []
    あり 全て pass 成功 pass true []
    あり 全て pass 失敗 fail true []

    missing_required_scenarios は「未実行・未供給」の一覧に限定し、実行済みの失敗理由は既存の scenario_evidence に残せば十分です。新しい失敗分類フレームワークは不要です。

    また、required に含めなかった scenario でも、供給済み evidence が fail なら既存どおり aggregate fail を維持してください。「必須集合を選ぶこと」と「それ以外の失敗を無視すること」は同義ではありません。


    2. P1:AC6 のコマンドは、列挙している live test を実行しません

    対象:AC6、Verification Commands、Runtime Verification Applicability

    AC6 のコマンドには、次のファイルが含まれています。

    tests/task-context/test_runtime_smoke_verifier_live_shadow_isolation.py
    

    しかし、このファイルにはモジュール全体の [pytest](https://docs.pytest.org/en/stable/example/markers.html).mark.claude_live が付いており、pyproject.toml の既定値は次のとおりです。

    addopts = "--import-mode=importlib -m 'not github_live and not claude_live'"

    したがって、ファイル名を明示しても、現在の AC6 コマンドでは live test が除外されます。 他のテストが成功すれば、live test を実行しないままコマンド全体が成功し得ます。pytest の公式資料でも、ファイル/node の選択と marker による選別は別に扱われています。:chatgpt-content-reference{index="9"}

    さらに、pytest 本体の標準終了判定は、テスト失敗や収集件数ゼロなどを見ており、正常終了だけから「必要なテストが全て実行された」とは判断できません。これは #2841 が防ぎたい誤認と同型です。:chatgpt-content-reference{index="10"}

    最小修正:実機テストを必須化するのではなく、AC6 の主張を正す

    ここで -m claude_live を一律追加し、Claude のインストール・認証・モデル呼び出しを新しい必須条件にするのは勧めません。

    本変更で確認したいのは集約ロジックです。既存テストにも、runner と statusLine の観測部分を差し替え、実 Claude を使わずに集約結果を検証する先例があります。

    AC6 は次の意味に直すのが適切です。

    既存の非 live な verifier/canonical-carrier 回帰テストが変更なしで PASS する。live-shadow-isolation は既定では未実行であり、本 Issue の PASS 根拠に含めない。

    実装後の主要な検証コマンドは、例えば次で足ります。

    uv run --locked pytest \
      tests/task-context/test_runtime_smoke_required_scenarios.py \
      tests/task-context/test_runtime_smoke_verifier.py \
      tests/task-context/test_runtime_smoke_verifier_canonical_carrier_regression.py \
      -q -ra

    既存 CI のチェックはそのまま維持し、この変更のためだけに新しい実機必須ゲートを増やさない方針を推奨します。任意で live test を実施した場合も、未実行・SKIP・PASS を区別して報告すべきです。リポジトリのポリシーも、SKIP は PASS ではないと明記しています。


    3. P2:新しい出力だけでは「何を必須として評価したか」が分かりません

    対象:RuntimeSmokeOrchestrationResult、AC4、宣言の入力契約

    追加予定の出力は、次の二つだけです。

    required_scenarios_satisfied
    missing_required_scenarios
    

    これでは、同じ evidence 群に対して、

    呼び出し A:wrong_primary_target だけを必須化
    呼び出し B:clear_scenario と clear_causal を必須化
    

    した場合、両者が成功すると追加出力は同じになります。結果を後から確認する側は、どの必須集合についての true なのかを、その出力だけでは区別できません。

    呼び出し側が入力宣言も確実に保存していれば補えますが、Issue はその保存契約も定めていません。ここは大きな証跡基盤ではなく、宣言した集合を出力にそのまま残すだけで改善できます。

    最小修正

    宣言時だけ、正規化した required_scenarios も出力する案を推奨します。

    {
      "required_scenarios": ["clear_scenario", "clear_causal"],
      "required_scenarios_satisfied": true,
      "missing_required_scenarios": []
    }

    順序は既知の三つの scenario の固定順などに統一すれば十分です。schema registry、署名、ledger は要りません。

    None と空集合も区別してください

    「部分集合」には空集合も含まれますが、現契約では空の宣言の扱いが明記されていません。また Python の all([]) は True です。if required_scenarios: で分岐すると、未指定と空集合も区別できなくなります。:chatgpt-content-reference{index="15"}

    私の推奨は次です。

    None は未宣言として既存出力を完全維持する。空集合は「追加の必須 scenario はゼロ」という明示宣言として扱い、その空集合も出力する。ただし、何らかの runtime AC を実証したことは意味しない。

    これなら、動的に集合を組み立てる呼び出し側を不必要に止めず、空の宣言を実証済みと誤認することも避けられます。AC の証跡として使う側は、その AC が要求する集合と実際の宣言を対応付ける必要があります。


    4. P2:「恒久対策として何を保証するか」が、現在のスコープより広く読めます

    対象:Goal、Outcome、Background、Out of Scope

    #2841 は既存 caller への適用を対象外とし、未宣言の挙動を維持します。したがって、変更後も 未宣言の caller が aggregate だけを見て判断する経路は、そのまま残ります。これは後方互換のために合理的ですが、「既存の誤判定経路まで解消した」とは報告できません。

    また、現行の WrongPrimaryTargetEvidence と ClearScenarioEvidence が保持するのは基本的に status と violations です。この集約器だけで、evidence が実 runtime のどの session/run から得られたかまで検証する構造ではありません。

    従って、今回保証できる内容は、正確には次です。

    呼び出し側が宣言した必須集合について、供給された evidence の欠落と非 pass を検出し、aggregate pass にさせない。

    「実 runtime で必須シナリオが実行されたこと自体を証明する」まで広げるべきではありません。

    関連する #2771 も、宣言の構造的な完全性と、検証内容が本当に目的を証明するかという意味的な十分性を分離しています。同じ責務分離を #2841 にも適用するのが適切です。

    caller 全移行を、この Issue の追加ゲートにする必要はありません

    実用性を上げる最小策は、追加予定の policy 節に、正しい利用例と今回保証しない範囲を記載することです。

    例えば /clear の検証では、現行コードは identity の維持を確認する assert_clear_scenario_evidence() と、clear event の因果関係を確認する assert_clear_causal_evidence() を組み合わせる前提です。clear_causal 一つだけを必須化しても、/clear の全条件を検証したことにはなりません。利用例では両方を宣言してください。

    一方、#2827 の narrow adapter は「通常 prompt の rebind」「内部完了の negative control」「workflow signal applied」「user-typed /task」という別の四種類を扱っています。#2841 の既存三種類の名前とは、そのまま対応しません。#2827 にこの API の利用を強制したり、#2841 の完了待ちを追加したりする必要はありません。


    5. P2:未知名の拒否と互換性について、現在のテスト要件では肝心な境界を確認できません

    対象:AC4、focused test、byte-identical の確認方法

    ValueError が出るだけでは、「副作用より前に拒否」を証明できません

    Issue は未知名を seed/subprocess の副作用より前に拒否するとしています。しかし、提案されているテスト名・AC は、単に未知名が拒否されることまでしか固定していません。

    現行 orchestrator は、集約までに seed、runner 起動、canonical roll-up、statusLine の収集を行います。Evidence dataclass を渡すだけで、関数全体が副作用のない unit test になるわけではありません。

    未知名のテストでは、有効な canonical parent を用意したうえで、少なくとも seed/runner などが呼ばれていないことも検証してください。そうしないと、未知名とは無関係な引数エラーで ValueError が出ても合格するテストになり得ます。

    実装は、既知名の正規化・検証を入口で行う小さな処理と、集約処理への接続で十分です。汎用バリデータを新設する必要はありません。

    「新フィールドがない」だけでは byte-identical の検証になりません

    AC2 のテストは、新フィールドがないことだけでなく、固定した evidence に対する既存キー・値・配列順なども確認すべきです。特に、今回の変更を契機に serializer を作り直す必要はありません。

    現行 to_dict() は出力対象を明示しています。Python の dataclasses.asdict() は dataclass のフィールドを辞書へ変換するため、単純な置換では既定出力の互換性を維持できません。現在の明示的な serializer を残し、宣言時だけフィールドを追加するのが小さい修正です。:chatgpt-content-reference{index="24"}

    追加テストは、次の境界に集中させれば十分です。

    境界 固定したい結果
    三種類それぞれの必須 evidence 欠落 当該名が missing に入り、aggregate fail
    必須 evidence が供給済みだが fail satisfied は false、missing は空
    必須集合は成功、既存の別検査が失敗 aggregate fail を維持
    必須ではない scenario が未供給 それだけでは新たに fail にしない
    必須ではないが供給済み scenario が失敗 既存どおり fail
    未指定/明示的 None/空集合 決めた宣言・出力契約どおり
    未知名 副作用の前に拒否
    未宣言の旧出力 代表的な pass/fail ケースで互換性維持

    これは決定論的なテストで扱える範囲です。新しい実機マトリクスや、毎回の人間確認を追加する理由にはなりません。


    推奨する着地点

    #2841 は撤回せず、既存の三ファイルを中心とする小さな変更として進めるのが適切です。 ただし、実装前に Outcome と AC を次の意味へ揃えてください。

    required_scenarios は追加の必須 evidence 条件を宣言する opt-in API とする。宣言された evidence の欠落または非 pass は aggregate failure とし、既存の failure は一切 pass に昇格させない。充足結果は評価した集合とともに出力し、未宣言時の既存出力・挙動は維持する。

    本機能は供給 evidence の充足を判定するものであり、実 runtime の実行由来や AC との意味的対応を単独で証明しない。既存 caller の移行は今回の完了条件に含めず、未移行経路の誤用防止まで達成したとは報告しない。

    検証は focused test と既存の非 live 回帰テストで行い、既定で除外される live test を PASS 根拠に数えない。

    優先順位は、失敗判定の維持と satisfied の定義 → AC6 の未実行問題 → 宣言集合の可視化 → 境界テストです。

    目指すべきなのは、**「全ての作業で全 scenario を実行させる仕組み」ではなく、「必要と宣言した検証だけは、未実行や失敗を成功と取り違えない仕組み」**です。これなら、品質を上げながら通常の開発フローを重くせずに済みます。

  3. squne121 commented on Sep 30, 2026

    @squne121
    OwnerAuthor

    確認時点で main は 4d7646f753d8dfd99727989c68eb0d3f7d0cf4d5、指定コメントは repository OWNER による明示的な REQUEST_CHANGES です。current issue-refinement-loop には、operator-selected trusted comment を with_human_context lane で扱う経路と、Step 2 の background launch → mandatory completion join 契約があります。

    推奨アクションは、#2841 を撤回・分割せず、指定コメントを trusted human-context として refinement を継続することです。主な contract 修正点は、required_scenarios_satisfied と aggregate success の分離、既存 failure の非昇格、live test を AC6 の PASS 根拠から除外、宣言した required_scenarios 自体の出力、None と空集合の区別、副作用前の unknown-name rejection、legacy output の実質的な互換性テストです。Allowed Paths は原則現在の3ファイルを維持できます。実装開始はこの invocation の対象外です。

    そのまま既存の対話的 Claude-GPT に貼れます。

    repo = squne121/loop-protocol

    対象:

    あなたは既に repository-owned Claude-GPT profile の対話的 Claude Code session で auto mode 起動済みです。この既存 session を継続してください。新しい Claude Code / Claude-GPT session を起動し直さないでください。

    Goal

    上記 OWNER REQUEST_CHANGES コメントを trusted human-context として current issue-refinement-loop を実行し、#2841 の Issue contract を canonical workflow に従って refinement してください。

    routine な investigation / review / Issue rewrite / deterministic repair / bounded retry / GitHub mutation について、人間の逐次承認を求めず自律的に進めてください。

    ただし repository が canonical に human_judgment_required / human_escalation を要求する条件を迂回してはいけません。

    この invocation は Issue refinement のみです。refinement が approved になっても impl-review-loop、implementation worker、production code 実装、commit、push、PR 作成へ進んではいけません。

    0. Fresh state を最初に取得する

    最初に以下を fresh に確認してください。

    1. current main HEAD
    2. 実装: orchestrate_runtime_smoke() の aggregate status=pass が、必須 scenario が skipped でも AC の PASS 証跡として使える欠陥を防ぐ #2841 の現在の body、labels、comments
    3. 指定 OWNER comment の本文、author association、comment ID/URL
    4. .claude/skills/issue-refinement-loop/SKILL.md
    5. 当該 Skill が今回必要と指定する references / scripts / schemas
    6. CLAUDE.md
    7. 必要に応じて:

    この prompt に書かれた手順と current repository contract が食い違う場合、current repository canonical SSOT を優先してください。

    確認時点の参考値として main は
    4d7646f753d8dfd99727989c68eb0d3f7d0cf4d5
    でしたが、これを stale な固定値として使用せず、必ず fresh read してください。

    1. 指定 comment の扱い

    指定 comment はユーザーが明示的に選択した trusted human-context です。

    current Skill が定める operator-selected human-context / trusted OWNER directive の canonical lane を使用してください。現在の contract が preflight.run.with_human_context / contract_update.run.with_human_context 等を要求するなら、その controlled lane を使用してください。

    GitHub comment の raw snapshot を downstream editor 等へ無制限に転送したり、独自の authority 判定を prose で再実装したりしないでください。

    comment の意図を単なる参考情報として無視せず、canonical authority / binding / freshness validation を通した上で contract refinement に反映してください。

    2. OWNER REQUEST_CHANGES の主要要求

    少なくとも以下を Issue contract 上で解消してください。ただし最終的な wording / AC 構成は current issue-refinement-loop の reviewer/editor に従って決定してください。

    A. required 集合の充足と aggregate success を分離する

    required_scenarios_satisfied は:

    • 宣言された全 required scenario の evidence が供給されている
    • その全 evidence の status が pass

    の場合にのみ true とする contract にしてください。

    missing_required_scenarios は未供給 / skipped の required scenario に限定してください。供給済みだが fail の scenario は missing には入れず、既存 evidence / violation semantics で failure を保持してください。

    required 集合が全て pass でも、runner failure、canonical DB failure、statusLine failure、required 外だが供給済み scenario の failure 等、既存の failure が存在するなら aggregate status は fail のままにしてください。

    新しい required 判定が既存 fail を pass に昇格させる contract にしてはいけません。

    B. AC6 の false-green を除去する

    現在列挙されている
    test_runtime_smoke_verifier_live_shadow_isolation.py
    は claude_live marker と repository の pytest addopts により通常 invocation では除外される点を contract に正しく反映してください。

    本 Issue の PASS 根拠は focused deterministic tests と既存 non-live regression tests にしてください。

    この Issue のためだけに Claude 実機を必須 gate 化しないでください。

    任意で live test を実行した場合も PASS / SKIP / NOT RUN を混同して報告しないでください。

    C. 評価対象集合を出力で識別可能にする

    宣言時には、正規化済みの required_scenarios 自体も result / to_dict() に出力する方向を contract に反映してください。

    例:

    • required_scenarios
    • required_scenarios_satisfied
    • missing_required_scenarios

    宣言なしの場合は legacy output を維持してください。

    D. None と空集合を明示的に区別する

    推奨 semantics:

    • None: required declaration なし。既存 behavior/output を維持。
    • empty collection: 「追加 required scenario はゼロ」という明示宣言。宣言フィールドを出力するが、それ自体を runtime AC の実証とは扱わない。

    if required_scenarios: のような実装前提で両者を潰さない contract にしてください。

    E. guarantee を現在の scope に限定する

    この変更が保証するのは概ね:

    「caller が宣言した required scenario 集合について、供給 evidence の欠落または non-pass を検出し、aggregate pass にさせない」

    までです。

    以下を保証したと表現しないでください。

    既存 caller migration は現 Issue の完了条件へ無理に追加しないでください。

    F. 境界テストを contract に固定する

    current reviewer/editor の判断を尊重しつつ、少なくとも次の failure classes が検証可能になるよう AC / VC を整合させてください。

    • 各 known scenario が required かつ missing → aggregate fail
    • required evidence が供給済みだが fail → satisfied=false / missing=[]
    • required 集合は全 pass、他の既存検査が fail → aggregate fail
    • non-required scenario が未供給 → それだけでは新規 fail にしない
    • non-required だが供給済み scenario が fail → 既存どおり aggregate fail
    • declaration なし / explicit None / empty declaration の区別
    • unknown scenario → seed / subprocess 等の副作用より前に reject
    • undeclared legacy output →代表的 pass/fail で互換性保持
    • declaration 時 → required set 自体を deterministic order で出力

    未知名テストは単に ValueError が出るだけでなく、要求されるなら seed / runner 等が呼ばれていないことまで固定してください。

    legacy compatibility は「新フィールドが無い」だけの弱い assertion にしないでください。現在の explicit serializer semantics を不用意に dataclasses.asdict() 等へ置換することを contract が誘発しないようにしてください。

    3. Scope 方針

    OWNER comment の推奨どおり、可能なら既存の小さい scope を維持してください。

    現状の中心:

    • scripts/task-context/task_context_runtime_smoke_verifier.py
    • tests/task-context/test_runtime_smoke_required_scenarios.py
    • docs/dev/runtime-verification-policy.md

    不要なもの:

    OWNER directive を満たすために Allowed Paths / scope の変更が必要に見える場合は、独自判断で即停止せず、current issue-refinement-loop の trusted human-context / scope-delta canonical routing をまず実行してください。

    canonical route が最終的に human judgment を要求する場合のみ、その結果に従って停止してください。

    4. SubAgent 利用契約

    必要な SubAgent を積極的に使用してください。ただし current Skill の routing を優先します。

    特に REFINEMENT_LOOP_PLAN_V1.decisions.investigation_policy.required == true なら、current contract に従い codebase-investigator を使用してください。

    各 SubAgent dispatch では親 thread の暗黙 context に依存させず、少なくとも以下を明示してください。

    • task
    • target Issue/comment
    • authority / SSOT
    • constraints
    • required evidence
    • expected structured output
    • mutation allowed / forbidden

    最重要: completion を必ず待つ

    SubAgent / background task を起動しただけで、その phase を完了扱いしてはいけません。

    全ての必要な SubAgent / background work について terminal completion を待ち、実際の final result / artifact / structured output を取得してから downstream phase に進んでください。

    特に current issue-refinement-loop Step 2 が要求する
    root_review_pipeline.produce
    の explicit background launch + mandatory completion join 契約を厳守してください。

    • run_in_background: true で起動
    • completion notification を待つ
    • 完了 JSON/result を取得する
    • それから canonical Step 2 routing を読む

    background launch 成功だけを Step 2 success として扱ってはいけません。

    SubAgent が別 SubAgent を必要と主張した場合は、current repository contract が nested delegation を許すか確認してください。禁止されている lane で勝手に nested delegation しないでください。

    5. Refinement loop を terminal state まで進める

    current Skill の canonical bounded loop を実行してください。

    基本形:

    fresh preflight
    → investigation(必要時)
    → semantic/contract review
    → REQUEST_CHANGES / deterministic repair / rewrite routing
    → Issue contract 更新
    → fresh readback
    → fresh preflight
    → fresh review
    → canonical next-action decision

    通常の needs_fix、deterministic repair、review REQUEST_CHANGES、freshness drift は、人間承認を要求する理由にせず、current Skill の bounded recovery route が存在する限り自動的に処理してください。

    max iterations、no-progress、irreconcilable scope conflict、evidence integrity failure 等で canonical decision が human_escalation になった場合は、それを迂回しないでください。

    planner / router / deterministic checker の判断を prose で独自再実装しないでください。

    6. GitHub mutation

    Issue body/comment 等の mutation は repository-owned controlled workflow を使ってください。

    raw gh issue edit / gh issue comment 等を canonical controlled lane の代替として直接使用しないでください。

    rewrite 後は必ず fresh Issue body を読み戻し、actual GitHub state と reviewed state の一致を検証してください。

    7. Follow-up / recurrent defect

    今回の refinement 中に、#2841 の scope 外で再発可能な別 root cause が具体的に確認された場合:

    1. まず repository 内の OPEN/CLOSED Issue を検索
    2. dedupe_key や root cause で重複確認
    3. current issue-refinement-loop の follow-up materialization policy が起票を要求・許可する場合のみ、canonical issue-creator / create-issue workflow で materialize
    4. 重複なら新規 Issue を作らず既存 Issue を参照
    5. 単なる security/harness 一般論を理由に follow-up Issue を増やさない

    #2841 OWNER comment で既に明示されている caller migration 等を、根拠なく新たな blocker にしないでください。

    8. Web research

    今回の OWNER comment には Python / pytest の外部仕様に関する記述があります。

    ただし過去 comment 内の :chatgpt-content-reference 等を authority として再利用しないでください。

    current REFINEMENT_LOOP_PLAN_V1 / investigation policy が外部調査を要求する、または current contract の正確性確認に外部仕様が materially necessary な場合のみ、current Skill の web-research routing に従い official source を fresh に調査してください。

    不要なら単に web research を増やさないでください。

    9. Termination

    approved の場合

    current Skill の approved termination 手順を完遂してください。

    必要な:

    • fresh contract review
    • readiness
    • dependency materialization gate(今回の canonical state が要求する場合)
    • termination report
    • LOOP_HANDOFF_RESULT_V1(適用対象なら)

    を current SSOT に従って処理してください。

    ただし approved 後も実装を開始しないでください。
    refinement_approved は implementation authorization ではありません。

    human_escalation の場合

    canonical:

    • termination_reason
    • termination_cause
    • blockers
    • iteration state
    • relevant evidence
    • 再開に必要な具体的 human decision

    を明示して終了してください。

    10. 最終報告

    最終回答には簡潔に以下を含めてください。

    1. final status: approved / human_escalation / その他 canonical terminal state
    2. fresh main SHA
    3. 使用した trusted human-context comment URL
    4. Issue body に実際に反映した主要 contract changes
    5. review / rewrite iteration 数
    6. 実行した SubAgent と、その terminal completion を取得したこと
    7. verification / deterministic checks の結果
    8. live test を実行したか、SKIP/NOT RUN だったか
    9. 起票/reuse した follow-up Issue(あれば)
    10. unresolved blocker(あれば)
    11. implementation は開始していないこと

    調査・提案だけで止まらず、current issue-refinement-loop の terminal state まで実際に進めてください。

    特に重要なのは、今回の REQUEST_CHANGES は新しい大規模ハーネスを要求しておらず、既存3ファイル中心の contract correction で解消可能性が高い点です。また、Claude-GPT では current repository が Step 2 の background execution と completion join を明示的に契約化しているため、prompt 側でもそこを強制しています。

  4. squne121 commented on Sep 30, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: human_escalation

    • Cause: human_judgment_required
    • Issue: 実装: orchestrate_runtime_smoke() の aggregate status=pass が、必須 scenario が skipped でも AC の PASS 証跡として使える欠陥を防ぐ #2841
    • Trusted context: 実装: orchestrate_runtime_smoke() の aggregate status=pass が、必須 scenario が skipped でも AC の PASS 証跡として使える欠陥を防ぐ #2841 (comment) (OWNER, ID 5911212153)
    • Main SHA: 4d7646f753d8dfd99727989c68eb0d3f7d0cf4d5
    • Iteration: 0 / 3 (review 0, rewrite 0)
    • Blockers:
      • contract_update.run.with_human_context returned STATUS: blocked, NEXT_ACTION: human_judgment_required, PLANNER_FAIL_CLOSED; contract_update.status: failed, writes: 0, fresh_review: unavailable.
      • The canonical selected-comment extraction produced confidence: ambiguous, ambiguity_flags: [structured_list_missing], extracted_directives: []; the selected comment snapshot is HTML markup. The trusted directive could not be converted into a provenance-bound contract patch plan. The read-only initial preflight had returned proceed_with_notes, but the subsequent mutation-phase gate stopped the workflow.
      • Step 1 codebase-investigator completed with status: inconclusive (no verified file:line evidence); it did not authorize a fallback. Step 2 was not launched after the blocking gate. No Issue body rewrite or implementation occurred.
    • Human decision needed to resume: provide/select an OWNER-authored Markdown comment with explicit, structured directives for the same Issue and three-file scope, or another canonical form accepted by the trusted human-context parser; then rerun issue-refinement-loop with that comment URL. Do not treat this report as approval to implement.
    LOOP_TERMINATION_RESULT_V1:
      termination_reason: human_escalation
      termination_cause: human_judgment_required
      max_iterations: 3
      blockers_history:
        - iteration: 0
          blockers:
            - PLANNER_FAIL_CLOSED
            - trusted_comment_directives_ambiguous
            - investigation_evidence_inconclusive
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: issue-refinement-loop
      follow_up_issues: []
      note_only_observations: []
  5. squne121 commented on Sep 30, 2026

    @squne121
    OwnerAuthor

    確認した範囲では、再開のために新しい OWNER コメントを作る必要はありません。現在の main は 4d7646f753d8dfd99727989c68eb0d3f7d0cf4d5 のままで、#2841 には既に 純 Markdown の OWNER コメント #issuecomment-5911554705 が存在します。前回停止は元の #5911212153 が HTML/clipboard envelope を含み、structured_list_missing → confidence: ambiguous になったことが直接原因でした。前回実行も Issue 本文未変更・review 0・rewrite 0 で終了しています。:chatgpt-content-reference{index="0"}

    また current issue-refinement-loop は、trusted freeform human directive を構造化 payload 不在だけで停止させない設計で、表現不能なら issue_editor_required に handoff する契約です。今回の failure class は既存 OPEN Issue #2778 がまさに所有しており、ordered-list 修正の #2812 は CLOSED です。したがって推奨は、#5911554705 を新しい active trusted human-context として refinement を再実行し、#2778 は重複起票せず再利用することです。

    そのまま既存 Claude-GPT session に貼る prompt です。

    repo = squne121/loop-protocol

    対象:

    あなたは既に repository-owned Claude-GPT profile の対話的 Claude Code session で auto mode 起動済みです。現在の session をそのまま継続してください。新しい Claude Code / Claude-GPT session を起動し直さないでください。

    Goal

    #2841 の前回 human_escalation を、既に GitHub 上に存在する OWNER-authored Markdown comment #5911554705 を新しい operator-selected trusted human-context として再開し、current issue-refinement-loop の canonical workflow を terminal state まで実行してください。

    この invocation は Issue refinement のみです。

    approved になっても、

    • implementation
    • impl-review-loop
    • production code 編集
    • commit
    • push
    • PR 作成

    には進まないでください。

    通常の investigation / deterministic repair / issue-editor rewrite / review retry / controlled GitHub mutation は、current repository contract が許す範囲で自律的に進めてください。canonical router が真に human_judgment_required を返した場合だけ停止してください。

    0. Fresh state を取得する

    最初に必ず fresh に取得・確認してください。

    1. current main HEAD
    2. 実装: orchestrate_runtime_smoke() の aggregate status=pass が、必須 scenario が skipped でも AC の PASS 証跡として使える欠陥を防ぐ #2841 の現在の body / labels / comments
    3. #5911554705 の本文、comment ID、URL、author、author association
    4. 前回 report #5911805912
    5. .claude/skills/issue-refinement-loop/SKILL.md
    6. Skill が今回参照を要求する current references / scripts / schemas
    7. CLAUDE.md
    8. 特に:
      • .claude/skills/issue-refinement-loop/references/anchor-comment-handling.md
      • termination / follow-up / review routing 関連 reference
      • current scope_signal_delta.py
      • current decide_rewrite_route.py
    9. 関連 Issue:

    確認時点の参考値として main は
    4d7646f753d8dfd99727989c68eb0d3f7d0cf4d5
    だが、固定値として信用せず fresh read してください。

    prompt と current repository contract が衝突する場合は current canonical SSOT を優先してください。

    1. Active trusted human-context を切り替える

    今回 active anchor として使うのは必ず:

    #2841 (comment)

    です。

    前回 active anchor の:

    #2841 (comment)

    は HTML / clipboard envelope を含む body で、前回 invocation では:

    • confidence: ambiguous
    • ambiguity_flags: [structured_list_missing]
    • extracted_directives: []
    • PLANNER_FAIL_CLOSED

    となりました。

    今回これを再び active anchor にしないでください。

    #5911554705 は、同じ OWNER REQUEST_CHANGES の内容を Markdown で明示し、A〜F の contract correction、三ファイル scope、SubAgent completion、termination 条件まで記載している既存コメントです。

    新しい再開用コメントを先に投稿しないでください。
    まず既存 #5911554705 を current Skill の with_human_context lane で使用してください。

    前回 termination report #5911805912 は status/evidence として読むだけで、approval や contract directive として扱わないでください。

    2. 前回 human_escalation を盲目的に再現しない

    current anchor-comment-handling.md / SKILL.md を実際に読んでください。

    current contract では trusted with_human_context の freeform human directive について、構造化 ANCHOR_SCOPE_REFRAME_V1 が無いことだけを理由に human judgment を要求しない経路、および section-bound patch で表現できない explicit trusted human_review_directive を NEXT_ACTION: issue_editor_required へ送る経路が存在します。

    したがって:

    • 「structured payload が無いので人間に再入力を要求する」
    • 「前回そう停止したので今回も停止する」
    • 「planner/router の意味を prose で再実装する」

    ことは禁止です。

    必ず current canonical executable route の実結果で判断してください。

    3. preflight / trusted contract update

    #5911554705 を指定し、current Skill が規定する:

    preflight.run.with_human_context

    を canonical main/root lane から実行してください。

    出力された:

    • STATUS
    • NEXT_ACTION
    • BLOCKERS
    • ARTIFACT
    • planner decisions
    • investigation policy
    • scope/binding evidence

    を artifact まで含めて確認してください。

    investigation が required の場合

    REFINEMENT_LOOP_PLAN_V1.decisions.investigation_policy.required == true なら current contract に従って codebase-investigator SubAgent を使ってください。

    SubAgent dispatch には親 thread の暗黙 context に依存せず、少なくとも以下を明示してください。

    • task
    • repo / Issue / active anchor URL
    • authority / SSOT
    • current main SHA
    • read-only / mutation prohibition
    • 確認対象 claims
    • 必要な exact repo-relative path / file:line evidence
    • expected structured output
    • 前回 investigator が evidence なし inconclusive だったこと
    • current source を fresh に再検証すること

    SubAgent completion は必須

    SubAgent を起動しただけで completion 扱いにしてはいけません。

    terminal completion notification を待ち、実際の final structured result / artifact を取得してから downstream phase に進んでください。

    もし current controller が fallback を禁止し、SubAgent final result が canonical に inconclusive となった場合は、それを成功に読み替えないでください。current router の判断に従ってください。

    investigation evidence transport が必要な場合

    current anchor-comment-handling.md が要求する場合は、read-only preflight.run.with_human_context で使用した 同一 investigation-evidence transport manifest を、直後の contract_update.run.with_human_context にそのまま再利用してください。

    manifest を別物として生成し直さないでください。

    4. contract_update.run.with_human_context

    preflight が canonical に trusted contract update を許可した場合だけ:

    contract_update.run.with_human_context

    を実行してください。

    結果が:

    NEXT_ACTION: issue_editor_required

    なら、current Skill の契約どおり:

    • 同じ contract_update.run.with_human_context を再実行しない
    • anchor comment を再投稿しない
    • active anchor URL #5911554705 を reviewer_feedback_url として使用
    • current issue-editor / controlled edit-issue transaction route へ handoff
    • full Issue contract rewrite を行う

    という route に進んでください。

    raw anchor snapshot を issue-editor に無制限に転送せず、current Skill が定める opaque/provenance-bound forwarding を使用してください。

    5. #2841 に反映すべき substantive contract

    active OWNER directive の semantic content を落とさないでください。

    最低限、current reviewer/editor に次を解消させてください。

    A. required set satisfaction と aggregate success を分離

    required_scenarios_satisfied == true は:

    • 宣言された全 required scenario の evidence が供給済み
    • 全て status == "pass"

    の場合だけ。

    供給済みだが fail の required scenario は:

    • required_scenarios_satisfied = false
    • missing_required_scenarios = []

    とする。

    required set が全 pass でも runner / canonical DB / statusLine / supplied non-required scenario 等の既存 failure があれば aggregate status は fail のまま。

    新しい required 判定で既存 failure を pass に昇格させない。

    B. AC6 false-green の修正

    test_runtime_smoke_verifier_live_shadow_isolation.py を、通常 invocation で実行済み PASS と主張しない。

    本 Issue の mandatory verification は focused deterministic tests と existing non-live regression tests を中心にする。

    Claude live runtime をこの小変更専用の mandatory gate にしない。

    任意に live test を実行した場合も:

    • PASS
    • SKIP
    • NOT RUN

    を区別する。

    C. evaluated set を output に残す

    declaration 時は normalized deterministic-order の:

    • required_scenarios
    • required_scenarios_satisfied
    • missing_required_scenarios

    を結果に残す。

    declaration なしでは legacy output を維持する。

    D. None と empty declaration を区別

    • None: declaration なし。legacy behavior/output。
    • empty collection: explicit declaration of zero additional required scenarios。宣言フィールドは出力する。

    if required_scenarios: のような truthiness collapse を contract 上許さない。

    E. guarantee を限定

    この Issue の guarantee は:

    caller が宣言した required scenario 集合について、供給 evidence の欠落または non-pass を検出し、aggregate pass にさせない

    まで。

    次は保証しない:

    F. boundary regression tests

    少なくとも:

    • known scenario 各々が required + missing
    • required evidence supplied + fail
    • required set all pass + unrelated existing failure
    • non-required missing
    • non-required supplied + fail
    • no declaration / explicit None / empty declaration
    • unknown scenario を seed / runner 等の副作用前に reject
    • representative legacy pass/fail output compatibility
    • declaration 時の deterministic required set output

    を AC / Verification Commands と対応させてください。

    既存 explicit serializer を不用意に dataclasses.asdict() 等へ置換する方向へ contract を広げないでください。

    6. Scope

    原則、既存三ファイル scope を維持してください。

    • scripts/task-context/task_context_runtime_smoke_verifier.py
    • tests/task-context/test_runtime_smoke_required_scenarios.py
    • docs/dev/runtime-verification-policy.md

    不要:

    scope change が必要なら prose 判断で即停止せず、current canonical scope-delta routing を使ってください。

    7. Step 2 review — background launch + mandatory join

    current Skill の canonical Step 2 は issue-reviewer SubAgent を直接起動する legacy routeではなく、root-owned:

    root_review_pipeline.produce

    です。

    current Skill の明示契約どおり、Claude Code main thread の Bash invocation では:

    • run_in_background: true を明示して起動
    • background task notification を待つ
    • terminal completion を join
    • 実際の完了 JSON/result を取得
    • その後でのみ canonical_step2_route を読む

    こと。

    background launch 成功だけを Step 2 成功として扱わないでください。

    必要な SubAgent / background work はすべて同様に terminal completion を取得してください。

    8. Rewrite loop

    canonical result が needs-fix / request_changes なら、bounded recovery route が存在する限り人間承認を求めず:

    review
    → issue-editor rewrite
    → controlled mutation
    → body/title readback
    → fresh preflight
    → fresh Step 2 background produce + completion join
    → fresh readiness

    を繰り返してください。

    decide_next_loop_action.py / rewrite router / planner / deterministic checker を authority とし、attempt 数や no-progress 判定を prose で再実装しないでください。

    9. 再発 defect: #2778 をまず reuse

    今回の前回 failure:

    • HTML/clipboard contaminated OWNER comment
    • structured_list_missing
    • confidence: ambiguous
    • explicit trusted human directive が issue_editor_required に到達しない

    は、既存 OPEN Issue:

    #2778

    の root-cause family と強く重なります。

    また #2812 はこの family の ordered-list detection 修正として CLOSED です。

    したがって:

    1. 調査: 構造化リスト(HTML貼り付け/Markdown順序付きリスト)でexplicit trusted human_review_directiveの検出に失敗しissue_editor_requiredに到達しない #2778 と 実装: scope_signal_delta.py の _BULLET_LINE_RE / extract_directive_items() を Markdown 順序付きリスト検出に対応させる #2812 の current state を fresh に読む
    2. 実装: orchestrate_runtime_smoke() の aggregate status=pass が、必須 scenario が skipped でも AC の PASS 証跡として使える欠陥を防ぐ #2841 reproduction が 調査: 構造化リスト(HTML貼り付け/Markdown順序付きリスト)でexplicit trusted human_review_directiveの検出に失敗しissue_editor_requiredに到達しない #2778 の既知 failure class と同一か、実装: scope_signal_delta.py の _BULLET_LINE_RE / extract_directive_items() を Markdown 順序付きリスト検出に対応させる #2812 後にも残る distinct regression かを evidence で判定
    3. 同一なら 新規 Issue を作らない
    4. current follow-up materialization policy が許可・要求する場合のみ、実装: orchestrate_runtime_smoke() の aggregate status=pass が、必須 scenario が skipped でも AC の PASS 証跡として使える欠陥を防ぐ #2841 の fresh reproduction evidence を 調査: 構造化リスト(HTML貼り付け/Markdown順序付きリスト)でexplicit trusted human_review_directiveの検出に失敗しissue_editor_requiredに到達しない #2778 に controlled lane で追記する
    5. 本当に distinct root cause と canonical dedupe が判断した場合だけ別 follow-up を検討する

    security/harness 一般論だけの Issue は増やさないでください。

    10. Web research

    今回は primary blocker が repository-owned parser / routing behavior なので、外部 Web research を無条件に増やさないでください。

    current planner の web_research_policy.required == true、または外部仕様確認が disposition に materially necessary な場合だけ current web-research routing を使用してください。

    11. Termination

    approved

    current Skill の approved termination を完遂する。

    fresh:

    • contract review
    • readiness
    • dependency/follow-up gates
    • readback
    • termination result

    を current SSOT どおり確認する。

    ただし implementation は開始しない。

    human_escalation

    canonical router が本当に要求した場合のみ停止し:

    を報告する。

    前回のように「structured Markdown comment を新しく投稿してください」と即座に要求する前に、今回選択した既存 Markdown anchor #5911554705 と current canonical freeform/editor route を最後まで評価してください。

    12. Final report

    最終回答には簡潔に:

    1. final canonical status
    2. fresh main SHA
    3. active trusted human-context URL (#5911554705)
    4. 実装: orchestrate_runtime_smoke() の aggregate status=pass が、必須 scenario が skipped でも AC の PASS 証跡として使える欠陥を防ぐ #2841 に反映した contract changes
    5. review / rewrite iteration
    6. 使用した SubAgent と terminal completion を取得したこと
    7. Step 2 background root_review_pipeline.produce の completion join 結果
    8. deterministic / verification result
    9. live test: PASS / SKIP / NOT RUN
    10. 調査: 構造化リスト(HTML貼り付け/Markdown順序付きリスト)でexplicit trusted human_review_directiveの検出に失敗しissue_editor_requiredに到達しない #2778 の reuse / evidence update 状態
    11. unresolved blocker
    12. implementation / commit / push / PR を開始していないこと

    を含めてください。

    調査・提案だけで終了せず、current issue-refinement-loop の canonical terminal state まで実際に進めてください。

    この再開では、前回と同じ #5911212153 をもう一度 parser に投げるより、既存の clean Markdown #5911554705 へ anchor を切り替えるのが要点です。これでも同じ structured_list_missing が再現するなら、#2778/#2812 後にも残る parser/routing regression の証拠として扱うのが筋です。

  6. squne121 commented on Sep 30, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: human_escalation

    LOOP_TERMINATION_RESULT_V1:
      termination_reason: human_escalation
      termination_cause: human_judgment_required
      max_iterations: 3
      blockers_history:
        - iteration: 0
          blockers:
            - PLANNER_FAIL_CLOSED
            - expands_allowed_paths
            - investigation_evidence_inconclusive
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: issue-refinement-loop
      follow_up_issues: []
      note_only_observations:
        - "Existing OPEN #2785 covers the current expands_allowed_paths failure class; no new Issue or evidence update was materialized."
  7. squne121 commented on Sep 30, 2026

    @squne121
    OwnerAuthor

    推奨は、#2785 の修正待ちにはせず、今回の human judgment を「Allowed Paths は拡張しない」と明示して #2841 を再開することです。前回 run は confidence: explicit まで進んだ一方、expands_allowed_paths で canonical に停止し、Issue 本文は未変更、review/rewrite 0、tests は NOT RUN のまま終了しています。終了レポート #5912343635 も投稿済みです。:chatgpt-content-reference{index="0"}

    live main は現在も 4d7646f753d8dfd99727989c68eb0d3f7d0cf4d5。#2785 は OPEN で今回と同じ false-positive family を所有しています。また current Skill には expands_allowed_paths 用の investigation-evidence transport がありますが、これは「実際に scope expansion が必要だが exact paths が未確定」の救済用です。今回は逆にscope を増やさない判断なので、derived path transport で boundary を消そうとするより、最小の OWNER clarification を controlled comment として投稿して active anchor を切り替えるのが適切です。

    そのまま既存の対話的 Claude-GPT に貼る prompt です。

    repo = squne121/loop-protocol

    対象:

    あなたは既に repository-owned Claude-GPT profile の対話的 Claude Code session で auto mode 起動済みです。現在の session をそのまま継続してください。新規 session は開始しないでください。

    Human decision for this resume

    今回の human_judgment_required に対する operator decision は次です。

    #2841 の Allowed Paths は拡張しません。

    前回 trusted OWNER directive #5911554705 内で言及された、現在の ## Allowed Paths 外の repository paths / Skill paths / references / scripts / tests 等は、調査・SSOT・workflow・evidence を参照するための read-only contextual references です。

    それらは:

    と扱ってください。

    #2841 の現在の ## Allowed Paths section は 変更せず、その既存3エントリだけを authoritative mutation scope として維持してください。

    この human decision を prose override として planner/router を迂回するために使ってはいけません。current issue-refinement-loop が trusted GitHub human-context を必要とする場合は、下記の clarification comment を repository-owned controlled comment lane で 1件だけ #2841 に投稿し、fresh readback 後、その新規 comment URL を operator-selected trusted human-context として canonical workflow を再開してください。

    投稿する clarification comment

    ## Refinement clarification
    
    This is an explicit scope decision for the current #2841 refinement.
    
    - Do not expand or otherwise modify the current `## Allowed Paths` section.
    - The existing Allowed Paths entries already present in #2841 remain the complete mutation allowlist for this Issue.
    - Repository paths mentioned in the earlier OWNER directive are read-only context/evidence references only. They do not authorize mutation of those paths and do not authorize an Allowed Paths expansion.
    - Continue applying the substantive REQUEST_CHANGES from https://github.com/squne121/loop-protocol/issues/2841#issuecomment-5911554705 within the existing Issue scope.
    - If the canonical classifier still reports `expands_allowed_paths` from this clarification, treat that as evidence of the existing #2785 failure class; do not reinterpret this clarification as permission to expand scope.

    この comment の投稿自体を今回の user authorization として扱ってよいです。ただし raw gh issue comment を repository-owned controlled publisher の代替として使用しないでください。current Skill が指定する controlled mutation/comment lane を使用してください。

    もし current canonical contract 上、GitHub clarification comment を新規投稿せずこの operator decision を安全に consume できる別の正式 route が既に存在するなら、その current SSOT を優先してください。その場合も「Allowed Paths を拡張しない」という decision の意味は変えないでください。

    Goal

    上記 human decision を canonical に materialize / bind したうえで、#2841 の current issue-refinement-loop を terminal state まで実行してください。

    この invocation は Issue refinement のみです。

    approved になっても:

    • implementation
    • impl-review-loop
    • production code editing
    • commit
    • push
    • PR creation

    には進まないでください。

    routine な investigation / issue-editor rewrite / review / deterministic repair / bounded retry / controlled GitHub mutation は、人間の逐次承認なしに進めてください。

    0. Fresh state

    最初に必ず fresh に確認してください。

    1. current main HEAD
    2. 実装: orchestrate_runtime_smoke() の aggregate status=pass が、必須 scenario が skipped でも AC の PASS 証跡として使える欠陥を防ぐ #2841 body / labels / comments
    3. #5912343635 の全文と termination state
    4. #5911554705 の全文、OWNER association、binding
    5. .claude/skills/issue-refinement-loop/SKILL.md
    6. Skill が要求する references / scripts / schemas
    7. CLAUDE.md
    8. 特に current:
      • references/anchor-comment-handling.md
      • references/termination-policy.md
      • references/follow-up-materialization.md
      • references/loop-state.md
      • scripts/scope_signal_delta.py
      • scripts/decide_rewrite_route.py
    9. 調査: trusted human-context directive の Allowed Paths boundary/operation が section-local source binding を失う #2785 current body/state
    10. 実装: scope_signal_delta.py の _BULLET_LINE_RE / extract_directive_items() を Markdown 順序付きリスト検出に対応させる #2812 current state
    11. 調査: trusted human-context directive の Allowed Paths boundary/operation が section-local source binding を失う #2785 の implementation follow-up が既に存在するか
    12. 必要なら 実装: trusted human-context の contract_update mutation lane が、freeform directive から不正な patch operation を導出し、失敗理由を出さずに停止する欠陥を是正する #2842 / 実装: contract_update.run.with_human_context の mutation phase に investigation evidence transport (#2086 AC3) を配線する #2678 / 実装: trusted human contract feedback を controlled editor handoff に接続する #2620 / 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 の current relation

    参考値として確認時点の main は
    4d7646f753d8dfd99727989c68eb0d3f7d0cf4d5
    ですが、固定値として使用せず fresh read してください。

    prompt と current repository contract が衝突する場合は canonical repository SSOT を優先してください。

    1. 前回 result を再利用しすぎない

    前回 #5912343635 は次を確定しています。

    • active anchor #5911554705 は Issue に正しく bound
    • directive confidence は explicit
    • blocker は expands_allowed_paths
    • contract_patch_plan absent
    • contract_update.run.with_human_context は write 0 で fail-close
    • codebase-investigator は admissible file:line evidence を返せず inconclusive
    • Step 2 は未実行
    • Issue body mutation なし
    • review 0 / rewrite 0

    これらは historical evidence として読む一方、current main / current Skill / new clarification に対して canonical preflight を fresh に実行してください。

    過去 result を理由に同じ human_escalation をそのまま再掲しないでください。

    2. expands_allowed_paths の扱い

    今回 human が決定した内容は scope expansion を拒否し、existing three-file scope を維持することです。

    したがって:

    こと。

    current canonical parser/router が clarification を正しく「no scope change」と分類できるなら、その route を使用してください。

    それでも reason_code: expands_allowed_paths が発生した場合は、今回の明示的 no-expansion clarification に反する #2785 の concrete reproduction evidence として扱ってください。

    3. Investigation / SubAgent

    current planner の investigation_policy.required == true なら codebase-investigator を使用してください。

    dispatch では親 thread の暗黙 context に依存せず、最低限:

    を明示してください。

    Completion is mandatory

    SubAgent を dispatch しただけで completion 扱いしないでください。

    全ての必要な SubAgent / background work の terminal completion を待ち、final structured result / artifact を取得してから downstream phase へ進んでください。

    status: inconclusive は success に読み替えないでください。

    ただし source inspection を行う正規の別 route / fallback が current Skill で許可されているなら、planner/router の判断に従って bounded recovery を実行してください。

    4. Canonical preflight → contract update

    新しい clarification comment を active anchor として current canonical:

    preflight.run.with_human_context

    を実行してください。

    artifact まで読み:

    • STATUS
    • NEXT_ACTION
    • BLOCKERS
    • authority classification
    • confidence
    • boundary flags
    • scope_delta_authority.route
    • contract_patch_plan
    • planner decisions
    • investigation policy

    を確認してください。

    contract_update_required の場合

    current Skill の正式 route に従って contract_update.run.with_human_context へ進んでください。

    issue_editor_required の場合

    current Skill が canonical に返した場合のみ issue-editor handoff へ進んでください。

    • blocked human_escalation を独自に issue_editor_required へ変換しない
    • reviewer_feedback_url / opaque forwarding / provenance binding は current contract に従う
    • controlled edit transaction を使う
    • rewrite 後に GitHub body を fresh readback する

    investigation-evidence transport

    current canonical route が 本当に investigation evidence transport を要求する場合だけ使用してください。

    ただし今回は no-scope-expansion decision なので、単に boundary を消すためだけに path literals を作らないでください。

    transport を使う場合は:

    • verified evidence のみ
    • current binding に対応
    • preflight と contract-update で Skill が要求するなら同一 manifest を reuse
    • unverified AGY proseから manifest を mint しない

    を守ってください。

    5. #2841 substantive contract correction

    #5911554705 の substantive REQUEST_CHANGES を失わず反映してください。

    最低限:

    A. required satisfaction と aggregate success の分離

    required_scenarios_satisfied == true は:

    • 全 required evidence が supplied
    • 全 required evidence status が pass

    の場合のみ。

    supplied-but-fail の required scenario:

    • satisfied = false
    • missing = []

    required set が全 pass でも既存 runner / canonical DB / statusLine / supplied non-required scenario failure があれば aggregate は fail のまま。

    B. AC6 false-green

    通常 pytest invocation で除外される live-shadow-isolation を mandatory PASS evidence と主張しない。

    focused deterministic tests + existing non-live regression tests を mandatory verification にする。

    この Issue 専用の Claude live mandatory gate は追加しない。

    live test を任意実行した場合は PASS / SKIP / NOT RUN を区別する。

    C. evaluated required set を output に残す

    declaration 時のみ normalized deterministic:

    • required_scenarios
    • required_scenarios_satisfied
    • missing_required_scenarios

    を出力。

    D. None と empty declaration

    • None = undeclared / legacy behavior + legacy output
    • empty collection = explicit zero-required declaration。declaration fields は出力
    • truthiness collapse 禁止

    E. guarantee を限定

    保証するのは caller-declared required set の supplied/pass completeness と aggregate false-green 防止まで。

    runtime provenance / AC semantic binding / caller migration / #2827 adapter replacement 等は保証しない。

    F. boundary regression cases

    AC / verification を少なくとも以下へ対応させる:

    • each known scenario required + missing
    • required supplied + fail
    • required all pass + unrelated existing failure
    • non-required missing
    • non-required supplied + fail
    • undeclared / explicit None / empty
    • unknown scenario rejection before seed/runner side effects
    • representative legacy pass/fail compatibility
    • deterministic declared set serialization

    原則、#2841 の current three-file mutation scope を維持する。

    6. Step 2 review

    canonical Step 2 は current Skill の root-owned:

    root_review_pipeline.produce

    を使用してください。

    Claude Code main thread の Bash から:

    • run_in_background: true を明示
    • background launch
    • completion notification を待つ
    • terminal completion を join
    • actual completion JSON/result を取得
    • その後だけ canonical_step2_route を読む

    こと。

    launch success ≠ Step 2 completion です。

    canonical_step2_route を唯一の routing authority とし、verdict/status から prose で再計算しないでください。

    7. Bounded loop

    current Skill に従い:

    fresh preflight
    → required investigation
    → contract update / issue-editor
    → fresh GitHub readback
    → fresh preflight
    → Step 2 background review + mandatory join
    → REQUEST_CHANGES の deterministic repair / rewrite
    → fresh review
    → readiness
    → decide_next_loop_action.py
    → terminal state

    まで進めてください。

    normal needs_fix / REQUEST_CHANGES / deterministic repair / freshness drift は、人間停止理由にせず canonical bounded recovery がある限り処理してください。

    planner / router / deterministic checker / loop-state SSOT を prose で再実装しないでください。

    8. #2785 recurrent defect handling

    #2785 は current OPEN issue として reuse してください。

    新規 duplicate Issue を作らないでください。

    以下を fresh に確認:

    1. 調査: trusted human-context directive の Allowed Paths boundary/operation が section-local source binding を失う #2785 current contract
    2. linked implementation follow-up の有無
    3. 実装: trusted human-context の contract_update mutation lane が、freeform directive から不正な patch operation を導出し、失敗理由を出さずに停止する欠陥を是正する #2842 等が 調査: trusted human-context directive の Allowed Paths boundary/operation が section-local source binding を失う #2785 root cause のどこまでを所有するか
    4. 今回の no-expansion clarification でも false-positive が再現するか

    再現しなかった場合

    #2841 refinement を通常継続し、#2785 を不要に更新しない。

    再現した場合

    current follow-up-materialization policy が許可・要求する場合のみ、#2785 に今回の fresh reproduction evidence を controlled lane で追記してください。

    evidence には最低限:

    を含める。

    単なる推測・security/harness 一般論は追記しない。

    #2785 の research contract が実装 follow-up を要求しているにもかかわらず follow-up が存在しないことを fresh に確認した場合でも、#2841 refinement の authority を越えて勝手に implementation scope を開始しないでください。current follow-up materialization / create-issue policy が明確に許可・要求する場合だけ dedupe 後に materialize してください。

    9. Termination

    approved

    current Skill の approved termination を完遂。

    fresh:

    • Issue readback
    • contract review
    • readiness
    • dependency/follow-up gate
    • termination result
    • applicable handoff artifact

    を確認。

    implementation は開始しない。

    human_escalation

    canonical router が新しい unresolved human decision を本当に要求した場合だけ停止。

    その際は:

    を明示する。

    既に今回解決した「Allowed Paths を拡張するかどうか」を、同じ意味のまま再質問しないでください。

    Final report

    簡潔に:

    1. final canonical status
    2. fresh main SHA
    3. newly materialized clarification URL(作成した場合)
    4. active trusted human-context URL
    5. 実装: orchestrate_runtime_smoke() の aggregate status=pass が、必須 scenario が skipped でも AC の PASS 証跡として使える欠陥を防ぐ #2841 body の実変更
    6. review / rewrite iteration
    7. SubAgent と terminal completion
    8. Step 2 background producer の mandatory join result
    9. deterministic / verification result
    10. live test: PASS / SKIP / NOT RUN
    11. 調査: trusted human-context directive の Allowed Paths boundary/operation が section-local source binding を失う #2785 reuse / evidence update / implementation follow-up state
    12. unresolved blocker
    13. implementation / commit / push / PR を開始していないこと

    を報告してください。

    調査だけで終了せず、current canonical workflow が許す範囲で terminal state まで進めてください。

    この形なら、前回の停止条件だった「拡張なのか false positive なのか」という人間判断自体を先に解消しつつ、#2785 を迂回して issue_editor_required を捏造することも避けられます。

  8. squne121 commented on Sep 30, 2026

    @squne121
    OwnerAuthor

    Refinement clarification

    This is an explicit scope decision for the current #2841 refinement.

  9. squne121 commented on Sep 30, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: human_escalation

    LOOP_TERMINATION_RESULT_V1:
      termination_reason: human_escalation
      termination_cause: human_judgment_required
      max_iterations: 3
      blockers_history:
        - iteration: 0
          blockers:
            - expands_allowed_paths
            - investigation_evidence_unavailable_permission_denied
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: issue-refinement-loop
      follow_up_issues: []
      note_only_observations:
        - dedupe_key: "existing:#2785:expands_allowed_paths:false-positive"
          source_url: "https://github.com/squne121/loop-protocol/issues/2841#issuecomment-5912811788"
          source_note_id: "scope-classifier-no-expansion-clarification"
          summary: "Explicit no-expansion OWNER clarification still routes to human_escalation/expands_allowed_paths; existing OPEN #2785 reused without mutation."
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