Design 47 H2: the tool runner drains at stop, pages by cursor and reads a seat's waiting asks #88

Merged
mesh-tools merged 16 commits from feat/47-H2 into main 2026-11-22 04:56:15 +00:00
16 Commits
Author SHA1 Message Date
jschoubben c90ff7d9c0 R1-4: the module's unit tests end at 159, within the budget
The drain's rows join the stopping runtime's table, the settings reader joins the start's cases, and
the pull through a bundle's channel joins the take through it: 162 test functions become 159, every
case kept (review round 1, finding 4).

Builds: design 47 H2 §819
2026-11-22 02:21:43 +01:00
jschoubben cab76319b8 R1-1: a page hands a kept delete, so a deleted key never comes back alive
The page watch ignored delete markers, so a reader following pages of a bucket with history kept
a deleted key's last value. A kept delete (a purge reads as one) is now an entry deleted: true with
no value at its sequence, seen-again like any message (review round 1, finding 1, state.go:375).

Builds: design 47 H2 §779, H-A-451 (1), H-A-382 (2)
2026-11-22 02:19:43 +01:00
jschoubben 026fb780d6 R1-3: the waiting read names a seat's stream by mesh-sdk's one derivation
seatStream derived the stream name itself and kept '.' where buscompose.SeatQueueStreamName
writes '_'; QueueWaitingOf now calls buscompose (review round 1, finding 3, queue.go:34).

Builds: design 47 H2 §777, H-A-410, P9
2026-11-22 02:18:31 +01:00
jschoubben e8579359b6 R1-2: a seat proof after the stop or cut at the bound is answered nothing
SeatAnswer answered the drain's unanswered error as {"error": "answered nothing"}; it now sends no
reply, as answerCalledOn does, so the caller's kept call meets the next runner (review round 1,
finding 2, seat.go:222).

Builds: design 47 H2 §813 (12), H-A-369
2026-11-22 02:17:39 +01:00
jschoubben a6a16c897b T4: a waiting read lists an ask handed out and not acknowledged, marked again
mesh/queue.waiting reads from each worker's acknowledgement floor, so an ask a worker holds or
handed back is listed with again: true; the holder tells the two apart by its own state taken.

Builds: design 47 H2 §777, H-A-410 (second addendum)
2026-11-22 01:01:59 +01:00
jschoubben 917195a302 T4: the runtime answers mesh/queue.waiting, a holder's own queue read without consuming
mesh/queue.waiting {seat} answers {asks: [{id, module, age_seconds}], capped}: for each worker the
holder's membership lists on the seat's stream, every message after the worker's delivered
sequence, read by a direct get by subject, never consumed; at most 768 KB; refused for a seat the
module holds no queue of (ADR 0596: a holder reads its own store).

Builds: design 47 H2 §777, H-A-410
2026-11-22 00:58:23 +01:00
jschoubben bebf2538db Merge remote-tracking branch 'origin/main' into feat/47-H2 2026-11-22 00:36:28 +01:00
jschoubben b8a30b2bc7 Mark the runner's three duration settings read at its runtime
drain-bound, kept-call-pace-first and kept-call-pace-max are placed in no file: the process reads
them from MESH_CONFIG_<KEY>, so each is marked "runtime": true, which the manifest validator asks.

Builds: design 47 H2 §775, §813 (12), H-A-370
2026-11-22 00:36:28 +01:00
jschoubben ec3fe34afc DMC-14: a state put answers its bucket's fill beside its revision
mesh/state.put answers {"revision", "fill": {"count", "bytes", "max_bytes"}}, buscalls.Fill's
form, read from the bound stream's info once per put, since the key-value put answers no figures;
a bundle's prune reads it from the put.

Builds: design 47 H2 DMC-14, H-A-350, H-A-386
2026-11-22 00:12:23 +01:00
jschoubben a1c12af8b2 T1 page by cursor: a state page continues from an opaque cursor in sequence order
mesh/state.page reads a state from an ordered watch starting after the cursor's sequence, never a
replay of the bucket per page: each kept message once across the pages of a read, a key's older
kept revisions included, at most 768 KB a page, next the opaque cursor, empty at the end. A value
written after the read reached its bucket comes marked seen-again (the cursor carries that mark;
the runner keeps nothing per read); a deleted key gets no entry. A state kept one bucket per node is
read one node's bucket after another.

Builds: design 47 H2 §779, H-A-254, H-A-382
2026-11-22 00:10:01 +01:00
jschoubben 0c7000fa93 Declare the runner's drain bound and kept-call pace settings, read at its start
node-tools declares drain-bound (30s), kept-call-pace-first (1s) and kept-call-pace-max (30s) as
duration settings; the runner reads the pace through the SDK at its start, as it reads its drain
bound, and stops before it serves on a value that is no duration.

Builds: design 47 H2 §775, §813 (12), §781, H-A-370, H-A-377
2026-11-22 00:01:45 +01:00
jschoubben 5cca1fceba Read drain-bound through the one settings reader, a duration text, 30 s by default
The runner reads its setting drain-bound as the node-engine composes it (MESH_CONFIG_DRAIN_BOUND)
with the SDK's duration reader, and stops before it serves on a value that is no duration.

Builds: design 47 H2 §813 (12), §781, H-A-369, H-A-370, H-A-377
2026-11-21 23:58:54 +01:00
jschoubben 858beb2b63 T2 amendment: a call after the stop began is answered nothing, never refused
A refusal would end the caller's kept call; left unanswered, the kept call paces and meets the new
runner. The ask made once the drain began ends Unanswered, so the bus sends its caller nothing.

Builds: design 47 H2 §813 (12), H-A-369
2026-11-21 23:57:07 +01:00
jschoubben 07ebeae74d mesh_wait knows every seat of the seat list by the events it declares
A wait by seat and event name was refused for a seat the catalog half's own definitions do not
name (the runner's mesh-pipeline-runner.pipeline-ended, defined in the delivery repository's
contracts module), though the seat list declares the event under the seat's events family. Every
seat of the seat list is now an emitter by its declared events.

Builds: design 47 H2 §821, H-A-343
2026-11-21 23:17:58 +01:00
jschoubben 2365e41811 Copy the kept call's ask id from its request header into the call's _meta as mesh/ask
Every tool call and seat verb the tool runner serves hands the bundle the ask id the kept call set
in the header x-ask (stdio.AskHeader) under _meta mesh/ask (stdio.MetaAsk), beside mesh/call; a call
whose header carries none names none.

Builds: design 47 H2 §775, H-A-351
2026-11-21 23:14:53 +01:00
jschoubben f7269d9812 T2 drain at stop: finish the calls in flight within the drain bound, cut and say past it
Once told to stop, the tool runner makes no new ask of a bundle (a call after the stop is refused),
waits for the asks in flight within the drain bound (30 s by default), cuts each still in flight at
the bound with a journal line naming the bundle, the verb and the call's age, leaves its caller
unanswered (a transport fault), and only then stops its bundles itself.

Builds: design 47 H2 §813 (12), H-A-342 (2), H-A-353
2026-11-21 23:11:38 +01:00