Repository navigation
[REA-6854] Report each finished step to the runtime with complete_step() - #234
Merged
Merged
Conversation
Contributor
Author
This was referenced Oct 3, 2026
Dere-Wah
force-pushed
the
dere/rea-6854-report-completed-steps
branch
from
October 3, 2026 19:54
9af1f4c to
9faa1ed
Compare
This was referenced Oct 3, 2026
tempusfrangit
approved these changes
Oct 3, 2026
tempusfrangit
left a comment
Contributor
There was a problem hiding this comment.
Reviewed step reporting through the bridge and the default-loop coverage for refused, empty, recovered, and failed steps. The reporting contract looks sound.
Dere-Wah
force-pushed
the
dere/rea-6854-apply-the-starting-input
branch
from
October 4, 2026 16:39
3061225 to
2bb381b
Compare
Dere-Wah
force-pushed
the
dere/rea-6854-report-completed-steps
branch
2 times, most recently
from
October 4, 2026 18:28
2b9b4f5 to
dc34d85
Compare
Dere-Wah
force-pushed
the
dere/rea-6854-apply-the-starting-input
branch
from
October 4, 2026 23:47
0f92c35 to
63884e1
Compare
Dere-Wah
force-pushed
the
dere/rea-6854-report-completed-steps
branch
from
October 4, 2026 23:47
dc34d85 to
c52f4ed
Compare
ggoldens
approved these changes
Oct 5, 2026
Dere-Wah
force-pushed
the
dere/rea-6854-report-completed-steps
branch
from
October 5, 2026 17:58
c52f4ed to
91cdf36
Compare
Contributor
Author
Dere-Wah
changed the base branch from
dere/rea-6854-apply-the-starting-input
to
graphite-base/234
October 5, 2026 18:14
The runtime needs to know when a model finishes a unit of work, to count a session's steps and later to save each step's result. A model reports one with complete_step(StepCompleted(...)): the step's output, any extra files to keep with it, an error when it failed, and how long it took. The default step loop reports every step that runs, after it emits the step's media, including a step that produced nothing and one whose error process_output() recovered from; a refused step or a crash reports nothing. process_output() writes the report itself by returning a StepCompleted instead of an Output: the loop emits its output and reports it as given. A model with its own run() calls complete_step() where it finishes a unit of work, such as a built clip. The generator-driven ReactorPipeline reports nothing. The report crosses into the runner as a neutral CompletedStep, with the output turned into a media bundle, through a step sink bound like the media sink. The runner numbers each step within its session and journals it as a step_completed fact with the step number, whether a step result follows (not yet: saving is off), and the error. Signed-off-by: Dere-Wah <derexcontact@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Dere-Wah
force-pushed
the
dere/rea-6854-report-completed-steps
branch
from
October 5, 2026 18:17
91cdf36 to
1eaa26a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why
The runtime has no idea when a model finishes a unit of work. It needs that to count a session's steps, which the next PR closes the session on, and later to keep each step's result. The default step loop knows where a step ends; a model with its own
run()knows where its unit of work ends, such as a built clip. Both need one way to say so.What Changed
A model reports a finished step with
complete_step():StepCompletedcarries the step's output, extra files to keep with it, an error when it failed, and how long it took. File names must be one plain name,result.jsonandoutput.mp4are reserved for the runtime, and contents must bebytes.complete_step()sits next tosend()onReactorCore.The default step loop reports every step that runs, after it emits the step's media. That includes a step that produced nothing (
output=None) and a step whose errorprocess_output()recovered from (reported without an error, since the application handled it). A refused step and a crash report nothing.ReactorPipeline's generator driver reports nothing.A
ReactorAppthat wants to write the report itself, to keep extra files with a step or to mark a step it recovered from, returns aStepCompletedfromprocess_output()instead of theOutput. The loop emits itsoutputand reports it as given, filling inelapsedwith the measuredgenerate()time when it is unset:Calling
complete_step()from insideprocess_output()would report the step twice, so the return value is the one way to replace the loop's report.The report crosses the bridge as a neutral
CompletedStep, with the output turned into a media bundle, through a step sink bound beside the media sink, so the runner never sees a model class. The runner numbers each step within its session and journals a newstep_completedfact,{"step": 1, "saved": false, "error": null}.savedstaysfalseuntil step results land. The event-vocabulary tests that pin the journal event list gain it on purpose.