Skip to content

実装: session recording no-push / private checkpoint / local-only verifier を追加する #379

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#242"
goal_ref: "session 記録ツール(EntireCLI 等)が public GitHub へ transcript / checkpoint を push しないことを機械的に検証する verifier を追加する"
change_kind: code

Parent Issue

#242

Parent Goal Ref

  • Goal: session 記録ツール導入時に checkpoint / transcript が local-only または private checkpoint のみになることを fail-closed で確認する
  • Desired Destination: public checkpoint branch / auto-push / unknown visibility のいずれかが検出されたら session recording を disable する verifier

Current Validated Scope

  • git ls-remote --exit-code --refs origin refs/heads/entire/checkpoints/v1 実行と exit code 判定(exit 0: branch exists → FAIL、exit 2: branch absent → PASS、その他: FAIL-CLOSED)
  • .entire/settings.json / .entire/settings.local.json の strategy_options.push_sessions 評価(merge 後 true → FAIL、false のみ PASS 候補、unknown/parse error → FAIL-CLOSED)
  • git config --show-origin --show-scope --get-regexp '^(remote|branch|url)\.' による effective config 評価
  • checkpoint_remote visibility 判定(private_verified | local-only のみ pass、unknown / unreachable / parse error は fail-closed)
  • GitHub API gh repo view "$owner/$repo" --json visibility --jq .visibility による remote visibility 確認(失敗時 unknown → FAIL-CLOSED)
  • git rev-parse --git-path hooks で実 hook dir 取得と session recording push hook 検査
  • agent hook files スキャン(.claude/settings.json 等)
  • fixture test による malicious scenario の検証

Remaining Parent Gaps

  • producer 本体実装 (Issue A)
  • validation gate (Issue B)
  • Kill Switch runtime smoke (Issue D)

Outcome

.claude/scripts/check_session_recording_runtime_safety.py (または .sh) が実装され、session 記録ツール (EntireCLI 等) が以下の条件で fail-closed で検出する状態:

  1. public checkpoint branch (entire/checkpoints/v1 が origin に存在) → FAIL
  2. auto-push 設定有効 (strategy_options.push_sessions: true) → FAIL
  3. checkpoint remote visibility unknown または public → FAIL(fail-closed)
  4. Git hook または agent hook files に session transcript push が残存 → FAIL
  5. insteadOf / pushInsteadOf で public remote へ redirect → FAIL

verifier は local developer、CI などから呼び出され、危険条件を検出したら exit 1+ を返す。
本 Issue のスコープは script + fixture test の実装のみ。hook/CI/EntireCLI producer/runtime kill switch への wiring は別 Issue で対応する。

In Scope

  • .claude/scripts/check_session_recording_runtime_safety.py (新規作成)
  • git ls-remote --exit-code --refs origin refs/heads/entire/checkpoints/v1 実行と exit code 判定
    • exit 0: branch exists → FAIL
    • exit 2: branch absent → branch check PASS
    • その他 non-zero (network/auth error 等): FAIL-CLOSED
  • .entire/settings.json と .entire/settings.local.json を merge し strategy_options.push_sessions を評価
    • effective_push_sessions = merge(settings.json, settings.local.json).strategy_options.push_sessions
    • true → FAIL、unknown / parse error / unsupported schema → FAIL-CLOSED、false のみ PASS 候補
  • git config --show-origin --show-scope --get-regexp '^(remote|branch|url)\.' による effective config 評価
    • remote.*.url, remote.*.pushurl, remote.pushDefault, branch.*.pushRemote
    • url.*.insteadOf, url.*.pushInsteadOf, include.path, includeIf.*.path
    • local / worktree / global / system / includeIf すべての合成結果を評価する
  • gh repo view "$owner/$repo" --json visibility --jq .visibility で remote visibility を確認(explicit repo + built-in jq、失敗時は unknown → FAIL-CLOSED)
  • git rev-parse --git-path hooks で actual $GIT_DIR/hooks ディレクトリを取得し session recording push hook を検査
  • 以下の agent hook files を session recording push 実行の有無でスキャン:
    • .claude/settings.json
    • .codex/hooks.json
    • .github/hooks/entire.json
    • .cursor/hooks.json
    • .factory/settings.json
    • .gemini/settings.json
    • .opencode/plugins/entire.ts
    • .pi/extensions/entire/index.ts
  • fixture test で以下シナリオを検証:
    • public checkpoint branch 存在時は FAIL
    • auto-push 有効時は FAIL
    • visibility unknown 時は FAIL-CLOSED
    • private_verified 時は PASS
    • local-only 時は PASS
  • verifier が secret を stdout/stderr に出力しない設計

Out of Scope

  • producer 本体実装 (Issue A)
  • validation gate (Issue B)
  • Kill Switch runtime smoke (Issue D)
  • secret exposure scanner (Issue D)
  • hook/CI/EntireCLI producer/runtime kill switch への wiring(別 Issue で対応)

