Skip to content

Honor SkillSpector analysis completeness - #112

Merged
chrisknvidia merged 8 commits into
NVIDIA:mainfrom
Tomauskasz:fix/skillspector-report-contract
Sep 8, 2026
Merged

chrisknvidia merged 8 commits into
NVIDIA:mainfrom
Tomauskasz:fix/skillspector-report-contract

Conversation

@Tomauskasz

@Tomauskasz Tomauskasz commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

SkillEvaluator now validates the SkillSpector report contract across the supported schema generations. It explicitly supports statusless 2.9.5 and 2.9.6 reports, status-bearing 2.10+ reports, and requires bundled_execution_surface beginning with 2.11.0. For 2.11.1 and newer reports, finding_id is the logical finding identity throughout validation, deduplication, and score reconstruction. Older report generations retain fingerprint-first behavior.

The evaluator now validates completeness counts and coverage, the required analyzer roster and work partitions, source-scoped component inventories and paths, filtering counts, and the risk recommendation. It preserves valid HIGH findings from coherent partial scans while keeping the overall result incomplete. Score reconstruction is conservative across compaction and hidden occurrences. The SC8 shipped-bytecode floor is explicit, and the staged scanner retains shipped bytecode for that check.

For 2.11.1+, validation rejects conflicting reuse of a finding ID across scoring, classification, and source fields. Evidence JSON comparisons preserve true-versus-1 type distinctions. The fixture set includes real 2.9.5 SAFE, 2.11.1 SAFE, and 2.11.1 classification-distinct PE3 cases; the existing 2.9.6 fixture remains covered.

CHANGELOG.md records the release impact.

Verification

On the exact final tree (e6799e85fff8e42c3785c2fe5f115a4ffd6c0195):

  • The focused suite passed: 367 tests.
  • The full suite passed: 5,997 tests; 17 skipped and 4 deselected under the repository's default test configuration.
  • Ruff passed for src and tests.
  • Source and wheel builds passed.
  • Live evaluator CLI --no-llm SAFE probes passed for tagged 2.9.5, 2.9.6, 2.10.0, and 2.11.1 reports.

Three independent native review lanes reported no new supported findings on this tree. The first review identified a JSON evidence equality gap; its regression failed before correction and passes afterward. Local execution receipts and the reconciled finding registry validate. Host execution provenance remains partial.

AI assistance

Codex implemented, tested, and reviewed these changes.

@Tomauskasz

Copy link
Copy Markdown
Contributor Author

End-to-end follow-up:

The full source suite for this PR also passed: 5160 passed, 17 skipped, 4 deselected. Lint and build passed.

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new contract checks still accept contradictory incomplete evidence.

@rng1995

rng1995 commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

@Tomauskasz Gentle ping when you have a chance: the remaining completeness-contract review thread is still waiting for an update or response. Thank you for your patience throughout the review and for your contribution.

@wuzhenhua24

Copy link
Copy Markdown

Independent reproduction — this matches the root cause described here exactly, and I bisected the SkillSpector side.

Minimal reproducer. A skill with no findings at all is enough; the only trigger is a / in a heading, which the reference resolver records as an unresolved local reference:

---
name: repro
description: Minimal reproducer for the SkillSpector completeness contract mismatch. Use when reproducing the reported validation failure.
---

# Repro

## Overview

Prose only. No executable content.

### Input/Output Separation

Keep inputs and outputs distinct.

Behaviour across SkillSpector versions (same skill, same SkillEvaluator commit, --no-llm):

SkillSpector score severity recommendation is_complete skillevaluator security-scan
2.9.6 0 LOW SAFE false PASS
2.10.0 0 LOW CAUTION false (status: partial) INCOMPLETE
2.11.0 0 LOW CAUTION false (status: partial) INCOMPLETE

Failure message on 2.10.0+:

skillspector JSON field 'risk_assessment.recommendation' does not match the risk severity;
security scan did not complete

