A wait names its actions, and a proposal is taken as what it names #158
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/3728-a-wait-names-its-actions-and-a-proposal"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tracker: #3728
Step 8 of plan #3694. It fixes the store and API half of #3688. An action a Proposer proposes is taken as that action, not fed to the step as an answer, and the Orchestrator can propose a stop without naming a node that does not exist.
What it delivers
needs_youcarriesactions, the routes its wait takes:answerwhile it waits about a step,more_runsatrun_limit, thenproposeandstop.{"action":"answer","answer":…,"proposal":…},{"action":"stop","proposal":…}, or, atrun_limit,{"action":"more_runs","runs":…,"proposal":…}. A report naming an action the wait does not take, or lacking what its action takes, records no proposal.needs_you.proposalreads{run_id, action, text, answer, runs}. The history'sproposalevent carriesaction,proposal,answerandruns. Migration 49 adds the flow run'sproposal_action,proposal_answerandproposal_runs, and upgrades each stored proposal, on a flow run and on its history, to actionanswerwith its text as the answer.POST /api/flow-runs/:id/take {"run_id":…}takes the waiting proposal of that Proposer run as what it names, in one transaction:answeras/answerwith its answer,stopas/stop,more_runsas/more-runswith itsruns. It answers what that route answers. A flow run whose proposal is another run's, or that has none, answers409 {"error":"proposal_changed"}.{"stop":"<why>"}. sak records thedecision(withstop,nextnull) and waits on Agra with causestop_proposed, the why as its question, its actionsanswer,proposeandstop. sak does not end the flow run itself. Anextnaming no node of the flow still waitsunknown_next.answerstays a step's input: no route reads an action out of an answer's text.docs/api.mdFlow runs describes all of it. Every schema-head assert moves to 49, and the roll-backs to 40 (tests/tools.sx) and 44 (tests/utf8_text.sx) drop the three new columns.web/e2e/work-the-flows.spec.ts: the stub Proposer's report in "Ask an agent to propose…" names actionanswer, with the same text. Theneeds-you-proposalgolden is unchanged.The Needs you card is step 9 (#3729). Until then it shows the proposal's text and fills it in through "Answer with it", as before.
Regressions
Each was written before the fix, and run at the step's base
1144f367(test files only, from agit archivearm) and at the head.tests/runner_core.sx(check_needs_you, and the newcheck_proposals). At the base:RUNNER CORE FAIL (15 checks), 467 ok:At the head:
RUNNER CORE OK, 482 ok.tests/flows.sx(check_proposal_upgrade, a db taken back to 48 with a stored proposal). At the base:FAIL a v48 database whose flow run waits with a proposal is built,FLOWS FAIL (1 checks), as the base has no proposal columns to take back. At the head:FLOWS OK.Flow run 27 at the base, from a probe added to the base arm only. A Proposer at
run_limitreports{"action":"more_runs","runs":10,…}. The base recordsneeds_you.proposalas{"run_id":127,"text":"Allow ten more runs."}. The only way to take it,answerwith that text, runs the step with## Answer\n\nAllow ten more runs.in its prompt, records nomore_runs, and the step chosen again waits atrun_limitonce more. All four probe checks held.Gates
At the head
aa7e2cb5:fast: gate run 539 (the run's gate #1), passed.full: gate run 542 (the run's gate #2), passed: everytests/*.sxfile, release.sh and step9, the deploy contract, the main Playwright config (764 passed, 1 skipped) and the runner config (10 passed).Golden set: none. Nothing under
web/e2echanges but the one stub report above.An Orchestrator that finds the flow should end, with no node to end it, reports {"stop": "<why>"}. sak records the decision and waits on Agra with cause stop_proposed, the why as its question; Agra stops the flow run or answers its step. A next naming no node still waits unknown_next.