Acceptance Criteria

  • AC1: .claude/scripts/check_session_recording_runtime_safety.py が存在する
  • AC2: git ls-remote --exit-code --refs origin refs/heads/entire/checkpoints/v1 で exit 0 (branch exists) 時に FAIL、exit 2 (branch absent) 時に branch check PASS、その他 non-zero 時に FAIL-CLOSED とする
  • AC3: strategy_options.push_sessions を .entire/settings.json と .entire/settings.local.json の merge 結果で評価し、true → FAIL、unknown/parse error → FAIL-CLOSED、false のみ PASS 候補とする
  • AC4: git config --show-origin --show-scope で取得した effective config(remote.*.pushurl, branch.*.pushRemote, url.*.pushInsteadOf, includeIf 等)で public destination への push を検出時に FAIL する
  • AC5: checkpoint remote visibility が unknown の場合は fail-closed で FAIL する
  • AC6: checkpoint remote visibility が private_verified の場合は PASS する
  • AC7: git rev-parse --git-path hooks で取得した実 hook dir と agent hook files (.claude/settings.json 等) に session transcript recording push が残存する場合は FAIL する
  • AC8: verifier の diagnostics は machine-readable code と redacted fingerprint のみを出力し、raw command 出力・token (ghp_/sk-/ENTIRE_*)・URL credential・絶対 path(Windows/POSIX 両形式)を含まない設計にする
  • AC9: fixture test で valid シナリオ (local-only / private_verified) が PASS する
  • AC10: fixture test で invalid シナリオ (public branch / auto-push / unknown visibility) が FAIL する
  • AC11: pnpm typecheck, pnpm lint, pnpm test, pnpm build が pass する
  • AC12: checkpoint_remote unreachable → FAIL-CLOSED
  • AC13: checkpoint_remote parse error → FAIL-CLOSED
  • AC14: ENTIRE_CHECKPOINT_TOKEN present かつ checkpoint remote absent/unverified → FAIL-CLOSED
  • AC15: fallback to origin が発生し得る設定(checkpoint_remote unreachable + ENTIRE_CHECKPOINT_TOKEN 設定あり)→ FAIL-CLOSED
  • AC16: non-GitHub remote は visibility unknown として FAIL-CLOSED(明示 allowlist がない限り PASS しない)
  • AC17: fixture: ls-remote auth error / timeout → FAIL-CLOSED
  • AC18: fixture: .entire/settings.local.json が strategy_options.push_sessions:true で override → FAIL
  • AC19: fixture: top-level push_sessions:false のみ存在し nested key 不明 → FAIL-CLOSED
  • AC20: fixture: global url.*.pushInsteadOf が public GitHub repo に rewrite → FAIL
  • AC21: fixture: remote.origin.pushurl が public repo → FAIL
  • AC22: fixture: checkpoint_remote private_verified + push_sessions:false + no public origin checkpoint branch → PASS
  • AC23: fixture: ENTIRE_CHECKPOINT_TOKEN present + checkpoint remote absent → FAIL-CLOSED
  • AC24: fixture: .claude/settings.json に entire checkpoint push hook あり → FAIL
  • AC25: fixture: diagnostics に ghp_*/sk-*/絶対 path が混入 → FAIL

Verification Commands

# AC1: verifier script 存在
$ test -f .claude/scripts/check_session_recording_runtime_safety.py

# AC2: public branch 検出(exit code 意味論含む)
$ pnpm test -- --testPathPattern="runtime.*safety.*public"

# AC3: auto-push 検出(strategy_options.push_sessions キー)
$ rg "strategy_options.*push_sessions|push_sessions.*true" tests/
$ pnpm test -- --testPathPattern="runtime.*safety.*push"

# AC4: effective config 経由 public remote 検出
$ pnpm test -- --testPathPattern="runtime.*safety.*remote"

# AC5: unknown visibility fail-closed
$ pnpm test -- --testPathPattern="runtime.*safety.*unknown"

# AC6: private_verified PASS
$ pnpm test -- --testPathPattern="runtime.*safety.*private"

# AC7: Git hook + agent hook files 検査
# preflight-scope: runtime_only
$ rg "git-path.*hooks|agent.*hook|claude.*settings|codex.*hooks" .claude/scripts/check_session_recording_runtime_safety.py

# AC8: secret 出力なし(ghp_, sk-, ENTIRE_, URL credential, abs path 含む)
# preflight-scope: runtime_only
$ ! pnpm test -- --testPathPattern="runtime.*safety" 2>&1 | rg "ghp_[0-9a-zA-Z]+|sk-[0-9a-zA-Z]+|ENTIRE_[A-Z_]+=\S+|https?://[^@]+@|/home/|/Users/|[A-Z]:\\Users\\"

# AC9: valid fixture PASS
$ pnpm test -- --testPathPattern="runtime.*safety.*valid"

# AC10: invalid fixture FAIL
$ pnpm test -- --testPathPattern="runtime.*safety.*invalid"

# AC11: 品質ゲート
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm build

# AC12: checkpoint_remote unreachable → FAIL-CLOSED
$ pnpm test -- --testPathPattern="runtime.*safety.*checkpoint.*unreachable"

# AC13: checkpoint_remote parse error → FAIL-CLOSED
$ pnpm test -- --testPathPattern="runtime.*safety.*checkpoint.*parse"

# AC14: ENTIRE_CHECKPOINT_TOKEN present + checkpoint remote absent/unverified → FAIL-CLOSED
$ pnpm test -- --testPathPattern="runtime.*safety.*token.*absent"

# AC15: fallback to origin が発生し得る設定 → FAIL-CLOSED
$ pnpm test -- --testPathPattern="runtime.*safety.*fallback.*origin"

# AC16: non-GitHub remote → visibility unknown → FAIL-CLOSED
$ pnpm test -- --testPathPattern="runtime.*safety.*non.*github"

