Skip to content

feat: secret-free Claude runtime diagnostic を追加 - #2474

Merged
squne121 merged 3 commits into
mainfrom
worktree-issue-2471-claude-runtime-diag
Sep 1, 2026
Merged

squne121 merged 3 commits into
mainfrom
worktree-issue-2471-claude-runtime-diag

Conversation

@squne121

@squne121 squne121 commented Sep 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • scripts/agent-ops/claude_runtime_diag.py を追加し、固定 probe ID だけで Claude-GPT runtime root と isolated home の関係を固定 enum に分類できるようにしました。
  • helper は CLAUDE_GPT_HOME と HOME を内部分類にだけ使用し、raw value・raw path・secret を出力しません。任意の環境変数名、path、expression を受け取る interface は提供しません。
  • synthetic PreToolUse fixture と isolated Claude Code structured runtime smoke を追加検証し、literal-path invocation が guard と worktree verifier を通ることを確認しました。guard/settings の変更はありません。

Closes #2471(実装 Issue を完了します)

Related #2456(研究起点。#2456 は close しません)

Checks

  • uv run pytest scripts/agent-ops/tests/test_claude_runtime_diag.py(focused test、21 passed)
  • pnpm typecheck(型検査)
  • pnpm lint(静的解析)
  • pnpm test(全体テスト、1874 passed)
  • pnpm build(production build)
  • uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py(routing regression、24 passed)
  • isolated Claude Code structured runtime smoke(fixed enum-only summary、raw egress なし)
  • すべての検証で対象要件を確認済みです。

上記の focused test、品質ゲート、runtime verification はすべて current head で成功しました。

検証コマンド結果

以下は current head a3ae5d331524016f01420f43f0d5412284e0490a に対する PASS 結果です。

  • focused helper pytest: 21 passed(固定診断 helper の focused 検証)
  • pnpm typecheck: PASS(型検査)
  • pnpm lint: PASS(静的解析)
  • pnpm test: 1874 passed(全体テスト)
  • pnpm build: PASS(production build)
  • Gemini routing test: 24 passed(routing regression)
  • Python invocation policy strict: PASS(Python 呼び出しポリシー)

Allowed Paths 遵守

Issue #2471 の Allowed Paths と一致する変更ファイルは、次の正確に3ファイルです。

  • scripts/agent-ops/claude_runtime_diag.py
  • scripts/agent-ops/tests/test_claude_runtime_diag.py
  • docs/dev/agent-runtime-ops.md

secret_boundary_guard.sh、.claude/settings.json を含む guard/settings は変更していません。

Runtime Verification Evidence

動作検証の証跡は、sanitized な固定結果だけに限定しています。

受け入れ条件の達成状況

以下の根拠は current head a3ae5d331524016f01420f43f0d5412284e0490a に限定しています。sanitized な結果だけを確認しており、prompt、transcript、値、path、credential、raw contents は保存・投稿していません。

  • AC1: 固定 probe ID と fixed enum 一行出力は focused helper pytest 21 passed で確認しました。
  • AC2: synthetic 値だけを使う fixture table の subprocess 分類は focused helper pytest 21 passed で確認しました。
  • AC3: unknown ID、extra args、その他の不正 invocation の reject は focused helper pytest 21 passed で確認しました。
  • AC4: lexical-only 分類と missing、empty、relative/malformed の扱いは focused helper pytest 21 passed で確認しました。
  • AC5: synthetic guard negative controls と raw egress 非出力は focused helper pytest 21 passed で確認しました。
  • AC6: arbitrary variable、path、expression を受け取る interface を提供しないことは focused helper pytest 21 passed で確認しました。
  • AC7: exact helper invocation の allow と inline Python、環境変数一覧出力、sensitive path の block 維持は focused helper pytest 21 passed で確認しました。
  • AC8: current head で isolated structured runtime smoke が exit 0、clean postcondition でした。新規 private prompt、three literal helper invocations、および untracked worktree-local output directory を用いました。
  • AC9: current head の runtime smoke では sanitized summary のみを確認し、raw egress はありませんでした。prompt、transcript、値、path、credential、raw contents は保存・投稿していません。
  • AC10: focused helper pytest 21 passed、typecheck、lint、test 1874 passed、build、Gemini routing 24 passed、Python invocation policy strict が PASS しました。
  • AC12: 本文は日本語中心の preflight を PASS し、Closes #2471 と Related #2456 を記載しています。調査: worktree isolation / secret boundary guard が secret-free診断まで過剰拒否する #2456 は close しません。

Schema Change Applicability

  • decision: not_schema_change
  • reason: 既存の producer-consumer machine-readable schema は変更せず、固定 argv を持つ新しいローカル診断 CLI を追加しただけです。

Schema Consumer Inventory

N/A

既存 schema を変更しないため、consumer inventory と migration は不要です。

Compatibility Decision(互換性判定)

  • change_type: N/A
  • compatibility: N/A
  • migration_required: N/A
  • migration_or_followup: N/A
  • reason: 既存 schema のキー、型、consumer を変更していません。

Safety Claim Matrix

Claim Implemented? Not controlled Evidence Follow-up
固定 three probe IDs だけを受理し、成功時は固定 enum 一行だけを返す yes N/A focused pytest 21 passed N/A
任意 argv を拒否し、test-owned value・path・sentinel を stdout/stderr へ出さない yes N/A focused pytest 21 passed N/A
exact literal helper invocation は secret boundary guard を通り、inline Python・env dump・sensitive path の block は維持される yes N/A synthetic PreToolUse fixture focused tests N/A
isolated runtime で literal invocation が worktree verifier に拒否されず fixed enum-only summary を返す yes N/A structured runtime smoke PASS N/A
secret_boundary_guard.sh と .claude/settings.json の保護範囲を変更しない yes N/A changed-path review と focused tests N/A

Notes

  • Related issue: 調査: worktree isolation / secret boundary guard が secret-free診断まで過剰拒否する #2456
  • MVP scope: literal-path helper、focused tests、canonical invocation documentation に限定しています。
  • AI / NotebookLM usage: Claude Code SubAgent を実装・独立検証・PR review に使用しました。NotebookLM は使用していません。
  • runtime evidence は fixed enum-only summary を確認し、prompt、transcript、raw environment value、raw path、credential、token、config content を commit・PR本文・GitHub comment に含めていません。

固定 probe ID だけで Claude-GPT runtime の状態を分類し、raw environment value や path を露出しない。

Co-Authored-By: Claude Code <[email protected]>
@squne121
squne121 marked this pull request as ready for review September 1, 2026 10:40
@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #2474 closed).

Test and others added 2 commits September 1, 2026 19:48
Keep the fixed runtime diagnostic documentation Japanese-centred without changing commands or safety semantics.

Co-Authored-By: Claude Code <[email protected]>
Use the repository's locked uv Python invocation for the fixed diagnostic probes so strict policy validation accepts the canonical documentation.

Co-Authored-By: Claude Code <[email protected]>
@squne121
squne121 merged commit 9c49b71 into main Sep 1, 2026
63 checks passed
@squne121
squne121 deleted the worktree-issue-2471-claude-runtime-diag branch September 1, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

実装: secret-free Claude runtime diagnostic を literal-path helper として提供する

1 participant