Three things worth noting:

  1. The skill has zero findings and score: 0, yet the entire security scan result is discarded. The rejection is not scoped to one questionable claim in the report.
  2. 2.9.6 already reports is_complete: false for this skill — it just doesn't escalate the recommendation. So the behavioural change in 2.10.0 is the fail-closed escalation, not completeness detection. That supports reading analysis_completeness before the recommendation/severity invariant, as this PR does.
  3. The trigger surface is wide. ledger_exceptions is a single reference_unresolved from the reference_resolution phase, raised by a slash inside a Markdown heading. Prose-heavy skills hit this readily — the first real skill where I saw it had two such exceptions, one from a heading and one from a table cell.

Environment: SkillEvaluator 3bfba44 (main, reports 0.2.1), SkillSpector installed via uv tool install, macOS / Python 3.13.

Until this lands, we are pinning SkillSpector to v2.9.6 downstream, with a regression test that fails on 2.10.0+ so we can tell when the pin is safe to drop.

@Tomauskasz

Copy link
Copy Markdown
Contributor Author

Follow-up from the complete three-lane review is in bdd69c1.

The ten contradictory/missing completeness-detail cases now share one parameter matrix and one scanner/assertion body. Runtime behavior and case coverage are unchanged; the test removes 23 net lines of duplicated mechanics.

Verification:

  • focused completeness and legacy contract set: 12 passed;
  • full serial suite: 5,482 passed, 17 skipped, 4 deselected;
  • repository Ruff check passed;
  • source and wheel builds passed;
  • git diff --check passed.

@Tomauskasz

Copy link
Copy Markdown
Contributor Author

Final test-only polish is in 1f25501.

The partial-report regression now overrides only fields that differ from the shared fixture. Current and legacy clean-report coverage now shares one parameterized test path. Production behavior and contract coverage are unchanged; the test file is 20 lines smaller.

Final verification: 5,482 passed, 17 skipped, 4 deselected; Ruff passed; source and wheel builds passed; git diff --check passed. The independent follow-up review found no issue.

Fresh CI, DCO, and Security runs for this head are action_required and are waiting for maintainer approval of the fork workflows.

@Tomauskasz
Tomauskasz force-pushed the fix/skillspector-report-contract branch from 1f25501 to 18b8fc9 Compare September 3, 2026 06:04
@Tomauskasz

Copy link
Copy Markdown
Contributor Author

The DCO-only failure is corrected in the rebased head 18b8fc9669670c9dc7a90f4095b5a0db35da2533.

The branch was rebased onto current main (b882b16a0ff604c1cc1590b9b72d0719906c65fd) with sign-off. All four non-merge PR commits now have parsed Signed-off-by trailers; the formerly unsigned bdd69c18 was rewritten as 54e51c8dcd8ae1cc291f4b643017ca42a16fb110.

The only rebase conflict was additive in CHANGELOG.md; the resolution preserves every current-main entry and the existing SkillSpector completeness entry. Production code and tests merged automatically.

Post-rebase verification: 5,488 passed, 17 skipped, 4 deselected; Ruff passed; source and wheel builds passed; git diff --check passed.

Fresh DCO, CI, and Security runs were created but are currently action_required. NVIDIA maintainer approval of the fork workflows is needed before they can execute.

TomauskaszCopla and others added 5 commits September 4, 2026 09:56
Context:
SkillSpector complete-summary flags could contradict authoritative coverage, inspection-count, exception, or limitation details while SkillEvaluator still accepted the scan.

Changes:
- Require present completeness objects to report numeric 100% coverage, zero integer partial and uninspected counts, and empty exception and limitation lists.
- Reject missing authoritative detail fields when the completeness object exists.
- Add regressions for contradictory and missing details plus the legacy report path without completeness metadata.

Impact:
Contradictory or malformed claimed-complete reports fail closed. Older reports that omit the completeness object retain their existing validation path.

Validation:
- Contradictory-detail regression: 5 passed.
- Missing-detail regression: 5 passed.
- Focused current, contradictory, missing, and legacy cases: 12 passed.
- Validator test suite: 847 passed.
- Ruff and `git diff --check`: passed.

Notes:
The full repository suite was not run locally.

Signed-off-by: Tomas <[email protected]>
Context:
Contradictory and missing SkillSpector completeness details used separate parameterized tests with identical scanner setup, execution, and assertions. Use one ten-case matrix for the shared fail-closed contract.

Changes:
- Pair each invalid detail mutation with an optional missing-field selector.
- Preserve all five contradictory-value cases and all five missing-field cases.
- Keep one public validation call and one assertion body for every case.

Impact:
The validator behavior and coverage remain unchanged while the test removes 23 net lines of duplicated mechanics.

Validation:
- Focused completeness and legacy contract set: 12 passed.
- `uv run pytest -q`: 5482 passed, 17 skipped, 4 deselected.
- `uv run ruff check src tests`: passed.
- `uv build`: source archive and wheel built successfully.
- `git diff --check`: passed.

Notes:
The repository-wide formatter check remains red on pre-existing files and is not part of the configured Makefile lint target.

Signed-off-by: Tomas <[email protected]>
Context:
The current and legacy SkillSpector report-contract tests repeated complete fixture values and duplicated the validator execution and assertions.

Changes:
- Update only the completeness fields that differ in the partial-report case.
- Parameterize the shared clean-report acceptance path for current and legacy metadata.

Impact:
Preserve the current, legacy, and incomplete report assertions while removing 20 lines of repeated fixture and mock setup.

Validation:
- Full suite: 5482 passed, 17 skipped, 4 deselected.
- Lint: All checks passed.
- Build: source distribution and wheel built successfully.
- Focused report-contract cases: passed.
- git diff --check: passed.

Notes:
None.

Signed-off-by: Tomas <[email protected]>
Context:
SkillSpector reports now require coherent version-specific completeness evidence before SecurityValidator converts their findings or returns a successful result.

Changes:
- Select a strict status-less compatibility contract for SkillSpector 2.9.6 and the status-bearing contract for versions 2.10 and newer.
- Validate execution markers, component and coverage equations, required analyzer rosters, universal analyzer work accounting, limitation reconciliation, and risk recommendations.
- Require coherent pre/post-filter finding counts and reconcile them with serialized active and suppressed findings without rejecting report-deduplicated or occurrence-expanded 2.10 output.
- Require non-empty 2.10 finding IDs and derive a conservative risk-score floor across SkillSpector's pre-compaction scoring and post-compaction report representations.
- Require versioned findings to identify a non-empty path and require a complete, unique component inventory with boolean executable evidence, reconciled counts, and exact source-scoped issue coverage.
- Preserve source scopes, match fingerprints, distinct modern finding IDs, and legacy findings whose display text is null.
- Reject occurrence-expanded rows that disagree on the severity, confidence, or finding ID copied from one compacted identity.
- Allocate compacted and hidden raw findings once across the most score-reducing rule slots while preserving independently reconstructable visible contributions and explicit rule floors.
- Preserve executable-component evidence and a conservative reported-score floor when generated findings are filtered.
- Keep SkillSpector's shipped-bytecode finding, blocking score floor, and shipped bytecode bytes authoritative while staging a generated-output-free scan tree.
- Preserve findings from coherent partial reports while retaining an incomplete result and suppressing clean summaries.
- Add a captured 2.9.6 report fixture, regression coverage for complete, partial, failed, and malformed reports, and changelog documentation.

Impact:
Failed, contradictory, duplicate, or materially understated SkillSpector output is rejected before findings are processed. Valid partial, compacted, source-scoped, null-fingerprint, legacy null-text, and shipped-bytecode findings remain available without representing an incomplete scan as complete or overstating evidence lost during compaction.

