Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(mcp): stop an unresolved reference from blocking safe_to_install - #526

Open
goodhee wants to merge 1 commit into
NVIDIA:mainfrom
goodhee:fix/510-output-reference-caveat
Open

fix(mcp): stop an unresolved reference from blocking safe_to_install#526
goodhee wants to merge 1 commit into
NVIDIA:mainfrom
goodhee:fix/510-output-reference-caveat

Conversation

@goodhee

@goodhee goodhee commented Sep 11, 2026

Copy link
Copy Markdown

Summary

  • safe_to_install no longer fails when every exceptional ledger row is REFERENCE_UNRESOLVED
  • require partially_inspected_files == 0, which is_complete used to cover
  • regression tests for the caveat case and for the opaque-target case that must still block

A SKILL.md mentioning a file the bundle does not carry (typically a runtime
output, "save the result to out.md") resolves to nothing, so is_complete
goes false and a scan with zero findings and every file fully inspected is
reported unsafe to install. Unquoted save.md passes and the backticked form
does not, so the verdict tracks markup, not content. Other reason codes,
analyzer limitations, and partial or uninspected files still block.
is_complete, the report, and CAUTION are unchanged.

Fixes #510.

Testing

  • uv run pytest tests/nodes/test_security_remediation.py tests/unit/test_mcp_server.py tests/nodes/test_finalize_inspection_ledger.py -q (393 passed)
  • uv run ruff check src/ tests/
  • uv run ruff format --check src/ tests/
  • uv run mypy src/skillspector/mcp_server.py

A SKILL.md that names a file the bundle does not carry - most commonly
an output the skill writes at runtime, e.g. "save the result to
`out.md`" - resolves to no bundled path, so reference resolution
records REFERENCE_UNRESOLVED and analysis_completeness.is_complete
becomes false. The MCP gate consumed that single boolean, so a scan
with zero findings and every discovered file fully inspected was
reported unsafe to install purely because of a documentation wording
choice. Writing the same filename as unquoted prose kept the scan
complete, so the verdict depended on markup rather than content.

An unresolved reference hides no bundled bytes: analysis scope is
driven by discovery, not by what SKILL.md mentions, and
finalize_inspection_ledger already refuses to synthesize an AE1
coverage finding for one. Treat a scan whose exceptional rows are all
REFERENCE_UNRESOLVED as install-eligible, and require
partially_inspected_files to be zero now that is_complete no longer
covers it on its own. Any other reason code, any analyzer limitation,
and any partially or entirely uninspected file keep failing closed,
and an exceptional row with no attributable reason still blocks.

is_complete, the rendered report, and the CAUTION recommendation are
untouched, so the caveat stays visible; only the install boolean stops
treating it as hidden content.

Fixes NVIDIA#510.

Signed-off-by: goodhee <[email protected]>

@sylvesterkaczmarek sylvesterkaczmarek left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

REFERENCE_UNRESOLVED is emitted for both missing and ambiguous references in build_context.py, so reference_caveat_only also makes an ambiguous-reference scan safe_to_install=true. Those cases remain intentionally incomplete because the referenced target cannot be determined. Could we distinguish missing from ambiguous and exempt only the intended missing-reference case, with an ambiguous-reference regression test?

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

Reviewed head ad0e683c3dc6086bb7309f29b6302dd59ead6ff2 — REQUEST_CHANGES.

  • src/skillspector/mcp_server.py:153-166: reference_caveat_only accepts every REFERENCE_UNRESOLVED ledger row, but that reason code represents both a missing target and an ambiguous target. An ambiguous reference can point at multiple bundled artifacts, so the scanner has not established which bytes the instruction reaches; nevertheless this branch can return safe_to_install=true. Preserve the resolution status in the completeness data or introduce distinct missing/ambiguous reason codes, exempt only the intended missing-output case, and add an MCP regression test proving an ambiguous reference remains unsafe.

Required checks pass, but the requested correction and mergeStateStatus=BEHIND both block merging.

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.

[False positive] Output references like "save to save.md" make a clean skill partial: is_complete=false / safe_to_install=false

3 participants