Commit Graph
481 Commits
Author SHA1 Message Date
jschoubben 089d98b406 node-tools: a stopping tool runner answers the typed fault stopping (H-A-542)
A call the runner does not take once its stop began was answered nothing, so its
caller's wait ended in a bare "timeout" and a build step's publish failed (main.440).
It is now answered with error-kind stopping beside its words, on a tool's reply and
a seat proof's alike; the calling runner keeps that kind and hands it to its bundle
as the JSON-RPC error's data, so mesh-sdk's stdio tells it by its kind. A call cut
at the drain bound stays unanswered (H-A-369).

Builds: design 47 H2 H-A-542 (amends H-A-369)
2026-11-23 11:43:19 +01:00
mesh-tools f26ca923c9 Merge pull request 'node-tools: the runner creates the _tools twin from the membership's spec (design 47 H2 H-A-472)' (#89) from fix/tools-twin-membership into main 2026-11-22 20:05:02 +00:00
jschoubben ba82044cc0 node-tools: the runner makes its twin from the membership's spec, removes it when withdrawn
The grants part no longer composes the tool runner's `_tools` twin: at a child's
first subscribe the runner creates or updates `<node>_<module>_tools` on EVENTS and
on every heard stream from the spec the membership's entry carries (filters, ack
wait, max deliver, max ack pending, deliver policy), and binds by name an entry an
older grants part wrote without one. When the grants part withdraws the module's
membership on this node, the runner removes the twins from the streams the last
entry named and makes none again until a membership is issued; it removes nothing
at its start. The heard entry is mesh-sdk's type, so the hearing keys its loops by
stream and consumer.