# AC17: fixture: ls-remote auth error / timeout → FAIL-CLOSED
$ pnpm test -- --testPathPattern="runtime.*safety.*ls.*remote.*error"

# AC18: fixture: settings.local.json が strategy_options.push_sessions:true で override → FAIL
$ pnpm test -- --testPathPattern="runtime.*safety.*local.*override"

# AC19: fixture: top-level push_sessions:false のみ・nested key 不明 → FAIL-CLOSED
$ pnpm test -- --testPathPattern="runtime.*safety.*push.*sessions.*toplevel"

# AC20: fixture: global url.*.pushInsteadOf → public GitHub → FAIL
$ pnpm test -- --testPathPattern="runtime.*safety.*push.*instead"

# AC21: fixture: remote.origin.pushurl → public repo → FAIL
$ pnpm test -- --testPathPattern="runtime.*safety.*pushurl"

# AC22: fixture: checkpoint_remote private_verified + push_sessions:false + no public branch → PASS
$ pnpm test -- --testPathPattern="runtime.*safety.*private.*verified.*pass"

# AC23: fixture: ENTIRE_CHECKPOINT_TOKEN present + checkpoint remote absent → FAIL-CLOSED
$ pnpm test -- --testPathPattern="runtime.*safety.*token.*checkpoint.*absent"

# AC24: fixture: .claude/settings.json に entire checkpoint push hook あり → FAIL
$ pnpm test -- --testPathPattern="runtime.*safety.*claude.*hook"

# AC25: fixture: diagnostics に ghp_*/sk-*/絶対 path が混入 → FAIL
$ pnpm test -- --testPathPattern="runtime.*safety.*diagnostics.*secret"

