fix(turns): keep the run task in every stage's input

Later visits' input.md held only the previous stage's output, so the
operator's task reached only the first stage; when a Prepare stage
summarised (paths, HEAD), Code never saw the task or its acceptance
checklist and either blocked (run #202) or did part of it (#195, #197,
#198). Later inputs now carry the run prompt under '# Run task' (headings
demoted) before '# Previous turn output'.
This commit is contained in:
2026-10-31 02:52:16 +00:00
parent ea0f22dfc7
commit 13c4035175
8 changed files with 35 additions and 23 deletions
+3 -2
View File
@@ -662,8 +662,9 @@ files as that step's artifacts:
<artifacts>/<run>/public/
```
`input.md` is the run prompt on the first visit and the previous visit's output
body (without its outcome section) afterwards. `memory.md` is the accumulated markdown of completed turns plus the
`input.md` is the run prompt on the first visit; later visits carry the run
prompt under `# Run task` followed by the previous visit's output body (without
its outcome section) under `# Previous turn output`. `memory.md` is the accumulated markdown of completed turns plus the
files each turn added to the shared `public/` directory. A text-only stage (an
explicit empty `tools` block) receives both files' contents in its prompt
instead, because it has no file-reading tool. The model returns the complete
+4 -2
View File
@@ -16,8 +16,10 @@ Every model visit gets its own directory under the run's artifact root:
<artifacts>/<run>/public/
```
- `input.md` is the run prompt on the first visit and the previous visit's body
after that, under a `# Previous turn output` heading.
- `input.md` is the run prompt on the first visit. Later visits keep the run
prompt under a `# Run task` heading (its own headings demoted two levels) and
add the previous visit's body under a `# Previous turn output` heading, so
every stage sees what the run is for even when an earlier stage summarised.
- `memory.md` is one `## <stage> · visit <n>` section per completed turn: the
turn body followed by a system-written, sorted list of the files that turn
added to `public/`.
+5 -3
View File
@@ -15,9 +15,11 @@ the run's artifact root:
zero-padded to two digits). `Paths.Ensure` creates the turn, private and public
directories idempotently; it never deletes or rewrites existing files.
`input.md` is the run prompt on the first visit and the previous visit's output
body (without the outcome section) under a `# Previous turn output` heading
afterwards. `memory.md` is plain
`input.md` is the run prompt on the first visit. Afterwards it is the run
prompt under a `# Run task` heading (headings demoted two levels) followed by
the previous visit's output body (without the outcome section) under a
`# Previous turn output` heading. Carrying the task forward means a stage that
only summarised its own work is never the sole carrier of what the run is for. `memory.md` is plain
markdown: one `## <stage> · visit <n>` section per completed turn, with that
turn's body — its own ATX headings demoted two levels, so the turn heading stays
the structural one — followed by a system-written list of files it added to