Skip to content

docs: session 記録 Kill Switch policy と検証コマンド整備 (session-recording-policy.md) #242

Closed
3 of 3 issues completed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#136"
goal_ref: "secrets_mode 遷移時の session 記録 Kill Switch 手順と検証コマンドを SSOT 化する"
change_kind: docs

Parent Issue

#136

Parent Goal Ref

Current Validated Scope

  • docs/dev/session-recording-policy.md の新規作成(YAML フロントマター付き Markdown)
  • docs/dev/agent-skill-boundaries.md への cross-link 追加
  • docs/dev/runtime-verification-policy.md への cross-link 追加
  • .claude/scripts/check_session_recording_policy.py の新規作成(policy 構造検証スクリプト)

Remaining Parent Gaps

Outcome

docs/dev/session-recording-policy.md (新規) に session_recording_policy/v1 YAML(secret_policy/v1 から派生した taxonomy_mapping、全 mode で public_full_transcript_allowed: false、Kill Switch の trigger_conditions / required_end_state)と検証コマンドが SSOT として明文化された状態。secrets_mode が none 以外に遷移したときに「どのアクションを停止するか」「どう検証するか」が決定論的に追える。docs/dev/agent-skill-boundaries.md および docs/dev/runtime-verification-policy.md から cross-link されている。

Background

#136 anchor comment は、session 記録ツール (EntireCLI 等) を仮に導入する場合、Secret 管理開始時に full transcript を public GitHub に置く運用を停止できる Kill Switch が無いと「導入しただけ」で終わると指摘。EntireCLI の security docs(W6 で grounding 不十分のため未検証だが、anchor comment 主張ベース)も entire/checkpoints/v1 branch への自動 commit / shadow branch raw blob を懸念しており、policy 側で fail-closed を保証する必要がある。本 Issue は EntireCLI を実導入する前段として、policy + 検証コマンドを SSOT 化する。

前提となる確立済み SSOT:

In Scope

  • docs/dev/session-recording-policy.md の新規作成(YAML フロントマター付き Markdown)
  • session_recording_policy/v1 YAML 要件:
    • schema: session_recording_policy/v1
    • source_of_truth.secret_policy: docs/dev/secret-policy.md(secret_policy/v1 明示参照)
    • source_of_truth.manifest_schema: docs/schemas/agent-session-manifest.schema.json(agent_session_manifest/v1 明示参照)
    • derived_from_secret_policy.current_secrets_mode: none
    • derived_from_secret_policy.fail_closed_on_unknown_mapping: true
    • taxonomy_mapping: secret_policy/v1 の 5 区分(current / publish_secret / app_runtime_secret / agent_local_secret / checkpoint_token)と session recording 許可フラグのマッピング
    • 全 mode で public_full_transcript_allowed: false(none 時も public full transcript は禁止)
    • public_surfaces.github_issue_comment.agent_session_manifest_allowed: true(metadata manifest のみ public 許可)
    • public_surfaces.github_issue_comment.raw_transcript_allowed: false
    • github_public_checkpoint_branch_allowed: false
    • checkpoint_remote.allowed_visibility: [private_verified](unknown は fail-closed)
    • checkpoint_remote.verification_method.github_remote: "gh repo view <owner/repo> --json visibility"
    • auto_push_sessions_allowed: false
    • manual_review_required_before_push: true
    • Kill Switch(kill_switch セクション):
      • trigger_conditions: secrets_mode != none / checkpoint_token_present / public_checkpoint_branch_detected / raw_transcript_public_surface_detected / secret_scan_status == flagged
      • required_end_state: session_recording_tool_enabled: false / git_hooks_recording_enabled: false / public_checkpoint_branch_present: false / auto_push_sessions_allowed: false / full_transcript_remote_visibility: none / leaked_credentials_rotated_or_revoked: true
      • verification_required: true
    • Kill Switch 手順(順序付き箇条書き、6 ステップ以上)
  • cross-link: docs/dev/agent-skill-boundaries.md と docs/dev/runtime-verification-policy.md から本 policy への参照リンク追加
  • .claude/scripts/check_session_recording_policy.py の新規作成(YAML parse / schema 参照 / public_full_transcript_allowed: false / Kill Switch required_end_state の構造検証)

Out of Scope

Acceptance Criteria

  • AC1: docs/dev/session-recording-policy.md が存在し YAML フロントマターを持つ
  • AC2: session_recording_policy/v1 YAML が文書内に fenced code block で記述され、secret_policy/v1 と agent_session_manifest/v1 を source_of_truth セクションで明示参照している
  • AC3: secret_policy/v1 の 5 区分(current / publish_secret / app_runtime_secret / agent_local_secret / checkpoint_token)との taxonomy_mapping が YAML に含まれている
  • AC4: 全 mode で public_full_transcript_allowed: false が明示されている(none 時も true にしない)
  • AC5: public_github_comment では raw_transcript_allowed: false かつ source_kind: transcript / local_file を禁止する記述がある
  • AC6: kill_switch セクションが trigger_conditions と required_end_state を持ち、6 ステップ以上の Kill Switch 手順が順序付きリストで記述されている
  • AC7: checkpoint_remote が private_verified | public | unknown の visibility 区分を持ち、unknown は fail_closed_on_unknown_visibility: true である
  • AC8: 検証コマンドが git ls-remote、Git hook 残存確認、git remote -v / pushRemote / insteadOf 確認、GitHub comment surface 確認の 4 種類以上を含む
  • AC9: docs/dev/agent-skill-boundaries.md と docs/dev/runtime-verification-policy.md の両方から本 policy への参照リンクが追加されている
  • AC10: .claude/scripts/check_session_recording_policy.py が存在し、YAML parse / schema 参照 / public_full_transcript_allowed: false / Kill Switch required_end_state の構造を検証する
  • AC11: pnpm typecheck, pnpm lint, pnpm test, pnpm build がすべて pass する

Verification Commands

# AC1: policy ファイル存在
test -f docs/dev/session-recording-policy.md && echo "PASS: AC1" || echo "FAIL: AC1"

# AC2: session_recording_policy/v1 スキーマ参照
rg "schema: session_recording_policy/v1" docs/dev/session-recording-policy.md && echo "PASS: AC2-schema" || echo "FAIL: AC2-schema"
rg "secret_policy/v1|secret-policy\.md" docs/dev/session-recording-policy.md && echo "PASS: AC2-secret-ref" || echo "FAIL: AC2-secret-ref"
rg "agent_session_manifest/v1|agent-session-manifest" docs/dev/session-recording-policy.md && echo "PASS: AC2-manifest-ref" || echo "FAIL: AC2-manifest-ref"

# AC3: taxonomy_mapping に 5 区分が存在
rg "app_runtime_secret|agent_local_secret|checkpoint_token" docs/dev/session-recording-policy.md && echo "PASS: AC3" || echo "FAIL: AC3"

# AC4: 全 mode で public_full_transcript_allowed: false
! rg "public_full_transcript_allowed:\s*true" docs/dev/session-recording-policy.md && echo "PASS: AC4" || echo "FAIL: AC4"

# AC5: public_github_comment で transcript 禁止
rg "raw_transcript_allowed: false|transcript.*false" docs/dev/session-recording-policy.md && echo "PASS: AC5" || echo "FAIL: AC5"

# AC6: Kill Switch trigger_conditions と required_end_state
rg "trigger_conditions" docs/dev/session-recording-policy.md && echo "PASS: AC6-trigger" || echo "FAIL: AC6-trigger"
rg "required_end_state" docs/dev/session-recording-policy.md && echo "PASS: AC6-end-state" || echo "FAIL: AC6-end-state"

# AC7: checkpoint_remote visibility 区分
rg "private_verified|fail_closed_on_unknown_visibility" docs/dev/session-recording-policy.md && echo "PASS: AC7" || echo "FAIL: AC7"

# AC8: 強化された検証コマンド
rg "git ls-remote" docs/dev/session-recording-policy.md && echo "PASS: AC8-ls-remote" || echo "FAIL: AC8-ls-remote"
rg "\.git/hooks|git hook|pre-push|pre-commit" docs/dev/session-recording-policy.md && echo "PASS: AC8-hooks" || echo "FAIL: AC8-hooks"
rg "git remote -v|pushRemote|insteadOf" docs/dev/session-recording-policy.md && echo "PASS: AC8-remote-config" || echo "FAIL: AC8-remote-config"
rg "gh issue.*comment|public.*surface|transcript.*comment" docs/dev/session-recording-policy.md && echo "PASS: AC8-comment-surface" || echo "FAIL: AC8-comment-surface"