Allowed Paths

  • .claude/scripts/check_session_recording_runtime_safety.py (新規作成)
  • tests/**/check_session_recording_runtime_safety*
  • tests/**/session_recording_runtime_safety*
  • tests/fixtures/session-recording-runtime-safety/**

Stop Conditions

  • Allowed Paths 外への変更が必要と判明
  • In Scope の固定契約(fail-closed condition)の変更が必要
  • new Issue 起票が必要と判明
  • nested SubAgent delegation が必要
  • 実 secret / token を fixture に含めようとした場合(即停止)
  • pnpm typecheck/lint/test/build のいずれかが fail した場合

Runtime Verification Applicability

decision: immediate
rationale: verifier の実行(git ls-remote mock、fixture test、CI dry-run)が必須。public branch 検出、auto-push 検査、visibility 判定は実行時に検証される。

Related

Source

source: refinement_loop_followup
origin_issue: "#326"
anchor_comment_url: "https://github.com/squne121/loop-protocol/issues/326#issuecomment-4528499380"
dedupe_key: "326-followup-C"

Required Skills

  • なし(implementation issue)

Activity

  1. added
    kind/implementation
    area/security
    area/ai-ops
    on May 24, 2026
  2. squne121 commented on May 28, 2026

    @squne121
    OwnerAuthor

    判定

    REQUEST_CHANGES。 Issue #379 は必要な安全弁ですが、現状の契約のまま実装すると「no-push / private checkpoint / local-only verifier」としては穴が残ります。特に、EntireCLI の実際の保存・push 挙動、Git の effective config、hook surface、git ls-remote の exit code 意味論が十分に契約化されていません。#379 自体は open で、表示上はまだ linked branch / PR がありません。(GitHub)

    前提整理

    #379 は、.claude/scripts/check_session_recording_runtime_safety.py を追加し、public checkpoint branch、push_sessions:true、unknown/public checkpoint remote、session recording push hook、insteadOf/pushInsteadOf による public redirect を fail-closed にする Issue です。親 #242 は「全 mode で public full transcript 不許可」「checkpoint remote は private_verified のみ」「unknown は fail-closed」を定義済みで、PR #323 で policy/checker は merge 済みです。つまり #379 は policy 文書ではなく、実行時・リポジトリ実体の検証境界です。(GitHub)

    EntireCLI は session transcript / prompt / modified file metadata を entire/checkpoints/v1 に保存し、push_sessions や checkpoint_remote によって checkpoint branch を remote に送れます。公式 README は、public repo では transcript が public に見えること、redaction は best-effort であり、shadow branch の raw blob には unredacted code snapshot が残り得ることを明記しています。したがって「見えている設定だけを grep する verifier」では不十分です。(GitHub)

    Blockers

    1. git ls-remote origin entire/checkpoints/v1 は branch 検出コマンドとして弱い

    #379 の AC/VC は git ls-remote origin entire/checkpoints/v1 と refs/heads/entire/checkpoints/v1 が混在しています。Git の ls-remote は通常、マッチする ref がなくても exit 0 になり得ます。--exit-code を使うと「ref なし」が exit 2 になり、通信失敗・認証失敗などとは区別できます。ここを契約に入れないと、network/auth error を「branch なし」と誤判定する危険があります。(GitHub)

    修正案:

    git ls-remote --exit-code --refs origin refs/heads/entire/checkpoints/v1
    

    判定は次で固定すべきです。

    • exit 0: branch exists → FAIL

    • exit 2: branch absent → branch check only PASS

    • その他 non-zero: unknown → FAIL-CLOSED

    2. Git の effective push destination を見ていない

    #379 は .git/config の pushRemote / insteadOf / pushInsteadOf を見る方針ですが、Git config は local / worktree / global / system / includeIf の合成結果として効きます。さらに url.<base>.insteadOf / url.<base>.pushInsteadOf は URL rewrite を行い、明示的な pushurl がある場合は pushInsteadOf が無視されます。.git/config だけを読む設計では、global config や conditional include 経由の public redirect を見逃します。(GitHub)

    修正案: verifier は最低限、次を effective config として評価するべきです。

    • git config --show-origin --show-scope --get-regexp '^(remote|branch|url)\.'

    • remote.*.url

    • remote.*.pushurl

    • remote.pushDefault

    • branch.*.pushRemote

    • url.*.insteadOf

    • url.*.pushInsteadOf

    • include.path / includeIf.*.path

    3. EntireCLI の設定キー解釈が曖昧

    #379 は .entire/settings.json / .entire/settings.local.json の push_sessions:false を確認すると書いていますが、EntireCLI の README 上の設定は strategy_options.push_sessions です。local settings が project settings を override する形もあり、単純に top-level push_sessions を探す実装だと false positive / false negative が出ます。(GitHub)

    修正案: Issue 契約に次を明記すべきです。

    effective_push_sessions = merge(.entire/settings.json, .entire/settings.local.json).strategy_options.push_sessions
    

    そして true は FAIL、unknown / parse error / unsupported schema は FAIL-CLOSED。false のみ pass 候補にするべきです。

    4. checkpoint_remote の fallback / unreachable 挙動が危険経路として未契約

    EntireCLI は checkpoint_remote が設定されている場合でも、remote に到達できないと warning を出して main push を継続する挙動が説明されています。また ENTIRE_CHECKPOINT_TOKEN がある場合、checkpoint remote の config load に失敗すると origin へ fallback し、HTTPS URL に変換して token を注入する挙動があります。#379 の「private_verified / local-only / unknown fail-closed」だけでは、この fallback 経路が fixture 化されていません。(GitHub)

    修正案: 追加 AC が必要です。

    • checkpoint_remote unreachable → FAIL-CLOSED

    • checkpoint_remote parse error → FAIL-CLOSED

    • ENTIRE_CHECKPOINT_TOKEN present かつ checkpoint remote absent/unverified → FAIL-CLOSED

    • fallback to origin が発生し得る設定 → FAIL-CLOSED

    • non-GitHub remote は visibility unknown として FAIL-CLOSED、明示 allowlist がない限り pass しない

    5. hook surface が .git/hooks 前提に寄りすぎている

    #379 は Git hook の session recording push を検出対象にしていますが、EntireCLI は Git hooks だけでなく、Claude / Codex / Copilot / Cursor / Factory / Gemini / OpenCode / Pi などの agent-specific hook location を使う設計です。README では .claude/settings.json、.codex/hooks.json、.github/hooks/entire.json、.cursor/hooks.json、.factory/settings.json、.gemini/settings.json などが hook location として列挙されています。(GitHub)

    修正案: #379 の in-scope に次を追加すべきです。

    Scan agent hook files:
    - .claude/settings.json
    - .codex/hooks.json
    - .github/hooks/entire.json
    - .cursor/hooks.json
    - .factory/settings.json
    - .gemini/settings.json
    - .opencode/plugins/entire.ts
    - .pi/extensions/entire/index.ts
    

    Scan actual Git hook directory via git rev-parse --git-path hooks, not git ls-files .git/hooks/.

    git ls-files .git/hooks/ は通常の Git index 上の追跡ファイルしか見ないため、実際の $GIT_DIR/hooks/* 検査としては不適切です。

    6. 「exit 1 で session recording を止める」と言うには integration が足りない

    #379 の Outcome は verifier が exit 1+ で session recording を stop すると書いています。一方で allowed paths は script と tests だけで、Claude hook / CI / EntireCLI producer / runtime kill switch への wiring は out-of-scope です。このままだと「script はあるが、誰も必ず呼ばない」状態になります。#325 は policy checker を Claude Stop/SubagentStop hook に接続する Issue でしたが、#379 は runtime verifier について同等の接続を持っていません。(GitHub)

    修正案: どちらかに寄せるべきです。

    現状の文面は B を約束しているのに scope は A です。

    Should Fix

    gh repo view の扱いを harden する

    GitHub CLI は gh repo view --json visibility をサポートしていますが、#379 の gh repo view <owner/repo> --json visibility | jq .visibility は、jq 依存、repo 推定、SSH URL parse、GitHub Enterprise host、認証失敗の扱いが曖昧です。gh repo view "$owner/$repo" --json visibility --jq .visibility のように explicit repo + built-in jq に寄せ、失敗時は必ず unknown → FAIL-CLOSED にするべきです。(GitHub)

    stdout/stderr の secret/path 検査が粗い

    #379 の AC8 は token/secret/absolute path を出さない要求ですが、VC は token|secret|api_key|/home/|/Users/ 程度です。これは Windows path、URL credential、ghp_、sk-、private key block、高 entropy secret、repo-local absolute path を取りこぼします。EntireCLI 自体も redaction を best-effort と明記しているため、verifier の diagnostics は「生出力を隠す」のではなく、最初から machine-readable code と redacted fingerprint のみにすべきです。(GitHub)

    #246 pilot gate との接続を明記する

    #246 は session recording pilot の前提として no-push/private checkpoint/manual review を要求しています。#379 が未完了または warning-only なら、pilot evidence として採用してはいけません。#379 の completion comment には「#246 の preflight prerequisite を満たす/満たさない」を明示させるべきです。(GitHub)

    追加すべき fixture matrix

    最低限、次の fixtures を AC に落とすべきです。

    Case Expected
    public origin に refs/heads/entire/checkpoints/v1 が存在 FAIL
    ls-remote auth error / timeout / DNS error FAIL-CLOSED
    .entire/settings.local.json が strategy_options.push_sessions:true で override FAIL
    top-level push_sessions:false だけ存在し、nested key 不明 FAIL-CLOSED
    global url.*.pushInsteadOf が public GitHub repo に rewrite FAIL
    explicit remote.origin.pushurl が public repo FAIL
    checkpoint_remote private_verified + push_sessions:false + no public origin checkpoint branch PASS
    checkpoint_remote public / unknown / gh auth failure FAIL
    ENTIRE_CHECKPOINT_TOKEN present + checkpoint remote missing/unverified FAIL
    .claude/settings.json / .codex/hooks.json が entire or git push ... entire/checkpoints/v1 を実行 FAIL
    actual $GIT_DIR/hooks/pre-push が checkpoint branch を push FAIL
    diagnostics に sk-... / ghp_... / /home/... / C:\Users... / URL credential が混入 FAIL

    Issue #379 への修正文案

    この Issue は以下のように強めるのが安全です。

    Verifier MUST evaluate effective runtime safety, not only checked-in policy files.
    

    PASS requires all of:

    1. effective strategy_options.push_sessions is exactly false
    2. public origin does not expose refs/heads/entire/checkpoints/v1
    3. checkpoint route is local-only or private_verified
    4. all GitHub visibility checks are explicit and authenticated; unknown means fail-closed
    5. effective Git push destinations after config scopes/includes/rewrite are not public checkpoint destinations
    6. Git hooks and agent hook files do not push session recording/checkpoint refs
    7. diagnostics are redacted by construction and never include raw command stdout/stderr, tokens, URLs with credentials, or absolute paths

    Any parse error, command failure, unknown visibility, unsupported provider, or ambiguous effective destination MUST fail closed.

    最終判断

    #379 は 実装してよいが、現契約のままでは merge すべきでない です。特に ls-remote exit semantics、EntireCLI の strategy_options.push_sessions / checkpoint_remote fallback、Git effective config、agent hook surface を AC/VC に入れないと、「安全確認に通ったのに public transcript/checkpoint が出る」事故を防げません。

    ## 判定

    REQUEST_CHANGES。 Issue #379 は必要な安全弁ですが、現状の契約のまま実装すると「no-push / private checkpoint / local-only verifier」としては穴が残ります。特に、EntireCLI の実際の保存・push 挙動、Git の effective config、hook surface、git ls-remote の exit code 意味論が十分に契約化されていません。#379 自体は open で、表示上はまだ linked branch / PR がありません。([GitHub]1)

    前提整理

    #379 は、.claude/scripts/check_session_recording_runtime_safety.py を追加し、public checkpoint branch、push_sessions:true、unknown/public checkpoint remote、session recording push hook、insteadOf/pushInsteadOf による public redirect を fail-closed にする Issue です。親 #242 は「全 mode で public full transcript 不許可」「checkpoint remote は private_verified のみ」「unknown は fail-closed」を定義済みで、PR #323 で policy/checker は merge 済みです。つまり #379 は policy 文書ではなく、実行時・リポジトリ実体の検証境界です。([GitHub]1)

    EntireCLI は session transcript / prompt / modified file metadata を entire/checkpoints/v1 に保存し、push_sessions や checkpoint_remote によって checkpoint branch を remote に送れます。公式 README は、public repo では transcript が public に見えること、redaction は best-effort であり、shadow branch の raw blob には unredacted code snapshot が残り得ることを明記しています。したがって「見えている設定だけを grep する verifier」では不十分です。([GitHub]2)

    Blockers

    1. git ls-remote origin entire/checkpoints/v1 は branch 検出コマンドとして弱い

    #379 の AC/VC は git ls-remote origin entire/checkpoints/v1 と refs/heads/entire/checkpoints/v1 が混在しています。Git の ls-remote は通常、マッチする ref がなくても exit 0 になり得ます。--exit-code を使うと「ref なし」が exit 2 になり、通信失敗・認証失敗などとは区別できます。ここを契約に入れないと、network/auth error を「branch なし」と誤判定する危険があります。([GitHub]1)

    修正案:

    git ls-remote --exit-code --refs origin refs/heads/entire/checkpoints/v1
    

    判定は次で固定すべきです。

    • exit 0: branch exists → FAIL
    • exit 2: branch absent → branch check only PASS
    • その他 non-zero: unknown → FAIL-CLOSED

    2. Git の effective push destination を見ていない

    #379 は .git/config の pushRemote / insteadOf / pushInsteadOf を見る方針ですが、Git config は local / worktree / global / system / includeIf の合成結果として効きます。さらに url.<base>.insteadOf / url.<base>.pushInsteadOf は URL rewrite を行い、明示的な pushurl がある場合は pushInsteadOf が無視されます。.git/config だけを読む設計では、global config や conditional include 経由の public redirect を見逃します。([GitHub]1)

    修正案: verifier は最低限、次を effective config として評価するべきです。

    • git config --show-origin --show-scope --get-regexp '^(remote|branch|url)\.'
    • remote.*.url
    • remote.*.pushurl
    • remote.pushDefault
    • branch.*.pushRemote
    • url.*.insteadOf
    • url.*.pushInsteadOf
    • include.path / includeIf.*.path

    3. EntireCLI の設定キー解釈が曖昧

    #379 は .entire/settings.json / .entire/settings.local.json の push_sessions:false を確認すると書いていますが、EntireCLI の README 上の設定は strategy_options.push_sessions です。local settings が project settings を override する形もあり、単純に top-level push_sessions を探す実装だと false positive / false negative が出ます。([GitHub]1)

    修正案: Issue 契約に次を明記すべきです。

    effective_push_sessions = merge(.entire/settings.json, .entire/settings.local.json).strategy_options.push_sessions
    

    そして true は FAIL、unknown / parse error / unsupported schema は FAIL-CLOSED。false のみ pass 候補にするべきです。

    4. checkpoint_remote の fallback / unreachable 挙動が危険経路として未契約

    EntireCLI は checkpoint_remote が設定されている場合でも、remote に到達できないと warning を出して main push を継続する挙動が説明されています。また ENTIRE_CHECKPOINT_TOKEN がある場合、checkpoint remote の config load に失敗すると origin へ fallback し、HTTPS URL に変換して token を注入する挙動があります。#379 の「private_verified / local-only / unknown fail-closed」だけでは、この fallback 経路が fixture 化されていません。([GitHub]2)

    修正案: 追加 AC が必要です。

    • checkpoint_remote unreachable → FAIL-CLOSED
    • checkpoint_remote parse error → FAIL-CLOSED
    • ENTIRE_CHECKPOINT_TOKEN present かつ checkpoint remote absent/unverified → FAIL-CLOSED
    • fallback to origin が発生し得る設定 → FAIL-CLOSED
    • non-GitHub remote は visibility unknown として FAIL-CLOSED、明示 allowlist がない限り pass しない

    5. hook surface が .git/hooks 前提に寄りすぎている

    #379 は Git hook の session recording push を検出対象にしていますが、EntireCLI は Git hooks だけでなく、Claude / Codex / Copilot / Cursor / Factory / Gemini / OpenCode / Pi などの agent-specific hook location を使う設計です。README では .claude/settings.json、.codex/hooks.json、.github/hooks/entire.json、.cursor/hooks.json、.factory/settings.json、.gemini/settings.json などが hook location として列挙されています。([GitHub]1)

    修正案: #379 の in-scope に次を追加すべきです。

    Scan agent hook files:
    - .claude/settings.json
    - .codex/hooks.json
    - .github/hooks/entire.json
    - .cursor/hooks.json
    - .factory/settings.json
    - .gemini/settings.json
    - .opencode/plugins/entire.ts
    - .pi/extensions/entire/index.ts
    
    Scan actual Git hook directory via git rev-parse --git-path hooks, not git ls-files .git/hooks/.
    

    git ls-files .git/hooks/ は通常の Git index 上の追跡ファイルしか見ないため、実際の $GIT_DIR/hooks/* 検査としては不適切です。

    6. 「exit 1 で session recording を止める」と言うには integration が足りない

    #379 の Outcome は verifier が exit 1+ で session recording を stop すると書いています。一方で allowed paths は script と tests だけで、Claude hook / CI / EntireCLI producer / runtime kill switch への wiring は out-of-scope です。このままだと「script はあるが、誰も必ず呼ばない」状態になります。#325 は policy checker を Claude Stop/SubagentStop hook に接続する Issue でしたが、#379 は runtime verifier について同等の接続を持っていません。([GitHub]1)

    修正案: どちらかに寄せるべきです。

    現状の文面は B を約束しているのに scope は A です。

    Should Fix

    gh repo view の扱いを harden する

    GitHub CLI は gh repo view --json visibility をサポートしていますが、#379 の gh repo view <owner/repo> --json visibility | jq .visibility は、jq 依存、repo 推定、SSH URL parse、GitHub Enterprise host、認証失敗の扱いが曖昧です。gh repo view "$owner/$repo" --json visibility --jq .visibility のように explicit repo + built-in jq に寄せ、失敗時は必ず unknown → FAIL-CLOSED にするべきです。([GitHub]1)

    stdout/stderr の secret/path 検査が粗い

    #379 の AC8 は token/secret/absolute path を出さない要求ですが、VC は token|secret|api_key|/home/|/Users/ 程度です。これは Windows path、URL credential、ghp_、sk-、private key block、高 entropy secret、repo-local absolute path を取りこぼします。EntireCLI 自体も redaction を best-effort と明記しているため、verifier の diagnostics は「生出力を隠す」のではなく、最初から machine-readable code と redacted fingerprint のみにすべきです。([GitHub]1)

    #246 pilot gate との接続を明記する

    #246 は session recording pilot の前提として no-push/private checkpoint/manual review を要求しています。#379 が未完了または warning-only なら、pilot evidence として採用してはいけません。#379 の completion comment には「#246 の preflight prerequisite を満たす/満たさない」を明示させるべきです。([GitHub]3)

    追加すべき fixture matrix

    最低限、次の fixtures を AC に落とすべきです。

    Case Expected
    public origin に refs/heads/entire/checkpoints/v1 が存在 FAIL
    ls-remote auth error / timeout / DNS error FAIL-CLOSED
    .entire/settings.local.json が strategy_options.push_sessions:true で override FAIL
    top-level push_sessions:false だけ存在し、nested key 不明 FAIL-CLOSED
    global url.*.pushInsteadOf が public GitHub repo に rewrite FAIL
    explicit remote.origin.pushurl が public repo FAIL
    checkpoint_remote private_verified + push_sessions:false + no public origin checkpoint branch PASS
    checkpoint_remote public / unknown / gh auth failure FAIL
    ENTIRE_CHECKPOINT_TOKEN present + checkpoint remote missing/unverified FAIL
    .claude/settings.json / .codex/hooks.json が entire or git push ... entire/checkpoints/v1 を実行 FAIL
    actual $GIT_DIR/hooks/pre-push が checkpoint branch を push FAIL
    diagnostics に sk-... / ghp_... / /home/... / C:\Users\... / URL credential が混入 FAIL

    Issue #379 への修正文案

    この Issue は以下のように強めるのが安全です。

    Verifier MUST evaluate effective runtime safety, not only checked-in policy files.
    
    PASS requires all of:
    1. effective strategy_options.push_sessions is exactly false
    2. public origin does not expose refs/heads/entire/checkpoints/v1
    3. checkpoint route is local-only or private_verified
    4. all GitHub visibility checks are explicit and authenticated; unknown means fail-closed
    5. effective Git push destinations after config scopes/includes/rewrite are not public checkpoint destinations
    6. Git hooks and agent hook files do not push session recording/checkpoint refs
    7. diagnostics are redacted by construction and never include raw command stdout/stderr, tokens, URLs with credentials, or absolute paths
    
    Any parse error, command failure, unknown visibility, unsupported provider, or ambiguous effective destination MUST fail closed.
    

    最終判断

    #379 は 実装してよいが、現契約のままでは merge すべきでない です。特に ls-remote exit semantics、EntireCLI の strategy_options.push_sessions / checkpoint_remote fallback、Git effective config、agent hook surface を AC/VC に入れないと、「安全確認に通ったのに public transcript/checkpoint が出る」事故を防げません。

  3. squne121 commented on May 29, 2026

    @squne121
    OwnerAuthor

    Contract Review: BLOCKED (2026-05-29T11:33:00Z)

    CONTRACT_REVIEW_RESULT_V1:
      status: blocked
      generated_at: "2026-05-29T11:33:00Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/379
      checks:
        template_compliance: pass
        state_label: ok
        allowed_paths_present: pass
        vc_present: pass
        stop_conditions_complete: pass
        vc_preflight:
          passed: false
          vc_failed_as_expected: 0
          vc_passed_unexpectedly: 0
          vc_unrunnable: 25
          vc_expected_pass: 0
          vc_skipped: 0
          status: blocked
          blocked_reason: compound_command_disallowed (全 25 件)
        ac_verifiability: pass
        product_spec_check:
          applicability: not_applicable
          decision: pass
        worktree_branch_collision: clear
      next_action: propose_refinement_loop
      blocked_reasons:
        - "VC 全 25 件が compound_command_disallowed (&&/||): baseline_vc_preflight/v1 は複合コマンド非対応"
      warnings: []

    不足項目

    VC preflight: blocked — compound_command_disallowed (全 25 件)

    baseline_vc_preflight/v1 は && / || を含む複合コマンドを実行できません。
    現在の VC は $ <検証コマンド> && echo "PASS: ACN" || echo "FAIL: ACN" 形式になっており、全 25 件が blocked と分類されています。

    修正方針

    各 VC コマンドから && echo "PASS: ACN" || echo "FAIL: ACN" を除去し、検証コマンド単体にしてください。

    変更前(例):

    # AC1: verifier script 存在
    $ test -f .claude/scripts/check_session_recording_runtime_safety.py && echo "PASS: AC1" || echo "FAIL: AC1"

    変更後(例):

    # AC1: verifier script 存在
    $ test -f .claude/scripts/check_session_recording_runtime_safety.py

    同様に AC2〜AC25 の全コマンドから && echo "PASS: ACN" || echo "FAIL: ACN" サフィックスを除去してください。

    推奨アクション

    issue-refinement-loop の起動を推奨します。承認後に実行可能です。

  4. squne121 commented on May 29, 2026

    @squne121
    OwnerAuthor

    #379 の scope rollup 停止について、人間判断で続行を承認します。

    理由:

    続行条件:

    上記条件で #379 を先行実装してください。

  5. squne121 commented on May 29, 2026

    @squne121
    OwnerAuthor

    Contract Snapshot (2026-05-29T11:50:00Z)

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-05-29T11:50:00Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/379
      checks:
        template_compliance: pass
        state_label: ok
        allowed_paths_present: pass
        vc_present: pass
        stop_conditions_complete: pass
        vc_preflight:
          passed: true
          vc_failed_as_expected: 2
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          vc_expected_pass: 25
          vc_skipped: 2
          status: pass
        ac_verifiability: pass
        product_spec_check:
          applicability: not_applicable
          decision: pass
        runtime_verification_applicability:
          decision: immediate
          applicable_acs: 25 (all tagged runtime-verification: true)
          execution_environment: git ls-remote / git config / gh repo view / fixture mocks
          skip_convention: n/a (unit test suite — always executable, no external service dependency)
          fallback_non_pass: pass (FAIL-CLOSED documented throughout AC/VC)
          evidence_requirements: pnpm test output (standard)
        worktree_branch_collision: clear
      next_action: implement_issue
      blocked_reasons: []
      warnings:
        - "RVA exit 77 SKIP 明示なし(fixture ベース unit test のため適用外と判断)"
        - "証跡要件の artifact 出力先未明示(pnpm test 標準出力を証跡とみなす)"
    • Outcome: .claude/scripts/check_session_recording_runtime_safety.py が実装され、public checkpoint branch / auto-push / unknown visibility 等を fail-closed で検出する。
    • Acceptance Criteria: AC1–AC25(全 25 件、runtime-verification: true)
    • Allowed Paths:
      • .claude/scripts/check_session_recording_runtime_safety.py
      • tests/**/check_session_recording_runtime_safety*
      • tests/**/session_recording_runtime_safety*
      • tests/fixtures/session-recording-runtime-safety/**
    • Worktree: .claude/worktrees/issue-379-session-recording-no-push-private-checkp
    • Branch: worktree-issue-379-session-recording-no-push-private-checkp
    • VC preflight: baseline fail = 2, 想定外 pass = 0, 実行不可 = 0, skipped = 2 (runtime_only)
  6. squne121 commented on May 29, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-05-29T12:05:31Z)

  7. added a commit that references this issue on May 29, 2026
  8. squne121 commented on May 29, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-05-29T12:30:00Z)

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: impl-review-loop
      follow_up_issues:
        - request_dedupe_key: "3f4ac0c8ed0374fd"
          status: reused_open
          issue:
            number: 380
            url: "https://github.com/squne121/loop-protocol/issues/380"
          reason: "hook/CI wiring は #380 (Kill Switch runtime smoke) が担当。OPEN のため skip"
      note_only_observations: []
    ISSUE_SCOPE_ROLLUP_DECISION_V2:
      schema_version: 2
      recorded_at: "2026-05-29T12:30:00Z"
      rollup_plan_ref:
        body_sha256: null
        generated_at: "2026-05-29T11:40:00Z"
      decision: skipped
      skipped_reason: "人間承認コメント (https://github.com/squne121/loop-protocol/issues/379#issuecomment-4574601583) により #380 との tests/** overlap を承認済み"
      executed_actions: []
      candidates_reviewed:
        - kind: issue
          number: 380
          confidence: high
          suggested_action: human_review_required
          final_decision: deferred
          rejection_reason: "人間判断で #379 先行実装を承認。tests/** は形式的 overlap"
        - kind: issue
          number: 377
          confidence: high
          suggested_action: human_review_required
          final_decision: rejected
          rejection_reason: "CLOSED (completed)"
  9. added a commit that references this issue on May 29, 2026
  10. squne121 commented on May 29, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-05-29T12:55:00Z)

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: impl-review-loop
      follow_up_issues:
        - request_dedupe_key: "3f4ac0c8ed0374fd"
          status: reused_open
          issue:
            number: 380
            url: "https://github.com/squne121/loop-protocol/issues/380"
          reason: "hook/CI wiring は #380 (Kill Switch runtime smoke) が担当。OPEN のため skip"
      note_only_observations: []
    ISSUE_SCOPE_ROLLUP_DECISION_V2:
      schema_version: 2
      recorded_at: "2026-05-29T12:55:00Z"
      decision: skipped
      skipped_reason: "人間承認コメント (#issuecomment-4574601583) により #380 との tests/** overlap を承認済み"
      candidates_reviewed:
        - kind: issue
          number: 380
          confidence: high
          suggested_action: human_review_required
          final_decision: deferred
          rejection_reason: "人間判断で #379 先行実装承認。tests/** は形式的 overlap"
        - kind: issue
          number: 377
          confidence: high
          suggested_action: human_review_required
          final_decision: rejected
          rejection_reason: "CLOSED (completed)"
  11. added a commit that references this issue on May 29, 2026
  12. squne121 commented on May 29, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-05-30T09:00:00Z)

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: impl-review-loop
      follow_up_issues:
        - request_dedupe_key: "3f4ac0c8ed0374fd"
          status: reused_open
          issue:
            number: 380
            url: "https://github.com/squne121/loop-protocol/issues/380"
          reason: "hook/CI wiring は #380 (Kill Switch runtime smoke) が担当"
      note_only_observations: []
    ISSUE_SCOPE_ROLLUP_DECISION_V2:
      schema_version: 2
      recorded_at: "2026-05-30T09:00:00Z"
      decision: skipped
      skipped_reason: "人間承認コメント (#issuecomment-4574601583) により #380 との tests/** overlap 承認済み"
      candidates_reviewed:
        - kind: issue
          number: 380
          confidence: high
          suggested_action: human_review_required
          final_decision: deferred
          rejection_reason: "人間判断で #379 先行実装承認"
        - kind: issue
          number: 377
          confidence: high
          suggested_action: human_review_required
          final_decision: rejected
          rejection_reason: "CLOSED (completed)"
  13. added a commit that references this issue on May 29, 2026
  14. squne121 commented on May 29, 2026

    @squne121
    OwnerAuthor

    post-merge-cleanup: 完了 (2026-05-30T09:10:00Z)

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: post-merge-cleanup
      follow_up_issues:
        - request_dedupe_key: "3f4ac0c8ed0374fd"
          status: reused_open
          issue:
            number: 380
            url: "https://github.com/squne121/loop-protocol/issues/380"
          reason: "hook/CI wiring は #380 (Kill Switch runtime smoke) が担当。OPEN のため skip"
      note_only_observations: []

    cleanup 結果:

  15. added a commit that references this issue on May 29, 2026
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

    area/ai-opsarea/securitykind/implementationphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions