Skip to content

fix: post-pass replies get the lens path's JSON tolerance; a non-JSON reply fails the pass - #385

Merged
TheAmericanMaker merged 1 commit into
mainfrom
fix/post-pass-json-tolerance
Sep 16, 2026
Merged

TheAmericanMaker merged 1 commit into
mainfrom
fix/post-pass-json-tolerance

Conversation

@TheAmericanMaker

Copy link
Copy Markdown
Member

Summary

Closes #366. Verified on main: parseTriageItems (collect.ts) and parseSynthesisTopFindings (render.ts) call JSON.parse directly and return [] on failure, and the completion branch writes whatever came back to <pass>.json and marks the pass completed; the new test fails there — a fenced reply yields completed with empty top findings, a prose reply the same.

  • Both parsers use parseLensJson (fence-tolerant). The stored synthesis.json/triage.json is the parsed object re-serialized, so downstream readers (loadPostPassVerdicts is unaffected — it reads verified.json) get JSON, not a fence.
  • A reply that is not a JSON object marks the entry failed with error: "the reply was not a JSON object — cut off at the output cap, or prose; the raw text is saved beside the run", writes <pass>.raw.txt, and collectResultText's existing failed-pass line shows the reason. An empty result body gets its own message.

Test plan

  • tests/broadside-post-pass-verdicts.test.mjs: fenced replies parse and populate the top items with the fence stripped on disk; prose replies fail both passes with the reason, keep the raw text, write no .json, and the report says so. Fails on main, passes here.
  • npm run build + npm test — 933 pass.

🤖 Generated with Claude Code

… reply fails the pass

Synthesis and triage parsed their reply with a raw JSON.parse, so a fenced
reply read as a completed pass with nothing in it. Both parse through the
fence-tolerant reader; a reply that is not a JSON object marks the pass
failed with the reason, keeps the raw text beside the run, and says so in
the report.

Closes #366

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@TheAmericanMaker
TheAmericanMaker merged commit 5dcaa93 into main Sep 16, 2026
5 checks passed
@TheAmericanMaker
TheAmericanMaker deleted the fix/post-pass-json-tolerance branch September 16, 2026 02:05
@TheAmericanMaker TheAmericanMaker mentioned this pull request Sep 16, 2026
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.

Post-pass JSON is parsed without the fence tolerance lens results get

1 participant