Skip to content

fix(analyzer): do not score scanner-budget gaps as HIGH AE1 findings - #983

Merged
rng1995 merged 1 commit into
NVIDIA:mainfrom
Varshith-Kali:fix-982-ae1-budget-scoring
Nov 9, 2026
Merged

rng1995 merged 1 commit into
NVIDIA:mainfrom
Varshith-Kali:fix-982-ae1-budget-scoring

Conversation

@Varshith-Kali

Copy link
Copy Markdown
Contributor

Fixes #982.

Budget-driven incompleteness is the scanner's own configuration, not an artifact property, but every such gap became a HIGH AE1 finding at confidence 1.0. Two budget AE1s alone scored 37.5 points and three hit the 43.75 cap, so one MEDIUM finding pushed a benign package to DO_NOT_INSTALL.

This change suppresses AE1 only when budget reasons (TP4 batch cap output_limit, static per-artifact runtime_limit) are the target's entire ledger gap, mirroring the existing format-limitation guard. Mixed limitations, failed or skipped work, fatal events, and truncated ledger evidence all still produce AE1 at HIGH. The completeness ledger is untouched, so budget gaps still report as partial with their reason codes.

Reproduction (unit-level, synthetic finalize state with 2 output_limit and 1 runtime_limit targets): before, 3 HIGH AE1 findings and score 43; after, 0 AE1, score 0, completeness still partial with all three budget reasons listed.

Tests: 3 new regression tests in tests/nodes/test_finalize_inspection_ledger.py (budget-only suppression with partial completeness retained, mixed budget plus parse-limit keeps HIGH AE1, budget-only with failed inventory keeps HIGH AE1). Full affected suites pass: 518 passed across finalize, report, analysis completeness, inspection ledger, primary input completeness, linked zip coverage, opaque reference reporting, and mcp_tool_poisoning. Ruff check and format check clean on both touched files.

Out of scope by design: TP4 batch packing and deterministic runtime limits from the issue suggestions. Once budget AE1s are unscored, the floor is gone, and both of those change analyzer behavior with their own risk.

@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.

[SkillSpector Review]

Decision: Approved

Value and readiness

Removing scored AE1 findings for scanner-budget-only gaps avoids turning ordinary package size and machine-load variation into a HIGH risk floor. The change is ready: the completeness ledger remains partial with its original budget reasons, while mixed artifact limitations and failed work continue through the AE1 path.

Material findings

None requiring changes. src/skillspector/nodes/finalize_inspection_ledger.py:381-408 requires explicit budget-only exceptional events; :843-852 additionally requires canonical, untruncated ledger evidence, valid analyzer accounting, no target fatality or duplicate inventory, and a partial final disposition. Existing artifact-driven AE1 and size-coverage paths remain in place. The three new tests at tests/nodes/test_finalize_inspection_ledger.py:819-870 cover suppression with partial completeness retained, a mixed parse limitation retaining HIGH AE1, and failed inventory retaining AE1.

PIC tradeoffs

Budget exhaustion still means incomplete inspection and remains visible to callers; the risk score now reflects emitted security findings rather than the scanner's own cap. Batch packing and deterministic runtime behavior remain separate work. No report schema or dependency change is needed.

Verification and gaps

Reviewed pinned head a1dd80585beb653d24b9babe404ab0dfa9de55e6: complete two-file diff, exact-head reference classification, format/budget guards, canonical ledger validation and completeness projection, new and adjacent fail-closed controls, linked #982, and all available review/thread/discussion records (none). A fresh head read was unchanged. All six current checks were inspected: changes, lint, DCO, TypeScript tests, and docker-smoke succeeded; test-unit failed. I compared failed-job logs with main run 41513800480 (e14c450, job 125513032912): all 15 failure IDs are identical (12 PowerShell completeness cases, the PowerShell language-ownership case, and two newline variants of the quoted-printf case). GitHub reports no required checks for the branch. These are CI observations, not a clean-suite claim. No contributor code, tests, builds, setup, hooks, or regular expressions were executed for this review.

@byungkyu

byungkyu commented Nov 6, 2026

Copy link
Copy Markdown

The test-unit failure here doesn't come from this change. It was already on main at this branch's base, and main has since fixed it.

  • Same failures without this PR: all 15 (12 in test_powershell_shell_ownership.py, 3 in test_shell_quote_ownership.py) also fail at the merge base e14c450b2. main's own CI failed on the same 15 at that commit.
  • Fixed on main: fix: preserve language boundaries during static inspection #973 (preserve language boundaries during static inspection) fixed them.
  • Passes once merged onto main: locally, current main (9a08b0a6) with this PR merged in (no conflicts) gives 709 passed, 0 failed across the two affected files and this PR's test_finalize_inspection_ledger.py.

