Skip to content

fix(security): show where SkillSpector parse limits apply in incomplete scans - #789

Merged
rng1995 merged 7 commits into
NVIDIA:mainfrom
mvanhorn:feat/skillspector-parser-locations
Nov 19, 2026
Merged

rng1995 merged 7 commits into
NVIDIA:mainfrom
mvanhorn:feat/skillspector-parser-locations

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

Summary

Incomplete SkillSpector scans already carried parser_diagnostic on
static_parse_limit ledger rows (span, cause, and check), but the
security check dropped that object. JavaScript helpers such as
scripts/admission.mjs therefore appeared as a path with no line and no
reason, even though the scanner named lines 74-170 as
runtime_dependent / command_string_runtime (the spawnSync call it
cannot resolve statically is on line 145).

The incomplete-analysis error now labels those rows from a well-formed
diagnostic (path:74-170, or path:11 for a single line), adds sanitized
cause and check to the bracket context, and, when every parse-limit
row is runtime_dependent, appends a short hint to review the reported
lines and prefer fixed argument lists. JSON skillspector_completeness
keeps a bounded copy of the diagnostic (no source text or byte offsets).
AE1 suggestions use the same span when the reason has no line of its own
and the evidence includes one. Rows that already have start_line are
unchanged. The check stays INCOMPLETE. These diagnostics never turn an
incomplete scan into a pass.

Refs #784

Verification

  • I am familiar with the Contributing Guidelines
  • Added or updated focused tests
  • Updated documentation for user-visible changes
  • Ran make lint
  • Ran make test
  • Ran make build
  • Did not add credentials, private datasets, or proprietary benchmark content

Release Impact

  • No user-visible release note needed
  • Updated CHANGELOG.md

Commands run

Platform: Linux 6.12.113+ x86_64, Python 3.13.18.

Untouched upstream/main (affe1acc3d0a24877c5d508d96ac69663a7fd92a):

  • uv run make lint — All checks passed
  • uv run make test — hung in tests/test_harbor_secure_docker_environment.py::test_windows_transfer_repeated_cancellation_reaps_process_and_removes_partial_output (~29%); killed (EXIT 143).
  • uv run python -m pytest -n auto --tb=line --deselect tests/test_harbor_secure_docker_environment.py::test_windows_transfer_repeated_cancellation_reaps_process_and_removes_partial_output — 50 failed, 39468 passed, 171 skipped, 65 warnings. These fail without this change: 27 Docker-client tests in tests/test_harbor_secure_docker_environment.py, 15 Rich wrapping assertions in tests/reporting/, 1 NeMo Gym process-group test, and 7 tier3/harness tests.
  • uv run make build — Successfully built skillevaluator-1.0.1.tar.gz and skillevaluator-1.0.1-py3-none-any.whl
  • ./fern/node_modules/.bin/fern check — Found 0 errors (1 Fern CLI upgrade warning)
  • uv run ruff format --check src/skillevaluator/validators/security.py — would reformat (pre-existing wrapping)

This branch:

  • uv run make lint — All checks passed
  • uv run ruff format --check on the Python files this change adds or edits except security.py — 7 files already formatted
  • uv run python -m pytest tests/validators/test_skillspector_parser_locations.py tests/validators/test_skillspector_diagnostics.py tests/validators/test_skillspector_reference_diagnostics.py tests/validators/test_skillspector_hook_surface.py tests/reporting/test_tier3_validate_cases.py — 261 passed
  • uv run python -m pytest -n auto --tb=line --deselect tests/test_harbor_secure_docker_environment.py::test_windows_transfer_repeated_cancellation_reaps_process_and_removes_partial_output — 50 failed, 39494 passed, 171 skipped, 65 warnings. The 50 failures are the same set as untouched upstream/main. The extra 26 passes are the new parser-location tests. tests/test_cli.py, tests/reporting/, and tests/golden/ are in this run.
  • uv run make build — Successfully built skillevaluator-1.0.1.tar.gz and skillevaluator-1.0.1-py3-none-any.whl
  • ./fern/node_modules/.bin/fern check — Found 0 errors (same Fern CLI upgrade warning as baseline)

Ran make test is unticked: serial make test hangs on the Windows-transfer test on untouched upstream/main as well, so it was not run to completion on either side; the xdist runs above deselect only that test.