Validation:
- uv run make test: 5955 passed, 17 skipped, 4 deselected.
- uv run make lint: all checks passed.
- uv run make build: source distribution and wheel built successfully.
- Focused validator suite: 353 passed.
- The null-fingerprint public-seam regression failed before the fix and passed after distinct finding IDs became authoritative.
- The fractional score-floor and staged-SC8 regressions failed before their fixes and passed afterward.
- Eight component-inventory, executable-occurrence, and hidden-multiplicity regressions failed against the prior immutable head and passed after the fixes.
- Self-review added passing regressions for duplicate component identities and producer source-scope priority.
- Six empty-path, zero/under-counted analyzer-work, and compacted-confidence counterexamples failed against the reviewed head and passed after the fixes; 2.9.6 and future-analyzer compatibility cases also pass.
- Two hidden and occurrence-expanded score-floor counterexamples failed against the reviewed head and passed with global unknown-finding allocation; an impossible raw-finding/compact-identity count also fails closed.
- A forged compacted-identity report claiming 15/LOW/SAFE for raw findings that score 69/HIGH/DO_NOT_INSTALL failed before the fix and now fails closed; a conflicting-finding-ID variant is also covered.
- Live SkillSpector 2.10.0 clean and 14-advisory reference-skill probes passed against clean-checkout content.
- SkillSpector 2.10.0 report-deduplication, source-scoped score, null-fingerprint, and SC8 floor probes matched the validator contract.
- The SC8 score-floor regression failed under the no-floor mutation and passed after restoration.
- git diff --check and JSON fixture parsing passed.

Notes:
Compatibility covers the captured SkillSpector 2.9.6 contract and the completeness and report-compaction behavior used by SkillSpector 2.10 and newer.

Signed-off-by: Tomas <[email protected]>
@Tomauskasz
Tomauskasz force-pushed the fix/skillspector-report-contract branch from 18b8fc9 to debc843 Compare September 4, 2026 07:19
@Tomauskasz

Copy link
Copy Markdown
Contributor Author

The three September 3 P1 review findings and the subsequent contract findings are addressed in rebased head debc8436c41c1daf874bc80203e8e11bcf51d9a8 on current main (73b27dad60d3927e202ea6099ce79bb25053fd2b).

  • Contract selection now uses a validated metadata.skillspector_version. The strict 2.9.6 path is covered by captured --no-llm JSON, while 2.10+ requires the full status-bearing schema.
  • Coherent partial reports now retain validated findings, stay incomplete, and do not emit clean or successful summaries.
  • Total, scanned, fully inspected, partially inspected, and uninspected counts must be non-negative integers and satisfy the producer equations; coverage is recomputed from those counts.
  • Pre/post-filter finding counts must be non-negative integers, satisfy the producer ordering, and remain coherent with serialized active and suppressed findings under the 2.9.6 and 2.10 report behaviors.
  • Versioned reports must contain a unique component inventory with non-empty paths and boolean executable evidence. Complete reports reconcile the inventory count and exact source/path issue coverage, with SC8 exempt because shipped bytecode is intentionally absent from public component metadata.
  • Every versioned finding must identify a non-empty producer path. Known universal analyzers must complete exactly one work item per component on complete nonempty scans; partial reports and unknown future analyzers retain their existing compatibility paths.
  • Occurrence-expanded rows under one modern compact identity must agree on the producer-copied severity, confidence, and finding ID; occurrence-specific paths and source details may still differ.

The follow-up also requires the captured 2.9.6 analyzer roster, the stable 2.10+ roster, and all semantic analyzers when LLM availability is confirmed. It validates analyzer work partitions and state agreement, and checks both execution markers, stage-specific LLM metadata, limitations, recommendation semantics, and non-empty 2.10 finding IDs. Self-review caught and fixed the partial LOW/CAUTION path, huge-integer coverage ordering, incomplete analyzer-roster acceptance, duplicate transitive analyzer IDs, released transitive-truncation output, unvalidated finding totals and identities, a real 2.10 pre-compaction score compatibility failure, source-provenance loss in score reconstruction, modern null-fingerprint findings collapsed by display prose, legacy null-text findings collapsed into one row, executable component evidence lost during post-filter scoring, lossy replacement of the producer score, fractional score truncation at the policy threshold, shipped bytecode removed before the artifact-integrity analyzer ran, inconsistent source-scope priority, and duplicate component identities. Exact SkillSpector 2.10.0 probes confirm that report-time deduplication can reduce two post-filter findings to one serialized issue, a non-executable source remains at score 40 even when another source uses the same executable path, three source scopes score 70 rather than collapsing to 40, and distinct null-fingerprint finding IDs remain score-distinct.

Independent review of the prior immutable head reproduced three additional counterexamples. Missing components allowed executable-risk understatement; compacted mixed executable/non-executable occurrences could select the wrong multiplier; and hidden raw duplicates made a serialized-only producer-score bound unsafe. The final contract rejects missing evidence and preserves only independently provable score evidence across compaction.

