Broken messages become rows
Under a strict codec a message that breaks the contract is confirmed, never acted on, and shown to an operator as a row.
The situation
A machine vendor ships firmware that sends a malformed job event. Acting on half a message could move the wrong unit. Dropping it silently hides the fault until something downstream stalls.
The recipe
A codec translates the machines’ wire protocol into the gateway’s line protocol. Set strict: true:
const codec: Machines.LineCodec = { ...Machines.genericCodec({ root: 'line/v1', receiptFrom: 'started' }), strict: true,};
await start({ // ...database, workers, roles machines: { lines: [Machines.loadLine('/etc/line.json')], codec },});| Codec | A message with contract violations |
|---|---|
strict: true |
Confirmed, never acted on; one contract-violation row on the operator role holds the raw message and the violations |
| default | Known fields are acted on and the violations are logged |
A person resolves the contract-violation row once the cause is understood. Unknown body fields are allowed; known ones are checked. Payloads may be up to 256 KB.
The guarantee
Under a strict codec, a message that breaks the contract never moves a unit or resolves a row. It is held for a person as a row in the operator’s queue, with the evidence attached, and the machine receives its receipt so it stops resending. See Machines.
Related patterns
The escalation boundary
Errors become escalations
When retries run out, the failure becomes a row an operator can act on. The run waits for retry or skip instead of disappearing.
The physical world
Learned addresses, approved by a person
A station learns its machine from first contact; any later disagreement becomes a registration row a person approves or rejects.
The physical world
Offline, quiet and alarm rows
A stopping alarm, a dropped machine and a silent one each become a row for the line operator, resolved when the machine recovers.
