Skip to content

fix(nist-ir-ai): repair invalid JSON escapes before parsing the assessment - #1197

Merged
scottbrumley merged 1 commit into
mainfrom
fix/promote-json-escape-repair
Oct 15, 2026
Merged

scottbrumley merged 1 commit into
mainfrom
fix/promote-json-escape-repair

Conversation

@scottbrumley

Copy link
Copy Markdown
Contributor

Bug (PoV tenant): URL-heavy issues produced assessments written as raw strings - backslashes in quoted paths/URLs are invalid JSON escapes, the parse failed, and salvage could not recover because the bad escape precedes every cut point.

Fix: a repair pass in SOCFWPromoteAssessment that doubles only invalid-escape backslashes, run strictly after a failed strict parse (valid replies are never rewritten), then re-parse, then salvage. War-room note states when repair fired. No dataset/contract change.

Testing:

  • Local 8-case suite: clean JSON untouched; Windows paths; UNC shares; URL backslashes; invalid \u; fenced+preamble; truncated+bad-escape combined; valid escapes preserved. All pass, plus a no-op guarantee on valid JSON.
  • Gate green, pack 1.4.7 uploaded to deathstar, tenant content verified.
  • Outstanding before merge: operator Playground run of the repair path on deathstar (no API path exists to execute commands). Two commands provided in session; result to be pasted here.

Not merging until the Playground evidence lands.

…sment

Model replies quoting Windows paths and URLs verbatim carry backslashes that
are invalid JSON escapes; json.loads(strict=False) does not forgive them, so
URL-heavy issues landed as raw strings instead of parsed assessments. Add a
repair pass that doubles only the offending backslashes - it runs strictly
after a failed parse, so well-formed replies are never rewritten - then
re-parse, then salvage. War-room note says when repair fired; dataset rows
and the contract are unchanged.
@scottbrumley scottbrumley added the version:patch Bug fix or hotfix → x.x.N label Oct 15, 2026
@scottbrumley
scottbrumley merged commit fc363af into main Oct 15, 2026
14 of 24 checks passed
@scottbrumley
scottbrumley deleted the fix/promote-json-escape-repair branch October 15, 2026 18:46
scottbrumley added a commit that referenced this pull request Oct 15, 2026
… release] (#1198)

The playbooks and prompts under ai/nist-ir live outside the packs and carry no
pack version, so their changes had no changelog home. One dated file per change
set, in the DC-facing format: what you get, what changed, what to update.
Seeded with today's Issue Assessment entry (#1196, #1197).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

version:patch Bug fix or hotfix → x.x.N

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant