fix(deep): coerce stringified concept-pass nodes and stop ticking empty batches (#383) - #395
Frankie-Xu wants to merge 2 commits into
Conversation
🌱 graft blast radiusNothing outside this diff depends on it. 2 areas changed; no indexed dependents at depth 2. Who knows this code — 2 people across 2 areas
Ownership is git history over each area's own files, weighted towards recent work (120-day half-life). Merge commits and bots are dropped, and you are dropped from your own PR. A name with no Test signal per changed area — 1 ✗ · 1 –Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.
Open the interactive graph → — click an area to see its dependent symbols at file:line. |
Windows checkout rewrote cli.ts / synthesize.ts as CRLF, so the PR looked like a 3000-line rewrite. Behaviour is unchanged.
|
Follow-up: the previous commit stored these files as CRLF on Windows, so GitHub showed a whole-file rewrite of cli.ts. e780182 converts them back to LF to match main. Behaviour is unchanged; the real delta is synthesize.ts + the concept-pass tick in cli.ts + test/synthesize-clean.test.ts. |
Summary
record_graphcall can still delivernodesas a JSON string (double-encoded tool args).clean()then hitif (!Array.isArray(nodes)) return [],warnToolChoiceIgnoredstayed silent because there was a tool call, and the CLI printed✓ concepts: 0 nodesfor a complete graph (--deepconcept pass: a stringifiednodestool argument is dropped byclean(), and the empty batch prints a ✓ #383).nodeswithJSON.parse; if a stray brace breaks that, salvage balanced{name:…}objects. Warn with the received type, character count, tool-call count, and how many nodes were salvaged.⚠rather than a success tick.Not in this PR
maxTokens.crux.ts/ id peel.recoverToolArgsFromContent(that path only runs when there is no tool-call args object).Closes #383
Test plan
nodeswith a stray}between two objects → salvaged nodes + warningnodesarray → 0 nodes, warning, no✓node --import tsx --test test/synthesize-clean.test.ts test/llm-ops.test.tsMade with Cursor