Skip to content

実装: Native Claude operatorにTask Context hooks・wrong-session guard・statusLine/Herdr projectionを配線する #2564

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#2562"
goal_ref: "Native Claude operatorの通常操作を変えず、Herdr TabへTask autobind/recoveryし、primary-target誤配送をUserPromptSubmitでblockし、statusLine/Herdr projectionからcurrent Taskを識別できるようにする"
change_kind: workflow
dedupe_key: "task-context-v1:native-operator-hooks-projection"

Parent Issue

#2562

Parent Goal Ref

  • Goal: Herdr上で最大8程度のClaude Code / Claude-GPT operatorを並列利用しても、Tab位置に依存せずcurrent Taskを識別し、wrong-session事故を開始前に止め、人間はAttention対象だけを把握でき、/clear・/quit・Herdr cold restartを跨いでTask Contextを復元できる状態にする。
  • Desired Destination(parent scope): Herdr上で最大8程度のNative Claude / Claude-GPT operatorを並列利用しても、Tab位置・worktree・branchをTask identityにせずcurrent Taskを安定識別し、wrong-primary promptをClaude処理前に止め、/clear・/quit・Herdr cold restartを跨いで必要なTask Contextを復元し、人間は既存Herdr/statusLine上のTask・Activity・Attention・runtime healthを見れば運用できる状態にする(v1はlocal SQLiteをlive state SSOTとする薄いcontrol-planeに限定)。

