Repository navigation
Proposal Mesh Node Types
Status: DRAFT (for operator + WIN review) · Author: LINUX plane · Date: 2026-07-31 · Task: ephemeral-mesh Companion to: Proposal-Ephemeral-Mesh. Extends LBA-REQ-006 / LBA-REQ-007; builds on ADR-0003 (bus wire), ADR-0004 (UDP presence).
Open decision (needs operator sign-off): §4 (v2, self-reviewed) defines strict serialization as a sink's serialized ingest log (a dense
ingestSeq), keyed by(sessionId, senderId, seq)and closed by a terminalDONE. Default level = serialized; strict-reproducible is opt-in (§4.2). Confirm the default level. Nothing is implemented yet — this is the design gate before code.
Give every mesh actor a boot-time node type — source, sink, or both — and define the strict
serialization guarantee for the source→sink coordination stream. The node type is orthogonal to the
existing mesh-actors.csv lifecycle role (golden | mesh): role says how the VM came to exist,
node_type says what it does on the bus.
This promotes the pattern the repo already proves ad hoc — experiments/multi-vm-topology/ hardcodes a
collector (a sink) and a sender (a source); tools/collab-cli/ci/mesh-actor.sh is the symmetric
both — into a first-class, declared property a disposable clone can boot into.
| Type | Bus behavior | Binds listeners? | Emits frames? | Existing analog |
|---|---|---|---|---|
source |
emit-only producer: sends bus-msg@1 frames (CLAIM/PROGRESS/HANDOFF/DONE) + UDP presence |
no (TCP) | yes | multi-vm sender |
sink |
collect-only consumer: binds the reliable TCP + presence UDP listeners, ingests + serializes what sources send; the concentration point | yes | no (coordination) | multi-vm collector |
both |
full peer: simultaneously a source and a sink | yes | yes |
mesh-actor.sh today |
- A source never has to collect; a sink never has to produce; a both does the sink's ordered
ingest and runs its own source stream. The two halves of a
bothnode are independent (§5). - Comms-only stays law (LBA-REQ-007, ADR-0005): these frames are coordination, never run-data. Run data remains VM-local (LBA-REQ-009); cross-plane comparison is still by host concentration (LBA-REQ-010/014). A "sink" concentrates coordination, not benchmark payloads.
-
Identity record —
/etc/lba-mesh-actorgainsNODE_TYPE=source|sink|both(defaultboth= back-compat with today's symmetric mesh).lba-mesh.service/mesh-actor.shread it and start only the half/halves the type calls for. -
Topology spec —
mesh-actors.csvgains anode_typecolumn next torole, so a mesh is declared as N sources + M sinks + K peers. The Windows analog (mesh-actor.ps1) honors the same field (parity). -
Ephemeral clone — the orchestrator injects
NODE_TYPEat boot (same seam that already injects the identity + IP), so a throwaway clone boots directly into its type — no post-hoc reconfiguration, no reboot. This is the "cattle" property applied to roles.
The wire is already strictly framed: ADR-0003 §1 is a 4-byte big-endian length prefix + exactly that many
bytes of UTF-8 JSON, one envelope per frame, fail-closed on a bad length (BusWire, Net.cs). The
envelope already carries sessionId, a monotonic seq, and a ts.run clock. So "strict serialization"
is a guarantee above the wire: a sink merges the frames it receives from one or more sources into a single
ordered log, preserving each source stream's internal order. That log — not raw arrival order — is the
canonical sequence.
-
Stream key =
(sessionId, senderId). Each source stamps a per-stream monotonicseqstarting at 1, contiguous. A restart / reconnect / ephemeral re-clone opens a newsessionId(a fresh seq space), so a re-clone is never mistaken for a regression. (sessionId+seqalready exist inbus-msg@1.) -
Single serialized delivery stage. However many TCP connections a sink accepts, every received frame is
enqueued into one ordered queue drained by one consumer, which assigns each frame a sink-local,
dense, monotonic
ingestSeq(1..M). That log is the serialization output. -
Per-stream order is strict + reproducible. Within a
(sessionId, senderId)stream, frames appear in the log in strictly ascendingseq. (Over a single TCP connection TCP already delivers them in order; theseqcontract catches reconnect / duplicate / multi-connection anomalies and makes the order attestable offline.) -
Cross-source interleave is a valid linearization — honestly NOT run-reproducible. When several sources
feed one sink, their streams interleave by authoritative arrival at the sink (never the sender wall
clock — the clock-skew rule,
ci/cases/linux-clock-skew-surfaced.json). The interleave is a function of what arrived when; a re-run may interleave differently. The default mode does not claim a reproducible cross-source order (see §4.2). -
Explicit end-of-stream. A source ends each stream with a terminal
DONEframe carrying its finalseq(= the count). A sink asserts it saw exactly1..Nand theDONE(N)— so a truncated stream (1..3when5were meant) fails instead of passing silently. -
Fail closed. A
seqgap, duplicate, regression, a missing terminalDONE, or an ingest-queue overflow (the queue is bounded; TCP backpressures a slow sink) →inOrder:false→ the receipt fails. -
Idempotent replay. A re-delivered frame (same
sessionId+senderId+seq) is de-duplicated — it does not consume a newingestSeq. - Presence is out of band. UDP presence beacons (ADR-0004, advisory liveness) are not in the serialized log — they answer "who is alive", not "in what order did work happen".
Why this shape: it is local (each sink is self-contained — no global coordinator or contention),
honest (per-stream order is reproducible; the cross-source interleave is not over-claimed), and it reuses
the primitives already in the bus (sessionId, seq, ts.run, authoritative-time) — matching the project's
deterministic-record ethos (mprr monotonic ordering) without inventing a distributed sequencer.
- Serialized (default). Every sink produces its own ingest log (§4.1): per-stream order is strict + reproducible; the cross-source interleave is a valid linearization (not run-reproducible).
- Strictly-reproducible (opt-in). For a reproducible cross-source order, admit one active source at a time via a token (single-writer window). The interleave then equals the token order — reproducible — at the cost of source concurrency. Enable it only where a byte-identical global order is required.
- Global total order = a single-sink topology. No separate "sequencer" is needed: declare one sink and its ingest log is the mesh-wide order (combine with the opt-in mode for a reproducible global order). This collapses the old "global order" and "single-writer" alternatives into topology + a mode.
- Rejected: wire-framing only — too weak (no cross-frame / cross-stream order, no offline attestation).
The sink records enough that a dependency-free validator recomputes the property with no live mesh: given
the frames { sessionId, senderId, seq, ingestSeq } + the terminal DONE(N) per stream, assert (a) each
(sessionId, senderId) substream is contiguous 1..N, (b) its frames appear in increasing ingestSeq,
(c) ingestSeq is dense 1..M with no duplicate, and (d) a terminal DONE(N) closed each stream. Any
miss → fail. Strict serialization is thus a fails-closed, re-runnable gate, like every other receipt.
-
source — emits a contiguous
seqper(sessionId)stream, ended by a terminalDONE(N); may retry a frame (idempotent bysessionId+seq). -
sink — the serialized ingest of §4; terminal (a leaf — it does not relay/forward, so there is no
seq-translation); emits the
orderedReceipt(§6). -
both — sinks inbound streams under §4 and runs its own source stream; the
seqspace it emits is independent of the streams it sinks. Aboth↔bothpair (today's symmetric mesh) is just two nodes each simultaneously sourcing and (strictly) sinking. -
Trust boundary.
senderId/sessionIdare self-declared and trusted within the private-intnet sandbox of known actors (ADR-0004/0005 private binding). Strict serialization is an integrity + ordering contract, not a security boundary against a hostile in-sandbox node.
-
meshModegains"typed"; eachnodes[]entry gainsnodeType: source|sink|both; the run recordsserializationMode: "serialized" | "strict-reproducible". - A sink node records an
orderedReceipt:orderedReceipt: { ingestSeqDense: true, totalFrames: M, perStream: [ { sessionId, senderId, firstSeq, lastSeq, count, contiguous: true, inIngestOrder: true, terminalDone: true } ], orderKey: "(sessionId,senderId,seq) within a stream; cross-source by sink ingestSeq (arrival)", strictSerialization: true } -
assertsgainstrictSerialization: trueandnodeTypesHonored: true. The offline validator (ephemeralMesh.mjs) grows atypedbranch performing the §4.3 recomputation and fails closed.
- Unknown
NODE_TYPE→ node refuses to start. - A sink observing a
seqgap / duplicate / regression, a missing terminalDONE(N)(truncation), or a bounded ingest-queue overflow →inOrder:false→ receipt fails. - Non-dense
ingestSeq(a hole or duplicate in the sink's own log) → fail. - A declared
sourcethat binds a listener, or asinkthat emits coordination frames → contract violation → fail (types are enforced, not advisory).
-
P2a —
NODE_TYPEin/etc/lba-mesh-actor+mesh-actor.sh/mesh-actor.ps1branch on it (start listeners forsink|both, the send/beacon loop forsource|both). -
P2b — the sink's serialized ingest: a single delivery stage assigns a dense
ingestSeq, keys streams by(sessionId, senderId), checks contiguity + the terminalDONE, and emits theorderedReceipt. (First as sink-side post-processing oflbabus net listenoutput; a nativelbabus net listen --orderedthat assignsingestSeqin-process can follow. The opt-in strict-reproducible token mode is a later add.) -
P2c — the ephemeral orchestrator boots a source → sink pair and seals the in-order receipt;
both↔bothremains the symmetric case (the current 2-node scaffold).
Same NODE_TYPE field, same serialization contract on the Windows plane (mesh-actor.ps1), same receipt —
so a source on one plane and a sink on the other is a valid, gate-able cross-plane mesh (feeds P4).
Stress-tested on the working Ubuntu box (6 vCPU, lbabus 0.11.0), loopback to isolate the pipeline from the network. Re-runnable via throughput-stress.sh.
| Path | Throughput | Bound by |
|---|---|---|
| One source (sequential seq'd sends) | ~3.5 frames/s | per-frame net send process spawn + ack |
| Fan-in: F concurrent sources → 1 sink | ~87 frames/s (flat for F ≥ 16) | CPU-saturated process spawn — one lbabus process per frame (~14.5 spawns/s/core on 6 cores) |
| Sink ingest (the §4 serialization algorithm) | ~2.3–3.5 million frames/s | pure in-memory O(M); ~40,000× headroom — never the limit |
Findings. (1) Strict serialization held at every scale tested (up to ~2k live frames and 4M synthetic):
zero loss, dense ingestSeq, per-stream order intact — the design is correct under load. (2) The upper
limit is the emit side: the one-process-per-net send model caps aggregate throughput at the box's
sustained process-spawn rate (~87 fps here). Source concurrency hides per-send ack latency (3.5 → 87 fps) but
cannot pass the CPU spawn ceiling. (3) The sink is ~40,000× faster than any source can feed it, so
serialization is never the bottleneck.
Interpretation. This is the right shape for a coordination bus (CLAIM/PROGRESS/DONE at mesh-event rates, LBA-REQ-007) — it is deliberately not a run-data pipe (run data stays VM-local, LBA-REQ-009).
To raise the ceiling (only if ever needed): replace the per-frame emit with a single streaming
lbabus net send over one persistent TCP connection (amortizing spawn + connect), moving the cap from
~10² toward the wire/sink limit (~10⁶). That is an lbabus (C#) change on the release-gated P2b+ track, and is
not required for coordination.
Generated from docs/proposals/mesh-node-types.md on develop. Edit the source in the repository, not this page.