Design 47 H2: H-A-634 rewritten, the bus expires an ended record; H-A-638 withdraws H-A-636

The operator answered (2026-11-24 about 21:2x CET) that the gate's delivery
history is not kept beyond 90 days and is never archived. So an ended record
now goes 30 days after its end by the bus's lifetime per key, driven by the
ledger's own configuration (ended-days, ends-with), and its history by the
ledger's keeping days; the gate deletes nothing, and mesh/ledger.remove,
gate_records_delete and held/months go. The gate lists its records from a
watch of its own ledger instead of month lists.

H-A-636 gave a ledger's state its ledger's cap, against ADR 0595 §3's 64 MiB:
H-A-638 withdraws it and reverts its code.

H-A-635 to H-A-637 move into the fourth file, which holds every answer from
H-A-634 on, since the third passed its 60 KB bound.
This commit is contained in:
2026-11-24 21:50:57 +01:00
parent 501a6b3c7f
commit cf1eb715d1
2 changed files with 219 additions and 138 deletions
@@ -3,7 +3,7 @@ layer: to-be
status: in-progress
design: 47
milestone: H
updated: 2026-11-23
updated: 2026-11-24
decisions:
- "ADR 0593"
- "ADR 0686"
@@ -562,40 +562,3 @@ where the design and the code disagree; the lead's answers follow, each against
where a package path's Go module requires a module of its own repository at the zero version, resolved only through
that path's module file, and its listing names that module's imports; live, the next pipeline whose movers hold
mesh-delivery-contracts passes its build. Principles 3 and 7.
- **H-A-635 (a slow pass of the assigner says which phase it is in, 01:08)** 24 Nov, issue 1984; answers the stall met
2026-11-23 23:53:48 UTC: the assigner on one machine logged "the pass took" (H-A-259) every 20 s, then nothing for six
minutes at near-zero CPU while every validate and composition step of a 70-mover pipeline waited; a read of its locks
found no cycle, and no tool takes a stuck process's stacks, so where it stood is not known. The pass names the phase it
is in as each starts (the assignments seat, the kept graph, the wants, the pass said, the puts, the node wants, the
backups and reverts), in the passer's own memory; a pass still running after the assigner setting
`pass-stall-seconds` (10 to 600, default 60) says once in the journal "the pass started at <time> is in <phase> for
<duration>", and again at each further bound until it ends; the end line stays as H-A-259 has it (principle 3: a part
that waits says where; principle 11: the bound is a setting; principle 7: a journal line in the passer, no new key or
event, since no other part acts on it). How it is checked: a unit row where a phase blocks past a short bound and the
journal line names that phase, and none is said for a pass that ends within it. Principles 3, 7 and 11.
- **H-A-636 (a ledger's state and index buckets take the ledger's cap, 01:31)** 24 Nov; answers the condition "Kept data is
filling up" of the delivery gate's records (open since 2026-11-23 10:20 CET): the gate's ledger asks `max-mib` 1024,
which sizes its history and its snapshot, while the bus module plans the ledger's state bucket and each index bucket
with no option (mesh-catalog modules/nats internal/keeper/plan.go, the ledger case, `stateSettings(options{})`), so
each is the state default of 64 MiB whatever the module asks; the gate's state bucket is full since 2026-11-23 11:48
UTC, its operations kept in the history and the state behind (ADR 0597 §6). The ledger's state bucket and its index
buckets take the ledger's own `max-mib`, as its history and snapshot do, through the existing `stateSettings` cap;
no other option of the ledger reaches them (principle 11: no cap fixed in code; principle 7: the entry's one existing
option, no new one). A raised cap reaches a held bucket through the keeper's existing path for larger settings, in
place, and the state catches up by replay (ADR 0597 §5). In the bus module (mesh-catalog). How it is checked: a row of
the keeper's plan tests (a ledger with `max-mib` 1024 plans its state and index buckets at 1 GiB, one with none at the
default); live, `mesh-broker.show` of the gate's records names its state bucket at 1 GiB and the condition clears.
Principles 7 and 11.
- **H-A-637 (the pipeline runner's test-run test waits on what it causes, never on a clock across a restart, 01:59)** 24 Nov,
issue 1984; answers the failure of main.512 (mesh-delivery-pipeline's integration step on a loaded build node, "1 failed:
TestTestRunsAreAskedOncePerLevelAndMoveEveryReader", which the same commit passed in main.511): the test writes the
setting test-step-bound "2s", restarts the runner inside the test while that clock runs, and needs the restarted
runner to hear its first step-progress before the clock ends; under load it did not (testruns_integration_test.go:411,
60 s); two more waits of the same test fail under load (:357, the ask read once; :519, cause not known). The test
restarts the runner under a bound longer than the restart (the setting rewritten to the short bound between the stop
and the start), its start waits for the new runner's own take-in line, the ask is waited for as every other wait is,
a wait whose run has ended stops at once naming it, and :519's cause is read before it is changed (principle 3: a
check fails only for the change it checks, never for the machine's load; principle 7: the test's own waits, no new
seam). Test-only: no behaviour of the runner changes. How it is checked: the test passes 10 of 10 runs pinned to one
core under three busy loops, and fails at once when the runner's real behaviour it checks is taken out. Principles 3
and 7.
@@ -18,93 +18,138 @@ principle that settles it.
## The operator's answers, continued (2026-11-24 from 01:06 CET)
- **H-A-634 (the gate deletes an ended delivery record `record-retention` days after its end, at a record's open; an
open record never; the bus module's fill names its object, 01:24)** 24 Nov, the operator's answer of about 01:06 CET
in chat ("sure, i guess") to the lead's design question "may the gate delete ended delivery records older than a set
number of days (default 30)? Open records are never touched". It amends G §154 (90 days, counted from the opening, an
open record deleted too), G §155 (the estimate of the ledger's growth), G §159 and §160 (the tools and the check of
the retention), §812's and §820's "never" for the ledger `records`, and §809's "the ledger is never pruned", which
stands for §812's prune toward a cap and not for this deletion. A delivery record's fields, retention and tools are
the design's under ADR 0656 §7 (G §145), so the answer is a design line (playbook 02, *Answering a design question*,
item 1). The case, read 2026-11-24 about 00:20 UTC: the bus module's condition "Kept data is filling up" for the
gate's `records`, open since 2026-11-23 10:20, says "75% of its cap" and names no object; the bus module's
`nats_streams` reads the ledger's state bucket at 67,108,471 of its 67,108,864 bytes (16,869 keys, last written
2026-11-23 11:48:52 UTC), its history at 226,666,132 of 1,073,741,824 bytes (82,178 operations, 21,969 instances),
its snapshot at 121,436,920 bytes and both index buckets with no key; the seat `mesh-broker`'s `show` answers only
their sum (415,211,523 of 2,348,810,240 bytes); `gate_records` counts 978 records, 869 ended (840 of them at H1's
clean state on 2026-11-20) and 109 open, the oldest opened 2026-11-14 01:05 UTC, and answers its fill "unread": "the
runtime answers no mesh/ledger.fill from a bundle".
(1) **What is deleted, and from when.** The gate deletes a delivery record once it has ended and its end is older
than its setting `record-retention`: the head holds `ended` (G §147; the operation `end` of §810), and `ended`'s `at`
plus `record-retention` lies before the judgement's time. A record whose head holds no `ended` is open, and an open
record is never deleted, whatever its age (the operator's answer). A record H-A-609 (2) reopens reads open from its
reopening: the reopening applies the record's `end` with `ended` empty, so the head holds none until the gate's next
end writes it, and its age counts from that end; an end written again by a late `running` (H-A-597) moves the time
it counts from in the same way. Principle 3: a record a running pipeline still writes is never taken from it.
(2) **The setting.** `record-retention` keeps its name and form, a whole number of days in the gate's manifest
`config`, from 7 to 3650, default 30 (the operator's answer), read at each judgement, so a change through the seat
`mesh-config` holds from the next. The lower bound is 7 because `gate_times` (§810) answers the last seven days'
median and worst from the ended records' times, and a shorter retention would have it answer from fewer days than it
says (principles 3 and 11). Fate: G §154's 90 days and the gate's reader's range of 1 to 3650 end; the manifest's
description of the setting says "days a delivery record is kept after its end; an open record is kept whatever its
age".
(3) **What a deletion removes, and through what.** For each record it deletes, the gate removes through the tool
runner's `mesh/ledger.remove` (G §587: an instance's operations and its snapshot from the history by its subjects,
its key in the state bucket and its keys in every declared index), in this order: every mover instance
(`mover/<branch.source.module>`) the ledger's index `movers` names for the record and every act instance the index
`acts` names (ADR 0597 §4; the joins `gate_record` reads), then the head instance (`record/<milestone>`), then the
record's entry in the list of its opening month (`held/<yyyy-mm>`) by that list's operation `drop`. The head goes
after its movers and acts, so a deletion cut part-way leaves the head, which the next judgement finds and finishes; a
removal of an instance already gone answers 0 and 0 (G §587) and is no failure. A record whose head counts more
movers (`movers`, §809) than the index `movers` names is not deleted: one journal line names the record, its count
and the index's answer, and a later judgement takes it once the ledger's repair `reindex` (ADR 0597 §10) has filled
the index, so no mover instance is left that no head names (principle 3). The deletion removes instances within the
gate's own ledger, as G §587 has it, never an entry of kept data whole, which only the bus module's `drop` and
`recreate` remove (ADR 0595 §4). Fate: the tool runner answers neither `mesh/ledger.remove` nor `mesh/ledger.fill`
to a bundle today (its list of the bus state calls a bundle may make names neither, and `gate_records` says so), so
G §587's "served by the tool runner for the calling module's own ledgers alone" is built for a bundle too, in the
tool runner (mesh-tools); both stay refused for another module's ledger (ADR 0597 §9; principle 12).
(4) **When the gate deletes.** At each record's open, before the open's first write, as the gate does today (records
open as deliveries do), and by hand through (6); never on a timer, never at its start and never on another part's
event, since only the gate's own records grow by it (ADR 0682 §11: a part wakes on its inputs alone; principle 7).
Each judgement deletes every ended record past the retention, the oldest end first. A removal the tool runner refuses
or does not answer stops that judgement and is said in the journal (the record, the instance, the error); the record
stays for the next judgement and the open goes on, since a record's room is judged by G §181's refusal of a full
ledger and not by the retention. Fate: today a failed removal refuses the open ("the records past their retention
cannot be removed, so no record is opened"); that refusal ends (principle 3: said, and no delivery's record held for
upkeep).
(5) **Which records the gate reads.** The judgement and every reader of the records (`gate_records`, the counts of
`delivery_status`, the records the gate takes up at its start) read the list of month lists, `held/months`, an
instance of the ledger's existing type `held` with one entry per month list (`instance` the list's instance,
`opened` the month's first instant), then each month list it names, oldest first; never only the months within the
retention and a month more, as today, since an open record of any age and a record ended within the retention but
opened before it are kept and must be read (principle 4). The gate writes a month's entry by `hold` when it opens the
first record of a month `held/months` does not name (it keeps the months named in its memory, read at its start);
at its start, when `held/months` names no month, it writes one entry for each month list it finds reading back from
the current month to the first month with none (today `held/2026-11` alone). When the retention leaves a past
month's list with no entry, the gate removes that list's instance through `mesh/ledger.remove` and drops its entry
from `held/months` by `drop`. One entry a month keeps `held/months` far under a value's 256 KiB, and the ledger gains
no type and no operation (principle 7).
(6) **Its tools** (principle 4; G §159's four lines). `gate_records_retention` reads what the retention would delete
now, deleting nothing: given no argument or `days` (1 to 3650, judged in place of the setting), it answers the
setting's value, every ended record past it, the oldest end first (its key, opened, ended, its movers as counted and
as the index names them, its acts), the records it would leave and why (3), and how many open records are kept
whatever their age, within §811's 768 KB with `capped`, `total` and the cursor. `gate_records_delete` (`why`,
required; `days`, 1 to 3650, default the setting; or `record`, one record's key) deletes as the judgement does, ended
records alone: a named record that is open is refused, naming it, and nothing is deleted; it answers each record
deleted with the operations and bytes its removals answered, and is recorded in the hand-act log of the seat
`mesh-hand-acts`, as `gate_record_end` is (G §159). `gate_records` answers beside the records the setting's value
and the oldest kept end.
(7) **What is said.** One journal line per record deleted (its key, its end, and the operations and bytes its
removals answered), one per record left for its index (3) and one per failed removal (4). No event is added: no part
acts on a deletion. The watchman's `record-open` ends at `record-ended` (G §148), and a deleted record has ended; the
revisions a record names are kept by the indexer's pins (H §749, H-A-566, H-A-572), not by the record, so a deletion
frees no revision, and G §154's `freed` at a removal ends: the seat `mesh-delivery`'s definition declares neither
`pinned` nor `freed` (principle 7).
(8) **Its size.** G §155's estimate (20 deliveries a day, about 200 KiB a record, a ledger of 768 MiB) is replaced
by the figures of the case above: the store that binds is the ledger's state bucket, at 64 MiB the most ADR 0595 §3
allows a ledger's state, full on 2026-11-23 while its history held a fifth of its cap; the retention holds the state
under its cap only while the records of `record-retention` days fit in it.
- **H-A-634 (an ended delivery record goes 30 days after its end, by the bus's lifetime per key; its history is kept
90 days and none beyond; the bus module's fill names its object, 01:24, rewritten 21:55)** 24 Nov, the operator's
answers in chat: about 01:06 CET ("sure, i guess") to the lead's design question "may the gate delete ended delivery
records older than a set number of days (default 30)? Open records are never touched"; and between 21:20 and 21:30
CET, after the lead set out how mature bus setups bound kept data (a lifetime per stream, a current state holding
only what is live with a lifetime per key, a history aged or archived), "I don't think so? Why would ever need the
history?" to "keep the gate's delivery history beyond 90 days?": no archive, the history expires. The second answer
replaces this answer's first form (the gate deleting each ended record through `mesh/ledger.remove` at each open,
with `gate_records_delete` and a list of month lists `held/months`): the bus removes what has ended, as the ledger's
own configuration asks, and the gate deletes nothing. It amends G §154 (90 days counted from the opening, an open
record removed too, `freed` at a removal), G §155 (the estimate of the ledger's growth, and a removal taking the
operations and the snapshot), G §159 and §160 (the tools and the check of the retention), G §587's removal, and
§820's row of `records` (its key's life "none", deleted "never"); §809's and §812's "never pruned" stand, since
nothing prunes the ledger toward a cap. A delivery record's fields, retention and tools are the design's under ADR
0656 §7 and §10 (G §145); a ledger that expires gives its keeping days in its own configuration (ADR 0595 §2, §8;
ADR 0597 §1), and a state's key may be given a lifetime of its own (design 25 § 12.1's option "a lifetime per key",
ADR 0595 §3); so the answer is design lines (playbook 02, *Answering a design question*, item 1), save where (4) and
(8) name what a record holds. The case, read 2026-11-24 about 00:20 UTC: the bus module's condition "Kept data is
filling up" for the gate's `records`, open since 2026-11-23 10:20, says "75% of its cap" and names no object; the bus
module's `nats_streams` reads the ledger's state bucket at 67,108,471 of its 67,108,864 bytes (16,869 keys, last
written 2026-11-23 11:48:52 UTC), its history at 226,666,132 of 1,073,741,824 bytes (82,178 operations, 21,969
instances), its snapshot at 121,436,920 bytes and both index buckets with no key; the seat `mesh-broker`'s `show`
answers only their sum (415,211,523 of 2,348,810,240 bytes); `gate_records` counts 978 records, 869 ended (840 of
them at H1's clean state on 2026-11-20) and 109 open, the oldest opened 2026-11-14 01:05 UTC, and answers its fill
"unread": "the runtime answers no mesh/ledger.fill from a bundle".
(1) **When an instance has ended, and when its key goes.** A ledger whose own configuration gives `ended-days` (a
whole number of days, 1 to 3650) keeps an instance's state key only until `ended-days` after the instance's end. An
instance has ended while its state holds a value in the field its type names in `ends-with` (absent, null, an empty
object and an empty text are no value); its end is the time the tool runner stamped (`at`) on the operation that last
gave that field a value. The tool runner keeps that time as `ended-at` in what it keeps under the instance's key,
beside the sequence of its last operation (and so in its snapshot), absent while the instance has not ended. Every
write of an instance's state by the tool runner (an `apply`, its write after a lost race of ADR 0597 §5, a
`rebuild`) gives the key the bus's per-message lifetime of what is left of `ended-days` after `ended-at`, and none
while the instance has not ended, so a reopened instance is kept whatever its age; when nothing is left, it writes no
state and deletes the key it holds. The bus removes the key when its lifetime ends, with no loop or timer of the
owner or the tool runner (ADR 0682 §11; principle 1), and a watch of the state hands it as a removed key (the
bucket's delete marker, which the keeper gives one second). An index key (ADR 0597 §4) carries the lifetime of the
instance it names, written so by the owner's watcher and by the repair `reindex` alike, and `reindex` writes none for
an instance whose lifetime has ended. The client's update of a key takes no lifetime (nats.go v1.54), so the tool
runner writes a state as one publish on the key's subject with the revision it read expected and the lifetime in the
bus's header `Nats-TTL`: the compare-and-set ADR 0597 §5 asks, unchanged. The bus serves it: the bus module runs NATS
server 2.11.17 (mesh-catalog `modules/nats`, its image and its go.mod), per-message lifetimes exist from 2.11,
research 082's Findings tried them on 2.11.17, and the keeper already makes a bucket that allows them (`key-ttl`).
Built in the tool runner (mesh-tools `node-tools/internal/ledger` and `internal/bus`). Principles 1, 3 and 7.
(2) **The gate's ledger.** The gate's `records` gains its own configuration: `max-age-days` 90, its history's keeping
days (ADR 0597 §1; none beyond, the operator's answer), and `ended-days` 30 (the operator's answer), beside its
option `max-mib` 1024. Its types `record`, `mover` and `act` name `ends-with: ended`; `mover` and `act` gain the
field `ended` (an object, the head's `ended` copied) and the operation `end` (set-fields `ended`, with its sequence).
A record's end writes the head's `end` first (G §147, §810), then `end` on each of its movers and acts with the
head's `ended`; a reopening (H-A-609 (2)) writes `end` with `ended` empty on its movers and acts first, then the
head's; so no open head has a mover or an act whose key is ageing (principle 3), and an end written again by a late
`running` (H-A-597) moves every one's end alike. A write that fails is said in the journal (the record, the instance,
the error) and finished by the pass of `gate_records_follow_ends` ((7)), which the gate makes at each start over the
records its watch hands ((5)). The gate applies no operation to a record it no longer reads: an event for one whose
key has gone is said in its journal and changes nothing, so no late event brings an ended record back from its
history. Fate: the gate's config value `record-retention` (G §154: 90 days from the opening) leaves its manifest and
its code; the 30 days are the ledger's `ended-days`, changed by a change of the gate's manifest (principle 11: a value
in the manifest, never in the code); the words of a full ledger (`room`, G §181) name `ended-days` or a larger cap
where they named `record-retention`. Built in the gate (mesh-catalog `modules/mesh-delivery-gate`). ADR 0656 §7.
(3) **The bus module, the manifest validator and what is held.** The bus module plans the state bucket and each
index bucket of a ledger whose own configuration gives `ended-days` with a lifetime per key (`key-ttl`), at the
state's cap of 64 MiB (ADR 0595 §3; H-A-638), and writes `ended-days` into the ledger's binding beside its types, so
the tool runner reads it from the module's membership. The manifest validator takes `ended-days` in a ledger's own
configuration from 1 to 3650 and refuses an `ends-with` naming no field of its type's schema, a ledger giving
`ended-days` with no type naming `ends-with`, and a type naming `ends-with` in a ledger with no `ended-days`, each
naming the field (ADR 0595 §8). mesh-sdk's catalog package gains `ends-with` on a ledger type and the configuration
name `ended-days`, and its membership's ledger binding `ended-days`. The gate's held `records` then differs from what
is asked: its history kept for good against 90 days, its state and index buckets with no lifetime per key. Neither
only grows, so the bus module raises `drifted`, and only its `recreate`, on the operator's warrant after the stream
snapshot, applies them (ADR 0595 §5). That `recreate` rebuilds from its data where the bus allows it, as §5 has it:
after the snapshot the keeper changes each object of the entry in place where the bus takes the asked settings on a
held object (a shorter age, a smaller cap, a lifetime per key turned on), keeping what those settings keep (a smaller
cap the newest that fit), and deletes and makes again empty only an object the bus refuses to change in place (a
lifetime per key turned off, another retention); the ask its tool raises names, per object, which of the two it
does. Fate: today the keeper deletes and makes again empty every object of the entry, which for the gate's `records`
would remove every record, open ones included. Built in the bus module (mesh-catalog `modules/nats`), the manifest
validator (mesh-delivery `modules/mesh-delivery-indexer/judge`) and mesh-sdk. ADR 0595 §2, §3, §5, §8; principle 3.
(4) **What the replay, the repairs and the snapshot do with an ended instance.** No read replays: `get` and `watch`
answer the state as the bucket holds it, null for a key gone (ADR 0597 §10). `apply` replays an instance whose state
is behind its history (ADR 0597 §5): for one whose key has gone while its history stands, from its snapshot and the
operations after it. The gate applies none ((2)); an owner that does gets the instance back with its new operation,
kept only by the lifetime that state gives ((1)), so an instance still ended past `ended-days` is not written again.
`rebuild` derives each instance from its history or its snapshot and writes it with its lifetime by (1): it brings
back none past its lifetime, and gives each instance held before this answer its lifetime. `lag`, and the index's
condition of ADR 0597 §4, count an instance whose lifetime has ended as not behind. `get` and `watch` answer beside an
instance's state its `expires` (`ended-at` plus `ended-days`), absent while it has not ended. The snapshot stays as
ADR 0597 §8 has it, the latest state of every instance, never expiring: an ended record's last state stays in the
snapshot store after its key and, from 90 days, its operations have gone, read by nothing but `apply`'s replay and
`rebuild`, which (1) keeps from bringing it back; a snapshot that goes with its key is a decision changing ADR 0597
§8, not a design line. Built in the tool runner and mesh-sdk's `buscalls` (`InstanceState` and a watch's change gain
`expires`). ADR 0597 §5, §8, §10; principles 3 and 4.
(5) **How the gate lists its records.** The gate keeps the key and the opening of every record its ledger holds from
a watch of its own ledger's `record/>` (ADR 0597 §10's `watch`: the current states at its start, then each change; a
key gone by its lifetime handed as removed and forgotten, and a listed record whose key reads null dropped as well),
and every reader of the records lists them from it, the oldest opening first, reading each as today: the judgement,
`gate_records`, the counts of `delivery_status`, `deliveries` and the records the gate takes up at its start
(ADR 0682 §11: a part keeps watched copies of its own states). So no reader needs a month list `held/<yyyy-mm>`: the
gate writes none at an open, and `held/months` is not made. The type `held` loses `hold` and `drop` and gains
`forget` (the effect `remove` naming no map, which empties the instance's state, ADR 0597 §2), which the gate applies
at its start to each month list a watch of `held/>` hands with a state (today `held/2026-11`, 978 entries); the type
stays declared, so the replay of its operations, kept up to 90 days, reads them. Fate: `List` and `months`, which read
the month lists within the retention and a month more from the opening and so missed an open record older than
that, go. Principle 7.
(6) **What goes.** The gate deletes nothing: its sweep at each open (`Sweep`) and that open's refusal ("the records
past their retention cannot be removed, so no record is opened") go. G §587's `mesh/ledger.remove` loses its one
caller and goes, with its request and answer (`LedgerRemoveRequest`, `LedgerRemoved`) in mesh-sdk's `buscalls`, the
tool runner's removal and its place among the calls of `ledger-upkeep-calls`; `mesh/ledger.fill` stays, and the tool
runner answers it to a bundle for its own ledgers, which it does not today. The first form's `gate_records_retention`,
`gate_records_delete`, `held/months` and the gate's deletion at each open are not built. G §154's `freed` at a
removal ends: the revisions a record names are kept by the indexer's pins (H §749, H-A-566, H-A-572), not by the
record, and the seat `mesh-delivery`'s definition declares neither `pinned` nor `freed`. No event is added for an
expiry: no part acts on one. Principle 7.
(7) **Its tools** (principle 4; G §159's four lines). `gate_records_expiring` reads what goes when, removing nothing:
given `within` (days, 1 to 3650, default the ledger's `ended-days`), every ended record whose key expires within it,
the soonest first (its key, opened, ended, `expires`, its movers and acts as counted and as the indexes name them),
and how many open records are kept whatever their age, within §811's 768 KB with `capped`, `total` and the cursor.
`gate_records` answers beside the records the ledger's `ended-days`, its keeping days and the soonest `expires`.
`gate_records_follow_ends` (`why`, required) does by hand the gate's pass at its start: it gives every mover and act
of an ended record that record's `ended` where they hold another, and takes it from those of an open record, reading
them through the indexes `movers` and `acts`; it answers each record and the instances it wrote, and is recorded in
the hand-act log of the seat `mesh-hand-acts`, as `gate_record_end` is (G §159). The tool runner's repairs of the
gate's ledger (`ledger_rebuild`, `ledger_reindex`, `ledger_lag`) repair what (1) keeps. Built in the gate.
(8) **Its size.** G §155's estimate is replaced by the case's figures, each about: a state key 3.9 KiB (67,108,471
bytes in 16,869 keys), 22 instances a record (21,969 for 978), so 87 KiB of state a record; 226 KiB of history and
121 KiB of snapshot a record; 98 records a day over the case's ten days. The state, at most 64 MiB (ADR 0595 §3;
H-A-638), holds 30 days of ended records below about 25 records a day, and stays under the bus module's raise mark
of 75% below about 18; at the case's rate 30 days need about 250 MiB, at G §155's estimated 20 a day about 51 MiB.
The history, at 1 GiB, holds 90 days below about 51 records a day (at the case's rate about 1.9 GiB). The snapshot
store, never expiring ((4)), reaches its 1 GiB after about 88 days at the case's rate and about 430 at 20 a day,
and then, as the bus module plans it, drops its oldest. Above those rates the state refuses when full and loses no
operation (ADR 0597 §6), the history refuses when full (G §181's `full`), and the bus module's condition says which
object is full ((9)); a cap above 64 MiB for a ledger's state is a decision changing ADR 0595 §3 (H-A-638).
(9) **The bus module names the object it judged.** (ADR 0595 §6) The bus module's fill pass already reads each
object of an entry that refuses when full and keeps the highest share; `full` and `full-cleared` carry that object:
`object` (its bus name), `part` (its place in the entry's binding: `history`, `state` or `index <name>` for a
@@ -113,17 +158,90 @@ principle that settles it.
of its cap). The seat `mesh-broker`'s `show` answers in `fill`, beside the sum, `objects`: each object's bus name,
part, bytes, cap and share; `nats_history` shows the new fields as it shows the rest. Built in the bus module
(mesh-catalog `modules/nats`) and the seat `mesh-broker`'s definition (mesh-contracts). Principles 3 and 4.
How it is checked: rows of the gate's record unit tests in `record_test.go`, beside the rows of `record-retention`
there today, never a new top-level test function: an ended record 31 days past its end is deleted with its movers,
its acts, its head and its month entry in that order; one 29 days past its end is kept; an open record opened 400
days ago is kept; a reopened record is kept until its next end; a record whose head counts more movers than its index
names is kept and said; a failed removal is said and the open is written; `record-retention` 6 and 3651 are refused,
7 and 30 taken, none read as 30; `held/months` is seeded at a start and loses an emptied past month. The gate's whole
test's case of G §160, "a record past its retention is removed", becomes "an ended record past its retention is
removed with its movers and acts, and an open record older than it stays". A row of the tool runner's unit tests: a
bundle's `mesh/ledger.remove` and `mesh/ledger.fill` on its own ledger are answered, on another module's refused. A
(10) **The order after H2's delivery.** First the operator's warrant for the bus module's `recreate` of the gate's
`records` ((3); one ask, said to the operator before it is raised, naming each object it changes in place). Then by
hand, each a hand act: `ledger_reindex` of `movers` and `acts`, so the indexes name each record's movers and acts
(they held no key in the case); `gate_records_follow_ends`; `ledger_rebuild` of the whole ledger, so every instance
held before this answer gets its lifetime ((4)); and `ledger_reindex` of both again, so their keys take those
lifetimes. The 840 records ended at H1's clean state then go on 2026-12-20.
How it is checked: rows of the tool runner's ledger unit tests, never a new top-level test function: an instance whose
`ends-with` field gets a value is written with a lifetime of `ended-days` from that operation's `at`, and one emptied
again with none; an end written again moves `ended-at`; a `rebuild` of an instance ended past `ended-days` writes no
state and deletes the key held; `reindex` writes an instance's index keys with its lifetime and none past it; `lag`
counts it not behind; `get` answers `expires`. A case of the ledger's one integration test on the real bus, the day
shortened in the test: a key written with a lifetime of two seconds is gone after them and a watch hands it removed,
and a racing writer of a key with a lifetime is refused. Rows of the keeper's plan tests: a ledger with `ended-days`
plans its state and index buckets with a lifetime per key at 64 MiB and writes `ended-days` in its binding, one
without plans none; rows of its `recreate` tests: a shorter age and a lifetime per key turned on are changed in place
with their data kept, a lifetime per key turned off is made again empty, and the ask names which. Rows of the
manifest validator's unit tests: `ended-days` 0 and 3651 refused and 30 taken; an `ends-with` naming no field
refused; `ended-days` with no `ends-with`, and the reverse, refused. Rows of the gate's record unit tests in
`record_test.go`, in place of the rows of `record-retention`: an end writes the head, then each mover and act with
its `ended`; a reopening empties the movers' and acts' first, then the head's; a failed write is said and the start's
pass finishes it; an event for a record no longer read changes nothing and is said; a removed key drops the record
from every list; `held/2026-11` is forgotten at a start; and the gate's manifest gives `ended-days` of 7 or more,
since `gate_times` answers the last seven days (G §810). The gate's whole test's case of G §160, "a record past its
retention is removed", becomes "an ended record's movers and acts take its end, and an open record's take none". A
row of the bus module's fill pass unit tests: an entry whose state is at 75% and whose history is at 20% says `full`
naming the state, and `show` answers each object. Live, after H2's delivery: `gate_records` answers the ledger's fill
and the setting 30; `gate_records_retention` names no record past it while every end is under 30 days old; and
`nats_history` of the gate's `records` names the object in its `full`. ADR 0656 §2, §7; ADR 0597 §4, §9, §10; ADR
0595 §3, §4, §6; ADR 0682 §11; principles 3, 4, 7, 11 and 12.
naming the state, and `show` answers each object. Live, after H2's delivery and (10): `mesh-broker.show` of the
gate's `records` names its state and index buckets with a lifetime per key at 64 MiB and its history at 90 days;
`gate_records_expiring` names each ended record's `expires` 30 days after its end and no open record; from 30 days
after (10)'s rebuild, while the rate of (8) holds, the gate's state stays under its cap and the bus module's condition
for `records` stays cleared; `nats_history` of the gate's `records` names the object in its `full`. ADR 0656 §7, §10;
ADR 0597 §1, §4, §5, §8, §10; ADR 0595 §2, §3, §5, §6, §8; ADR 0682 §11; principles 1, 3, 4, 7 and 11.
## Answers of 2026-11-24 from 01:08 CET
- **H-A-635 (a slow pass of the assigner says which phase it is in, 01:08)** 24 Nov, issue 1984; answers the stall met
2026-11-23 23:53:48 UTC: the assigner on one machine logged "the pass took" (H-A-259) every 20 s, then nothing for six
minutes at near-zero CPU while every validate and composition step of a 70-mover pipeline waited; a read of its locks
found no cycle, and no tool takes a stuck process's stacks, so where it stood is not known. The pass names the phase it
is in as each starts (the assignments seat, the kept graph, the wants, the pass said, the puts, the node wants, the
backups and reverts), in the passer's own memory; a pass still running after the assigner setting
`pass-stall-seconds` (10 to 600, default 60) says once in the journal "the pass started at <time> is in <phase> for
<duration>", and again at each further bound until it ends; the end line stays as H-A-259 has it (principle 3: a part
that waits says where; principle 11: the bound is a setting; principle 7: a journal line in the passer, no new key or
event, since no other part acts on it). How it is checked: a unit row where a phase blocks past a short bound and the
journal line names that phase, and none is said for a pass that ends within it. Principles 3, 7 and 11.
- **H-A-636 (a ledger's state and index buckets take the ledger's cap, 01:31)** 24 Nov; answers the condition "Kept data is
filling up" of the delivery gate's records (open since 2026-11-23 10:20 CET): the gate's ledger asks `max-mib` 1024,
which sizes its history and its snapshot, while the bus module plans the ledger's state bucket and each index bucket
with no option (mesh-catalog modules/nats internal/keeper/plan.go, the ledger case, `stateSettings(options{})`), so
each is the state default of 64 MiB whatever the module asks; the gate's state bucket is full since 2026-11-23 11:48
UTC, its operations kept in the history and the state behind (ADR 0597 §6). The ledger's state bucket and its index
buckets take the ledger's own `max-mib`, as its history and snapshot do, through the existing `stateSettings` cap;
no other option of the ledger reaches them (principle 11: no cap fixed in code; principle 7: the entry's one existing
option, no new one). A raised cap reaches a held bucket through the keeper's existing path for larger settings, in
place, and the state catches up by replay (ADR 0597 §5). In the bus module (mesh-catalog). How it is checked: a row of
the keeper's plan tests (a ledger with `max-mib` 1024 plans its state and index buckets at 1 GiB, one with none at the
default); live, `mesh-broker.show` of the gate's records names its state bucket at 1 GiB and the condition clears.
Principles 7 and 11.
- **H-A-637 (the pipeline runner's test-run test waits on what it causes, never on a clock across a restart, 01:59)** 24 Nov,
issue 1984; answers the failure of main.512 (mesh-delivery-pipeline's integration step on a loaded build node, "1 failed:
TestTestRunsAreAskedOncePerLevelAndMoveEveryReader", which the same commit passed in main.511): the test writes the
setting test-step-bound "2s", restarts the runner inside the test while that clock runs, and needs the restarted
runner to hear its first step-progress before the clock ends; under load it did not (testruns_integration_test.go:411,
60 s); two more waits of the same test fail under load (:357, the ask read once; :519, cause not known). The test
restarts the runner under a bound longer than the restart (the setting rewritten to the short bound between the stop
and the start), its start waits for the new runner's own take-in line, the ask is waited for as every other wait is,
a wait whose run has ended stops at once naming it, and :519's cause is read before it is changed (principle 3: a
check fails only for the change it checks, never for the machine's load; principle 7: the test's own waits, no new
seam). Test-only: no behaviour of the runner changes. How it is checked: the test passes 10 of 10 runs pinned to one
core under three busy loops, and fails at once when the runner's real behaviour it checks is taken out. Principles 3
and 7.
## H-A-636 against design 25 (2026-11-24 from 21:30 CET)
- **H-A-638 (H-A-636 withdrawn: a ledger's state and index buckets keep the state's cap of 64 MiB, 21:55)** 24 Nov,
withdraws H-A-636. ADR 0595 §3 decides "A ledger's state and index buckets take a cap like any state bucket (at most
64 MiB)", and design 25 § 12.1's table fixes "the bucket at most 64 MiB" for a state, which a ledger's state and
index buckets take "as state"; a lead answer cannot raise that cap (playbook 02, *Answering a design question*, item
2: against a record, the answer is a decision). The bus module plans a ledger's state bucket and each index bucket at
the state's cap again, with no option of the ledger reaching them but H-A-634 (3)'s lifetime per key; the change that
built H-A-636 (mesh-catalog `modules/nats`, the ledger case of the keeper's plan, 0f648e26 on main) is reverted in H2
with H-A-634. The gate's state is bounded by H-A-634's lifetimes instead, within 64 MiB only while 30 days of its
records fit (H-A-634 (8)). A held state or index bucket made at the larger cap asks a smaller cap, a drift only the
`recreate` of H-A-634 (3) applies, on the operator's warrant, never `apply` (ADR 0595 §5). How it is checked: the
row H-A-636 added to the keeper's plan tests is turned (a ledger with `max-mib` 1024 plans its state and index
buckets at 64 MiB); live, after H2's delivery and H-A-634 (10), `mesh-broker.show` of the gate's `records` names its
state at 64 MiB. ADR 0595 §3, §5; principle 7.