diff --git a/03-DESIGN/01-to-be/47-milestones/H2-lead-answers-4.md b/03-DESIGN/01-to-be/47-milestones/H2-lead-answers-4.md index 670043a5..5a55f07a 100644 --- a/03-DESIGN/01-to-be/47-milestones/H2-lead-answers-4.md +++ b/03-DESIGN/01-to-be/47-milestones/H2-lead-answers-4.md @@ -10,6 +10,16 @@ decisions: - "ADR 0597" - "ADR 0595" - "ADR 0682" + - "ADR 0614" + - "ADR 0618" + - "ADR 0624" + - "ADR 0603" + - "ADR 0686" + - "ADR 0684" + - "ADR 0674" + - "ADR 0673" + - "ADR 0668" + - "ADR 0666" --- # Design 47, milestone H2: lead answers, continued a third time @@ -289,7 +299,7 @@ line and the code disagree (DMC). Five research-readers read each at today's mai mesh-catalog 17e1bfb6, mesh-sdk bb11615, `mesh-host` d27af83, mesh-contracts 52e5224); each answer below rests on that reading and names the principle that settles it. Scope questions DQ-5, DQ-10, DQ-12, DQ-23, DQ-30 (and DMC-6, which follows DQ-12) wait for the operator; DMC-2, DQ-25 and DQ-27 go to hq-design-writer as design lines, since no -principle settles them. +principle settles them (H-A-682 to H-A-684, below). - **H-A-639 (DQ-1: which manifest reads leave mesh-sdk)** `ManifestNeeds` and `ModuleNeeds` move whole into the indexer's manifest validator (their only callers); `MissingManifestReads`, `StatedManifestReads`, `BaselineManifestReads` and @@ -421,3 +431,150 @@ principle settles them. measured rate need about 1.9 GiB (H-A-634 (8)). Principle 11. - **H-A-681 (H-A-634: the ledger account's purge grant)** The ledger account's grant to purge a history goes, since no caller is left after H2; the snapshot purge stays. Principle 7. + +## The design lines of the three questions no principle settles (2026-11-25 from 13:05 CET) + +Written by hq-design-writer under the records each follows (playbook 02, *Answering a design question*, item 1), from +the research-readers' reading of the same mains. + +- **H-A-682 (DMC-2: the indexer names each entry's needs, and the assigner holds a node's want for a need its + node-engine does not state)** 25 Nov. Where met (mesh-delivery 3b1f03ce): the indexer's `CatalogEntryOf` + (`internal/index/catalog_graph.go:33`) fills no `needs`, and `ModuleValueOf` says "the reader needs are not kept" + (`:70`), while the take-in writes them on the module's value (`modules.go:105-108`); the assigner copies `e.Needs` + (`cmd/mesh-delivery-assigner/halves.go:164`) and compares a node's words only for `want:version` (`pass.go:263-266`); + `graph.MissingReads` has no caller. The records settle who reads them. ADR 0614 §4 is in force, read with ADR 0618 + §1 and ADR 0624 §2, whose second sentence keeps "a hold for a manifest word or seat name the engine does not state" + as ADR 0614 §4 has it. ADR 0682 §9 ends the holds it names (the canary, a grant, a provision, a served verb, bus + state, an acting part's build) and changes no clause of ADR 0614, so ADR 0682 §8's "whole want rule" is the rule of + which version a want names and the order its writes follow, and the hold of a node whose node-engine cannot read the + manifest stands beside it: §772 is that hold for one capability, `want:version`, and H-A-568, H-A-569 (2), H-A-586 + and H-A-622 already rest on it. So H §750's "The want is held for nothing else" reads "for nothing else than a reader + capability its node-engine does not state (ADR 0614 §4), §772 being its first case"; no record is needed. + (1) **The entry carries its needs.** `CatalogEntryOf` writes the entry's `needs` (the seat `mesh-catalog`'s + `CatalogEntry` field, a sorted list of reader capabilities, absent when empty) from the module's value: the words, + forms and seat names `ModuleNeeds` names, with the manifest validator's rule needs (H-A-568, H-A-569 (2), H-A-605 + (4)); `ModuleValueOf` reads them back, and its "the reader needs are not kept" goes. The field's description says + "as the indexer derives them at the take-in" where it says "as the forge bridge read them at the merge"; no form is + raised, since no field is added or removed (§780). + (2) **The assigner compares them with the node's words.** The needs of a want are those of the catalog graph entry + at the fingerprint it names: the module's entry the assigner holds when that entry names the fingerprint, else the + seat `mesh-catalog`'s `entry` for it (G §443's read of a build older than the newest), asked once per fingerprint + and kept until the next catalog revision the assigner takes in. A want whose needs hold a capability that the node's + words in the assigner's state `engine-reads` (H-A-104: the words of the node's last `manifest-reads-changed`) do not + hold is written held: `hold` true and `words` `awaits-reads:` followed by the missing capabilities, sorted and + joined by commas (`awaits-reads:directory-contents-owner`); `assign.Module` takes the node's missing needs beside + `ReadsVersion`. §772's case is read first and keeps its words `awaits-hand-placement`, since an engine that does not + read a want by version reads no want of this form at all. The pass that the node's next `manifest-reads-changed` + wakes (as today) writes the want with no hold once the node's words hold every need; a node away keeps its held + want and moves on its return (ADR 0603 §7, as ADR 0614 §4 cites it). `assigner_why` names the missing capabilities + of a held want and `assigner_engine_reads` the node's words; no state is added. A build key's reference forms add + no need: every build keeps a form each counted engine states (ADR 0624 §1), so ADR 0624 §2's hold meets no node. + (3) **No baseline.** An engine that states nothing states no `want:version`, so §772 holds it whatever the baseline + would hold: reading it as the baseline (ADR 0614 §4) changes no want, and H-A-639's deletion of the baseline stands + (principle 7). + (4) **A held mover is waited for.** A want held on a present placing machine is a mover not running there, so its + tier waits and ends `tier-late` within `tier-bound`, naming that machine (§751): the loud end of a node-engine that + did not take its new version (principle 3). + (5) **The node-engine's own build is refused, never held.** A mover that claims the seat `node-engine` and whose + entry needs a capability that no node's words in `engine-reads` hold would be held on every machine, and no engine + could ever state it; so the assigner's validate run adds to its verdict, for that mover's manifest, the problem + "needs , which no node-engine states", counted as a new problem, and its step ends failed + `manifest-refused` (ADR 0614 §4's check, a result of the step `validate` by ADR 0682 §5). + Built in H2: the indexer (`CatalogEntryOf`, `ModuleValueOf`, the field's description) and the assigner (the want + pass, `assign.Wants`, the validate run). How it is checked: unit (indexer): the entry of a module whose value names + needs carries them, and the value read back from it names them; unit (assigner, `wants_test.go`): a node whose + words lack a need of the want's entry is written held with `awaits-reads:`, one whose words hold it is not, a + node without `want:version` keeps `awaits-hand-placement`, a `manifest-reads-changed` naming the need writes the want + with no hold, and a want at an older fingerprint takes the needs `entry` answers for it; unit (validate step): a + node-engine mover needing a capability no node states ends `manifest-refused` naming it. ADR 0614 §4, ADR 0618 §1, + ADR 0624 §2, ADR 0682 §5, §8, §9; principles 3 and 7. +- **H-A-683 (DQ-25 with DQ-24 and H-A-674: one key's slow handling holds back no other key's events, a handler lists + no keys, and a handling past its bound is a finding)** 25 Nov. Where met (mesh-sdk bb11615, mesh-delivery + 3b1f03ce): mesh-sdk's `process.HearEvents` (`go/process/module.go:115`) hands a durable's events to its handler one at + a time, and the event hub (`EventHub`, `go/process/event_hub.go`) pulls through it; the builder hands its events on + by the name they carry (`eventWorkers` and `eventKey`, `cmd/mesh-delivery-builder/eventtake.go`; H-A-514's addenda), + every event of the seat `node-engine` under one key; `Retaker.retakeAll` (`internal/build/retake.go:171`) lists every + build key and reads each at every `running` and `manifest-reads-changed`, `runningWant` (`:132`) asking the seat + `mesh-catalog`'s `entry` first; `engineReads.heard` (`reads.go:148`) asks its node again (ADR 0618 §4). Met twice + within an hour on 23 Nov: one node's `manifest-reads-changed` took 10 m 41 s and another's 5 m 53 s, the retake + taking each, and meanwhile the builder handled no other event of that seat; the first of the kind was the pipeline + runner's `step-ended` (issue 1984 note 6, fixed by mesh-delivery #359). The records place the rule: hearing an event + and its kept consumers are the runtime every module uses, in mesh-sdk (ADR 0686 §1), and a pass takes only the keys + its input names and reads nothing of its own whole (ADR 0682 §11, one shape in mesh-sdk); so the rule is the + runtime's, for every module, and the builder's hand-out by key is that runtime built in one part (principle 7: one + copy). A work queue per kind of work (ADR 0595 §2's template) was weighed and not taken: a waiting event is already + kept on the bus by its own durable until its handler acknowledges it (H-A-281's in progress), so a queue would keep + the same work twice; the builder's publish queue (§793) stays one, since its pieces are many per event and outlive it + (ADR 0674 §3). + (1) **The hub hands events by key.** mesh-sdk's `EventHub.Handle` takes, beside a pattern and its handler, the key + of the pattern's events: a function of a message's subject and body that the module gives, or none. One key's + events are handled one at a time in the order heard, the events of different keys side by side, at most + `events-at-once` keys at once (a setting each module may set, read by the runtime: 1 to 64, default 8), the others + waiting in the order heard; every pattern given no key hands its events under one shared key, so a module that gives + none handles them as today. Each message still waiting is said in progress to the bus each time a handling ends + (H-A-281's rule, kept), and `HearEvents`' pull stays. The builder's `eventWorkers` and `eventKey` move into the hub + with their tests, none left in the builder, which gives its patterns their keys: a registry seat's outcome by its + name, `version-released` by its module, and the seat `node-engine`'s `running` and `manifest-reads-changed` by the + node their subject names, so a slow handling of one node's event holds back no other node's. + (2) **A handler reads only what its event names.** A handler lists no keys of a bucket or stream and reads no state + whole (ADR 0682 §11, now for every module's handlers); it reads and writes its own kept data by the keys its event + names, and a call it needs is a kept call (ADR 0668) under its event's key. In the builder `retakeAll`'s list goes: + the builder keeps in memory each build key whose newest revision failed on a transport fault, with the seat and + node `TransportFaultOf` names, filled by its start sweep (`Sweep`, which reads every key once at the start until H4's + index of what builds replaces it, §762) and kept by every write of a build's end; an event retakes only the keys of + that set whose seat or node it names, and `runningWant` asks `entry` only while the set holds a key. + `engineReads.heard` keeps asking its node (ADR 0618 §4), under that node's key. + (3) **A handling past its bound is said, and past a longer one is a finding.** The hub times each handling: past + `slow-event` (the builder's setting of §794, now read by the runtime for every module, default 100 ms) it writes + §794's journal line with the key; when a handling runs past `event-overrun` (a setting, 1 second to 1 hour, default + 60 seconds) it tells a hook at once, while the handling still runs, which the process reader wires into the finding + `event-overrun` where it holds a findings writer, as H-A-169 wires `event-unhandled`: one per module, its id the + module, its summary the subject, the key and since when, cleared once no handling of the module is past the bound; + the journal line at the handling's end says how long it took. + Built in H2: mesh-sdk (the event hub, in mesh-sdk's change that rebuilds every module once, §818) and the builder, + the one part that gives its patterns keys in H2; every other module gets (3) at that rebuild and gives its patterns + keys where its finding or a fault shows the need (principle 7). How it is checked: unit (mesh-sdk, + `event_hub_test.go`): with one key's handler blocked another key's event is handled, one key's events keep their + order, the patterns given no key share one key, a handling past `event-overrun` tells the hook once while it runs and + the finding clears at its end, and waiting messages are said in progress; unit (builder): a `manifest-reads-changed` + of one node whose ask never answers holds back no event of another node, a `running` with the set empty makes no call + and reads no key, and one naming a seat retakes only that seat's keys; the code review of every module H2 touches + refuses a handler that lists keys or reads a state whole; live: the builder raises no `event-overrun` through H2's + delivery. ADR 0686 §1, ADR 0682 §11, ADR 0618 §4, ADR 0673, ADR 0668; principles 1, 3, 7 and 11. +- **H-A-684 (DQ-27: the assigner's tool `assigner_validate` judges a pipeline's candidate on request)** 25 Nov. Where + met: no tool judges a manifest on request (issue 1984 note 25: a manifest changed by a fix had no verdict before its + merge, and a whole run would have cost about an hour of build capacity); `indexer_judge` and `indexer_verdicts` went + (H §764) and the take-in validates no manifest (ADR 0682 §5); the manifest validator runs only in the assigner's step + `validate` (`cmd/mesh-delivery-assigner/validatestep.go`, H §745), one run per candidate keyed `.validate` + in the state `composition-runs` (H-A-108), and `assigner_validate_before` reads what a run did not count; the package + comment of mesh-delivery-indexer-tools still names the two removed tools. Principle 4 settles that the act gets a + tool (the validate run is the assigner's own act, started today by a step alone, and ADR 0666 §25 gives every act a + tool that starts it by hand); its input follows ADR 0682 §5 and ADR 0666 §18. + (1) **The tool.** `assigner_validate` takes `pipeline` (required: a pipeline's key as the runner names it, a + delivering pipeline's or a run on request's, ADR 0684 §3) and `module` (optional: narrows the answer to one + manifest). It reads the pipeline's candidate (its module graph revision, or its run) from the seat + `mesh-pipeline-runner`'s `show`, then joins or starts that candidate's validate run under `.validate` + exactly as the step does, so a `validate` step the pipeline asks later joins it and builds no second manifest + validator. It answers at once with the run as it stands: `running` with its start, or its end: passed; failed + `cycle` naming the cycle; failed `manifest-refused` with every problem per manifest, those counted and those the case + before holds too (as `assigner_validate_before` answers them); `could-not-run` with why. It writes no want, ends no + step and changes no record, so it is no hand-act; a pipeline the runner does not know, or one whose candidate the + indexer does not hold yet, is answered so, naming it, and nothing starts. `mesh-pipeline-runner.show` joins the + assigner's `invokes` where it is not there. Its description carries "judge a manifest on request", "the manifest + validator's verdict" and "validate", so `mesh_search` with those words finds it (one-question-one-tool). + (2) **A candidate, not a manifest, a module or a commit.** A manifest given whole is not judged: the manifest + validator is built from the candidate's own entry of the module holding the seat `mesh-catalog` and judges every + manifest of one revision together (one name per module, the seats, the cycle; ADR 0682 §5, H-A-108), so a manifest + alone has neither heads to build it from nor a revision to be judged in, and its verdict would name nothing the mesh + can deliver (principle 2). A module alone only narrows the answer, since the run is one per revision. A commit not + yet taken in has no candidate until a run on request makes one (ADR 0666 §18), so a change before its merge is + judged by asking the runner's `run` with its members, then this tool with that run's key once the indexer holds the + run's candidate; the person cancels the run (the runner's `cancel`) when its builds are not wanted. + (3) **The indexer tools' comment.** The package comment of mesh-delivery-indexer-tools names only what the package + serves. + Built in H2 (the assigner; the indexer tools' comment). How it is checked: unit (assigner, `validatestep_test.go`): + the tool on a pipeline with no validate run starts it under `.validate`, and that pipeline's later + `validate` step joins it with no second validator build; on an ended run it starts nothing and answers its verdict, + narrowed by `module`; an unknown pipeline and a candidate not held are answered so and start nothing; the + assigner's manifest test lists `assigner_validate`; live: `mesh_search` with "judge a manifest on request" finds it. + Principles 4, 2 and 7; ADR 0682 §5, ADR 0666 §18, §25, ADR 0684 §3.