Simulation
PartialOmniglass ships a component simulator in the same binary (the top-level sim/ tree, see its README). It serves a fleet of
fictional AV and IT components, each on its own loopback address, speaking the protocols real gear
speaks (HTTP and HTTPS, SNMP, SSH, Telnet, raw TCP line protocols and the same over TLS, UDP,
WebSocket, server-sent events, signed webhooks), all from one live state per component. An outpost
collects from a simulated component exactly as it would from hardware, and a write over one protocol
shows in every protocol that reads it.
That makes the simulator two things. It is the test bed: the end-to-end tests, the screenshot harness and the lab all collect from a real fleet. And it is a teaching surface (learning tool): an operator can watch the monitoring loop work against components they can break on purpose. The operator’s walk-through is the simulation guide.
The catalog
Section titled “The catalog”Everything a simulated component is comes from the families compiled into the binary (sim/component), so
nothing is read from disk. There is one kind of component: a Go family, a package under sim/component/
that exports func Spec() spec.Spec. A family is one wire API implemented once, its models the rows of a
typed table (spec.Table, so five sizes of one display are five rows, not five packages), its HTTP routes
and line commands Go funcs the engine’s servers call, and its responses typed Go values the engine
encodes. A package is a family only if it declares that func, and the list of families is generated by
make gen from the directories, never hand-kept. A component is not described in a file and no template
renders its answers; a component’s web page is html/template over a typed view struct, both embedded in the
family’s package (the history is below).
Every family and every model in it is generated from the code, so this table cannot drift from it:
| Package | Serves | Faces | Models |
|---|---|---|---|
bookingservice | Room-booking platform's integration: pushes each booked location's day, read off the lab calendar, through /telemetry:push | none (it reports by pushing) | booking-service |
borealbeam | Boreal Beam laser installation projector | http 80, snmp 161, icmp | boreal-beam-340 (boreal-beam-snmp) |
borealcast | Boreal Cast digital signage media player | http 80, icmp | boreal-cast-m1 (boreal-cast-api) |
borealedge | Boreal Edge 4K commercial display | http 80, snmp 161, icmp | boreal-edge-55 (boreal-edge-snmp), boreal-edge-65 (boreal-edge-snmp), boreal-edge-75 (boreal-edge-snmp), boreal-edge-86 (boreal-edge-snmp), boreal-edge-98 (boreal-edge-snmp) |
ferritepdu | Ferrite PDU 4C, networked rack power conditioner | http 80, snmp 161, icmp | ferrite-pdu-4c (ferrite-pdu-snmp) |
genericcomponent | Generic unclassified SNMP device | snmp 161, icmp | generic-device (snmp-generic) |
kestrelgaze | Kestrel Gaze P2 PTZ camera | http 443 (tls), icmp | kestrel-gaze-p2 (kestrel-gaze-api) |
kestrelrelay | Kestrel Relay C1 conferencing codec | http 443 (tls), icmp | kestrel-relay-c1 (kestrel-relay-api) |
kestrelvroom | Kestrel VRoom video conferencing bar | http 443 (tls), websocket 9443 (tls), icmp | kestrel-vroom (kestrel-api) |
lyraarc | Lyra Arc A2, ceiling array microphone | http 80, snmp 161, icmp | lyra-arc-a2 (lyra-arc-snmp) |
lyrahx | Lyra HX-1, wireless microphone system | http 80, snmp 161, icmp | lyra-hx-1 (lyra-hx-snmp) |
meridianextender | Meridian XL AV extender | http 80, snmp 161, icmp | meridian-xl-1 (meridian-xl-snmp) |
meridianswitcher | Meridian MX presentation switcher | http 80, snmp 161, icmp | meridian-mx-84 (meridian-mx-snmp) |
newtroncore | Newtron Core control processor | tcp 51325, icmp | newtron-core-3 (newtron-core-nvp) |
newtronpanel | Newtron Panel touchpanel | http 443 (tls), ssh 22, tcp 51325, tcp 51326 (tls), telnet 23, udp 51327, snmp 161, icmp | newtron-panel-7 (newtron-panel-nvp) |
newtronslate | Newtron Slate scheduling panel | tcp 51325, icmp | newtron-slate-5 (newtron-slate-nvp) |
polarisamp | Polaris Amp 4-100, 4-channel power amplifier | http 80, snmp 161, icmp | polaris-amp-4100 (polaris-amp-snmp) |
polarisdsp | Polaris DSP 16, 16-channel audio DSP | http 80, ssh 22, telnet 23, tcp 1710, snmp 161, udp 9000, icmp | polaris-dsp-16 (polaris-dsp-snmp) |
recordingservice | Shinra recording service: health, work counters and a failure feed over https | http 443 (tls), icmp | recording-service (recording-service-api) |
schedulingservice | Cloud room-booking / scheduling platform (bookings + config) | http 443 (tls), icmp | scheduling-service (scheduling-service-api) |
tessellatecensus | Tessellate Census C1 ceiling people counter | http 80, tcp 5000, tcp 5001, icmp | tessellate-census-c1 (tessellate-census-http) |
uccplatform | Account-wide meeting platform: every room's and device's state over one API and one webhook | http 443 (tls), icmp | ucc-platform (ucc-rooms) |
A product resolves to the family that claims it (its name, or one of its models). A family may not share a name with another, and two families may not claim one product. A family’s routes and commands are listed on its surfaces, so the console shows its API as the component answers it, and a component of a different kind never stands in for another, even on the same driver: the catalog’s alignment test refuses a family whose models have different drivers or component types.
What a family is made of
Section titled “What a family is made of”A package is its model table, its Spec, and what answers on each surface, and nothing else:
- Models are
spec.Tableover the family’s own typedRow. A model reports itself: its row names its model and its summary, its overlay puts that name in the component’s state (so SNMP’s sysDescr, the status document and the dashboard all say “Edge 98” for a 98-inch), and the catalog resolves its identity for the consoles that list a product. A family of one is named for its product. - Interfaces are
wire.Interfacevalues: protocol, port, TLS, auth and, for a line protocol, the framing (wire.Interfaceis the vocabulary a family declares its faces in; nothing in it is read from a file). - JSON is a typed struct encoded by
httpapi.Document, orhttpapi.Statusfor the identity block many families repeat. Control routes arehttpapi.Control: the state paths a body field sets, its choices or a number or a flag, checked before anything is written, answering an acknowledgment built from the state it left. The same declaration lists the route’s quick sets to the console and registers the paths for the console’s fault chip, so the listing and the handler cannot differ. A reboot ishttpapi.Action, one change of several paths with the component’s clock and its defaults. A control on one element of a list ishttpapi.Element, and a paged list declares its names once (httpapi.Paging). - SNMP is
sim/surface/snmp(the system group and the identity arc) and typed scalars (surface.Text,surface.Integer) each naming the state path it reads, so the console lists it and an operator can fire a get at it. A line protocol issim/surface/nvpor asurface.Commander, listed on the face that serves it. - A web page is
html/templateover a typed view struct, both embedded in the package. The markup names no state path; the script is a static asset spliced in as written, because the template engine would otherwise drop its comments. - Behavior is
spec.Ticks fromsim/component/internal/bind, which joins asim/behaveprimitive to the state paths a family keeps it in: the panel follows its room (PowerFollowsRoom), a reading wanders in a band (Drift), a lamp ages only while lit (Wear), a sign follows the building’s day (BuildingDay) and steps its playlist (PlaylistAdvance). A tick declares the paths it writes, listed beside the family’s behaviors on the console, and may name events it reports on the component’s feed (Tick.Emit). A room with no calendar is the primitive’s fallback, never the family’s. - Uptime is
spec.Elapsed, read-derived with no goroutine and no event. - Services read the rooms they speak for through
spec.RoomsOf(d), send a webhook withspec.Send, push withSpec.Pushand subscribe a sender withSpec.Webhook.
spectest.Conform holds any family to what the engine and console rely on, over every row of its table, and
the family’s own tests cover what is its own. A spectest.NewFake stands in for the component, so a handler, a
surface and a tick are unit tests with no engine.
Adding a component
Section titled “Adding a component”A new component is a new package, written test first. The worked example is a small lamp: one model table, one JSON route, one control, SNMP uptime and one tick.
-
The model table. A typed
Row, wrapped withspec.Table:package glowlamptype Row struct{ Product, Model string; Watts int }var Rows = []Row{{Product: "glow-lamp-40", Model: "Lamp 40", Watts: 40},{Product: "glow-lamp-60", Model: "Lamp 60", Watts: 60},} -
The spec. Identity, the rows as models, the face, the state and what answers on it. The product must be one the boot seed ships: the alignment test fails a family naming one it does not.
func Spec() spec.Spec {return spec.Spec{Name: "glow-lamp",Identity: spec.Identity{Manufacturer: "Glow", ComponentType: "lamp", Summary: "Glow smart lamp"},Models: spec.Table(Rows, func(r Row) spec.Model {return spec.Model{Product: r.Product, Model: r.Model, State: map[string]any{"configuration": map[string]any{"device": map[string]any{"model": r.Model}}}}}),Interfaces: []wire.Interface{{Name: "api", Protocol: "http", Port: 80}},State: map[string]any{"status": map[string]any{"lamp": map[string]any{"power": "on"}}},HTTP: routes(), // httpapi.Document for the status, httpapi.Control for powerTicks: []spec.Tick{bind.Drift("warmth", bind.Seconds(60), "status.lamp.warmth", behave.Band{Lo: 20, Hi: 60, Step: 1})},}} -
Register and test.
make genadds the package to the generated list of families and to the docs table above.spectest.Conform(t, Spec())runs over every row, and the family’s own tests drive a handler against aspectest.NewFake. A capture of the real device can be held to the family through the wire replay seam (sim/wire_replay_test.go, below). -
Account for it. A seeded product on the network that no family serves is listed in
sim/component/coverage.gowith its issue; a product served by a family is dropped from that list.
What proves a family answers what the shipped drivers read is the driver contract test
(TestEveryShippedDriverPollResolvesAgainstItsSimulatedFamily, internal/collection/drivercontract_test.go). It is
generated from the boot seed and the shipped catalog, with no list to keep: for every seeded product that
has a polled driver and a family that serves it, the test starts the component on loopback and runs each of
the driver’s polls through the real collection path (the SNMP, HTTP, HTTPS and line clients, with the
simulated fleet’s own credentials), then requires every metric and property the poll declares to resolve
to a value. A family that stops answering a field a driver reads fails naming the product, driver, poll
and signal. The test logs what it skipped and why (a product with no driver, a driver that only listens
or is pushed to, a driver that rides a held websocket).
Coverage is accounted, not hoped for
Section titled “Coverage is accounted, not hoped for”Every seeded product on the network is a model of a family or is listed, with its issue, in the
coverage accounting (sim/component/coverage.go). A product with no network interface (a passive speaker,
an analog microphone) is listed as passive, with how the fleet watches it instead (an amplifier
channel’s load, a DSP input’s level), and a passive product with a driver is refused. Tests hold the catalog
and the dev seed’s own components to that list, so what is left to simulate is always current, and the
tables are generated from it:
No seeded product on the network is left to simulate: every one is a model of a family.
| Passive product | How the fleet watches it instead |
|---|---|
lyra-gn-12 | an analog gooseneck microphone; the DSP input it is wired to reports its level and mute (#1367) |
polaris-sky-c6 | a passive loudspeaker; the amplifier channel driving it reports its load (#1367) |
A new family lands at its class floor (#1266): its driver reads at least one signal of its class off the component’s own API, beyond identity and uptime. The amplifier family is the pattern: its SNMP agent answers chassis power, the protect state it latches on a fault, the heatsink temperature and fan, and the driver reads them, while its HTTP API is its control face.
The catalog holds components and nothing above them: no room archetype and no fleet layout, since a simulated system is built to the platform’s own standards (fleets, ADR-0914). It names only fictional vendors, as the boot seed does, and a test refuses a real company’s name.
How the catalog came to be Go
Section titled “How the catalog came to be Go”The simulator began as YAML component profiles and response templates, and moved to Go families one wire API
at a time (#2826, ADR-2829).
Parity with the profile was proven, then the proof was retired. Before each profile was deleted a recorder
played one script against it (every route valid and refused, SNMP gets and walks, the drift its seeded source
draws, a pinned room day with and without a calendar, each line protocol’s conversation and every event and post)
and the family was held to the transcript: status, headers, bytes and state of every answer, SNMP types and values,
and every behavior’s sequence. The families kept the profile’s wire byte for byte and corrected only its accidents,
each correction an ADR
(ADR-2832,
ADR-2834,
ADR-2835,
ADR-2836).
When the last profile went (#2837) the YAML store, its schema, the loader, the surface fragments and every
response and behavior template went with it, and a guard test fails the build if one comes back. The recorded
goldens, the recorder and the parity hooks (Frozen, Quirk, Diverges) went too: with no YAML left to compare
against, they proved nothing a family’s own tests do not.
What stays is the replay seam (sim/wire_replay_test.go): a transcript is JSON for one product, the requests
of a script with each one’s status, headers, body, whether it moved state, the named events it published and
optionally the state after, and replayWire plays it against a Go family and reports every difference by step.
It is where a capture from a real device plugs in: write the capture as a transcript, name the family, replay.
sim/wire_replay_seam_test.go proves the seam against borealedge and that an altered expectation fails.
What the conversions settled is written once, for the next family:
- A route or a tick reports a named event on the component’s feed (
Component.Publish,Tick.Emit), numbered with the state changes the feed streams and replayed to a reconnect as they are. A route a page calls but does not advertise isPrivate. A control route can write the changes a field implies beside it (httpapi.Control.Also), and a document that kept a template’s comment lines keeps them (httpapi.Annotated), because a collector reads the bytes. - A command is listed under the face that serves it (
Command.Face); a control route may take free text held to a pattern (httpapi.Text); a tick reads its room’s booked meetings (TickContext.ReadBookings). A push line is a Go func of the subject, the token and the value (wire.Subject.PushLine). - A service that speaks for many rooms reads them through
spec.RoomsOf(d); a component that reports by pushing declaresSpec.Push, and one a lab subscribes to a webhook endpoint declaresSpec.Webhook. - Text stays text: a value the old templates coerced (an id of digits into a number) is stored as the string it is, and a field that is not a string is refused.
Fleets
Section titled “Fleets”The catalog defines no fleet. A fleet is one of two things, both built from the platform’s standards:
- the dev fleet: the dev seed’s own systems, each component a family serves given an address and endpoints on the dev outpost (below);
- a scale lab scenario: a manifest (
internal/lab/scenario/manifests) naming standards from the template catalog, the system type of each, the catalog product filling each slot, and how many sites of which shape hold how many systems. The lab seeds the plan it resolves to, and a product the simulator does not serve is refused.
A component’s identity is a function of its id wherever it is listed: fleet.Enrich fills the hostname,
serial, MAC and address a family leaves blank, the same id giving the same serial across restarts
and reseeds.
One component, every protocol, one state
Section titled “One component, every protocol, one state”The engine gives each component a listener per protocol surface on the component’s own address, and every
listener reads and writes the same state tree. A DSP’s HTTP gain route writes a channel’s gain; its
SSH show channels renders it; a line-protocol session subscribed to that path receives a push; its
SNMP agent answers the mapped OID from the same tree. SNMP is read-only (v1 and v2c GET, GETNEXT,
GETBULK and walk; no SET and no traps).
Every request a component answers arrives on one hit stream (the component, protocol, operation, port and status), and session lifecycle (a line session opened, closed or pushed to) on another.
Addresses and ports
Section titled “Addresses and ports”A component’s address is a loopback address (127.x.y.z). On Linux every 127.0.0.0/8 address is
local with no configuration, and the kernel routes a connection by its destination, so a component
answers on its own address alone: a TCP connect to an address with no component is refused. Two facts
shape where the simulator runs:
- Every loopback address answers ping, component or not, because the kernel answers ICMP. For ping
to tell the truth, a firewall rule must drop the addresses with no component, which needs
NET_ADMIN. - Ports below 1024 need a privilege (SNMP 161, SSH 22, HTTP 80 and 443).
Docker is how the lab gets both, confined to one container.
Fixed ports and ephemeral ports
Section titled “Fixed ports and ephemeral ports”Each protocol surface a component serves is a face: one listener. Every face takes its port from one port map the caller picks, binds it, and records the address it got. There is one bind path, so the two choices differ only in the port asked for:
- Fixed (
sim.PrivilegedPortShift(offset)): every face binds the port its family declares, ports below 1024 lifted by the offset. This is the operator-facing simulator, where an operator, a seeded endpoint and these docs all name the same port (a display’s SNMP on 161, or 10161 when lifted by 10000; a panel’s line protocol on 51325, above the lift). - Ephemeral (
sim.EphemeralPorts): every face binds port 0 and reports the port the kernel gave it. Tests serve this way, so two runs on one host never collide over a port. A test that drives the run mode out of process cannot learn a picked port, so it keeps the fixed ports and claims a loopback address no other test holds (simtest.ClaimLoopback).
What the faces do
Section titled “What the faces do”Each face is a working protocol endpoint with the failure modes a collector must handle, so a driver is proven against a real wire:
- TLS. A line face may declare
tls: trueand serve its protocol behind a real handshake; an http face withtls: trueserves HTTPS. Each key is derived from the component’s id, so it is the same on every run and an endpoint that pinned it stays up across a simulator restart. The simulator protects nothing, and a key anyone can derive from a public id says so. A family can serve a certificate near expiry (TLSValidityDays). - HTTP auth. An http face’s
authisbasic,header,bearerorquery, answering a wrong or missing credential with 401, or it signs in:form(a sign-in page and a session cookie),token(a JSON login answering a token and its lifetime) ordigest(RFC 7616). FiringPOSTat the face’sexpire_pathends every session, as a reboot would, so a collector’s re-login can be watched. - Event streams. An http face may declare
events: a server-sent events stream where every change to the state paths it names is one numbered event, and a reconnect’sLast-Event-IDreplays from that event, itself included, so a collector’s dedup is exercised on every resume. - WebSocket. A control socket of JSON text frames:
subscribepushes every change to the paths it names,getis answered by aresultcarrying the request’sid, andseton asettablepath pushes the change to every subscriber before itsresult. - SNMP. A v2c face answers its own community and silently drops any other, as a real agent does.
It may also declare a
refused_communityit answers withauthorizationError, the one auth refusal v2c makes detectable. - Datagrams. A udp face declared
persistent: trueserves the line protocol one datagram a line, each source address its own session; without it, the face is an echo. It drops a share of datagrams each way (loss_pct), seeded per datagram (by the component, face, direction, bytes and how many times those bytes crossed), so a test on a lossy face repeats.
A face with an expire_path or a drop_path can be driven from the console, and each has
test-harness hooks (counting handshakes, refusals, logins, upgrades) that a test reads to tell a
gated collector from a retrying one.
Beside an outpost
Section titled “Beside an outpost”The simulator runs beside an outpost and holds that outpost’s credential
(ADR-0142),
so it can pull only that outpost’s components, report hits only on them, and answer only the operations
the server asks of that outpost’s simulator. omniglass sim run reads the same OMNIGLASS_SERVER,
OMNIGLASS_OUTPOST_NAME and OMNIGLASS_OUTPOST_TOKEN as outpost run.
Every pull (--poll, ten seconds by default) asks the server for each component with an endpoint on
the outpost, its product and the host its endpoints target, and serves the ones a family serves at a
loopback address. A component added on the server starts on the next pull and a removed one goes dark,
with no restart and no disturbance to the rest. About once a second the simulator reports the hits it
saw and the components it is serving.
The server accepts hits only for components it handed that outpost, by a closed set of protocols
(http, snmp, ssh, telnet, tcp, udp, websocket), and keeps them in memory as a live
signal (sim/simhub). GET /outposts/{name}/simulation (omniglass outpost simulation <outpost>) joins them to the outpost’s components, each with a status: running, starting,
failed or offline. These are the simulator’s own words, so they never borrow reachability’s or
health’s values. A simulator silent for a hundred seconds is forgotten, and deleting the outpost
forgets it at once. Because hits live in one server process, a second replica sees no simulator; that
is accepted while the server runs as one (scaling).
The world it holds
Section titled “The world it holds”The server’s list says which components to serve and nothing of where they sit: no site, building or
room. The simulator does not ask. The sim is; Omniglass learns. The simulator holds the world it
simulates (sim/world): the sites, the rooms with their standard and capacity, each room’s planned
components, the services that speak for rooms, the meeting knobs per standard and the calendar seed. It
reads that world from a file the lab wrote from the scenario, at the path in OMNIGLASS_SIM_WORLD,
and never from the server or its database; Omniglass learns the world only by collecting from it. The one
reader beside the simulators is a lab server’s own ground-truth route, which reads the same file to
serve the calendar back and feeds nothing it reads into detection.
With the file, sim run (and outpost run --simulate) builds the lab calendar
from the world’s seed and knobs and installs it on the engine, so a family’s tick reads a real room (TickContext.Room). With
none there is no calendar and no room, as before.
Each pull is joined to the world by the component’s name. The world gives every planned component
a name of its own, <system>-<slot>-<n> (unique across the plan), and the lab’s scale seed onboards
the component under exactly that name, so the join is an exact lookup and Omniglass’s own naming is
never replayed. A component the world names takes its site, building and room from it, which fills the
identity tokens {site}, {building}, {room} and {room-device:...} in its default state and the room
the component’s own reads use; a component it does not name keeps empty room fields. A service
resolves a push’s owner system to a room through the world (spec.RoomsOf(d)) and lists the rooms it
speaks for (Covered).
What an endpoint observed
Section titled “What an endpoint observed”A hit says a component was touched, not whether every request arrived or how each ended. For that, every
simulated endpoint keeps an observation (sim/observe.go): counters that never reset, so
a reader takes two reads and the difference. It counts three units, each matched with what the outpost
tallies sending:
- a connection, counted where a TCP face accepts it, with a gauge of those open;
- a request (an http request, an SNMP datagram, an ssh exec, a line, a datagram, a frame),
settled with exactly one outcome:
answered,refused(401 or 403, a wrong community or password),error,dropped(the client hung up first) orwithheld(the simulator’s own planted loss, so a fault never reads as loss of the path); - a stream (an event stream, a websocket upgrade), counted once as opened, never a request in flight.
Beside them each protocol keeps a service-time histogram with fixed buckets, so histograms from many outposts merge by summing, and each face counts the requests that found it already serving one, since an outpost should never send a face two at once.
GET /outposts/{name}/simulation/observation reads the simulator, then the outpost’s own tally
(collection.RequestTally), then the simulator again, so a request in transit is inside the bracket,
never a gap. A scale lab reconciles it hop by hop
(measuring a scale lab), and a running server does so
continuously (internal/closedloop), shown on
Platform health. Each read carries the simulator’s
fleet_generation, so a window across a change to the served fleet reads restarted rather than as
loss
(ADR-1895).
In the outpost’s own process
Section titled “In the outpost’s own process”omniglass outpost run --simulate runs the same simulator inside the outpost’s process, the two side
by side under one context (simoutpost.RunWithOutpost). Loopback addresses belong to a network
namespace, and the kernel never routes 127.0.0.0/8 off lo, so in one process the simulated components
sit on the loopback the outpost collects from by construction. Both halves share the outpost’s name
and token, so there is no second enrollment. --impairments, --port-offset and --poll are the
simulator’s flags, refused without --simulate. When either half stops, the other is stopped.
With --impairments, root and NET_ADMIN sit on the outpost process, so the mode belongs in a
container of its own, where the privilege reaches only that namespace. The impairments touch only the
simulated components’ addresses; the outpost’s traffic to the server is never shaped.
The dev fleet
Section titled “The dev fleet”The dev seed simulates its own fleet. Every component whose product a family serves gets an address
in 127.60.0.0/16 and endpoints on the dev outpost, edge-hq. A product whose driver has a spec gets
that driver attached, with the credential its face demands seeded as a platform secret; the attach
table is sim/simfleet. A product whose driver is still a stub gets a reachability probe on its
family’s port. For a simulator that may not bind below 1024, omniglass seed-dev --sim-port-offset 10000 aims the endpoints at the lifted ports.
Beside those, the fixtures wire:
- planted faults (#1193), each a lesson to find and fix: a panel’s telnet console logging in with the password from before a rotation (a rejected session), a panel’s ssh endpoint pinning the host key it had before it was reimaged (a changed key), and an SNMP endpoint naming the community its agent refuses (the probe gate);
- every collection method healthy on one location (#1370): the drivers the rest of the fleet
never attaches, the healthy twins of the planted faults, and a bare
icmpprobe; - a webhook sender, a meeting platform the simulator subscribes to its webhook endpoint (below);
- a pusher, a booking service that pushes a system’s bookings (below).
Every collection method in the dev fleet
Section titled “Every collection method in the dev fleet”| Method | Kind | Rides | Component | Location | Endpoint | Health |
|---|---|---|---|---|---|---|
ucc-webhook | driver | webhook | ucc-platform | Headquarters | Room webhooks | healthy |
newtron-nvp-telnet | driver | telnet | huddle-touch | Huddle Room | Panel console | planted fault |
newtron-nvp-tls | driver | tls | huddle-touch | Huddle Room | Panel over TLS | healthy |
newtron-nvp-udp | driver | udp | huddle-touch | Huddle Room | Panel over UDP | healthy |
newtron-nvp-ssh | driver | ssh | briefing-touch | Briefing Room | Panel SSH | planted fault |
snmp-generic | driver | snmp | auditorium-touch | Auditorium | Panel SNMP | planted fault |
kestrel-ws | driver | wss | bar-a | Boardroom A | Bar control socket | healthy |
tessellate-census-feed | driver | tcp | census-a | Boardroom A | People counter feed | healthy |
boreal-edge-web | driver | http | panel-a | Boardroom A | Display web admin | healthy |
newtron-panel-web | driver | https | touch-a | Boardroom A | Panel web | healthy |
newtron-nvp-ssh | driver | ssh | touch-a | Boardroom A | Panel shell | healthy |
newtron-nvp-telnet | driver | telnet | touch-a | Boardroom A | Panel Telnet | healthy |
ferrite-pdu-api | driver | http | power | Boardroom A | PDU control | healthy |
icmp | transport | touch-a | Boardroom A | Panel ping | healthy | |
push-listener | the shared push listener is not built (not in the binary) | gap, #1148 | ||||
snmp-trap | the SNMP trap transport is not built (not in the binary) | gap, #1150 | ||||
syslog | the syslog transport is not built (not in the binary) | gap, #1149 | ||||
websocket | no simulated device speaks a plain ws face, and no driver rides it | gap, #1414 | ||||
TestEveryCollectionMethodRunsOnAHealthyLabComponent holds the fleet to this table: every seeded
driver and every transport in the transport registry runs on a component a family serves, by an
endpoint that is no planted fault, or is listed as a gap with its issue. A method counts on both
tiers: a driver only when it lands collected values, icmp on its connection tier (a ping has no
component API to read), and the push lane on its collected tier (a push has no endpoint). make test-lab
proves it live, and holds every component and system to a value of its own, bar the gaps
devseed.TierGaps lists (checking the lab).
The lab runs the dev fleet with edge-hq serving it in process, so the whole loop is one command:
the outpost polls the simulated components, the samples land on the seeded components, and a command
issued to a panel changes the simulated panel.
Breaking a component on purpose
Section titled “Breaking a component on purpose”An impairment is what an operator has broken on a simulated component, recorded on the component and applied by the simulator beside its outpost:
- unplugged: dark on every protocol; a connect times out rather than being refused, and ping goes unanswered;
- latency and jitter: a delay, with variation, on traffic toward the component;
- loss: a share of packets toward the component dropped;
- rate: a bandwidth limit on the component’s link, both ways.
PUT /components/{name}/impairment sets the whole impairment (a field left out reads as zero, so an
empty set repairs the component) and GET reads it, gated by simulation:update and simulation:read
in the caller’s component scope, the write audited. The simulator applies it only when started with
--impairments and holding NET_ADMIN: it rewrites its namespace’s firewall and traffic shaping
through netlink, owning one nftables table and one root qdisc on loopback, cleared when it stops. With
them, ping tells the truth.
A component can also be broken through its own API. A family’s control route that sets a state path to a fixed
list of values is a quick set (#2462), offered in the console as a named action (Power off,
Input: hdmi2), and the simulator reports each component’s faults, the settable paths held off their
defaults, which the component’s row in the fleet read carries. An unplugged component’s endpoint reads
down, and the official reachability-lost event rule
opens an alarm on it after its sustain.
Exercising a simulated component
Section titled “Exercising a simulated component”GET /components/{name}/simulation lists every protocol surface a simulated component serves, with
its routes, commands and OIDs. POST /components/{name}/simulation:fire fires any of them: the server
forwards the operation over the bus to the simulator beside the component’s outpost, which answers it
in process from the component’s live state, through the same routes, commands and OID map its listeners
use. A command’s change sticks, so the outpost reads it on its next poll; and since it does not cross
the network, an impairment does not stop it.
A route can also report named events once its change applies (a codec’s dial route reports
call-started), a line face can push log lines and scene changes to its subscribers, and a route or
a behavior can post a webhook, signed as a real sender signs one (hmac, token, basic or
none). A webhook fault posts as a sender gone wrong: a bad signature, a stale timestamp, or one
delivery sent twice. These are the faces the shipped drivers’ event, log and webhook emits are proven
against
(ADR-1145,
ADR-1024).
A component talks on its own
Section titled “A component talks on its own”A behavior is a timer on one component, a family’s Tick: each tick returns the state paths to write, the
engine applies them to the live state, then reports the tick’s named events (Tick.Emit) on the
component’s events face, as a route does, read from the state the writes left. A tick that has no event
this time returns none, so its own condition says when it fires; and a tick streams only what it changed, so a timer that rewrites a
watched path with the value it already holds puts nothing on the feed
(ADR-2754).
A tick reads the wall clock through its component’s clock (TickContext.Now) and draws from its component’s
seeded source (TickContext.Rand), so a
component keeps the same schedule on every run and a test drives a simulated day on a pinned clock
(ADR-2754.2).
No tick of a shipped family runs faster than 15 seconds: a component gets richer by reporting more
kinds of signal, not more samples (#1360).
The Kestrel VRoom shows what that buys (#2754). Every video bar in a lab acts out its room’s meetings
off the lab calendar, a tick a minute: one call per held meeting, starting and
ending at the first tick on or after the meeting does, none for a no-show. The call reports
call-started (the meeting’s id, at least half of who came) and call-ended, and in between a
participant joins or leaves now and then, never past who came (participant-joined,
participant-left). Each occurrence is also an event: log line in the codec’s idiom (a severity, a
facility such as kvroom.call, and its text), beside a status line every 15 minutes. A second
behavior, every 30 seconds, drifts the call’s packet loss (a ratio), jitter, bitrate, frame rate,
speaker level and microphone level while a call is up and rests them when the room is idle, drifts
the codec’s own load, temperature, fan and memory, and writes the WARN line a bar’s network log does
when loss crosses 3% and an INFO line when it recovers. On the corporate
lab’s calendar a bar runs about 1.7 named events and 6.7 log lines an hour (11 feed events counting
state changes), and the schedule is the room’s, not the bar’s own (a bar with no calendar keeps its own).
A call on demand still talks now: the bar’s own dial route starts one at once with its event and log
line, a meeting running under it is skipped, and it ends at the bar’s hang-up route or after
30 minutes, so a demo or a test can make a bar talk without waiting for a meeting. The
kestrel-api driver lands all of it from one held feed and two polls, and in the corporate lab’s
conference rooms the bar’s websocket control socket is a second endpoint beside its https API
(the scale lab).
The lab calendar
Section titled “The lab calendar”A component that talks on its own needs something to talk about, and a room’s meetings should be the same for everything that speaks of that room: its video bar, its scheduling panel, the booking service and the meeting platform. The lab calendar (#2757) is that one thing. It is not stored and not shipped: it is a pure function of the scenario’s knobs, a seed and a window, so every simulator and the server compute the same calendar without asking each other (ADR-2757).
A calendar entry is a kind (meeting, or a scripted problem, below), a window on the
simulator’s clock, the room it is scoped to (the engine’s room key: site, building, room), and a
payload of its kind, and exactly one: an entry is a sum type, built only with a kind and a payload that
agree (a mismatch is refused), and read through typed accessors (AsMeeting, AsProblem) that report false
for another kind, so a new kind cannot nil-deref a reader that does not know it. There is one query: the
entries of a room over a window, filtered by the kinds the caller says it reads, in start order; Now,
Next and Prev take the same kinds. A meeting’s payload says whether it was booked or a walk-in, who
organized it, how many were expected and how many came, how it went (held, no-show,
ended early, ended late) and the slot it was booked on, which differs from when it ran.
The scenario declares meetings in its calendar.meetings block, a set of knobs per standard
(booking_rate, slot_mix, no_show_rate, ended_early_rate, ended_late_rate, attendance,
walk_in_rate, hours, recording_rate, and the room’s timing, wake_lead_seconds,
cooldown_seconds, recording_tail_seconds and sharing, below); a bad block is refused at load naming the field
(the lab guide). Each room’s day is generated whole from its
seed, its room key and the UTC day, so a day reads the same whichever window asks for it, across
runs and across engines:
- a slot opens on every 15-minute boundary where its length (15, 30 or 60 minutes, weighted by
slot_mix) lands on a wall-clock boundary of its own length, and is booked withbooking_rate; - a booked meeting starts up to 2 minutes early or 5 late and ends up to 5 minutes before or after its slot, a late end pushing the next start later, so meetings in a room never overlap;
- a no-show holds its slot with nobody in it;
- a free 15-minute cell no booking touches holds a short walk-in with
walk_in_rate; - a meeting that took place (never a no-show) is recorded with
recording_rate, a draw of its own from the seed, the room and the slot, so it moves no other draw.
The engine holds the calendar (Engine.SetCalendar) and reads time only through each component’s clock,
the seam a test pins; that clock is the engine’s own, real time plus an offset (Engine.SetClock,
sim.Clock, ADR-2800).
A lab started with --sim-clock-offset (the OMNIGLASS_SIM_CLOCK_OFFSET variable of each simulator) runs
the simulated world ahead of real time, so a test stands the calendar’s “now” inside a chosen meeting
and reads the room’s components live. The offset moves what the world reads and writes in its own time (the
a tick’s clock, an override’s now, uptime and the anchor it counts from, a webhook body’s ts) and
nothing Omniglass owns: the outpost’s collection cadence, a sample’s collection time, a request hit and a
webhook signature’s timestamp stay on real time. It is the first, fixed-speed step of the accelerated
clock of #1362, which adds a speed to the same Clock. A tick reads its own room through its context (TickContext.Room is the room’s phase, and Spans the
room’s meetings over a window of time, what a charge or a warm-up is built from), and a service, a push body
included, reads another room by its key through spec.RoomsOf(d) (its phase, its meeting now, its bookings). A
service that speaks for many rooms reads by room key, not by system: the calendar is keyed by room, and a
push’s owner is a system, so a service resolves its owner to the room key before it reads, through
the world the simulator holds.
The room phase
Section titled “The room phase”Every component in a room reads one derived room state, not timing rules worked out again in its own
family (#2797, ADR-2757).
calendar.StateAt(room, instant) is a pure function of the calendar, so a control processor, a touch
panel, a display, a bar and a PDU in one room cannot disagree. It gives a phase, one of:
| Phase | The room is |
|---|---|
idle | in none of the others |
waking | in the lead before a booked meeting someone will attend (a walk-in has none) |
in-meeting | in a meeting someone attends |
sharing | in a running meeting that is sharing content |
cooldown | in the tail after a meeting that took place |
impaired | under a scripted problem (read through the calendar’s problem entries) |
and the facts readers need: occupancy (the phase the meetings alone give, so a reading that holds
whatever goes wrong reads it), in_use (waking, in a meeting, sharing or cooling down), call_active,
attendees, sharing, scheduled, impaired, building_open, use_until, recording_pending, meeting
(the running meeting, a no-show included) and has_calendar. A no-show holds its slot with nobody in it
and wakes and cools nothing. impaired outranks the other phases in phase, and moves nothing else: a
panel under an impairment still reads the meeting beneath it.
The wake lead, the cooldown tail, the recording tail and the sharing stretch are declared once per
standard in the calendar.meetings knobs (wake_lead_seconds 120, cooldown_seconds 300,
recording_tail_seconds 600, sharing the middle third, {min_minutes: 30, parts: 3, from_part: 1, to_part: 2} of a meeting), validated at load like the others, and unset they read those values. A
family carries none of them: a guard test fails the build if one writes arithmetic on a meeting’s time, or
calls the retired roomInUse or meetingSharing. A tick reads the phase from TickContext.Room (its own
room) and a service that speaks for many from RoomsOf(d), each with every field present, so
if c.Room.InUse is the whole rule.
The engine computes a room’s state once per room per second through one memo, however many components read it (the booked-meetings reading of the scheduling surfaces rides the same memo), keyed by the calendar and world it was read through and the component clock’s second.
Components that read the calendar:
-
Boreal displays, projectors and signage (#2768): the Edge display and the Beam projector wake (power on, the conferencing input) by default two minutes before a booked meeting someone will attend, at the start of a walk-in, and sleep by default five minutes after it ends, a no-show leaving them as they were; the projector’s light-source hours grow only while it is on. The Cast signage player follows the building’s day instead: its tick reads
TickContext.Hours, the hours the building’s rooms declare for their meetings (behave.BuildingSpan, the widest span the world’s knobs give them), and the player plays inside them and stops outside. -
The people counter (
tessellate-census-c1) reports who the calendar says is in its room: a held meeting’s or walk-in’s actual attendees (over the room’s capacity when the payload says so), zero in a no-show and in an empty room, and now and then one fewer in a meeting of two or more, as someone steps out. The lab’s conference rooms carry one, so its count rises at a meeting’s start and falls at its end. A counter with no calendar (the dev fleet, which holds no world) keeps its own random walk, as a room with no calendar is left as it was. -
The scheduling surfaces (#2765): the booking service, the scheduling service and the Slate 5 panel say what the calendar says of a room, a panel’s tick through
TickContext.ReadBookingsand a service throughspec.RoomsOf(d).Bookingsfor each room it serves (booked entries alone, on the component’s clock: a walk-in is nobody’s booking, a no-show is). A booked meeting holds its room from the earlier of its slot’s start and its own to the later of its slot’s end and its own.- The booking service pushes each system’s
booking-count(booked meetings left in the day, the one running included) andbooking-statefor the room the world places the system in. It pushes for the system names the world gives it, since a grant carries only the server’s ids. - The scheduling service is one account for the whole fleet, a conduit
(ADR-1282):
the lab places it once, at the headquarters, covering every room the plan books. Its rooms list
is token-paged, one record per room keyed by the room’s system and listed by its
name(the name a company gave the room, as a calendar lists it) with itsaddress(the location) beside it, with that room’s booking state, bookings today and left, the organizer holding it and the next start, all off the calendar. A driver polls it and fans each record out to the system the lab’s installer bound that room id to; a room nobody bound lands in the conduit’s unbound inbox. It also counts today’s booked meetings, those still to come and the rooms with one in progress across the rooms it covers. - The scheduling panel reads its own room: booked or free,
GET CURRENTandGET NEXTfor the booked meeting holding the room and the next (<start> <end> <organizer>of the slot, ornone). BOOK and RELEASE are a momentary override that holds until the calendar’s reading changes. - A component with no calendar (the dev fleet has no world file) keeps its previous behavior exactly: the booking service its fixed meeting day, the scheduling service its 8 and no rooms, the panel its buttons.
- The booking service pushes each system’s
-
Room audio (#2774): the ceiling microphone is active, with its level up and mute moving now and then, while someone is in the room (a no-show holds its slot with nobody in it, so it is idle). The wireless pack transmits in the same hours, and its battery is a pure function of the calendar over the 48 hours before now (
meetingsBetween): it drains in use and recharges on its dock between meetings, so the charge reads the same at any instant on any run, and a scripted problem can pin it (a dead battery, below). The DSP opens a gate for every two attendees actually in the room, up to its four table and ceiling strips, and raises their peak with the head count; the amplifier carries signal and warms while the room is in use. Each sits at its noise floor otherwise. A component whose room holds no calendar (hasCalendar) keeps its earlier drift unchanged. -
Conferencing, the video bar and the codec (#2767): a held meeting is a call. The Kestrel VRoom bar and the Relay C1 codec are in a call exactly when their room’s meeting has somebody in it (a no-show has none, a walk-in has one), at the first tick on or after it starts and ends; participants open at half to all of who came and move inside it, content is shared now and then, and a meeting that starts as the last one ends moves the call on in one tick. A dial or a hang-up on the component holds against the calendar. A bar whose room has no calendar (the dev fleet has no world) keeps #2754’s own schedule, exactly as before. The bar’s camera also counts the room (
status.video.people_count, in its status snapshot): the calendar’s attendees in a held meeting or a walk-in, one fewer now and then as the camera misses someone, and 0 in a no-show and outside any meeting; with no calendar it counts only the call it is in (a dial’s participants) and reads a steady 0 when idle. Its driver collects it as the existingpeople-count, so the plan’sroom-occupancyrule fillsoccupancy-countin every room with a bar, a huddle room included, with no rule of its own. A huddle room’s temperature stays empty: no component in it is the source of one. -
The meeting platform (#2767, #2790): one account for the whole fleet, a conduit (ADR-1282), designed to the shape of a real cloud meeting platform’s rooms and devices admin APIs under our own names. The lab places it once, at the headquarters, covering every room of every site, and its world owns the ids: a room is its system’s name, a component has the stable id the world gives it.
- The rooms list is token-paged (
page_size,next_page_token, the last room of the page, empty on the last), one record per room: itsid, itsname(the name a company gave the room, “Curie” or “Huddle 3”, the world’s label for it) with the room’saddress(its location) as a field beside it, itsstatus(available,in-meeting,offline), themeetingit holds (id,topic,start,participants, empty when there is none), thebookingthat holds it now (a booked no-show leaves the room available with its booking) and thenextbooked one, all from the calendar. A room is in a meeting exactly when somebody is in it. - The components list is paged the same way, one record per component in those rooms that a meeting
platform manages (a codec, bar, controller, scheduling panel, camera or microphone, not a display or an
amplifier): its
id,name,room_id,type,status(online,offline),firmware(the version the component itself reports) andlast_seen. The world’s components read online; a component the platform holds itself, which no room names, keeps the status its own route gave it. - Webhooks, signed as every post is:
room.meeting.startedandroom.meeting.endedat each calendar boundary, one a tick, none for what was already running when it was subscribed;room.participant.joinedandroom.participant.leftanddevice.status.changedwhen the platform’s own routes post them. Each names itsroom_id(and thedevice_idwhere it applies). - Omniglass learns it from configuration. The
ucc-roomsdriver walks both lists in one poll each (request.paginate, paged lists) and fans each room’s call state and headcount to the system the lab’s installer bound its id to, and each component’s platform status and firmware to the component bound to its id;ucc-webhookroutes a post by the same ids. A room id or a component id nobody bound (zr-boardroom-b,zd-spare-bar) lands in the conduit’s unbound inbox. - A platform with no world (the dev fleet) keeps its own rooms and components, as before.
- The rooms list is token-paged (
-
PTZ camera and recording service (#2775): the Gaze camera reports the people actually in its room (nobody in a no-show), frames the group when a meeting starts (tracking on, a tighter shot for fewer people) and returns to its home preset when it ends, holding still while the room is empty. The recording service (#2757) is one account-wide cloud component, placed once through the manifest’s
services:block and covering every room, with no recorder slot in any standard. It carries a recording in progress for each recorded meeting in the rooms it covers (else its own room) and queues it for ten minutes after it ends, and lists the rooms as a token-paged recordings list, one record per room, which its driver walks and fans out to each room’s system by the room id the lab’s installer bound, as the scheduling platform’s rooms do. A service with no calendar keeps the old drift and lists no room. The recording failure feed stays route-driven. -
Room control and switching (#2776): the room is started and ended for its meetings. The Newtron control processor holds the room’s system power (
status.control.room_power, read asGET ROOMPOWER) on from (by default) two minutes before a booked meeting someone attends (at the start of a walk-in) to five minutes after it ends, the window the displays wake in, and runs the start-meeting macro as it goes on and the end-meeting macro as it goes to standby, the last one and the second it ran held beside it (GET MACRO). It also reads the room’s temperature (status.room.temperature_c,GET ROOMTEMP), as a real processor polls a room sensor: the room warms with the people in a held meeting toward the setpoint plus a load per attendee and settles back between meetings and overnight, with small noise, and a processor with no calendar reads the setpoint with the same noise. Its driver collects it asroom-sensor-temperature, and the plan’sroom-temperaturecalc rule carries it up to the room system’s ownroom-temperature, asroom-occupancydoes for the people counter. The touch panel wakes in the same window and its active page is idle, in-call while the meeting is held, and sharing through the middle third of a meeting of half an hour or more, a no-show leaving it idle. The switcher routes the conferencing input while a meeting is held, the lectern laptop through the sharing stretch and the empty input between meetings and through a no-show, so it is on a real source exactly when the video bar in the room is in a call; an operator’s route inside a meeting holds until the meeting asks for another. The extender carries a signal exactly while a meeting is held, its link staying the cable’s. The room phase’sin_useandsharingare the two readings the room’s components share. A component whose room has no calendar keeps its previous state. The bar’s and the codec’s content sharing is the same stretch (the phase’ssharing), so the switcher is on the laptop input exactly while the bar shares; a bar in a room with no calendar, or in a call someone dialed, keeps its own random draw. An operator’s share or stop holds until the calendar’s sharing next changes. -
Rack power (#2777): the Ferrite PDU’s outlet load is a pure function of the calendar, not a walk. Its outlets map to the room’s gear by a fixed table in the family (outlet 1 the video chain of display, bar and codec, outlet 2 the DSP and the control processor, outlet 3 the amplifier, outlet 4 nothing plugged in), so no new function and no look at another component: the gear is awake by the displays’ rule above (the phase’s
in_use, shared with the control processor) and each outlet reads a level for it (the video outlet and the amplifier rise again while a meeting has somebody in the room). A switched-off outlet draws nothing, the total is the outlets’, and the energy counter accrues the total’s draw each tick, so a busy room’s rack reads more by evening than an idle one’s. The mains voltage stays noise. A PDU whose room holds no calendar keeps its earlier random walk.
Behavior primitives
Section titled “Behavior primitives”The readings above are written once, in Go, as the shared primitives of sim/behave (#2830, the first wave of
the Go component families); a family composes
them through sim/component/internal/bind. Each primitive is a pure
function of the room’s state (calendar.StateAt, or the engine’s memo of it), the component’s previous typed state, typed
parameters and the instant, and returns the component’s next typed state. It takes and returns plain values, never a family’s
spec, so any family composes it.
Four rules hold for every primitive. It is deterministic: the only randomness is the per-component source passed in, seeded from the component id, and a primitive draws exactly as the behavior it replaced did, in the same order, so a component that moved to Go kept its seeded run. It carries the no-calendar fallback: a component whose room has no calendar keeps the behavior it had before it read one, so a family never branches on it. It has no magic numbers: every rate, band and threshold is a field of a typed parameter struct whose default is the number the families use, and the room’s wake lead, cooldown and sharing stretch arrive already resolved from the meeting knobs. And it does no I/O: the clock is an argument, and the calendar is read only by the few readers that say so.
| Primitive | What the component does | Replaces |
|---|---|---|
PowerFollowsRoom, InputFollowsMeeting | wakes on the edge of the room going busy, sleeps once the cooldown has run, selects the conferencing input on the wake; an operator’s change inside a meeting holds | the displays’ and the projector’s room_meeting |
RoomPower | a controller’s power follows the room’s use, and runs the start or end macro on the edge only | the control processor’s room_meeting |
FollowsCall, PlanOwnSchedule | starts, turns and ends the call the meeting wants, opens it with half to all of who came, joins and leaves within who came; with no calendar a bar plans its own day | the video bar’s and the relay’s call_cycle |
ContentSharing, ContentSource | shares through the stretch the room phase says; an operator’s share or stop holds until it next changes | the bar’s and the relay’s sharing |
PeopleCount | the calendar’s actual attendees, one fewer now and then; with no calendar a walk or the call’s own count | the census counter’s occupancy_drift, the bar’s people_count |
Climate | the room’s temperature moves toward the setpoint plus a load per attendee while in use | the control processor’s room_climate |
Battery, SpansBetween | a pack’s charge over the 48 hours before now, from the room’s meetings alone | the transmitter’s battery_drain |
Recordings, PerRoom | recordings in progress and the queue, over the rooms a service covers or its own | the recording service’s room_recordings |
BuildingDay, BuildingSpan, PlaylistAdvance | a signage player plays inside the building’s hours and stops outside, and steps its playlist while it plays | the signage player’s building_day and playlist_advance |
Drift, Wear | a reading wanders inside a band from the component’s own source; a worn part ages only while the component is lit | the displays’, the projector’s and the player’s drifts and the lamp’s light_source_aging |
PanelFollowsRoom | a touch panel wakes with the room’s use and shows the call, sharing or idle page; a room with no calendar leaves it as it was | the touch panel’s room_meeting |
RouteFollowsRoom, SignalOnInput | a switcher routes the codec’s feed in a call, the lectern while content is shared and the empty input between meetings, on the edge only, and reports the signal on the routed input | the switcher’s room_meeting and signal_follow |
ExtenderSignal | an extender carries a signal while a meeting someone attends is held | the extender’s room_meeting |
BookingsAt, RoomBooking, SumBookings, FixedDay | a room’s booked count, state, now and next, and the day a service with no calendar keeps | the panel’s, the scheduling service’s and the booking service’s readings |
MicActivity, MicLevel, Gates, AmpSignalPresent, AmpTemperature, AmpOutputLevel, OutletCurrent | microphones, mixer gates, amplifier signal and levels and a PDU outlet’s load follow the people in the room | the Lyra, Polaris and Ferrite room behaviors |
Each primitive has a table test over the pinned room day of the calendar’s own phase tests (a booked meeting, a
walk-in, a back-to-back pair, a meeting that shares, a no-show, a scripted impairment, and a room with no calendar),
and a family test (sim/behave_family_test.go) that drives the family through the engine on a pinned clock, a tick at a time over that
day, runs the primitive from the typed state the component holds with a twin of its random source, and compares every
path the primitive owns. The two cannot drift apart unseen: a tick that draws a different number of times fails the
next comparison.
Reading the calendar back
Section titled “Reading the calendar back”The lab calendar is the ground truth a learner lays beside what Omniglass detected, so a lab server
serves it: GET /lab/calendar?start=&end= (omniglass lab calendar list, #2770), gated by
simulation:read, 404 on a server that is not a lab. It answers each entry’s kind, window, site,
building, room, system and an open payload (a meeting’s origin, organizer, expected and actual
headcount, outcome, slot and whether it is recorded; a scripted problem’s name, role, unplugged,
loss_pct and, when it pins a path, pin_path and pin_value), for rooms whose system is in the caller’s system
read scope, and site, building, room and system narrow it. A window is at most 31 days.
The server does not ask a simulator and does not learn the calendar from collected data. It computes it with the functions the simulator uses, from the world file the lab’s seed wrote into the data volume the server shares (the world it holds), so a route and a component in the same room cannot disagree. A lab with no world (no plan, the dev fleet) has an empty calendar.
Scripted problems
Section titled “Scripted problems”Not everything on the calendar is a meeting. A scenario scripts recurring problems in
calendar.problems: a display dark on Tuesday afternoons, a wireless pack that reads dead every Thursday, a
codec that takes a firmware window every night. Each is scripted, not drawn: a cadence (daily; weekly on
a weekday; monthly on a date or on the nth weekday), a UTC time of day and a duration, a scope (a
standard, a site or its kind, or named rooms, resolved from the plan and the world) with the role of the
room it lands on (a slot such as main-display or wireless-mic, never a product), and one
impairment. Only one thing is drawn: with a spread, each room’s occurrence starts a seeded whole number
of minutes after the time, inside the cadence, so a fleet does not break at one instant. The calendar derives
problems exactly as it derives meetings, from the world and the seed, so a month asked whole, day by day or
from another process is the same month.
A problem is a problem entry beside the meetings: its window, its room and a payload of name, role and
the impairment (unplugged, loss_pct or a pin of a state path and a value). A reader of a meeting asks for the
meeting kind alone and so never meets a problem; the readers of problems ask for the problem kind, the
lab-only route for every kind, and a component reads its own room’s problems through the calendar.
One executor registers them; one arbiter decides. The simulator’s problem executor reads the calendar through the clock and, for each component a problem is active on (the room it sits in and the slot it fills), registers the problem’s wants as the window opens and releases them as it closes; a component does not re-implement a problem, and a component with no calendar is untouched. The executor writes to nothing itself.
The impairment arbiter (sim.Arbiter, one per simulator engine) decides what a component suffers when several
sources want something at once: the operator’s impairment route, each scripted problem and, next, scenes. A
source registers its wants under its own name (unplugged, delay, jitter, loss, a rate limit, and pins of state
paths) and releases only its own, so clearing a problem never clears an operator’s impairment and the reverse
holds too. The arbiter resolves the same way every time:
- Unplugged if any source wants it. Loss, latency and jitter take the highest wanted and a rate limit the tightest.
- For one pinned path the newest pin wins, a pin being as new as the moment its source first held that path on that component. The losers are kept: as a winner releases, the next newest takes the path, and when the last releases the path goes back to what it read before any pin held it.
It is the only writer to the two seams that make a component suffer, the behavior-override set and the netns
impairer, and a guard test fails the build if anything else calls them. Pins hold a path through the
override seam, so the component’s own behavior stops writing it while a pin is open. Unplugged and loss
are the network’s, applied by the impairer exactly as an operator’s would be, so the same firewall and
shaping that break a component on request break it on schedule. They need --impairments and NET_ADMIN;
without them the simulator logs that the problem needs the network and is not applied, once per window, and
the pins still apply.
The sim is; Omniglass learns. Nothing is told to Omniglass: a collector learns of a problem by collecting from
the broken component (an unreachable endpoint, a pinned reading, a lossy link), and an operator can lay the two
side by side with the calendar. The meeting platform reads the same fact from the arbiter (which derives scripted problems from the
calendar, whichever simulator serves the component) and not from the dark component: while a source, an operator
or a problem, has a listed component unplugged, its entry on the platform’s components list reads offline,
last seen when the problem began, and its room reads offline on the rooms list when the component is the
room’s codec or bar.
A simulated service posts from the start
Section titled “A simulated service posts from the start”A webhook’s URL carries a token the server mints when the endpoint is created, so no family can name
it in advance. The simulator plays the outside service, and so holds what that service would hold
(ADR-1370):
the server’s component list carries, for a simulated component with a webhook endpoint, the endpoint’s
path and signing secret, and the simulator calls the component’s own subscribe route
(Spec.Webhook.Subscribe) as the service’s admin would. A webhook sender family also names a provision
route (Spec.Webhook.Provision), through which the simulator adds every identity bound to a system on the component (a component id bound to a component is no room),
so a meeting platform comes to speak for each system it is bound to (#1747); a lab’s account takes its rooms and components from its world instead (#2790).
The fence is two facts an outpost cannot assert: the database carries the lab mark, and the component
sits in 127.60.0.0/16, which only the seed allocates. Outside a lab nothing is handed out, and a real
component’s webhook never is.
The account-wide meeting platform is the face the fan-out is proven against: one service speaking for every room and component on its account, polled as paged records and posting batched state on a behavior every 30 seconds, so an account no one drives is still heard. One of its rooms is bound to nothing, so its values land in the conduit’s unbound inbox until an operator binds it (ADR-1282).
A pusher pushes on its own cadence
Section titled “A pusher pushes on its own cadence”Some outside actors are not on the network at all: a scheduling platform reports what it manages by
pushing to Omniglass, and nothing polls it. A family models one with a push face (Spec.Push): a cadence
(Every, at least a second) and a Go func that builds the body for each system the pusher reports
for. The face holds a bearer token for a machine user granted only telemetry:push on those systems,
reads them off its own grant (GET /auth/me), and posts each one’s batch through
POST /telemetry:push. A failed push is logged with the component and the reason, never the token, and
the grant is read again on the next tick. The shipped booking-service family is the first pusher.
A pusher is declared, not coded
(ADR-1743).
The dev fixtures list theirs under sim_pushers, a scale scenario under pushers
(the manifest format). Either way the seed grants each one’s
machine user its systems, the lab mints the token on every run, and the simulator beside the pusher’s
outpost runs it as a component holding that token, which reaches the simulator’s environment and nowhere
else. A scale scenario declares a webhook sender in the same list; the seed makes it a component with
an endpoint of its family’s driver and a signing secret minted for that seed alone.
Adding a simulated component or system
Section titled “Adding a simulated component or system”POST /outposts/{name}/simulation/components creates a component of a simulated product with the
endpoint the outpost reaches it through: the lowest free address in 127.60.0.0/16, the product’s
driver attached where its credential exists, else a reachability probe. :plan on the same path
previews that add without creating anything. The simulator serves it from its next pull.
A simulated system is built to a standard, the platform’s own archetype
(ADR-0143).
GET /simulation/standards/{standard}:plan staffs each slot with the first simulated product that
fits, and lists any slot none fits, which is what the catalog still lacks.
POST /outposts/{name}/simulation/systems creates the system, its components and endpoints and its
slot assignments in one transaction, through the planned-system primitive (internal/systemplan,
storage.CreatePlan) a system template also builds on. Every piece is the
ordinary create, with the caller’s scope and an audit row.
The console’s Simulation page, shown while a simulator is connected, lists the simulated components, lights a row when the outpost reaches it, and adds components and systems; its drawer carries a component’s status, its impairment and its API surface (simulation guide).