Allow refine from ready, returning through triage - #119
Merged
Conversation
Refine was refused on anything but a `proposed` task, so tasks triaged before refine landed were stuck: the only way to have an agent rewrite their body was a manual `voro set --body-file`. `ready → refining` is now a legal transition for both intensities. The conclude transition is untouched — a round lands on `proposed` however it began and keeps no memory of its origin, so a task refined out of `ready` comes back through triage: its verdict was issued against a body that no longer exists. `parked` stays excluded. Everything hanging off the `refining` state needed no change, which was the point of making it a state: the markers, the session row, reconcile of dead rounds, and scoring all read the state rather than the origin. The dispatch race is closed the same way triage's was — the scheduler's candidate query does not list `refining`, so a refining task drops out of `voro next` and out of every window's ready rows at once.
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.
Refine now fires from
readyas well asproposed, so a task triaged before refine existed can have its body agent-rewritten instead of hand-edited throughvoro set --body-file.What changed
voro-core/src/transition.rs: the transition arm widens to(Proposed | Ready, Action::Refine(_)) => Refining, for both intensities (the note-driven and interactive flavours are one action carrying different notes).legal_actionsstill withholds refine — it collects verdicts, and refine is not one — so only theapplymatch and the test matrix moved.refining → proposed, always. A round keeps no memory of its origin, so a task refined out ofreadydeliberately returns through triage — thereadyverdict was passed on a body that no longer exists, so the rewrite earns a fresh verdict. Norefining → readyarm, no origin state.parkedstays excluded.voro/src/dispatch.rs:guard_refinable— the early refusal both flavours share — acceptsReady; the message becomes "only a proposed or ready task can be refined".voro/src/app.rs:is_proposedbecomesis_refinable(proposed or ready), andrefine_selected's shared guard follows, refusing with "task is {state} — refine works on a proposal or a ready task".voro/src/ui.rs: ther/R refinekey-line slot is advertised on a selectedreadyrow on both the cockpit and the task browser; the?key map's uppercase gloss rewords to "refine a brief". The cockpit line stays within its ten slots on a ready row (⏎, d/D, r/R, s, !, n/N, e, ?, tab, q).voro/src/cli.rs:voro triage <id> refineis unchanged apart from the widened guard — no new verb — and the--helptransitions entry and the handler doc say so.docs/DESIGN.md: §6's state table (readygains the refine transition; therefiningrow's "entered from" and "leaves by" prose), a new paragraph of rationale after the refine-is-a-state argument, and the §6 sentences that said refine is refused on anything but a proposal.Nothing else needed code changes, which was verified rather than assumed: the
↻ refined/⚠ refine failedmarkers, the session row, reconcile of dead refine rounds, and scoring all hang off therefiningstate and theproposedlanding, not the origin.Tests
voro-coregains atransition::tests::refinemodule: a ready task refines in either flavour and opens its session row in the same write; every round concludes toproposedwhatever it started from, across all threeRefineOutcomes; refine is refused from every other state includingparked,running,review,needs-input,waiting,stalledand the closed pair; and a refining task drops out ofcandidates()/focus(), which is the dispatch race closed by construction. Two existing "refused from the wrong state" tests move their fixture fromreadytoparked, andvoro's dispatch tests gain a ready-task refine round-trip.app.rsgains a positiver-on-a-ready-row test beside the reworked refusal test.Verified
cargo test --workspace(619 tests) andcargo clippy --workspace --all-targets -- -D warningspass;cargo fmt --all --checkclean.Driven end-to-end in the TUI against a scratch database with a stub agent: on a selected
readyrow the key line advertisesr/R refine;ropens the "Refine note — what needs fixing" prompt; submitting it moves the task off the queue onto the running strip as⟳ refining(headerrefining 1 ready 1); when the stub'svoro set --bodylands, the task returns as a proposal marked↻ refined—↻ 1 refinedon the folded digest,↻ refinedon the row — with the rewritten body and arefinedevent carrying the note.voro triage 2 refine --note "…"accepts areadyid from the CLI. While a round is in flightvoro nextreports "no ready tasks" andvoro dispatchrefuses with "only ready or stalled tasks can be dispatched; task 3 is refining"; on a parked task refine refuses with "only a proposed or ready task can be refined".Branch
refine-from-ready, one commit, not pushed.