1900 Protocol Version
Provium has one wire-version constant: PROTOCOL_VERSION, 1.
It pins:
-
The host ↔ agent protocol, every op, every result variant, every error shape.
-
The observability event stream: every
Eventvariant and every payload field. -
The Hello / HelloOk / HelloErr handshake and the
OpenModefield set.
1900.1 When it bumps #
PROTOCOL_VERSION increments any time:
- A new wire variant is added (op or event).
- A field is added to an existing payload struct.
- A new
OpenModeflag,ExecResultvariant, orOpResultshape lands. - The
EventFrameenvelope changes.
It is not bumped for changes that don't reach the wire, internal struct renames, host-side refactors, agent-side optimization, additional Lua bindings that map onto existing wire ops.
1900.2 What it does NOT pin #
- The Lua API surface (the userdata methods
vm,bridge, and so on). That surface evolves freely; tests that use it are rebuilt against the same Provium version that runs them. - Internal types like
Vm,Lab,Bridge. Those are language-level objects, not wire-level contracts. - The CLI flag set. New flags can be added without bumping the protocol; removing or renaming a flag is a separate compatibility concern documented in the CLI reference.
1900.3 How the pin is enforced #
The conformance suite locks every wire-facing struct against an explicit byte expectation. Examples of what it locks:
Hello.protocol_versionis a u32 encoded as1.HelloOkfield tags (agent_version,guest_os,agent_features, …).OpResult.outcomeis the"ok"/"err"discriminator key, withvaluefor the payload.SyscallResultfield set:ret,errno, optionalout_bufs(omitted when empty).OpenMode's six flags,read,write,create,truncate,append,exclusive, each serialize as their own named field (it is a struct of booleans, not a packed bitfield).
Any refactor that changes a tag name, reorders an enum, or shifts a bit fails
the pin test. The fix is to bump PROTOCOL_VERSION and update the pin to
match the new shape, explicit, not silent.
1900.4 How to add a new op or event #
- Add the new variant / payload type to the protocol crate.
- Add a serialization round-trip test alongside it.
- Bump
PROTOCOL_VERSION. - Update the conformance pin to lock the new shape.
- (Op only) Wire the agent-side handler.
- (Op only) Wire the host-side dispatcher and a Lua binding.
Skipping step 4 produces a protocol change without explicit pinning, exactly the regression the pin tests are designed to catch.
1900.5 Backwards compatibility #
Provium does not commit to backwards compatibility on the host-agent wire. The
host and agent are versioned together, they ship in lock-step out of the same
workspace. The Hello handshake exchanges versions and HelloErrs the
connection if they don't match, so a stale agent against a fresh host fails
fast at connection time, not silently mid-op.
For the event stream, consumers (provium-coverage, dashboards) are versioned
against PROTOCOL_VERSION. A consumer built against version N reading a
stream from version N+1 will fail to deserialize the new fields; the typical
recovery is to rebuild the consumer.