fix(mcp): stop an unresolved reference from blocking safe_to_install - #526
fix(mcp): stop an unresolved reference from blocking safe_to_install#526goodhee wants to merge 1 commit into
Conversation
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
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
[SkillSpector Review]
Reviewed head ad0e683c3dc6086bb7309f29b6302dd59ead6ff2 — REQUEST_CHANGES.
src/skillspector/mcp_server.py:153-166:reference_caveat_onlyaccepts everyREFERENCE_UNRESOLVEDledger 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 returnsafe_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.
Summary
safe_to_installno longer fails when every exceptional ledger row isREFERENCE_UNRESOLVEDpartially_inspected_files == 0, whichis_completeused to coverA SKILL.md mentioning a file the bundle does not carry (typically a runtime
output, "save the result to
out.md") resolves to nothing, sois_completegoes false and a scan with zero findings and every file fully inspected is
reported unsafe to install. Unquoted
save.mdpasses and the backticked formdoes not, so the verdict tracks markup, not content. Other reason codes,
analyzer limitations, and partial or uninspected files still block.
is_complete, the report, andCAUTIONare 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