Repository navigation
feat: share capability preflight deadline - #2394
Conversation
Pass one monotonic deadline from the root consumer through every producer probe so timeout results remain structured and actionable. Co-Authored-By: Claude Code <[email protected]>
Preview URLPreview removed (PR #2394 closed). |
Co-Authored-By: Claude Code <[email protected]>
判定
レビュー対象は、最新の 現時点で review submission はなく、PR上のコメントも preview bot の投稿だけです。 P0-1: optional Spark probe が全deadlineを消費し、必須GitHub probeを未実行のまま
|
Classify malformed successful Spark probe output without raising from assess(). Co-Authored-By: Claude Code <[email protected]>
…test fidelity (#2401) (#2410) * fix: capability-preflight probe ordering, Spark validation, deadline test fidelity (#2401) Bounded follow-up for the merged PR #2394 review findings: - Reorder capability-preflight probes so required GitHub probes (github_auth -> github_repo_read -> controlled_github_read) run before the optional spark_env_only probe, sharing one absolute deadline. - Add a Spark JSON payload validator that normalizes malformed/invalid shapes (non-dict top level, non-bool binary_available, missing/non-dict chatgpt_auth, non-bool chatgpt_auth.available) into the existing structured malformed-output reason instead of risking an uncaught AttributeError. - Add scripts/claude-gpt/tests/test_capability_preflight_review_fixes.py covering probe ordering (AC1), spark-starvation degrade semantics (AC2), malformed Spark payload handling (AC3), the single shared absolute deadline (AC4), and a hermetic real root-to-producer subprocess boundary test faking only the external gh leaf CLI (AC5). - Remove the filename-based timeout-ownership blacklist test (AC6). - Mark the real-subprocess test_workflow_capability_returns_structured_result with @pytest.mark.github_live (optional live coverage, not part of this Issue's hermetic close evidence). - Update the pre-existing shared-deadline probe-order assertion in test_workflow_capability_preflight_deadline.py to the new gh/gh/gh/sh order (required by implementing AC1). Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix: AC5 root-to-producer deadline transport観測とAC2/AC3境界テストをOWNERレビュー指摘へ整合させる (#2401) PR #2410 への OWNER REQUEST_CHANGES (P1-1/P2-1/P2-2) fix_delta。 - AC5 (test_root_to_producer_transports_deadline_with_fake_external_clis): 実 subprocess.run をラップして root が構築した producer argv を記録し `--deadline-monotonic-ns` の一意存在と整数値を検証。fake `gh` wrapper 自体が sys.argv[1:] を JSON line で記録するようにし、fixture の calls[] (非厳密トレース) に頼らず 3 回の gh 呼び出しの exact argv/order を照合。spark_mode=None 固定条件で decision=="ready" を厳密化。 --deadline-monotonic-ns 0 で実 producer を直接起動し GitHub subprocess が一切 spawn しないことを確認する境界テストを追加。 - AC2 (test_required_probes_run_before_optional_spark_and_starvation_degrades): spawn 前 deadline 消費シナリオ(既存 test_expired_deadline_spawns_no_new_process でカバー済み)ではなく、spark probe が正の残り timeout で spawn し TimeoutExpired を受ける実シナリオへ変更。 - AC3: 実 _run_env_only_preflight() を直接呼び出し (assess() 経由の monkeypatch 迂回なし) chatgpt_auth: null の malformed 判定境界を検証 する追加ケースを1件追加。既存6ケースは維持。 - test_producer_cli_without_deadline_creates_local_deadline を test_producer_cli_without_deadline_passes_none_to_assess へリネーム (挙動変更なし、AC4新規テストとの役割分担を明記)。 Allowed Paths内2ファイルのみ変更。focused suite 25 pass、full scripts/claude-gpt/tests/ suite 344 pass, 1 skip。 Co-Authored-By: Claude Sonnet 5 <[email protected]> --------- Co-authored-by: Test <[email protected]> Co-authored-by: Claude Sonnet 5 <[email protected]>
Summary
受け入れ条件の達成状況
--deadline-monotonic-nsで producer へ渡すことを、focused pytest のtest_root_transports_one_deadline_and_keeps_watchdog_graceで確認しました。test_producer_cli_without_deadline_creates_local_deadlineで確認しました。test_all_four_probes_share_decreasing_remaining_timeoutとtest_expired_deadline_spawns_no_new_processで確認しました。spark_mode=Noneの env-only skip、preferred fallback、および required block をtest_spark_none_skips_env_probe_and_timeout_semantics_are_preservedで確認しました。test_watchdog_and_nonzero_stderr_taxonomy_are_distinct_and_redactedで確認しました。Runtime Verification Evidence(動作検証証跡)
immediate(hermetic local pytest、認証・ネットワーク不要)uv run --locked pytest scripts/claude-gpt/tests/test_workflow_capability_preflight.py scripts/claude-gpt/tests/test_workflow_capability_preflight_deadline.py scripts/claude-gpt/tests/test_timeout_taxonomy_compat.py .claude/skills/issue-refinement-loop/scripts/tests/test_root_entry_router_workflow_capability.py -q --junitxml=artifacts/issue-2322-focused-runtime-verification.xml41 passed in 17.76sartifacts/issue-2322-focused-runtime-verification.xml(worktree 内で生成)Checks
uv run --locked pytest scripts/claude-gpt/tests/test_workflow_capability_preflight.py scripts/claude-gpt/tests/test_workflow_capability_preflight_deadline.py scripts/claude-gpt/tests/test_timeout_taxonomy_compat.py .claude/skills/issue-refinement-loop/scripts/tests/test_root_entry_router_workflow_capability.py -q(41 passed)。対象の hermetic runtime verification は成功しました。uv run --locked pytest scripts/claude-gpt/tests -q(331 passed, 1 skipped, 1 deselected)。関連する Python 回帰 suite は成功しました。uv run --locked ruff check .claude/scripts scripts schemas .claude/skills(Ruff F401/E501 を含む lint は成功)。Schema Change Applicability
not_schema_changedecision、checks、actor_capabilities、reasonsのキー集合は不変です。追加した optional CLI deadline は既存の直接起動を維持します。Schema Consumer Inventory
N/A: 公開 schema のフィールド、型、consumer contract は変更していません。root consumer と producer の optional CLI transport を同一 PR 内で更新し、互換経路をテストしました。
Compatibility Decision(互換性判定)
N/AN/AN/AN/ASafety Claim Matrix
Notes
artifacts/issue-2322-focused-runtime-verification.xml(worktree 内、41 tests passed)。