fix: preserve Markdown context during JSON command recovery - #559
Conversation
Signed-off-by: Long Chen <longchen@nvidia.com>
rng1995
left a comment
There was a problem hiding this comment.
[SkillSpector Review]
Reviewed current head b179f91ab7e9aa090a5fb4415a818f1c3c2cf9af, including the complete production diff, the whole-document Markdown projection and JSON-span recovery paths, all added unit/public CLI/MCP regressions, prior discussion, and exact-head checks.
Reusing the length-preserving whole-document projection correctly keeps each recovered JSON string's original fenced, literal, or inline-code ownership while preserving the validated structural-quote offsets and bounded disjoint-span work. The tests cover fence/container combinations, single and multiple entries, conservative runtime-selected cases, benign controls, semantic/static modes, CLI exit behavior, and MCP installation decisions. All five hosted checks pass. No required changes remain on this head.
When JSON string recovery scans a string in isolation, it can reinterpret literal shell backticks from a surrounding Markdown code fence as inline-code delimiters. The example reported on #516 then changes from incomplete/CAUTION to complete/SAFE merely by adding unrelated array entries, allowing
--fail-on-incompleteand MCP installation checks to accept unresolved static analysis.Reuse the corresponding slice of the whole-document Markdown projection during recovery. This preserves the original delimiter ownership, source coordinates, JSON escapes, and disjoint-span work bound without reparsing each string as a new Markdown document.
Follow-up to the P1 review, as requested by the maintainer.
Regression coverage
static_parse_limit, CAUTION, strict CLI exit 1, andsafe_to_install=false; benign controls remain complete/SAFE.Validation
make test-ci: 5,054 passed, 14 skipped, 38 deselected, four expected failures, 90% coverage. Its two failures were the existing fenced-hostname public expectations described above; those expectations were corrected, a standalone control was added, and the affected modules then passed the 139-case rerun. Production code is unchanged since the full run. Hosted CI will rerun the full suite on the final commit.--no-llm --fail-on-incomplete: score 0, CAUTION,is_complete=false,static_parse_limit, exit 1.git diff --checkpassed.