Not verified: live and integration markers (excluded by default); paid or credentialed checks.

Demo

The recording runs Tier 1 security with --no-llm on the public TheColliery/CoalFace skill from #784 (skills/coalface at f7574dfb), before and after this change. The scan stays INCOMPLETE in both.

demo

Full recording (MP4): https://raw.githubusercontent.com/mvanhorn/pr-demo-assets/main/osc-bulk-1118/skillspector-parser-locations/out.mp4

…te scans

Incomplete SkillSpector scans dropped parser_diagnostic on static_parse_limit rows, so JavaScript helpers showed no span, cause, or check.

Label those rows from a well-formed diagnostic, keep a bounded copy in skillspector_completeness, and hint when every parse-limit row is runtime_dependent. The security check stays INCOMPLETE.

Signed-off-by: Matt Van Horn <mvanhorn@users.noreply.github.com>
@cursor
cursor Bot force-pushed the feat/skillspector-parser-locations branch from 6fc9ff3 to d6940e6 Compare November 18, 2026 19:06
Resolve the CHANGELOG.md conflict by keeping the upstream Tier 3 entries
and this branch's SkillSpector parser-location entry.

Signed-off-by: Matt Van Horn <mvanhorn@users.noreply.github.com>
@mvanhorn

Copy link
Copy Markdown
Contributor Author

Fixed as of the current head 34b440d: the end line now goes into the grouping key and the "target lines" text only when it came from parser_diagnostic, so a row that already carries its own start and end line keeps the base suggestion and finding ID. Two tests in tests/validators/test_skillspector_reference_diagnostics.py cover your cases: a row with lines 3 to 7 and no parser diagnostic matches the base finding ID, and two read_error rows with the same start line but different end lines still group into one.

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

Thank you for the contribution! Reviewed parser-derived locations, row-line precedence, stable finding identities, boundary revalidation and report propagation. Focused diagnostics, reference, hook-surface and reporting suites passed (262 tests). The previous identity/grouping issue is fixed; no additional actionable issues found.

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

Thanks @mvanhorn for this contribution! I reviewed 34b440d995. I reproduced the problem on main, confirmed this change fixes it, checked that the new tests fail on main, and ran the new and related tests on this head (all pass). I left 3 inline comments (3 P3); please take a look.

mvanhorn and others added 4 commits November 19, 2026 00:26
… row

SkillSpector 2.13.x builds an AE1 finding's evidence.reasons without
parser_diagnostic, so the span branch never ran on real reports. When a
structured reason has no line, read the span from the one
analysis_completeness.ledger_exceptions row with the same normalized path
and reason_code; skip it when zero or several rows match.

Tests now use the captured 2.13.4 mjs fixture plus an AE1 issue in the
scanner's shape. The CHANGELOG notes the one-time AE1 finding_id change.

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
A reason whose lines come from a parser_diagnostic now carries
line_source: "parser_diagnostic" instead of the private _parser_span
marker. reference_suggestion reads that field and no longer mutates the
evidence it is given, so issue_diagnostics output has no
underscore-prefixed keys and repeated calls return the same suggestion
and finding ID.

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
The incomplete-analysis error shows only the first three ledger rows, so
runtime-dependent parse-limit rows could fall into "and N more" behind
reference_missing rows, leaving the hint pointing at lines that were not
shown. The hint now names up to three path:start-end locations itself,
built the same way as the row labels. Extra locations and rows without a
usable span point to parser_diagnostic on the skillspector_completeness
rows of the JSON report.

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
@mvanhorn

Copy link
Copy Markdown
Contributor Author

@rng1995 I replied on each of the three P3 threads with the fix. I left them open for you to resolve once you've checked them.

@rng1995
rng1995 enabled auto-merge (squash) November 19, 2026 09:57
@rng1995
rng1995 merged commit 798031f into NVIDIA:main Nov 19, 2026
26 checks passed
@mvanhorn

Copy link
Copy Markdown
Contributor Author

Appreciate the merge, @rng1995. Incomplete SkillSpector scans should now point at the parser span and cause from parser_diagnostic instead of a bare path, which makes runtime_dependent helpers much easier to track down.

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.

3 participants