# AC9: cross-link
rg "session-recording-policy" docs/dev/agent-skill-boundaries.md && echo "PASS: AC9-skill-boundaries" || echo "FAIL: AC9-skill-boundaries"
rg "session-recording-policy" docs/dev/runtime-verification-policy.md && echo "PASS: AC9-runtime-verification" || echo "FAIL: AC9-runtime-verification"

# AC10: checker script 存在
test -f .claude/scripts/check_session_recording_policy.py && echo "PASS: AC10" || echo "FAIL: AC10"

# AC11: 品質ゲート
pnpm typecheck && echo "PASS: AC11-typecheck" || echo "FAIL: AC11-typecheck"
pnpm lint && echo "PASS: AC11-lint" || echo "FAIL: AC11-lint"
pnpm test && echo "PASS: AC11-test" || echo "FAIL: AC11-test"
pnpm build && echo "PASS: AC11-build" || echo "FAIL: AC11-build"

Allowed Paths

  • docs/dev/session-recording-policy.md(新規作成)
  • docs/dev/agent-skill-boundaries.md(cross-link 追加のみ)
  • docs/dev/runtime-verification-policy.md(cross-link 追加のみ)
  • .claude/scripts/check_session_recording_policy.py(新規作成)

Stop Conditions

  • Outcome / Scope / AC が VC で検証できない形式に崩れた場合は即停止
  • Allowed Paths 外への書き込みを試みた場合は即停止
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合は即停止
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)は即停止
  • 後続 Phase / 別スコープへの波及が判明した場合は即停止
  • nested SubAgent delegation が必要になった場合は即停止
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合は即停止
  • session 記録ツールの実導入を始めようとした場合は即停止(本 Issue は policy 整備のみ)
  • pnpm typecheck/lint/test/build のいずれかが fail した場合は即停止

Runtime Verification Applicability

decision: immediate
rationale: docs-only 変更。VC コマンド (test -f, rg, pnpm) は実装直後に即時実行可能。

Handoff Contract

Required Skills

  • なし(docs 編集のみ)

Sub-issues

Sub-issues

3 of 3 Issues completed
Loading 3 sub-issues

