sec (4/9): scope benchmark requirement preflight to runnable scanners#28
Conversation
3534adf to
17a2615
Compare
A benchmark validates required env for every requested scanner before running. A url-only user-defined scanner would abort a skill benchmark it would never run against, because its required credentials look missing. Filter requirement validation to scanners that support the per-case target kind.
6f1cade to
33a4013
Compare
|
Codex review: needs maintainer review before merge. Reviewed July 25, 2026, 10:38 PM ET / July 26, 2026, 02:38 UTC. ClawSweeper reviewWhat this changesThe branch limits benchmark environment-variable preflight to scanners that support skill targets, so a configured scanner that would be skipped does not block the benchmark for missing unused credentials. Merge readinessKeep this PR open for normal maintainer review. It is a fresh, clean, narrowly scoped correction to the merged user-defined-scanner work, and the author is a repository member, so conservative cleanup must not auto-close it. Priority: P2 Review scores
Verification
How this fits togetherClawScan benchmarks load skill targets, select configured scanner adapters, validate their declared environment requirements, then execute the runnable scanners and write raw evidence into a benchmark artifact. This change aligns the early credential check with the target-kind filtering already used to decide which scanners can run. flowchart LR
A[Benchmark configuration] --> B[Requested scanners]
C[Skill benchmark targets] --> D[Runnable scanner selection]
B --> D
D --> E[Credential preflight]
E --> F[Scanner execution]
F --> G[Benchmark artifact]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the focused filtering change after the target-kind regression test and standard Go validation confirm that credential preflight still rejects every scanner that will actually execute. Do we have a high-confidence way to reproduce the issue? Yes, from source: configure a skill benchmark with both a skill-capable scanner and a URL-only scanner whose required environment variable is absent; current preflight validates the URL-only scanner even though target-kind selection would skip it. Is this the best way to solve the issue? Yes. Filtering the scanner IDs passed into requirement validation by the same registry target-kind capability used for execution is the narrowest maintainable repair and preserves fail-fast validation for scanners that can run. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5cfa90b129f4. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
What changes
Benchmark requirement preflight now only considers scanners that can
actually run on the benchmark's target kind. A scanner that does not support the
target kind (e.g. a plugin-only scanner during a skill benchmark) no longer has
its required env vars demanded before the run starts.
Why it matters
Preflight fails fast when a required credential is missing — good. But it was
checking every configured scanner, including ones that would be skipped anyway
because they don't support the target kind. That meant a benchmark could abort
demanding, say, a token for a scanner that was never going to execute. Scoping
preflight to the runnable set makes the "fail before partial work" check match
the work that will actually happen.
Before / after
New helper
runnableBenchmarkScanners(opts, kind)filters the scanner set viathe registry's
SupportsTargetKindbefore requirement resolution;RunBenchmarkfeeds that filtered set into preflight.
Verify
TestRunnableBenchmarkScannersFiltersUnsupportedTargetKindasserts a scannerthat does not support the target kind is dropped from the preflight set.