Commit Graph

4 Commits

Author SHA1 Message Date
alan 00252da8f8 turn: keep turn headings structural in memory
Turn bodies were embedded verbatim, so a body's own ## headings looked like
sibling turns and could even duplicate the system's "Files added to public/"
line. Body headings are now demoted two levels (capped at H6) outside fences;
fenced code is untouched.
2026-10-19 23:35:18 +01:00
alan b1482b554b turn: keep the body written before a trailing outcome
ParseOutput returned only the text after the outcome value, so a stage that wrote
its result first and "# outcome" last handed the next stage "(no output)" — the
probe's Compose and Critique turns were both lost this way. The body is now the
whole document with just the outcome heading and value line removed, in order,
byte for byte. Tests cover a trailing and a mid-document outcome.
2026-10-19 23:31:06 +01:00
alan e37b864c40 stage turns: replace JSON results with file-based markdown turns
Each model visit now gets <run>/stages/<seq>-<stage>/ with input.md,
memory.md, output.md, private/ and a shared run-level public/. The model
reads the two input files, follows the stage's instructions verbatim and
returns complete markdown; only the # outcome section is parsed.

- add internal/turn layout, render and output parsing
- write input.md/memory.md before a visit and output.md from the final
  message; inventory all turn files as stage artifacts
- accumulate completed turns and system-written public file additions in
  memory, including across retries and resume
- remove the JSON envelope, strict field validation, line format and the
  repair ladder for model stages
- republish pipeline authoring prompts and docs in the new style

Checks: go build ./..., go vet ./..., go test -count=1 ./..., gofmt -l .
2026-10-19 22:27:44 +01:00
alan 7b6bd71dd8 turn: add file-based stage turn foundation 2026-10-19 20:06:18 +01:00