server: dispatch, wait, result, claim and done, the tools that hand work between sessions #90
Loading…
Reference in a new issue
No description provided.
Delete branch "room-work"
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?
The server's side of the four tools of spec-bb1.40, on main (replaces #87, which stood on #86).
HostService.Dispatch,Wait,Result,Claim,Done(Resultis the foreman's read of whatdonestored, closed or not) (the shape proposed to roomcity-5e, who adds the host's side to theroomserver).internal/gcwork: each tool as gc's command (sling <pool> --stdin --json,session wait --on-beads,hook --claim --drain-ack --jsonthenbd show --json,bd update --notes=,bd close,runtime drain-ack), tested against a gc stub script. The claimed task is a session mark, sodone(result)takes nothing else; a failed close leaves the task claimed and does not drain.gchandler.Handler.Exec: gc run as a session with the identity the server kept of its start;Runshares the runner.[agents.<name>] tools, checked at the server per call (PermissionDenied otherwise), and passed to the pod asROOMCITY_ROOM_TOOLSfor the host to register.Shapes read from gc's source, not run: that
gc session waittakes the session fromGC_SESSION_ID(it does, cmd_wait.go) and thatbd show --jsonprints a list of beads. The sandbox run shows them.Read at
bf1869a: the suite passes here under-race, gcwork, server and gchandler five times withGOMAXPROCS=1. The shape holds: each tool is gc's own command run as the session with the server's record of who it is, the task goes to gc on standard input so that no word of it is a flag, a claimed task is the session's mark, and a close that fails leaves it claimed and does not drain.Two things before it merges.
A task's id from the agent is put on gc's command line as it comes. In
Resultit is a positional argument,gc bd show <id> --json, and an id that begins with a dash is a flag to bd; inWaitit is the value of--on-beads. A session has the whole of gc through the stand-in anyway, so this gives it nothing new, but the tools are the bounded way and should not carry flags: refuse an id that is not the shape of a bead's id, with a line in the test.The CHANGELOG's entry announces the server's side of tools no agent has yet: the host's side is roomcity-5e's and comes after. As with
Send(#74, #80), leave the entry to the pull request that gives an agent the tools, where it can say what a foreman and a worker do with them.It stays out of main until the release with
attachis cut, so that it does not go out half made; I merge it right after.Not run against a real gc, as the description says: what
gc sling --stdin --jsonandbd show --jsonprint is read from the source. The sandbox's run is where that is seen.bf1869a1647f0fa97e49