Skip to content

fix(security): explain incomplete SkillSpector scans that hit a runtime limit - #294

Merged
rng1995 merged 15 commits into
mainfrom
naren/port-skillspector-runtime-limit
Nov 4, 2026
Merged

rng1995 merged 15 commits into
mainfrom
naren/port-skillspector-runtime-limit

Conversation

@rng1995

@rng1995 rng1995 commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • When SkillSpector reports partial analysis, the Tier 1 security error now quotes up to three of the report's completeness (ledger) exceptions as path[:line] [phase; reason_code; analyzers=...]. When there are more, it says how many remain and counts the distinct incomplete files per reason, for example and 463 more (incomplete files by reason: runtime_limit 462, obfuscated_instruction_text 4). A file with several rows counts once.
  • For runtime_limit rows the error adds what to do:
    • Scan time budget (any row that names regular analyzers or no analyzer): when many files are affected, the skill most likely bundles more content than SkillSpector can inspect within its time budgets, so a skill that bundles a large corpus hits the same limit on every rerun. Keep large reference material outside the skill; a plain rerun helps only when a few files are affected on a busy machine. The report does not say which budget ran out (SkillSpector's whole-scan deadline or a shorter stage budget such as bundle discovery), so the message names no specific limit.
    • Sub-analysis budget (every analyzer is named <analyzer>_runtime_limit, such as static_patterns_supply_chain_bytecode_runtime_limit): the budget does not depend on bundle size. Rerun, and update SkillSpector or report the exceptions if it repeats.
  • Report fields quoted in the error are reduced to one line (control, format and separator characters become spaces) and bounded to 200 characters each, so a malformed or hostile path cannot add lines to any report or make the error unbounded.
  • A partial report without ledger exceptions keeps the exact previous message. Gating is unchanged: the scan still fails closed as INCOMPLETE, and nothing is added to the JSON schema.
  • Docs: a "SkillSpector stops at a runtime limit" troubleshooting entry in docs/tier1-validation.mdx. CHANGELOG entry under Unreleased / Fixed.

Why

A partial SkillSpector report failed the security check with only skillspector JSON field 'analysis_completeness' reports incomplete analysis (status 'partial'); security scan did not complete. The report's ledger exceptions were checked for shape and then dropped, so users saw no file, no reason and no remedy. Two causes need opposite fixes:

  • SkillSpector 2.12.0 charges the SC8 bytecode walk for time spent waiting behind other analyzers (NVIDIA/SkillSpector#828, fixed in 2.13.0). The walk can stop with a static_patterns_supply_chain_bytecode_runtime_limit row on a skill that ships no bytecode, and the folder it names changes from run to run. Moving content out of the skill does not help; a rerun or a newer SkillSpector does. On main today, this sub-analysis case is the common source of a runtime_limit error.
  • A skill that vendors a large document corpus runs out of SkillSpector's time budget on every run. Rerunning never helps; the bundle has to shrink. On main today, SkillEvaluator stops SkillSpector after 300 seconds, before SkillSpector's own 600-second whole-scan deadline, so such a skill usually ends as skillspector timed out after 300 seconds with no report. Only SkillSpector's shorter stage budgets, such as bundle discovery, produce runtime_limit rows for it here. Once the SkillEvaluator watchdog is longer than SkillSpector's deadline (see "Merge order"), SkillSpector returns a partial report with runtime_limit rows for every file it did not finish, and this error names them and gives the remedy.

The new error tells the two apart from the report itself.

Merge order

Merge after fix(security): make the SkillSpector timeout configurable. That change raises the SkillSpector watchdog to 1,200 seconds by default, above SkillSpector's 600-second deadline, which is what makes the whole-scan case above reachable. This PR shares no code with it and is correct on its own: the error text and the docs entry name no watchdog value, and the docs entry says that a SkillEvaluator timeout shows up as skillspector timed out after N seconds instead. Both PRs add a separate accordion to docs/tier1-validation.mdx, which merges cleanly. The second to land needs a small rebase: both add a CHANGELOG entry at the same place and extend the same skillevaluator.validators.security import in tests/validators/test_security.py.

Not in this PR

  • An automatic single rerun after a static runtime_limit, with findings and risk merged across the two attempts. The trigger it targets is the SC8 bug above, which the SkillSpector 2.13.0 fix removes. Public's strict report validation would also need a result-level merge, because merging raw reports breaks its finding-count and inventory checks. On a whole-scan limit, a rerun doubles the scan time without finishing.
  • AE1 ("Incomplete referenced artifact analysis") naming and a count-only reference summary across the CLI, Markdown, HTML and JSON reporters. SkillSpector 2.12.0 and later already name AE1 and describe the remedy. The ledger exceptions quoted by this change show the reason and analyzer behind an AE1. The reporter work is larger and is better as its own PR.
  • Naming "raise SKILLSPECTOR_MAX_WORKFLOW_SECONDS together with SKILLEVALUATOR_SKILLSPECTOR_TIMEOUT_SECONDS" as another remedy for the whole-scan case, and a large-bundle hint on the skillspector timed out after N seconds error. Both depend on the configurable-timeout change and belong in a follow-up once it is merged.
  • Neutralising Markdown inline syntax (links, emphasis) in execution errors. The Markdown reporter renders every validator's execution errors with HTML escaping only; that is a reporter-wide change. Escaping inside this message would put literal escape characters into the CLI, JSON and HTML reports, which show the same text.

Kept from public

  • Public's strict completeness validation is unchanged: shape checks on every ledger row, the fatal-row rejection, the counter/coverage/analyzer-evidence checks, the 2.11.2 docs-only applicability rule and the CAUTION recommendation rule for partial LOW scans. The new text is built only after those checks pass, from rows they already validated.
  • The static-then-LLM stage structure, mark_scan_incomplete gating and the error-only reporting path stay as they are. Public's CLI and Markdown reporters list execution errors for INCOMPLETE results (and the JSON and HTML reports carry them), so the explanation goes into that error rather than into a separate Critical finding. The message keeps public's ...; security scan did not complete wording, so existing tests and tooling that look for it still match.
  • Untrusted report text is bounded and kept on one line, in line with public's handling of other scanner output.

Tests

  • New tests in tests/validators/test_security.py:
    • test_skillspector_partial_scan_names_incomplete_files_by_reason: a valid partial report with 8 ledger rows on 7 files produces exactly one error. The report's inventory, counters, coverage and analyzer accounting match its ledger (7 partially inspected files, degraded analyzers with matching limitations). The error quotes the first three rows, says and 5 more, and counts files per reason (runtime_limit 6, obfuscated_instruction_text 1; a file with two rows counts once). It also carries the scan-budget advice.
    • test_skillspector_sub_analysis_time_budget_does_not_blame_bundle_size: an SC8-shaped report (degraded static_patterns_supply_chain, one ..._bytecode_runtime_limit row) passes validation and produces the exact sub-analysis error with no bundle-size advice.
    • test_skillspector_runtime_limit_hint_counts_only_scan_budget_files: mixed rows, including a bundle-discovery row that names no analyzer, use the scan-budget advice, count only scan-budget files and name no specific deadline.
    • test_skillspector_incomplete_analysis_error_without_runtime_limit_has_no_hint: other reasons are quoted with line numbers and get no hint. Without ledger rows the message is unchanged.
    • test_skillspector_incomplete_analysis_error_bounds_untrusted_report_text: newlines are removed, long fields are cut to 200 characters, and non-string fields fall back to unknown.
  • All five fail on unmodified main: the two end-to-end tests on their message assertions, the three unit tests because the helper does not exist.
  • pytest tests/validators tests/reporting tests/ci tests/test_oss_packaging.py tests/test_oss_boundary.py tests/test_oss_source_hygiene.py tests/utils/test_tool_runner.py: 4556 passed, 3 skipped. pytest tests/cli tests/test_ci_change_classifier.py tests/test_ci_workflows.py: 194 passed.
  • ruff check passes on both changed Python files. ruff format --check reports only differences that were already in both files on main; the added lines are formatted. scripts/check_oss_boundary.py passes.

🤖 Generated with Claude Code

rng1995 and others added 2 commits October 30, 2026 11:59
…me limit

When SkillSpector reported partial analysis, the Tier 1 security scan
failed as INCOMPLETE with only "reports incomplete analysis (status
'partial')". The report's ledger exceptions were checked for shape and
then dropped, so users saw no file, no reason and no remedy. Two common
causes need opposite fixes: a skill that bundles a large corpus uses up
SkillSpector's whole-scan time budget on every rerun, while a
sub-analysis such as the SkillSpector 2.12.0 SC8 bytecode walk can stop
at its own time budget on a skill with no bytecode at all.

The error now quotes up to three ledger exceptions as
"path[:line] [phase; reason_code; analyzers=...]" and, when there are
more, counts the distinct incomplete files per reason. For runtime_limit
rows it adds a remedy: keep large bundled material outside the skill when
the whole-scan budget ran out, or rerun and update SkillSpector when
every analyzer is a "<analyzer>_runtime_limit" sub-analysis budget.
Quoted report fields are kept on one line and bounded to 200 characters.
A partial report without ledger exceptions keeps the previous message,
and the scan still fails closed as INCOMPLETE.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…get hint

A runtime_limit row that names regular analyzers, or none, can come from
SkillSpector's whole-scan deadline or from a shorter stage budget such as
bundle discovery, and the report does not say which. The hint no longer
cites the 600-second whole-scan default; it still says that a large bundled
corpus hits the same limit on every rerun. The docs entry names both kinds
of budget and notes that a SkillEvaluator timeout appears as
"skillspector timed out after N seconds" instead.

The whole-scan test report now has an inventory, counters, coverage and
degraded analyzer accounting that match its ledger rows, and the mixed-rows
test covers a bundle-discovery row with no analyzers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review summary: no findings.

Checked the ledger exception formatting (control/format/separator characters collapsed to spaces, 200-char bound per field, non-string and bool line values ignored), the per-reason distinct-file counts, the scan-budget vs sub-analysis-budget split in the runtime_limit hint, and that the partial-without-ledger message and the fail-closed INCOMPLETE gating are unchanged. The docs claim of a 600 second default whole-scan deadline matches DEFAULT_MAX_WORKFLOW_SECONDS in SkillSpector v2.13.1 (state.py), and the 'before v2.13.0' SC8 note agrees with #292. CHANGELOG is under Unreleased > Fixed. The new ledger/runtime-limit/partial tests pass locally (35 selected from tests/validators/test_security.py) and ruff check is clean. I did not wait for the full test_security.py module run to finish.

Reviewed with Claude Code.

rng1995 and others added 5 commits November 2, 2026 10:58
Resolved conflicts in CHANGELOG.md.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflict in tests/validators/test_security.py (security import list): kept
main's _skillspector_llm_env and this PR's
_skillspector_incomplete_analysis_error.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
Resolve conflicts with #271: keep both SkillSpector Fixed entries in the
CHANGELOG (the timeout entry first) and import both
_skillspector_incomplete_analysis_error and _skillspector_timeout_seconds
in the security tests. Update the runtime-limit troubleshooting text to
SkillSpector v2.13.3's 1,080-second default scan deadline.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
Resolve conflicts with #299 in security.py: keep both sets of new
helpers, and keep #299's passive-raster warning path while the
remaining partial-analysis error uses
_skillspector_incomplete_analysis_error.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>

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

Gating is unchanged (the scan still fails closed as incomplete), the quoted report fields are cut to one line and 200 characters, and the CLI and HTML reporters escape the text. I ran the new tests and they pass. One non-blocking point: when a report mixes the two kinds of runtime_limit rows, only the scan-budget advice shows.

rng1995 and others added 6 commits November 3, 2026 09:08
No conflicts.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ow kinds

When a SkillSpector report held scan-budget runtime_limit rows and
sub-analysis (<analyzer>_runtime_limit) rows, the hint covered only the
scan-budget rows, so the by-reason count and the hint disagreed and the
sub-analysis rows got no rerun or update advice. Emit both sentences.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
…budget advice

When a partial SkillSpector report had both regular runtime_limit rows and
<analyzer>_runtime_limit rows, the hint returned only the scan-budget advice.
The by-reason count included every runtime_limit file, but the hint counted
only the scan-budget ones, and the sub-analysis files got no rerun or update
advice. Each kind of row now gets its own sentence, so the two hints together
cover every runtime_limit file in the count.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…limit

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…illspector-runtime-limit

Conflicts in src/skillevaluator/validators/security.py and tests/validators/test_security.py.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolve the CHANGELOG.md conflict: keep main's new Unreleased entry and
put this PR's entry after it.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
rng1995 and others added 2 commits November 5, 2026 00:31
Resolve the CHANGELOG.md conflict: keep main's Ctrl+C entry (#291) and
add this PR's SkillSpector partial-scan entry after it.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rng1995
rng1995 enabled auto-merge (squash) November 4, 2026 19:41
@rng1995
rng1995 merged commit 0ae3fdb into main Nov 4, 2026
22 checks passed
@rng1995
rng1995 deleted the naren/port-skillspector-runtime-limit branch November 4, 2026 20:09
rng1995 added a commit that referenced this pull request Nov 5, 2026
Resolve the CHANGELOG.md conflict: keep main's SkillSpector partial-scan
entry (#294) and add this PR's RAGAS scorer entry after it.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

2 participants