Activity

  1. added
    kind/implementation
    area/docs
    area/security
    area/ai-ops
    on May 23, 2026
  2. added 2 commits that reference this issue on May 23, 2026
  3. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    判定

    REQUEST_CHANGES 相当。
    #242 の方向性は妥当ですが、このまま実装すると「Secret が出たら session 記録を止める」という安全境界が docs 上の宣言に留まり、検証不能・同期不能・撤退不能 になります。

    #242 は docs/dev/session-recording-policy.md を作り、session_recording_policy YAML、Kill Switch、git ls-remote / rg 検証、agent-skill-boundaries.md / runtime-verification-policy.md からの cross-link を要求しています。Issue 自体にコメントはありません。
    親の #136 では、PR #81/#131 の反省として「AC 読み落とし、test-runner 呼び出し不明、SKIP exit 0、PR本文破壊、token/context pressure」を検証可能にするため、metadata-first / full transcript は疑義時のみ / public checkpoint 禁止 / Secret Kill Switch を決定しています。

    重大ブロッカー

    B1. secrets_mode が #241 / PR #317 の Secret Inventory とズレる

    #242 の secrets_mode は none | publish_secret | app_secret | unknown ですが、PR #317 で secret-policy.md は current / publish_secret / app_runtime_secret / agent_local_secret / checkpoint_token の 5 区分を SSOT として導入済みです。さらに PR #317 は secret_policy/v1、current_secrets_mode、taxonomy_mapping、VITE_* sensitive 不可、public full transcript 制御を扱っています。

    この状態で #242 が独自に secrets_mode を持つと、Secret Inventory と session 記録 policy が二重管理になります。特に agent_local_secret と checkpoint_token が #242 側に明示されていないのは危険です。session transcript が最も漏らしやすいのは、アプリ runtime secret だけでなく、agent local 設定、checkpoint token、CLI認証情報、ローカルパスです。

    修正案: #242 の YAML は secret_policy/v1 を参照する形にする。

    session_recording_policy:
      schema: session_recording_policy/v1
      source_of_truth:
        secret_policy: docs/dev/secret-policy.md
        secret_policy_schema: secret_policy/v1
        manifest_schema: docs/schemas/agent-session-manifest.md
      derived_from_secret_policy:
        current_secrets_mode: none
        fail_closed_on_unknown_mapping: true
      taxonomy_mapping:
        none:
          public_metadata_manifest_allowed: true
          public_full_transcript_allowed: false
          private_full_transcript_allowed: true
        publish_secret:
          public_metadata_manifest_allowed: true
          public_full_transcript_allowed: false
          private_full_transcript_allowed: false
        app_runtime_secret:
          maps_to: app_secret
          public_metadata_manifest_allowed: true
          public_full_transcript_allowed: false
          private_full_transcript_allowed: false
        agent_local_secret:
          maps_to: unknown
          public_metadata_manifest_allowed: true
          public_full_transcript_allowed: false
          private_full_transcript_allowed: false
        checkpoint_token:
          maps_to: unknown
          public_metadata_manifest_allowed: true
          public_full_transcript_allowed: false
          private_full_transcript_allowed: false
        unknown:
          public_metadata_manifest_allowed: false
          public_full_transcript_allowed: false
          private_full_transcript_allowed: false

    B2. none: true で full transcript を許可するのは過剰に楽観的

    #136 の判断は「metadata-first / full transcript は疑義時のみ」であり、public full transcript を no-secret 時に通常許可する設計ではありません。#242 の元 YAML では full_transcript_allowed.none: true ですが、これは危険です。transcript には Secret そのものがなくても、未公開設計、ローカル絶対パス、MCP/tool 出力、CLI認証状態、Issue未公開メモ、脆弱性調査内容が入り得ます。

    GitHub secret scanning は Git history 全 branch に加え、Issue / PR / Discussion / Wiki などもスキャン対象にしますが、これは事後検知であり、公開 transcript の投入を安全化する機構ではありません。検出時は credential を即時 rotate / revoke すべきものとされています。([GitHub Docs]1)

    修正案: public に許可するのは manifest metadata のみに限定する。

    public_surfaces:
      github_issue_comment:
        agent_session_manifest_allowed: true
        raw_transcript_allowed: false
        local_file_evidence_allowed: false
      public_checkpoint_branch:
        allowed: false
      public_pr_body:
        raw_transcript_allowed: false

    B3. git ls-remote origin refs/heads/entire/checkpoints/v1 だけでは Kill Switch 検証にならない

    #242 の検証コマンドは origin の特定 branch を見るだけです。これは次を検出できません。

    • origin 以外の remote への checkpoint push
    • branch 名変更
    • private と誤認した public remote
    • 既に push 済みの branch / comment / artifact
    • Git hook が残っている状態
    • url.*.insteadOf や pushRemote による意図しない push 先

    #245 でも onboarding 側に no-push / private checkpoint / manual review / Kill Switch が要求され、#246 でも smoke test で Kill Switch 継続 PASS を前提条件にしています。つまり #242 は後続 issue の安全基盤であり、弱い検証はそのまま後続に伝播します。

    修正案: docs-only でも、最低限この粒度にする。

    # public origin に checkpoint branch が存在しないこと
    git ls-remote --heads origin refs/heads/entire/checkpoints/v1 | tee /tmp/entire_origin_checkpoint.txt
    test ! -s /tmp/entire_origin_checkpoint.txt
    
    # remote / pushRemote / insteadOf の確認
    git remote -v
    git config --get-regexp 'remote\..*\.push|branch\..*\.pushRemote|url\..*\.insteadOf' || true
    
    # Git hook 残存確認
    for hook in pre-commit prepare-commit-msg post-commit pre-push post-merge; do
      test ! -f ".git/hooks/$hook" || ! rg -i "entire|checkpoint|session|transcript" ".git/hooks/$hook"
    done
    
    # public GitHub comment に raw transcript/local_file evidence を出していないこと
    gh issue view "$ISSUE_NUMBER" --comments --repo squne121/loop-protocol \
      | rg -i "raw transcript|source_kind: transcript|source_kind: local_file|entire/checkpoints" && exit 1 || true

    B4. PR #314 の agent_session_manifest/v1 と接続しないと、policy が孤立する

    PR #314 は agent_session_manifest/v1 を JSON Schema + fixtures + tests で SSOT 化し、public_github_comment の場合は source_kind: transcript / local_file を禁止する制約を導入しています。

    #242 がこの schema を直接参照しないと、session recording policy と manifest policy が別々に進化します。これは #136 の「metadata-first」決定に反します。

    修正案: #242 の AC に以下を追加。

    - [ ] `docs/dev/session-recording-policy.md` は `agent_session_manifest/v1` を参照する
    - [ ] `public_github_comment` では `source_kind: transcript` / `source_kind: local_file` を禁止する、と明記する
    - [ ] `raw_transcript_included: true` の manifest は public GitHub comment に投稿不可、と明記する

    B5. 配布経路の Secret / Deploy capability の扱いが粗い

    Vite は VITE_* 変数を client-side source code に露出し、VITE_* に API key 等の sensitive 情報を入れるべきでないと明記しています。([vitejs]2)
    GitHub Pages の custom workflow は pages: write と id-token: write 権限を必要とします。これは長期 Secret ではありませんが、release integrity に関わる deploy capability です。([GitHub Docs]3)
    Cloudflare Pages の direct upload CI は GitHub Secrets に CLOUDFLARE_ACCOUNT_ID と CLOUDFLARE_API_TOKEN を設定する導線を公式に示しています。([Cloudflare Docs]4)
    itch.io butler は CI で BUTLER_API_KEY を使い、公開 build log に出たら burned とみなして revoke すべきとしています。([itch.io]5) ([itch.io]5)

    したがって #242 は「現在 static Vite だから no-secret」だけでなく、将来の配布経路が入った瞬間に session recording policy を fail-closed へ遷移させる必要があります。

    修正案: publish_secret だけでなく deploy_credential_boundary を明示する。

    deploy_credential_boundaries:
      github_pages_oidc:
        stored_secret: false
        permissions:
          - pages: write
          - id-token: write
        release_integrity_sensitive: true
        public_full_transcript_allowed: false
      cloudflare_pages:
        secrets:
          - CLOUDFLARE_ACCOUNT_ID
          - CLOUDFLARE_API_TOKEN
        public_full_transcript_allowed: false
      itch_butler:
        secrets:
          - BUTLER_API_KEY
        public_full_transcript_allowed: false

    B6. Kill Switch が「手順」であって「状態遷移」になっていない

    #242 の Kill Switch は 5 手順を要求していますが、手順列挙だけだと「実行後にどの状態になっていれば安全か」が曖昧です。

    修正案: Kill Switch を state machine として書く。

    kill_switch:
      trigger_conditions:
        - secrets_mode != none
        - checkpoint_token_present == true
        - public_checkpoint_branch_detected == true
        - raw_transcript_public_surface_detected == true
        - secret_scan_status == flagged
      required_end_state:
        session_recording_tool_enabled: false
        git_hooks_recording_enabled: false
        public_checkpoint_branch_present: false
        auto_push_sessions_allowed: false
        full_transcript_remote_visibility: none
        leaked_credentials_rotated_or_revoked: true
      verification_required: true

    これにより「disable したつもり」ではなく「disable 後の状態」を検証できます。

    B7. checkpoint_remote_required_when_full_transcript: private は検証不能

    Git の remote -v や ls-remote だけでは、その remote が private かどうかは判定できません。GitHub repository なら API で visibility を見られますが、任意 remote では不可能です。

    修正案: private を直接書かず、検証状態を分ける。

    checkpoint_remote:
      required_when_full_transcript: private_verified
      allowed_visibility:
        - private_verified
      forbidden_visibility:
        - public
        - unknown
      verification_method:
        github_remote: "gh repo view <owner/repo> --json visibility"
        non_github_remote: "human_attestation_required"
      fail_closed_on_unknown_visibility: true

    B8. Allowed Paths が deterministic checker を許可していない

    PR #317 は .claude/scripts/check_secret_policy.py を導入し、policy を script-first VC にしています。
    #242 は docs/dev/session-recording-policy.md と cross-link だけを allowed paths にすると、rg ベースの脆い検証しかできません。

    修正案: #242 の Allowed Paths に checker を追加する。

    Allowed Paths:
    - docs/dev/session-recording-policy.md
    - docs/dev/agent-skill-boundaries.md
    - docs/dev/runtime-verification-policy.md
    - .claude/scripts/check_session_recording_policy.py

    checker では最低限次を検証します。

    - YAML parse 可能
    - schema == session_recording_policy/v1
    - secret_policy/v1 への参照あり
    - agent_session_manifest/v1 への参照あり
    - public_full_transcript_allowed が全 mode で false
    - public_checkpoint_branch_allowed == false
    - auto_push_sessions_allowed == false
    - Kill Switch required_end_state が全 key を持つ
    - git ls-remote / hook check / gh issue comment check の検証コマンドが存在
    

    #242 の本文に追加すべき受け入れ条件

    既存 AC に加えて、以下を追加した方がよいです。

    - [ ] `session_recording_policy/v1` YAML は `secret_policy/v1` と `agent_session_manifest/v1` を明示参照する
    - [ ] `secret_policy/v1` の 5 区分(current / publish_secret / app_runtime_secret / agent_local_secret / checkpoint_token)との mapping を持つ
    - [ ] `public_full_transcript_allowed: false` が全 mode で明示される
    - [ ] `public_github_comment` では `transcript` / `local_file` evidence を禁止する
    - [ ] Kill Switch は手順だけでなく `trigger_conditions` と `required_end_state` を持つ
    - [ ] checkpoint remote visibility は `private_verified | public | unknown` に分け、unknown は fail-closed とする
    - [ ] `git ls-remote origin` だけでなく Git hook / pushRemote / insteadOf / GitHub comment surface を検査する
    - [ ] `.claude/scripts/check_session_recording_policy.py` による構造検証を追加する

    最小パッチ方針

    1. docs: session 記録 Kill Switch policy と検証コマンド整備 (session-recording-policy.md) #242 の YAML を secret_policy/v1 派生に変更する。
    2. none でも public full transcript は禁止にする。
    3. PR docs(#243): agent_session_manifest/v1 schema SSOT 定義と Main Loop phase 別記録運用確定 #314 の agent_session_manifest/v1 と接続し、public GitHub comment で transcript/local_file evidence を禁止する。
    4. Kill Switch を「手順」から「trigger → required end state → verification」に変える。
    5. check_session_recording_policy.py を追加して rg 依存を減らす。
    6. docs: AI agent session 記録ツールの人間導入手順サジェスト (tool-onboarding/session-recording.md) #245 / research/pilot: AI 駆動 session 記録 pilot smoke test (manifest 整合性 / Kill Switch 動作 / Secret 漏れ検査) #246 の前提条件として使える粒度まで、no-push / private_verified / manual-review /撤退手順を機械可読化する。

    最終コメント

    #242 は、単体の docs issue ではなく、#241 Secret Inventory、#243 manifest schema、#245 onboarding、#246 pilot smoke test の安全境界ハブです。
    現状のままだと「危険なら止める」という意図はありますが、実装後に検証できるのは rg と特定 branch の有無だけです。高品質化するなら、public transcript を原則禁止、metadata manifest のみ public 許可、Secret taxonomy は #241 から派生、Kill Switch は required end state で検証に寄せるべきです。

  4. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    Issue 本文更新 — review-issue feedback 反映

    reviewer_feedback (REVIEW_ISSUE_RESULT_V1: needs-fix) および anchor_comment_feedback (feedback_update_required) を受けて、以下の変更を反映した。

    対応した blocking issues

    C1 — 必須セクション分割

    • ## Parent / Source を ## Parent Issue / ## Parent Goal Ref / ## Current Validated Scope / ## Remaining Parent Gaps の 4 独立セクションに分割。

    C2 — Stop Conditions 定型 6 項目追加

    • 4 件から 9 件に拡充。不足していた以下の定型項目を追加:
      • In Scope の固定契約変更が必要になった場合
      • 新規 Issue 起票が必要と判断した場合
      • 後続 Phase / 別スコープへの波及が判明した場合
      • nested SubAgent delegation が必要になった場合
      • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合

    C5 — AC の ACN ラベル統一

    • 全 AC 項目を - [ ] AC1: <内容> 〜 - [ ] AC11: <内容> 形式に統一。

    C9 — Runtime Verification Applicability セクション追加

    • decision: immediate / rationale: docs-only 変更。VC コマンド (test -f, rg, pnpm) は実装直後に即時実行可能。 を追記。

    対応した anchor_comment edits (E1〜E5)

    E1 — secrets_mode を secret_policy/v1 派生形式に変更

    • session_recording_policy/v1 スキーマ、source_of_truth セクションで secret_policy/v1 と agent_session_manifest/v1 を明示参照する形式に変更。
    • 5区分 taxonomy_mapping を In Scope に追加。
    • 全 mode で public_full_transcript_allowed: false を明示(none 時も true 禁止)。

    E2 — AC 追加(ACN ラベル付き)

    • AC8(4種類以上の VC)、AC9(cross-link 両ファイル)、AC10(checker script 存在)、AC11(品質ゲート)を追加。

    E3 — VC 強化

    • git remote -v / pushRemote / insteadOf 確認(AC8-remote-config)
    • .git/hooks 残存確認(AC8-hooks)
    • GitHub comment surface 確認(AC8-comment-surface)
    • 各コマンドに PASS/FAIL エコーを追加。

    E4 — Allowed Paths に checker script 追加

    • .claude/scripts/check_session_recording_policy.py を追加。

    E5 — Background に確立済み SSOT 追記

    non_blocking 改善(NB1〜NB4)の対応

  5. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: iteration 1 本文修正 (2026-05-23T16:52:26Z)

    • 修正内容: AC1〜AC11 全項目に <!-- runtime-verification: true --> タグを追加
    • 理由: decision: immediate 宣言に対して C11 チェック(AC に runtime-verification タグが 1 件以上必要)を満たすため
    • iteration: 1 → 2 へ進行
  6. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: 完了 (2026-05-24T00:00:00Z)

    改善履歴

    iteration 修正内容
    0 C1(必須セクション4件追加) / C2(Stop Conditions 9件) / C5(AC1〜AC11 ACNラベル) / C9(Runtime Verification Applicability: immediate) / E1(secrets_mode→secret_policy/v1 派生形式、全mode public_full_transcript: false) / E2(AC追加: secret_policy/v1 5区分 taxonomy_mapping、public transcript 禁止、Kill Switch state machine、checkpoint visibility) / E3(VC強化: hook/pushRemote/insteadOf/comment surface) / E4(Allowed Paths に checker script 追加) / E5(Background に PR #317/#314 参照追記)
    1 C11: AC1〜AC11 全項目に <!-- runtime-verification: true --> タグ追加

    次アクション

    issue-contract-review を起動してください。

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      follow_up_issues: []
      note_only_observations: []
  7. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    Contract Snapshot (2026-05-24T01:57:00Z)

    • Outcome: docs/dev/session-recording-policy.md (新規) に session_recording_policy/v1 YAML(secret_policy/v1 から派生した taxonomy_mapping、全 mode で public_full_transcript_allowed: false、Kill Switch の trigger_conditions / required_end_state)と検証コマンドが SSOT として明文化された状態。
    • Acceptance Criteria: AC1〜AC11(docs/dev/session-recording-policy.md 存在・YAML スキーマ参照・taxonomy_mapping・transcript 禁止・Kill Switch・checkpoint visibility・VC 4種・cross-link・checker script・品質ゲート)
    • Verification Commands: test -f、rg(パターン存在確認)、pnpm typecheck/lint/test/build
    • Allowed Paths:
      • docs/dev/session-recording-policy.md(新規作成)
      • docs/dev/agent-skill-boundaries.md(cross-link 追加のみ)
      • docs/dev/runtime-verification-policy.md(cross-link 追加のみ)
      • .claude/scripts/check_session_recording_policy.py(新規作成)
    • Worktree: .claude/worktrees/issue-242-session-kill-switch-policy-session-recor
    • Branch: worktree-issue-242-session-kill-switch-policy-session-recor
    • VC preflight: baseline fail = 16, 想定外 pass = 0, 実行不可 = 0
    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-05-24T01:57:00Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/242
      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: 16
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          classifications:
            - ac: AC1
              command: "test -f docs/dev/session-recording-policy.md"
              exit_code: 1
              category: file_not_found_expected
              confidence: high
              evidence:
                stdout_excerpt: "FAIL: AC1"
                stderr_excerpt: ""
              decision: go
            - ac: AC2
              command: "rg 'schema: session_recording_policy/v1' docs/dev/session-recording-policy.md"
              exit_code: 1
              category: file_not_found_expected
              confidence: high
              evidence:
                stdout_excerpt: "FAIL: AC2-schema"
                stderr_excerpt: ""
              decision: go
            - ac: AC3
              command: "rg 'app_runtime_secret|agent_local_secret|checkpoint_token' docs/dev/session-recording-policy.md"
              exit_code: 1
              category: file_not_found_expected
              confidence: high
              evidence:
                stdout_excerpt: "FAIL: AC3"
                stderr_excerpt: ""
              decision: go
            - ac: AC4
              command: "! rg 'public_full_transcript_allowed:\\s*true' docs/dev/session-recording-policy.md"
              exit_code: 0
              category: expected_baseline_fail
              confidence: high
              evidence:
                stdout_excerpt: "PASS: AC4 (negative check — file not found → no prohibited value)"
                stderr_excerpt: ""
              decision: go
            - ac: AC5
              command: "rg 'raw_transcript_allowed: false' docs/dev/session-recording-policy.md"
              exit_code: 1
              category: file_not_found_expected
              confidence: high
              evidence:
                stdout_excerpt: "FAIL: AC5"
                stderr_excerpt: ""
              decision: go
            - ac: AC6
              command: "rg 'trigger_conditions|required_end_state' docs/dev/session-recording-policy.md"
              exit_code: 1
              category: file_not_found_expected
              confidence: high
              evidence:
                stdout_excerpt: "FAIL: AC6-trigger / AC6-end-state"
                stderr_excerpt: ""
              decision: go
            - ac: AC7
              command: "rg 'private_verified|fail_closed_on_unknown_visibility' docs/dev/session-recording-policy.md"
              exit_code: 1
              category: file_not_found_expected
              confidence: high
              evidence:
                stdout_excerpt: "FAIL: AC7"
                stderr_excerpt: ""
              decision: go
            - ac: AC8
              command: "rg 'git ls-remote|.git/hooks|git remote -v|gh issue.*comment' docs/dev/session-recording-policy.md"
              exit_code: 1
              category: file_not_found_expected
              confidence: high
              evidence:
                stdout_excerpt: "FAIL: AC8-ls-remote / AC8-hooks / AC8-remote-config / AC8-comment-surface"
                stderr_excerpt: ""
              decision: go
            - ac: AC9
              command: "rg 'session-recording-policy' docs/dev/agent-skill-boundaries.md"
              exit_code: 1
              category: expected_baseline_fail
              confidence: high
              evidence:
                stdout_excerpt: "FAIL: AC9-skill-boundaries / AC9-runtime-verification"
                stderr_excerpt: ""
              decision: go
            - ac: AC10
              command: "test -f .claude/scripts/check_session_recording_policy.py"
              exit_code: 1
              category: file_not_found_expected
              confidence: high
              evidence:
                stdout_excerpt: "FAIL: AC10"
                stderr_excerpt: ""
              decision: go
            - ac: AC11
              command: "pnpm typecheck && pnpm lint && pnpm test && pnpm build"
              exit_code: 0
              category: expected_baseline_fail
              confidence: high
              evidence:
                stdout_excerpt: "PASS: AC11 (quality gates pass at baseline — stability check)"
                stderr_excerpt: ""
              decision: go
        ac_verifiability: pass
        worktree_branch_collision: clear
      next_action: implement_issue
      blocked_reasons: []
      warnings: []
  8. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-05-24T02:03:00Z)

  9. added 2 commits that reference this issue on May 23, 2026
  10. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    post-merge-cleanup: 完了 (2026-05-24T02:40:00Z)

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      follow_up_issues:
        - request_dedupe_key: "follow-up:squne121/loop-protocol:pr/323:ci-integration"
          issue_number: 324
          issue_url: "https://github.com/squne121/loop-protocol/issues/324"
          status: reused_open
        - request_dedupe_key: "follow-up:squne121/loop-protocol:pr/323:claude-hook"
          issue_number: 325
          issue_url: "https://github.com/squne121/loop-protocol/issues/325"
          status: reused_open
        - request_dedupe_key: "follow-up:squne121/loop-protocol:pr/323:skill"
          issue_number: 326
          issue_url: "https://github.com/squne121/loop-protocol/issues/326"
          status: reused_open
    
      note_only_observations: []
  11. added 2 commits that reference this issue on May 24, 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/docsarea/securitykind/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions