Sessions live in the store: started, listed, read, patched and messaged through the API, their runs claimed at once outside a runner's capacity #204
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/3905-s1-sessions-in-the-store-a-session-its-l"
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: #3905
Step S1 of the Sessions plan (#3893).
What it delivers
session(in one project or in Global, its title, model, effort, permission mode, runner, branch, pin, archive and revision), itssession_legs (one harness conversation each, with the harness's conversation id) and itssession_turns (one message of Agra's each, the run that takes it and how it ended).run_requestandstreamare rebuilt so each belongs to a task or to a session, and a session's run serves one of its legs; a stream's harness conversation moves toconversation_id, still answered as the stream'ssession_id.POST /api/sessionsanswers201with the session, its first turn and the run it queued;GET /api/sessionspages them, the latest active first, under?project=,?global,?q=,?pinnedand?archived;GET /api/sessions/:idreads one with its legs, runs and turns;PATCH /api/sessions/:idsetstitle,pinned,archivedandpermissionunderIf-Match;POST /api/sessions/:id/messagesmakes the next turn, keyed like an inbox message;POST /api/sessions/:id/streamsopens a session's run's stream.session/<id>-<slug>or the branch it is given; one in Global works in no checkout.session, takes no place in the claim order, and is offered at once, withsession_idand no task, priority or place, to the runner the session names or to each connected runner that meets its project. The runner claims it as soon as it is offered, with every place of its capacity taken, and it takes none;holdingdoes not count it. Its claim starts the session's next leg on the harness it resolved.task_idnull; its run names the session. The runner opens it atPOST /api/sessions/:id/streams; a session's run is given noSAK_REPORT, and one in Global no gate cache.GET /api/runsandGET /api/streamskeep to the tasks' runs and streams, so nothing the web reads changes. A stream that names a run is opened on that run's own task or session: a task's stream naming a session's run, or another task's, answers400.Checks
tests/sessions.sx: the routes, their refusals, the offers on the runner channel (to the meeting runners, the named runner alone, every runner for Global), the claim beside a task's run withholdingunmoved, the stream on the session, turns into the inbox at once or at the run's start, the turns' ends and the move of an untaken turn to a new run, the list's filters and order, the patch underIf-Match, and a Global session's memory.tests/runner_priority.sx: a session's ticket starts with every place of the runner taken while a run of the claim order waits, and one going takes none of the capacity.tests/runner_core.sx: on a runner of capacity one running a step, a session's run is claimed and run to its end beside it on the stub harness; its stream reads no task and carries the conversation its leg takes.tests/deployed_upgrade.sx: the deployed release's database migrates, each stream's harness conversation moving toconversation_id. The schema tests that take a fresh database back to an older version first take it back to 57 (tests/support/schema.sx).The review's regression:
tests/sessions.sxchecks thatPOST /api/tasks/:id/streamsnaming a session's run answers400("a task's stream names no run of a session"). Before the fix, ona689be0d's store, the check fails: the open answers201with a stream on the task recording the session's run, the session's own open then answers200with that stream, and the run's start answers400, soSESSIONS FAIL (10 checks). After it, atb20b2270,SESSIONS OK.No bug QA reported is fixed here. It changes no screen, so it adds and changes no golden under
web/e2e.Gates at the head
sak-gate full, gate run 1, atb20b2270: passed (73 sx tests, the release check andtests/step9_release.sx, the deploy contract, and both Playwright configs, 799 passed with 1 skipped, and 10 passed).