Final immutable-head review found three more P1s. Empty or absent issue paths bypassed executable-score matching; a complete report could claim zero universal analyzer work; and representative confidence copied during compaction could reject a genuine producer score. All six exact public-seam cases failed against the reviewed head and pass after the fixes. Captured 2.9.6, future-analyzer, and partial-report compatibility cases also pass.

A subsequent immutable-head review found one more P1 in that correction: one hidden raw finding or one occurrence-expanded identity erased independently provable risk from every visible rule. The final implementation deduplicates modern report identities, computes the finite global count of unknown raw findings, and allocates those findings once to the largest possible diminishing-weight reductions. The six-rule counterexamples now retain conservative score floors of 55 with one hidden raw finding and 30 with six expanded duplicates. Reports that claim fewer raw findings than their distinct compact identities also fail closed.

The last immutable-head review found that contradictory representative fields under one compact identity could forge a passing score. A six-rule report claiming 15/LOW/SAFE passed even though its raw findings score 69/HIGH/DO_NOT_INSTALL. The exact regression now fails closed, and a separate conflicting-finding-ID case is covered.

Post-rebase verification: 5,955 passed, 17 skipped, 4 deselected; Ruff passed; source and wheel builds passed; the focused validator suite passed 353 tests; live SkillSpector 2.10.0 clean and 14-advisory reference-skill probes passed against clean-checkout content; report-deduplication, source-scoped score, null-fingerprint, and SC8 floor probes passed; the fractional score-floor, staged-bytecode, and conflicting-compacted-identity regressions went red before their fixes and green afterward; the exact independent-review regressions failed against their prior heads and passed after the fixes; 2.9.6 and future-analyzer compatibility cases pass; the SC8 floor regression killed a no-floor mutation; git diff --check and captured-fixture JSON parsing passed. All five PR commits retain parsed Signed-off-by trailers.

Final exact-head producer-contract and repository-standards reviews found no P0-P2 issues.

@chrisknvidia
chrisknvidia dismissed rng1995’s stale review September 7, 2026 23:59

The original requested changes have been addressed at current head debc843; the related review threads were independently verified and resolved.

@chrisknvidia

Copy link
Copy Markdown
Collaborator

@Tomauskasz Could you please address these three current-head contract gaps before we merge?

  1. Make SkillSpector 2.11.1 identity handling classification-aware. A released 2.11.1 scan can emit two valid PE3 findings with the same match_fingerprint but distinct classification metadata and finding_ids. At commit 12f40725, SkillEvaluator groups them as one compact identity and rejects the complete report with skillspector JSON compacted identity has inconsistent scoring fields (current code). Please use the 2.11.1+ finding_id as the logical identity consistently across validation, deduplication, and minimum-score reconstruction, while preserving conflicting-identity/tamper checks and older-version behavior.

  2. Require bundled_execution_surface for 2.11+. Removing only that analyzer entry from a real, complete 2.11.1 SAFE report is currently accepted as passed/SAFE because the required-analyzer roster does not contain it (current roster). Please add a 2.11-specific required roster and reject reports missing this evidence, without requiring the analyzer for 2.10 reports.

  3. Handle the real 2.9.5 statusless schema. A genuine 2.9.5 --no-llm report is rejected as an unsupported pre-2.10 schema because the compatibility gate accepts only exactly 2.9.6 (current gate). Since 2.9.5 to 2.9.6 did not change this report schema, please support both versions explicitly—or, if 2.9.5 support is intentionally excluded, document and enforce 2.9.6 as the minimum supported scanner version across the integration.

Why this must be addressed before merge: issue 1 rejects valid output from the currently released scanner; issue 2 can turn missing security-analysis evidence into a false SAFE result; and issue 3 breaks an already released scanner without an explicit minimum-version contract. The repository's green checks do not currently exercise these real producer/consumer combinations.