Current Validated Scope

  • 本Issueのwrite-capable scopeは .claude/settings.json、.claude/hooks/task_context/**、.claude/skills/task/**、scripts/task-context/**、tests/task-context/** に限定される。
  • 実装: Task Context v1のSQLite registry・schema・typed internal APIを追加する #2563(core registry/typed API)がmerge済みであることを前提とする。
  • Claude-GPT/cold restart/runtime-smoke固有のwiringはこのIssueのwrite-capable scope外(後続child)。

Remaining Parent Gaps

Depends On

Outcome

project .claude/settings.json からTask Context adapterが独立hookとして配線され、Native Claude operatorで通常の claude 起動・通常prompt・/clear・/quit を維持したままTask/Activity/Bindingが同期される。Claude画面のstatusLineとHerdr Tab表示はTask Context DBのread-only projectionとなり、ACTIVEな別primary target promptはClaudeへ渡る前にblockされる。

In Scope

  • thin Claude-native hook adapterを追加し、core typed APIへ正規化requestを渡す。Task semantics/SQLを.claude/hooksへ重複実装しない。
  • Task Context固有のClaude-native hook/statusLine entrypointは .claude/hooks/task_context/** 配下へ置き、無関係な.claude/hooks siblingへwrite scopeを広げない。
  • .claude/settings.jsonへ既存hook群と順序非依存で以下を配線する: SessionStart, UserPromptSubmit, CwdChanged, SubagentStart, SubagentStop, PreToolUse, Stop, StopFailure, SessionEnd。
  • 既存session_manifest_coordinator等と同一eventで並列になっても順序依存しない。
  • UserPromptSubmitのdeterministic primary-target classifierを配線する。fenced/inline code、blockquote、example/quoted textをauthority textから除外し、EXPLICIT/INFERRED/REFERENCE_ONLY/AMBIGUOUS/NONEを分類する。LLMをhot pathに入れない。precedenceは次のとおりとする: /task special-case最優先 > single high-confidence same-target → PASS > single high-confidence other-target → BLOCK > REFERENCE_ONLY/NONE → PASS > AMBIGUOUS → silent rebindせずPASS + advisory。
  • UNBOUND Tab + explicit/inferred GitHub targetはautobind。GitHub targetなしはad-hoc Taskを生成する。ACTIVE Taskかつtask_refs == 0(GitHub ref 0件のad-hoc Task)はprovisional/absorbentとする: 最初のhigh-confidence primary GitHub targetが来た場合はsame Taskへそのrefをclaimし、different-Task rebindとして扱わない。1つ以上primary refを持った後からdifferent-primary guardを通常どおり有効にする。
  • ACTIVE current Activity + different primary targetは原則block。関連Issue/PR参照は通す。
  • terminal Activityからの合法same-Task advance / different-Task rebindは通常promptだけで進められる。
  • ACTIVE Taskを意図的に切り替えるproject-local /task <target> escape hatchを追加する。通常の自然言語promptやshell起動引数をescape hatchにしない。
  • binding_idをdurable identityとし、Herdr tab/pane/workspace locationはmutable RuntimeLocation observationとして分離する。operator paneが別Tab/Workspaceへmoveしても Task/Activity/Binding identityは変化しない。Herdrへのprojection直前にcurrent live pane/tabを解決し、staleな旧Tabを更新しない。HERDR_TAB_IDをdurable Task/Binding primary keyへ昇格しない。
  • SessionStartのstartup: 既存のrecoverable/suspended Bindingがcurrent live operator locationから決定的に解決できれば復元する。それ以外は通常のbinding規則へ進む。stale open ExecutionRunがあれば先にreconcileし、同一operatorにopen runを重複生成しない。
  • SessionStartのresume: Task/Activity/Bindingを維持し、session/run associationをreconcileする。stale ExecutionRunのself-healを行い、duplicate open runを作らない。
  • SessionStartのclear(/clear): Task/Activity/Binding維持、旧/新operator ExecutionRunのみ切替、Task Contextを新conversationへ再注入する。
  • SessionStartのcompact: Task/Activity/Binding/current operator ExecutionRun identityを変更しない。必要なcontext refresh/reinjectionだけを行う。compactだけを理由に新しいmanaged runを作らない。
  • SessionStartのfork: v1ではparent operatorのTabBindingを自動継承しない。parent Bindingをsteal/mutateしない。fork側は通常のbinding規則によって独立に解決されるまでinherited Bindingなしとして扱う。
  • SessionEndの正常受信を復元の前提条件にしない。次回SessionStartがstale open ExecutionRunを検出してself-heal/reconcileできることとする。
  • /quit: operator run終了、Binding suspended。後日同じlive Herdr Tabで通常claude起動したSessionStartから復元。追加起動argument不要。
  • non-Herdr canonical interactive Claude (HERDR_TAB_IDなし) はobserve-only: autobind/rebind/wrong-tab routing/TabBinding作成を行わない。
  • CwdChangedはRuntimeLocationのみ更新し、worktree変更をTask switch/block条件にしない。
  • SubAgentはparent Task/Activity配下のExecutionRunとして記録し、TabBindingを作らない。
  • Stop/StopFailure/SessionEndはruntime factのみ同期し、Claudeの自然言語final responseからTask completionを推測しない。
  • DB busy/corrupt時のfail policyは以下のとおりとする: 通常promptでは、DB busy/unavailable/corrupt/read failure時はpromptを原則PASSしTask Contextはdegradedとして可視化する。persistenceできないTask mutationは行わず、成功したように装わない。current state取得とwrong-target判定まで正常完了した場合のみ、high-confidence definite mismatchをBLOCKする。/task <target>は明示的なstate-changing commandのため、必要なpersistenceに失敗した場合は/task自体を明示failure/blockとし、rebind成功を装わない。command型UserPromptSubmitのtimeoutで完全なfail-closedを保証できるとは主張しない。UserPromptSubmit Task Context adapterのtimeoutは既定30秒を使わず最大1秒のbounded hot-path budgetとし、既存SQLite busy budget 200msとの整合を保つ。
  • statusLineはquery currentだけを消費するread-only rendererとする。query currentはClaude Codeから渡される安定したsession_idをselectorとして呼び出し、session_id -> Binding -> Task / Activity / Attention / RuntimeLocation / runtime healthを返すadditive queryとする。query currentのstatusLine経路は真にread-onlyであり、DB directory作成・DB新規作成・migration・WAL設定等のwrite-capable initialization・projection mutation・GitHub fetch・Herdr mutationを一切行わない。read-only open不能またはDB未作成の場合は空/degraded statusを返し、DBを作成しない。既存service SQLをhook/statusLine側へ重複実装しない。Issue/PRはOSC 8 hyperlink対応。
  • Herdr projectionは既存primitiveをそのまま利用する: projection_outbox revision=N consume → live pane/tab resolve → herdr tab rename → herdr pane report-metadata --current --source task-context-v1 --seq N → projection ack。既存service layerのrevision-awareack_projection()をSSOTとして再利用し、additiveなtyped CLI projection ack operationを追加してこれを呼ぶ(adapter側へack SQLを重複実装しない)。Herdr custom metadata tokenはbest-effort enhancementとし、必須UXはHerdr Tab labelとClaude statusLineまでとする。projectionをUserPromptSubmit hot pathへ同期的に抱え込まない。DB commitをHerdr失敗でrollbackしない。
  • Herdr tab labelは#N · refine|impl|cleanup等の瞬間識別を優先し、statusLineに詳細(Issue title/PR/Activity/Attention/worktree/branch/runtime health)を出す。
  • /task <target> はslash command expansionより前にUserPromptSubmitが生のプロンプト文字列として受け取ることを前提に、UserPromptSubmit adapter自身がdeterministicにspecial-case判定する(別parserやexpansion結果への依存にしない)。
  • /task <target>によるTask rebindは単一のUserPromptSubmit adapter(typed transaction)だけがatomicに所有し、通常のprimary-target classifierより先に評価する(precedence: /task special-case > 通常primary-target classifier)。
  • 同一UserPromptSubmitイベントに登録された複数handlerが並列実行され、他handlerが最終的にpromptをblockした場合でも、本adapterのTask/Activity mutation(autobind/rebind含む)はhook実行順に依存せず、state corruptionやauthority/pending authorizationの次turnへのcarry-overを起こさない(Spark固有ケースに限らず、全UserPromptSubmit mutationに適用する一般原則とする)。
  • Task Context mutation semanticsはcommit-on-submissionに固定する:Userが明示送信しTask Context自身のvalidationが成功してautobind/rebind//task mutationをcommitした場合、独立したsibling hookが別理由で同一promptをblockしてもrollbackしない。2-phase prompt transactionや独自hook coordinatorは追加しない。

Out of Scope

  • workflow-specific trusted completion signal producer変更(別child)。
  • cross-session message policy / crossSessionInbound=hold(別child)。
  • Claude-GPT launcher統合(別child)。
  • runtime-smoke isolated registry(別child)。
  • Herdr cold restart resume dispatcher(別child)。
  • Task Contextをsecurity sandboxとして扱うこと。

Acceptance Criteria

  • AC1: 新規Herdr Tabで通常claude起動後、Issue/PR URLを含む通常promptだけでTask/Activity/Bindingが自動作成・表示される。
  • AC2: /clear後もTask/Activity/Binding IDが維持され、新conversationへTask Contextが自動注入される。
  • AC3: /quit後、同じlive Herdr Tabで通常claudeを起動するだけでsuspended Bindingが復元される。Task Context用追加argvを要求しない。
  • AC4: current ACTIVE Activityと異なるhigh-confidence primary target promptはClaude処理前にblockされ、reference-only cross-contextはblockされない。ただしACTIVE Taskがtask_refs==0のprovisional/absorbent状態にある間の最初のhigh-confidence primary GitHub target claimはblock対象としない。
  • AC5: current Activityがterminalなら合法same-Task advance / different-Task rebindを通常promptだけで進められる。AMBIGUOUS分類(multi-ref比較prompt等)はsilent rebindせずPASS + advisoryとし、誤ってblockしないことをfixtureで検証する。
  • AC6: /task <target>だけがACTIVE Taskを意図的にsupersede/rebindするexplicit human escape hatchとして動作する(provisional/absorbent Taskへの最初のprimary ref claimはこのrebind規則の対象外とする)。
  • AC7: worktree/cwd変更だけでTask/Activity/Bindingが変更・blockされない。
  • AC8: SubAgentにoperator TabBindingが作られず、parent ExecutionRun配下へroll-upされる。
  • AC9: statusLineは安定したsession_idをselectorとするquery currentを呼び出し、read-onlyでTask/PR/Activity/Attention/RuntimeLocation/runtime healthを表示し、Issue/PR OSC 8 linkを出力する。query currentのstatusLine経路はDB作成・write・projection mutation・GitHub fetch・Herdr mutationを行わない。
  • AC10: Herdr projection失敗後もDB stateはcommit済みのまま保持され、outbox再実行でeventually current表示へ追いつく。
  • AC11: HERDR_TAB_IDなしのcanonical interactive Claudeはobserve-onlyでTask routingを行わない。
  • AC12: ACTIVE Task Aの状態でraw /task Bを送信した場合、UserPromptSubmitのwrong-primary-prompt guard自身によって誤blockされず、slash expansionのタイミングに関わらず/task Bへのrebindが正しく成立する。
  • AC13: Task Context hookが先/後どちらで完了しても、別handler block後のcanonical stateは同じTask(またはautobind/rebind先)となり、pending authorization等は残存しない(commit-on-submissionによりrollbackしない)ことをorder-independentなテストで検証する。
  • AC14: operator paneを別TabまたはWorkspaceへmoveした後もTask/Activity/Bindingは不変であり、次回projectionは移動先のcurrent Tabへ追従する。
  • AC15: compactはTask/Activity/Binding/ExecutionRun identityをmutateせずcontext再注入のみ行い、forkはv1でparent operatorのTabBindingを継承しないことをテストで検証できる。

Runtime Verification Applicability

decision: immediate
applicable_acs: [AC1, AC2, AC3, AC4, AC6, AC9, AC12, AC14]
reason: "actual Claude hook lifecycle、/clear・/quit、prompt block、statusLine/Herdr projectionはfixtureだけでは実runtime integrationを証明できない"
execution_environment: "isolated/local Herdr + Native Claude runtime; canonical Task Context test state"
fallback_policy: "static/unit testsのみをruntime PASSにしない"
skip_conditions: "対象runtime(Herdr/Claude native)を用意できない開発環境ではruntime検証をskipし、static/unit testsのみをbaselineとして扱う。skip時はruntime AC PASSを主張しない。"
artifact_requirements: "worktree-agent-runtime-smoke等のisolated runtime実行から取得したbounded evidence(実行ログ抜粋、生成されたTask/Activity/Binding識別子、statusLine出力等)をIssue commentへpublic-safeな形で添付する。"

Verification Commands

# AC1
# AC2
# AC3
# AC4
# AC5
# AC6
# AC7
# AC8
# AC9
# AC10
# AC11
# AC12
# AC13
# AC14
# AC15
$ uv run --locked pytest tests/task-context -q

実runtime ACは後続のTask Context-specific runtime verifierからworktree-agent-runtime-smokeを利用して証跡化する。generic smoke Skill自体へTask Context意味論を埋め込まない。#2564自身は現行generic worktree-agent-runtime-smokeへの追加harness改造なしに実現可能なminimal Native canaryまでを担当し、isolated Task Context DB/actual hooks//clear/wrong-target/statusLine/Native・Claude-GPTを含む本格E2Eは#2568が担当する。#2564のためにgeneric runtime-smoke harnessへTask Context専用意味論を新設しない。

Allowed Paths

  • .claude/settings.json
  • .claude/hooks/task_context/**
  • .claude/skills/task/**
  • scripts/task-context/**
  • tests/task-context/**
  • scripts/check_hook_boundaries.py
  • docs/dev/hook-boundaries.md
  • tests/test_hook_boundaries_doc.py

Stop Conditions

  • #2563のbreaking schema migrationや既存契約の非互換変更が必要になった場合(scripts/task-context/**・tests/task-context/**内でのadditive typed API/CLI operationの追加、例: query currentのsession selector化・真のread-only query path・projection ack operationの追加は、Allowed Pathsの範囲内でありStop対象としない)。
  • existing hookの実行順を前提にしないと成立しない場合。
  • LLM/network callを通常UserPromptSubmit hot pathへ常時入れる必要が生じた場合。
  • worktree/branch/Herdr tab positionをTask identityへ昇格する必要が生じた場合。
  • Claude-GPT/cold restart/runtime-smoke固有変更が必要になった場合(対応childへ分離する)。
  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合

Required Skills

  • Claude Code hooks(UserPromptSubmit / SessionStart / PreToolUse等のlifecycle)
  • statusLine / Herdr tab projection
  • deterministic primary-target classifier設計
  • pytest(deterministic unit/integration tests)

Required Design References

Delivery Rule

Activity

  1. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    判定

    REQUEST_CHANGES です。ただし、設計の方向性は維持してよいです。

    親 #2562 の以前のレビューで問題だった /task <target> の precedence と、同一 UserPromptSubmit handler の並列実行問題は、現行 #2564 ではかなり適切に取り込まれています。さらに依存 #2563 は PR #2588 として既に merge 済みなので、実装着手の前提自体は満たされています。

    一方、現在の #2563 実装と最新 Claude Code / Herdr の実インターフェースまで突き合わせると、#2564 の契約だけでは実装者が誤った実装をしてもACを満たしたと解釈できる箇所が残っています。 #2564 自身には現在コメントがないため、直接コメントだけでなく親 #2562 のレビュー、#2563/#2566/#2567/#2568/#2570/#2571、PR #2588/#2579、現行repo資産を併せて評価しました。

    敵対的レビュー

    Severity | Finding | 推奨 -- | -- | -- BLOCKER | AC9 の statusLine → query current 契約が現行coreでは成立しない | query current を session_id selector対応+真のread-only pathへ拡張 BLOCKER | HERDR_TAB_ID をlive locatorとして扱うとpane移動後にstaleになる | durable Bindingとlive Herdr locator解決を明確に分離 BLOCKER | SessionStart lifecycle matrixが不足。compact/fork/resumeでBinding/ExecutionRunを壊せる | source別transitionをIssue本文に固定 HIGH | sibling hookがblockしたturnでTask Context mutationをどう扱うか未決定 | 「commit-on-submission」へ意味論を固定 HIGH | UserPromptSubmit fail-closed方針はClaude Codeの実failure semanticsと一致せず、UXも悪い | availability優先のdegraded/fail-openへ変更 HIGH | 無target promptでad-hoc Taskを作ると、次turnの本命Issue promptを自分でblockする | zero-ref ad-hoc Taskをprovisional/absorbentにする MEDIUM | Herdr projectionの「Tab name/metadata」が抽象的すぎる | tab rename + pane report-metadata --seq をそのまま利用 MEDIUM | #2564 runtime verificationと#2568の責務が循環気味 | #2564はminimal canary、Task Context E2Eは#2568へ MEDIUM | classifierのAMBIGUOUS時の挙動が未固定 | false-blockを避けるdecision tableを固定

    SessionEndも補助signalとして扱うべきです。公式のreasonは clear/resume/logout/prompt_input_exit/bypass_permissions_disabled/other で、default timeoutも1.5秒しかありません。(Claude)

    さらに2026年には /exit でSessionEndが発火しなかった報告や、print modeで発火しないopen bugもあります。(GitHub)

    したがって、

    「SessionEndが正常に来たこと」を次回restoreの必須条件にしない

    のが重要です。次回 SessionStart はstale open ExecutionRunを検出してself-heal/reconcileできる設計にしてください。

    これは防御機構ではなく、通常利用でbindingが詰まらないための可用性対策です。


    4. HIGH — sibling hook block時のmutation意味論を決め切る

    AC13まで追加されている点は改善されています。

    ただし、

    他handlerがpromptをblockしてもstate corruptionやcarry-overを起こさない

    だけでは、Task Context側で既にcommitしたautobind/rebindをrollbackすべきなのかが決まっていません。

    Claude Codeはmatching hooksをすべて並列実行します。(Claude)

    つまり、

    Task Context hook → autobind commit
    Spark hook        → prompt block

    は普通に起こり得ます。あとからTask Context hookが「兄弟hookの最終結果」を知るcallbackはありません。

    ここで2-phase commitやhook coordinatorを作るのは、この個人開発の目的に対して明らかに過剰です。

    推奨は commit-on-submission に固定することです。

    UserPromptSubmitで人間が明示的に送信したTask intent
        ↓
    Task Context自身のvalidationが成功
        ↓
    commit
    

    他の独立hookが別理由でpromptをblockしてもrollbackしない

    /task B も同様です。

    AC13も「corruptionしない」ではなく、例えば、

    Task Context hookが先/後どちらで完了しても、別handler block後のcanonical stateは同じTask Bとなり、pending authorization等は残存しない

    まで期待stateを固定した方がよいです。


    5. HIGH — fail-closed はこの用途には強すぎ、しかも完全には実現できない

    #2564 は、

    DB busy/corrupt時、UserPromptSubmitとguarded mutationのみfail-closed

    としています。

    しかしClaude Code公式仕様では、command型 UserPromptSubmit hookがtimeoutするとhookをcancelし、prompt自体はそのままClaudeへ渡ります。(Claude)

    つまりcommand hookである以上、

    「Task Contextが壊れたら必ずpromptを止める」という安全境界にはできません。

    しかも親はTask Contextをsecurity boundaryにしないことを明示しています。趣味開発で8セッションを回す運用なら、DBが一時的に200ms lockしただけで会話を止める方が害が大きいです。

    推奨policyは次です。

    ordinary prompt:
    DB unavailable → prompt pass
    → "Task Context degraded"を可視化
    → Task mutationはしない

    wrong-target判定まで正常に完了:
    definite mismatch → block

    /task B:
    persistence失敗 → /taskだけ明示failure
    切替成功を装わない

    hook timeoutはデフォルト30秒を使わず、500ms~1秒程度の短い上限を明示する方がよいです。core側のSQLite waiting budgetは既に200msなので整合します。

    この変更はセキュリティ弱化というより、Task Contextの本来の位置付けを「mistake-prevention」に戻すものです。


    6. HIGH — ad-hoc Taskが通常UXを自壊させる

    現行契約では、

    UNBOUND + GitHub targetなし
    → ad-hoc Task生成

    です。

    そしてACTIVE Taskにdifferent primary targetが来ればblockです。

    この2つを素直に組み合わせると、

    新しいTab

    User:
    「まずこのリポジトリの現状を見て」
    → ad-hoc Task A

    User:
    「じゃあIssue #2564を実装して」
    → different primary target
    → block
    → /task 2564 が必要

    となります。

    これは親の「普通にclaudeを起動して普通に使う」と真逆です。

    新しいschema fieldを増やす必要はありません。GitHub refが0件のTaskをprovisional扱いすれば十分です。

    ACTIVE Task
    かつ task_refs == 0
    かつ first high-confidence primary GitHub target
    ↓
    same Taskへそのrefをclaim
    ↓
    rebind扱いにしない

    その後、1つ以上primary refを持ったTaskだけdifferent-primary guard対象とします。

    これはかなり有用性が上がる修正です。


    7. MEDIUM — Herdr projectionは既存機能をそのまま使う

    #2564 の

    Herdr Tab name/metadataだけを更新

    は少し抽象的です。

    Herdrには現在、必要なprimitiveが既にあります。

    herdr tab rename があり、display-only metadataには herdr pane report-metadata が使えます。また --seq N により、同一sourceから遅れて届いた古いmetadataをHerdr自身が無視できます。(Herdr)

    したがって追加control-planeを作らず、

    DB transaction
    → projection_outbox revision=N

    async projection worker
    → live pane/tab resolve
    → herdr tab rename ...
    → herdr pane report-metadata --current
    --source task-context-v1
    --seq N
    --token task=#2564
    --token activity=impl
    --token attention=...
    → success
    → ack_projection(key, N)

    でよいです。

    coreには既にrevision-aware flush_projection() / conditional ack_projection() が存在します。

    ただしtyped CLIには現在 projection flush しか露出していないので、#2564でackをどう呼ぶかまで決めた方がよいです。service layer直接利用でも、CLIへのadditive operationでも構いません。曖昧なままだとoutboxが消えない実装が生まれます。

    Claude Code自身もnon-authoritativeな処理にはasync hookを用意しています。Herdr projectionはUserPromptSubmit hot pathから切り離すべきです。

    またHerdrのcustom $token は、ユーザー側sidebar configにtokenを配置して初めて見えます。(Herdr)
    したがって #2564の必須UXはTab label + Claude statusLineまで にし、Herdr custom metadata tokenはbest-effort enhancement程度が妥当です。


    8. MEDIUM — #2564 と #2568 のruntime verification責務を整理する

    #2568は、

    candidate Task Context hooks/statusLineをfresh Claude/Herdr runtimeで実行するisolated verifier

    そのものです。

    一方 #2564 もruntime verificationを immediate とし、「後続Task Context-specific runtime verifierからworktree-agent-runtime-smokeを利用」としています。

    ここは少し循環しています。

    推奨は、

    #2564:
    unit/integration tests

    • 現在のgeneric smokeだけで実現可能なminimal Native canary

    #2568:
    isolated Task Context DB

    • actual hooks
    • /clear
    • statusLine
    • wrong-target
    • Native/Claude-GPT
      の本格E2E

    です。

    現行 worktree-agent-runtime-smoke には既にfresh Claude runtimeや UserPromptExpansion の観測機能があります。

    #2564のためだけにgeneric harnessを増築する必要はありません。


    9. MEDIUM — classifierはfalse-positive blockを最小化すべき

    deterministic classifier + LLMなしは正しいです。

    ただし AMBIGUOUS のdecisionが明文化されていません。

    この仕組みの損失関数は、

    wrong Taskへ1 prompt投げる
    vs
    正常なpromptを頻繁に誤blockする

    であり、このプロジェクトでは後者もかなり高コストです。

    推奨policyは、

    /task                         → special-case
    single high-confidence same → PASS
    single high-confidence other → BLOCK
    REFERENCE_ONLY / NONE → PASS
    AMBIGUOUS → silent rebindしない
    原則PASS + advisory

    です。

    特に、

    「Issue #2564を実装する前に #2563 と #2562 の設計を比較して」

    のようなmulti-ref promptをblockしないfixtureを厚くすべきです。


    推奨する #2564 の実装形

    このIssueを巨大化する必要はありません。むしろ以下の5コンポーネント程度に抑えるのがよいです。

    1. UserPromptSubmit adapter
    
    
    • deterministic classifier
    • /task precedence
    • SQLite only
    • GitHub/Herdr/network I/Oなし
    • short timeout
    1. Session lifecycle adapter

      • startup/clear/compact/resume/fork matrix
      • stale ExecutionRun reconciliation
      • SessionEndはbest-effort
    2. statusLine renderer
      session_id
      ↓
      read-only query current
      ↓
      pure formatting + OSC8

    3. Herdr projection adapter

      • outbox consume
      • live --current resolution
      • tab rename/report-metadata
      • async
      • revision conditional ack
    4. deterministic tests

      • provisional ad-hoc absorption
      • pane move
      • compact/fork/resume
      • sibling block final-state

    cross-session messaging/securityは #2566、Claude-GPT carrierは #2567、isolated E2E harnessは #2568、cold restoreは #2569に残すべきです。#2566もTask Contextのsafe PreToolUse が既存permission semanticsを横取りしない方向なので、この分割と整合しています。

    最終評価

    Issue #2564の基本設計は維持してよいですが、現状のままimplementationへ渡すのは推奨しません。

    特に実装前に直すべきなのは、(1) statusLine用の真のread-only current-session query、(2) Herdr pane moveを考慮したlive locator、(3) SessionStart source matrix の3点です。この3点は実装後レビューで見つけると設計手戻りになります。

    その次に、fail-closedをdegraded/fail-open寄りへ変更し、zero-ref ad-hoc Taskを最初のIssue/PRへ自然吸収させるのが、この個人開発で最もUX改善効果が高いです。

    逆に、daemon、独自Herdr metadata service、hook coordinator、2-phase prompt transaction、新規汎用runtime harnessは追加しない方がよいです。現在のSQLite service、Claude hooks、Herdr --current / report-metadata --seq、既存runtime-smokeだけで十分成立します。

    ## 判定

    REQUEST_CHANGES です。ただし、設計の方向性は維持してよいです。

    親 #2562 の以前のレビューで問題だった /task <target> の precedence と、同一 UserPromptSubmit handler の並列実行問題は、現行 #2564 ではかなり適切に取り込まれています。さらに依存 #2563 は PR #2588 として既に merge 済みなので、実装着手の前提自体は満たされています。

    一方、現在の #2563 実装と最新 Claude Code / Herdr の実インターフェースまで突き合わせると、#2564 の契約だけでは実装者が誤った実装をしてもACを満たしたと解釈できる箇所が残っています。 #2564 自身には現在コメントがないため、直接コメントだけでなく親 #2562 のレビュー、#2563/#2566/#2567/#2568/#2570/#2571、PR #2588/#2579、現行repo資産を併せて評価しました。

    敵対的レビュー

    Severity Finding 推奨
    BLOCKER AC9 の statusLine → query current 契約が現行coreでは成立しない query current を session_id selector対応+真のread-only pathへ拡張
    BLOCKER HERDR_TAB_ID をlive locatorとして扱うとpane移動後にstaleになる durable Bindingとlive Herdr locator解決を明確に分離
    BLOCKER SessionStart lifecycle matrixが不足。compact/fork/resumeでBinding/ExecutionRunを壊せる source別transitionをIssue本文に固定
    HIGH sibling hookがblockしたturnでTask Context mutationをどう扱うか未決定 「commit-on-submission」へ意味論を固定
    HIGH UserPromptSubmit fail-closed方針はClaude Codeの実failure semanticsと一致せず、UXも悪い availability優先のdegraded/fail-openへ変更
    HIGH 無target promptでad-hoc Taskを作ると、次turnの本命Issue promptを自分でblockする zero-ref ad-hoc Taskをprovisional/absorbentにする
    MEDIUM Herdr projectionの「Tab name/metadata」が抽象的すぎる tab rename + pane report-metadata --seq をそのまま利用
    MEDIUM #2564 runtime verificationと#2568の責務が循環気味 #2564はminimal canary、Task Context E2Eは#2568へ
    MEDIUM classifierのAMBIGUOUS時の挙動が未固定 false-blockを避けるdecision tableを固定

    1. BLOCKER — statusLine は現状の query current を使えない

    #2564 は「statusLineは query current だけを消費するread-only renderer」とし、Task/PR/Activity/Attention/runtime locationを表示する契約です。

    ところが merge 済み #2563 の実装では、

    task-contextctl query current
        ↓
    task_id が必須
        ↓
    get_task(task_id)
        ↓
    返るのは Task だけ
    

    です。さらにCLIは全operationで _open_db_and_migrate() を呼びます。つまり statusLine から呼ぶと、DBがなければディレクトリ作成・DB open・WAL設定・migrationへ入れる構造です。

    一方Claude Codeのstatus line入力には、まさに安定した session_id が渡されます。公式もsession単位のキャッシュキーとして session_id を使う例を示しています。(Claude)

    coreには既に get_binding_by_current_session(claude_session_id) があり、session → Binding解決のphysical uniquenessも実装されています。

    したがって #2564 で次を明示的に契約化すべきです。

    query current {
        claude_session_id: S
    }
    
    → {
        binding,
        task,
        current_activity,
        open_operator_run,
        task_refs,
        runtime_location,
        runtime_health,
        attention
    }
    

    さらに query current 用に、

    connect_readonly()
      SQLite URI mode=ro
      PRAGMA query_only=ON
      mkdirしない
      journal_modeを変更しない
      migrationしない
    

    を追加するのがよいです。DB未作成なら空statusを返すだけにする。

    これはschema破壊ではありません。PR #2588 自身が、後続 #2564 等ではrequest/result envelopeを変えずに payload / data のadditive extensionを行う前提を明記しています。

    これを直さない限りAC9は実装仕様として不足しています。


    2. BLOCKER — HERDR_TAB_ID はlive Tab identityではない

    これは今回のレビューで特に重要です。

    #2564 は、

    • HERDR_TAB_ID がなければnon-Herdr observe-only
    • RuntimeLocationはmutable
    • Herdr Tab labelをTask Contextから更新

    としています。

    ところがHerdr公式仕様では、paneをmoveするとworkspace-qualified pane ID自体が変わります。またrunning processは起動時のHerdr environmentを保持します。その一方で、旧 HERDR_PANE_ID はterminalへのaliasとして維持されるため --current は安全に使える、と明記されています。(Herdr)

    つまり起動時の

    HERDR_TAB_ID=w1:t1
    

    をprojection targetとして保存すると、

    paneをw1:t1からw1:t4へmove
    ↓
    ClaudeのenvはHERDR_TAB_ID=w1:t1のまま
    ↓
    Taskは同じ
    ↓
    projectionだけ旧tabをrename
    

    という事故が成立します。

    これはまさに親 #2562 が禁止している「tab positionをidentityとして扱う」に近いfailure modeです。

    推奨は、

    Binding ID = durable identity
    
    HERDR_PANE_ID / alias
        ↓
    Herdr --current / current pane lookup
        ↓
    現在のworkspace/tab/paneをside effect直前に解決
        ↓
    Tab rename / metadata projection
    

    です。

    #2564へ新しいACを1つ追加すべきです。

    live operator paneを別TabまたはWorkspaceへmoveした後もTask/Activity/Bindingは不変であり、次回projectionは旧Tabではなく移動先のcurrent Tabへ追従する。

    新daemonも監視serviceも不要です。projection時のlate bindingだけで十分です。


    3. BLOCKER — SessionStart のsource matrixを固定すべき

    最新Claude Codeの SessionStart は単なる「起動時」hookではありません。現在の公式sourceは、

    startup / resume / clear / compact / fork

    です。auto/manual compactionでも SessionStart(source=compact) が発火します。forkには /fork、/branch、--fork-session 等も含まれます。(Claude)

    ところが #2564 は /clear と /quit のsemanticsはかなり詳しく定義していますが、compact / fork / ordinary resume のTask Context semanticsを固定していません。

    これは実装者次第で、

    auto compact
    → SessionStart
    → 新しいmanaged ExecutionRunをstart
    → 既存open runとunique constraint衝突
    

    になり得ます。coreは1 Bindingあたりopen managed operator runを最大1に物理制約しています。

    私は次のmatrixを固定します。

    SessionStart.source Task Context動作
    startup Binding recovery/create + operator run reconciliation
    clear Task/Activity/Binding維持、旧run終了→new run
    compact context再注入のみ。Task/Binding/run identity mutationなし
    resume session_idをstrong anchorとして既存Binding/runをreconcile
    fork v1ではoperator Bindingを継承しない。observe-onlyまたは明示的UNBOUND

    SessionEndも補助signalとして扱うべきです。公式のreasonは clear/resume/logout/prompt_input_exit/bypass_permissions_disabled/other で、default timeoutも1.5秒しかありません。([Claude]3)

    さらに2026年には /exit でSessionEndが発火しなかった報告や、print modeで発火しないopen bugもあります。([GitHub]4)

    したがって、

    「SessionEndが正常に来たこと」を次回restoreの必須条件にしない

    のが重要です。次回 SessionStart はstale open ExecutionRunを検出してself-heal/reconcileできる設計にしてください。

    これは防御機構ではなく、通常利用でbindingが詰まらないための可用性対策です。


    4. HIGH — sibling hook block時のmutation意味論を決め切る

    AC13まで追加されている点は改善されています。

    ただし、

    他handlerがpromptをblockしてもstate corruptionやcarry-overを起こさない

    だけでは、Task Context側で既にcommitしたautobind/rebindをrollbackすべきなのかが決まっていません。

    Claude Codeはmatching hooksをすべて並列実行します。(Claude)

    つまり、

    Task Context hook → autobind commit
    Spark hook        → prompt block
    

    は普通に起こり得ます。あとからTask Context hookが「兄弟hookの最終結果」を知るcallbackはありません。

    ここで2-phase commitやhook coordinatorを作るのは、この個人開発の目的に対して明らかに過剰です。

    推奨は commit-on-submission に固定することです。

    UserPromptSubmitで人間が明示的に送信したTask intent
        ↓
    Task Context自身のvalidationが成功
        ↓
    commit
    
    他の独立hookが別理由でpromptをblockしてもrollbackしない
    

    /task B も同様です。

    AC13も「corruptionしない」ではなく、例えば、

    Task Context hookが先/後どちらで完了しても、別handler block後のcanonical stateは同じTask Bとなり、pending authorization等は残存しない

    まで期待stateを固定した方がよいです。


    5. HIGH — fail-closed はこの用途には強すぎ、しかも完全には実現できない

    #2564 は、

    DB busy/corrupt時、UserPromptSubmitとguarded mutationのみfail-closed

    としています。

    しかしClaude Code公式仕様では、command型 UserPromptSubmit hookがtimeoutするとhookをcancelし、prompt自体はそのままClaudeへ渡ります。(Claude)

    つまりcommand hookである以上、

    「Task Contextが壊れたら必ずpromptを止める」という安全境界にはできません。

    しかも親はTask Contextをsecurity boundaryにしないことを明示しています。趣味開発で8セッションを回す運用なら、DBが一時的に200ms lockしただけで会話を止める方が害が大きいです。

    推奨policyは次です。

    ordinary prompt:
      DB unavailable → prompt pass
                     → "Task Context degraded"を可視化
                     → Task mutationはしない
    
    wrong-target判定まで正常に完了:
      definite mismatch → block
    
    /task B:
      persistence失敗 → /taskだけ明示failure
      切替成功を装わない
    

    hook timeoutはデフォルト30秒を使わず、500ms~1秒程度の短い上限を明示する方がよいです。core側のSQLite waiting budgetは既に200msなので整合します。

    この変更はセキュリティ弱化というより、Task Contextの本来の位置付けを「mistake-prevention」に戻すものです。


    6. HIGH — ad-hoc Taskが通常UXを自壊させる

    現行契約では、

    UNBOUND + GitHub targetなし
    → ad-hoc Task生成
    

    です。

    そしてACTIVE Taskにdifferent primary targetが来ればblockです。

    この2つを素直に組み合わせると、

    新しいTab
    
    User:
    「まずこのリポジトリの現状を見て」
    → ad-hoc Task A
    
    User:
    「じゃあIssue #2564を実装して」
    → different primary target
    → block
    → /task 2564 が必要
    

    となります。

    これは親の「普通にclaudeを起動して普通に使う」と真逆です。

    新しいschema fieldを増やす必要はありません。GitHub refが0件のTaskをprovisional扱いすれば十分です。

    ACTIVE Task
    かつ task_refs == 0
    かつ first high-confidence primary GitHub target
        ↓
    same Taskへそのrefをclaim
        ↓
    rebind扱いにしない
    

    その後、1つ以上primary refを持ったTaskだけdifferent-primary guard対象とします。

    これはかなり有用性が上がる修正です。


    7. MEDIUM — Herdr projectionは既存機能をそのまま使う

    #2564 の

    Herdr Tab name/metadataだけを更新

    は少し抽象的です。

    Herdrには現在、必要なprimitiveが既にあります。

    herdr tab rename があり、display-only metadataには herdr pane report-metadata が使えます。また --seq N により、同一sourceから遅れて届いた古いmetadataをHerdr自身が無視できます。(Herdr)

    したがって追加control-planeを作らず、

    DB transaction
      → projection_outbox revision=N
    
    async projection worker
      → live pane/tab resolve
      → herdr tab rename ...
      → herdr pane report-metadata --current
           --source task-context-v1
           --seq N
           --token task=#2564
           --token activity=impl
           --token attention=...
      → success
      → ack_projection(key, N)
    

    でよいです。

    coreには既にrevision-aware flush_projection() / conditional ack_projection() が存在します。

    ただしtyped CLIには現在 projection flush しか露出していないので、#2564でackをどう呼ぶかまで決めた方がよいです。service layer直接利用でも、CLIへのadditive operationでも構いません。曖昧なままだとoutboxが消えない実装が生まれます。

    Claude Code自身もnon-authoritativeな処理にはasync hookを用意しています。Herdr projectionはUserPromptSubmit hot pathから切り離すべきです。

    またHerdrのcustom $token は、ユーザー側sidebar configにtokenを配置して初めて見えます。(Herdr)
    したがって #2564の必須UXはTab label + Claude statusLineまで にし、Herdr custom metadata tokenはbest-effort enhancement程度が妥当です。


    8. MEDIUM — #2564 と #2568 のruntime verification責務を整理する

    #2568は、

    candidate Task Context hooks/statusLineをfresh Claude/Herdr runtimeで実行するisolated verifier

    そのものです。

    一方 #2564 もruntime verificationを immediate とし、「後続Task Context-specific runtime verifierからworktree-agent-runtime-smokeを利用」としています。

    ここは少し循環しています。

    推奨は、

    #2564:
      unit/integration tests
      + 現在のgeneric smokeだけで実現可能なminimal Native canary
    
    #2568:
      isolated Task Context DB
      + actual hooks
      + /clear
      + statusLine
      + wrong-target
      + Native/Claude-GPT
      の本格E2E
    

    です。

    現行 worktree-agent-runtime-smoke には既にfresh Claude runtimeや UserPromptExpansion の観測機能があります。

    #2564のためだけにgeneric harnessを増築する必要はありません。


    9. MEDIUM — classifierはfalse-positive blockを最小化すべき

    deterministic classifier + LLMなしは正しいです。

    ただし AMBIGUOUS のdecisionが明文化されていません。

    この仕組みの損失関数は、

    wrong Taskへ1 prompt投げる
    vs
    正常なpromptを頻繁に誤blockする
    

    であり、このプロジェクトでは後者もかなり高コストです。

    推奨policyは、

    /task                         → special-case
    single high-confidence same  → PASS
    single high-confidence other → BLOCK
    REFERENCE_ONLY / NONE        → PASS
    AMBIGUOUS                    → silent rebindしない
                                   原則PASS + advisory
    

    です。

    特に、

    「Issue #2564を実装する前に #2563 と #2562 の設計を比較して」

    のようなmulti-ref promptをblockしないfixtureを厚くすべきです。


    推奨する #2564 の実装形

    このIssueを巨大化する必要はありません。むしろ以下の5コンポーネント程度に抑えるのがよいです。

    1. UserPromptSubmit adapter
       - deterministic classifier
       - /task precedence
       - SQLite only
       - GitHub/Herdr/network I/Oなし
       - short timeout
    
    2. Session lifecycle adapter
       - startup/clear/compact/resume/fork matrix
       - stale ExecutionRun reconciliation
       - SessionEndはbest-effort
    
    3. statusLine renderer
       session_id
          ↓
       read-only query current
          ↓
       pure formatting + OSC8
    
    4. Herdr projection adapter
       - outbox consume
       - live --current resolution
       - tab rename/report-metadata
       - async
       - revision conditional ack
    
    5. deterministic tests
       - provisional ad-hoc absorption
       - pane move
       - compact/fork/resume
       - sibling block final-state
    

    cross-session messaging/securityは #2566、Claude-GPT carrierは #2567、isolated E2E harnessは #2568、cold restoreは #2569に残すべきです。#2566もTask Contextのsafe PreToolUse が既存permission semanticsを横取りしない方向なので、この分割と整合しています。

    最終評価

    Issue #2564の基本設計は維持してよいですが、現状のままimplementationへ渡すのは推奨しません。

    特に実装前に直すべきなのは、(1) statusLine用の真のread-only current-session query、(2) Herdr pane moveを考慮したlive locator、(3) SessionStart source matrix の3点です。この3点は実装後レビューで見つけると設計手戻りになります。

    その次に、fail-closedをdegraded/fail-open寄りへ変更し、zero-ref ad-hoc Taskを最初のIssue/PRへ自然吸収させるのが、この個人開発で最もUX改善効果が高いです。

    逆に、daemon、独自Herdr metadata service、hook coordinator、2-phase prompt transaction、新規汎用runtime harnessは追加しない方がよいです。現在のSQLite service、Claude hooks、Herdr --current / report-metadata --seq、既存runtime-smokeだけで十分成立します。

  2. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    推奨は、#5612090902 を OWNER の direct human context として固定し、Issue #2564 の契約更新→fresh review→readiness まで issue-refinement-loop の canonical routeで自動完走させることです。

    現状、#2564 は open で、対象コメントは REQUEST_CHANGES。主な修正対象は statusLine/read-only query、Herdr locator、SessionStart lifecycle の3 BLOCKERに加え、commit-on-submission、degraded/fail-open、provisional ad-hoc Task等です。 依存 #2563 の PR #2588 は既に merge 済みなので、dependency待ちを理由に止める必要はありません。

    issue-refinement-loop 自体も iteration approval はデフォルト不要で、direct human context の anchor は preflight.run.with_human_context → contract_update.run.with_human_context が正規経路です。issue_editor_required なら同じ contract update を再試行せず controlled issue-editor routeへ移り、その後 fresh readback/review/readiness を通します。 codebase-investigator / web-researcher が planner 上 required なら SubAgent として起動し、両方必要なら並列化しても Step 2 前に必ず両方の完了を待つのが現行契約です。

    既に auto mode なら、Claude Code の permission mode を変更する指示は不要です。以下をそのまま投入するのがよいです。

    あなたは既に auto mode で起動済みの対話的 Claude Code です。

    対象リポジトリ:
    https://github.com/squne121/loop-protocol

    対象 Issue:
    #2564

    今回の authoritative human-context anchor:
    #2564 (comment)

    .claude/skills/issue-refinement-loop を canonical control-plane として使用し、Issue #2564 の refinement loop を実行してください。

    実行方針

    • 人間への iteration approval / rewrite approval / SubAgent dispatch approval は求めない。
    • 現在の Claude Code auto mode / permission mode は変更しない。/permission 等を要求しない。
    • issue-refinement-loop の planner / reviewer / router / worker の SSOTをそのまま consumeし、main threadで独自の判定ロジックを再実装しない。
    • max_iterations は skill の既定値 3 を使用する。
    • 対象コメントは OWNER が明示的に与えた direct human context として扱う。
    • REQUEST_CHANGES であること自体を human escalation の理由にしない。
    • refinement が承認されるまで実装コードを先走って変更しない。承認後の handoff は skill の canonical Step 5 / root transition に従う。

    Anchor comment の canonical handling

    最初に .claude/skills/issue-refinement-loop/SKILL.md と、そこから必要と指定された references を progressive disclosure で読むこと。

    今回の anchor は direct human context なので、canonical main root / default branch から、skill が定義する preflight.run.with_human_context profile を使用すること。

    以下を使用してはならない:

    • unlabeled preflight.run.with_anchor
    • preflight.run.with_agent_report
    • production gateを迂回した run_refinement_preflight.py の直接実行
    • anchor URLだけからoriginを独自推定する処理

    preflight.run.with_human_context が trusted contract patch plan を生成した場合は、main/root control-plane が canonical contract_update.run.with_human_context を実行すること。

    NEXT_ACTION: issue_editor_required が返った場合:

    • 同一 contract_update.run.with_human_context をno-progress再実行しない。
    • anchor commentを再投稿しない。
    • canonical controlled issue-editor routeへhandoffする。
    • issue-editor SubAgentの作業完了を必ず待つ。
    • mutation後、body/title readback → fresh preflight → fresh review → fresh readiness の各gateを通すまで approved / implementation-ready と扱わない。

    今回の refinement で解消すべきレビュー事項

    対象anchorの全文をauthorityとしてfact-checkしたうえで、少なくとも以下をIssue契約へ反映すること。

    1. statusLine / query current

      • 現行coreとの契約不整合を解消する。
      • session_id selector を含め、statusLineから安全に現在Taskを特定できる真のread-only query pathを固定する。
      • queryによるDB mutation、migration side effect、GitHub/Herdr mutationを発生させない。
    2. durable Binding と live Herdr locator の分離

      • HERDR_TAB_ID 等のlive locatorをTask/Binding identityとして扱わない。
      • pane/tab移動後もdurable Task/Activity/Binding identityが維持されるよう、live Herdr locationの再解決責務を明文化する。
    3. SessionStart lifecycle matrix

      • startup/resume/compact/fork等、実際のClaude Code SessionStart sourceごとのtransitionを固定する。
      • BindingとExecutionRunの新規作成・継承・切替・reconcileを曖昧にしない。
      • SessionEnd の正常到着をrestoreの必須条件にしない。
      • 次のSessionStartでstale open ExecutionRunをself-heal/reconcile可能にする。
    4. sibling UserPromptSubmit hooks

      • Task Context mutation semanticsを commit-on-submission として固定する。
      • Task Context自身のvalidation後にcommitされたautobind/rebindは、独立したsibling hookが同じpromptをblockしてもrollbackしない。
      • hook完了順に依存せずcanonical final stateが一致することをAC/testへ落とす。
      • pending authorization等を次turnへcarry-overしない。
    5. DB unavailable時のavailability policy

      • ordinary promptでは Task Context DB busy/unavailable/corrupt等をsecurity boundaryとして扱わない。
      • persistence不能時はTask mutationを行わず、degraded状態を可視化し、可能な範囲でpromptをpassする方針を検討・固定する。
      • definite wrong-target判定が正常に成立した場合だけblockする。
      • /task B 自身のpersistenceが失敗した場合はswitch成功を装わず、その /task 操作を明示failureにする。
      • Claude Code hook timeout semanticsとcore SQLite waiting budgetを踏まえてbounded timeoutを明示する。
    6. zero-ref ad-hoc Task

      • GitHub refを持たない初期ad-hoc Taskを provisional / absorbent として扱う。
      • first high-confidence primary GitHub targetを同一Taskへclaimできるようにし、通常利用で不要な /task rebindを要求しない。
      • primary ref確定後のみdifferent-primary guardを通常適用する。
    7. Herdr projection

      • 既存Herdr primitivesを優先し、新しいcontrol-planeを増やさない。
      • herdr tab rename
      • herdr pane report-metadata
      • revision/sequence (--seq)
        を利用する方向で契約を具体化する。
      • projection outbox commitとHerdr反映を分離する。
      • ack_projectionをどの既存service/CLI pathから実行するか曖昧にしない。
      • Herdr custom metadata tokenはbest-effortとし、必須UXは少なくともTab label + Claude statusLineとする。
      • projectionをUserPromptSubmit hot pathへ同期的に抱え込まない。
    8. runtime verification責務

    9. deterministic classifier

      • /task special-caseを最優先。
      • single high-confidence same target → PASS
      • single high-confidence different target → BLOCK
      • REFERENCE_ONLY / NONE → PASS
      • AMBIGUOUS → silent rebind/blockを避け、原則PASS + advisory
        というfalse-positive最小化のdecision semanticsをIssue上で固定する。
      • 実際のrepo契約とanchor全文を確認し、より正確な既存decision tableがある場合はそのSSOTへ整合させる。

    SubAgent

    SubAgentを使用すること。

    REFINEMENT_LOOP_PLAN_V1 が investigation required とした場合は canonical codebase-investigator SubAgentを使用し、以下を現行mainから検証させること:

    anchor内のClaude Code hooks / Herdr interface等のexternal claimsについて planner が web research required とした場合は canonical web-researcher SubAgentを使用し、一次資料を優先して検証させること。

    codebase-investigator と web-researcher の両方がrequiredなら並列実行してよい。

    ただし、起動したすべてのSubAgentの作業完了を必ず待ち、結果をjoinしてからStep 2へ進むこと。
    SubAgentをfire-and-forgetにしない。

    plannerがrequired=falseと判定したSubAgentを、main threadの独自判断で無理に起動してcontrol-plane契約を破らないこと。

    canonical Step 2のroot reviewはmain/root-owned pipelineの責務であり、issue-reviewer SubAgentへ置き換えない。

    Loop continuation

    review結果が needs-fix / request_changes であり iteration budget内なら、人間への確認なしでIssue rewriteへ進み、再reviewすること。

    各rewrite後は、skillのrouter/readback/final-review gateを必ず使用する。

    以下を独自判断で省略しない:

    • post-mutation readback
    • fresh review
    • final review gate
    • readiness
    • dependency/materialization gate
    • canonical termination reporting

    canonical_step2_route 等、producerが返すcanonical routing authorityをそのまま使用し、verdictやstdoutからmain threadが独自にrouteを再構築しない。

    Human escalationについて

    この依頼自体を「各iterationの人間承認」として再要求してはならない。

    anchor commentですでに明示されている判断について再度人間へ質問しない。

    ただし、SSOT control-planeが実際に以下のような回復不能状態を返した場合は、承認されたふりをして進めず、そのexact reason/evidenceを残して停止すること:

    • genuine human_judgment_required
    • operator intervention required でcanonical autonomous recoveryが存在しない
    • environment/integrity failure
    • destructive operationが必要
    • secret/credential入力が必要
    • skillが明示的に禁止するscope expansion

    単なるREQUEST_CHANGES、通常のrewrite継続、SubAgent実行、Issue本文更新、fresh reviewをhuman escalationへ格上げしない。

    Approved termination

    Issue #2564 がapproved/readiness satisfiedとなったら .claude/skills/issue-refinement-loop の現行Step 4.5 / Step 5契約に従うこと。

    issue_kind: implementation のため、skillが要求する dependency gate / LOOP_HANDOFF_RESULT_V1 / root transitionを省略しない。

    root transitionが invoked: true を返し、現行skill契約が同一turnで impl-review-loop handoffを要求する場合は、そのcanonical handoffに従うこと。refinement main threadから独自の実装開始経路を作らない。

    最終報告

    完了時は簡潔に以下を報告すること:

    • refinement loopのtermination reason
    • iteration数
    • Issue #2564本文を変更したか
    • anchor commentの各BLOCKER/HIGH/MEDIUMがどう契約化されたか
    • 実行したSubAgentとその完了結果
    • final review/readiness結果
    • unresolved blocker
    • implementation handoffが発生したか
    • 発生した場合はhandoff先と状態

    途中で通常の承認確認を挟まず、canonical control-planeが許す範囲で最後まで自律実行してください。

    この形なら、今回のレビューを「また人間判断が必要な曖昧コメント」と扱わせず、trusted human-context → contract update → refinement の正規経路へ直接載せられます。特に with_anchor ではなく with_human_context を明示している点が重要です。

  3. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

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

    iteration: 0(rewrite 未実行)
    termination_cause: human_judgment_required
    blockers_summary: scope_signal_guard_triggered, scope_signal_guard_reason_code:new_allowed_path_layer

    経緯

    1. Step 0f Preflight(preflight.run.with_human_context): STATUS: pass / NEXT_ACTION: proceed。anchor comment(本 Issue 実装: Native Claude operatorにTask Context hooks・wrong-session guard・statusLine/Herdr projectionを配線する #2564 の OWNER 敵対的レビュー、BLOCKER3/HIGH3/MEDIUM3)を snapshot 固定。

    2. Step 1 Investigation(codebase-investigator)+ Step 1b Web Research(web-researcher)を並列実行し join。

      • web-researcher が Anthropic 公式ドキュメントで anchor comment の外部 claim を fact-check: SessionStart の source 種別(startup/resume/clear/compact/fork)、UserPromptSubmit hook の並列実行・no-rollback 意味論、hook timeout(UserPromptSubmit 既定 30 秒、SessionEnd 1.5 秒)を確認。
      • codebase-investigator の delegation 結果は evidence 不足で大半が未確認だったため、control-plane(本セッション)が .claude/settings.json / scripts/task-context/task_contextctl.py / task_context_service.py / task_context_db.py を直接読み、anchor comment の BLOCKER1(query current は task_id 必須で get_task() のみを返し、_open_db_and_migrate() を全 operation で無条件に通るため真の read-only path が存在しない)を実コードで確認した。get_binding_by_current_session() と runtime_locations(durable Binding とは別の mutable location テーブル)は既に core に存在することも確認した。DEFAULT_BUSY_TIMEOUT_MS = 200 も anchor comment の記述と一致。projection flush のみが CLI 露出済みで ack_projection() は service layer 止まりであることも確認した。
      • AGY delegation が repo root に残した一時ファイル(.2564-delegation-*.json 等)は cleanup 済み。
    3. Step 2 Review(run_root_review_pipeline.py produce): canonical_step2_route: step_2_5(deterministic checker VERDICT: approve、non-blocking improvement 1 件のみ)。

    4. Step 2.5 Semantic Design Review(issue-design-reviewer SubAgent、pinned body_sha256=29cab9ee...): assessment: findings、BLOCKER 3 / HIGH 3 / MEDIUM 3 の 9 finding。anchor comment の BLOCKER1-3 / HIGH4-6 / MEDIUM7-9 の指摘が pinned body の AC/In Scope/Stop Conditions レベルではまだ固定されていないと判定。join_review_results.py → effective_verdict: needs-fix(rewrite_lane: semantic、blocker/high 6 件が rewrite 対象)。

    5. rewrite 前の next-action 決定として decide_next_loop_action.py を実行したところ、canonical Priority 3(scope_signal_guard hard stop)が発火した:

      STATUS: human_escalation
      NEXT_ACTION: human_escalation
      TERMINATION_CAUSE: human_judgment_required
      BLOCKERS: scope_signal_guard_triggered
      BLOCKERS: scope_signal_guard_reason_code:new_allowed_path_layer
      

      REFINEMENT_LOOP_PLAN_V1.decisions.scope_signal_guard(legacy 検出器)は triggered: true / reason_code: new_allowed_path_layer / excluded_by_anchor_reframe: false を返した。anchor comment は OWNER による直接 human context だが、ANCHOR_SCOPE_REFRAME_V1 の copy/paste template 形式ではない自由記述の敵対的レビューであるため、scope_delta_decision.status: not_applicable(no_anchor_scope_reframe_v1_payload)となり、シグナルは anchor reframe によって除外されない。

    未解決の懸念(human 判断が必要な理由)

    新旧 scope signal detector 間の不一致が確認された。同一 body に対して:

    • legacy decisions.scope_signal_guard: triggered: true(new_allowed_path_layer)
    • v2 scope_signal_guard_decision_v2.raw_signal: triggered: false(no_scope_signal)

    が同時に出力されている。references/scope-signal-guard.md によれば new_allowed_path_layer は「after.allowed_path_layers - before.allowed_path_layers が非空の場合のみ発火する」設計だが、Issue 本文の ## Current Validated Scope(write-capable scope 列挙)と ## Allowed Paths は同一の 5 パスで一致しており、明らかな新規レイヤー追加は本文上に見当たらない。本セッションはこの矛盾を独自判断で解消せず(plan_refinement_loop.py の判定ロジックを SKILL.md に再実装しない、hard stop を bypass しない、という skill の禁止事項に従う)、fact として報告するに留める。

    Owner 向け推奨アクション(いずれか)

    1. references/scope-signal-guard.md の ANCHOR_SCOPE_REFRAME_V1 copy/paste template で本 Issue の scope delta(.claude/skills/task/** 等)を明示承認する comment を投稿し、loop を再実行する。
    2. legacy _detect_scope_signals() と v2 scope_signal_delta.py の new_allowed_path_layer 判定不一致自体を別 Issue として調査する。
    3. 上記のいずれかを経ず、この hard stop を意図的に無視してよいと判断する場合は、その判断を明示的に記録した上で loop を再実行する。

    Step 2.5 が特定した rewrite 対象(loop 再開時にそのまま使用可能)

    .claude/artifacts/issue-refinement-loop/2564/8427ca62719cd22d/semantic_review_result.json に、anchor comment の BLOCKER1-3・HIGH4-6(statusLine query current の session_id selector 化・真の read-only path、HERDR_TAB_ID と durable Binding の分離、SessionStart source matrix、sibling hook の commit-on-submission 固定、fail-closed→degraded/fail-open 方針、zero-ref ad-hoc Task の provisional/absorbent 化)に対応する 6 件の blocker/high finding と recommended_fix が保存済み。MEDIUM 3 件(Herdr projection 既存 primitive 利用、#2564/#2568 責務分離、classifier AMBIGUOUS 挙動)も findings に含まれる。

    未起動 SubAgent

    plan_refinement_loop.py の investigation_policy.required: true / web_research_policy.required: true を受けて codebase-investigator と web-researcher を並列起動し、両方の完了を待って join した。issue-design-reviewer は Step 2.5 で起動し完了済み。issue-editor は rewrite 未実行のため未起動。

    本文変更

    Issue #2564 の本文(body_sha256=29cab9ee1833407ca56831d9af7b7e1c2e12a7290cd57bb4ec85a13c76fb4327)は変更していない。

    Implementation Handoff

    発生しない(approved 終了ではないため LOOP_HANDOFF_RESULT_V1 / impl-review-loop handoff は対象外)。

  4. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    推奨は、ANCHOR_SCOPE_REFRAME_V1 で存在しない scope expansion を承認するのではなく、今回の対話指示そのものを OWNER directive として canonical に materialize し、with_human_context lane から refinement を再開することです。

    前回は investigation / web research / semantic review の SubAgent までは join 済みですが、scope guard で rewrite 前に停止したため issue-editor は未起動でした。 現在の Issue 本文では Current Validated Scope と Allowed Paths が同じ5パスであり、今回必要なのは基本的にその範囲内での契約具体化です。

    特に重要なのは、現行 issue-refinement-loop 自身が operator-selected human context について、exact path が必要なら codebase-investigator で導出して再判定し、full rewrite が必要なら issue_editor_required へ進め、人間に手書き ANCHOR_SCOPE_REFRAME_V1 を再入力させてはならないと規定している点です。 また、対話で受領した人間指示を control-plane がコメント化するための OWNER_DIRECTIVE_MATERIALIZED_FROM_INTERACTIVE_PROMPT_V1 provenance marker も現行契約にあります。

    設計判断も先に固定してよいです。Claude Code公式仕様では、matching hooks は並列実行され、SessionStart は startup/resume/clear/compact/fork を区別します。([Claude]1) UserPromptSubmit command hook は既定30秒ですが、timeoutすると出力が破棄され、prompt自体はClaudeへ進むため、「DB障害時にも必ずfail-closed」は実仕様上成立しません。([Claude]1) status line入力の session_id はsession lifetime中安定・一意と公式に説明されているので、query current のselectorとして使う方向も妥当です。([Claude]2)

    以下を、そのまま既に auto mode の Claude Code に渡すのを推奨します。

    あなたは既に auto mode で起動済みの対話的 Claude Code です。

    対象リポジトリ:

    https://github.com/squne121/loop-protocol

    対象 Issue:

    https://github.com/squne121/loop-protocol/issues/2564

    今回の停止報告:

    https://github.com/squne121/loop-protocol/issues/2564#issuecomment-5612432362

    元の敵対的レビュー:

    https://github.com/squne121/loop-protocol/issues/2564#issuecomment-5612090902

    目的は、.claude/skills/issue-refinement-loop を 通常の iteration 承認確認なしで自律実行し、Issue #2564 を approved/readiness satisfied まで持っていくことです。

    Claude Code の permission mode / auto mode 自体を変更しないでください。既に起動している現在の auto mode をそのまま使用してください。

    通常の rewrite、SubAgent 起動、Issue 本文更新、fresh review、readback、readiness、bounded retry の途中で人間承認を求めないでください。

    1. 最初に現行 Skill 契約を確認する

    最初に current main の

    .claude/skills/issue-refinement-loop/SKILL.md

    を読み、必要になった reference だけを progressive disclosure で読むこと。

    少なくとも今回必要になった時点で以下を参照すること。

    • references/anchor-comment-handling.md
    • references/scope-signal-guard.md
    • references/semantic-design-review.md
    • references/loop-state.md
    • references/termination-policy.md
    • references/follow-up-materialization.md

    planner / router の判断ロジックを prose で再実装しないこと。
    plan_refinement_loop.py、canonical preflight、rewrite router、next-action router の出力を authority とすること。

    古い artifact / planner input / loop state を無条件再利用せず、current Issue body / current main / current comment snapshot に対して fresh producer を使うこと。

    2. authority / origin の扱い

    issuecomment-5612432362 は前回実行が生成した termination / diagnostic report として扱うこと。
    author_association=OWNER だけを理由に direct human authority とみなさないこと。

    issuecomment-5612090902 は今回解消すべき敵対的レビュー evidence として扱うこと。

    そして、この対話プロンプト自体を direct interactive human instruction として扱うこと。

    今回の設計判断はこのプロンプト内で明示的に確定するため、後段で同じ事項について人間へ再確認しないこと。

    canonical authority を GitHub comment として永続化する必要がある場合は、root control-plane が Issue #2564 へこの指示を materialize すること。

    その場合は現行 repository の controlled Issue-comment mutation laneを使用し、少なくとも次の provenance marker を付けること。

    <!-- OWNER_DIRECTIVE_MATERIALIZED_FROM_INTERACTIVE_PROMPT_V1
    source_kind: direct_interactive_human_instruction
    -->

    materialize した comment には、後述する「Owner decisions」を top-level の明示的な bullet directive として含めること。

    存在しない scope expansion を捏造するために ANCHOR_SCOPE_REFRAME_V1 を投稿してはならない。

    今回の Owner decision は「現在の5つの Allowed Paths を維持したまま契約を具体化する」であり、新しい Allowed Path layer を追加する判断ではない。

    materialized comment を作成した場合、その canonical comment URL を
    preflight.run.with_human_context
    および必要な
    contract_update.run.with_human_context
    の human-context source として使用すること。

    3. Owner decisions — 今回ここで確定する設計判断

    以下は human judgment 待ちにせず、Issue #2564 の契約へ反映すること。

    A. Allowed Paths

    write-capable scope は次の 既存5パスのまま固定する。

    • .claude/settings.json
    • .claude/hooks/task_context_*
    • .claude/skills/task/**
    • scripts/task-context/**
    • tests/task-context/**

    これら以外へ scope を拡張しない。

    ただし、scripts/task-context/** と tests/task-context/** 内で必要になる additive な typed API / CLI operation の追加は #2564 の実装範囲として許可する。

    特に query current の session selector、真の read-only query path、projection ack operation は、breaking schema migrationを伴わない限り「#2563のtyped APIを触るから即Stop」としないよう Issue 契約を修正する。

    breaking schema migration、既存契約の非互換変更、Allowed Paths外の変更が本当に必要なら、その時点ではじめて Stop Condition とする。

    B. statusLine / query current

    statusLine は Claude Code から受け取る stable session_id を selector として current Task Context を解決する。

    query current は少なくとも、

    session_id -> Binding -> Task / Activity / Attention / RuntimeLocation / runtime health

    を返せる additive query とする。

    statusLine path は 真に read-only とする。

    DB queryのために、

    • DB directory作成
    • DB新規作成
    • migration
    • WAL設定などのwrite-capable initialization
    • projection mutation
    • GitHub fetch
    • Herdr mutation

    を行わない。

    read-only open不能またはDB未作成なら、空/degraded statusを返し、DBを作成しない。

    既存service SQLを hook/statusLine 側へ重複実装しない。

    C. durable Binding と live Herdr location

    Binding identity と HERDR_TAB_ID / pane / workspace 等の live locator を分離する。

    binding_id は durable identity。

    Herdr tab/pane/workspace location は mutable RuntimeLocation observation とする。

    operator pane が別Tab / Workspaceへmoveしても Task / Activity / Binding identityは変化しない。

    Herdrへのprojection直前に current live pane/tabを解決し、staleな旧Tabを更新しない。

    HERDR_TAB_ID を durable Task/Binding primary keyへ昇格しない。

    D. SessionStart lifecycle matrix

    Issue契約へ startup / resume / clear / compact / fork の挙動を明示する。

    基本方針を以下で固定する。

    startup:
    既存のrecoverable/suspended Bindingがcurrent live operator locationから決定的に解決できれば復元する。
    それ以外は通常のbinding規則へ進む。
    stale open ExecutionRunがあれば先にreconcileし、同一operatorにopen runを重複生成しない。

    resume:
    Task / Activity / Bindingを維持し、session/run associationをreconcileする。
    stale ExecutionRunのself-healを行い、duplicate open runを作らない。

    clear:
    Task / Activity / Bindingを維持する。
    旧conversation/operator ExecutionRunから新ExecutionRunへの切替だけを行い、新conversationへTask Contextを再注入する。

    compact:
    Task / Activity / Binding / current operator ExecutionRun identityを変更しない。
    必要なcontext refresh/reinjectionだけを行う。
    compactだけを理由に新しいmanaged runを作らない。

    fork:
    v1では parent operator の TabBindingを自動継承しない。
    parent Bindingをsteal/mutateしない。
    fork側は通常のbinding規則によって独立に解決されるまで inherited Bindingなしとして扱う。

    SessionEnd の正常受信を復元の前提条件にしない。
    次回 SessionStart が stale open ExecutionRun を検出してself-heal/reconcileできることをAC/testへ入れる。

    E. sibling UserPromptSubmit hook と mutation

    Task Context mutation semantics は commit-on-submission として固定する。

    Userがpromptを明示送信し、Task Context自身のvalidationが成功してautobind/rebind /task mutationをcommitした場合、その後に独立したsibling hookが別理由で同一promptをblockしてもrollbackしない。

    hookの完了順序に依存しない。

    同じ入力・初期stateなら、Task Context hookが sibling hook より先に完了しても後に完了しても、最終canonical Task Context stateを一致させる。

    pending authorization / deferred rebind intent 等を次turnへcarry-overしない。

    2-phase prompt transactionや独自hook coordinatorは追加しない。

    F. DB unavailable時の availability policy

    Task Contextはsecurity boundaryではなく mistake-prevention / operator UX の仕組みとして扱う。

    ordinary prompt では、

    DB busy / unavailable / corrupt / read failure
    → promptは原則PASS
    → Task Contextはdegradedとして可視化
    → persistenceできないTask mutationは行わない
    → 成功したように装わない

    とする。

    current stateの取得とwrong-target判定まで正常完了した場合のみ、
    high-confidence definite mismatch
    をBLOCKする。

    /task <target> は明示的なstate-changing commandなので、必要なpersistenceに失敗した場合は /task 自体を明示failure/blockし、rebind成功を装わない。

    command型 UserPromptSubmit のtimeoutで完全なfail-closedを保証できるとは主張しない。

    UserPromptSubmit Task Context adapterのtimeoutはデフォルト30秒を使わず、最大1秒のbounded hot-path budgetとする。
    既存SQLite busy budget 200msとの整合を保つこと。

    G. zero-ref ad-hoc Task

    GitHub refが0件のad-hoc Taskは provisional / absorbent とする。

    ACTIVE Task
    かつ task_refs == 0
    かつ最初のhigh-confidence primary GitHub target
    なら、

    same Taskへそのrefをclaimし、different-Task rebindとして扱わない。

    1つ以上primary refを持った後からdifferent-primary guardを通常どおり有効にする。

    「まずrepoを調べて」→「Issue #2564を実装して」の普通の会話で /task を要求するUXにしない。

    新しいschema fieldが不要なら追加しない。

    H. classifier decision

    precedence は既存どおり /task special-case を最優先する。

    少なくとも次を固定する。

    /task                         -> special-case
    single high-confidence same  -> PASS
    single high-confidence other -> BLOCK
    REFERENCE_ONLY               -> PASS
    NONE                         -> PASS
    AMBIGUOUS                    -> PASS + advisory
                                    bind/rebindはしない
    

    multi-ref comparison promptをfalse-positive blockしないfixtureを追加する。

    I. Herdr projection

    新規daemon、独自metadata service、別control-planeを作らず、既存Herdr primitiveを利用する。

    current CLI/APIをfact-checkした上で、基本形を

    projection_outbox revision=N
      -> live pane/tab resolve
      -> herdr tab rename
      -> herdr pane report-metadata --current
           --source task-context-v1
           --seq N
      -> projection ack
    

    とする。

    既存service layerの revision-aware ack_projection() をSSOTとして再利用する。

    projection flush が既にCLI化されている構造に合わせ、additive な typed CLI projection ack operationを追加して既存 ack_projection() を呼ぶ方式を採用する。
    adapter側へack SQLを重複実装しない。

    Herdr custom metadata tokenはbest-effort enhancementとする。

    #2564の必須UXは少なくとも

    • Herdr Tab label
    • Claude statusLine

    まで。

    projectionをUserPromptSubmit hot pathに同期的に抱え込まない。

    J. runtime verification boundary

    #2564:

    unit/integration test
    +
    現行generic worktree-agent-runtime-smoke で追加harness改造なしに実現可能な minimal Native canary

    までを担当する。

    #2568:

    isolated Task Context DB
    actual hooks
    /clear
    wrong-target
    statusLine
    Native / Claude-GPT を含む本格Task Context E2E

    を担当する。

    #2564のためにgeneric runtime-smoke harnessへTask Context専用意味論を新設しない。
    #2568との循環依存を作らない。

    4. scope_signal_guard の前回停止を正しく処理する

    前回の

    legacy decisions.scope_signal_guard = triggered:true / new_allowed_path_layer

    と

    scope_signal_guard_decision_v2.raw_signal = triggered:false / no_scope_signal

    の不一致を無視して先へ進んではならない。

    しかし、前回artifactをそのままauthorityとして再利用して再停止するのも避けること。

    current main / current Issue body / immutable snapshot provenance に対して canonical producer をfreshに実行し、

    • before_body
    • current_body
    • after_body
    • source_refs
    • legacy projection
    • V2 raw signal

    のbindingを確認すること。

    Current Validated Scope と Allowed Paths の既存5パスを「新規Allowed Path delta」と捏造しない。

    operator-selected human-context directive の exact path が必要なら、current SKILL.md / #2086契約に従い read-only codebase-investigator SubAgent に導出させ、その結果を canonical authority pathへ渡すこと。

    そのSubAgentの完了を必ず待つこと。

    contract_update.run.with_human_context が NEXT_ACTION: issue_editor_required を返した場合は、それをhuman escalationへ変換せず、canonical issue-editor full-rewrite laneへ進むこと。

    人間に ANCHOR_SCOPE_REFRAME_V1 の手動コピペを要求しない。

    ただし、valid immutable delta inputを使ったcanonical fresh runでもなお legacy/V2 が矛盾し、router自身がhard stopを返すなら、planner判定を手書きで上書きしたり hard stop をbypassしてはならない。

    その場合は、

    • 使用した snapshot refs
    • delta input
    • legacy projection
    • V2 decision
    • router receipt
    • current git HEAD
    • body sha256

    を保存して workflow defect として明確に報告すること。

    人間へ同じ判断を再質問する必要はない。

    5. SubAgent orchestration — 必ずcompletion joinする

    planner の policy と current skill contractに従って必要なSubAgentを使うこと。

    特に必要なら、

    codebase-investigator
    と
    web-researcher

    は並列起動してよい。

    ただし background launchは完了ではない。両方の最終結果が返るまで必ず待ち、joinしてから次のcanonical stepへ進むこと。

    Step 2.5 が applicable なら issue-design-reviewer を起動し、作業完了を待ってから semantic resultをrecord/joinすること。

    rewriteが必要なら canonical issue-editor SubAgent を起動し、issue-editor の作業完了を必ず待つこと。

    issue-editor completion前にreadback/reviewへ進まない。

    SubAgentのresultを受け取っていないのに「完了した」と推定しない。

    SubAgent自身へnested SubAgent delegationをさせない。
    current skillが明示的に別扱いする場合を除き、nested delegationが必要になったら既存Stop Conditionに従う。

    6. 前回semantic findingsの扱い

    前回 artifact:

    .claude/artifacts/issue-refinement-loop/2564/8427ca62719cd22d/semantic_review_result.json

    は evidence として参照してよい。

    ただし、

    • body SHA binding
    • current mainとのstaleness
    • current invocationとのbinding
    • current skillが再利用を許可するか

    を確認し、staleならfresh semantic reviewを実行する。

    少なくとも前回の BLOCKER/HIGH 6件と MEDIUM 3件、および上記Owner decisionsがIssue契約へ具体的に反映されたことを確認する。

    7. rewrite後に省略禁止のgate

    Issue本文mutation後は必ず authoritative readbackを行う。

    その後、同じ新body revisionに対してfreshに、

    1. refinement preflight
    2. root-owned review
    3. applicableならsemantic design review
    4. final review gate
    5. contract/readiness
    6. allowed-path gate
    7. dependency/materialization gate

    を通すこと。

    old bodyのreview結果をnew bodyへ流用しない。

    readback未確認のままapproved扱いしない。

    fresh reviewがneeds-fixなら、max_iterations の範囲で人間承認なしに次のrewrite iterationへ進むこと。

    通常のREQUEST_CHANGESをhuman escalationへ格上げしない。

    8. 実装を先走らない

    Issue #2564 が refinement上 approved になるまでは実装コードを変更しない。

    approved/readiness satisfied後は .claude/skills/issue-refinement-loop の current Step 4.5 / Step 5 / root transition 契約へ従う。

    issue_kind: implementation としてcanonical implementation handoffが発生する場合はその結果を正しく記録する。

    root transition が current contract上 impl-review-loop を直ちに起動する設計ならそのcanonical transitionに従うが、refinement approval前にimplementationへ飛ばない。

    9. 人間確認なしで継続してよいもの

    以下では承認確認を挟まない。

    • current repo / Issue / comments のread-only調査
    • SubAgent起動とcompletion待ち
    • web fact-check
    • deterministic review
    • semantic review
    • Issue contract rewrite
    • controlled Issue本文mutation
    • post-mutation readback
    • test / static validation
    • fresh review
    • readiness
    • bounded rewrite retry
    • approved後のcanonical handoff

    10. 本当に停止してよい条件

    通常のreview findingやrewrite必要性では停止しない。

    current canonical contractで明示的に許可されない次のような境界だけを停止理由とする。

    • secret / credential の入力が必要
    • destructive / non-idempotent operationについて今回のauthorityでは判断できない
    • permission boundaryの新規拡張が必要
    • external service boundaryの新規拡張が必要
    • Issue partition / 新規独立scopeが不可避
    • breaking schema migrationが必要
    • 上記5つ以外のwrite pathが本当に必要
    • canonical router自体がvalid fresh evidenceに対して解消不能なhard stopを返す
    • その他current SKILL.mdが明示的にhuman judgmentを必須とする境界

    停止する場合も通常の承認質問はせず、何がcanonicalに阻止しているかをartifact/evidence付きで最終報告する。

    11. 最終報告

    最後に必ず以下を簡潔に報告すること。

    • final refinement verdict
    • Issue bodyが変更されたか
    • final body SHA
    • 解消したBLOCKER/HIGH/MEDIUM
    • 実行したSubAgentと、それぞれcompletion join済みか
    • verification/readiness結果
    • scope_signal_guardの最終判定
    • unresolved blocker
    • implementation handoffの有無
    • handoffがある場合はhandoff先と状態
    • repo rootに意図しない変更や一時ファイルが残っていないか

    途中で通常の人間承認確認を挟まず、current canonical control-planeが許す範囲で最後まで自律実行してください。

    この形なら、前回のhard stopを単純に「無視」させるのではなく、今の人間指示を正式な authority に変換してから canonical flow を再走させます。また、前回の6件の requires_owner_choice を先に決めているため、issue-editor直前で再び同じ判断待ちになる可能性も下げられます。

  5. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    Owner Directive(対話プロンプトから materialize)

    この comment は、直前の直接対話プロンプト(interactive human instruction)で確定した Issue #2564 の設計判断を GitHub 上へ永続化するものです。root control-plane(issue-refinement-loop orchestrator)が controlled issue-comment mutation lane 経由で投稿しています。

    この directive は新しい Allowed Path layer を追加するものではありません。 既存の 5 つの Allowed Paths(.claude/settings.json, .claude/hooks/task_context_*, .claude/skills/task/**, scripts/task-context/**, tests/task-context/**)を維持したまま、その内部で許可される additive operation の範囲を明確化し、issuecomment-5612090902 の敵対的レビュー(BLOCKER3/HIGH3/MEDIUM3)を Issue 契約へ反映するための Owner decision です。

    A. Allowed Paths(既存5パス維持)

    • write-capable scope は既存の以下5パスに 固定 する。新規レイヤーは追加しない。
      • .claude/settings.json
      • .claude/hooks/task_context_*
      • .claude/skills/task/**
      • scripts/task-context/**
      • tests/task-context/**
    • scripts/task-context/** / tests/task-context/** 内での additive な typed API / CLI operation の追加(query current の session selector 化、真の read-only query path、projection ack operation 等)は 実装: Native Claude operatorにTask Context hooks・wrong-session guard・statusLine/Herdr projectionを配線する #2564 の実装範囲として許可する。breaking schema migration・既存契約の非互換変更・Allowed Paths 外の変更が必要になった場合にのみ Stop Condition とする。

    B. statusLine / query current

    • statusLine は Claude Code から渡される stable session_id を selector として current Task Context を解決する。
    • query current は少なくとも session_id -> Binding -> Task / Activity / Attention / RuntimeLocation / runtime health を返す additive query とする。
    • statusLine path は真に read-only とする:DB directory 作成・DB 新規作成・migration・WAL 設定等の write-capable initialization・projection mutation・GitHub fetch・Herdr mutation を行わない。read-only open 不能または DB 未作成なら空/degraded status を返し、DB を作成しない。
    • 既存 service SQL を hook/statusLine 側へ重複実装しない。

    C. durable Binding と live Herdr location の分離

    • binding_id を durable identity とし、Herdr tab/pane/workspace location は mutable RuntimeLocation observation として分離する。
    • operator pane が別 Tab/Workspace へ move しても Task/Activity/Binding identity は変化しない。Herdr への projection 直前に current live pane/tab を解決し、stale な旧 Tab を更新しない。
    • HERDR_TAB_ID を durable Task/Binding primary key へ昇格しない。

    D. SessionStart lifecycle matrix

    • startup: recoverable/suspended Binding が current live operator location から決定的に解決できれば復元。それ以外は通常の binding 規則へ。stale open ExecutionRun は先に reconcile し、同一 operator に open run を重複生成しない。
    • resume: Task/Activity/Binding を維持し、session/run association を reconcile。stale ExecutionRun の self-heal を行い、duplicate open run を作らない。
    • clear: Task/Activity/Binding を維持。旧→新 ExecutionRun への切替のみ行い、新 conversation へ Task Context を再注入する。
    • compact: Task/Activity/Binding/current operator ExecutionRun identity を変更しない。必要な context refresh/reinjection のみ。compact だけを理由に新しい managed run を作らない。
    • fork: v1 では parent operator の TabBinding を自動継承しない。parent Binding を steal/mutate しない。fork 側は通常の binding 規則で独立に解決されるまで inherited Binding なしとして扱う。
    • SessionEnd の正常受信を復元の前提条件にしない。次回 SessionStart が stale open ExecutionRun を検出して self-heal/reconcile できることを AC/test へ含める。

    E. sibling UserPromptSubmit hook と mutation semantics

    • Task Context mutation semantics は commit-on-submission に固定する:User が明示送信し Task Context 自身の validation が成功して autobind/rebind//task mutation を commit した場合、独立した sibling hook が別理由で同一 prompt を block しても rollback しない。
    • hook の完了順序に依存せず、同じ入力・初期 state なら最終 canonical Task Context state を一致させる。pending authorization / deferred rebind intent 等を次 turn へ carry-over しない。
    • 2-phase prompt transaction や独自 hook coordinator は追加しない。

    F. DB unavailable 時の availability policy

    • Task Context は security boundary ではなく mistake-prevention / operator UX の仕組みとして扱う。
    • ordinary prompt では: DB busy/unavailable/corrupt/read failure → prompt は原則 PASS、Task Context は degraded として可視化、persistence できない Task mutation は行わず、成功を装わない。
    • current state 取得と wrong-target 判定まで正常完了した場合のみ high-confidence definite mismatch を BLOCK する。
    • /task <target> は明示的な state-changing command のため、必要な persistence が失敗した場合は /task 自体を明示 failure/block とし、rebind 成功を装わない。
    • command 型 UserPromptSubmit の timeout で完全な fail-closed を保証できるとは主張しない。UserPromptSubmit Task Context adapter の timeout は既定 30 秒を使わず 最大 1 秒 の bounded hot-path budget とし、既存 SQLite busy budget 200ms との整合を保つ。

    G. zero-ref ad-hoc Task

    • GitHub ref が 0 件の ad-hoc Task は provisional/absorbent とする:ACTIVE Task かつ task_refs == 0 かつ最初の high-confidence primary GitHub target なら、same Task へその ref を claim し、different-Task rebind として扱わない。1 つ以上 primary ref を持った後から different-primary guard を通常どおり有効にする。
    • 「まず repo を調べて」→「Issue 実装: Native Claude operatorにTask Context hooks・wrong-session guard・statusLine/Herdr projectionを配線する #2564 を実装して」の通常の会話で /task を要求する UX にしない。新しい schema field が不要なら追加しない。

    H. classifier decision

    • precedence は /task special-case を最優先する:
      • /task → special-case
      • single high-confidence same → PASS
      • single high-confidence other → BLOCK
      • REFERENCE_ONLY → PASS
      • NONE → PASS
      • AMBIGUOUS → PASS + advisory(bind/rebind はしない)
    • multi-ref comparison prompt を false-positive block しない fixture を追加する。

    I. Herdr projection

    • 新規 daemon / 独自 metadata service / 別 control-plane を作らず、既存 Herdr primitive を利用する:projection_outbox revision=N → live pane/tab resolve → herdr tab rename → herdr pane report-metadata --current --source task-context-v1 --seq N → projection ack。
    • 既存 service layer の revision-aware ack_projection() を SSOT として再利用する。additive な typed CLI projection ack operation を追加してこれを呼ぶ方式を採用し、adapter 側へ ack SQL を重複実装しない。
    • Herdr custom metadata token は best-effort enhancement とする。実装: Native Claude operatorにTask Context hooks・wrong-session guard・statusLine/Herdr projectionを配線する #2564 の必須 UX は少なくとも Herdr Tab label と Claude statusLine まで。projection を UserPromptSubmit hot path へ同期的に抱え込まない。

    J. runtime verification boundary


    この directive は issue-refinement-loop の canonical preflight.run.with_human_context / 必要な contract_update.run.with_human_context の human-context source として使用される。

  6. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 実行報告(human_judgment_required — 最終 handoff 直前で停止)

    この対話プロンプトを direct interactive human instruction として扱い、Owner Directive(https://github.com/squne121/loop-protocol/issues/2564#issuecomment-5612664012)として materialize した上で、canonical control-plane を通じて refinement を再開・完走させた。

    実施内容(すべて completion join 済み)

    1. Owner Directive を controlled issue-comment mutation lane で materialize(issuecomment-5612664012、OWNER_DIRECTIVE_MATERIALIZED_FROM_INTERACTIVE_PROMPT_V1 provenance marker付き)。
    2. preflight.run.with_human_context(この anchor)を fresh 実行 → STATUS: pass。legacy scope_signal_guard と v2 raw_signal は今回 fresh evidence で一致(no_scope_signal)し、前回報告した新旧 detector 不一致は解消済み。
    3. scope_signal_guard_decision_v2.scope_delta_authority.route.action: contract_update_required を受け、decide_next_loop_action.py(Priority 2)に従い contract_update.run.with_human_context を実行 → 機械的 patch が適用されたが(writes: 1)、構造破損(見出しのない孤立 paragraph が AC13 直後に挿入)を起こした。
    4. Step 2(deterministic checker)は破損後の body も approve を返したため、Step 2.5 semantic design review(issue-design-reviewer SubAgent、completion join 済み)を実行し、4 blocker + 3 high + 3 medium + 構造破損 blocker を検出。
    5. 2 回目の contract_update.run.with_human_context は disposition: proven_no_change(writes:0)で、機械的 patch の余地なしと判定。
    6. issue-editor SubAgent(completion join 済み)に Step 2.5 findings 全 10 件の解消を委譲し、本文を全面書き直し。body_sha256 は独立 readback で 0148aed8c9caa58d88542a5332bd7951bd93e16f114f38ab86af72179659f70d と確認。
    7. fresh 再評価サイクルを完走:
      • fresh preflight.run.with_human_context → pass、scope_signal_guard 両検出器とも no_scope_signal で一致。
      • fresh Step 2 review → approve / step_2_5。
      • fresh Step 2.5 semantic design review(issue-design-reviewer SubAgent、completion join 済み)→ assessment: clear(前回の 4 blocker/3 high/4 medium/1 low が全て解消されたことを個別確認)。
      • join_review_results.py → effective_verdict: approve。
      • run_root_review_pipeline.py gate-final-review → final_review_allowed: true。
      • run_contract_review_once.py --mode execute --evidence-mode current-head(HEAD=a2568fdad178b9e22b74595a982f0550c2595f49)→ status: go(readiness/blockers/product_spec/vc_preflight 全て pass、declared_path_overlap は advisory・disjoint)。
      • dependency_materializer.evaluate_termination_dependency_gate → decision: proceed(no_hard_dependencies_confirmed_this_cycle)。
      • decide_next_loop_action.py --review-result-verdict approve → NEXT_ACTION: proceed_to_step_4_5(delivery_rollup.applicable: false、follow_up_materialization.candidates: [] のため Step 4.5 は no-op)。

    最終 handoff 直前で発見した未解決ブロッカー

    Step 5 の contract snapshot materialize(ensure_contract_snapshot.py --mode auto --post)を実行したところ、GitHub へは何も書き込まれず(post_status: not_requested)、以下の runtime_error で停止した:

    allowed_paths_pre_post_validation_failed:invalid_allowed_path_pattern:.claude/hooks/task_context_*
    

    原因は scripts/agent-guards/changed_file_matcher.py::AllowedPathsMatcher.normalize_allowed_pattern() の matcher v2 grammar(各 path segment は literal / * / ** のいずれかのみが有効、task_context_* のような部分 glob は無効として fail-closed)に対し、Issue #2564 の ## Allowed Paths に元々(本セッションの介入前から)存在していた .claude/hooks/task_context_* という記法が違反していることである。この pattern は Issue 作成当初からの既存エントリであり、今回の refinement・Owner Directive・issue-editor rewrite のいずれによっても新規追加・変更されていない(body diff で確認済み)。

    この matcher v2 grammar では「task_context_ prefix を持つ複数ファイル」を表現する構文が存在しない(.claude/hooks/* は同一 directory 内の全 hook ファイルへ意図せず範囲が広がり、.claude/hooks/** はさらに広い)。いずれの修正も Allowed Paths の実質的な範囲を変更することになり、「今回の Owner decision は既存の5つの Allowed Paths を維持したまま契約を具体化することであり、新しい Allowed Path layer を追加する判断ではない」という今回の Owner Directive A の明示的な制約と、pattern 修正で意図せず抵触しうる。

    したがって、この pattern をどう修正するか(.claude/hooks/* へ広げる/.claude/hooks/** へ広げる/具体的なファイル名の列挙を Owner が決めてから literal で書く、等)は自己判断で決定せず、Owner の判断を仰ぐ。

    未解決ブロッカー

    • blocker_kind: allowed_paths_pattern_invalid_for_downstream_matcher
    • blocker_detail: .claude/hooks/task_context_* は changed_file_matcher.py の matcher v2 grammar で invalid(部分 segment glob 不可)。このままでは ensure_contract_snapshot.py の go snapshot 投稿(Step 5 handoff の前提)が runtime_error で完了せず、実装 PR が作成された場合も pr-review-judge の Allowed Paths gate で同じ matcher により誤判定される可能性が高い。
    • evidence:
      • git HEAD: a2568fdad178b9e22b74595a982f0550c2595f49
      • final body_sha256: sha256:0148aed8c9caa58d88542a5332bd7951bd93e16f114f38ab86af72179659f70d
      • contract_review_once status: go(この pattern 検証は run_contract_review_once.py 自体には含まれず、ensure_contract_snapshot.py の pre-post validation でのみ検出される)
      • ensure_contract_snapshot.py 実行結果の errors: ["allowed_paths_pre_post_validation_failed:invalid_allowed_path_pattern:.claude/hooks/task_context_*"]
      • matcher 実装: scripts/agent-guards/changed_file_matcher.py::AllowedPathsMatcher.normalize_allowed_pattern()(153行目付近、segment grammar のコメント参照)

    本文変更

    Issue #2564 の本文は変更されている(body_sha256: sha256:0148aed8c9caa58d88542a5332bd7951bd93e16f114f38ab86af72179659f70d)。旧 body(Owner Directive 前の元本文、sha256:29cab9ee...)から、Owner Directive A〜J の設計判断・OWNER 敵対的レビューの BLOCKER3/HIGH3/MEDIUM3 を全て契約へ反映済み。Allowed Paths のテキスト自体(5パスの列挙)は元のまま一切変更していない。

    実行した SubAgent(すべて completion join 済み)

    • codebase-investigator(前回 iteration、evidence 不足のため control-plane が直接 .claude/settings.json / scripts/task-context/*.py を読み補完)
    • web-researcher(前回 iteration、Claude Code hooks 公式仕様 fact-check)
    • issue-design-reviewer ×3(構造破損前 body、issue-editor 直後の破損 body、issue-editor 全面書き直し後の最終 body)
    • issue-editor ×1(全面書き直し)

    Implementation Handoff

    発生していない。 LOOP_HANDOFF_RESULT_V1 は投稿していない(Step 5 の go snapshot materialize が上記 blocker で完了していないため)。root_entry_router.py による impl-review-loop への root transition も未実行。

    repo root の状態

    意図しない変更・一時ファイルは残っていない(git status --short はクリーン)。前回 iteration で発生した AGY delegation の一時ファイル(.2564-delegation-*.json 等)も既に削除済み。

  7. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    推奨は、.claude/hooks/task_context_* を .claude/hooks/task_context/** に置き換えることです。.claude/hooks/* や .claude/hooks/** へ広げるのは避けます。

    現行 matcher v2 は各 segment を literal / * / ** に限定しており、task_context_* は仕様上明確に invalid です。さらに ensure_contract_snapshot.py と impl-review 側の adjudicator は同じ normalizer を使って invalid pattern を拒否します。つまり matcher の一時的不具合ではなく、Issue 契約側の表現が現行 grammar に適合していません。

    .claude/hooks/task_context/** なら「Task Context 専用 namespace」という意味境界を維持しつつ、matcher v2 で正規に表現できます。既存の5つの意味的な write scopeは維持し、以前の Owner Directive A の「文字列を一字一句維持する」という部分だけを supersede する扱いが適切です。.claude/hooks/* は既存の無関係な hook まで許可するので採用しません。また changed_file_matcher.py 自体を #2564 のために変更するのも、グローバルな Allowed Paths 文法変更になり過剰です。現在のIssue本文にも invalid な旧表記が残っています。

    提供された実行ログでも、semantic review clear、final review、readiness go、dependency gate proceed まで通過し、最後の snapshot materialization だけがこの pattern で停止しており、implementation handoff はまだ発生していません。したがって設計全体を再検討する必要はありません。 GitHub上の最新停止コメントとも一致します。

    なお別件として、run_contract_review_once.py が go を返した後に snapshot で初めて invalid Allowed Path が見つかった点は control-plane の検出時期の欠陥です。#2564を塞がず、後続で AllowedPathsMatcher validation を refinement/final readiness の前段へ寄せる改善を別Issue化する価値があります。

    既に auto mode の Claude Code には、以下をそのまま渡すのを推奨します。

    あなたは既に auto mode で起動済みの対話的 Claude Code です。

    対象リポジトリ:

    https://github.com/squne121/loop-protocol

    対象 Issue:

    #2564

    今回の停止報告:

    #2564 (comment)

    既存 Owner Directive:

    #2564 (comment)

    目的は、今回判明した Allowed Paths grammar blocker を scope を不必要に拡張せず解消し、.claude/skills/issue-refinement-loop の canonical flow を再開して Step 5 / implementation handoff まで完走することです。

    Claude Code の permission mode / auto mode 自体は変更しないでください。現在の auto mode をそのまま使用してください。

    今回の direct human decision

    この対話プロンプトを OWNER の direct interactive human instruction として扱ってください。

    既存 Owner Directive A のうち「Task Context hook scope の文字列表現を .claude/hooks/task_context_* のまま維持する」という部分だけを、今回の判断で supersede します。

    write-capable scope の意味的な5領域は維持しますが、matcher v2 grammar に適合させるため、Task Context hook scope を次のように正規化してください。

    旧:

    .claude/hooks/task_context_*

    新:

    .claude/hooks/task_context/**

    したがって canonical Allowed Paths は次の5項目です。

    • .claude/settings.json
    • .claude/hooks/task_context/**
    • .claude/skills/task/**
    • scripts/task-context/**
    • tests/task-context/**

    これは .claude/hooks 全般への scope expansion を承認するものではありません。

    .claude/hooks/* および .claude/hooks/** への置換は禁止します。

    また、このIssueを通すために scripts/agent-guards/changed_file_matcher.py の matcher grammarを変更してはなりません。partial-segment glob対応をグローバルに追加する変更は #2564 の責務外です。

    Task Context用の新規 hook / statusLine entrypoint が必要なら、原則として .claude/hooks/task_context/ subtree 内へ配置し、Task semantics / SQL 等のcore logicは既存契約どおり scripts/task-context/** 側に保持してください。

    最初にSubAgentで妥当性を確認する

    最初に current main / current Issue body を基準として、read-only の codebase-investigator SubAgentを起動してください。

    少なくとも以下を調査させてください。

    SubAgentの作業完了を必ず待ってください。

    completion resultを受け取る前に、完了したと推定したりIssue本文を書き換えたりしないでください。

    SubAgent自身へnested SubAgent delegationをさせないでください。

    調査の結果、.claude/hooks/task_context/** では #2564 の契約を実装できず、Allowed Paths外のwriteが本当に不可避だと判明した場合のみ停止してください。その場合も .claude/hooks/* 等へ自己判断で拡張せず、具体的な不足pathと理由を報告してください。

    Owner Directive の materialization

    current canonical control-plane が direct human decision のGitHub上のdurable authorityを要求する場合、この指示を Issue #2564 の controlled issue-comment mutation lane で materializeしてください。

    少なくとも次の provenance marker を付けてください。

    commentでは、以前の Owner Directive A を全面撤回したように扱わず、

    「意味的な5つのwrite scopeは維持するが、invalid legacy shorthand .claude/hooks/task_context_* を matcher-v2-compatible な dedicated subtree .claude/hooks/task_context/** へ正規化する」

    という限定的な superseding decisionであることを明記してください。

    .claude/hooks/* / .claude/hooks/** は明示的に非承認としてください。

    materializeした場合、そのcomment URLを subsequent preflight.run.with_human_context 等の canonical human-context source としてください。

    Issue本文の修正

    codebase-investigatorのcompletion join後、current issue-refinement-loop が定義する rewrite / issue-editor laneを使用してください。

    Issue本文mutationが必要なら issue-editor SubAgentへ委譲し、issue-editorの作業完了を必ず待ってください。

    少なくとも以下を同一revisionで整合させてください。

    ## Current Validated Scope 内の

    .claude/hooks/task_context_*

    を

    .claude/hooks/task_context/**

    へ変更する。

    ## Allowed Paths 内も同様に変更する。

    その他、Issue本文中で old pattern が write boundary として authorityを持つ箇所があれば、新しい dedicated subtree表記へ統一する。

    必要なら In Scope に、

    「Task Context固有のClaude-native hook/statusLine entrypointは .claude/hooks/task_context/** 配下へ置き、無関係な.claude/hooks siblingへwrite scopeを広げない」

    という制約を追加する。

    それ以外の、すでに semantic review clear となった Owner Directive B〜J、AC、runtime verification boundary、Stop Conditions等を不用意に再設計しないでください。

    mutation後のfreshness

    Issue本文mutation後は authoritative readback を必ず実行し、current body SHAを取得してください。

    旧 body SHA

    0148aed8c9caa58d88542a5332bd7951bd93e16f114f38ab86af72179659f70d

    にbindされた review / readiness / semantic artifact / snapshot判定を、新bodyへそのまま流用しないでください。

    Allowed Pathsの1行だけの修正であっても body SHAが変わるため、current skill contractに従って必要なproducerをfreshに再実行してください。

    canonical refinement flowを再開する

    .claude/skills/issue-refinement-loop/SKILL.md と必要な references を progressive disclosure で読み、planner / router のロジックをmain threadのprose判断で再実装しないでください。

    current canonical producer / routerの結果をauthorityとしてください。

    少なくとも新body revisionについて、current skillが要求する順序で以下をfreshに完走してください。

    1. preflight.run.with_human_context
    2. scope signal / scope delta authority evaluation
    3. root-owned deterministic review
    4. applicableなら issue-design-reviewer SubAgentによるfresh semantic design review
    5. semantic reviewを起動した場合はそのcompletionを必ず待ち、canonical join
    6. final review gate
    7. contract/readiness review
    8. Allowed Paths validation
    9. dependency/materialization gate
    10. Step 4.5
    11. Step 5 contract snapshot materialization
    12. LOOP_HANDOFF_RESULT_V1
    13. canonical root transition

    scope_signal_guardについては、この変更を「無かったこと」にして bypassしてはいけません。

    一方、このdirect human decisionは .claude/hooks/task_context_* というinvalid legacy shorthandを .claude/hooks/task_context/** というdedicated namespaceへ正規化する明示的なOwner decisionです。

    fresh canonical producerがscope deltaを検出した場合は、その human-context authorityをcanonical routeへ渡し、routerの結果に従ってください。

    valid fresh evidenceとOwner authorityを与えてもcanonical router自体が解消不能なhard stopを返す場合のみ停止してください。

    snapshot blockerの再検証

    Step 5直前には、current ## Allowed Paths の全patternが AllowedPathsMatcher.normalize_allowed_pattern() の現行grammarでvalidであることを確認してください。

    特に、

    .claude/hooks/task_context/**

    がvalidであり、

    .claude/hooks/task_context_*

    がcurrent Issue bodyのauthoritative Allowed Pathsから完全に除去されていることを確認してください。

    その後、current canonical contractに従って ensure_contract_snapshot.py の snapshot materializationをfreshに実行してください。

    今回の成功条件には、前回の

    allowed_paths_pre_post_validation_failed:invalid_allowed_path_pattern:.claude/hooks/task_context_*

    が解消され、current body SHAにbindされた go snapshotが実際にmaterializeされることを含めてください。

    snapshot成功前に implementation-ready と報告しないでください。

    implementation handoff

    Issue #2564 が approved / readiness satisfied / fresh contract snapshot satisfied になった後だけ、current issue-refinement-loop Step 5 / root transition契約に従ってください。

    issue_kind: implementation なので LOOP_HANDOFF_RESULT_V1 を省略しないでください。

    root_entry_router.py 等のcurrent canonical root transitionが invoked: true を返し、同一root invocationで impl-review-loop entryを要求する場合は、そのcanonical transitionに従ってください。

    refinement承認前に実装コードを変更しないでください。

    人間承認について

    以下は今回すでにOwner判断済みなので、再確認しないでください。

    通常のIssue本文mutation、SubAgent起動、fresh review、semantic review、readback、readiness、snapshot再試行、canonical handoffの途中で通常の承認確認を挟まないでください。

    本当に停止してよいのは、secret/credential、destructive/non-idempotent operation、今回承認していない新規permission/external-service boundary、.claude/hooks/task_context/** でも足りない実質的なwrite-scope expansion、またはcurrent canonical routerの解消不能なhard stop等、current skillがhuman judgmentを必須とする場合だけです。

    最終報告

    最後に簡潔に、以下を報告してください。

    • final refinement verdict
    • Issue本文を変更したか
    • old / new body SHA
    • .claude/hooks/task_context_* → .claude/hooks/task_context/** の正規化結果
    • semantic scopeが拡大していないこと
    • 実行したSubAgent
    • 各SubAgentがcompletion join済みか
    • fresh preflight / review / semantic review / final review / readiness結果
    • Allowed Paths validation結果
    • ensure_contract_snapshot.py の結果とsnapshot URL
    • scope_signal_guard最終判定
    • unresolved blocker
    • LOOP_HANDOFF_RESULT_V1 の状態
    • implementation handoffの有無
    • handoff先とroot transition状態
    • repo rootに意図しない変更や一時ファイルが残っていないか

    途中で通常の承認確認を挟まず、current canonical control-planeが許す範囲で最後まで自律実行してください。

    この形なら、既存設計をほぼそのまま保持しつつ、今回の blocker だけを機械的に解消できます。特に「matcherを緩めて通す」のではなく、契約表現をmatcherの正規文法へ合わせる点が重要です。

  8. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    Owner Directive(限定的 superseding decision — Allowed Paths grammar 正規化)

    この comment は、直前の直接対話プロンプトで確定した Issue #2564 の設計判断を GitHub 上へ永続化するものです。root control-plane(issue-refinement-loop orchestrator)が controlled issue-comment mutation lane 経由で投稿しています。

    これは既存の Owner Directive(A〜J)を全面撤回するものではありません。 Owner Directive A のうち「Task Context hook scope の文字列表現を .claude/hooks/task_context_* のまま維持する」という一点だけを、今回の判断で限定的に supersede します。

    背景

    前回の停止報告で判明した通り、.claude/hooks/task_context_* は scripts/agent-guards/changed_file_matcher.py::AllowedPathsMatcher.normalize_allowed_pattern() の matcher v2 grammar(各 path segment は literal / * / ** のいずれかのみ有効。部分 segment glob は invalid として fail-closed)に違反しており、ensure_contract_snapshot.py の go snapshot materialize が完了できない状態にあった。

    正規化の決定

    write-capable scope の意味的な5領域は維持したまま、Task Context hook scope の記法のみを matcher-v2-compatible な dedicated subtree へ正規化する。

    旧: .claude/hooks/task_context_*
    新: .claude/hooks/task_context/**

    canonical Allowed Paths は以下の5項目に更新する。

    • .claude/settings.json
    • .claude/hooks/task_context/**
    • .claude/skills/task/**
    • scripts/task-context/**
    • tests/task-context/**

    明示的に非承認とする事項

    実装上の指示

    Task Context 専用の Claude-native hook / statusLine entrypoint は、原則として .claude/hooks/task_context/ subtree 内へ配置する。Task semantics / SQL 等の core logic は既存契約どおり scripts/task-context/** 側に保持し、.claude/hooks/task_context/** 配下には薄い adapter スクリプトのみを置く。無関係な既存 .claude/hooks sibling(secret_boundary_guard.sh 等)へ write scope を広げない。


    この directive は issue-refinement-loop の canonical preflight.run.with_human_context の human-context source として使用される。

  9. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-09-10T04:38:55Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/2564
      body_sha256: "sha256:ad78445871ebd45551a173fd0218da1bdedac223dc5c6ab7fe8f3a58a05c5887"
      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:ad78445871ebd45551a173fd0218da1bdedac223dc5c6ab7fe8f3a58a05c5887","source_provenance":{"source_type":"body_file","body_file":"/tmp/contract_review_once_body_vgzenjfp.md"}}
        vc_preflight:
          decision: pass
          classifications: '[{"ac":"AC15","line":16,"raw_command":"uv run --locked pytest tests/task-context -q","command_hash":"sha256:25a91ab1b80a73f8bceaa6b17135cd8869211a4461d7dd1ac037a61789c94e28","execution_key_hash":"sha256:324b3e26c64fba7404551407aa0484d55b3bebf939ac194a260d36b19b4d1ede","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["........................................................................ [ 67%]","...................................                                      [100%]","107 passed in 1.98s"],"stdout_truncated":false,"stdout_original_line_count":4,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":2169,"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,"timeout_provenance":{"timeout_seconds":150,"cleanup_tail_seconds":15,"source":"static_fallback","estimator_version":"v2","estimator_input_digest":"sha256:5e4eb69fe5da5f824279f9c95410f80d6628d4888932f6b9c2379c8ce68a6262"}}]'
          classifications_transport: {"schema":"vc_preflight_classifications_transport/v1","classification_count":1,"original_payload_sha256":"sha256:ea7d4488e5491a397be65ac6838c00db577b34bec7d53b9c0b95a8c5bd006f7b","compact":false,"truncated":false}
        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":"3aff61429acd4429f2840faa374f5cf4687c7113","draft_policy":"include_drafts","prs":[{"number":2578,"title":"feat: record phase-aware human history","base_ref_name":"main","head_ref_name":"worktree-issue-1908-human-history-phase-routing","head_ref_oid":"8abbf72984b791ea1180e607dc33b895450fef21","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2578","changed_files_count_graphql":12},{"number":2612,"title":"feat: agent-retrospective に session-window coverage / --since-last-retrospective を追加する","base_ref_name":"main","head_ref_name":"worktree-issue-2601-agent-retrospective-since-last-retrospec","head_ref_oid":"e624106771f0e9e4cba5d546bd0bdaf15784ee46","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2612","changed_files_count_graphql":4}],"fetched_count":2,"totalCount":2,"has_next_page":false,"complete":true,"saturated":false,"limit":200,"page_count":1,"inventory_digest":"sha256:cf64936d4855513c095795924bbacc460a433c30959621fe2e3146fe68bc70eb","errors":[]},"inventory_digest_extended":"sha256:29b9c20187f7debf9abb845bf6d99a22fb85ffa41949c734f5bfa735042f5397","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":2564,"contract_source_kind":"issue_comment","contract_source_id":"5613256795","contract_body_sha256":"sha256:ad78445871ebd45551a173fd0218da1bdedac223dc5c6ab7fe8f3a58a05c5887","allowed_paths_normalized_sha256":"5047c17f6e358ef28c472d6a9a054fc983661bd8daea312ce1ab36d478e30104","base_ref":"main","base_sha_at_snapshot":"3aff61429acd4429f2840faa374f5cf4687c7113"}'
  10. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告(approved / implementation handoff)

    前回の 停止報告 で判明した Allowed Paths grammar blocker(.claude/hooks/task_context_* が matcher v2 grammar 上 invalid)を、OWNER の限定的 superseding decision(issuecomment-5613170728)に基づき解消し、canonical flow を完走した。

    実施内容

    1. codebase-investigator SubAgent(completion join 済み)で .claude/hooks/task_context/** への正規化が matcher v2 grammar・.claude/settings.json・既存 .claude/hooks/ 運用と矛盾しないことを確認。
    2. OWNER の限定的 superseding decision(Owner Directive A のうち Allowed Paths 記法のみを supersede、.claude/hooks/* / .claude/hooks/** は明示的に非承認)を controlled issue-comment mutation lane で materialize(issuecomment-5613170728、OWNER_DIRECTIVE_MATERIALIZED_FROM_INTERACTIVE_PROMPT_V1 provenance marker付き)。
    3. issue-editor SubAgent(completion join 済み)に限定修正を委譲: ## Current Validated Scope と ## Allowed Paths 内の .claude/hooks/task_context_* を .claude/hooks/task_context/** へ書き換え、## In Scope へ scope 限定の一文を追加。それ以外(Owner Directive B〜J、AC1-15 等)は無変更。body_sha256 を独立 readback で ad78445871ebd45551a173fd0218da1bdedac223dc5c6ab7fe8f3a58a05c5887 と確認、旧 pattern 0件・新 pattern 3件を確認。
    4. fresh 再評価サイクルを完走:
      • fresh preflight.run.with_human_context(anchor: issuecomment-5613170728)→ pass。legacy/v2 scope_signal_guard とも no_scope_signal で一致。
      • fresh Step 2 review → approve / step_2_5。
      • fresh Step 2.5 semantic design review(issue-design-reviewer SubAgent、completion join 済み)→ assessment: clear(Allowed Paths 正規化が正しく限定的であること、.claude/hooks/*/.claude/hooks/** への非意図的拡大がないこと、他セクションの不用意な再設計がないことを個別確認)。
      • join_review_results.py → effective_verdict: approve。
      • run_root_review_pipeline.py gate-final-review → final_review_allowed: true。
      • run_contract_review_once.py --mode execute --evidence-mode current-head(HEAD=3aff61429acd4429f2840faa374f5cf4687c7113)→ status: go。
      • dependency_materializer.evaluate_termination_dependency_gate → decision: proceed。
      • decide_next_loop_action.py --review-result-verdict approve → NEXT_ACTION: proceed_to_step_4_5(Step 4.5 は no-op: delivery_rollup.applicable: false、follow_up_materialization.candidates: [])。
      • Allowed Paths validation: AllowedPathsMatcher.normalize_allowed_pattern() で全5パターンを個別検証し、すべて valid(.claude/hooks/task_context/** を含む)であることを確認。
      • ensure_contract_snapshot.py --mode auto --post → status: ok、source: materialized_go。前回の allowed_paths_pre_post_validation_failed:invalid_allowed_path_pattern:.claude/hooks/task_context_* は解消され、go snapshot が実際に materialize された: 実装: Native Claude operatorにTask Context hooks・wrong-session guard・statusLine/Herdr projectionを配線する #2564 (comment)

    scope_signal_guard 最終判定

    legacy decisions.scope_signal_guard / v2 scope_signal_guard_decision_v2.raw_signal とも triggered: false / no_scope_signal で一致。scope_delta_authority.route.action: human_escalation(expands_allowed_paths、anchor comment 自体の分類)は decide_next_loop_action.py のいずれの hard-stop priority(Priority 2: contract_update_required のみ対象、Priority 3: scope_signal_guard.triggered のみ対象)にも該当せず、canonical router は一貫して STATUS: pass を返した。

    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/2564#issuecomment-5613256795
        generated_at: "2026-09-10T04:38:00Z"
        body_sha256: "sha256:ad78445871ebd45551a173fd0218da1bdedac223dc5c6ab7fe8f3a58a05c5887"
      metadata:
        title_prefix_ready: true
      label_sync_observation:
        kind: presentation_sync
        result: noop
        detail: "既存 label なし。state/blocked・state/queued 等の stale label 除去対象なし。"
      auto_fixes:
        result: auto_fixed
        required: []
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: "2026-09-10T04:38:00Z"
      checked_body_sha256: "sha256:ad78445871ebd45551a173fd0218da1bdedac223dc5c6ab7fe8f3a58a05c5887"
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []

    本文変更履歴(今回サイクル)

    • 前回サイクル(Owner Directive A〜J 全面反映): body_sha256=0148aed8...
    • 今回サイクル(Allowed Paths grammar 正規化のみ): body_sha256=ad78445871ebd45551a173fd0218da1bdedac223dc5c6ab7fe8f3a58a05c5887

    実行した SubAgent(すべて completion join 済み)

    • codebase-investigator(.claude/hooks/task_context/** 正規化の技術的妥当性検証)
    • issue-editor(Allowed Paths / Current Validated Scope の限定修正)
    • issue-design-reviewer(正規化後の最終 semantic design review、assessment: clear)

    repo root の状態

    意図しない変更・一時ファイルは残っていない(git status --short はクリーン)。

  11. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

  12. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-09-10T05:23:17Z)

  13. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    impl-review-loop 実行報告(human_judgment_required — Step 1 blocked)

    Issue #2564 の refinement は前回サイクルで approved(LOOP_HANDOFF_RESULT_V1.status: impl_ready)となり、root_entry_router.py の canonical root transition(route: invoke_impl_review_loop, invoked: true)に従い、同一 turn で impl-review-loop を起動した。

    実施内容

    1. build_intake_capsule.py → next_action.route: proceed_to_step_1(contract_snapshot.normalized_status: go、evidence_complete: true)。
    2. Step 1(implementation-worker SubAgent、completion join 済み): IMPLEMENT_RESULT_V1.status: ok。PR feat: Native Claude operatorにTask Context hooks・wrong-session guard・statusLine/Herdr projectionを配線する #2615 を起票(draft)。worktree .claude/worktrees/issue-2564-task-context-native-hooks。独立検証: main checkout clean、PR diff の全21ファイルが live Allowed Paths(5項目)内であることを確認。
    3. Step 2(test-runner SubAgent、completion join 済み + 独立 adjudication): uv run --locked pytest tests/task-context -q → 192 passed。head_sha (8fad58d645e4ee65b186a1fbfa22fb1359e80db1) が current PR head と一致することを独立確認。adjudicate_vc_result.py(canonical schema: CONTRACT_REVIEW_RESULT_V1 baseline + baseline_vc_preflight/v1 current)で VC_ADJUDICATION_RESULT_V1.overall_status: pass / blocking: false を独立算出。step4-gate → invoke_pr_reviewer: true。
    4. Step 4(pr-reviewer SubAgent、completion join 済み): verdict: REQUEST_CHANGES。
      • Blocker A: required CI check python-test(python-test-core)が head 8fad58d6... で red(6 test failures)。原因は .claude/settings.json へ9 lifecycle hookを新規配線したが、scripts/check_hook_boundaries.py が要求する docs/dev/hook-boundaries.md の hook_boundaries_manifest_v1 manifest を更新していないため。
      • Blocker B: PR本文に AC1-AC15 の達成状況セクションが欠落。
    5. Step 1 再委譲(implementation-worker SubAgent、completion join 済み、fix_delta 付き):

    最終ブロッカー(human 判断が必要)

    docs/dev/hook-boundaries.md は project-wide の governance document(scripts/check_hook_boundaries.py が .claude/settings.json の hooks と構造照合し drift を検出する、DOCS_PATH ハードコード、代替パスなし)であり、Issue #2564 が要求する9個の新規 lifecycle hook 配線(SessionStart/UserPromptSubmit/CwdChanged/SubagentStart/SubagentStop/PreToolUse/Stop/StopFailure/SessionEnd)を .claude/settings.json へ追加する以上、このファイルの manifest 更新は不可避である。これは Issue #2564 の現行 Allowed Paths に含まれていない。

    選択肢(Owner 判断が必要、自己判断で選択しない):

    1. Issue 実装: Native Claude operatorにTask Context hooks・wrong-session guard・statusLine/Herdr projectionを配線する #2564 の Allowed Paths へ docs/dev/hook-boundaries.md を追加する Scope Delta を承認する。
    2. docs/dev/hook-boundaries.md の manifest 更新を別の fast-follow Issue に分離する(ただしその場合、本 PR の CI required check は 実装: Native Claude operatorにTask Context hooks・wrong-session guard・statusLine/Herdr projectionを配線する #2564 のマージ前には green にならない可能性がある)。
    3. その他の Owner 決定。

    repo / PR の状態

    実行した SubAgent(すべて completion join 済み)

    • implementation-worker ×2(初回実装 + fix_delta 対応)
    • test-runner ×1(独立検証)
    • pr-reviewer ×1(REQUEST_CHANGES)

    LOOP_HANDOFF_RESULT_V1(impl-review-loop 側)

    この impl-review-loop iteration は approved 終了ではない(continue_loop 経路の Step 1 が blocked で停止したため)。termination_reason: human_escalation として停止する。

    repo root の状態

    意図しない変更・一時ファイルは残っていない。

  14. self-assigned this
    on Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions