Skip to content

fix: keep a synthesis that opens with a line of chat - #21

Merged
hibeekaey merged 1 commit into
mainfrom
fix/synth-preamble
Aug 17, 2026
Merged

fix: keep a synthesis that opens with a line of chat#21
hibeekaey merged 1 commit into
mainfrom
fix/synth-preamble

Conversation

@hibeekaey

Copy link
Copy Markdown
Owner
  • valid_synth_output required the very first line of the synthesizer's output to be a heading. A model that prefaces the document with "Here is the merged document:" therefore had an otherwise correct merge of a 60 KB file thrown away, and auto went on to spend another multi-minute call on the next fallback before settling for the deterministic merge. Found while diagnosing a real agent: claude synthesis failed; trying the next fallback.
  • Prose above the first heading is now dropped rather than fatal, bounded to ten lines. Past that it is a refusal and not a document, so the deterministic merge already in place stays.
  • Deliberately not included: a size floor rejecting a synthesis far smaller than its input. It would close a related hole (a short refusal that happens to open with # currently replaces the whole file, recoverable only from .bak), but every threshold I could pick was arbitrary, and a legitimate consolidation measured 45% of its input. Worth a separate decision rather than a guessed constant.
  • Version bumped to 1.6.1; merging this cuts the release.

Validation: both new assertions fail against the pre-fix binary and pass after — the preamble case, and a fourteen-line refusal ending in a heading that must not be rescued. Falsified the bounded window by widening it to 100 (the refusal gets accepted) and by unwiring the strip (the preamble case fails again). Full suite green, nine suites, plus ShellCheck over bin/agent scripts/*.sh tests/*.sh.

🤖 Generated with Claude Code

valid_synth_output required the very first line of the synthesizer's output
to be a heading. A model that prefaces the document with "Here is the merged
document:" therefore had an otherwise correct merge of a 60 KB file thrown
away, and auto went on to spend another multi-minute call on the next
fallback before settling for the deterministic merge.

Prose above the first heading is now dropped rather than fatal, bounded to
ten lines. Past that it is a refusal and not a document, and the
deterministic merge already in place is the better answer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@hibeekaey
hibeekaey merged commit bd52b36 into main Aug 17, 2026
3 checks passed
@hibeekaey
hibeekaey deleted the fix/synth-preamble branch August 17, 2026 22:01
hibeekaey added a commit that referenced this pull request Aug 17, 2026
- `valid_synth_output` checked only that the output was non-empty and
opened with a heading. A refusal that happens to start with one
therefore passed, replacing the whole memory file with three lines and
pushing that stub to every agent — the `.bak` was the only way back. A
synthesis must now keep at least a quarter of the document's lines.
- The threshold is set against measurement rather than taste: shrinking
is most of the job (folding the imported sections away), a real merge
measured 45% of its input, and a refusal measured 2%. 25% sits an order
of magnitude above the refusal and well under the merge.
- Test fixtures now answer proportionally to the prompt they are given,
the way a synthesizer does, instead of returning a one-line stub. The
old mocks were smaller than the floor, which is itself evidence the
fixtures were not modelling the real thing.
- Version bumped to 1.6.2; merging this cuts the release.

Validation: falsified three ways — floor at 0 lets the stub replace the
canon, floor at 60 wrongly refuses a legitimate half-document, and
inverting the comparison breaks the healthy path. All nine suites and
ShellCheck over `bin/agent scripts/*.sh tests/*.sh` green.

This closes the hole left open deliberately in #21.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant