Sanitize paths in produced json - #85
Closed
JanKrivanek wants to merge 2 commits into
Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a small JSON sanitization step in the skill-validator’s LLM judge parsing path to prevent invalid escape sequences (commonly from Windows-style paths) from breaking JSON.parse, and introduces unit tests to cover these cases.
Changes:
- Add
sanitizeJsonEscapes()utility to repair invalid JSON escape sequences inside JSON strings. - Apply sanitization before
JSON.parsein both the independent judge and pairwise judge parsers. - Add Vitest coverage for common valid/invalid escape scenarios and ignore generated validator results output.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| eng/skill-validator/src/json-utils.ts | Introduces sanitizeJsonEscapes() to rewrite invalid escapes to valid JSON escapes. |
| eng/skill-validator/src/judge.ts | Sanitizes extracted JSON before parsing and reports sanitized JSON on parse errors. |
| eng/skill-validator/src/pairwise-judge.ts | Sanitizes extracted JSON before parsing in pairwise judge flow. |
| eng/skill-validator/tests/json-utils.test.ts | Adds unit tests covering valid escapes, invalid path escapes, and multiline judge output. |
| .gitignore | Ignores skill-validator’s default .skill-validator-results/ output directory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
Fixed by other PRs |
moesac0970
pushed a commit
to moesac0970/skills
that referenced
this pull request
Jul 4, 2026
…xed: removed dangling writing-mstest-tests ref
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
LLM Judge can be adding paths to result json that cause it to be unparseable - e.g.:
https://github.com/dotnet/skills/actions/runs/22298025045/job/64498823613#step:6:61
So sanitizing paths to prevent results being flagged as wrong