On this page
/ docs · refine & write

Refine & Write

Refine and Write share the same control shape: a primary agent produces a draft, a reviewer critiques it, and the runtime iterates until the issue list is empty or the round limit is reached.

01Why these two stages belong together

02Shared loop

Same runtime pattern, different prompts and toolsets.

03IterationState

The runtime carries only the latest draft and the currently open issues.

04Refine design

Refine narrows intent. It does not run experiments or build plans.

05Write design

Write treats research outputs as facts and turns them into a readable paper.

06Polish + metadata

These are sub-steps inside Write, not a fourth top-level stage.

07Termination and reviewer contract

The runtime decides when the loop stops; the reviewer only reports issues.

08Code map

Most of the complexity lives in the shared base, not in the concrete stages.