Skip to content

実装: Claude-GPT launcher の classifyAllShell を native default と同様に省略する - #2717

Merged
squne121 merged 4 commits into
mainfrom
worktree-issue-2709-claude-gpt-launcher-classifyallshell-nat
Sep 22, 2026
Merged

squne121 merged 4 commits into
mainfrom
worktree-issue-2709-claude-gpt-launcher-classifyallshell-nat

Conversation

@squne121

@squne121 squne121 commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

Issue #2709 の実装。Claude-GPT launcher の claude_gpt_auto_mode_json_fragment()(lib.sh)が無条件注入していた classifyAllShell: true を除去し、native Claude Code の既定(narrow な Bash/PowerShell allow が classifier より先に解決される key-omission 相当)に整合させた。native full parity の主張ではなく、Claude-GPT 固有の classifier coverage 拡張だった無条件注入を除去するものに限定する。

current head の owner review(issuecomment-5762036279)で REQUEST_CHANGES 相当と判定された2件の P1(V2 schema cutover 未実施/AC4 SKIP=77 契約未実装)と3件の P2(direct readback 型異常の黙殺・version floor metadata の誤称・stale prose は Out of Scope のまま)を本 commit で解消した。

  • lib.sh: claude_gpt_auto_mode_json_fragment() から classifyAllShell キーを省略。claude_gpt_auto_mode_readback() の readback ロジックを、classifyAllShell の enabled/disabled 判定から tri-state/availability evidence(generated_key_present / direct_readback_available / effective_value / native_parity_claimed)へ更新し、未読出の boolean を enabled・native parity・denial-rate 改善として報告しないようにした。CLAUDE_GPT_MIN_SUPPORTED_CLAUDE_VERSION の役割を launcher 起動を拒否する hard fail-closed gate から non-blocking capability 情報へ縮小した(他機能はこの version floor を参照していないことを investigation 済み)。generated key を省略したにもかかわらず direct readback が true を返す矛盾ケースは、引き続き fail-closed(exit 8)で拒否する(AC5 block 条件 (b))。
    • fix_delta P1-1: 出力 schema identity を CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V2 へ cutover(checks.classify_all_shell_enabled / checks.classify_all_shell_verification_source を廃止した breaking shape change を V1 のまま公開しない)。
    • fix_delta P2-1: direct readback の config.get("classifyAllShell") is True という truthiness 判定を exact type(raw_value) is bool 判定へ変更。non-boolean 値(文字列・null・数値・list・dict 等)は genuine false へ黙って正規化せず、新規 fail-closed reason classify_all_shell_readback_non_boolean を出す。
    • fix_delta P2-2: CLAUDE_GPT_MIN_SUPPORTED_CLAUDE_VERSION に紐づく evidence field を claude_version.ok(曖昧な「readback capability」を示唆する名称)から claude_version.classify_all_shell_setting_version_floor_met(「autoMode.classifyAllShell setting のサポート開始バージョンを満たしているか」に限定した意味)へ改称し、コメントも direct readback availability とは別物であることを明記した。
  • preflight.sh: --auto-mode-check の出力 schema を CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V2 に更新し、exit code 契約コメントを新 evidence shape・新 fail-closed reason に合わせて更新した。あわせて「opt-in で通常起動に組み込まれない」という stale な説明を訂正し、launch.sh が通常起動のたびにこの readback を実際に呼び出している実態を明記した(Issue 実装: Claude-GPT launcher の classifyAllShell を native default と同様に省略する #2709 Background で指摘された stale prose の是正。Allowed Paths に含まれる preflight.sh の範囲内)。
  • auto_mode_canary.py:
    • fix_delta P1-1: EVIDENCE_SCHEMA を AUTO_MODE_CANARY_EVIDENCE_V2 へ cutover。_effective_policy() に EXPECTED_AUTO_MODE_CHECK_SCHEMA(CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V2)との schema identity 検証を追加し、渡された --auto-mode-check-json の schema が一致しない場合(欠落・legacy V1 artifact・不明 schema のいずれか)は、その中身を「未評価 evidence」へ黙って変換せず auto_mode_check_schema_mismatch: true / auto_mode_check_observed_schema として明示する。main() はこの mismatch を検知した場合、他の mode の結果が全て OK/SKIP であっても overall exit_classification を "pass" にせず fail-closed にする(negative regression: test_effective_policy_rejects_legacy_v1_schema_as_mismatch_not_pass / test_run_marks_overall_fail_when_auto_mode_check_schema_mismatches)。generic migration/compatibility framework は追加していない。
  • tests/test_auto_mode_policy.py: schema change(V1→V2 / claude_version.ok → claude_version.classify_all_shell_setting_version_floor_met)に伴う既存 assertion を適合。legacy V1 artifact の schema mismatch 拒否を検証する2件の新規 test を追加した(P1-1 の negative regression)。
  • tests/test_classify_all_shell_native_projection.py:
    • fix_delta P1-2: AC4 authoritative runtime verifier を本ファイル内の薄い CLI entrypoint(run_ac4_runtime_verifier() / if __name__ == "__main__":)として追加した。新規 harness ファイルは作らない。python3 test_classify_all_shell_native_projection.py として直接実行すると、claude CLI 不在時は exit 77(explicit SKIP。PASS へ昇格しない)、readback/policy 異常時は exit 1、成功時は exit 0 を返す process-level 契約を実装した。既存 pytest.mark.skipif(REAL_CLAUDE_BIN is None, ...) は unit regression としてのみ残し、PR body ではこれを AC4 の authoritative runtime VC の代替として扱わない。3系統の exit code を test_ac4_runtime_verifier_skips_with_exit_77_when_claude_unavailable / test_ac4_runtime_verifier_exits_0_on_success_and_1_on_contradicting_readback で regression する。
    • fix_delta P2-1: _write_fake_claude() に classify_all_shell_raw_literal パラメータを追加し、non-boolean drift(JSON string / null / number / list / dict)を模擬した test_classify_all_shell_readback_non_boolean_is_schema_drift_not_false(parametrize 5 ケース)を追加した。

Checks

  • AC1: uv run --locked pytest scripts/claude-gpt/tests/test_classify_all_shell_native_projection.py::test_generated_settings_omits_classify_all_shell -q PASS
  • AC2: uv run --locked pytest scripts/claude-gpt/tests/test_classify_all_shell_native_projection.py::test_effective_policy_reports_tri_state_evidence -q PASS
  • AC3: uv run --locked pytest scripts/claude-gpt/tests/test_auto_mode_policy.py -q PASS(66 passed, 1 skipped)/ uv run --locked pytest scripts/claude-gpt/tests/test_classify_all_shell_native_projection.py::test_native_aligned_projection_preserves_hard_deny -q PASS
  • AC4: authoritative runtime verifier(unit regression の pytest skip ではなく、process-level exit code 契約):
    • uv run --locked python3 scripts/claude-gpt/tests/test_classify_all_shell_native_projection.py → exit 0(実 claude CLI 2.1.278。sanitized evidence を stdout に出力)
    • claude CLI 非存在 env(PATH から claude を除外・CLAUDE_GPT_CLAUDE_BIN 未設定)での同コマンド実行 → exit 77(SKIP: claude CLI not available for AC4 runtime verification を stderr に出力。PASS へ非昇格)
    • CLAUDE_GPT_CLAUDE_BIN を「generated key 省略と矛盾するtrueを返す fake claude」に向けた同コマンド実行 → exit 1(fail-closed readback を stderr に出力)
    • regression: uv run --locked pytest scripts/claude-gpt/tests/test_classify_all_shell_native_projection.py::test_ac4_runtime_verifier_skips_with_exit_77_when_claude_unavailable scripts/claude-gpt/tests/test_classify_all_shell_native_projection.py::test_ac4_runtime_verifier_exits_0_on_success_and_1_on_contradicting_readback -q PASS
    • 従来の uv run --locked pytest scripts/claude-gpt/tests/test_classify_all_shell_native_projection.py::test_real_cli_projection_readback_or_skip -q PASS(実 claude CLI 2.1.278。ただしこれは unit regression であり authoritative runtime VC ではない)
  • AC5: uv run --locked pytest scripts/claude-gpt/tests/test_classify_all_shell_native_projection.py::test_unreadable_native_boolean_does_not_claim_parity -q PASS
  • AC6: uv run --locked pytest scripts/claude-gpt/tests/test_classify_all_shell_native_projection.py::test_min_supported_version_gate_is_non_blocking -q PASS
  • AC7: pnpm typecheck PASS / pnpm lint PASS(No issues found)/ pnpm test PASS(108 files, 1939 tests)/ pnpm build PASS / uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py PASS(24 passed)/ uv run --locked pytest scripts/claude-gpt/tests/test_auto_mode_policy.py scripts/claude-gpt/tests/test_classify_all_shell_native_projection.py -q PASS(79 passed, 1 skipped)
  • fix_delta P1-1(V2 schema cutover + schema validation + legacy V1 negative regression): uv run --locked pytest scripts/claude-gpt/tests/test_auto_mode_policy.py::test_effective_policy_rejects_legacy_v1_schema_as_mismatch_not_pass scripts/claude-gpt/tests/test_auto_mode_policy.py::test_run_marks_overall_fail_when_auto_mode_check_schema_mismatches -q PASS
  • fix_delta P2-1(non-boolean readback drift regression): uv run --locked pytest "scripts/claude-gpt/tests/test_classify_all_shell_native_projection.py::test_classify_all_shell_readback_non_boolean_is_schema_drift_not_false" -q PASS(5 parametrized cases)
  • 追加確認: uv run --locked pytest scripts/claude-gpt/ -q(Allowed Paths 外のファイルも含む全 claude-gpt 回帰)PASS(459 passed, 76 skipped, 6 deselected)— 他ファイルの fake claude binary が classifyAllShell を条件付きで設定する箇所(generated fragment が省略すれば単に設定されない)を含め、regression なしを確認

Schema Change Applicability

  • decision: schema_change
  • reason: CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V1(lib.sh が生成、preflight.sh --auto-mode-check 経由で出力)の checks オブジェクトから classify_all_shell_enabled / classify_all_shell_verification_source を削除し、新規トップレベル classify_all_shell(tri-state/availability evidence、4 フィールド)を追加し、claude_version.ok を claude_version.classify_all_shell_setting_version_floor_met へ改称した。連動して AUTO_MODE_CANARY_EVIDENCE_V1(auto_mode_canary.py)の effective_policy.classify_all_shell サブフィールドを真偽値からオブジェクトへ変更し、effective_policy に auto_mode_check_schema_mismatch / auto_mode_check_observed_schema を新設した。
  • これらは additive ではない breaking shape change であるため(owner review 指摘)、schema 文字列自体を CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V2 / AUTO_MODE_CANARY_EVIDENCE_V2 へ cutoverした(V1 のまま維持しない)。direct consumer が lib.sh / preflight.sh / auto_mode_canary.py / scripts/claude-gpt/tests/* に閉じていることを investigation 済みのため、汎用 migration framework・version negotiation framework・compatibility shim は追加していない(局所的な一括 cutover)。

Schema Consumer Inventory

before(変更前のスキーマ形状。CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V1 / AUTO_MODE_CANARY_EVIDENCE_V1)

CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V1.checks:
  - classify_all_shell_enabled: bool
  - classify_all_shell_verification_source: "effective_config" | "settings_literal_plus_version_gate_best_effort" | "not_evaluated"
CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V1.claude_version.ok: bool

AUTO_MODE_CANARY_EVIDENCE_V1.effective_policy.classify_all_shell: bool(既定 True)

after(変更後のスキーマ形状。CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V2 / AUTO_MODE_CANARY_EVIDENCE_V2)

CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V2.classify_all_shell(トップレベル新設。checks からは削除):
  - generated_key_present: bool
  - direct_readback_available: bool
  - effective_value: bool | null
  - native_parity_claimed: bool(常に false)

CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V2.claude_version.classify_all_shell_setting_version_floor_met: bool
  (旧 claude_version.ok から改称。`autoMode.classifyAllShell` setting のサポート開始
  バージョンを満たしているかのみを意味し、direct boolean readback availability とは別物)

CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V2 の fail_closed_reasons に新規
`classify_all_shell_readback_non_boolean`(direct readback が exact bool でない
値を返した場合。genuine false へ黙って正規化しない)を追加。

AUTO_MODE_CANARY_EVIDENCE_V2.effective_policy.classify_all_shell: 上記と同形の object(既定は
  { generated_key_present: false, direct_readback_available: false, effective_value: null, native_parity_claimed: false })

AUTO_MODE_CANARY_EVIDENCE_V2.effective_policy.auto_mode_check_schema_mismatch: bool(新設。
  --auto-mode-check-json の schema が CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V2 と
  一致しない場合 true。main() はこれを検知すると overall exit_classification を
  "pass" にしない)
AUTO_MODE_CANARY_EVIDENCE_V2.effective_policy.auto_mode_check_observed_schema: string | null(新設)

consumer inventory table(consumer 一覧テーブル)

Consumer ファイル 更新有無 備考
scripts/claude-gpt/lib.sh(claude_gpt_auto_mode_readback() — producer) 更新済み 新 V2 schema を生成する producer 本体。exact bool 型判定・schema identity 文字列を含む
scripts/claude-gpt/preflight.sh(--auto-mode-check 経由でそのまま stdout へ出力) 更新済み JSON 自体は lib.sh の出力をそのまま printf/透過する。schema 文字列を含む2箇所の printf エラーレスポンスも V2 化
scripts/claude-gpt/auto_mode_canary.py(_effective_policy() / main() — consumer) 更新済み checks.classify_all_shell_enabled 読み取りから新 classify_all_shell object 読み取りへ変更。加えて schema identity 検証(EXPECTED_AUTO_MODE_CHECK_SCHEMA)を新規追加し、mismatch を overall exit classification に反映する
scripts/claude-gpt/tests/test_auto_mode_policy.py 更新済み schema change に伴う既存 assertion の適合 + legacy V1 artifact 拒否の新規 negative regression 2件
scripts/claude-gpt/tests/test_classify_all_shell_native_projection.py 更新済み 新 schema の focused regression + AC4 authoritative runtime verifier entrypoint + non-boolean drift regression
scripts/claude-gpt/launch.sh 変更なし(Allowed Paths 外) AUTO_MODE_CHECK_JSON を auto-mode-check.json へそのまま書き出すのみで、個別フィールドを読み取らない(grep/jq 等での分解読み取りなし)。schema 形状変化の影響を受けない
その他 scripts/claude-gpt/**(launch.sh を subprocess 起動する既存 hermetic test 群) 変更なし(Allowed Paths 外、investigation 済み) fake claude stub は classifyAllShell を settings 入力に応じて条件付き設定するのみで、CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V2 / AUTO_MODE_CANARY_EVIDENCE_V2 の JSON 形状を読み取って assert していない(investigation で effective_policy の direct consumer は auto_mode_canary.py と test_auto_mode_policy.py のみに閉じていることを確認済み)。uv run --locked pytest scripts/claude-gpt/ -q で regression なしを確認済み(459 passed, 76 skipped, 6 deselected)

このスキーマの直接 consumer は lib.sh / preflight.sh / auto_mode_canary.py / scripts/claude-gpt/tests/* に閉じている(Issue #2709 Background で investigation 済み。docs/dev/schema-governance.md の Initial Known Schemas には未登録)。

Safety Claim Matrix

N/A
reason: 本 PR の変更ファイル(scripts/claude-gpt/lib.sh / preflight.sh / auto_mode_canary.py / tests/*)は SAFETY_SENSITIVE_PATH_PATTERNS(transport / permission / sandbox / auth / mcp / .claude/skills/ / .github/workflows/)のいずれにも該当しない。

ただし本 PR は Auto mode policy の生成ロジックに触れるため、念のため既存安全境界の継続性を明記する:

  • permissions.deny、explicit PermissionRequest allow、GPT hard-deny(default branch push / force push / remote ref deletion)、proxy directory read isolation、hook、launcher-owned Auto-mode activation、--permission-mode auto 強制は本 PR で一切変更していない。既存 test_auto_mode_policy.py の全 66 テスト(1 skip)が継続 PASS することで検証済み。
  • classifyAllShell の key omission は shell permissions.allow を追加・共有・緩和するものではない(Out of Scope 節参照)。生成される hard_deny の narrow 追加分(default branch push / force push / remote ref deletion)は test_native_aligned_projection_preserves_hard_deny で回帰確認済み。
  • V2 cutover / schema mismatch fail-closed / non-boolean drift の追加は、いずれも既存 safety boundary を緩めるものではなく、evidence の正確性・fail-closed 挙動を強化する変更に限定している。

Runtime Verification Evidence(動作検証証跡)

Runtime Verification Applicability: immediate(applicable_acs: AC2, AC4)。AC4 の authoritative runtime VC は、unit regression の pytest skip ではなく、test_classify_all_shell_native_projection.py 内の薄い CLI entrypoint(run_ac4_runtime_verifier())を python3 で直接実行した process-level exit code で検証する。

isolated Claude-GPT launcher runtime で real Claude CLI(2.1.278)を用いて以下の三系統をすべて実 exit code で確認した(fallback を使わず、SKIP を PASS へ昇格しない):

# 1. 成功系(実 claude CLI 2.1.278 利用)
$ uv run --locked python3 scripts/claude-gpt/tests/test_classify_all_shell_native_projection.py
exit code: 0

# 2. SKIP系(claude CLI が PATH に存在せず CLAUDE_GPT_CLAUDE_BIN も未設定の env)
exit code: 77
stderr: "SKIP: claude CLI not available for AC4 runtime verification"

# 3. failure系(generated key 省略と矛盾する true を返す fake claude を
#    CLAUDE_GPT_CLAUDE_BIN 経由で注入)
exit code: 1

sanitized effective-policy summary(AC4 の focused runtime verifier が確認した成功系 stdout。exit 0 のケース):

{
  "schema": "CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V2",
  "status": "ok",
  "ok": true,
  "claude_version": {
    "raw": "2.1.278 (Claude Code)",
    "parsed": [2, 1, 278],
    "min_supported": [2, 1, 193],
    "classify_all_shell_setting_version_floor_met": true
  },
  "checks": {
    "environment_narrow_label_present": true,
    "allow_narrow_label_present": true,
    "hard_deny_defaults_and_additions_present": true,
    "soft_deny_unmodified": true
  },
  "classify_all_shell": {
    "generated_key_present": false,
    "direct_readback_available": false,
    "effective_value": null,
    "native_parity_claimed": false
  },
  "fail_closed_reasons": []
}

raw settings / prompt / transcript / token / credential / HOME 絶対パスは記録していない(digest 化された値と narrow label の存在確認のみ)。GitHub mutation や classifier request は発生させていない。

Notes

IMPLEMENTATION_SCOPE_COVERAGE_V1:
  schema_version: "IMPLEMENTATION_SCOPE_COVERAGE_V1"
  issue_number: 2709
  issue_body_sha256: "sha256:b7a47b64d926c44b73e3d11edf5428323240d30b69c197e236e3e943a8debcb6"
  normalized_scope_manifest_sha256: "sha256:c8faa337a6c8a13a939b783f82fc3464a6885d9fbe0d572b1c26b8c4177e70f8"
  pr_head_sha: "d8e48dca3d7eb8516bcd2dcc86b8d048933c7f02"
  scope_manifest: {"acceptance_criteria": ["CLAUDE_GPT_MIN_SUPPORTED_CLAUDE_VERSION の version floor は、classifyAllShell readback 検証が利用可能かどうかを示す non-blocking capability 情報として扱う(launcher 起動そのものを拒否しない)。他の独立した機能がこの version floor を必要とする場合、その根拠を実装 PR に明記して維持する。", "direct readback が利用可能になった場合に、generated/default projection と矛盾する値を返した。", "direct_readback_available: false 自体は merge blocker としない。block 条件は次のいずれかに限定する。", "generated settings に classifyAllShell キーが残っている。", "launcher 固有 hard boundary(hard_deny 等)が壊れた。", "launcher-generated autoMode(claude_gpt_auto_mode_json_fragment() の出力)は classifyAllShell キーを含まず、無関係な user/project settings を取り込まない。", "permissions.deny、explicit PermissionRequest allow、GPT hard-deny(default branch push・force push・remote ref deletion)、proxy directory read isolation、hook、launcher-owned Auto-mode activation、--permission-mode auto 強制、bypass 不可の既存契約は、既存 scripts/claude-gpt/tests/test_auto_mode_policy.py suite の継続 PASS で verification する(新規 test への再収容や新しい security regression harness の追加は行わない)。新規 test_classify_all_shell_native_projection.py は generated autoMode・classifyAllShell omission・hard_deny projection の保持・readback availability 表現に限定する。", "pnpm typecheck、pnpm lint、pnpm test、pnpm build、project-required model-routing test、focused Claude-GPT policy test が PASS する。", "preflight/canary の effective-policy 出力は、少なくとも次の tri-state/availability 表現を持つ evidence を返す。key omission と native direct boolean readback の availability を区別し、未読出の boolean を enabled・native parity・denial-rate 改善として報告しない。", "real CLI が利用可能な場合、isolated launcher runtime の focused verifier は generated policy(key omission・4 rule lists の readback・hard-deny 追加分)と readback availability を sanitized evidence として出力して PASS する。GitHub mutation や classifier request を発生させない。利用不能時は exit 77 の SKIP とし PASS に昇格しない。", "必要な CLI capability 自体が存在せず、今回の projection を検証できない(この場合は AC4 の SKIP 経路を使い、runtime PASS を主張しない)。"], "allowed_paths": ["scripts/claude-gpt/auto_mode_canary.py", "scripts/claude-gpt/lib.sh", "scripts/claude-gpt/preflight.sh", "scripts/claude-gpt/tests/test_auto_mode_policy.py", "scripts/claude-gpt/tests/test_classify_all_shell_native_projection.py"], "change_kind": "code", "goal_ref": "Claude-GPT launcher の Auto mode が classifyAllShell を native default と同様に generated settings から省略するようにし(native full parity の主張ではない)、保持すべき安全境界と evidence の限界を機械可読な形で確認可能にする", "in_scope": ["CLAUDE_GPT_MIN_SUPPORTED_CLAUDE_VERSION の役割を、launcher 起動を拒否する hard fail-closed gate から、classifyAllShell readback 検証が利用可能かどうかを示す capability 情報(non-blocking)へ縮小する。他の独立した機能がこの version floor を要求する場合はそれを維持する根拠を本 Issue 内に記録する(下記 AC6)。", "generated settings・effective-policy evidence・negative regression により、キー省略と既存 safety guard の保持を確認する focused test/runtime verifier を追加する。", "launcher-owned JSON fragment(lib.sh の claude_gpt_auto_mode_json_fragment())から Claude-GPT 固有の無条件 classifyAllShell: true を除去する。", "readback/preflight(preflight.sh --auto-mode-check)と canary(auto_mode_canary.py)の evidence 表現を、直接 boolean readback が現行 native CLI で未対応であることを前提にしつつ、存在しない key を true/false と推定・報告しない tri-state/availability 表現(下記 AC2 evidence shape)へ更新する。この表現変更に伴う CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V1 / canary の局所的な result shape 更新(V2 化)を明示的に In Scope とする。この schema の直接 consumer は lib.sh / preflight.sh / auto_mode_canary.py / scripts/claude-gpt/tests/* に閉じていることを investigation で確認済み(下記 Background 参照)。", "新規 focused test file scripts/claude-gpt/tests/test_classify_all_shell_native_projection.py に、generated autoMode の key omission・hard_deny projection の保持・readback availability 表現の focused regression test を追加する。"], "schema_version": "IMPLEMENTATION_SCOPE_MANIFEST_V1"}

本 PR は Claude Code(claude-sonnet-5)により生成された: 🤖 Generated with Claude Code

#2709)

launcher-owned autoMode fragment(claude_gpt_auto_mode_json_fragment)から
Claude-GPT 固有の無条件 `classifyAllShell: true` 注入を除去し、native Claude
Code の既定(narrow allow が classifier より先に解決される key-omission
相当)に整合させる。native full parity の主張ではなく、classifyAllShell
coverage の既定への整合に限定する。

- lib.sh: fragment から classifyAllShell キーを省略。claude_gpt_auto_mode_readback
  の readback ロジックを tri-state/availability evidence
  (generated_key_present / direct_readback_available / effective_value /
  native_parity_claimed)へ更新し、未読出の boolean を enabled・native
  parity・denial-rate 改善として報告しない。version floor
  (CLAUDE_GPT_MIN_SUPPORTED_CLAUDE_VERSION)は launcher 起動を拒否する
  hard fail-closed gate から non-blocking capability 情報へ縮小。generated
  key 省略と矛盾する direct readback 値(true)は引き続き fail-closed で
  拒否する。
- preflight.sh: --auto-mode-check の exit code 契約コメントを新 evidence
  shape に合わせて更新し、通常起動が毎回この readback を呼ぶという stale
  でない実態を明記する。
- auto_mode_canary.py: _effective_policy() の classify_all_shell を
  真偽値の decay デフォルト True から、lib.sh の readback 結果をそのまま
  転記する tri-state evidence オブジェクトへ更新する。
- test_auto_mode_policy.py: schema change に伴う既存 assertion を新 evidence
  shape へ適合(新規テスト関数は追加していない)。
- 新規 test_classify_all_shell_native_projection.py: generated autoMode の
  key omission、tri-state evidence の返却、hard_deny projection の保持、
  real CLI での readback(利用不能なら skip)、矛盾する readback 値の
  fail-closed 拒否、version floor の non-blocking 化を focused regression
  として検証する。

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #2717 closed).

@squne121

Copy link
Copy Markdown
Owner Author

判定

REQUEST_CHANGES 相当です。

PR #2717 の中心方針、つまり launcher-generated autoMode から classifyAllShell: true を外す変更自体は妥当です。現行 Claude Code 公式仕様でも、既定では narrow な Bash/PowerShell allow が classifier より先に解決され、classifyAllShell: true を指定した場合だけ全 shell command が classifier に送られます。公式もこれを latency と coverage のトレードオフとして説明しています。また claude auto-mode defaults/config が公開するのは4つの rule list であり、classifyAllShell の boolean は readback surface にありません。([Claude]1)

current head 4ac5840770d679cd1f0a452b9bec5a33e41102e8 では CI は最終的に全体 success です。ただし、以下の2件は green CI では捕捉できておらず、#2709 の確定済み contract と食い違っています。

P1 — V2 化を明示した契約なのに、breaking shape change を V1 のまま公開している

これは最優先で直した方がよいです。

Issue #2709 の refinement 完了コメント issuecomment-5760321877 は明確に、

CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V1 / canary evidence の局所的な V2 化

を contract delta として確定しています。現在の Issue 本文にも、tri-state 化に伴う result shape の 「V2 化」 が In Scope として残っています。

しかし PR は逆に ## Schema Change Applicability で、breaking change であることを自ら認識しつつ、

  • CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V1
  • AUTO_MODE_CANARY_EVIDENCE_V1

をそのまま維持しています。

実際の変更は additive ではありません。

旧 preflight V1:

checks.classify_all_shell_enabled: bool
checks.classify_all_shell_verification_source: string

新 PR:

classify_all_shell:
  generated_key_present: bool
  direct_readback_available: bool
  effective_value: bool | null
  native_parity_claimed: bool

さらに canary の

effective_policy.classify_all_shell

も bool → object です。同じ V1 を名乗れる互換変更ではありません。

しかも、これは命名だけの問題ではなく、現在の _effective_policy() に実害があります。auto_mode_canary.py は渡された --auto-mode-check-json の schema を一切検証せず、

classify_all_shell_payload = check_payload.get("classify_all_shell")
if isinstance(classify_all_shell_payload, dict):
    ...

という読み方をします。そのため旧 V1 artifact を渡すと、新フィールドがないことを schema mismatch と判定せず、

{
  "generated_key_present": false,
  "direct_readback_available": false,
  "effective_value": null,
  "native_parity_claimed": false
}

という新形式の「未評価 evidence」に静かに変換されます。さらに canary の overall PASS/SKIP/FAIL は _effective_policy() の schema validity と独立しているので、他の canary が通れば、不正な旧 evidence を含んだまま exit_classification: pass も作れます。

推奨修正は小さくて済みます。

  • preflight を CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V2 にする
  • canary outer shape も bool→object が machine contract なら AUTO_MODE_CANARY_EVIDENCE_V2 にする
  • _effective_policy() は expected schema 以外を転記しない
  • 旧 V1 を入力する negative regression を1本追加する
  • 汎用 migration framework や compatibility layer は作らない

direct consumer が局所的だという PR 自身の inventory が正しいなら、むしろここは互換 shim を増やさず一括 V2 cutover する方が、個人開発として簡潔です。

P1 — AC4 の「CLI 不在 = exit 77 SKIP」が実装されていない

新規 test の runtime verifier は、

@pytest.mark.skipif(REAL_CLAUDE_BIN is None, reason="claude CLI not available")
def test_real_cli_projection_readback_or_skip(...):

になっています。

一方 #2709 の AC4 は明示的に、

利用不能時は exit 77 の SKIP とし PASS に昇格しない

と要求しています。リポジトリの docs/dev/runtime-verification-policy.md も decision: immediate の runtime VC は SKIP=77 と定義しています。

pytest.mark.skipif はその契約の代替になりません。pytest の skip は「suite を green に保ちながらその test を実行しない」仕組みであり、pytest の成功 exit code は 0 です。したがって現在 PR 本文にある「pytest skip とし、PASS へ昇格しない設計」という説明は、プロセス exit semantics として成立していません。([pytestドキュメント]2)

現在の実機では Claude CLI 2.1.278 が存在したため test は本当に PASS しており、今回の証跡自体は問題ありません。問題になるのは CLI が無い環境に移したときです。そのとき同じ VC が green になってしまいます。

ここも大きな harness は不要です。例えば focused verifier を極薄の shell/Python entrypoint にして、

Claude CLI 不在       -> SKIP: ... / exit 77
readback 成功         -> exit 0
readback/policy 異常  -> exit 1

だけ担わせ、その内部から pytest または既存 helper を使えば十分です。unit regression 側の pytest.skip は残して構いませんが、authoritative runtime VC としては使わないのがよいです。

P2 — direct readback の型異常を false として潰している

lib.sh の Python 部分では現在、

if config is not None and "classifyAllShell" in config:
    direct_readback_available = True
    effective_value = config.get("classifyAllShell") is True

です。

つまり将来 vendor CLI が例えば、

{"classifyAllShell": "false"}

や null、数値等を返した場合、

{
  "direct_readback_available": true,
  "effective_value": false
}

と報告します。

「readback surface が将来出現した場合に備える」コードなのに、schema drift を genuine false と区別できません。

ここは、

raw_value = config["classifyAllShell"]
if type(raw_value) is bool:
    direct_readback_available = True
    effective_value = raw_value
else:
    reasons.append("classify_all_shell_readback_non_boolean")

程度で十分です。新しい generic validator は不要です。

P2 — 2.1.193 を「direct readback capability」の指標と呼ぶのは不正確

CLAUDE_GPT_MIN_SUPPORTED_CLAUDE_VERSION="2.1.193" を hard gate から non-blocking metadata に落としたこと自体は良い変更です。

ただしコメントではこれを、

classifyAllShell direct boolean readback 検証が利用可能かどうかを示す capability 情報

と表現しています。

公式仕様で v2.1.193 が意味するのは autoMode.classifyAllShell setting をサポートし始める境界です。公式 defaults/config は現在も4 rule lists しか出していません。PR自身の Claude Code 2.1.278 実測でも direct_readback_available: false です。したがって「≥2.1.193」と「direct readback capability」は別物です。(Claude)

挙動を変える必要まではありませんが、フィールド/コメントは例えば、

classify_all_shell_setting_version_floor_met

程度の意味に限定した方が、後の調査で誤読されません。独立用途が本当に無いなら、V2化に合わせてこの dead-ish metadata 自体を落とす選択肢もあります。

P2 — stale prose は今回の runtime blocker ではないが、早めに消した方がよい

調査時点でも以下は古いままです。

#2709 refinement でも既知の残件として明示され、Allowed Paths boundary の都合で意図的に外されています。そのため #2717 の契約違反として merge blocker にはしません。

ただ、実装直後からコメントが現在挙動と逆になるので、次の独立 Issue まで大げさにするより、owner authority 的に可能なら comment/doc-only で一緒に直す方が保守コストは低いと思います。新しい approval/harness を追加してまで守る価値のある分離ではありません。

問題なしと判断した点

classifyAllShell の omission 自体は公式仕様と一致します。true にすると narrow allow まで classifier 経由となり latency が増えるため、今回の変更は日常操作の friction 削減という目的に直接合っています。([Claude]1)

また $defaults を environment / allow / hard_deny に残している点も正しいです。公式仕様では $defaults を外すとその section の built-in rules を丸ごと置換します。([Claude]1)

独自 hard-deny を残しつつ native_parity_claimed: false としているのも適切です。現在の native Auto mode は working repository の default branch への push も既定許可ですが、この launcher は default-branch push hard-deny を維持するので full native parity ではありません。PRはそこを過大主張していません。([Claude]1)

#2659 の classifier model routing、#2666 の narrow label 文言修正を再度抱き合わせていない点も良いです。特に #2659 は routing 先変更を証明しただけで denial-rate 改善を主張しておらず、今回の projection 変更とは因果を分離したままにできています。

また IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha が現在 head より古い点も調べましたが、これはバグ扱いしません。この marker は実装上明示的に PR publication-time immutable snapshot として設計されており、その後の追加 commit で更新しないのが契約です。

修正優先順位

このPRを高品質かつ過剰ハーネスなしで仕上げるなら、変更はかなり限定できます。

  1. V2 schema cutover + schema validation + old-V1 negative test
  2. AC4 用の薄い exit-77 runtime verifier
  3. effective_value の厳密 bool type check
  4. version metadata の命名/説明を正確化
  5. stale comment/doc は可能なら同時修正、難しければ小さな follow-up

新しい broker、hook、approval ledger、GitHub mutation canary、denial-rate benchmarkは不要です。現在の5ファイル中心の実装規模をほぼ維持したまま直せます。

結論として、behavioral change は採用してよい一方、現 head のままの merge は勧めません。特に V1 のまま breaking schema を出す点と、runtime SKIP が exit 77 になっていない点の2件は、#2709 が refinement でわざわざ解消した契約を実装段階で戻してしまっています。 CI が全 green なのは確認済みですが、この2点は現テスト構成では検出されません。

@squne121

Copy link
Copy Markdown
Owner Author

確認した現状では、PR #2717 は open / draft / mergeable / clean、head は 4ac5840770d679cd1f0a452b9bec5a33e41102e8 で、変更5ファイルはすべて #2709 の Allowed Paths 内です。対象コメントの P1 2件は Issue #2709 の現行契約と実際に整合しており、優先修正対象にするべきです。

また外部仕様も再確認しました。Claude Code の現行ドキュメントでは、classifyAllShell 未指定時は narrow Bash/PowerShell allow が classifier より先に処理され、true のとき全 shell command が classifier に回ります。v2.1.193 は setting のサポート開始バージョンであり、defaults/config が返すのは4 rule listsなので、対象コメントの version metadata 指摘も妥当です。([Claude]1) pytest の通常の skip は authoritative VC の「exit 77」と同義ではないため、AC4 は独立した exit semantics を持たせるべきです。([pytestドキュメント]2)

一方、対象コメント自身の「REQUEST_CHANGES 相当」は現行 impl-review-loop の human-veto 規約に引っかかります。そこで、今回あなたが明示した「修正してマージ直前まで自律継続」という指示を live PR comment に materialize してから、対象コメントを fix_delta として処理する構成にしています。launch.sh と docs/dev/agent-skill-boundaries.md は依然 Allowed Paths 外なので、この実行では触らせません。

以下を、そのまま既に auto mode で起動している Claude Code に渡すのを推奨します。

PR #2717 の既存実装を対象に、以下の owner review comment を修正入力として .claude/skills/impl-review-loop を実行してください。

Target PR:
#2717

Target review/fix-delta comment:
#2717 (comment)

Linked Issue:
#2709

Canonical skill:
https://github.com/squne121/loop-protocol/tree/main/.claude/skills/impl-review-loop

Operator intent

これは既存 PR #2717 を破棄して作り直す依頼ではありません。

current PR を resume し、target comment の指摘を修正し、実装 → verification → PR review → fix のループを、人間への途中承認を要求せずに自律実行してください。

最終到達点は impl-review-loop の正常終了条件である merge-ready / draft_pr_ready 相当です。

PR の merge 自体は絶対に実行しないでください。
Issue / PR の close も実行しないでください。
マージ判断だけを人間に残してください。

Important: target comment の human-veto ambiguity を最初に解消する

target comment 冒頭には REQUEST_CHANGES 相当です とあります。

現行 impl-review-loop の Step 5 では live PR 上の owner による REQUEST_CHANGES が human veto の例として定義されているため、その文字列だけを機械的に停止指示として扱うと、今回の operator intent と衝突します。

今回のこの対話指示は明示的に、

  • target comment の指摘を修正要求 / fix_delta として採用する
  • その修正後も impl-review-loop を継続する
  • merge-ready になるまで途中の人間承認は不要
  • merge はしない

という continuation authorization です。

canonical skill が human veto の解除を live PR comment として要求する場合に限り、作業開始前に PR #2717 へ次の趣旨の短い clarification comment を投稿してください。

Operator continuation clarification: issuecomment-5762036279 is repair feedback to be applied as fix_delta, not an instruction to terminate this run. Continue impl-review-loop autonomously through implementation, verification, and re-review until draft_pr_ready / merge-ready. Do not merge. This clarification does not authorize changes outside Issue #2709 Allowed Paths.

投稿した場合は live PR comments を再取得し、target comment の REQUEST_CHANGES を修正要求として継続可能であることを確認してから進んでください。

元の comment は編集・削除しないでください。

Start from live state, not cached assumptions

最初に必ず live state を再取得してください。

少なくとも以下を確認してください。

事前確認時点では PR #2717 の head は
4ac5840770d679cd1f0a452b9bec5a33e41102e8
でしたが、これを authority にせず live read を優先してください。

既存 PR が対象 scope を保持しているため、duplicate PR を作らず existing_pr_resume を優先してください。

Target comment を initial fix_delta として扱う

target comment の findings を優先度順に処理してください。

P1-1: breaking evidence schema を V2 に正しく cutover

Issue #2709 は tri-state shape への変更について局所的な V2 化を In Scope としています。

現在の PR のように breaking shape change を

  • CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V1
  • AUTO_MODE_CANARY_EVIDENCE_V1

のまま公開しないでください。

最小差分で V2 cutover してください。

期待事項:

  • preflight result を V2 schema identity にする
  • canary evidence も machine-readable contract が bool → object に変わるのであれば V2 にする
  • producer / direct consumer / tests を一括して更新する
  • _effective_policy() 等の consumer は expected schema identity を明示的に検証する
  • legacy V1 artifact を新 V2 evidence の「未評価値」に黙って変換しない
  • legacy V1 input が overall PASS に紛れ込まない negative regression を追加する
  • generic migration framework、version negotiation framework、compatibility shim は作らない
  • direct consumers が局所的という既存 inventory を活かし、単純な cutover にする

schema name だけ直して内部 consumer の validation を残さない、という半端な修正は避けてください。

P1-2: AC4 の authoritative runtime verifier を exit 77 contract に合わせる

pytest.mark.skipif の skip を AC4 authoritative runtime VC として扱わないでください。

Issue #2709 の契約どおり、

  • real Claude CLI / required isolated runtime が利用可能 → verifier を実行
  • verifier 成功 → exit 0
  • policy/readback 異常 → non-zero failure
  • required runtime が利用不能 → explicit SKIP として exit 77
  • exit 77 を PASS に昇格しない

という process-level semantics を持つ focused runtime verifier を成立させてください。

ただし Allowed Paths を増やすためだけに新しい harness ファイルを作らないでください。

既存 Allowed Paths 内、特に既存 preflight.sh または focused test file 等を利用して、最も薄い実装にしてください。

unit regression としての pytest.skip が有用なら残して構いませんが、それを AC4 authoritative runtime VC の代替にしないでください。

PR body の Verification Commands / Runtime Verification Evidence も、実際の authoritative command と exit semantics に一致させてください。

P2-1: classifyAllShell direct readback を strict bool として扱う

direct readback に classifyAllShell が存在する場合、Python truthiness や is True だけで非 bool 値を genuine false に潰さないでください。

少なくとも、

  • exact bool true
  • exact bool false
  • key absent
  • key present but non-boolean

を区別してください。

non-boolean は schema/capability drift として明示的 reason を出し、effective_value: false として正常化しないでください。

新しい generic validator framework は不要です。

P2-2: v2.1.193 metadata の意味を正確にする

現行 Claude Code vendor specification では v2.1.193 は autoMode.classifyAllShell setting の support floor です。

claude auto-mode defaults/config が direct boolean readback を公開し始める version floor ではありません。

したがって、現在の metadata/comment/field が >=2.1.193 == direct readback capability を意味している場合は誤解を除いてください。

候補は、

  • setting support floor であることが分かる名称・説明に限定する
  • V2 cutover の中で実際に不要なら dead metadata を削る

のいずれかです。

新しい capability probing framework は作らないでください。

P2-3: stale prose はこの run では scope expansion しない

target comment が指摘した、

  • scripts/claude-gpt/launch.sh
  • docs/dev/agent-skill-boundaries.md

の stale prose は認識してください。

ただし current Issue #2709 ではこれらは明示的に Out of Scope / Allowed Paths 外です。

今回の continuation authorization は Allowed Paths expansion を意味しません。

したがってこの run では上記2ファイルを変更しないでください。

merge blocker にもしないでください。

必要なら最終報告に non-blocking follow-up recommendation として残してください。
この理由だけで新規 Issue を自動作成しないでください。

Allowed Paths boundary

live Issue #2709 を正本として gate を再評価してください。

事前確認時点の Allowed Paths は以下です。

  • scripts/claude-gpt/lib.sh
  • scripts/claude-gpt/preflight.sh
  • scripts/claude-gpt/auto_mode_canary.py
  • scripts/claude-gpt/tests/test_auto_mode_policy.py
  • scripts/claude-gpt/tests/test_classify_all_shell_native_projection.py

live Issue が変わっていなければ、この5パス外の source/document file を変更しないでください。

PR body/comment/evidence 更新は source Allowed Paths と混同しないでください。

SubAgent orchestration — 必須

このタスクは top-level orchestrator が単独で実装・自己レビューしないでください。

.claude/skills/impl-review-loop の canonical Step 1–5 に従い、必要な SubAgent を使ってください。

少なくとも役割を分離してください。

  1. implementation-worker

    • target comment を initial fix_delta として受け取る
    • current PR/worktree を resume
    • P1/P2 を最小差分で修正
    • tests / verifier / PR body の必要更新まで行う
    • merge はしない
  2. test-runner

  3. pr-reviewer / pr-review-judge

    • current head を independent review
    • linked Issue の live contract、target comment、changed files、verification evidence を参照
    • blocker が残れば REQUEST_CHANGES
    • blocker がなければ canonical APPROVE route

各 SubAgent を dispatch したら、必ずその SubAgent の作業完了と構造化結果を待ってから次の routing を判断してください。

「dispatch したので後で確認する」「並列実行中だが結果を待たずに次へ進む」は禁止です。

SubAgent 自身からさらに nested SubAgent delegation は行わせないでください。Issue #2709 の stop condition と canonical skill の boundary を守ってください。

Review/fix loop

最初の target comment だけ直して終了しないでください。

implementation → verification → PR review を current head ごとに行い、REQUEST_CHANGES が返れば blockers を次 iteration の fix_delta にして Step 1 へ戻してください。

head SHA が変わったら旧 review / CI evidence を current-head evidence として再利用しないでください。

main/base drift があれば canonical scope-clean reconciliation / update-branch routing に従ってください。

APPROVE 単独を終了条件にせず、impl-review-loop の live mergeability / blockers / CI / autonomy validator を含む終了条件を満たしてください。

max_iterations その他 canonical hard stop は skill の規定どおり扱ってください。

ただし SubAgent の単なる human_review_required: true、stale snapshot、semantic warning 等を、それ自体で途中承認要求に変換しないでください。

Verification quality

Issue #2709 の Verification Commands を live body から読み直し、必要に応じて V2/AC4修正後の authoritative command に合わせて PR evidence を更新してください。

少なくとも以下の種類を fresh current head で検証してください。

  • generated settings が classifyAllShell を含まないこと
  • V2 preflight schema
  • V2 canary schema
  • legacy V1 input rejection / non-acceptance regression
  • tri-state/availability evidence
  • direct readback strict bool handling
  • hard_deny projection 維持
  • test_auto_mode_policy.py の既存 regression
  • AC4 authoritative runtime verifier の exit 0 / 77 / failure semantics
  • available な real Claude CLI を用いた sanitized runtime verification
  • project-required model-routing tests
  • pnpm typecheck
  • pnpm lint
  • pnpm test
  • pnpm build
  • relevant Claude-GPT focused/full regression

テストを増やす場合も、対象バグを閉じる最小テストにしてください。

新しい broker、hook、approval ledger、GitHub mutation canary、denial-rate benchmark、generic schema migration framework は追加しないでください。

External specification verification

vendor behavior に依存する判断では、古い記憶ではなく現行の公式 Claude Code documentation を確認してください。

特に確認対象:

  • autoMode.classifyAllShell の default behavior
  • classifyAllShell: true の意味
  • v2.1.193 の意味
  • claude auto-mode defaults
  • claude auto-mode config
  • effective config が公開する field surface

pytest の skip / process exit semantics についても公式 pytest documentation を authority にしてください。

外部仕様と repository contract が衝突する場合は勝手に契約を拡張せず、違いを evidence として記録してください。

PR hygiene

実装後は PR body を current implementation と evidence に同期してください。

特に、

  • V1 と書かれた stale schema description
  • Schema Change Applicability
  • Schema Consumer Inventory
  • Checks
  • Runtime Verification Evidence
  • authoritative AC4 command / exit semantics
  • current test counts
  • sanitized runtime evidence

を実際の結果に合わせてください。

過去の publication-time immutable marker を、単に head が変わったという理由だけで書き換えないでください。marker の canonical contract に従ってください。

Prohibited actions

  • PR merge
  • force push
  • default branch への直接 push
  • unrelated refactor
  • Allowed Paths 外 source/doc modification
  • launch.sh / docs/dev/agent-skill-boundaries.md の今回の便乗修正
  • native full parity の主張
  • denial-rate 改善の未検証な主張
  • compatibility framework の過剰実装
  • green CI を理由に target comment の P1 を無視すること
  • test skip を exit 77 と同一視すること
  • SubAgent の完了を待たずに次工程へ進むこと
  • merge-ready 前の途中確認を人間に求めること

Completion condition

以下のいずれかまで、この対話ターン内で自律継続してください。

正常終了:

  • canonical impl-review-loop が approved route に到達
  • current-head verification が必要条件を満たす
  • blockers が空
  • mergeability が canonical approvable state
  • required autonomy validation が通る
  • IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready 相当を生成
  • PR は unmerged のまま

真の hard stop:

  • actual Git conflict
  • secret/protected-path 等の canonical hard gate
  • max_iterations exhaustion
  • permission/validation failure 等、canonical skill が明示的に停止を要求する状態

hard stop の場合は質問だけして終了せず、取得できた evidence、実行済み修正、残 blocker、再開に必要な具体的 action を構造化して報告してください。

最後に、

  • final PR head SHA
  • commits made
  • changed files
  • target comment 各 finding の disposition
  • verification results
  • runtime verifier result と exit code
  • fresh PR-review verdict
  • mergeability
  • remaining warnings / non-blocking follow-up
  • IMPL_REVIEW_LOOP_RESULT_V1

を提示してください。

merge はしないでください。SubAgent の全作業完了を待ち、canonical impl-review-loop の終了判定まで実行してください。

この構成なら、対象コメントの P1/P2 を修正しつつ、REQUEST_CHANGES 文言による意図しない即停止と、stale prose の便乗 scope expansion の両方を避けられます。

@squne121

Copy link
Copy Markdown
Owner Author

Operator continuation clarification: issuecomment-5762036279 is repair feedback to be applied as fix_delta, not an instruction to terminate this run. Continue impl-review-loop autonomously through implementation, verification, and re-review until draft_pr_ready / merge-ready. Do not merge. This clarification does not authorize changes outside Issue #2709 Allowed Paths.

PR #2717 owner review(fix_delta)反映:
- CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V1 / AUTO_MODE_CANARY_EVIDENCE_V1 を
  breaking shape change に合わせて V2 へ cutover し、_effective_policy() に
  schema identity 検証を追加。legacy V1 artifact は「未評価 evidence」へ
  黙って変換せず auto_mode_check_schema_mismatch として明示し、canary の
  overall exit_classification を fail-closed にする
- AC4 authoritative runtime verifier を
  test_classify_all_shell_native_projection.py 内の薄い CLI entrypoint
  (run_ac4_runtime_verifier)として追加し、claude CLI 不在時に exit 77 の
  explicit SKIP、readback/policy 異常時に exit 1、成功時に exit 0 を返す
  process-level 契約を実装(既存 pytest.mark.skipif は unit regression として
  残す)
- lib.sh の classifyAllShell direct readback を exact bool 型判定に変更し、
  non-boolean drift を classify_all_shell_readback_non_boolean として
  明示的に fail-closed にする
- CLAUDE_GPT_MIN_SUPPORTED_CLAUDE_VERSION の意味を
  classify_all_shell_setting_version_floor_met に限定し、direct readback
  availability との混同を解消

Allowed Paths: scripts/claude-gpt/{lib.sh,preflight.sh,auto_mode_canary.py,tests/test_auto_mode_policy.py,tests/test_classify_all_shell_native_projection.py}

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@squne121

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE

PR #2717 を独立に検証した。owner review comment(issuecomment-5762036279)が指摘した P1×2/P2×2 の全項目が diff に実在し、コード読解と手元実行の両方で独立確認できた。P2-3(launch.sh / agent-skill-boundaries.md 除外)も遵守されている。

検証結果サマリ

  1. V2 schema cutover(P1-1): auto_mode_canary.py の EVIDENCE_SCHEMA = "AUTO_MODE_CANARY_EVIDENCE_V2"、EXPECTED_AUTO_MODE_CHECK_SCHEMA = "CLAUDE_GPT_AUTO_MODE_PREFLIGHT_RESULT_V2" を確認。lib.sh/preflight.sh の producer 側も V2 に統一済み。_effective_policy() は observed schema が期待値と不一致(欠落/legacy V1/不明)の場合 auto_mode_check_schema_mismatch: true を明示し、main() はこれを検知すると他 mode が全て OK/SKIP でも exit_classification を "pass" にしない(fail-closed)。legacy V1 artifact を渡す negative regression(test_effective_policy_rejects_legacy_v1_schema_as_mismatch_not_pass/test_run_marks_overall_fail_when_auto_mode_check_schema_mismatches)も存在し、uv run --locked pytest で実行しPASSを確認した。
  2. AC4 exit 77 契約(P1-2): 新規 harness ファイルではなく、既存 Allowed Paths 内の test_classify_all_shell_native_projection.py に run_ac4_runtime_verifier() + if __name__ == "__main__": が実装されている。独立に3系統すべて再現した(pytest.mark.skipif 経由ではなく実 subprocess 実行):
    • claude 不在環境(PATH 無効化、venv python3 直接起動)→ exit 77、stderr に SKIP: claude CLI not available... を確認
    • 実 claude CLI(2.1.278)利用時 → exit 0、PR body 記載の sanitized evidence(classify_all_shell tri-state 4フィールド等)と完全一致する stdout を確認
    • (fake claude で矛盾値を返すケースは PR body の pytest regression test_ac4_runtime_verifier_exits_0_on_success_and_1_on_contradicting_readback が exit 1 を検証しており、フルスイート実行で PASS 済み)
  3. non-boolean readback strict 判定(P2-1): lib.sh の埋め込み Python が type(raw_classify_all_shell_value) is bool の exact 型判定に変更されており、旧 config.get("classifyAllShell") is True の truthiness 判定を置き換えている。non-boolean 5ケース(JSON string/null/number/list/dict)を parametrize した test_classify_all_shell_readback_non_boolean_is_schema_drift_not_false が新設され、classify_all_shell_readback_non_boolean reason での exit 8 fail-closed を検証している。
  4. version floor metadata 改称(P2-2): claude_version.ok → claude_version.classify_all_shell_setting_version_floor_met に改称され、コメントも「setting support floor」と「direct readback availability」が別物であることを明記。test_min_supported_version_gate_is_non_blocking で non-blocking 挙動を回帰確認。
  5. Allowed Paths 遵守(P2-3 は対象外のまま): allowed_paths_review_gate.py(live linked issue body 基準)で status: ok を確認。gh pr diff --name-only の変更ファイルは Issue 実装: Claude-GPT launcher の classifyAllShell を native default と同様に省略する #2709 の Allowed Paths 5件と完全一致し、scripts/claude-gpt/launch.sh / docs/dev/agent-skill-boundaries.md は git diff main...HEAD --stat で変更ゼロを確認した。launch.sh は AUTO_MODE_CHECK_JSON を個別フィールド分解せず不透明に転記するのみであり(grep で該当行確認済み)、PR body の Schema Consumer Inventory の主張と整合する。
  6. PR body の整合性: Verification Commands / Runtime Verification Evidence / Schema Change Applicability / Checks は V2 schema 名・exit 77 契約に統一されており stale な記述は見当たらない。uv run --locked pytest scripts/claude-gpt/tests/test_auto_mode_policy.py scripts/claude-gpt/tests/test_classify_all_shell_native_projection.py -q を独立再実行し「79 passed, 1 skipped」を確認(PR body の自己申告と一致)。
  7. 過剰実装の有無: diff は5ファイルに限定され、新規 broker/hook/approval ledger/汎用 migration framework は見当たらない。
  8. CI: 現在 head に対し required checks 全て SUCCESS(gh pr checks で 20/20 PASS)。
  9. Mergeability: mergeable: MERGEABLE, merge_state_status: CLEAN。

Warnings(blocker ではない)

  • Safety Claim Matrix は正式な Claim/Implemented/Not controlled/Evidence/Follow-up 表形式ではなく「N/A + 理由 + 補足プローズ」の形式で提出されている。変更ファイルパス自体は safety-sensitive パターンに一致せず、diff は既存 enforcement 機構(permissions.deny / hard_deny / hooks 等)を一切変更していない(既存 test_auto_mode_policy.py 66 tests 継続 PASS で裏付け)。blocker には格上げしないが、次回以降は正式な表形式での提出が望ましい。
  • PR body 末尾の IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha(d8e48dca...)が現在の head(7c673491...)と不一致(publication-time immutable marker の契約どおり、head 更新のみを理由に書き換えていないため。advisory telemetry であり merge-blocking ではない)。
verdict: APPROVE
reviewed_head_sha: "7c67349173c79748362ad11e91da57bf88841adb"
blockers: []
warnings:
  - "Safety Claim Matrix is prose/N-A format rather than the formal Claim/Implemented/Not controlled/Evidence/Follow-up table, though content substantively covers the same ground and no enforcement mechanism is modified"
  - "IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha in PR body is stale (d8e48dca...) vs current head (7c673491...); advisory only, publication-time immutable marker per canonical contract"

@squne121
squne121 marked this pull request as ready for review September 22, 2026 01:11
@squne121
squne121 merged commit 60bb337 into main Sep 22, 2026
46 checks passed
@squne121
squne121 deleted the worktree-issue-2709-claude-gpt-launcher-classifyallshell-nat branch September 22, 2026 01:25
squne121 added a commit that referenced this pull request Sep 24, 2026
… prose を修正する (#2743)

* docs: launch.sh と agent-skill-boundaries.md の classifyAllShell 関連 stale prose を修正する (#2721)

PR #2717(Issue #2709)で classifyAllShell 無条件注入を除去した後に残った
stale prose を実装挙動に整合させる。

- scripts/claude-gpt/launch.sh: readback コメントを、classifyAllShell キー
  省略・tri-state evidence(generated_key_present / direct_readback_available
  / effective_value)・version floor や direct_readback_available=false
  単独では block しないことを説明する内容に書き換え、詳細 fail-closed
  reason の再列挙を preflight.sh / lib.sh の V2 contract への参照に置換。
- docs/dev/agent-skill-boundaries.md: Issue #2203 節の generated autoMode
  説明を environment / allow / hard_deny(classifyAllShell は intentionally
  omitted)に更新し、Issue #2223 の記述を OPEN な production-broker
  follow-up 前提から CLOSED / minimal-harness Owner Decision 整合に更新。

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: #2223 Owner Decision の security authority と live readback evidence の区別を prose 修正で明確化する

PR #2743 review comment(OWNER REQUEST_CHANGES)で指摘された誤分類を修正する。
docs/dev/agent-skill-boundaries.md の Issue #2203 節が「authoritative live
readback を security authority」と混同していた記述を、security authority
(server-side protection / repository permission / required CI)と mutation
correctness の evidence(native/client operation + authoritative live
readback)を分離する記述へ改める。同節の三層 authorization boundary の導入文も
repository の server-side security authority ではなく launcher-local な
defense-in-depth / canary-local narrow transaction guard として再フレーミング
する。scripts/claude-gpt/launch.sh のコメントも同様に autoMode を second gate
として説明し直す。launcher behavior / generated settings の実挙動は変更しない。

Co-Authored-By: Claude Sonnet 5 <[email protected]>

---------

Co-authored-by: Test <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
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.

実装: Claude-GPT launcher の classifyAllShell を native default と同様に省略する

1 participant