Status
direction
Conceptual layer
①–⑥ seams on the Plant Box
Repo layer
L1, L2, L3, L5, L6
Source
architecture section 3.4, section 3.6.8, section 7.1, section 7.3, section 5.8 · ADRs 033–038 · D3, D4, D7, D10, D15, D16 · Company policy: master document section 7.

Docs 01 to 06 describe each piece. This doc fixes how the pieces meet: who owns each job, which topic and table each piece uses, how the cloud reaches the Plant BoxPlant-side computer for the fast loop (direction; D4), and what happens when a link fails. Where it settles something the earlier docs left open, it says so; those points are listed for sign-off in the fast-loop handoff.

1. Two paths, one owner per job#

JobOwnerRuns onPath
Read the PLC fastL1 edge-agentPlant BoxFast
Write allow-listed setpointsL1 stamped-writerPlant BoxFast
Pull signed config from the cloudL1 sync-agent (new)Plant BoxFast
Keep the twin in step; run accepted proceduresL3 stamped-l3-twinPlant Box (cloud while messages only)Fast
Send signals and plant-local alertsL5 stamped-l5-relay (new)Plant BoxFast
Store records, parameters, write log, ledgersL2 universal-repositaryCloudBoth
Detect card-worthy conditions; emit FindingsL3 scheduled core (stamped-l3-core)Cloud or plant serverScheduled
Turn Findings into cards; explain proceduresL4 knowledge-reasoningCloudScheduled
Budgets, acceptance records, closureL5 closure-verificationCloudScheduled
Acceptance card, shift switch, alert and ledger viewsL6 experience-integrationCloudScheduled

2. Topic registry#

All topics sit under stamped/v1/{org}/{plant}/. Docs 02 and 05 and the data plane page use these names exactly.

TopicBrokerPublisherReadersContent
fast/{line}/{asset}/{signal}Plant only, QoS 0edge-agenttwinFast readings with PLC time, edge time, sequence
twin/state/{line}Plant onlytwinlocal screens, relayPlant state, forecasts, uncertainty
twin/write/requestPlant onlytwinwriter onlyWrite requests (expire in 5 s)
writer/write/resultPlant onlywritertwinResults, refusals, read-back
twin/heartbeatPlant onlytwinwriterHeartbeat every second
records/{type}Plant to cloud, bufferedtwin, writerL1 cloud then L2Record rows, versioned JSON Schema
messages/outPlant onlytwinrelayAlerts, actions, signals with episode_id
control/inPlant onlysync-agenttwin, relayVerified config bundle (section 4)

Broker ACLs follow the publisher and reader columns; nothing else may publish or subscribe. Fast batches for replay travel on the existing durable upload, not on these topics (section 7).

3. Ownership matrix: tables#

Rows reach L2 through records/{type} and the existing L1 cloud path, as upserts on the key in 05. Each row carries episode_id where one applies and the plant-box lockfile id (section 9).

Table: 16 rows by table
TableSchemaProducerMain consumersContract (proposed)
fast_readingtelemetryL1 edge-agent (batch upload)L3 replay, evalstelemetry/fast-reading-batch 1.0.0
billet_pushtelemetryL3 twin (flow)L3 scheduled, L4, L6records/billet-push 1.0.0
forged_parttelemetryL3 twin (flow)L3 scheduled, L6records/forged-part 1.0.0
part_linkfeaturesL3 twin (genealogy)L3 scheduled, L6records/part-link 1.0.0
part_flagfeaturesL3 twin (genealogy)L3 scheduled, L6records/part-flag 1.0.0
time_binfeaturesL3 twin (genealogy)L6, register matchingrecords/time-bin 1.0.0
ht_basketfeaturesL3 twin (heat treatment)L6, digestrecords/ht-basket 1.0.0
ht_testfeaturesL1 (lab export or document)L3 twin, L6context/ht-test 1.0.0
rejection_rowfeaturesL1 (register intake); match fields from L3 twinL3 scheduled, L6context/rejection-row 1.0.0
twin_statefeaturesL3 twinL3 replay, incidentsrecords/twin-state 1.0.0
write_logledgerL1 writerL5 evidence, L6, auditsrecords/write-log 1.0.0
follow_throughledgerL3 twinL5, L3 tuning, L6records/follow-through 1.0.0
missed_savingsledgerL3 twinL6, L4 (procedure review)records/missed-savings 1.0.0
param_rowbaselinesL3 tuning job (cloud) via L2 HTTPtwin (via config bundle)baselines/param-row 1.0.0
param_promotionbaselinesL3 tuning job; approver on L5 staff consoleL5 console, auditsbaselines/param-promotion 1.0.0
part_aliasgraphL5 staff console via L2 admin APItwin, L3 scheduledgraph/part-alias 1.0.0