The branch is 134 commits behind main, so updating it from main and re-running CI should clear the check. If you run it locally, note that main now needs tree_sitter, so re-run pip install -e ".[dev]" after updating.

Budget-driven incompleteness (TP4 batch cap output_limit, static
per-artifact runtime_limit) is the scanner's own configuration, not an
artifact property, but every such gap became a HIGH AE1 finding at
confidence 1.0. Two budget AE1s alone scored 37.5 points and three hit
the 43.75 cap, so one MEDIUM finding pushed a benign package to
DO_NOT_INSTALL.

Suppress AE1 only when budget reasons are the target's entire ledger
gap, mirroring the existing format-limitation guard: mixed limitations,
failed or skipped work, fatal events, and truncated ledger evidence all
still produce AE1 at HIGH. The completeness ledger is untouched, so
budget gaps still report as partial with their reason codes.

Fixes NVIDIA#982.

Signed-off-by: Varshith Puli <[email protected]>
@Varshith-Kali
Varshith-Kali force-pushed the fix-982-ae1-budget-scoring branch from a1dd805 to adf699f Compare November 6, 2026 01:03
@Varshith-Kali

Copy link
Copy Markdown
Contributor Author

Thanks for confirming this, the diagnosis matches what I saw locally. Rebased onto current main (9a08b0a) as adf699f, no conflicts.

Verified on the rebased head: 721 passed, 0 failed across test_finalize_inspection_ledger.py, test_powershell_shell_ownership.py and test_shell_quote_ownership.py, ruff clean. CI should clear on the new head.

@Varshith-Kali

Copy link
Copy Markdown
Contributor Author

Hi @rng1995, quick update: CI is fully green on the rebased head (adf699f), including test-unit which now passes. The PR is ready on my side whenever you have a moment to merge. Thanks again for the approval.

@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.

[SkillSpector Review]

Decision: Approved (reviewed head adf699f69a6436f5bfdb4e652637b1639416d0e7).

Value and readiness: Budget-only incomplete analysis remains visible as partial coverage without adding a HIGH AE1 artifact-evasion score. Mixed artifact limitations and failed work retain the AE1 path. This current-head re-review replaces reliance on the older approval's commit association after rebasing.

Previous findings: The prior marked approval had no required code changes and explicitly reviewed a1dd80585beb653d24b9babe404ab0dfa9de55e6. I compared that source with this rebased head and re-read the complete current two-file feature diff and its integration context. The budget helper, suppression condition, and three added regression tests retain their behavior. The old unit-CI failures are no longer present in current-head hosted CI.

Material findings: No blocking or optional change found. finalize_inspection_ledger.py:389-415 requires explicit budget-only exceptional events and rejects failed/skipped work, unknown or mixed reasons, fatal events, and reasons attached to completed work. The caller at lines 1054-1062 additionally requires canonical untruncated ledger evidence, valid target accounting, no duplicate inventory path or target fatality, and a partial final disposition. The new branch does not modify the ledger or existing findings. Finalization still derives incomplete analysis from the retained budget rows. The three added tests at tests/nodes/test_finalize_inspection_ledger.py:1063-1113 assert partial status and all original reasons alongside no fabricated AE1, mixed parse limitations retaining HIGH AE1, and failed inventory retaining AE1. Adjacent canonical-accounting and coverage controls remain present.

PIC tradeoffs: The existing policy choice is preserved: budget exhaustion remains incomplete coverage and cannot establish installation safety from score alone. Batch packing and runtime determinism remain separate work; no new product decision is required for this rebase.

Verification and gaps: Compared old/current source and tests as data, reviewed the full current feature diff, canonical ledger validation, reference classification, target disposition handling and final projection, and read all review/discussion/thread records. Six hosted check runs, including test-unit, succeeded on this exact head (run). A fresh head read was unchanged and GitHub reported CLEAN merge state. No contributor code, tests, imports, builds, setup, hooks, regex probes, scanner invocations, or live providers were executed. This is a static review with hosted CI evidence, not a local test result.

@rng1995
rng1995 merged commit 1470418 into NVIDIA:main Nov 9, 2026
6 checks passed
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.

AE1 from TP4's 64-batch budget and the static runtime limit sets a 37.5-43.75 point floor on large skill packages

3 participants