A close-out agent SYNTHESISES the run — one paragraph above the commits saying what they deliver together
11.5.27's stated limit: concatenated commits do not synthesise. Four commits that together deliver one capability read as four separate changes, because each was written by an agent that saw one card and could not know the others existed.
The missing sentence is the one a reviewer wants first — "these four move the CLI's reads onto /api/v1; the fifth is the guard that keeps them there" — and nothing in the run can write it. Only something that read the whole branch can.
What to build
One agent invocation at close-out, after the branch is pushed and before the pull request is opened, whose entire job is: read the commits and the diff, emit one paragraph saying what the branch delivers as a whole. That paragraph goes at the TOP of the body, above the frame and the commits.
⚠️ ADDITIVE, never a replacement
The synthesis sits above material it cannot overwrite. The commits stay, in full, underneath it.
That is not tidiness — it is what makes a wrong synthesis survivable. A summary that misreads the branch is visibly contradicted by the commits below it, and a reviewer who distrusts the paragraph still has everything they had before. A synthesis that REPLACED the commits would make the loop's most confident output its least verifiable one, and there is no way to tell a good summary from a plausible one without the material it summarised.
What it costs, said plainly
One agent invocation per run — tokens and wall-clock, on the user's own key under BYOK. It runs once per run, not per card, so it is small next to the run it describes. It must NOT block the pull request: if the synthesis agent fails, times out, or returns nothing, the body is opened exactly as 11.5.27 would have built it. A run must never lose its pull request over a paragraph.
Scope BOUNDARY
The synthesis step and its placement in the body. It does NOT change what 11.5.27 assembles — the frame and the commits are untouched and remain the body when synthesis is absent. It does NOT change the title (its own card). It does NOT run per card. It does NOT apply to motir batch, which has no branch-level unit to summarise.
Acceptance criteria
- The synthesis appears ABOVE the frame and commits, and the commits are present in full underneath it — asserted on the assembled body.
- A failing, timing-out or empty synthesis leaves the body exactly as 11.5.27 builds it, and the pull request still opens. Asserted for each of the three, because this is the criterion that keeps a nice-to-have from becoming a way to lose a run's output.
- It runs ONCE per run per repo, asserted on the invocation count.
- A run of ONE card skips synthesis entirely — there is nothing to synthesise, and a paragraph restating a single commit is noise.
- The prompt handed to the synthesis agent asks for what the branch DELIVERS, not a restatement of the commit subjects; a summary that is the subjects joined by commas is the failure this card is trying to avoid and should be visible in a test fixture.
Context refs
- 11.5.27 — the body this extends; its "concatenated commits do not synthesise" limit is this card's brief.
packages/cli/src/commands/auto.ts—closeOutRepos, where the branch is pushed and the body assembled.packages/cli/src/agentRun.ts—runAgent, the existing invocation path.- Story: MOTIR-1855.