Repository navigation
fix(security): show where SkillSpector parse limits apply in incomplete scans - #789
Conversation
…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>
6fc9ff3 to
d6940e6
Compare
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>
|
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 |
rng1995
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
… 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>
|
@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. |
|
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. |
Summary
Incomplete SkillSpector scans already carried
parser_diagnosticonstatic_parse_limitledger rows (span,cause, andcheck), but thesecurity check dropped that object. JavaScript helpers such as
scripts/admission.mjstherefore appeared as a path with no line and noreason, even though the scanner named lines 74-170 as
runtime_dependent/command_string_runtime(thespawnSynccall itcannot resolve statically is on line 145).
The incomplete-analysis error now labels those rows from a well-formed
diagnostic (
path:74-170, orpath:11for a single line), adds sanitizedcauseandcheckto the bracket context, and, when every parse-limitrow is
runtime_dependent, appends a short hint to review the reportedlines and prefer fixed argument lists. JSON
skillspector_completenesskeeps 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_lineareunchanged. The check stays
INCOMPLETE. These diagnostics never turn anincomplete scan into a pass.
Refs #784
Verification
make lintmake testmake buildRelease Impact
CHANGELOG.mdCommands run
Platform: Linux 6.12.113+ x86_64, Python 3.13.18.
Untouched
upstream/main(affe1acc3d0a24877c5d508d96ac69663a7fd92a):uv run make lint— All checks passeduv run make test— hung intests/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 intests/test_harbor_secure_docker_environment.py, 15 Rich wrapping assertions intests/reporting/, 1 NeMo Gym process-group test, and 7 tier3/harness tests.uv run make build— Successfully builtskillevaluator-1.0.1.tar.gzandskillevaluator-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 passeduv run ruff format --checkon the Python files this change adds or edits exceptsecurity.py— 7 files already formatteduv 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 passeduv 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 untouchedupstream/main. The extra 26 passes are the new parser-location tests.tests/test_cli.py,tests/reporting/, andtests/golden/are in this run.uv run make build— Successfully builtskillevaluator-1.0.1.tar.gzandskillevaluator-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 testis unticked: serialmake testhangs on the Windows-transfer test on untouchedupstream/mainas 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-llmon the publicTheColliery/CoalFaceskill from #784 (skills/coalfaceatf7574dfb), before and after this change. The scan staysINCOMPLETEin both.Full recording (MP4): https://raw.githubusercontent.com/mvanhorn/pr-demo-assets/main/osc-bulk-1118/skillspector-parser-locations/out.mp4