Designs and glossary follow ADR 0634 and ADR 0635: shared code lives with its owner
The registry milestone now moves the Delivery domain out of mesh-sdk, creates a contracts module per domain it moves and the first domain SDK, defines 25 seats whole with their states, reads the seat list from the bus and renames two seats. Design 26's *Where a seat's code goes* is what the review and the developer read to place every new name, so it must say this before develop starts. - design 26: definitions carry states; the 25 seats by contracts module; the seat list from the bus; the two renames; the domain SDK and a module's own package; the transfer in the Delivery domain's SDK; checks per ADR 0634 §10 and ADR 0635 §6 - design 20, playbook 06: the homes of shared code, the first that fits - design 47: the seat mesh-module-assigner - glossary: domain SDK added; seat-set package retired; mesh-module-assigner, mesh-wants, mesh-node-enroller and the-private-network in their domains - preparer and code reviewer definitions: the homes, without the retired word Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
This commit is contained in:
+49
-26
@@ -59,8 +59,12 @@ is listed under [Homonyms](#homonyms), with the qualified form each domain uses.
|
||||
A node seat may also name **the paths its holder owns**, such as `/etc/hosts`: a claim whose module does
|
||||
not declare them is refused, and only a claimant declares them (ADR 0287).
|
||||
- **seat definition** — the one language-neutral file (a schema with conformance fixtures) that names a seat's
|
||||
verbs and their messages, its events, its state and the forms of its provisions; its Go and TypeScript types
|
||||
verbs and their messages, its events, its states and the forms of its provisions; its Go and TypeScript types
|
||||
are generated from it. The indexer keeps every trunk's and open pull request's as bus state (ADR 0608 §1, §2).
|
||||
Every seat has one, written by hand in its domain's contracts module, either whole or at the seat list's grain
|
||||
(its name, scope, verbs and provision), and every reader of the list of seats learns it from the bus, never from a
|
||||
compiled package (ADR 0635 §1, §2).
|
||||
*Not:* ~~seat-set package~~ (hq)
|
||||
- **operator** — the person who runs the mesh, and the one the mesh talks to.
|
||||
*Not:* ~~master~~ (hq)
|
||||
- **person** — any human, as against the mesh acting unattended: *a person's word* releases a held
|
||||
@@ -72,7 +76,7 @@ is listed under [Homonyms](#homonyms), with the qualified form each domain uses.
|
||||
**Purpose.** To say what one module is, in the one document every other domain reads.
|
||||
**Recorded in** the catalog, one manifest per module. **Upstream of** every other domain; its words
|
||||
are a published vocabulary, fixed by the manifest's schema. **Decided by** ADR 0040, 0126, 0174, 0188,
|
||||
0207, 0236, 0262.
|
||||
0207, 0236, 0262, 0634, 0635.
|
||||
**Uses:** module, seat, config value (Config), provision (Provisioning), data class (Data), health (Health
|
||||
and repair).
|
||||
|
||||
@@ -99,25 +103,32 @@ and repair).
|
||||
seat's **verb** is the same thing carried by a seat rather than a module.
|
||||
- **mesh-sdk** — the library a module's own code is written against, including the SDK harness that serves a
|
||||
tools bundle to the tool runner. The SDK harness is part of it, not a library of its own. It keeps the runtime
|
||||
every module uses, and the seat-neutral parts two or more seats' clients or holders share; its seat contracts and
|
||||
the logic it held over seats move into the contracts modules, and its seat list into the seat-set package
|
||||
(ADR 0608 §5, ADR 0625 §2, §9, ADR 0627 §2).
|
||||
every module uses, and what modules or seats of more than one domain share; its seat contracts and the logic it
|
||||
held over seats move into the contracts modules, what one domain's modules share into its domain SDK, and what
|
||||
one module owns into that module's own package. It imports no contracts module and reads the seat list from the
|
||||
bus (ADR 0608 §5, ADR 0625 §9, ADR 0634 §1, §4, §5, ADR 0635 §1, §4).
|
||||
*Not:* ~~tools-sdk~~
|
||||
- **contracts module** — a module whose work is to publish the contract packages of seats (their verbs, events,
|
||||
the layouts of their states, their messages), one per seat defined whole and per language, the seat-set package,
|
||||
and the seats' client packages; every file but a client's is generated. `mesh-contracts` for the Core domain's
|
||||
seats and every domain that has none yet, `mesh-<domain>-contracts` for a domain's, named after its heading on
|
||||
this page; a seat defined outside the mesh's own contracts has one of its own. A seat's holder implements the
|
||||
contract; the contracts module holds no seat (ADR 0608 §5, ADR 0625 §1, §5 to §7).
|
||||
the layouts of their states, their messages), one per seat defined whole and per language, with the definitions
|
||||
of its seats at every grain and the seats' client packages; every file but a definition's, a fixture's and a
|
||||
client's is generated. `mesh-contracts` for the Core domain's seats, `mesh-config` and every domain that has none
|
||||
yet, `mesh-<domain>-contracts` for a domain's, named after its heading on this page; a seat defined outside the
|
||||
mesh's own contracts has one of its own. A package-only module found by its manifest, at a repository's root or in
|
||||
a folder. A seat's holder implements the contract; the contracts module holds no seat (ADR 0608 §5, ADR 0625 §1,
|
||||
§5 to §7, ADR 0634 §7, §8, ADR 0635 §2).
|
||||
*Not:* ~~SDK module~~, ~~domain package~~
|
||||
- **client package** — the one hand-written package a seat may carry beside its contract, in the seat's contracts
|
||||
module and never in a holder: the logic two or more callers would otherwise each write over that seat. It uses
|
||||
only its own seat's contract and mesh-sdk's runtime, never another seat's client, and names no holder, no module's
|
||||
tool and no module's subject (ADR 0625 §4, ADR 0627 §1, §3). Bare "client" only where the sense is plain (see
|
||||
module and never in a holder: the logic two or more callers or holders would otherwise each write over that seat.
|
||||
It uses only its own seat's contract, mesh-sdk's runtime and its own domain SDK, never another seat's client, and
|
||||
names no holder, no module's tool and no module's subject (ADR 0625 §4, ADR 0627 §1, §3, ADR 0634 §2). Bare "client" only where the sense is plain (see
|
||||
[Homonyms](#homonyms)).
|
||||
- **seat-set package** — the generated package in `mesh-contracts` holding every seat not yet defined whole at the
|
||||
seat list's grain (its name, scope, verbs and provision); mesh-sdk's `catalogue` is its one importer in mesh-sdk
|
||||
(ADR 0625 §2, §3).
|
||||
- **domain SDK** — a package-only module, `mesh-<domain>-sdk`, named after a domain's heading on this page, holding
|
||||
the logic and forms that one domain's modules and seats share and that no seat carries and no one module owns
|
||||
(`mesh-delivery-sdk` the first). Its importers are its domain's modules and the holders and callers of its domain's
|
||||
seats; it imports only mesh-sdk and contract packages, names no module's tool or subject, and holds no seat's type
|
||||
or state layout and no state layout one module owns. Not a contracts module, and not mesh-sdk, which keeps what
|
||||
more than one domain uses (ADR 0634 §1, §2, §8).
|
||||
*Not:* ~~domain library~~ (hq)
|
||||
- **contracts marker** — the field `generated-from` of a contracts module's package artifact, naming the directory
|
||||
of the seat definitions its files are generated from; the manifest validator refuses a module carrying it that claims a seat,
|
||||
and the build modules' test step regenerates and compares every module carrying it (design 26).
|
||||
@@ -278,22 +289,27 @@ every other domain has something to run on. **Recorded by** the controller and t
|
||||
## Placement — what runs on which node
|
||||
|
||||
**Purpose.** To decide, send and apply what each node runs, and to say why.
|
||||
**Recorded by** the controller's `inventory` database; from ADR 0567, by the seat `mesh-placement`, in its states on
|
||||
**Recorded by** the controller's `inventory` database; from ADR 0567, by the seat `mesh-module-assigner`, in its states on
|
||||
the bus. **Upstream of** Provisioning, Connectivity, Data
|
||||
and Health and repair. **Decided by** ADR 0100, 0126, 0176, 0181, 0207, 0221, 0252, 0261, 0411, 0539, 0549, 0559, 0567, 0571.
|
||||
and Health and repair. **Decided by** ADR 0100, 0126, 0176, 0181, 0207, 0221, 0252, 0261, 0411, 0539, 0549, 0559, 0565, 0567, 0571, 0634.
|
||||
**Uses:** node, machine, module, seat, manifest (Module), config value (Config), proposal (Operator and conversation).
|
||||
|
||||
- **assignment** — a module put on a node. Its config values on that node (module-assignment config,
|
||||
Config) are `mesh-config`'s, never part of what the controller records (ADR 0348 §9).
|
||||
- **placement** — which module runs on which node, with its pins, host ports and bindings, and what a person
|
||||
decided of the node, as one key per node in the state `placement` of the seat `mesh-placement`. It changes only by
|
||||
decided of the node, as one key per node in the state `placement` of the seat `mesh-module-assigner`. It changes only by
|
||||
a placement proposal the operator approves, and no repository holds it or names a node (ADR 0567). Until ADR
|
||||
0547's third milestone the controller's assignments are kept equal to it by the holder.
|
||||
*Not:* ~~placement file~~ (hq)
|
||||
- **mesh-placement** — the seat, held once for the mesh by the assigner, that keeps placement: its states
|
||||
- **mesh-module-assigner** — the seat, held once for the mesh by the assigner, that keeps placement: its states
|
||||
`placement`, `proposals` and `candidates`, and its seven verbs `placement`, `proposals`, `propose`, `withdraw`,
|
||||
`again`, `adopt` and `hand-back`. Only the holder writes its states (ADR 0567).
|
||||
- **seat holders** — the state `seat-holders` of the seat `mesh-placement`, written by its holder, the assigner: one
|
||||
`again`, `adopt` and `hand-back`. Only the holder writes its states (ADR 0567, renamed by ADR 0634 §9). Its
|
||||
contract is in `mesh-placement-contracts` (ADR 0634 §7).
|
||||
*Not:* ~~mesh-placement~~ (hq)
|
||||
- **mesh-wants** — the seat, held once for the mesh by the assigner, that keeps what each node should run, one want
|
||||
per node and module (`want.<node>.<module>`), and a person's upgrade policy, served as its verb `upgrade`
|
||||
(ADR 0565 §7, ADR 0571 §8). Its contract is in `mesh-placement-contracts` (ADR 0634 §6, §7).
|
||||
- **seat holders** — the state `seat-holders` of the seat `mesh-module-assigner`, written by its holder, the assigner: one
|
||||
key per seat naming each holder and its node, composed from placement and the manifests' claims as the indexer
|
||||
holds them, and rewritten only when a key differs. The tool runner and every other reader of who holds a seat
|
||||
read it there, never the controller (ADR 0571 §6, §7).
|
||||
@@ -301,11 +317,11 @@ and Health and repair. **Decided by** ADR 0100, 0126, 0176, 0181, 0207, 0221, 02
|
||||
of each key they were laid over, the nodes' answers, the verdict and the ask. It takes effect only on the operator's
|
||||
Approve, and is discarded if declined, expired or withdrawn. A kind of *proposal* (Operator and conversation).
|
||||
- **placement candidate** — one node's placement as a placement proposal lays it, kept in the state `candidates`
|
||||
of the seat `mesh-placement` under `<proposal>.<node>` while the proposal is open. The node composes it in
|
||||
of the seat `mesh-module-assigner` under `<proposal>.<node>` while the proposal is open. The node composes it in
|
||||
**shadow** (composed and compared, never applied) and answers in its own have whether what it would run is the
|
||||
same; the verdict fails only on a refusal or a node that has not answered (ADR 0567). Not the indexer's candidates of
|
||||
a group, which are fingerprints (Delivery).
|
||||
- **hand-back** — the operator's verb `hand-back` of the seat `mesh-placement`, answered until the lease write: it
|
||||
- **hand-back** — the operator's verb `hand-back` of the seat `mesh-module-assigner`, answered until the lease write: it
|
||||
deletes every placement key, and every node returns to the compositions the controller sends. A hand act (ADR 0567).
|
||||
- **pending assignment** — an assignment of a module whose build is still running, kept, and made by the
|
||||
controller when that build registers the module, or ended with why when it does not
|
||||
@@ -431,13 +447,17 @@ and vault (Identity and access).
|
||||
**Purpose.** To issue, hold, rotate and check the credentials and grants by which modules, nodes, agents
|
||||
and the operator act. **Recorded by** the controller's `identity` and `licences` databases and the vault.
|
||||
**Upstream of** Provisioning, Delivery, and Operator and conversation.
|
||||
**Decided by** ADR 0085, 0113, 0183, 0225, 0234, 0386, 0387, 0388, 0411, 0413, 0414, 0550, 0571.
|
||||
**Decided by** ADR 0085, 0113, 0183, 0225, 0234, 0386, 0387, 0388, 0411, 0413, 0414, 0550, 0571, 0587, 0634.
|
||||
**Uses:** module, node, seat, tool (Module), operator, consumer and provision (Provisioning), agent and ask (Operator and conversation).
|
||||
|
||||
- **credential** — anything that proves an identity: a password, a key, a token. A **pair credential**
|
||||
is the two ends of one credential, the consumer's and the provider's.
|
||||
- **secret** — a credential or other value the vault keeps sealed and the node-engine unseals into a
|
||||
file at apply (ADR 0085).
|
||||
- **mesh-node-enroller** — the seat, held once for the mesh by the module `mesh-enrolment`, through which a new
|
||||
machine joins: a one-time token issued on the operator's Approve, redeemed once by the machine's node-engine, the
|
||||
node's account minted and signed by the vault (ADR 0587 §1, renamed by ADR 0634 §9). The module keeps its name;
|
||||
only the seat's changed. Its contract is in `mesh-identity-and-access-contracts` (ADR 0634 §7).
|
||||
- **secret family** — a module's own secrets declared as one name ending in `-*`; each member is the prefix
|
||||
and a name (`smb-password-<source>`, one per source the module's config values name), given by its full name
|
||||
and never made by the mesh
|
||||
@@ -845,13 +865,16 @@ becomes a message). **Decided by** ADR 0227, 0231, 0240, 0252, 0283, 0564.
|
||||
|
||||
**Purpose.** To make every node and module reachable by name where it should be, and unreachable where
|
||||
it should not. **Recorded by** the controller. **Upstream of** Provisioning and Health and repair.
|
||||
**Decided by** ADR 0007, 0117, 0138, 0223, 0226, 0247.
|
||||
**Decided by** ADR 0007, 0117, 0138, 0223, 0226, 0247, 0634.
|
||||
**Uses:** node, machine, assignment and endpoint.
|
||||
|
||||
- **private network** — the mesh's own encrypted network between its nodes, on which every node has an
|
||||
address and a mesh name (ADR 0226).
|
||||
The network the machine sits on without it is the **underlay**.
|
||||
*Not:* ~~overlay~~ (hq)
|
||||
- **the-private-network** — the seat of the private network, whose provision is the value a module reads to reach
|
||||
the private network; its contract, holding that value's layout, and its client, holding the private network's own
|
||||
manifest that its callers compose, are in `mesh-connectivity-contracts` (ADR 0634 §4, §6, §7, ADR 0635 §4).
|
||||
- **anchor** and **hub** — the roles a node plays for the private network: the anchor is reachable from
|
||||
outside and every node reaches it; a hub relays for nodes that cannot reach each other directly.
|
||||
- **resolver** — a seat holder that answers the mesh's names; a node lists only the mesh's resolvers
|
||||
|
||||
@@ -83,21 +83,30 @@ Three questions, answered from the machine:
|
||||
thing works: the credential authenticates, a wrong one is refused, the containers reach each
|
||||
other, the data survives a restart.
|
||||
|
||||
## A module that calls or holds a seat
|
||||
## A module that calls or holds a seat, or shares code
|
||||
|
||||
*Added 2026-11-04* (ADR 0625, ADR 0627). Where each piece of a seat's code goes is
|
||||
[design 20](../../03-DESIGN/01-to-be/20-writing-a-module.md) *Where a seat's code goes*; in short:
|
||||
*Added 2026-11-04, widened 2026-11-05* (ADR 0625, ADR 0627, ADR 0634, ADR 0635). Where each piece of shared code goes
|
||||
is [design 20](../../03-DESIGN/01-to-be/20-writing-a-module.md) *Where a seat's code goes*: shared code lives with its
|
||||
owner. In short:
|
||||
|
||||
- **Import the seat's contract and, where it has one, its client package**, from the seat's contracts module
|
||||
(`mesh-contracts` today), never the holder module and never a copy of the seat's types in your own code.
|
||||
- **Import the seat's contract and, where it has one, its client package**, from the seat's domain's contracts module
|
||||
(`mesh-<domain>-contracts`, or `mesh-contracts` for the Core domain and a domain with none), never the holder module
|
||||
and never a copy of the seat's types in your own code. The list of seats your module needs is read from the bus,
|
||||
never compiled in.
|
||||
- **Logic you would write over a seat that another caller would write too** belongs in that seat's client package,
|
||||
through a change of the contracts module; it never goes into mesh-sdk, and never into the holder.
|
||||
- **Logic and state layouts only your module owns**, where it holds no seat for them, are your module's own package;
|
||||
another repository's module imports it only by a published version, so your manifest declares it as a package
|
||||
artifact.
|
||||
- **Logic your domain's modules share, owned by no one module and carried by no seat**, is your domain's SDK's
|
||||
(`mesh-<domain>-sdk`); only what modules of more than one domain use goes into mesh-sdk.
|
||||
- **Holding a seat** means implementing its contract in your module. A seat you define yourself gets a contracts
|
||||
module of its own (it may share your repository); a role no other module could ever take over is your module's
|
||||
own tools and events, not a seat.
|
||||
|
||||
The review of the pull request checks this; the checks design 26 lists refuse a stray file in a contracts module,
|
||||
a seat named in mesh-sdk and a client reaching another seat's client.
|
||||
The review of the pull request checks the home of every new exported name; the checks design 26 lists refuse a stray
|
||||
file in a contracts module, a seat named in mesh-sdk, an import of a contracts module from mesh-sdk, and a client
|
||||
reaching another seat's client.
|
||||
|
||||
## What the first port actually cost
|
||||
|
||||
|
||||
Reference in New Issue
Block a user