Please add captured or real-version regression coverage for the 2.11.1 classification-distinct PE3 case, a 2.11.1 report missing bundled_execution_surface, and 2.9.5/2.9.6 compatibility. The identity test should also prove that a genuinely reused/conflicting finding_id is still rejected. Then please rerun the full suite and live --no-llm probes for the supported 2.9.x, 2.10.x, and 2.11.1 contracts.

chrisknvidia and others added 2 commits September 7, 2026 18:48
Context:
SkillSpector 2.11.1 preserves classification-distinct findings that share
a match fingerprint. The evaluator must retain their finding identities.
The reviewer also identified missing 2.11 analyzer evidence and rejection
of the released 2.9.5 statusless report schema.

Changes:
- Use finding IDs for 2.11.1+ validation, deduplication, and score floors.
- Reject conflicting ID reuse, including JSON evidence type differences.
- Require bundled_execution_surface evidence starting at 2.11.0.
- Share the statusless compatibility contract between 2.9.5 and 2.9.6.
- Add captured producer reports and public-seam compatibility regressions.
- Update the compatibility changelog entry.

Impact:
Real 2.11.1 classification-distinct PE3 findings remain visible as security
findings. Missing required analyzer evidence and inconsistent identities
fail closed. Older identity behavior remains version-gated.

Validation:
- Full suite: 5,997 passed, 17 skipped, 4 deselected.
- Focused validator suite: 367 passed.
- Ruff src/tests, source and wheel builds, and diff checks passed.
- Live evaluator --no-llm probes passed with 2.9.5, 2.9.6, 2.10.0, 2.11.1.
- Three native final-tree review lanes reported no new supported findings.
- Evidence-type regression failed before its correction and passed after.

Notes:
Preserves NVIDIA's merge commits. Local review receipts and registry
validate; host execution provenance remains partial. No merge requested.

Signed-off-by: Tomas <[email protected]>
@Tomauskasz

Copy link
Copy Markdown
Contributor Author

@chrisknvidia All three requested contract fixes are in 3f95960c972c6e1fcb04e46f051403c845dabc5a, on top of your merge commits.

  • 2.11.1+ identity: finding_id now drives validation, deduplication, finding-count reconciliation, and both score-reconstruction paths. A real tagged 2.11.1 PE3 capture preserves the two classification-distinct findings sharing one fingerprint. Conflicting ID reuse still fails closed, including JSON evidence differences such as true versus 1.
  • 2.11+ analyzer evidence: missing bundled_execution_surface is rejected for 2.11.0/2.11.1, without requiring it for 2.10.
  • 2.9.x compatibility: 2.9.5 and 2.9.6 explicitly share the statusless contract. Their tagged report implementations compare byte-identically; captured reports cover both versions.

Verification on the pushed tree: 5,997 passed, 17 skipped, 4 deselected; 367 focused validator tests passed; Ruff, source/wheel builds, and diff checks passed. Live evaluator CLI --no-llm SAFE probes passed with tagged 2.9.5, 2.9.6, 2.10.0, and 2.11.1. The real 2.11.1 PE3 probe now reports its two HIGH findings as a completed security failure, rather than rejecting the report as malformed.

The new regressions reproduce the prior-head failures. Three independent native review lanes inspected the final immutable diff and reported no new supported findings. An evidence-equality issue raised during the first review was reproduced, corrected, and covered by a red/green regression before the final review. Local review receipts and the reconciled finding registry validate; host execution provenance remains partial.

The new CI, DCO, and Security runs are action_required, pending maintainer approval of the fork workflows. They have not reported test failures.

@chrisknvidia
chrisknvidia merged commit ff349e0 into NVIDIA:main Sep 8, 2026
17 checks passed
mimran-khan added a commit to mimran-khan/SkillEvaluator that referenced this pull request Sep 9, 2026
mimran-khan added a commit to mimran-khan/SkillEvaluator that referenced this pull request Sep 9, 2026
Resolve CHANGELOG.md after merging upstream NVIDIA#99, NVIDIA#107, and NVIDIA#112.
rng1995 pushed a commit to mimran-khan/SkillEvaluator that referenced this pull request Sep 14, 2026
Resolve CHANGELOG.md after merging upstream NVIDIA#99, NVIDIA#107, and NVIDIA#112.
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.

5 participants