Skip to content

実装: Skill references/ の read permission と Agent/Skill 契約 strict validator を追加する #1745

Closed
1 of 1 issue completed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1732"
goal_ref: "Option A の permission contract を実装し、独立した binding manifest・strict validator・fresh-session smoke runner・result schema により references/ の正規 read と secret/local settings deny、既存 terminal/output 契約を固定する"
change_kind: mixed
runtime_verification:
  required: true
  mode: immediate
  evidence_type: claude-code-fresh-session-permission-smoke

Parent Issue

#1732

Parent Goal Ref

  • Goal: .claude/** blanket deny を廃止し、Skill references/ の正規 read を許可しながら secret/local settings/credential paths は deny のままにする permission contract と binding を確定する
  • Desired Destination: 独立 binding manifest、strict validator、再利用可能な fresh-session smoke runner、機械可読 result schema が存在し、実装: pr-reviewer/pr-review-judge の重複を削減し preload を追加する #1744 が同一PRで pr-reviewer binding を active 化できる

Current Validated Scope

Remaining Parent Gaps

なし(本 Child は共有基盤を独立実装し、#1744 の active 化に先行して検証可能)

Outcome

Option A を採用し、Read(**/.claude/**) blanket deny を廃止する。代わりに Skill references/ 等の明示的な正規 path を allow し、secret/local settings/credential paths は deny する。対象 binding を独立 manifest に記述し、strict validator と reusable fresh-session smoke runner が同じ manifest を検証する。runner は active/pending binding を区別し、terminal state と output schema を不変として structured result を出力する。runtime unavailable は PASS にせず blocked とする。

Effective Decision Matrix (Option A)

Path class Decision Evidence
対象 Skill の references/ allow fresh-session positive smoke が PASS
secret/local settings/credential paths deny 既存 secret regression と fresh-session negative smoke が PASS
runtime unavailable / auth unavailable blocked runner result が blocked、PASS へ昇格不可
binding pending pending active 化の証跡が揃うまで #1745 の検証対象として保持
binding active active manifest、validator、runner、同一PRの証跡が current head に束縛

Binding Boundary / Dependency

In Scope

  • .claude/settings.json の blanket Read(**/.claude/**) deny を廃止し、対象 Skill references/ と必要な canonical validator/manifest paths を allow する。
  • secret/local settings/credential paths(例: .env*、**/credentials/**、.claude/settings.local.json)の deny を維持し、既存 regression を追加・更新する。
  • 独立 binding manifest(active/pending、対象 agent/skill、許可 references、deny path、validator/runner/version)を追加する。
  • strict YAML validator(scripts/agent-ops/validate_claude_agent_skill_contract.py の唯一の実装・所有物)を追加し、frontmatter、manifest schema、name/directory 一致、preload mapping、canonical path 実在、disable-model-invocation: true 非存在、terminal/output schema 不変性を検証する。Skill references の read permission 対象は設定・manifest・validator・smoke の共有基盤に限り、実装: pr-reviewer/pr-review-judge の重複を削減し preload を追加する #1744 が所有する pr-reviewer/pr-review-judge references の内容は編集しない。
  • reusable fresh-session smoke runner と structured result schema を追加する。positive/negative cases、runtime metadata、artifact path、blocked reason、active/pending state を記録する。
  • runtime evidence は各 case を fresh session で取得し、baseline/candidate SHA と manifest hash に束縛する。raw transcript と credential は保存しない。

Fresh-session runner contract (canonical)

  • Input: repository root, baseline/candidate commit SHA, binding-manifest path, manifest SHA-256, exact Agent/Skill canonical paths, and an explicit case list (references_positive, secret_negative, local_settings_negative, credential_negative, plus active/pending binding state). Inputs are validated against the manifest; caller-supplied fixtures, arbitrary commands, and resume/session identifiers are rejected.
  • Execution: for every case start a new authenticated Claude Code session (resume is prohibited), execute only the manifest-declared permission probe, capture exit code/decision, runtime version, duration, terminal-state digest, and output-schema digest, and bind the structured evidence to both SHAs and the manifest hash. Missing authentication/service/runner availability yields blocked, never PASS.
  • Output: emit exactly one result_schema_v1.json-conforming structured JSON result containing schema/version, case, decision (pass/blocked/fail), binding state (active/pending), baseline/candidate SHA, manifest hash, runtime metadata, artifact path, blocked reason when applicable, and redacted positive/negative summaries. Persist no transcript or secret values.
  • Prohibited: no static file-existence/grep substitute for a runtime case, no synthetic or caller-controlled binary/fixture as runtime evidence, no permission broadening, no narrow allow override of a broad deny, no resume session, no raw transcript/credential capture, and no mutation of GitHub, repository files, or terminal/output schemas.

Out of Scope

Runtime Verification Applicability

runtime_verification_applicability:
  decision: immediate
  reason: permission allow/deny は static inspection だけでは実証できず、fresh session の実観測が必要
  applicable_acs: [AC4, AC5, AC6]
  execution_environment:
    claude_code_version: "artifact に記録"
    model: "baseline/candidate で同一"
    repository_state: "clean、baseline/candidate SHA と manifest hash に束縛"
    session_policy: "case ごとに fresh session、resume 禁止"
    authentication: "既存認証済み環境のみ。secret 値は記録しない"
  skip_conditions:
    - "認証、service availability、利用枠、runner 依存が利用不能"
  fallback_policy: "static/synthetic test や caller-controlled fixture を runtime smoke の PASS としない。runtime unavailable は blocked のままにする"
  artifact_requirements:
    - "structured result JSON(schema/version、case、decision、active/pending、manifest hash、commit SHA、timestamp、blocked reason)"
    - "positive/negative smoke summary と既存 secret regression summary"
  evidence_redaction:
    raw_transcript: prohibited
    credentials: prohibited
    structured_summary_only: true

Acceptance Criteria

Verification Commands

# AC1
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-ops/tests/test_validate_claude_agent_skill_contract.py -q
# AC2
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-ops/tests/test_validate_claude_agent_skill_contract.py -q -k strict_manifest_validator_execution
# AC3
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-ops/tests/test_secret_path_regression.py -q
# AC4
# baseline-expect: fail
# preflight-scope: runtime_only
$ scripts/agent-ops/fresh_session_permission_smoke.py --manifest scripts/agent-ops/binding_manifest.yaml --agent .claude/agents/pr-reviewer.md --skill .claude/skills/pr-review-judge --baseline-sha BASELINE_SHA --candidate-sha CANDIDATE_SHA --cases references_positive,secret_negative,local_settings_negative,credential_negative --output artifacts/1745/fresh-session-result.json
# AC5
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-ops/tests/test_fresh_session_permission_smoke.py -q
# AC6
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-ops/tests/test_fresh_session_permission_smoke.py -q -k hash_binding
# AC7
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-ops/tests/test_validate_claude_agent_skill_contract.py -q -k pr_reviewer_binding_active_boundary

Allowed Paths

  • .claude/settings.json
  • scripts/agent-ops/binding_manifest.yaml
  • scripts/agent-ops/validate_claude_agent_skill_contract.py
  • scripts/agent-ops/fresh_session_permission_smoke.py
  • scripts/agent-ops/result_schema_v1.json
  • scripts/agent-ops/tests/test_secret_path_regression.py
  • scripts/agent-ops/tests/test_validate_claude_agent_skill_contract.py
  • scripts/agent-ops/tests/test_fresh_session_permission_smoke.py
  • docs/dev/agent-skill-boundaries.md

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • 実装: Agent/Skill の重複を削減し progressive disclosure へ移行する #1732/実装: pr-reviewer/pr-review-judge の重複を削減し preload を追加する #1744 の本文、pair 整理、または terminal/output schema の変更が必要になった場合
  • blanket deny 以外の安全な path-scoped contract で references/ 正規 read を表現できない場合
  • secret/local settings/credential path への意図しない read 許可が生じた場合
  • runtime unavailable、auth unavailable、service unavailable、または fresh-session を実行できない場合(該当 AC は blocked、PASS へ昇格しない)
  • manifest/runner/validator の current-head、hash、baseline/candidate SHA binding を証明できない場合
  • nested delegation、権限昇格、外部サービス追加、既存テスト大規模改変が必要になった場合

Required Skills

  • Python
  • pytest
  • YAML / JSON Schema
  • Claude Code permissions

Required Design References

Scope Delta

Delivery Rule

1 Issue = 1 PR を原則とする。worktree 上で実装し、Draft PR を既定とする。

Notes for Reviewer

OWNER 決定(issuecomment-5081104493)に従う。runtime evidence は公式 fresh-session wire の structured summary のみを受理し、synthetic fixture/static test/caller-controlled binary は代替にしない。active/pending と terminal/output schema の不変性をレビュー時に確認する。

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

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

    @squne121
    OwnerAuthor

    判定

    REQUEST_CHANGES — 現状の Issue 契約では実装着手・クローズともに不可です。

    問題設定自体は正しいです。Skill references/ を progressive disclosure で読む経路を確保しながら secret boundary を維持し、Agent/Skill 契約を機械検証する方向性にも妥当性があります。

    ただし、現在の #1745 は以下を許してしまいます。

    • 実際には参照を読めない permission 設定でも AC1 を通過できる

    • fresh session を一度も起動せず AC3/AC4 を通過できる

    • broken YAML、欠落 Skill、誤った preload mapping があっても AC2 を通過できる

    • 親 Issue が要求する terminal state/output schema の不変性を検証せずクローズできる

    • 後続 実装: pr-reviewer/pr-review-judge の重複を削減し preload を追加する #1744 が必要とする smoke runner を作らずクローズできる

    レビュー基準は current main の 1e1d0b58cbb6ab087e58a32bed823b940239ea44 です。#1745 のコメントは空で、Closes #1745 を持つ実装 PR も検索上はまだありません。

    重大ブロッカー

    重要度 | 問題 | 現在のまま起きること -- | -- | -- P0 | permission contract が未確定 | broad deny と narrow allow を同時に書いて false green P0 | #1744 が要求する runner がスコープ外 | #1745 を閉じても後続を開始できない P0 | AC と VC が対応していない | ファイル存在・文字列一致だけで runtime AC が PASS P0 | 親が要求する不変条件が AC から欠落 | terminal state/output schema drift を検出不能 P0 | validator の正本と対象集合が未定義 | self-consistent だが誤った mapping を正しいと判定 P1 | security threat model が曖昧 | built-in tool だけ守って subprocess から読める P1 | 配布境界が未記載 | repo-local では動くが plugin 配布時に契約が変わる

    再レビュー可能になる条件

    1. Read(**/.claude/**) をどう扱うかを一意に決定する

    2. 実装: pr-reviewer/pr-review-judge の重複を削減し preload を追加する #1744 用 runner と result schema を 実装: Skill references/ の read permission と Agent/Skill 契約 strict validator を追加する #1745 のスコープへ追加する

    3. 親 実装: Agent/Skill の重複を削減し progressive disclosure へ移行する #1732 の順序を B → A → C へ修正する

    4. file-existence/grep VC を behavior test と live smoke に置き換える

    5. independent binding manifest と staged activation contract を追加する

    6. terminal state/output schema の不変性を AC に復元する

    7. disable-model-invocation の検査対象を preload Skill に限定する

    8. strict YAML parser の SSOT/differential prevention 方針を確定する

    9. current secret regression suite を直接実行する

    10. repo-local 保証であり plugin distribution 保証ではないことを明記する

    実装 PR がなく、#1745 自身にも runner が存在しないため、今回 fresh-session runtime smoke は実行していません。現時点ではその未実行性そのものが、Issue 契約の主要欠落です。

    ## 判定

    REQUEST_CHANGES — 現状の Issue 契約では実装着手・クローズともに不可です。

    問題設定自体は正しいです。Skill references/ を progressive disclosure で読む経路を確保しながら secret boundary を維持し、Agent/Skill 契約を機械検証する方向性にも妥当性があります。

    ただし、現在の #1745 は以下を許してしまいます。

    • 実際には参照を読めない permission 設定でも AC1 を通過できる
    • fresh session を一度も起動せず AC3/AC4 を通過できる
    • broken YAML、欠落 Skill、誤った preload mapping があっても AC2 を通過できる
    • 親 Issue が要求する terminal state/output schema の不変性を検証せずクローズできる
    • 後続 実装: pr-reviewer/pr-review-judge の重複を削減し preload を追加する #1744 が必要とする smoke runner を作らずクローズできる

    レビュー基準は current main の 1e1d0b58cbb6ab087e58a32bed823b940239ea44 です。#1745 のコメントは空で、Closes #1745 を持つ実装 PR も検索上はまだありません。

    重大ブロッカー

    重要度 問題 現在のまま起きること
    P0 permission contract が未確定 broad deny と narrow allow を同時に書いて false green
    P0 #1744 が要求する runner がスコープ外 #1745 を閉じても後続を開始できない
    P0 AC と VC が対応していない ファイル存在・文字列一致だけで runtime AC が PASS
    P0 親が要求する不変条件が AC から欠落 terminal state/output schema drift を検出不能
    P0 validator の正本と対象集合が未定義 self-consistent だが誤った mapping を正しいと判定
    P1 security threat model が曖昧 built-in tool だけ守って subprocess から読める
    P1 配布境界が未記載 repo-local では動くが plugin 配布時に契約が変わる

    P0-1: 記載されている permission 修正の主経路は成立しない

    現在の .claude/settings.json には、secret path の個別 deny に加えて Read(**/.claude/**) という broad deny が存在します。

    Claude Code の permission は deny → ask → allow の順で評価され、rule の具体性はこの優先順位を変えません。したがって、次の構成は必ず失敗します。

    {
      "allow": [
        "Read(/.claude/skills/pr-review-judge/references/**)"
      ],
      "deny": [
        "Read(**/.claude/**)"
      ]
    }

    狭い allow は broad deny の例外にはなりません。PreToolUse hook が allow を返しても deny を上書きできません。 (Claude)

    ところが #1745 は、概ね次の三つを同時に要求しています。

    1. Read(**/.claude/**) の境界を維持する
    2. 対象 references/ は許可する
    3. 無関係な .claude/** は引き続き拒否する

    これは「狭い allow を追加する」だけでは実現不能です。または同等の path-scoped 修正 と書かれていますが、その同等方式が AC、Allowed Paths、VC のどこにも固定されていません。

    推奨判断

    推奨は Option A です。

    Option A: blanket read deny を廃止し、実秘密だけを deny する

    • Read(**/.claude/**) を削除
    • .env*
    • settings.local.json
    • secrets/**
    • credential/token store

    だけを明示的に deny する。

    この場合、AC4 の「無関係な .claude/** を拒否」は撤回し、次に変更します。

    secret path、local settings、credential path が Read/Grep/Glob/認識可能な Bash read command から拒否される。

    .claude 配下の tracked configuration を「読めないこと」で守る方式は、progressive disclosure と根本的に衝突します。また、security boundary の実装内容を隠すことは強い防御にはなりません。

    Option B: .claude/** 全体を本当に秘密境界として維持する

    この要件を残すなら、最低でも二層必要です。

    • built-in Read/Grep/Glob 用の PreToolUse blocking hook
    • Bash/Python/Node 等の subprocess 用の sandbox denyRead/allowRead

    Claude Code の Read rule は built-in file tools と一部の認識可能な Bash command には適用されますが、Python や Node が直接ファイルを開くような任意 subprocess には適用されません。一方、sandbox は Bash subprocess を OS レベルで制限しますが、built-in Read/Edit/Write は permission system 側で処理されます。 ([Claude]1)

    sandbox は broad deny 内の narrow allow を表現できますが、その場合は hook/sandbox 設定、実装、platform test を Allowed Paths に追加する必要があります。sandbox filesystem isolation は macOS、Linux、WSL2 が対象です。 (Claude)

    現 Issue の Allowed Paths では Option B を実装できません。


    P0-2: #1744 が依存する reusable smoke runner が #1745 に存在しない

    関連 Issue #1744 は #1745 に block されており、#1745 が次のような reusable fresh-session runner を提供する前提です。

    scripts/agent-ops/run_claude_agent_skill_contract_smoke.py
    

    または同等の launcher と、正確な invocation contract を要求しています。

    しかし #1745 には以下がありません。

    したがって、#1745 は後続依存を満たさずにクローズ可能です。これは dependency contract の破綻です。

    さらに親 #1732 は handoff 順を Child A → Child B → Child C としていますが、Child A の #1744 が Child B の #1745 に依存しているため、実際の順序は Child B → Child A → Child C でなければなりません。親本文も修正対象です。 ([GitHub]3)

    runner の推奨方式

    #1744 がまだ pr-reviewer に preload を追加していなくても検証できるよう、--agents で ephemeral agent を定義し、--agent でその agent を main session として実行します。

    claude -p \
      --agents "$DYNAMIC_AGENT_JSON" \
      --agent contract-smoke \
      --permission-mode dontAsk \
      --no-session-persistence \
      --output-format stream-json \
      --max-turns 4 \
      --model "$PINNED_FULL_MODEL_ID" \
      "$PROMPT"

    --agents は skills、permissionMode、tools 等を含む file-based subagent と同等の field を受け付けます。--agent、--no-session-persistence、structured output、turn limit も公式 CLI に存在します。 ([Claude]4)

    これにより、#1744 の Agent ファイル変更前でも、候補 Skill preload と permission を独立して smoke できます。


    P0-3: AC と Verification Commands が対応していない

    現在の対応は次のとおりです。

    AC 要求しているもの 現在の VC 実際に証明できるもの
    AC1 実効 permission contract rg で allow 文字列検索 文字列が存在するだけ
    AC2 strict validator の全機能 test -f validator.py 空ファイルでも PASS
    AC3 fresh session positive smoke test file の存在確認 runtime 未実行でも PASS
    AC4 fresh session negative smoke test 関数名を rg 関数本体が空でも PASS
    AC5 既存 secret tests 全 PASS 新規 test file の pytest 既存 secret test 未実行

    特に preflight-scope: runtime_only が付いた VC が test -f や rg なのは、分類自体が矛盾しています。

    この失敗形式には実例があります。PR #416 では rg と TypeScript typecheck を中心にした Verification Report が全 PASS と報告され、一度 APPROVE されましたが、後のレビューで YAML frontmatter が mapping values are not allowed により壊れていたことが判明しました。文字列検索は「設定らしい文字が存在する」ことしか証明しません。 ([GitHub]5)

    さらに、canonical Python test plan は .claude/hooks/tests/test_secret_boundary_contract.py を明示的に ignore しています。新 test file のみを実行しても、既存 security regression suite が CI で守られるとは限りません。

    必須修正

    AC ごとに、結果を直接観測する command を一対一で置く必要があります。

    # Static validator behavior
    uv run --locked pytest scripts/agent-ops/tests/ -q
    
    # Current repository contract
    uv run --locked python3 \
      scripts/agent-ops/validate_claude_agent_skill_contract.py \
      --repo-root . \
      --contract scripts/agent-ops/contracts/claude-agent-skill-bindings.v1.yaml \
      --json
    
    # Existing secret-boundary regression
    uv run --locked pytest \
      .claude/hooks/tests/test_secret_boundary_contract.py -q
    
    # Authenticated fresh-session runtime smoke
    uv run --locked python3 \
      scripts/agent-ops/run_claude_agent_skill_contract_smoke.py \
      --repo-root . \
      --contract scripts/agent-ops/contracts/claude-agent-skill-bindings.v1.yaml \
      --output /tmp/claude-agent-skill-smoke-result.json

    runtime が認証・service availability 等で実行不能なら、現在の Issue 記載どおり blocked のままとし、static test を代替成功として扱わない方針は維持すべきです。


    P0-4: 親が要求する terminal state/output schema 不変性が AC から消えている

    親 #1732 は Child B に対して、共有 validator が次を検証すると明記しています。

    • strict YAML
    • preload mapping
    • canonical reference/validator path
    • terminal state の不変性
    • output schema の不変性

    親の Desired Destination と Decisions Fixed の双方に記載されています。 ([GitHub]3)

    一方、#1745 の AC2 は次の項目までしか具体化していません。

    • YAML validity
    • Skill name/directory
    • preload mapping
    • disable-model-invocation
    • reference/validator path existence

    terminal state と output schema が AC/VC にありません。つまり、validator がこれらを実装しなくても #1745 を閉じられます。

    必要なのは独立した expected inventory

    Agent と Skill の現在値だけを相互比較しても不十分です。両方が同じ誤りへ同時に変更された場合、self-consistent と判定されるためです。

    次のような machine-readable manifest が必要です。

    schema: CLAUDE_AGENT_SKILL_BINDINGS_V1
    
    bindings:
      - agent: issue-reviewer
        skills:
          - review-issue
        enforcement: active
        terminal_contract:
          schema_id: ISSUE_REVIEW_RESULT_COMPACT_V1
          terminal_states:
            - ok
            - failed
    
      - agent: pr-reviewer
        skills:
          - pr-review-judge
        enforcement: pending
        activation_issue: 1744
        output_contract:
          schema_id: LOOP_VERDICT_V2

    重要なのは active と pending を分離することです。

    現在の pr-reviewer と implementation-worker にはまだ skills: がなく、それぞれ #1744 と将来の Child C が追加します。

    したがって、推奨する分担は次です。

    この場合、#1744 と Child C の Allowed Paths に manifest を追加しなければなりません。

    また現状でも、review-issue.md と issue-reviewer.md の双方が review-issue Skill を preload しています。mapping は単純な一対一ではなく、少なくとも many-agents-to-one-skill を扱う必要があります。


    P0-5: strict validator の対象集合・仕様・正本が閉じていない

    1. disable-model-invocation は全 Skill 禁止ではない

    repo 内には既に disable-model-invocation: true を持つ Skill が複数あります。これらを全件エラーにすると current main 自体が失敗します。

    公式仕様上の制約は、subagent の skills: で preload される Skill にこの field があると preload できないというものです。missing/disabled Skill は warning とともに skip されます。 ([Claude]4)

    したがって validator は以下に限定すべきです。

    agent.skills[] が参照する Skill
      AND disable-model-invocation == true
      => error
    

    全 .claude/skills/** に対する禁止ではありません。

    2. PyYAML を使うだけでは strict にならない

    repo には既に、duplicate key、複数 YAML fence、non-mapping root を fail-closed にする _StrictSafeLoader があります。この実装は過去の parser differential を避けるため SSOT として設計されています。

    一方、既存 parity checker の frontmatter parser は行分割ベースです。

    新 validator が第三の parser を独自実装すると、再び parser differential を作ります。次のどちらかを Issue に固定すべきです。

    • generic strict YAML loader を scripts/agent-ops/ または共有 library へ抽出する
    • 既存 strict loader と同一 fixture corpus による differential test を必須化する

    前者が望ましいですが、既存 MRC parser とその tests を変更するなら Allowed Paths の追加と overlap preflight が必要です。

    3. Agent Skills の公式制約が不足している

    最低限、次を検証対象に含める必要があります。

    • name は一文字以上六十四文字以下
    • lowercase alphanumeric と hyphen のみ
    • 先頭末尾 hyphen 禁止
    • consecutive hyphen 禁止
    • parent directory 名と一致
    • description は非空で千二十四文字以下

    公式 specification は skills-ref validate も提供しています。 ([Agent Skills]6)

    skills-ref を CI dependency にするなら version pin と lockfile 変更を Allowed Paths に含める必要があります。外部 dependency を増やさない場合は、公式仕様互換の validator と conformance fixtures を repo 内に持つべきです。

    4. Agent name uniqueness が抜けている

    Claude Code は agent directory を recursive scan し、同一 tree に同じ name が複数ある場合、文書化されていない filesystem read order で一つだけをロードします。strict validator は duplicate agent name を必ず拒否すべきです。 ([Claude]4)

    5. canonical reference の定義がない

    pr-review-judge は明示的な Reference Loading Map を持っています。

    しかし他方で review-issue/SKILL.md は、自 Skill の references/ ではなく別 Skill の ../create-issue/references/body-authoring.md を参照しています。

    したがって validator は「references/ 内にある全ファイル」を canonical と推測してはいけません。次を明示する必要があります。

    • canonical paths の正本は manifest か Reference Loading Map か
    • cross-skill reference を許可するか
    • symlink 解決後も repo root 内であること
    • .. による repo escape を拒否すること
    • missing file、directory 指定、case mismatch をどう扱うか

    P1: runtime evidence contract が不足している

    現在は artifact requirement が positive smoke result と negative routing result だけです。これでは、モデルが実際には tool call をせず「読みました」と回答した場合と、本当に Read が成功した場合を区別できません。

    最低限、次の schema が必要です。

    schema: CLAUDE_AGENT_SKILL_SMOKE_RESULT_V1
    repo_sha: "<candidate SHA>"
    settings_sha256: "<digest>"
    contract_sha256: "<digest>"
    claude_code_version: "<exact version>"
    model_id: "<full model id>"
    permission_mode: dontAsk
    
    cases:
      - case_id: positive_reference_read
        tool: Read
        requested_path: "<normalized repo-relative path>"
        tool_attempted: true
        expected_decision: allow
        observed_decision: allow
        content_sha256_match: true
    
      - case_id: negative_secret_read
        tool: Read
        requested_path: ".env.contract-smoke"
        tool_attempted: true
        expected_decision: deny
        observed_decision: deny
        denial_source: permission_rule
    
    redaction:
      raw_transcript_stored: false
      synthetic_secret_only: true

    判定は次のように fail-closed にします。

    • model が tool を呼ばなかった → inconclusive、PASS 禁止
    • file missing → deny 成功として扱わない
    • model の自己申告だけ → 証拠として扱わない
    • positive は tool event と content digest の両方が必要
    • negative は tool event と permission denial reason が必要
    • 実 secret は使わず synthetic sentinel を使う

    さらに Read rule は Grep/Glob に best-effort 適用される仕様なので、Read 一件だけで三 tool の成功を主張せず、三種類を個別 case にすべきです。任意 subprocess まで守ると主張する場合は、Python/Node read の negative case も必要です。 ([Claude]1)

    再現性のため、次も固定します。

    • Claude Code exact version
    • model alias ではなく full model ID
    • fallback model 無効
    • --no-session-persistence
    • bounded --max-turns
    • baseline/candidate の同一 case set
    • no raw transcript
    • authenticated runtime が使えない場合は blocked

    P1: repo-local と配布物の境界を明示する必要がある

    親 #1732 は cross-repository 配布、plugin packaging、versioning、install smoke を明示的に Out of Scope としています。したがって、それ自体を #1745 の blocker にする必要はありません。 ([GitHub]3)

    ただし #1745 の Outcome には次を明記すべきです。

    本 validator と runtime smoke が保証する対象は、repository-local .claude/agents/、.claude/skills/、.claude/settings.json の source checkout である。

    Claude Code の plugin subagent では permissionMode、hooks、mcpServers が無視されるため、将来 plugin 化すると repo-local smoke と同じ security contract にはなりません。 ([Claude]4)

    現リポジトリには検査時点で plugin manifest も確認できません。

    plugin 配布を行う時点で、別 Issue として以下が必要です。

    • plugin manifest validation
    • install-from-directory/zip smoke
    • scoped agent identifier
    • plugin subagent の ignored fields 検査
    • packaged artifact digest
    • source/package parity

    推奨する修正版スコープ

    Outcome

    repository-local Claude Code configuration において、Skill reference の正規 Read/Grep/Glob 経路と sensitive-path deny が両立している。Agent/Skill frontmatter、active preload binding、canonical resource path、terminal state/output schema ID を独立 manifest に対して検証する strict validator が CI で実行される。さらに reusable fresh-session runner が、synthetic fixture を用いた positive/negative tool-event evidence を schema-valid artifact として生成できる。

    推奨 Allowed Paths

    .claude/settings.json
    
    scripts/agent-ops/strict_frontmatter_yaml.py
    scripts/agent-ops/validate_claude_agent_skill_contract.py
    scripts/agent-ops/run_claude_agent_skill_contract_smoke.py
    
    scripts/agent-ops/contracts/claude-agent-skill-bindings.v1.yaml
    scripts/agent-ops/contracts/claude-agent-skill-smoke-result.v1.schema.json
    
    scripts/agent-ops/tests/**
    .github/ci/python-test-plan.json
    

    Option B の blanket .claude/** boundary を採用する場合は、追加で以下が必要です。

    .claude/hooks/<path-read-boundary-guard>
    .claude/hooks/tests/**
    .claude/settings.json  # sandbox filesystem policy
    

    strict loader を既存 MRC parser と共有化する場合は、その parser と tests も Allowed Paths に追加する必要があります。

    修正版 Acceptance Criteria

    AC 必須条件
    AC1 採用する permission model が Option A/B のどちらかに一意に決定され、設定 JSON の構造と effective decision matrix を test する
    AC2 malformed frontmatter、duplicate key、unterminated delimiter、non-mapping root、field type mismatch を fail-closed にする
    AC3 Skill naming/description 制約、agent name uniqueness を検証する
    AC4 active binding manifest と Agent skills: が完全一致し、pending binding は current CI を壊さない
    AC5 preload 対象 Skill に限り disable-model-invocation: true、missing、disabled を error にする
    AC6 canonical reference/validator path が存在し、realpath 後も repo root 内である
    AC7 terminal state enum と output schema ID/digest が manifest と一致する
    AC8 reusable fresh-session runner が Read/Grep/Glob positive と synthetic secret negative を実行し、schema-valid artifact を生成する
    AC9 existing secret-boundary regression test が直接実行され、CI selection に含まれる
    AC10 #1744 が runner と manifest を利用できるよう、#1744 の Allowed Paths/VC/dependency 記述が同期されている

    再レビュー可能になる条件

    1. Read(**/.claude/**) をどう扱うかを一意に決定する
    2. 実装: pr-reviewer/pr-review-judge の重複を削減し preload を追加する #1744 用 runner と result schema を 実装: Skill references/ の read permission と Agent/Skill 契約 strict validator を追加する #1745 のスコープへ追加する
    3. 親 実装: Agent/Skill の重複を削減し progressive disclosure へ移行する #1732 の順序を B → A → C へ修正する
    4. file-existence/grep VC を behavior test と live smoke に置き換える
    5. independent binding manifest と staged activation contract を追加する
    6. terminal state/output schema の不変性を AC に復元する
    7. disable-model-invocation の検査対象を preload Skill に限定する
    8. strict YAML parser の SSOT/differential prevention 方針を確定する
    9. current secret regression suite を直接実行する
    10. repo-local 保証であり plugin distribution 保証ではないことを明記する

    実装 PR がなく、#1745 自身にも runner が存在しないため、今回 fresh-session runtime smoke は実行していません。現時点ではその未実行性そのものが、Issue 契約の主要欠落です。

  3. squne121 commented on Jul 25, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Human Escalation Required

    The loop has terminated and requires human review. Cause: human judgment required

    Blockers

    "preflight が repair_diagnostics を検出し、現行本文の Verification Commands に baseline-expect 注釈が不足している"
    
    "OWNER アンカーコメントは .claude read permission の Option A/B の選択を未決定としており、実装方針を一意に定められない"
    
    "#1744 の runner・結果スキーマと #1745 の manifest/validator の責務境界が未確定で、AC/VC を安全に正規化できない"
    
  4. squne121 commented on Jul 26, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Human Escalation Required

    The loop has terminated and requires human review. Cause: human judgment required

    Blockers

    "issue-reviewer の raw compact 出力が REVIEWER_BLOCKER_CLAIM 未許可フィールドを含み、validate_review_compact_output.py が validation_status=invalid と判定した"
    
    "reviewer compact validator の不合格結果は issue-refinement-loop の本文修正ルートで消費できない"
    
  5. squne121 commented on Jul 26, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-26T00:31:19Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1745
      body_sha256: "sha256:27bbd8a70b72634e88ee54c62bed0733c3cb336f7791d5cbb92b0f9aa0a0c5a2"
      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:27bbd8a70b72634e88ee54c62bed0733c3cb336f7791d5cbb92b0f9aa0a0c5a2","source_provenance":{"source_type":"github_api","body_file":null}}
        vc_preflight:
          decision: pass
          classifications: [{"ac":"AC1","line":3,"raw_command":"rg -n \"Option A\" .claude/settings.json","command_hash":"sha256:3cec7a9af4ede20050b84865084e70c8bcaf6047f2c1fdf2a32c59b94763c11b","execution_key_hash":"sha256:fd70dab85de71aba4ad36e9e5eba3ed3c28b296e999504a4cc8775ed693105de","runner":"exec","exit_code":1,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":2,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"fail","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"raw":"# baseline-expect: fail"},"strict":null,"repair":null},{"ac":"AC2","line":3,"raw_command":"test -f scripts/agent-ops/binding_manifest.yaml","command_hash":"sha256:c6a0981bbcbc86bc354aa03b9a0c8076051514492b3ecfb6504800a54b0045da","execution_key_hash":"sha256:493e371cd0e38a3fb66607446b7de7d85303726931f005572732337c2fae377c","runner":"exec","exit_code":1,"classification":"expected_fail","category":"file_not_found_expected","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":1,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"fail","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"raw":"# baseline-expect: fail"},"strict":null,"repair":null},{"ac":"AC3","line":3,"raw_command":"test -f scripts/agent-ops/validate_claude_agent_skill_contract.py","command_hash":"sha256:9709b460eac3a91baa42779eaaffb6d76e983d99a9417854ea0d451165fcc365","execution_key_hash":"sha256:ef13a3b4a24433946e23f34404eaddbfe9965802df9ae87bf1b72e4cf0a6373c","runner":"exec","exit_code":1,"classification":"expected_fail","category":"file_not_found_expected","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":2,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"fail","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"raw":"# baseline-expect: fail"},"strict":null,"repair":null},{"ac":"AC4","line":4,"raw_command":"test -f scripts/agent-ops/fresh_session_permission_smoke.py","command_hash":"sha256:54becf15b91da9ee0158115353122d3c706aa3c8dad6a3a4da18c48c09df1dda","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_runtime_only","decision":"go","scope_class":"runtime_only","confidence":"low","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"raw":"# baseline-expect: fail"},"strict":null,"repair":null,"verification_owner":"impl-review-loop","deferred_reason":"VC marked runtime_only; verification deferred to post-implementation runtime","runtime_verification_required":true},{"ac":"AC5","line":4,"raw_command":"test -f scripts/agent-ops/tests/test_secret_path_regression.py","command_hash":"sha256:33ea83f24d4ee8d4741f832bd6ce51be50f27a2f5b9385cea6613019fd01c124","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_runtime_only","decision":"go","scope_class":"runtime_only","confidence":"low","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"raw":"# baseline-expect: fail"},"strict":null,"repair":null,"verification_owner":"impl-review-loop","deferred_reason":"VC marked runtime_only; verification deferred to post-implementation runtime","runtime_verification_required":true},{"ac":"AC6","line":4,"raw_command":"test -f scripts/agent-ops/result_schema_v1.json","command_hash":"sha256:3d60d22f0aacfa28f3d75a3392d9010e39d0553ee97ece00e11bda5c451a6d73","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_runtime_only","decision":"go","scope_class":"runtime_only","confidence":"low","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"raw":"# baseline-expect: fail"},"strict":null,"repair":null,"verification_owner":"impl-review-loop","deferred_reason":"VC marked runtime_only; verification deferred to post-implementation runtime","runtime_verification_required":true},{"ac":"AC7","line":4,"raw_command":"rg -n \"binding_manifest\" scripts/agent-ops/binding_manifest.yaml","command_hash":"sha256:2809280aa4187b6e7dd3d3aa61cdda1405ede4c1f32e3bc33a80bf4f2b6718ca","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_pr_review_only","decision":"go","scope_class":"pr_review_only","confidence":"low","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"raw":"# baseline-expect: fail"},"strict":null,"repair":null,"verification_owner":"pr-review-judge","deferred_reason":"VC marked pr_review_only; verification deferred to PR review","runtime_verification_required":false}]
      source: ensure_contract_snapshot_auto
      expected_contract_fingerprint: {"issue_number":1745,"contract_source_kind":"issue_comment","contract_source_id":"5081215510","contract_body_sha256":"sha256:27bbd8a70b72634e88ee54c62bed0733c3cb336f7791d5cbb92b0f9aa0a0c5a2","allowed_paths_normalized_sha256":"148b2710f76b71b55caa76fdeac8a5f34de03df4366b2c347592cb585e336b2c","base_ref":"main","base_sha_at_snapshot":"becbdc6118084b4e122dc407dabd9f9bc656b255"}
  6. squne121 commented on Jul 26, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Approved

    The issue has been approved and is ready for implementation.

    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/1745#issuecomment-5081215510
        generated_at: '2026-07-26T00:32:06Z'
        body_sha256: sha256:27bbd8a70b72634e88ee54c62bed0733c3cb336f7791d5cbb92b0f9aa0a0c5a2
      metadata:
        title_prefix_ready: true
        phase_label_ready: true
      auto_fixes:
        result: auto_fixed
        required: []
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: '2026-07-26T00:32:06Z'
      checked_body_sha256: sha256:27bbd8a70b72634e88ee54c62bed0733c3cb336f7791d5cbb92b0f9aa0a0c5a2
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []
  7. squne121 commented on Jul 26, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 人間判断要請

  8. squne121 commented on Jul 26, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-26T01:16:05Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1745
      body_sha256: "sha256:6755907e125ea438d45db2a2da03543d761c380cf4b40a29f130ec7cc37e320b"
      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:6755907e125ea438d45db2a2da03543d761c380cf4b40a29f130ec7cc37e320b","source_provenance":{"source_type":"github_api","body_file":null}}
        vc_preflight:
          decision: pass
          classifications: [{"ac":"AC1","line":3,"raw_command":"rg -n \"Option A\" .claude/settings.json","command_hash":"sha256:3cec7a9af4ede20050b84865084e70c8bcaf6047f2c1fdf2a32c59b94763c11b","execution_key_hash":"sha256:fd70dab85de71aba4ad36e9e5eba3ed3c28b296e999504a4cc8775ed693105de","runner":"exec","exit_code":1,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":2,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"fail","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"raw":"# baseline-expect: fail"},"strict":null,"repair":null},{"ac":"AC2","line":3,"raw_command":"test -f scripts/agent-ops/binding_manifest.yaml","command_hash":"sha256:c6a0981bbcbc86bc354aa03b9a0c8076051514492b3ecfb6504800a54b0045da","execution_key_hash":"sha256:493e371cd0e38a3fb66607446b7de7d85303726931f005572732337c2fae377c","runner":"exec","exit_code":1,"classification":"expected_fail","category":"file_not_found_expected","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":2,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"fail","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"raw":"# baseline-expect: fail"},"strict":null,"repair":null},{"ac":"AC3","line":3,"raw_command":"test -f scripts/agent-ops/validate_claude_agent_skill_contract.py","command_hash":"sha256:9709b460eac3a91baa42779eaaffb6d76e983d99a9417854ea0d451165fcc365","execution_key_hash":"sha256:ef13a3b4a24433946e23f34404eaddbfe9965802df9ae87bf1b72e4cf0a6373c","runner":"exec","exit_code":1,"classification":"expected_fail","category":"file_not_found_expected","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":2,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"fail","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"raw":"# baseline-expect: fail"},"strict":null,"repair":null},{"ac":"AC4","line":4,"raw_command":"test -f scripts/agent-ops/fresh_session_permission_smoke.py","command_hash":"sha256:54becf15b91da9ee0158115353122d3c706aa3c8dad6a3a4da18c48c09df1dda","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_runtime_only","decision":"go","scope_class":"runtime_only","confidence":"low","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"raw":"# baseline-expect: fail"},"strict":null,"repair":null,"verification_owner":"impl-review-loop","deferred_reason":"VC marked runtime_only; verification deferred to post-implementation runtime","runtime_verification_required":true},{"ac":"AC5","line":4,"raw_command":"test -f scripts/agent-ops/tests/test_secret_path_regression.py","command_hash":"sha256:33ea83f24d4ee8d4741f832bd6ce51be50f27a2f5b9385cea6613019fd01c124","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_runtime_only","decision":"go","scope_class":"runtime_only","confidence":"low","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"raw":"# baseline-expect: fail"},"strict":null,"repair":null,"verification_owner":"impl-review-loop","deferred_reason":"VC marked runtime_only; verification deferred to post-implementation runtime","runtime_verification_required":true},{"ac":"AC6","line":4,"raw_command":"test -f scripts/agent-ops/result_schema_v1.json","command_hash":"sha256:3d60d22f0aacfa28f3d75a3392d9010e39d0553ee97ece00e11bda5c451a6d73","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_runtime_only","decision":"go","scope_class":"runtime_only","confidence":"low","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"raw":"# baseline-expect: fail"},"strict":null,"repair":null,"verification_owner":"impl-review-loop","deferred_reason":"VC marked runtime_only; verification deferred to post-implementation runtime","runtime_verification_required":true},{"ac":"AC7","line":4,"raw_command":"rg -n \"binding_manifest\" scripts/agent-ops/binding_manifest.yaml","command_hash":"sha256:2809280aa4187b6e7dd3d3aa61cdda1405ede4c1f32e3bc33a80bf4f2b6718ca","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_pr_review_only","decision":"go","scope_class":"pr_review_only","confidence":"low","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"raw":"# baseline-expect: fail"},"strict":null,"repair":null,"verification_owner":"pr-review-judge","deferred_reason":"VC marked pr_review_only; verification deferred to PR review","runtime_verification_required":false}]
      source: ensure_contract_snapshot_auto
      expected_contract_fingerprint: {"issue_number":1745,"contract_source_kind":"issue_comment","contract_source_id":"5081350983","contract_body_sha256":"sha256:6755907e125ea438d45db2a2da03543d761c380cf4b40a29f130ec7cc37e320b","allowed_paths_normalized_sha256":"148b2710f76b71b55caa76fdeac8a5f34de03df4366b2c347592cb585e336b2c","base_ref":"main","base_sha_at_snapshot":"92b70d470f9c1ad089396a1a717044cc8f2b9db6"}
  9. 21 remaining items

  10. squne121 commented on Jul 26, 2026

    @squne121
    OwnerAuthor
    HUMAN_C1_DECISION_V1:
      candidate_issue_number: 420
      decision: C1/non-conflict
      current_body_sha256: sha256:7810ee472b70c9e20ba65644cfd62c9304e3b213854a505702e03613cb357147
      candidate_body_sha256: sha256:daa94650f3b6f0ea5ecea30037c818e5442eccb5b9dcbdf8e9e4888a5a17aa10
  11. squne121 commented on Jul 26, 2026

    @squne121
    OwnerAuthor
    HUMAN_C1_DECISION_V1:
      candidate_issue_number: 1009
      decision: C1/non-conflict
      current_body_sha256: sha256:7810ee472b70c9e20ba65644cfd62c9304e3b213854a505702e03613cb357147
      candidate_body_sha256: sha256:16af40291383532a081fdf64c0deb8498258bb25f71417703d025a58c7e1e5d1
  12. squne121 commented on Jul 26, 2026

    @squne121
    OwnerAuthor
    HUMAN_C1_DECISION_V1:
      candidate_issue_number: 1288
      decision: C1/non-conflict
      current_body_sha256: sha256:7810ee472b70c9e20ba65644cfd62c9304e3b213854a505702e03613cb357147
      candidate_body_sha256: sha256:a0ce4301ac29e665e1163f4555925596713c264e608e0a61e823507340f58f83
  13. squne121 commented on Jul 26, 2026

    @squne121
    OwnerAuthor
    HUMAN_C1_DECISION_V1:
      candidate_issue_number: 1363
      decision: C1/non-conflict
      current_body_sha256: sha256:7810ee472b70c9e20ba65644cfd62c9304e3b213854a505702e03613cb357147
      candidate_body_sha256: sha256:20d03f5b43ee41ad298284054708578f23606c56df4b06eb64858fba8bb4df2a
  14. squne121 commented on Jul 26, 2026

    @squne121
    OwnerAuthor
    HUMAN_C1_DECISION_V1:
      candidate_issue_number: 1587
      decision: C1/non-conflict
      current_body_sha256: sha256:7810ee472b70c9e20ba65644cfd62c9304e3b213854a505702e03613cb357147
      candidate_body_sha256: sha256:bbbe7ea7166464f91b94a31bf650e4f2542f4ff5445b03c1d7933b40f2923502
  15. squne121 commented on Jul 26, 2026

    @squne121
    OwnerAuthor
    HUMAN_C1_DECISION_V1:
      candidate_issue_number: 1601
      decision: C1/non-conflict
      current_body_sha256: sha256:7810ee472b70c9e20ba65644cfd62c9304e3b213854a505702e03613cb357147
      candidate_body_sha256: sha256:a858247c3fcb5a38cc9a4a009e6d491e2aefee02f64b54a932dfdc751a2cfd19
  16. squne121 commented on Jul 26, 2026

    @squne121
    OwnerAuthor
    HUMAN_C1_DECISION_V1:
      candidate_issue_number: 1733
      decision: C1/non-conflict
      current_body_sha256: sha256:7810ee472b70c9e20ba65644cfd62c9304e3b213854a505702e03613cb357147
      candidate_body_sha256: sha256:4c8ac571feab5464b31b0e1c7ab23fb3676adbaf7b0b620260f5a9342b75c6f8
  17. squne121 commented on Jul 26, 2026

    @squne121
    OwnerAuthor
    HUMAN_C1_DECISION_V1:
      candidate_issue_number: 1738
      decision: C1/non-conflict
      current_body_sha256: sha256:7810ee472b70c9e20ba65644cfd62c9304e3b213854a505702e03613cb357147
      candidate_body_sha256: sha256:95d9eb20918d61c59d98a4dc119cebb8acdc8ab550473cfc0c9ca9117c254828
  18. squne121 commented on Jul 26, 2026

    @squne121
    OwnerAuthor

    確認結果

    前回実行では、#1745・#1744・#1732 の契約修復と関連 Issue の依存直列化までは完了しました。しかし、複数候補の判定を一つのコメントにまとめた #5082575396 が malformed な routing input として残り、worktree 作成・実装・PR 作成前に停止しています。後から投稿した候補別コメントは受理されましたが、先の不正コメントを打ち消せませんでした。

    また、前回の基準 SHA 5419e642… から main は 73364923… へ進んでいるため、旧 contract snapshot、overlap evidence、body/base binding は再利用できません。

    現行 checker は、信頼されたコメント内に判定スキーマ識別子があれば「exactly one fenced block」を要求し、複数 block を schema_block_missing_or_duplicate として拒否します。さらに、後続コメントで上書き可能なのは current body hash の stale retry に限定され、parser error は routing input に残す設計です。したがって、有効なコメントを追加するだけでは解消せず、既存コメントを非 routing tombstone へ controlled update する必要があります。これは現行実装からの推論です。

    #1429 と #1754 は現在も .claude/settings.json を共有する実編集候補です。非衝突の C1 と偽装せず、live state で責務が両立するなら #1745 の successor として直列化する方が安全です。

    現行 SSOT は、Codex root を control-plane に限定し、implementation-worker、test-runner、pr-reviewer を明示 spawn することを要求しています。Spark 系は人間が明示した read-only 監査にのみ使用でき、通常 worker の代替にはできません。 実装・検証・レビューの各ステップでも同じ委譲境界が明記されています。

    以下をそのまま渡してください。

    あなたは squne121/loop-protocol の trusted orchestrator です。

    Issue #1745 について、前回の blocked run を盲目的に再開せず、current main と live GitHub state から全状態を再構築したうえで、malformed overlap-decision comment の限定修復、必要な競合 Issue の直列化、fresh overlap preflight、実装、検証、Draft PR、current-head CI、current-head PR review、レビュー修正までを自律実行してください。

    PR はマージしないでください。auto-merge も有効化しないでください。

    1. 目標

    target_state:
      repository: squne121/loop-protocol
      issue: 1745
      pr_state: draft_or_ready_for_review
      review_verdict: APPROVE
      merge_ready: true
      required_auto_actions: []
      merge: prohibited

    このプロンプトは、以下に対する OWNER の明示承認です。

    1. Issue 実装: Skill references/ の read permission と Agent/Skill 契約 strict validator を追加する #1745 の既存コメント ID 5082575396 を、削除せず、非 routing tombstone へ controlled update する。
    2. 実装: update_branch.py を canonical branch-update executor に統一し、入力・race・postcondition を自己検証する #1429 と 実装: issue-reviewer SubAgent の最終応答から prose 要約を排除し canonical compact stdout 形式を強制する #1754 が live state でも 実装: Skill references/ の read permission と Agent/Skill 契約 strict validator を追加する #1745 と実編集衝突し、意味上は直列実行可能である場合、両 Issue の意味を変えず 実装: Skill references/ の read permission と Agent/Skill 契約 strict validator を追加する #1745 を predecessor として追加する。
    3. current evidence に基づく contract snapshot、overlap preflight、候補別 C1 decision の再生成。
    4. 実装: Skill references/ の read permission と Agent/Skill 契約 strict validator を追加する #1745 の実装、テスト、commit、push、Draft PR、CI 修正、レビュー対応。
    5. 通常の stale precondition、テスト失敗、CI failure、レビュー指摘、branch BEHIND の自律修正。

    追加の人間承認を求めないでください。

    ただし、secret 値の閲覧、破壊的操作、外部課金、権限不足、意味を発明しなければ契約を修復できない場合、解消不能な実編集衝突、runtime verification の blocked、3 iterations 超過では停止してください。

    2. サブエージェント使用は必須

    root thread は control-plane 専用です。サブエージェントを実際に起動し、event-derived SUBAGENT_LAUNCH_LEDGER_V1 で起動を証明してください。

    2.1 Read-only 事前監査

    実行環境に応じて次を明示 spawn してください。

    Claude Code

    • codebase-investigator

      • current main、Issue、コメント、関連 PR、hooks、rules、scripts、validator の read-only 監査
      • Edit、Write、commit、push、GitHub mutation 禁止

    Codex CLI

    spark-worker を implementation-worker の代替にしないでください。Spark に Issue 更新、コメント更新、ファイル編集、commit、push、review judgment、publish をさせないでください。

    read-only 監査結果は次の構造で root に返してください。

    PREFLIGHT_AUDIT_V1:
      current_main_sha: "<sha>"
      issue_body_sha256: "sha256:<hash>"
      malformed_comment:
        comment_id: 5082575396
        current_body_sha256: "sha256:<hash>"
        still_routing_malformed: true | false
        rejection_reason: "<reason|null>"
      structural_collisions:
        - issue_number: 1429
          classification: successor_candidate | semantic_conflict | no_current_collision
          evidence: []
        - issue_number: 1754
          classification: successor_candidate | semantic_conflict | no_current_collision
          evidence: []
      old_artifacts_reusable: false
      blockers: []

    2.2 契約・依存更新

    Issue 本文の限定修復が必要な場合は issue-author SubAgent を明示 spawn し、edit-issue skill と edit_issue_txn.py を使用してください。

    issue-author に raw gh issue edit、raw REST body mutation、直接 comment mutationをさせないでください。

    2.3 実装ループ

    以下は必須委譲です。

    • 実装・修正・commit・push・Draft PR:

      • implementation-worker
    • Verification Commands と runtime evidence:

      • test-runner
    • current-head PR review:

      • pr-reviewer

    root thread は以下を直接行わないでください。

    • repository file の編集
    • implementation test の実行
    • commit
    • push
    • PR の意味的レビュー判定
    • review 指摘に対するコード修正
    • raw gh pr create
    • raw gh pr review

    例外は、後述する OWNER 承認済みコメント ID 5082575396 の一回限りの controlled update と、control-plane artifact の tmp/ または artifacts/ への保存だけです。

    3. current main と SSOT を読み直す

    古いログに記載された SHA、body hash、snapshot URL、artifact digest、overlap JSON、C1 decision を再利用しないでください。

    最初に current main から最低限次を読み直してください。

    AGENTS.md
    CLAUDE.md
    docs/dev/workflow.md
    docs/dev/agent-skill-boundaries.md
    docs/dev/runtime-verification-policy.md
    docs/dev/secret-policy.md
    docs/dev/github-ops.md
    docs/dev/hook-boundaries.md
    docs/dev/repository-folder-policy.md
    
    .claude/settings.json
    .claude/hooks/**
    .claude/agents/codebase-investigator.md
    .claude/agents/issue-author.md
    .claude/agents/implementation-worker.md
    .claude/agents/test-runner.md
    .claude/agents/pr-reviewer.md
    
    .claude/skills/impl-review-loop/SKILL.md
    .claude/skills/impl-review-loop/steps/**
    .claude/skills/implement-issue/SKILL.md
    .claude/skills/edit-issue/SKILL.md
    .claude/skills/open-pr/SKILL.md
    .claude/skills/pr-review-judge/SKILL.md
    .claude/skills/ssot-discovery/SKILL.md
    
    .claude/skills/implement-issue/scripts/check_implementation_overlap.py
    .claude/skills/implement-issue/tests/test_check_implementation_overlap.py
    .claude/skills/edit-issue/scripts/edit_issue_txn.py
    
    .codex/config.toml
    .codex/agents/**
    .codex/hooks/**
    .codex/rules/default.rules
    
    scripts/agent-guards/controlled_skill_mutation_exec.py
    scripts/agent-guards/controlled_skill_mutation_policy.py
    scripts/agent-guards/local_main_branch_guard.py
    scripts/agent-guards/worktree_scope_guard.py
    scripts/check_impl_review_loop_codex_dispatch.py
    scripts/check-codex-agents.mjs
    関連する validators、executors、hooks、rules、tests
    

    .claude/skills/**/SKILL.md を手順の正本とし、secret policy は docs/dev/secret-policy.md を正本としてください。

    4. live state を再構築する

    次をオンラインで再取得し、AUDIT_STATE_V2 として保持してください。

    AUDIT_STATE_V2:
      repository: squne121/loop-protocol
      current_main_sha: "<sha>"
      root_checkout:
        branch: "<branch>"
        clean: true | false
      issue_1745:
        state: "<state>"
        body_sha256: "sha256:<hash>"
        updated_at: "<timestamp>"
        comments_complete: true | false
        contract_snapshot_url: "<url|null>"
        contract_snapshot_fresh: true | false
      malformed_comment:
        id: 5082575396
        url: "https://github.com/squne121/loop-protocol/issues/1745#issuecomment-5082575396"
        body_sha256: "sha256:<hash>"
        updated_at: "<timestamp>"
        author_association: "<value>"
        parse_result: "<result>"
      existing_closing_prs: []
      related_issues:
        - 1732
        - 1744
        - 1429
        - 1754
        - 63
        - 159
        - 224
        - 225
        - 360
        - 964
        - 1573
      current_open_prs: []
      branch_protection: {}
      subagent_launch_ledger_path: "<path>"

    次も確認してください。

    既存 PR がある場合は重複 PR を作らず、その PR の current head と契約 binding を監査して継続可否を決定してください。

    5. malformed コメントを controlled update する

    対象:

    Issue: #1745
    comment_id: 5082575396
    

    5.1 事前条件

    更新前に必ず GitHub からコメントを再取得し、次を確認してください。

    • comment ID が一致する
    • repository と Issue が一致する
    • author association が OWNER または COLLABORATOR
    • current body hash を計算できる
    • current overlap checker がこのコメントを rejected routing input として扱う
    • rejection reason が、複数 block、schema parse error、または同等の malformed record である
    • コメントがすでに非 routing tombstone へ更新済みなら mutation をスキップする

    元本文は GitHub 更新前に、commit 対象外の次のような場所へ保存してください。

    tmp/issue-1745-comment-5082575396-before.json
    

    記録するもの:

    • comment ID
    • URL
    • author
    • updatedAt
    • original body SHA-256
    • original body
    • parser rejection reason

    secret、token、認証 header は保存しないでください。

    5.2 更新内容

    コメントは削除しないでください。

    コメント本文を、routing decision を一切主張しない tombstone に置き換えてください。

    重要: replacement body 自体には overlap checker が検索する判定スキーマ識別子を一文字も含めないでください。説明目的、引用、code block、旧本文の転載にも含めないでください。識別子を含む限り parser の対象に残るためです。

    replacement body の形式:

    # SUPERSEDED_C1_BATCH_NOTE_V1
    
    status: superseded_non_routing
    repository: squne121/loop-protocol
    issue_number: 1745
    comment_id: 5082575396
    reason_code: invalid_batched_candidate_decisions
    original_body_sha256: "sha256:<更新前本文のhash>"
    replacement_authority: "OWNER-approved controlled update"
    routing_effect: "This comment asserts no overlap decision."
    replacement_rule: "Use only fresh, exact, candidate-scoped decisions published separately after final readback."
    
    <!-- CONTROLLED_EXEC_MARKER:issue1745-comment5082575396-nonrouting-v1 -->

    <更新前本文のhash> は live readback 値で置換してください。

    5.3 mutation route

    current hooks、rules、mutation route matrix を確認し、repository-approved な Issue comment PATCH route を使用してください。

    既存コメント更新専用の controlled executor が current main に存在する場合はそれを優先してください。

    存在しない場合に限り、body-inspection guard が認識する REST PATCH route を使ってください。

    概念上の endpoint:

    PATCH repos/squne121/loop-protocol/issues/comments/5082575396
    

    body は inspect 可能な repo-local JSON file から渡してください。stdin、inline shell expansion、GraphQL mutation、削除 API は使わないでください。

    guard または権限により PATCH が拒否された場合、bypass、別 shell、token 抽出、comment delete に迂回せず停止してください。

    5.4 final readback

    更新直後に GitHub から再取得し、次を検証してください。

    COMMENT_REPAIR_RESULT_V1:
      status: updated | already_repaired | blocked
      comment_id: 5082575396
      comment_url: "<url>"
      before_body_sha256: "sha256:<hash>"
      after_body_sha256: "sha256:<hash>"
      updated_at: "<timestamp>"
      routing_schema_identifier_absent: true
      controlled_marker_present: true
      deleted: false
      artifact_path: "<path>"
      errors: []

    さらに、current checker の parser または同じ production module を使う限定検査で、このコメントが rejected ではなく unrelated/non-routing になることを確認してください。

    shadow parser を正本にしないでください。

    6. #1429 と #1754 の実衝突を直列化する

    前回ログでは #1429 と #1754 が構造衝突候補として残りました。これらを C1/non-conflict と偽装しないでください。

    read-only 監査 SubAgent に、各 Issue について次を確認させてください。

    6.1 successor として扱える場合

    次をすべて満たす場合だけ、issue-author SubAgent と edit_issue_txn.py を使い、一件ずつ直列化してください。

    変更内容:

    処理順:

    fresh readback
    → candidate body
    → static readiness
    → issue-author SubAgent
    → edit_issue_txn.py
    → body final readback
    → native dependency update
    → dependency final readback
    

    対象順:

    #1429
    #1754
    

    6.2 successor にできない場合

    以下では変更せず停止してください。

    • semantic contradiction がある
    • active PR と安全に直列化できない
    • Allowed Paths または Outcome を変更しなければ dependency を追加できない
    • SSOT 間の優先順位が不明
      -意味を推測しなければならない

    7. fresh intake と contract snapshot

    コメント修復と必要な dependency 更新後、過去 artifact を使わず preparation の capsule-first 手順を実行してください。

    current main の SSOT に記載された exact invocation を使ってください。現時点で想定される基本形は次です。

    uv run --locked python3 \
      .claude/skills/impl-review-loop/scripts/build_intake_capsule.py \
      --issue-number 1745 \
      --repo squne121/loop-protocol \
      --max-stdout-bytes 4096

    capsule が fresh かつ valid なら、同一情報を raw gh issue view、comments fetch、snapshot search で重複取得しないでください。

    古い snapshot は、次のいずれかだけでも再利用禁止です。

    • base SHA が current main と異なる
    • Issue body SHA が異なる
    • source comments fingerprint が異なる
    • current Issue updatedAt と整合しない
    • dependency drift がある

    fresh contract snapshot を current main SHA と current Issue body SHA に束縛してください。

    8. fresh overlap preflight

    current main の exact command contract に従い、fresh overlap preflight を実行してください。

    uv run --locked python3 \
      .claude/skills/implement-issue/scripts/check_implementation_overlap.py \
      --issue-number 1745 \
      --repo squne121/loop-protocol \
      --limit 2000 \
      > tmp/overlap_preflight_1745.json

    継続判断は exit code ではなく JSON の route を正本にしてください。

    必須条件:

    source:
      complete: true
      saturated: false

    さらに次を確認してください。

    human_c1_decisions:
      rejected: []

    ignored_non_routing に tombstone が現れる、または schema-like comment として認識されないことは許容します。

    route

    • proceed

      • 実装へ進む
    • proceed_with_collision_evidence

      • evidence 全体を保存し実装へ進む
    • human_review_required

      • candidate ごとの理由を調査する
    • wait_for_predecessor

      • predecessor が本当に未完了なら停止
    • duplicate

      • duplicate readback を確認し、勝手に実装しない
    • runtime_error

      • 停止

    C1 candidate が残る場合は、read-only SubAgent が current body、current code、PR、dependency を候補ごとに確認してください。

    真に非衝突と証明できる場合だけ、候補ごとに一つの exact、hash-bound decision comment を個別投稿してください。

    禁止:

    • 複数候補を一コメントにまとめる
    • 一コメントに複数 schema block を入れる
    • true structural collision を C1/non-conflict とする
    • candidate body hash を推測する
    • old body hash を再利用する
    • malformed comment の削除で回避する

    decision 投稿後は、current body、candidate body、comment body、updatedAt の final readback を行い、再度 overlap preflight 全体を実行してください。

    継続 route に収束しない場合は実装へ進まないでください。

    9. impl-review-loop を iteration 0 から開始する

    LOOP_STATE:
      issue_number: 1745
      iteration: 0
      max_iterations: 3
      contract_snapshot_url: "<fresh URL>"
      last_step: null
      blockers_history: []

    worktree は executor 経由で次に作成してください。

    .claude/worktrees/issue-1745-<slug>
    

    main checkout へのコード編集、直接 commit、直接 push を禁止します。

    10. Step 1 — implementation-worker

    implementation-worker SubAgent を明示 spawn してください。

    入力:

    subagent_type: implementation-worker
    inputs:
      issue_number: 1745
      contract_snapshot_url: "<fresh contract snapshot URL>"
      fix_delta: null

    SubAgent は current Issue #1745 の Outcome、In Scope、Allowed Paths、AC、VC を正本として implement-issue skill を実行してください。

    最低条件:

    • TDD
    • Allowed Paths のみ
    • .claude/settings.json の blanket read deny 廃止
    • secret/local settings/credential deny 維持
    • strict binding manifest
    • production strict YAML validator
    • fresh-session permission smoke runner
    • structured result schema
    • duplicate key、unknown key、wrong type、missing path の fail-closed
    • Agent/Skill frontmatter と name/directory consistency
    • preload mapping
    • active/pending invariant
    • terminal/output schema identity
    • baseline/candidate/current-head/manifest hash binding
    • runtime unavailable を blocked とし PASS に昇格しない
    • raw transcript と credential 値を保存しない

    Issue bodyの current contract と異なる旧ログの実装要件を優先しないでください。

    11. Step 2 — test-runner

    実装後、test-runner SubAgent を別セッションとして明示 spawn してください。

    入力:

    subagent_type: test-runner
    inputs:
      issue_number: 1745
      pr_number: "<PR番号>"
      ac_list: "<current Issue の全AC>"
      verification_commands: "<current Issue の全VC>"
      contract_body_sha256: "sha256:<live Issue body hash>"
      diff_head_sha: "<current PR head SHA>"
      verification_directory: "<worktree>"

    最低限実行:

    pnpm typecheck
    pnpm lint
    pnpm test
    pnpm build

    加えて、Issue #1745 の current VC、validator、manifest、runner、schema、secret regression、fresh-session runtime smoke をすべて実行してください。

    判定規則:

    • SKIP は PASS ではない
    • exit 77 は blocked/skip
    • fallback success は runtime PASS ではない
    • synthetic fixture は actual runtime PASS の代替にならない
    • runtime artifact が必要なのに存在しなければ FAIL
    • 全 runtime case が実行不能なら human_review_required
    • baseline failure と candidate regression を区別する
    • current PR head、Issue body SHA、manifest hash、artifact digest に束縛する
    • test output を捏造しない

    TEST_VERDICT_MACHINE/v2 を current head に対して生成してください。

    12. commit、push、Draft PR

    implementation-worker と open-pr skill の controlled path を使ってください。

    禁止:

    git add .
    git add -A
    --no-verify
    force push
    direct push to main
    raw gh pr create
    

    変更ファイルを列挙して個別 stage してください。

    PR は Draft とし、本文に最低限次を含めてください。

    1 Issue = 1 PR を維持してください。

    13. current-head CI と review loop

    PR 作成後:

    1. current PR head SHA を取得
    2. required CI を current head に束縛して待機
    3. failure/cancelled の場合のみログを取得
    4. baseline failure と差分起因 failure を分類
    5. 差分起因なら implementation-worker に限定 fix delta を渡す
    6. 修正後は test-runner を新しい head で再実行
    7. CI が current head で完了したら pr-reviewer を明示 spawn
    8. reviewer の verdict 本文を trusted orchestrator が controlled review publisher の render mode で投稿
    9. REQUEST_CHANGES なら指摘された delta だけを implementation-worker に委譲
    10. head が変わるたびに旧 TEST_VERDICT、LOOP_VERDICT、artifact を破棄して再実行

    pr-reviewer 入力:

    subagent_type: pr-reviewer
    inputs:
      pr_number: "<PR番号>"
      reviewed_head_sha: "<current PR head SHA>"

    pr-reviewer 自身に raw gh pr review を実行させないでください。

    終了条件:

    LOOP_VERDICT_V2:
      verdict: APPROVE
      merge_ready: true
      required_auto_actions: []
      reviewed_head_sha: "<current PR head SHA>"

    APPROVE 単独では終了しないでください。

    次が一つでもあれば merge-ready としないでください。

    • unresolved review thread
    • CI failure/pending/skipped-only
    • stale head
    • stale contract snapshot
    • Allowed Paths gate が ok 以外
    • runtime blocked
    • required_auto_actions が非空
    • launch ledger に必須 SubAgent の起動記録がない
    • current Issue body SHA mismatch
    • artifact digest mismatch

    PR はマージしないでください。

    14. 自律継続事項

    次は停止理由ではありません。

    • 通常の test failure
    • lint/typecheck failure
    • CI の差分起因 failure
    • PR body hygiene
    • review 指摘
    • BEHIND
    • current main との通常の branch update
    • stale snapshot の再生成
    • stale precondition の対象単位 retry
    • 修正可能な schema error
    • controlled comment PATCH の一時的 transport error

    15. 停止条件

    次だけで停止してください。

    停止時は、remote mutation の有無、before/after hash、current main、Issue body hash、comment hash、dependency readback、artifact paths、解除条件を構造化報告してください。

    16. 最終出力

    散文を返さず、次の二つの YAML document だけを返してください。

    SUBAGENT_EXECUTION_SUMMARY_V1:
      launch_ledger_path: "<path>"
      ledger_valid: true | false
      launches:
        - agent: "<codebase-investigator|spark-deep>"
          role: read_only_preflight
          status: completed | blocked
        - agent: issue-author
          role: dependency_contract_update
          status: completed | skipped | blocked
        - agent: implementation-worker
          role: implementation
          status: completed | blocked
        - agent: test-runner
          role: verification
          status: completed | blocked
        - agent: pr-reviewer
          role: current_head_review
          status: completed | blocked
      root_data_plane_violations: []
    EXECUTION_RESULT_V1:
      repository: squne121/loop-protocol
      issue_number: 1745
      status: merge_ready | blocked | failed
      current_main_sha: "<sha>"
      issue_body_sha256: "sha256:<hash>"
      contract_snapshot_url: "<url>"
      contract_repairs:
        issue_1745: "<result>"
        issue_1744: "<live readback result>"
        issue_1732: "<live readback result>"
        comment_5082575396: "<updated|already_repaired|blocked>"
        collision_issues:
          63: "<result>"
          159: "<result>"
          224: "<result>"
          225: "<result>"
          360: "<result>"
          964: "<result>"
          1429: "<result>"
          1573: "<result>"
          1754: "<result>"
      overlap_preflight:
        route: "<route>"
        complete: true | false
        saturated: true | false
        evidence_sha256: "sha256:<hash>"
        rejected_human_decisions: []
      worktree: "<path|null>"
      branch: "<branch|null>"
      commit_sha: "<sha|null>"
      pr_url: "<url|null>"
      pr_head_sha: "<sha|null>"
      changed_files: []
      verification:
        static: pass | fail | blocked
        runtime: pass | fail | blocked
        ci: pass | fail | pending
        artifact_paths: []
      review:
        verdict: APPROVE | REQUEST_CHANGES | null
        merge_ready: true | false
        required_auto_actions: []
        reviewed_head_sha: "<sha|null>"
      blockers: []
      next_action: "<single exact action>"

    GitHub readback、current-head CI、runtime artifact、current-head review、SubAgent launch ledger で結果を証明してください。

    このプロンプトは、前回の停止点を単純再開せず、malformed 履歴の限定修復と新しい main への再束縛から始める構成です。

  19. squne121 commented on Jul 26, 2026

    @squne121
    OwnerAuthor

    判定

    前回 run の blocked は、当時のプロンプトには従っていますが、今回の「#1745 の実装を最優先」という方針には適合しません。
    次回は、必要最小限の control-plane 修復を実施した後、#1745 の実装・runtime verification・Draft PR・current-head review まで進めるべきです。マージは行いません。

    調査時点の main は、前回ログの 73364923... から 92f8ced7... へ進んでいます。古い snapshot、Issue hash、overlap evidence はすべて破棄対象です。

    敵対的レビュー

    P0 — 前回の停止条件が #1745 優先方針と矛盾している

    前回プロンプトは、競合 Issue に active PR があれば安全に直列化できないとして停止する契約でした。そのため #1754 の Draft PR #1787 を検出した時点で、エージェントは仕様どおり停止しています。つまり主因はエージェントの判断能力ではなく、orchestration contract の優先順位設計です。

    しかしリポジトリ SSOT は、衝突由来の停止を SHA に束縛された Git conflict、または CONFLICTING/DIRTY に限定し、DRAFT や BEHIND を衝突停止と混同しないよう定めています。

    PR #1787 は MERGEABLE かつ BEHIND です。CI は現行 head で成功しており、未解消なのは current-head TEST_VERDICT、runtime artifact、branch update、PR body hygiene です。これは #1754 自身の merge-ready blocker であって、#1745 の着手 blocker ではありません。

    修正方針: #1787 は凍結し、#1754 を #1745 の successor として記録する。#1745 を先に実装し、#1787 は #1745 マージ後に rebase・snapshot 再生成・runtime 再検証する。

    P0 — 過去の malformed コメントが実装全体のグローバルロックになっている

    前回 run は 5082575396 のみ tombstone 化しましたが、5081455326、5081489557、5081583067、5081617190、5082495659 が rejected routing input として残ったため停止しました。

    production checker は、trusted comment が判定スキーマ識別子を含みながら malformed なら rejected に入れ、rejected が一件でもあれば候補の現在状態と無関係に human_review_required へ倒します。これは fail-closed ではありますが、過去の壊れた routing record を永続的な実装ロックにしています。

    修正方針: current checker が実際に rejected とした OWNER/COLLABORATOR の過去 routing comment だけを、原文保存・before/after hash・final readback 付きで非 routing tombstone にする。削除は禁止です。単なる body hash drift で、現在も真の C1 なら fresh exact decision による supersessionを優先します。

    P0 — #1745 が先行することは既に SSOT で確定している

    親 #1732 は Child B #1745 → Child A #1744 → Child C の順を明示しています。また cross-repository 配布、plugin packaging、versioning、install smoke は非ゴールです。

    #1744 は本文と GitHub native dependency の双方で #1745 に block され、#1745 が提供する fresh-session runner の exact invocation を待っています。

    current #1745 は、blanket Read(**/.claude/**) deny の廃止、個別 secret deny の維持、strict manifest validator、fresh-session runner、result schema を要求しています。

    したがって、#1429 や #1754 を理由に #1745 を後回しにするのは依存順序の逆転です。

    P1 — Option A の security guarantee を過大表示してはいけない

    Claude Code の Read(...) deny は built-in file tools に適用されますが、Bash subprocess による cat や任意の Python/Node ファイル読み取りをOSレベルでは防止しません。任意 subprocess まで強制するには sandbox の denyRead が必要です。(Claude)

    現行 secret_boundary_guard.sh は多数の危険な Bash パターンを検出しますが、パターンベースであり、任意 subprocess を完全に封じる security boundary ではありません。

    #1745 の結果は、少なくとも次を区別すべきです。

    • built-in permission deny
    • PreToolUse hook deny
    • sandbox OS-level deny
    • OS-level enforcement not claimed

    Option A では最後の状態を明記し、negative smoke が成功しただけで「任意プロセスから credential を読めない」と主張してはいけません。

    P1 — strict validator は YAML parse 成功だけでは不足する

    YAML 1.2 の mapping key は一意でなければなりません。duplicate key を後勝ちで辞書化する loader は strict validator として不適切です。(YAML)

    既存依存には PyYAML と jsonschema があるため、Allowed Paths 外の依存更新なしで実装できます。JSON Schema Draft 2020-12 と additionalProperties: false 相当の閉じた schema を使用できます。 (JSON Schema)

    また Claude Code は、preload 対象 Skill が欠落または disabled の場合、必ずしも session を失敗させず warning のみで skip します。したがって repository validator が事前に fail-closed しなければ false green が残ります。([Claude]4)

    P1 — launch ledger は疑似起動では成立しない

    Codex の current SSOT は、root を control-plane に限定し、actual SubagentStart event から生成した SUBAGENT_LAUNCH_LEDGER_V1 を canonical evidence としています。project config の存在や worker の自己申告だけでは不十分です。

    .codex/hooks.json には実際に SubagentStart hook が設定されています。前回の /root/spark_* 起動はこの経路を通らず、ledger が空になりました。

    次回は shell 上の疑似的な background agent ではなく、Claude Code の Agent tool または Codex の native custom-agent spawn を使用する必要があります。

    実行プロンプト

    あなたは squne121/loop-protocol の trusted implementation orchestrator です。

    最優先方針

    Issue #1745 の実装を最優先してください。

    今回の目標は、current main と live GitHub state を基準に、Issue #1745 を実装し、全 Verification Commands、actual fresh-session runtime verification、current-head CI、current-head PR review を完了し、Draft PR を merge_ready: true にすることです。

    PR はマージしないでください。auto-merge も有効化しないでください。

    過去の overlap artifact、contract snapshot、Issue body hash、candidate hash、main SHA、CI verdict、runtime artifact、C1 decision を再利用しないでください。

    OWNER priority decision

    以下は OWNER の明示的な優先順位決定です。

    1. 実装: Skill references/ の read permission と Agent/Skill 契約 strict validator を追加する #1745 の実装を、実装: update_branch.py を canonical branch-update executor に統一し、入力・race・postcondition を自己検証する #1429、実装: issue-reviewer SubAgent の最終応答から prose 要約を排除し canonical compact stdout 形式を強制する #1754、PR fix(claude): issue-reviewer compact output hook を追加 #1787 より先に進める。
    2. control-plane の履歴修復は、実装: Skill references/ の read permission と Agent/Skill 契約 strict validator を追加する #1745 を実装可能にするための必要最小限に限定する。
    3. Draft/BEHIND/green CI 不足/別 PR の runtime evidence 不足だけを、実装: Skill references/ の read permission と Agent/Skill 契約 strict validator を追加する #1745 の structural conflict として扱わない。
    4. 実装: update_branch.py を canonical branch-update executor に統一し、入力・race・postcondition を自己検証する #1429 と 実装: issue-reviewer SubAgent の最終応答から prose 要約を排除し canonical compact stdout 形式を強制する #1754 が 実装: Skill references/ の read permission と Agent/Skill 契約 strict validator を追加する #1745 と意味的に両立し、差分適用順だけが競合するなら、実装: Skill references/ の read permission と Agent/Skill 契約 strict validator を追加する #1745 を predecessor、両 Issue を successor とする。
    5. 実装: issue-reviewer SubAgent の最終応答から prose 要約を排除し canonical compact stdout 形式を強制する #1754 の PR fix(claude): issue-reviewer compact output hook を追加 #1787 が open の場合、その PR は凍結する。close、merge、force-push は行わない。実装: Skill references/ の read permission と Agent/Skill 契約 strict validator を追加する #1745 マージ後に rebase、contract snapshot refresh、runtime verification を行う後続作業として残す。
    6. 実装: Skill references/ の read permission と Agent/Skill 契約 strict validator を追加する #1745 の実装 PR は一つだけ作成する。既存 PR があれば重複作成しない。
    7. 通常のテスト失敗、lint、CI failure、BEHIND、stale snapshot、review request は自律修正対象であり停止理由ではない。

    明示承認する remote mutation

    次を追加承認なしで実行してよいものとします。

    A. rejected overlap routing comment の限定修復

    Issue #1745 の OWNER/COLLABORATOR authored comment のうち、current production overlap checker が human_c1_decisions.rejected に実際に列挙し、以下のいずれかを満たすものだけを対象とします。

    • schema block missing/duplicate
    • 複数 candidate decision の batch
    • malformed YAML
    • candidate が現在の C1 candidate ではない
    • true structural collision/successor candidate を過去に C1 とした stale record
    • current body/candidate body drift により現在の routing decision として使用不能で、fresh exact decision でも安全に supersede できないもの

    前回観測された comment ID は次です。ただし live checker の再取得結果を正本としてください。

    • 5081455326
    • 5081489557
    • 5081583067
    • 5081617190
    • 5082495659
    • 5082575396 は既に repair 済みの可能性があるため readback して skip 判定する

    処理規則:

    1. comment を GitHub から再取得する。
    2. repository、Issue、comment ID、author association、current body hash、updatedAt、checker rejection reason を確認する。
    3. 原文を commit 対象外の tmp/issue-1745-overlap-comments/<comment-id>-before.json に保存する。
    4. secret、credential、authorization header、token は保存しない。
    5. コメントは削除しない。
    6. replacement body には production checker が検索する判定スキーマ識別子を一文字も含めない。
    7. replacement は non-routing tombstone とし、original body SHA-256、reason code、controlled mutation marker のみを記録する。
    8. GitHub final readback で before/after hash、updatedAt、marker、非削除を確認する。
    9. production checker または同一 production parser で unrelated/non-routing になったことを確認する。
    10. shadow parser の成功だけで完了扱いにしない。

    単なる current_body_sha256_mismatch で、candidate が現在も真正な C1/non-conflict である場合は、過去コメントの mutation よりも、fresh exact candidate-scoped decision の投稿と production checker の supersession を優先してください。

    複数 candidate を一コメントにまとめないでください。

    B. successor dependency の追加

    #1429 と #1754 を live readback し、次を確認してください。

    両立する場合、GitHub native dependency として #1745 が #1429/#1754 を block する successor edge を追加してください。

    まず native dependency のみで current checker が current_native_blocking provenance を認識できるか確認してください。

    current SSOT が Issue body と native dependency の同期を必須とする場合だけ、issue-author と edit-issue skill の controlled transaction を使い、候補 Issue の dependency metadata に #1745 を追加してください。

    候補 Issue の以下は変更禁止です。

    • Outcome
    • In Scope
    • Out of Scope
    • Acceptance Criteria
    • Verification Commands
    • Allowed Paths
    • security policy
    • delivery rule

    #1754 に body mutation が必要で PR #1787 が open の場合は、PR #1787 に次だけを明記してください。

    実行環境ごとの SubAgent 契約

    root thread は control-plane 専用です。

    repository file の編集、implementation test、commit、push、PR semantic review、review fix は root が直接行わず、実 SubAgent に委譲してください。

    Claude Code

    実際の Agent tool を使い、少なくとも次を spawn してください。

    • codebase-investigator
    • issue-author(dependency/Issue transaction が必要な場合)
    • implementation-worker
    • test-runner
    • pr-reviewer

    Codex CLI

    native custom-agent spawn を使い、少なくとも次を実際に spawn してください。

    • implementation-worker
    • test-runner
    • pr-reviewer

    複雑な read-only preflight では spark-deep を使用してよいですが、manual read-only analysis に限定してください。

    spark-worker を implementation-worker、issue-author、test-runner、pr-reviewer の代替にしないでください。

    shell 上で単に background process を /root/spark_* 等の名前で起動したことを SubAgent spawn とみなさないでください。

    Codex では .codex/hooks.json の SubagentStart event を通し、event-derived SUBAGENT_LAUNCH_LEDGER_V1 に実 launch が記録されることを確認してください。

    Phase 0 — current state の再構築

    最初に current main を取得し、root checkout の状態を確認してください。

    古い SHA を checkout しないでください。

    最低限、current main から以下を読み直してください。

    AGENTS.md
    CLAUDE.md
    docs/dev/workflow.md
    docs/dev/agent-skill-boundaries.md
    docs/dev/runtime-verification-policy.md
    docs/dev/secret-policy.md
    docs/dev/github-ops.md
    docs/dev/hook-boundaries.md
    docs/dev/repository-folder-policy.md
    
    .claude/settings.json
    .claude/hooks/**
    .claude/agents/codebase-investigator.md
    .claude/agents/issue-author.md
    .claude/agents/implementation-worker.md
    .claude/agents/test-runner.md
    .claude/agents/pr-reviewer.md
    
    .claude/skills/impl-review-loop/SKILL.md
    .claude/skills/impl-review-loop/steps/**
    .claude/skills/implement-issue/SKILL.md
    .claude/skills/edit-issue/SKILL.md
    .claude/skills/open-pr/SKILL.md
    .claude/skills/pr-review-judge/SKILL.md
    .claude/skills/ssot-discovery/SKILL.md
    
    .claude/skills/implement-issue/scripts/check_implementation_overlap.py
    .claude/skills/implement-issue/tests/test_check_implementation_overlap.py
    .claude/skills/edit-issue/scripts/edit_issue_txn.py
    
    .codex/config.toml
    .codex/agents/**
    .codex/hooks.json
    .codex/rules/default.rules
    
    scripts/check-codex-agents.mjs
    scripts/check_subagent_launch_ledger.py
    scripts/agent-guards/**
    

    .claude/skills/**/SKILL.md を手順の正本とし、secret policy は docs/dev/secret-policy.md を正本としてください。

    次を live GitHub から取得してください。

    current code で #1745 Outcome が既に実装済みかも確認してください。

    Phase 1 — read-only adversarial preflight

    read-only SubAgent に次を確認させ、構造化結果を返させてください。

    PREFLIGHT_AUDIT_V2:
      current_main_sha: "<sha>"
      issue_1745:
        state: "<state>"
        body_sha256: "sha256:<hash>"
        updated_at: "<timestamp>"
        existing_closing_prs: []
        outcome_already_implemented: false
      overlap_comments:
        rejected: []
        repair_required: []
        already_non_routing: []
      structural_candidates:
        - issue_number: 1429
          semantic_compatibility: compatible | contradiction | unknown
          edit_collision: true | false
          active_prs: []
          recommended_relation: successor | none | stop
        - issue_number: 1754
          semantic_compatibility: compatible | contradiction | unknown
          edit_collision: true | false
          active_prs: []
          recommended_relation: successor | none | stop
      pr_1787:
        state: "<state>"
        draft: true | false
        mergeable: "<value>"
        merge_state_status: "<value>"
        frozen_for_1745_priority: true | false
      blockers: []

    Phase 2 — minimum control-plane repair

    次の順番で処理してください。

    1. rejected routing comment の live rejected set を確定
    2. 承認範囲内の comment repair/fresh superseding decision
    3. 実装: update_branch.py を canonical branch-update executor に統一し、入力・race・postcondition を自己検証する #1429/実装: issue-reviewer SubAgent の最終応答から prose 要約を排除し canonical compact stdout 形式を強制する #1754 の successor dependency
    4. GitHub final readback
    5. fresh Issue 実装: Skill references/ の read permission と Agent/Skill 契約 strict validator を追加する #1745 body hash/dependency fingerprint の取得
    6. fresh contract snapshot
    7. fresh overlap preflight

    #1429/#1754 を true structural collision のまま C1/non-conflict として投稿しないでください。

    #1744 と #1732 の本文は変更しないでください。

    Phase 3 — fresh overlap preflight

    current main の implement-issue skill に記載された exact invocation を使ってください。

    route の正本は JSON の route です。exit code ではありません。

    必須条件:

    source:
      complete: true
      saturated: false
    
    human_c1_decisions:
      rejected: []

    route が human_review_required の場合、candidate ごとに次を実行してください。

    全体 preflight を再実行し、次のいずれかへ収束してから実装してください。

    • proceed
    • proceed_with_collision_evidence

    Phase 4 — #1745 implementation

    fresh contract snapshot を作成し、implementation-worker を iteration 0 で起動してください。

    Issue #1745 の live Outcome、In Scope、Allowed Paths、AC、VC を唯一の実装契約とします。

    親 #1732、兄弟 #1744、#1429、#1754 のコードを #1745 PR に取り込まないでください。

    TDD で進め、Allowed Paths のみ編集してください。

    Permission contract

    • .claude/settings.json の blanket Read(**/.claude/**) deny を廃止する
    • secret、credential、local settings の個別 deny を維持する
    • canonical Skill references と 実装: Skill references/ の read permission と Agent/Skill 契約 strict validator を追加する #1745 が所有する manifest/validator/runner path だけを必要最小限 allow する
    • broad Read allow を追加しない
    • bypassPermissions を使用しない
    • existing secret_boundary_guard を削除・弱体化しない
    • permission hook の allow が deny rule を上書きできると仮定しない

    Binding manifest

    live Issue に schema の固定指定があればそれに従ってください。

    固定されていない部分では、少なくとも以下の invariant を閉じてください。

    • schema/version identity
    • repository-local distribution scope
    • binding ID の一意性
    • active/pending closed enum
    • agent path、agent name、skill path、skill name
    • name と filename/directory の consistency
    • preload mapping
    • canonical references
    • deny paths
    • validator/runner/result schema version
    • terminal state identity
    • output schema identity
    • current manifest canonical hash
    • pending binding を active evidence として扱わない

    cross-repository distribution、plugin packaging、install smoke を実装・主張しないでください。

    Strict YAML validator

    既存の PyYAML と jsonschema を使用し、Allowed Paths 外の dependency file を変更しないでください。

    次を fail-closed にしてください。

    • duplicate mapping key
    • unknown key
    • missing required key
    • wrong scalar/list/mapping type
    • null where prohibited
    • non-string mapping key
    • invalid enum
    • duplicate binding ID
    • malformed frontmatter
    • manifest/agent/skill name mismatch
    • missing agent/skill/reference/schema path
    • repo root 外へ解決される path
    • symlink escape
    • wrong preload mapping
    • disable-model-invocation: true の Skill preload
    • active/pending invariant violation
    • terminal state/output schema drift
    • baseline/candidate/current-head/manifest hash mismatch

    current contract が明示的に許可しない限り、YAML merge key、custom tag、anchor/alias を拒否してください。

    JSON result schema は Draft 2020-12 または current repo の canonical dialectを明示し、閉じた object では additionalProperties: false または同等の strict check を使用してください。

    schema-valid だけで semantic invariant 達成とは扱わず、cross-field validation を Python validator で実施してください。

    Fresh-session permission smoke

    各 runtime case は独立した fresh Claude Code session で実行してください。

    current CLI が対応する場合、基本 contract は次です。

    claude -p
    --permission-mode dontAsk
    --no-session-persistence
    --output-format json
    --max-turns <bounded>
    

    current Issue/runner contract が --json-schema を要求する場合は使用してください。

    flag や runtime が利用不能な場合、silent fallback せず blocked または exit 77 としてください。

    次を記録してください。

    • Claude Code version

    • runtime model identity

    • permission mode

    • cwd/repository root

    • baseline SHA

    • candidate SHA

    • current PR head SHA

    • Issue body SHA

    • manifest hash

    • runner version

    • result schema version

    • case ID

    • start/finish timestamp

    • status: pass | fail | blocked

    • denial source:

      • built_in_permission
      • pretool_hook
      • sandbox_os_enforced
      • not_os_enforced
    • artifact path

    • artifact digest

    最低限の case:

    1. safe control read
    2. canonical references positive read
    3. secret path negative
    4. .claude/settings.local.json negative
    5. credential path negative
    6. missing reference negative
    7. malformed manifest negative
    8. pending binding must not become active
    9. baseline/candidate/head/manifest hash drift negative

    positive control が失敗した状態で、negative deny だけを成功扱いにしないでください。

    dontAsk により未許可 tool 全体が拒否された結果を、specific secret deny の証明として扱わないでください。safe control と references positive case により一般 read が成立することを先に証明してください。

    Option A が保証するのは built-in permission と既存 hook の対象範囲です。sandbox の OS-level arbitrary subprocess isolation を追加していない場合、結果に not_os_enforced を明記し、任意 Python/Node subprocess まで完全に防止したと主張しないでください。

    raw transcript、session resume data、credential 値、環境変数 dump は保存しないでください。

    Phase 5 — verification

    実装後、別セッションの test-runner を起動してください。

    入力には必ず次を含めてください。

    Issue #1745 の current Verification Commands をすべて実行してください。

    加えて repository standard checks を実行してください。

    pnpm typecheck
    pnpm lint
    pnpm test
    pnpm build

    判定規則:

    • SKIP は PASS ではない
    • exit 77 は blocked/skip
    • fallback success は PASS ではない
    • mock/synthetic session は actual runtime PASS の代替にならない
    • required artifact 欠落は FAIL
    • runtime case が全件実行不能なら blocked
    • baseline failure と candidate regression を区別する
    • head が変わったら旧 runtime/TEST_VERDICT を無効化する
    • secret 値や raw transcript を artifact に含めない

    current head に束縛された TEST_VERDICT_MACHINE/v2 を生成してください。

    Phase 6 — commit、push、Draft PR

    implementation-worker と open-pr skill の controlled route を使用してください。

    禁止:

    git add .
    git add -A
    --no-verify
    force push
    direct push to main
    raw gh pr create
    

    変更ファイルを列挙して個別 stage してください。

    Draft PR 本文には最低限次を含めてください。

    Phase 7 — current-head CI and review loop

    1. current PR head SHA を取得
    2. current head の required CI を待つ
    3. failure の場合だけ必要なログを取得
    4. baseline failure と差分起因 failure を分類
    5. 差分起因なら implementation-worker に bounded fix delta を渡す
    6. head が変わるたび test-runner を再実行
    7. current-head CI 完了後に pr-reviewer を spawn
    8. pr-reviewer は current Issue contract、diff、CI、runtime artifact、Allowed Paths をレビュー
    9. REQUEST_CHANGES は指摘 delta だけを worker に戻す
    10. 最大 3 iterations
    11. APPROVE 後も merge_ready と required_auto_actions を確認
    12. PR はマージしない

    終了条件:

    LOOP_VERDICT_V2:
      verdict: APPROVE
      merge_ready: true
      required_auto_actions: []
      reviewed_head_sha: "<current PR head SHA>"

    次が一つでもあれば merge-ready にしないでください。

    • unresolved review thread
    • current-head CI failure/pending
    • stale head
    • stale contract snapshot
    • Allowed Paths gate が ok 以外
    • runtime blocked/skip
    • Issue body SHA mismatch
    • manifest/artifact digest mismatch
    • mandatory SubAgent launch evidence 欠落
    • pending binding を active とした証跡

    停止条件

    次の場合だけ停止してください。

    次は停止理由ではありません。

    • PR fix(claude): issue-reviewer compact output hook を追加 #1787 が open/Draft/BEHIND
    • fix 可能な malformed overlap comment
    • stale body hash/snapshot
      -通常の test/lint/typecheck/build failure
    • 差分起因 CI failure
    • PR body hygiene
    • review request
    • normal branch update
    • current main の進行
    • successor dependency の追加
    • head 変更後の artifact 再生成

    最終出力

    散文ではなく、次の二つの YAML document を返してください。

    SUBAGENT_EXECUTION_SUMMARY_V2:
      runtime: claude_code | codex_cli
      launch_ledger_path: "<path|null>"
      ledger_valid: true | false | not_applicable
      launches:
        - agent: "<name>"
          role: "<role>"
          runtime_spawn_verified: true | false
          status: completed | skipped | blocked
      root_data_plane_violations: []
    EXECUTION_RESULT_V2:
      repository: squne121/loop-protocol
      priority_decision: issue_1745_first
      issue_number: 1745
      status: merge_ready | blocked | failed
      current_main_sha: "<sha>"
      issue_body_sha256: "sha256:<hash>"
      contract_snapshot_url: "<url|null>"
      control_plane_repairs:
        comments:
          updated: []
          already_non_routing: []
          fresh_decisions_posted: []
          remaining_rejected: []
        dependencies:
          issue_1429: "<result>"
          issue_1754: "<result>"
          pr_1787: frozen | not_open | blocked
      overlap_preflight:
        route: "<route>"
        complete: true | false
        saturated: true | false
        rejected_human_decisions: []
        evidence_sha256: "sha256:<hash|null>"
      implementation:
        worktree: "<path|null>"
        branch: "<branch|null>"
        commit_sha: "<sha|null>"
        changed_files: []
        manifest_sha256: "sha256:<hash|null>"
      pull_request:
        url: "<url|null>"
        head_sha: "<sha|null>"
        draft: true | false
      verification:
        static: pass | fail | blocked
        runtime: pass | fail | blocked
        ci: pass | fail | pending
        enforcement_scope: "<summary>"
        artifacts: []
      review:
        verdict: APPROVE | REQUEST_CHANGES | null
        merge_ready: true | false
        required_auto_actions: []
        reviewed_head_sha: "<sha|null>"
      blockers: []
      next_action: "<single exact action>"

    この版は Claude Code/Codex CLI 共通です。環境別に分割する場合は、SubAgent spawn と launch-ledger 部分だけを専用化すれば足ります。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/implementerenhancementphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions