Skip to content

Ticket #249: compact synthesis context — verification ​

  • Date: 2026-11-11
  • Branch: ticket/249-compact-synthesis
  • Base: integration/terminal-turns at fd0d3a0 (merge of #246); merged ffec511 (#247) before final verification
  • Spec: parent #245; ticket #249
  • Unit gate: npm run verify (strict typecheck + full test suite)

Behavior ​

A root synthesis turn no longer receives the bounded last-20 group transcript. Its context carries the original request and the #246 branch digest — worker path plus the final result for each terminal branch. Worker turns keep the recent transcript unchanged.

The synthesis prompt asks for one concise group summary: answer the original request, name the contributing workers, and note anything still open. It states that $Name mentions are references in the terminal turn, so a name in the summary does not start new work. The synthesis turn block uses the existing routing: false mode for the same reason.

The digest reuses #246's caps: at most 20 branches, each result bounded to 600 characters plus an ellipsis. No new cap was needed.

Measurements ​

npm run benchmark:synthesis renders a fixed five-branch fan-out over the #225 12-member roster and 20-message transcript. Token counts are the documented chars/4 estimate; output is a fixed representative concise summary, not a live model measurement.

MeasurementCharsEst. tokens
Synthesis context2,033509
Synthesis prompt text33584
Synthesis prompt total (context + text)2,368593
Removed last-20 transcript block1,492373
Representative concise summary30376

For comparison, the same fixture renders a worker context at 2,904 chars because it still carries the transcript. The pre-#245 evidence recorded 8,333 leader characters for a five-writer relay (four syntheses plus completion); #246 removes the per-hop turns and this ticket removes the per-turn transcript, leaving one compact prompt per command.

Tests ​

npm run verify: strict typecheck passed; 1,893 tests passed, 0 failed, 0 skipped (after the #247 merge).

  • execution.test.ts: a synthesis context has the root request and branch digest but no recent block; the digest is bounded to 20 branches and 600-char results; the synthesis prompt asks for one concise summary and marks mentions as references; the worker context still carries the last-20 transcript.
  • root-synthesis-service.test.ts: the five-way fan-out synthesis context carries the root request and no recent transcript through the real service boundary.
  • prompt-benchmark.test.ts: synthesis prompt sizes stay bounded and the removed transcript is material.
  • Existing #246 relay/fan-out tests still pass.

Conflict risk ​

  • #247 ancestor guard: merged at ffec511 with no conflicts. It changes the completion decision and its service call sites; this ticket changes execution.ts context/prompt rendering and context tests.
  • #250 continuation dispatch: adds a native tool and terminal continuation handling in service.ts and the tool surface. It may update the terminal-turn wording in turn-context.ts; the routing: !synthesis argument here is the only shared line and is a one-line resolution.
  • No TUI, store, routing planner, or tool-surface change.

Released under the MIT License.