Builds: design 47 H2 H-A-472 (fifth, sixth, seventh, eighth and ninth addenda)
2026-11-22 19:35:08 +01:00
mesh-tools 51a24ea801 Merge pull request 'Design 47 H2: the tool runner drains at stop, pages by cursor and reads a seat's waiting asks' (#88) from feat/47-H2 into main 2026-11-22 04:56:14 +00:00
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
mesh-tools d602f731ee Merge pull request 'The tool runner's bus tests wait on the bus's events, not on process state or time (H-A-363)' (#87) from fix/47-H1-node-tools-bus-tests into main 2026-11-21 23:24:09 +00:00
jschoubben 4f265fe884 Tool runner tests: Until's bound is 30 s, for every package that waits on the bus
The bus package waited within Until's fixed 5 s eighteen more times, the kind
the per-node test's fix names; raised in its one place, Until in meshtest,
which runtime, console, firstview and provide wait with too. The bound only
ends a wait that never hears what it waits for.

Builds: design 47 H H-A-363 (fix-a-bug-met-twice: a fixed bound a loaded machine overruns)
2026-11-22 00:18:42 +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 0e03495757 Tool runner bus: the per-node state test waits on the watch, not a 5 s poll
Under load TestAPerNodeStateIsServedAcrossEveryNodesBucket failed 2 of 30: a
bucket made during the watch is taken in on the bus's creation advisory, which a
loaded machine delivers after mt.Until's fixed five seconds. The test now waits
as the watch hands each change over, bounded only for a watch that never hears.

Builds: design 47 H H-A-363 (fix-a-bug-met-twice: a fixed bound a loaded machine overruns)
2026-11-22 00:03:42 +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 537e44eff6 Tool runner bus: long-lived loops read their settings once, as they start
A hearing's loops, SeatTake's heartbeat and followGrants' retry loop outlive the
call that started them and read the package's settings on every turn; a test
that sets a setting back as it ends then raced the loop (the race detector:
streams_test.go:232's cleanup write of RebindEvery against the rebind loop's
read, in TestAConsumerNamedBeforeItExistsIsBoundOnceItDoes at -count=30). Each
loop now takes RebindEvery, NakDelay, EventHeartbeat, WorkHeartbeat,
GrantsRetry, GrantsRetryMost, GrantsPatience and StateTimeout once, as consumes
already took IdleHeartbeat and its tick hook.

Builds: design 47 H H-A-363 (fix-a-bug-met-twice: a goroutine outliving its settings)
2026-11-21 23:40:18 +01:00
jschoubben a75d86236b Tool runner bus: pulled workers belong to their connection; two tests wait for what they assert
A worker bound for a pull was kept for the process, so a later connection's pull
used a worker bound on a closed connection and answered "connection closed"
(every run of TestAHolderPullsOneMessageWhenItHasRoom after the first). The
bound workers and the pulled messages are now the Conn's.

The two tests that failed main.165 and main.115 asserted on bus figures before
the bus had delivered them: the worker's pending count right after a publish, a
no-wait pull right after a publish, a callback counter read when a flush
returned, a 300 ms delay and a 2 s ack wait a loaded machine overruns. They now
count binds on a channel the watcher's reader fills, pull with a wait that ends
at the delivery, prove "nothing fetched ahead" by the second message's first
delivery, and use bounds a loaded machine stays within.

Builds: design 47 H H-A-363 (fix-a-bug-met-twice; whole-module tests under load, H-A-327)
2026-11-21 23:39:25 +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
mesh-tools 02675a43ea Merge pull request 'Design 47 H1: proof 2, the tool runner delivered by its pipeline' (#86) from probe/47-H1-proof2-node-tools into main 2026-11-21 18:13:48 +00:00
jschoubben e70de721dc Give the tool runner a pipeline of its own (design 47 H1, proof 2) 2026-11-21 19:13:39 +01:00
mesh-tools d064bb75cd Merge pull request 'Design 47 H1, proof 2: one comment in the tool runner, delivered with the SDK in one merge call' (#83) from proof/47-H1-tools into main 2026-11-21 11:27:08 +00:00
mesh-tools ee143c9f91 Merge pull request 'Design 47 H1: the tool runner binds a state once per process (H-A-251)' (#85) from fix/47-H1-tools-bind-once into main 2026-11-21 11:01:54 +00:00
jschoubben 05d8f6b762 H-A-251: bind a state's bucket once for the process, not before every read
The runtime asked the bucket's stream info before every get, put, delete and
listing, so each state read was two answers on the bus (a third of the night's
flood came this way, ten thousand reads per sweep). A Conn is one account's
connection; it now keeps one binding per bucket, shared by concurrent askers,
and binds again once when the bus says the bucket is gone.

Builds: design 47 H H-A-251
2026-11-21 11:55:35 +01:00
mesh-tools fe707779e3 Merge pull request 'Design 47 H1: an object store's fill is the stream's own figures, never a listing (H-A-227)' (#84) from fix/47-H1-tools-fill-figures into main 2026-11-21 01:12:17 +00:00
jschoubben 3eef0254df H-A-227: answer an object store's fill from its stream's own figures
The fill was a listing of every description in the store, deleted chunks'
leftovers included; a receiver reading it per chunk made one connection read
about 14 MB/s. The fill is now one stream info request: its bytes, its cap,
and its live subjects as the count.

Builds: design 47 H H-A-227
2026-11-21 01:59:38 +01:00
jschoubben 39c2604926 Design 47 H1, proof 2: mark the importer side of the two-module change
The bus package's doc names the proof, so node-tools rebuilds against the SDK version the same merge call publishes; go.mod keeps mesh-sdk at the zero version.

Builds: design 47 H §5 step 7, G §370
2026-11-21 01:46:34 +01:00
mesh-tools 07f5aa11c3 Merge pull request 'Design 47 H1: the tool runner claims each durable it pulls through the SDK's guard (H-A-197)' (#82) from fix/47-H1-runner-pull-once into main 2026-11-20 23:53:13 +00:00
jschoubben 876adfbf05 H-A-197: the runner pulls through the SDK's ConsumeOnce, keeping no copy
Review round 1 (P7): the runner's bind copied the SDK's claim wrapper and its
caller lookup. It now calls process.ConsumeOnce, which claims, pulls and
releases (at a stop, or once a drain or the bus ended the loop, before its
Closed is closed), naming the claim for the module whose hearing it is.

Builds: design 47 H H-A-197, H-A-196
2026-11-20 22:20:07 +01:00
jschoubben c952386737 H-A-197: the tool runner claims each durable it pulls through the SDK's guard
A tool runner built before H-A-132/133 ran two pull loops on the indexer
bundle's one durable, each event reached one loop only, and nothing said so;
the SDK's guard (H-A-196) could not see it, since the runner bound through the
bus client directly. hearing.bind now claims each durable with
process.PullOnce, naming the runner's hearing and the part that asked it, and
releases the claim as the loop is stopped or drained, or as the bus ends it,
so a re-serve (which stops its old loop first) binds again without a refusal.
The heartbeat test's second consume pulled the same durable: it gets its own.

Builds: design 47 H H-A-197, H-A-196
2026-11-20 22:12:45 +01:00
mesh-tools d76d9e0b1a Merge pull request 'Design 47 H1: the tool runner re-serves a membership without dropping a call; its integration level fits its bound (H-A-158, H-A-160)' (#80) from fix/47-H1-node-tools-integration-bound into main 2026-11-20 16:49:43 +00:00
jschoubben 8ee4fdfb8e H1 integration bound: a reload's stand-in serves no repairs; stop waits its Say
Review round 1. A ledger binding heard while a module was loaded again
made refreshRepairs serve the repairs on the reload's stand-in, whose
subscriptions nobody stopped: the repairs were served twice, and still
answered after the runtime stopped. The stand-in is now marked as
reloading and the refresh leaves it alone; the reload serves the module's
repairs as its binding is when the load ends. The reload test holds a
bundle's start, issues the binding inside the reload, and asks a repair
after the runtime stopped: without the change it still answered (6 of 6
runs, GOMAXPROCS=1 and 24).

No test failed without keep's stop waiting for the heartbeat's goroutine.
The heartbeat test now holds one Say and stops meanwhile: stop must not
return before that Say has; without the wait it failed 50 of 50 runs at
GOMAXPROCS=1 and at 24.

Builds: design 47 H §774, H-A-160; principle 11
2026-11-20 17:45:50 +01:00
jschoubben 05deea5952 H1 integration bound: the repairs' refresh keeps the tools it still serves
When a module's ledger binding came or went, refreshRepairs stopped every
subscription of its tools and served them all again, so a call in that
gap was dropped the same way as on a membership (H-A-158). serve is now
the one routine that changes a module's subscriptions, by tool address:
it keeps those still named, subscribes the new, then stops those no
longer named; refreshRepairs and the first serve both go through it, so
no tool is served twice or not at all.

The ledger test's later binding now comes and goes ten times, and the
module's own tool must answer the first call after each, within the
tests' 2 s bound; it failed without the change at GOMAXPROCS=1 and 24.

Builds: design 47 H §774, H-A-158, H-A-160; principle 11
2026-11-20 17:28:34 +01:00
jschoubben 3850eb8eac H1 integration bound: the heartbeat and the counter tests hold under load
TestTheRuntimeSaysItIsThereEveryInterval slept 70 ms and wanted three
beats at 20 ms: a loaded machine that did not schedule the heartbeat in
time failed it (main.20's integration step on the build node); and its
stop returned before the heartbeat's goroutine ended, so a beat could be
said after it ("said after it was stopped"). The ticks are now the
caller's (keep, beside Keep's own ticker), the test drives them and waits
on each beat, and stop returns once nothing more is said. Pinned to one
processor at idle priority beside six busy loops, the old test failed 13
of 100 runs; the new passes 100 of 100.

TestTwoWritersIncrementingOneCounterOnTheBusLoseNoUpdate bounded a
writer's tries at 1000, a guess: on one processor the scheduler lets one
writer win every round and the other lost its 1000 tries every time. A
write is lost only to the other writer's write, so the bound is the
other's count plus one.

Builds: design 47 H §774; principle 11
2026-11-20 17:23:59 +01:00
jschoubben eb174d853f H1 integration bound: the runner follows a membership without dropping a call
On every membership of a module, HandleCalled stopped each subscription
of a tool and subscribed again on the same subjects; a call the bus
routed in that window was dropped by the client in silence, and its
caller waited the runner's whole bound (30 s). On the build node this
was the 30 s of TestAReplacedBundlesOldToolStaysGoneOnTheNextMembership
and of TestTheLedgerRepairsAreToolsOfEveryLedgerOwner, and most of the
integration level's 72 s. Now a membership keeps every subscription whose
subject and queue it still names, subscribes the new ones, and only then
stops those it no longer names (make before break).

The test asks the served tool once after each of five memberships, with
the tests' own call bound of 2 s (principle 11); it fails without the
change. The runtime tests' call helper and the ledger listing wait that
bound, not the runner's 30 s.

Builds: design 47 H §774, H-A-158; principle 11
2026-11-20 17:18:09 +01:00
mesh-tools b1d10dd67e Merge pull request 'The tool runner binds a module's consumer once and hands each event to the follower and the bundles (design 47 H, H-A-132, H-A-133)' (#79) from fix/47-H1-one-consumer-loop into main 2026-11-20 10:35:33 +00:00
jschoubben fb4fe282c7 H1 one consumer loop: serve's first views wiring in one tested function
Review round 1: no test failed when serve went back to firstview.Start.
startViews starts the follower and answers the options runtime.Run is
given; its test holds that on a module's own account the follower binds
nothing and the runtime is given the hearer, and on the machine's
account the follower binds its own.

Builds: design 47 H §752, H-A-113, H-A-132, H-A-133

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
2026-11-20 11:33:19 +01:00
jschoubben 13ff8041b8 H1 one consumer loop: the follower hears on the module's one consumer
In a module's own runtime the branch follower (first views) and the
bundles each bound the module's durable <node>_<module>_tools with a pull
loop of their own, so each event reached one of the two: the catalog
revision of main.1 reached the follower and never the indexer's bundle,
whose revision verb answered none-yet. The runtime now binds the consumer
once, for the bundles, and hands each event to the follower after the
bundles took it (runtime.WithHearer); the machine's runtime keeps the
follower's own binding.

Builds: design 47 H §752, H-A-113, H-A-132

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
2026-11-20 11:26:31 +01:00
mesh-tools f92ec7d24f Merge pull request 'Design 47 H1: the tool runner hears every event and serves every seat's verbs' (#78) from feat/47-H1-tool-runner into main 2026-11-20 07:13:07 +00:00
jschoubben 8a534ba436 T2b first-view tool by name form: the gate env test names no MESH_VIEW_CALLERS word
The runner sets no MESH_VIEW_CALLERS env; the gate knows a first-view tool by its name forms (mesh-sdk 77a7b187).

Builds: design 47 H §752, H-A-69

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
2026-11-20 02:47:04 +01:00
jschoubben d9fe2568de T3 whole: the tool runner is started by its entry against an embedded bus
main's body is `serve(ctx)`, which the process calls with the service manager's signals and one integration test calls with a
credential file and the node-engine's environment: it serves a bundle's tool and seat verbs over a seat list read from a stand-in of
the seat mesh-catalog, waits a verb its definition's timeout, and rereads the list for a verb the first read does not name.

Builds: design 47 H §774, §760, H-A-16, H-A-61

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
2026-11-20 02:44:40 +01:00
jschoubben 81663a4d9e T5 checker-name-gone: the state-watch tests use a state of a module that stays
The fixture state mesh-delivery-checker.owed, which the retiring checker keeps, is the assigner's `pins`: the three tests of the
file assert the same of a state watched by a module that is granted it.

Builds: design 47 H §764 (The checker), H-A-61

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
2026-11-20 02:38:55 +01:00
jschoubben a118559515 T4 no-held-back: the approval gate's table no longer holds a row for an ask held back by a count
The row of an ask the router holds back as the fourth open one goes, and the router's refusal row names another refusal: the
operator channel keeps no limit on open asks, and its record no state `held-back` (mesh-sdk, mesh-contracts).

Builds: design 47 H §764 (The operator channel's limit), H-A-57

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
2026-11-20 02:38:31 +01:00
jschoubben f2a05fb440 T2 no-callers-hook: the runner admits every caller by serving, with no hook that judges who may call
The `admitted` hook, its parameter of serveSeats and its comments go; the test rows that built definitions with Callers and Class
go with the field mesh-sdk removes. A seat's verb is answered for every caller.

Builds: design 47 H §752, §764 (Every seat contract), H-A-41

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
2026-11-20 02:38:21 +01:00