async function body, no agent) just as well as agents. A retry-until-green
test loop is the canonical non-agent case:
Notes
- Give every
<Loop>an explicitid. Without one the loop id is derived from its position in the tree, so a sibling that conditionally mounts or unmounts shifts the path and re-keys the loop, stranding its iteration state and restarting it from 0. An explicitidpins identity and makes the loop immune to sibling churn. onMaxReachedhas exactly two values."return-last"(the default) ends the loop cleanly oncemaxIterationsis hit, keeping the last iteration’s output."fail"instead throwsRALPH_MAX_REACHEDand fails the run. Use"fail"when hitting the cap means the work never converged (tests never went green); use the default when the best-so-far result is acceptable.ctx.latest(table, nodeId)reads the highest-iteration output;untilmust usectx.outputMaybe()since output is absent on iter 0.- Direct nesting of
<Loop>in<Loop>throws; wrap the inner loop in<Sequence>. - Custom Drizzle tables for loop tasks require
iterationin the primary key. Ralphis still exported as a deprecated alias ofLoopfor older workflows. New code should import and renderLoop.