write_log in L2 is the record of every write and refusal. The L5 evidence store keeps references to its rows, not a second copy.

4. Control channel: cloud to plant box#

The plant allows outbound connections only, so the cloud never connects in.

  1. sync-agent polls L2 over HTTPS (GET /v1/plants/{plant_id}/plant-box-config?since=) with a plant-box credential.
  2. The response is a plant_box_config bundle: accepted procedures with versions and recipients, per-shift procedure switches, approved parameter rows, part aliases, roster roles and the L5 budget settings. L5 and the L3 tuning job write their parts into L2; L2 assembles the bundle.
  3. The bundle is signed with the Stamped release key. sync-agent verifies the signature and version, then publishes it on control/in. The twin and relay load only verified bundles and stamp the bundle version on what they produce.
  4. If the link is down, the last verified bundle stays in force.

Safety asymmetry (today's stage). A remote change can always switch a procedure or a write tag off, and the box applies an off at once. Switching writes on takes a person at the plant: the "Stamped auto" switch on the machine plus the in-charge's enable on a plant-local screen. The writer's allow-list, limits and hazard rows are not carried on this channel; they live in the site packVersioned, owner-reviewed plant configuration including topology, change only on site, are signed by the plant's production head and are checksummed by the writer. This matches section 7 of the master document: writes do not come from the cloud.

Message-only procedures (AL1Autonomy levels (direction; fast-loop stages 1–3 = AL1–AL3)) can be switched on for a shift from L6, because they write nothing.

5. Stage 2 confirmation path#

At AL2 a person confirms each write. The confirmation is a token, not a write: it may come from a plant-local screen or as a reply to the relay's message (carried back through cloud L5 and the control bundle when the link is up). The twin then builds the write request on the Plant Box, and the writer runs every check in 02 section 3.3, including the 2-minute token age. A token never carries a value the twin did not propose.

6. Messages: the L5 relay and one budget per person#

  • The twin never sends to WhatsApp, SMS or a stack light directly. It publishes on messages/out; stamped-l5-relay (code in closure-verification) owns delivery from the Plant Box.
  • Online: the relay applies the L5 budgets from the bundle and reports every send and reply to cloud L5, which stays the budget authority (ADR-036, D16).
  • Offline: the relay sends alerts and signals only, under conservative local caps, and holds actions until the link returns. Cloud L5 reconciles the relay's log on return.
  • One person budget. L4's attention_budget stays a pre-filter on cards (l4/22). Any card or action that reaches a person counts against that person's L5 action budget. Alerts and signals keep their own rules.

7. One Finding outbox; the fast-data tier#

Findings. The twin holds no outbox. Card-worthy patterns become EvidenceLayer contract for detector output (direction; as built: Finding finding.json 1.2.0) (direction; as built: FindingAs-built L3 detector output admitted to L4 (finding.json 1.2.0) 1.2.0) on the scheduled path: L3 engines read twin records from L2 (a procedure that keeps not being followed, model drift on an asset, repeated risk on one part) and emit through the existing outbox and dual-lane gate. Lab still never promotes.

Fast data. The Plant Box keeps a rolling fast archive and uploads it in compressed batches to telemetry.fast_reading, kept at least 13 months so a full-year replay is possible. Per-minute measurements continue on the existing path, so live upload is unchanged (ADR-034).

8. Episode trace#

The twin mints episode_id when a procedure or alert first fires for a condition. It is carried on twin records, messages, replies, follow_through, missed_savings and write_log, and the L5 thread uses it. A Finding built from twin records lists the episode ids in its evidence references, so a card links back to the floor events behind it.

Episode trace

Plant Box

Done reply

follow-through from machine data

L1 edge fast read

L3 twin

L5 relay

Operator

L1 writer

L2 records, follow_through, write_log

How to read it.

  1. Fast readings update the twin; signals carry episode_id through the relay.
  2. At AL2 or AL3 the twin may publish a WriteRequest to the writer; results land in L2.
  3. Follow-through and ledger rows share the same episode for L5 threading.

Build now: episode_id on messages and follow_through. Later: Evidence references on scheduled Findings.

View Mermaid source
flowchart TB
    %% house-style: episode-trace
    subgraph floor["Plant Box"]
        direction LR
        edge["L1 edge fast read"] --> twin["L3 twin"]
        twin --> relay["L5 relay"]
        relay --> person["Operator"]
        twin --> writer["L1 writer"]
        writer --> twin
    end
    store(["L2 records, follow_through, write_log"])
    twin --> store
    person -.->|"Done reply"| relay
    twin -.->|"follow-through from machine data"| twin

    classDef govc fill:#fff4d6,stroke:#c99a2e,color:#000
    classDef agentc fill:#e8f0ff,stroke:#5b7bd5,color:#000
    classDef loopc fill:#eef7ee,stroke:#4f9a4f,color:#000
    class person agentc
    class store loopc

9. Plant-box lockfile#

One versioned manifest per Plant Box: edge-agent, sync-agent, writer, twin and relay versions; procedure catalog version; parameter set version; site pack version and checksum; bundle version. Signed with the Stamped release key. Its id is stamped on every record and every write. It plays the role the L4 release lockfile plays for the decision runtime (l4/16).

10. Service levels#

MeasureTargetOwner
Twin loop p99Under 100 msL3
Fast-tag freshnessUnder 2 sL1
Signal, event to cueUnder 5 sL5 relay
P1 alert deliveryUnder 5 minL5
Writer read-back failuresZeroL1
Heartbeat gapNever over 5 sL3
Edge buffer drain after link returnWithin 1 hourL1
Alert loadAbout 1 per person per hourL3 and L5

11. Degraded modes#

FailureFast loopScheduled path
Cloud link downRuns on the last bundle; signals and alerts go out locally; actions held; records bufferNo new twin records in L2; Findings on twin records wait
Plant box downPLC watchdog drops the machine switch; operator values stand; no signalsUnchanged; twin records stop
L5 down (cloud)Relay keeps local caps; reconciles laterCards queue at L5 intake
L2 downRecords buffer on the box; bundle stays at last versionL3 reads fail closed; no invented points
Clock jump over 2 sWriter stops; twin state uncertainWindow flagged in records

12. Control today#

Stamped recommends and the plant team decides. Safety systems, quality holds and release, maintenance authorisation and lockout, and customer priority, promise dates, routing, master data and the full dispatch sequence stay with the plant. Writes reach only allow-listed process setpoints through stamped-writer, earned stage by stage as ADR-035 sets out (AL1 messages, AL2 confirm, AL3 standing); that is the first path to autonomous execution, under the plant's control and approval.

Page history: last 2 changes
  1. 2026-10-07 docs(technical): rewrite fast-loop/; all architecture diagrams in house style 7330f47
  2. 2026-10-03 docs(fast-loop): interfaces and ownership; one topic registry; control-today wording; amend ADR-033 and ADR-036 df796e9

Diagram

100%

Search the architecture