Release and update contracts 1.0
Work record: #24, under OTA epic #9. This is an executable source reference, with synthetic artifacts and isolated simulation identity. It implements manifests, compatibility paths, signed reference production, status admission and pure journal recovery. It does not implement a firmware updater, a persistent store, local orchestration or a deployment pipeline.
Contracts and consumers
- Release JSON Schema, version
arbi.release/1.0: module inventory overlay, immutable release manifests and multi-module release sets. - Update JSON Schema, version
arbi.update/1.0: scoped requests, local boot observations, bounded events and recovery journals. - Generated release types and update types are generated by the existing protocol generator. Runtime refinements remain mandatory.
- Release validator/producer helpers and update reference export through
@arbi/protocol. The existing message/configuration/accounting/audit contracts retain their versions and behavior. - Release fixtures, update fixtures, executable tests, producer CLI and updater/status CLI consume the same contracts.
Run from the repository root with Node >=24 and pinned pnpm:
pnpm --filter @arbi/protocol generate
pnpm --filter @arbi/protocol test
pnpm --filter @arbi/protocol build
node packages/arbi-protocol/scripts/release-producer.mjs > /tmp/arbi-reference-catalog.json
node packages/arbi-protocol/scripts/release-updater.mjs /tmp/arbi-reference-catalog.jsonThe producer generates an ephemeral Ed25519 key in process, signs six synthetic text payloads and emits an availability catalog plus its public key. It never emits or saves the private key. The consumer independently verifies every artifact and signed manifest, checks update and rollback paths, then runs the Pico status vector with JSON round trips between transitions. The supplied public key is simulation trust only; consuming this catalog cannot establish production authenticity. Tests exercise both actual CLIs. Neither CLI downloads or installs anything.
Identity and truthful capability
A module ID is exactly the accepted configuration component ID, independent of source boot/session IDs. Each release target binds module ID, target class, board ID, hardware ID/revision and assembly ID/revision. bindReleaseInventory checks every overlay component against the validated configuration, including realm, site, mode and configuration revision. A label is not a flash interface.
| Fixture target | Board label | Current configuration identity | Update capability |
|---|---|---|---|
| Motion | raspberry-pi-pico-2-w |
pico, synthetic pico-model hardware |
Reference trial boot only; physical interface unavailable |
| Pod | raspberry-pi-3a-plus |
pod, synthetic pod-model hardware |
Reference application/OS trial only; physical interface unavailable |
| Edge | synthetic-linux-edge |
edge, synthetic edge-model hardware |
Reference application/OS trial only; actual edge board and recovery integration unverified |
| Driver | driver-a-model |
driver-a, synthetic configuration identity |
Unavailable: no reviewed update interface |
| Passive parts | Configuration hardware labels | Anchors, drums, powered line, servos | Unavailable: no executable update target |
The inventory preserves the canonical fixture's unsupported component.update fields. Its separate reference-only capability requires simulation evidence and is rejected in hardware mode. There is deliberately no enabled physical capability variant in this contract implementation. Pico firmware manifests cannot address Linux targets, and Linux application/OS manifests cannot address the Pico. Minimum updater and, where required, bootloader versions must be met. Physical board/hardware revisions must eventually come from reviewed inventory rather than copying the synthetic labels.
The upstream RP2350 OTA example demonstrates partitioned trial boot facilities; it does not establish ARBI delivery authentication or recovery safety. The Raspberry Pi boot documentation and RAUC integration documentation require target boot integration work. No Pi 3A+ hardware-rooted secure-boot capability is asserted. Target recovery remains #71 and #44.
Immutable availability and authenticity
A manifest identifies release/build/version/40-hex source commit, artifact ID, SHA-256 digest, positive exact byte size, Ed25519 signature and signing-key ID, channel, protocol/configuration ranges, minimum updater/bootloader and module dependencies. Versions are bounded numeric major.minor.patch; contract ranges are inclusive numeric major.minor. The reference understands protocol and configuration 1.0 only and rejects ranges that exclude them, malformed digests, missing identity, wrong board/hardware and unknown schema versions.
produceRelease signs a domain-separated canonical SHA-256 of the entire manifest, with the signature value zeroed. The key ID remains included. Canonical JSON ordering is the configuration digest convention. Signatures therefore bind target, build, dependencies, channel, configuration and artifact identity together. verifyReleaseArtifact separately checks exact bytes and signature using a caller-supplied trusted public-key binding. Structural signature validity alone is not authenticity; a digest alone is not authentication. Fixture zero signatures intentionally have no authenticity.
Publication makes a release available only. It does not establish authorization, download, boot, health or installation. The gated software publication prototype implements immutable simulation-only Linux candidate publication and catalog verification; live operator setup remains unverified. Trusted key provisioning/revocation and broader release channel enforcement remain #74, outside this reference producer.
Mixed versions and configuration migration
The example releases each executable from 1.0.0 to 1.1.0 while retaining the accepted protocol/configuration 1.0 schemas. The edge's synthetic local configuration data format changes from 1.0.0 to 1.1.0; this is a migration contract, not an implemented migration or a new accepted configuration schema. The target manifest records migration source/destination, a permitted rollbackTo and record ID. A changed data version requires an explicit forward migration or the previous manifest's explicit reverse compatibility.
| Update prefix | Edge | Pico | Pod | Permitted rollback order |
|---|---|---|---|---|
| Initial | 1.0.0 / data 1.0.0 | 1.0.0 | 1.0.0 | No operation |
| After edge | 1.1.0 / data 1.1.0 | 1.0.0 | 1.0.0 | Edge, restoring data 1.0.0 |
| After Pico | 1.1.0 / data 1.1.0 | 1.1.0 | 1.0.0 | Pico, then edge |
| After pod | 1.1.0 / data 1.1.0 | 1.1.0 | 1.1.0 | Pod, Pico, edge |
New Pico requires new edge; new pod requires new edge and Pico. Older modules explicitly tolerate the new peer versions. inspectReleaseSet checks initial and every intermediate state and requires a compatible rollback path from every update prefix to the initial state. It rejects cyclic/unknown order, duplicate module steps, incompatible intermediate states, changed target identity, missing recovery prefixes and irreversible data rollback. It never infers compatibility from final versions alone.
checkReleaseStep allows only a declared adjacent step from a trusted local observed mixed-version selection. Update request admission binds the exact manifest and baseline to that release set, checks the actual target boot selection, and rejects premature update/downgrade/rollback. A separately authorized rollback uses a new scoped operation ID and direction: rollback; it cannot mutate the original request. Physical migration and filesystem/bootloader atomicity remain future target work.
Operation, deadlines and provenance
An operation key is (realm, executionMode, siteId, operationId). Module/artifact, release set, direction, source provenance, deadlines, authorization and budget fields are immutable under it. Target boot/session changes do not change the logical operation ID. Identical request replay returns the existing journal even after its start deadline; changed payload or target rejects with IDEMPOTENCY_CONFLICT. Fresh admission binds authenticated source, authorized audit context, current local inventory and baseline observation. Mode or UI presentation grants no permission.
issuedAt, startDeadline, confirmationDeadline and observations are exact UTC milliseconds. The start deadline governs new admission/staging/reservation; confirmation is accepted only before the confirmation deadline. A trusted adapter must supply a valid current time; this reference has no clock synchronization mechanism. Late local boot/health evidence is retained, while the state becomes recovery-required and the prior confirmed build remains recorded. Internet loss alone neither marks health failed nor rolls back a target.
| State / fact | Admitted evidence | Installed/confirmed behavior |
|---|---|---|
| Available | Valid immutable release manifest | No installed state change |
| Requested / desired | Authenticated, authorized immutable request | Baseline locally observed boot remains installed/confirmed |
| Staged | Trusted edge artifact-verification binding | No installation inferred |
| Installation reserved | Trusted edge preflight; durable marker before hypothetical dispatch | Still staged; effect remains unknown until local observation |
| Trial | Target's bound local boot identity, build, digest, data version and health record | Installed is the observed trial build; confirmed remains baseline |
| Confirmed | Passed local health from the same trial boot before deadline | That locally observed build becomes confirmed |
| Failed | Trusted edge failure record | Retains last boot/confirmed evidence without assuming target effects |
| Rolled back | New passed local boot of exact permitted baseline artifact/data | Baseline becomes observed installed/confirmed; desired request stays unchanged |
| Recovery required | Trusted edge ambiguity or late target evidence | Retains available evidence; requires recovery rather than another install dispatch |
Every status field retains its source: availability has manifest provenance, desired has request source/time, installed/confirmed retain local source device/boot/session, observation time, record ID and health. An old observation is historical evidence, not current health. There is no automatic conversion from a notification, download or authorization to successful installation. Only a trusted target adapter's matching local observation can admit boot/health events. Event IDs deduplicate unchanged observations and reject changed observations under the same ID. Staging verification and independent-preflight record IDs remain in the journal and are checked again during replay; a session change alone cannot stand in for a new boot.
reserveReferenceInstallation returns a journal containing the single installation reservation and a one-time hypothetical dispatch decision. The future durable adapter must atomically persist the returned journal before any dispatch, serialize admission/reservation per scope/target, and enforce unique operation/event IDs. recoverUpdate validates/replays an already trusted journal and always returns dispatchInstallation: false. A lost acknowledgement or a restart after reservation therefore requires local reconciliation, never another installation. A reserved failed/ambiguous operation blocks a new operation on that target until observed resolution. This is a pure recovery protocol; JSON round trips are not SQLite/fsync/power-loss evidence, and the log's author is not authenticated by replay validation.
Accounting, audit and local gates
The request carries an approved reservation ID, exact artifact payload bytes, a separate maximum WAN-byte budget and ota/os-update category. Payload size is validated with the accepted accounting quantity rules, including counter bounds. It is an expected application payload, not WAN transfer, retry/overhead allowance consumed, provider usage or billing. Actual metering/reservations/download policy remain future consumers.
updateAuditReferences exports typed audit correlation/resource/metadata/local-record references for a known recorded event. It preserves intent ID, correlation ID, request source and actual observed target boot. The audit adapter must still bind actor, source, action and evidence at its trusted boundary. It cannot infer a device effect from a staging/reservation record. Publication, update intent, authorization, local observation and device effects remain distinct.
ADR-0005 and ADR-0006 retain local authority. Parked alone is not update-safe; independent protection cannot be owned solely by the module being rebooted. The reference requires a simulated preflight record with a separate protection owner and rejects all physical admission/reservation. It adds no GPIO, network actuator path, measured position/tension or flash support. Driver encoders remain unavailable to Pico telemetry; recording remains deferred/disabled.
Source tests and the offline consumer prove contract/reference behavior only. Persistent durability, physical interruption recovery, independent restraint/line clearance, bootloader health/recovery, actual migrations, live provider setup, signing lifecycle and installed/qualified gates remain unverified under #73, #78 and the commissioning gates.