Repository navigation
feat(spec-driven): make the model an edit run changed available to the editor (#845) - #875
Merged
Merged
Conversation
The run card named a step only during validation; while the agent planned and worked it showed "Working..." and the last file touched, so a user could not tell editing from writing and running its own scripts. Planning now sends a step, and each Phase 2 turn sends one built from its tool calls: reading the code, editing a named file (with the checklist item that names it), running the app's checks, testing it through its API, running a command the agent wrote. No sentence quotes the model's text. A step stays at least two seconds before the next replaces it. The steps are the existing `step` event on the `gap` and `customize` rows.
The agent works through a checklist (the task_list tool), but the editor only saw it as the planner's text behind a chevron and never learned which items were done, blocked or dropped. A new `checklist` stream event carries the whole checklist, each item with its id, text and state (open, done, blocked, dropped), when planning seeds it, after each Phase 2 turn that changed it, and after a validation round that settled items from the code. It is sent only when the list changed. Older editors ignore the event.
A user who saw a run keep working after the asked change was done could
only cancel it, and a cancelled run is neither checked nor packaged as a
finished result.
POST /spec-driven/finish/{run_id} sets a flag the Phase 2 loop reads at its
next turn boundary; Phase 2 then hands off to Phase 3 through the same path
as the edit handoff, with its own stop detail, so the result is still
validated and packaged. It works for create and edit runs and changes
nothing once validation has started. The run record says "finished early
at the user's request" and lists the checklist items left not done, as
does BESSER_GENERATION.md; the done event carries `finishedEarly`. The
config advertises the endpoint as `features.finish_now_enabled`.
… now
The run section says what the run card shows in every phase and how
"Finish now" ends a run: Phase 2 hands off at its next turn, Phase 3 still
checks and packages the result, and the record and BESSER_GENERATION.md say
the run finished early at the user's request with the items not done. The
API reference lists POST /spec-driven/finish/{run_id}, the
`finish_now_enabled` feature flag, the `step` event in every phase, the new
`checklist` event and the done event's `finishedEarly`.
With auto-fix on, Phase 3 sent an open checklist item whose deterministic check fails (an action-contract item) to a repair turn as a "task incomplete" blocker, so the run went on implementing work after the user had asked it to finish. After a Finish now handoff Phase 3 now checks and packages only: its findings are recorded and reported, and the fix loop does not start. FINISH_NOW_DETAIL moves to pipeline/constants.py so the Phase 3 mixin can read it; the orchestrator still exports it.
An edit run that adds to the data model updates the project model on the
server, but the editor only received it through a GitHub push, so a user who
downloaded the result kept a diagram without the new classes and their next
run started from it.
The run now keeps that model with its download (same lifetime), and its done
event carries `updatedModel` ({url, changes}) when model sync changed the
model: where to fetch it and what it adds. GET
/spec-driven/download/{run_id}/model returns {run_id, project_export}, the
export the push writes. Both read the copy kept on disk, so a process that
did not run the edit serves them too; this also makes a push served by the
backend write the run's synced model instead of the request's.
The API page lists GET /spec-driven/download/{run_id}/model and the done
event's updatedModel field; the model sync section says where the synced
model is kept and how the editor gets it.
A run's synced model is the generation request's project, Agent diagram
configuration included. It was written in plain text next to the run's
download and returned as is by GET /spec-driven/download/{run_id}/model,
so an LLM key or bot token in an agent's config reached anyone holding the
run id, while the zip's and the repository's model files redact them.
The kept copy and every read of the run's model now go through the same
credential redaction as the repository's model files.
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.
Backend half of issue #845: after an edit run changed the data model, the editor can offer that change on the canvas. Companion: the editor pull request on the branch
feat/offer-run-model. Stacked on #869, #871, #872 and #873.GET /spec-driven/download/{run_id}/model. The done event says one is available and lists what it adds (updatedModel). A run that changed no model, and a create run, expose nothing.7,952 Spec-Driven and backend tests pass locally (the two known macOS failures aside);
ruffclean.The
openapiCI job fails until the editor half is merged and the submodule pointer moves. No real run was made.