Repository navigation
feat(doctor): add Tier 1 scanner and Tier 2 provider readiness checks - #293
Conversation
doctor and health-check only checked Tier 3 live-evaluation readiness. A missing or outdated Tier 1 scanner (SkillSpector, Bandit, Semgrep, Gitleaks, pip-audit) or an unconfigured or rejected Tier 2 provider only showed up partway through validate, as an INCOMPLETE scan or a skipped tier. Nothing showed which SkillSpector version was on PATH. Both commands now take --tier 1|2|3|all. The default stays 3, so existing scripts and CI see the same behavior. - Tier 1 reports each external scanner that the --checks selection runs. Each row shows the resolved path, any executable override, and the version from a bounded, shell-free probe. SkillSpector is probed without provider credentials and Semgrep without its update check. A scanner fails when it is missing, its override is malformed, the probe fails or exceeds --timeout, or it is older than Bandit 1.9.4 or Gitleaks 8. - Tier 2 resolves the embedding and LLM providers offline. doctor --tier 2 --verify-models also sends one embedding request and one chat request. They go through the existing clients with no retries and a timeout-bounded HTTP client. Only the HTTP status and a remedy are reported, never the provider's response body. - --tier all runs every tier in order, and a failed tier does not stop the next. An option for an unselected tier is a usage error before any probe. tier3 doctor is now a separate, Tier 3-only command with unchanged options. EmbeddingClient gains optional max_retries and http_client arguments, matching LLMClient. ExternalTool exposes its override configuration error. Refs #42 Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
The OpenAI and Anthropic SDKs ignore an httpx.Client timeout that equals httpx's 5-second default and fall back to their own 600 seconds. With --timeout 5, each Tier 2 live probe could therefore wait up to 10 minutes on a hung provider. A Bedrock chat probe goes through litellm, which never saw the timeout at all. - EmbeddingClient and LLMClient take an optional timeout. LLMClient passes it to the OpenAI and Anthropic SDK clients and to litellm for Bedrock. The default stays the provider's own. - doctor passes --timeout to both probes explicitly, so every httpx timeout field carries the requested value, including 5 seconds. - --timeout is capped at 3600 seconds. A huge value no longer overflows the subprocess timer with a traceback. - --timeout with --tier 2 is a usage error unless --verify-models sends live requests. health-check never sends one, so its help and docs describe --timeout as Tier 1 only. Tests cover the 5-second case for the OpenAI SDK path, the Anthropic chat probe, the Bedrock litellm timeout, the timeout cap, and the offline Tier 2 rejections for both commands. Refs #42 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
Review summary: no findings (no P1/P2/P3).
Checked: the scanner-to-check mapping against the validators (SkillSpector for security; Bandit, Semgrep and Gitleaks for code-integrity; pip-audit for dependency), which treat a missing scanner as incomplete, so a failing doctor row matches validate behavior; the Bandit 1.9.4 and Gitleaks 8 floors (pyproject extra, and the detect command used by the secrets scan); no floor for SkillSpector is correct because the validator keeps a legacy path for older reports; option validation (unselected-tier options, --timeout bounds and NaN, unknown --checks) and exit codes, which I exercised by hand; Tier 3 default behavior, tier3 doctor, the timeout passed to the OpenAI/Anthropic/litellm clients, status-only live diagnostics, docs and CHANGELOG.
Local verification (head b531e38): ruff check clean; pytest tests/test_doctor.py tests/test_cli.py tests/test_base_install.py tests/embedding/test_client.py tests/inference/test_llm_client.py tests/golden: 501 passed. Manual doctor --tier 1/2 runs behaved as documented.
Reviewed with Claude Code.
b531e38 to
16244f2
Compare
Conflicts: CHANGELOG.md, docs/tier1-validation.mdx Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Clean merge of the newer main (#281, #271, #293); CHANGELOG.md and docs/agents-and-sandboxes.mdx auto-merged with no conflicts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
* docs(changelog): move entries released in 0.7.0-0.7.2 out of Unreleased 0.7.0 (#314) and 0.7.1 (#327) never cut their sections on main, and 0.7.2 (#335) added its section below the whole Unreleased block, so Unreleased still listed work that had already shipped. Place each Unreleased entry under the release that shipped the PR that added it: - 0.7.0: the published section from the 0.7.0 tag, verbatim. It already holds the six entries that main had filed under 0.6.0, so 0.6.0 again matches the v0.6.0 tag, including the original run_config.json entry. - 0.7.1: #264 #271 #274 #281 #284 #289 #293 #299 #316 #317 #318 #323 #324 #326 #327, plus the #320 wording of the Windows Git-root entry, since #320 changed that 0.7.0 fix in 0.7.1. - 0.7.2: #263 #265 #269 #270 #276 #279 #287 #290 #296 #309 #328 #330 merged with the existing #335 entries. Only post-v0.7.2 entries stay under Unreleased, with one heading per subsection. Entry text is unchanged, apart from the published tag wording in 0.7.0 and 0.6.0. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(release): prepare v0.8.0 Set the package, fallback, lock, citation and developer-guide versions to 0.8.0 and move every entry merged since v0.7.2 under '## 0.8.0 - 2026-11-05', leaving Unreleased empty. The refusal-fallback documentation test now reads the release section that names CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK, requires it to be 0.8.0, and requires exactly one entry there to name the switch. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(release): pin the verified 0.8.0 Tier 1 image and add its CI bundle Pin onboarding to the Tier 1 image published by the reviewed main revision 55d2d04 in "Build and publish Tier 1 image" run 42158955180: ghcr.io/nvidia/skillevaluator-tier1@sha256:9d5483243918937be4f2178f74cf7c622a531dee41e3176906994d52fa14950a (config sha256:d17d6f5105ec5f1bf0cbe4dff0d693aae4ecf01e9c1c6a6ddb7830518acace33). The workflow and publisher refs both move to 55d2d04. ci/bundles/0.8.0 mirrors the 0.7.2 bundle. The templates, README and release.json are the run's github-actions-onboarding artifact and match ci/render_templates.py output for these pins byte for byte. The scanner inventory and verification receipt come from the build's runtime-stage version step, the five-case smoke receipt, the onboarding job's anonymous pull, and the public manifest, whose config digest equals the smoke-tested image ID. The ZIP uses the 0.7.2 layout (sorted members, inner checksums, 1980 timestamps, 0644, deflate level 9) and rebuilds to identical bytes. Point the current-bundle links at 0.8.0 and list 0.7.2 as historical. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]> --------- Signed-off-by: Narendran Raghavan <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
doctorandhealth-checktake--tier 1|2|3|all. Without--tierthey still check Tier 3 only, exactly as before.--tier 1reports each external scanner that the--checksselection runs (default:validate's default checks):security; Bandit, Semgrep and Gitleaks forcode-integrity; pip-audit fordependency.SKILLEVALUATOR_*_PATHoverride, and the parsed version.ExternalTool.run. It is bounded by--timeout, starts no shell, and runs the scanner as its validator does: SkillSpector gets the same credential-free environment as the static scan, and Semgrep gets no network update check.securityextra floor) or Gitleaks 8.--tier 2resolves the embedding provider and the LLM provider used for duplicate analysis, offline.doctor --tier 2 --verify-modelsalso sends one embedding request and one chat request. They go through the existingEmbeddingClientandLLMClient, with no retries, and--timeoutbounds each request.httpx.Clienttimeout that equals httpx's 5-second default and fall back to their own 600 seconds, so--timeout 5would otherwise not bound the read.EmbeddingClientmessages andllm_failure_diagnostic. Only the HTTP status and a remedy are shown, never a provider response body.--tier allruns Tiers 1, 2 and 3 in order. A failed tier does not stop the next, and the exit code is 1 if any tier failed.--checkswithout Tier 1,--env-modewith--tier 1,--verify-modelswith--tier 1.--timeoutwith--tier 2is rejected unless--verify-modelssends live requests, because offline Tier 2 has nothing to bound.health-checknever sends one, so its--timeoutcovers only Tier 1 scanner probes.--checksnames and a--timeoutthat is not finite, not positive or above 3600 seconds are rejected the same way. The upper bound keeps a huge value from overflowing the subprocess timer.tier3 doctoris now its own Tier 3-only command. Its options are unchanged, and it has no--tier,--checksor--timeout.src/skillevaluator/doctor.py. It does not import Harbor or provider SDKs unless a live probe was requested, so Tier 1 readiness works on a base install.EmbeddingClientgains optionalmax_retries,http_clientandtimeoutarguments, andLLMClientgains an optionaltimeoutthat it forwards to the OpenAI and Anthropic SDKs and to litellm for Bedrock. Defaults are unchanged.ExternalTool.configuration_errorexposes why an override was rejected.doctor/health-checksections and the command table), Agents & Sandboxes readiness section, Configuration, Installation (system tools), Tier 1 validation, and a CHANGELOG entry under Unreleased / Added.Why
Before this change, the only preflight was Tier 3 readiness, and it needs a provider and a backend. Problems with the other tiers showed up only partway through
validate:INCOMPLETE.PATH.Users and CI can now check each tier up front.
health-check --tier 1also works as a non-interactive scanner preflight.This covers the readiness-reporting part of #42: one command reports the Tier 1 scanner state, including path, version, malformed override and incompatible version, and CI can require it.
@rookepoole offered to implement #42 and proposed a full contract there: a separate
scanner-preflightcommand with--json, a consent-gated--bootstrap, and the same Bandit 1.9.4 and Gitleaks 8 floors this PR adopts. They also argued that scanner readiness should not extenddoctor. This PR does not settle that. It covers only readiness reporting and leaves their open questions to maintainers: the command name and surface (doctor --tier 1orscanner-preflight), the--jsoncontract, and the bootstrap scope. It also leaves the SkillSpector bundling decision open, so it does not close the issue. The Tier 1 rows here can back either command surface.Refs #42
Kept from public
doctorandhealth-checkstill check only Tier 3, with the same options and the sametier3.commands.doctorcall. The CI wheel smoke test (placeholder key, no scanners) and the native-Windows local-mode step keep passing unchanged. The documented "offline readiness probes by default" behavior also still holds. An all-tier default would have failed both CI steps.--verify-modelsflag, andhealth-checknever sends one. An alternative design probed models on every run.resolve_embedding_providerandresolve_llm_providerwith their existing setup guidance. It does not use a separate OpenAI-only provider config, so OpenAI, Anthropic, Bedrock, NVIDIA Build and OpenAI-compatible endpoints work through the same clientsvalidateuses.llm_failure_diagnosticandEmbeddingClient's status-only messages. Configured labels pass throughsafe_llm_labels. Rows are printed withescape_markupon anemoji=Falseconsole, the same as the Tier 3 table, with pass/warn/fail styling.ToolsandExternalToolas they are: interpreter-sibling preference, fail-closed overrides, existing install hints, and the bounded, shell-free runner. They do not use a separate subprocess path.Tests
tests/test_doctor.py(new):Toolsentries with an in-processsubprocess.run:--checksselection probes exactly its scanners, withversionfor Gitleaks.httpx.MockTransport:--verify-modelssends exactly one embedding request and one chat request, with every httpx timeout field set to--timeout. This includes 5 seconds, which the SDKs would otherwise replace with 600.--timeoutto litellm.tests/test_cli.py:--tier, both commands keep the old Tier 3 call.--verify-modelsreaches Tier 2.--tier allkeeps going after a failed tier.tier3 doctor --tier/--checks/--timeout,health-check --verify-models,--timeout 1e300and3601, and--timeoutwith an offline--tier 2for both commands.--timeoutreaches Tier 2 with--verify-models, still applies to Tier 1 under--tier all, andhealth-check --helpdescribes it as Tier 1 only.tier3 doctorstays Tier 3.doctor/health-checkexample indocs/cli-reference.mdxparses.tests/test_base_install.py: with every extras-only module blocked,doctor --tier 1passes anddoctor --tier 2 --verify-modelsreports the missing Tier 2 extra without importing it.tests/embedding/test_client.py:max_retries,http_clientandtimeoutreach the SDK.tests/inference/test_llm_client.py: an explicittimeoutreaches the OpenAI and Anthropic SDK constructors, and Bedrock forwards it to litellm only when it is set.tests/golden/cli_surface.json: regenerated. Onlydoctorandhealth-checkgain--tier,--checksand--timeout;tier3 doctoris unchanged.main: 18286 passed, 29 skipped. Fifteen failures are local only and also fail without this change. Twotest_harbor_secure_docker_environment.py::*sidecar_retains_*failures come from host environment variables. Thirteentier3/test_judge_failure_artifacts.py::test_generated_custom_only_script_*failures come from the host's Python 3.9python3running the generated verifier script.ruff checkandruff format --checkpass on the changed lines. Pre-existing format differences intool_runner.pyandtests/inference/test_llm_client.pyare outside this diff.doctor --tier 1,health-check --tier 2,doctor --tier allanddoctor --tier 2 --verify-modelsagainst NVIDIA Build with a placeholder key. Both live probes reported HTTP 403 with a remedy and no response body.httpx.MockTransport,doctor --tier 2 --verify-modelswith timeouts of 4 and 5 seconds sent both requests with every httpx timeout field set to that value.doctor --tier 1 --checks code --timeout 1e300,doctor --tier 2 --timeout 5andhealth-check --tier 2 --timeout 5exit 2 with a usage error.🤖 Generated with Claude Code