Repository navigation
Compatibility
Kronik has not reached the v0.9 compatibility freeze. The actor package is
currently kronik:actor@0.1.1, which grows only by new interfaces and
optional exports, so components built for 0.1.0 keep running
(ADR 0113); the IO 0.2 interface changes the
actual ABI before that freeze. This page defines the required
compatibility policy, not a claim that unfinished interfaces are frozen or that
v0.9/v1.0 is ready.
The v0.9 freeze covers log format v1, kronik:actor@1.0.0, API /v1, the CLI's
machine-readable schemas, kronik.diff/v1, and the policy language. The frozen
contracts remain backward compatible until v2. A name in this list does not
rename today's WIT package or advertise an unimplemented adapter.
A change is breaking if a previously supported producer, component, client, operator command or policy loses its documented meaning. This includes:
- refusing an old log, dropping a record or field needed to reconstruct state, changing causal identity, silently altering effect delivery, or replaying a committed result differently without an explicit engine upgrade;
- removing/retyping a WIT function, changing record/variant layout or resource ownership, or accepting an old component whose host semantics changed;
- removing an endpoint, request/response field, CLI command/option, JSON field, error code or enum case; changing its type, requiredness, scope requirement, status/exit behavior, default meaning or pagination semantics;
- changing diff classifications, grounding/confidence or PII semantics so that the same observed behavior yields a different decision without a versioned migration; changing policy syntax, evaluation or approval precedence;
- returning previously private data, granting authority where an old caller was denied, or treating an unrecognized security field as authorization.
Adding an optional field or endpoint can be compatible only if old consumers continue to work. An added enum/variant is not automatically compatible: old consumers may require exhaustive matching. Unknown Protobuf fields must not be reused as evidence of authorization. Removed field numbers and enum values remain reserved; never reuse their numbers for a different meaning.
The binary and each published SDK use semantic versions. After 1.0:
- a patch fixes compatible behavior and security defects;
- a minor adds backward-compatible functionality;
- a major permits breaking changes, with the notice and migration rules below.
SDK versions describe each SDK's public API independently. A binary or SDK version bump alone does not version a wire format: logs, WIT packages, API namespaces and JSON/diff schemas retain their own explicit identifiers. Changing one requires the matching versioned reader/adapter and compatibility proof, not an alias that pretends two formats are identical.
Before the freeze, a 0.x minor may introduce a documented breaking change.
Even then, repository rules require a format version change and a genuine old
producer fixture. Do not overwrite an old fixture with new encoder output or
regenerate every expected result to conceal a behavior change.
Wasmtime/engine changes are not replay-compatible by assumption, including
patch updates. Follow kronik upgrade check and
ADR 0001; preserve the recorded old engine
identity and code hash. Do not rewrite historical engine names to make a check
pass.
Each release is a new engine, so a data directory that another release wrote
starts only after a passing kronik upgrade check with the new binary; the
operations guide has the procedure (Upgrading to a new
release) and what changes for the
data of v0.4.1 (Upgrading from v0.4.1).
A frozen supported interface is not removed until at least twelve calendar months after public deprecation notice, and never in a backward-compatible minor/patch release. Notice must identify the affected versions and interface, replacement, migration commands/examples, first notice date and earliest removal date. Publish it in release notes and the relevant reference/migration guide; machine-readable warnings must not corrupt JSON stdout.
For example, a notice published on 2027-02-15 cannot permit removal before 2028-02-15, even if v2 ships sooner. The replacement must be usable throughout the notice period. Deprecation is not permission to stop fixing supported security defects. A severe unsafe operation may need immediate fail-closed restriction: publish the actual security rationale and remediation through the security advisory process, rather than silently describing it as compatible or fabricating a twelve-month history.
- Keep the original release's immutable producer log/component bytes and their producer version, source revision, engine and SHA-256 provenance. Store only non-secret fixture data. A current encoder's hand-built record is useful as a wire unit test, but is not a released-producer compatibility fixture.
- Read or explicitly migrate every actual released
0.xproducer corpus with the candidate. Reconstruct state and perform deterministic identity replay of the same recorded inputs/effects, checking the real behavior diff and state. A successful Protobuf decode alone does not prove compatibility. - Run old WIT components through the real adapter. If no adapter exists, reject before deployment with the unsupported package/version and the exact supported build/migration path; never partially link or silently substitute host behavior. Freeze the final WIT only after its actual consumers agree.
- Exercise API/CLI/diff/policy consumers against their declared schemas and semantics, including precedence, error/exit and authorization behavior. Retain old and new fixtures for new versioned formats.
- Record exact commands, revisions, fixture digests and pass/fail/ignored counts. Missing released producers, an unavailable runtime or unmerged feature consumers are explicit gaps, not green compatibility results.
The current fixture tests, example identity replay and engine-upgrade checks remain useful evidence for their measured revisions. They do not by themselves establish the complete M33 release corpus or all future interfaces.
tests/compatibility/releases.json is the versioned
kronik.compatibility-index/v2 inventory. Its separately declared
published_releases set must exactly match its covered cases. It pins the actual
published v0.1.0, v0.3.0, v0.4.0, v0.4.1, v0.5.0, v0.6.0 and v0.6.1 producer binary digests, source
commits, immutable exported manifest digests, original root counts, genuine
counter/SQL component bytes - and from v0.5.0 the media/room component bytes too -
and the API, CLI JSON, diff and WIT source snapshots of those tags. Every snapshot
is its tag's bytes except the CLI-JSON snapshots of v0.1.0, v0.3.0 and v0.4.0: the
public-release preparation edited one word of their introduction's prose
(253fa961), and their index entries say so, with the Git blob each tag has
(producer_git_blob) and the edit (edit). Their schemas are the tags'.
scripts/verify-compatibility.py compares every snapshot with its source file at
the producer revision and refuses a difference the index does not declare; it
needs those revisions in the clone and says so when it cannot compare (a shallow
clone or a source archive).
When the index is read from a Git checkout, the verifier also requires the catalog
to match the repository's release tags: every v0.x.y tag has exactly one case
whose producer revision is that tag's commit, and a case without such a tag is
refused. A missing tag is therefore a red gate rather than an omission the index
declares complete about itself. A source archive has no tags and skips that
comparison; a shallow clone must fetch them (git fetch --tags --unshallow).
There was no published v0.2.0 artifact in the inspected release set; do not invent
one. The v0.1.0 artifact actually reports kronik 0.1.0-dev and records Wasmtime
50.0.0; its real identity is retained rather than rewritten. The v0.4.0 artifact
reports kronik 0.4.0 and records Wasmtime 50.0.1. The v0.4.1 artifact reports
kronik 0.4.1, records Wasmtime 50.0.1 and names engine
kronik-0.4.1+wasmtime-50.0.1; it is a patch release on the v0.4.0 line.
The v0.5.0 artifact reports kronik 0.5.0, records Wasmtime 50.0.1 and names
engine kronik-0.5.0+wasmtime-50.0.1. The v0.6.0 artifact reports kronik 0.6.0,
records Wasmtime 50.0.3 and names engine kronik-0.6.0+wasmtime-50.0.3. The
v0.6.1 artifact reports kronik 0.6.1, records Wasmtime 50.0.3 and names
engine kronik-0.6.1+wasmtime-50.0.3; it is a patch release on the v0.6.0 line.
The saved logs were produced by those binaries running the maintained test
applications. Their embedded component bytes remain exactly as recorded.
Separately, the index's components entries preserve the genuine tagged old
SDK/WIT component bytes, including older counters that differ from today's
counter fixture. A newly compiled component with the same WIT package name
is not a substitute for those bytes.
The v0.4.0 case is the first produced from an attested release. The Sigstore
attestation of its x86_64 musl archive was verified with the installer's pinned
verifier, and the pinned binary digest is the ELF digest in the attested
reproducibility.json. Its tagged counter and notes are the maintained fixtures
of that tag, so its notes entry reuses the stored v0.3.0 notes bytes. Its data
holds files that the earlier producers did not write: a second snapshot taken at
shutdown, the secret-coverage watermark and the foreign-actor layout marker.
The v0.4.1 case is the first produced from an attested release that is also a
patch release: no log format, WIT or wire change from v0.4.0, nine original
roots and ten turns like every case before it. Its tagged counter and notes are
the same maintained fixtures as v0.4.0's - same Git blobs, same payload digests -
so its component entries name the same stored bytes rather than a second copy;
its WIT and diff snapshots are the same Git blobs every earlier release pinned.
Its API and CLI-JSON snapshots are the v0.4.1 bytes the tag carries: the
EffectSecret schema (M23 secret history) is additive, and the OpenAPI
info.version moves to 0.4.1. The case is pinned to the ELF digest in the tagged
reproducibility.json, not to a build of this checkout.
The v0.5.0 case is the first from a release that added long-lived connections and
blobs, and the first with four released components: the maintained counter and
notes guests plus that tag's media and room guests. Its 32 original roots are 7
counter, 2 notes, 9 media and 14 room inputs; its manifest declares the
counter, notes, blobs and connections scenarios and records the blob,
hold, timer, transcript, room and closed-connection observations of those
inputs. Its API and CLI-JSON snapshots are the v0.5.0 tag's bytes, and its diff
and WIT snapshots are the tag's versions of those new record kinds and
interfaces. As before, the case is pinned to the ELF digest in the tagged
reproducibility.json, not to a build of this checkout.
The v0.6.0 case adds one input to that scenario: a call answered with a blob
that the callee wrote (CALLEE_WRITTEN_REPLY). v0.5.0 already answered such a
call, but its case was produced without it. Its 33 original roots are 7
counter, 2 notes, 10 media and 14 room inputs. Its counter, notes and room
guests are v0.5.0's bytes, so their entries name the stored components; its
media guest is the tag's own. Its four snapshots are the v0.6.0 tag's bytes,
and the case is pinned to the ELF digest in the tagged reproducibility.json.
The v0.6.1 case runs the v0.6.0 scenario unchanged, and its 33 original roots
are again 7 counter, 2 notes, 10 media and 14 room inputs. Its four guests are
the stored components' bytes. Its CLI-JSON, diff and WIT snapshots equal
v0.6.0's, and its API snapshot differs only in its version. The case is pinned
to the ELF digest in the tagged reproducibility.json.
Run the existing public-binary consumer from a clean candidate checkout:
cargo build -p kronik
python3 scripts/verify-compatibility.py \
--index tests/compatibility/releases.json \
--binary target/debug/kronik \
--revision "$(git rev-parse HEAD)" \
--workdir /var/tmp/kronik-compatibility-new \
--port 47831The work directory must not exist. The command copies, never upgrades in
place, each immutable corpus; runs real upgrade check; compares the original
state/log integrity hashes; requires every original root (nine in each
case before v0.5.0, 32 in v0.5.0, 33 in v0.6.0 and v0.6.1), not merely a positive root count, in the
upgrade check and isolated/continuous identity replays; and verifies the
historical key-backed result. It also deploys each release's genuine old
counter and SQL components into a fresh fixture, checks committed state
transitions, replays their five real inputs in both modes, consumes the public
versioned diff, and runs the versioned public policy semantic cases. The v0.5.0,
v0.6.0 and v0.6.1 cases additionally replay their blob roots (nine, ten and
ten) and their 14 connection roots through the released media and room components and check
their answers. Any mismatch exits
nonzero. The existing CI caller uses the already-built candidate; it must never
regenerate producer output during CI.
A corpus from v0.5.0 on also holds the record kinds that release added,
long-lived connections and blobs (scenarios in its manifest), and the
verifier checks them as well:
- Its original roots include their root inputs, and each identity replay
must replay every kind's roots with no divergent turn (the diff's
kinds), each connection's open, frames and close with no frame changed, itssend-nowframes from their recording, and the fetch from its recording. - The candidate must read every blob back byte for byte (the SHA-256 of its
content, which the manifest records), hold it
liveand whole (kronik blobs inspect --verify), keep it for every reason the producer's node did (the log, a hold, the pending timer's or the saved call's pin, the snapshot), report the same holds and the same pending timer, collect none of them, and find no drift between its pins and its rows (kronik blobs gc --dry-run --verify). - It must show the room's messages, closes and closed connections as the producer saw them, and each connection's frame counts and close must agree with its client's transcript in the manifest.
- The released media and room components are deployed with the counter and
SQL components. After the policy cases, from a stable point of their own,
media reads an upload above the blob threshold in 4 KiB chunks, writes a
blob and answers with it, and puts a blob that it then holds and reads, and
room has a WebSocket member with a subject that streams two
send-nowframes and saysbye; both replays of those inputs must be exact, per kind and per frame.
An older WIT component may instead receive a real nonzero
IMPORT_NOT_ALLOWED response identifying its old package/interface version and
an explicit rebuild path naming the supported package and kronik build.
Generic link failures, missing JSON errors, successful exit codes with error
text, and hints added by this script do not qualify. The failed deployment must
leave the actual deployment inventory unchanged. The consumer then deploys
the maintained current component and still runs the real state, replay, diff
and policy checks. Its proof distinguishes executing original bytes from this
clear-migration alternative; rejecting a component never makes old-log replay
optional. Today's generic allowlist hint alone is not a migration receipt.
The candidate must support the current historical integrity query and confirm
the requested through_lsn in its response. Released v0.3.0 is a valid
producer, but its older integrity handler reads through the current applied
LSN and does not accept that position as an argument. Do not use it as a
modern candidate, drop the integrity comparison, or rewrite the frozen log
hash after an engine-upgrade record has been appended.
compatibility-corpus.py produce is an explicit maintainer operation requiring
the real release binary and its pinned SHA-256. It accepts any published
v0.N.M tag and refuses a binary whose --version first line is not that
release's own: kronik 0.N.M, or kronik 0.1.0-dev for the v0.1.0 artifact.
Its --emit-files records may be promoted by promote-compatibility-corpus.py
only into a new owned directory. Promotion verifies bounded payloads, exact
inventory and digest/provenance agreement, and refuses existing destinations.
Only the public dummy master key 44 repeated 32 times and owned test data
occur in these fixtures. The steps for a new release follow the catalog rule
below.
The retained compatibility proof
shows nine original roots and ten turns per actual producer, successful engine
upgrade from Wasmtime 50.0.0 to 50.0.1, and complete unchanged replay in both
modes. Those measurements were made on the d9b946f2-based binary, before
the subsequently integrated M23–M30 product. The later IO
0.1-to-0.2 adapter, new wire formats, public API/CLI additions and their schemas
must pass again against that actual integrated binary before any M33 or v0.9
claim. The source revision label alone is not proof of a clean release build.
The complete index consumer subsequently passed against that same
checkpoint binary, SHA-256
149fe62fe088267992a1eec40853947c89daab9c38b58acb44cf0bf6a1fc5408.
For both actual releases it read the frozen producer log, upgraded and
verified the original bounded integrity, then deployed the genuine tagged old
counter and SQL component bytes into a separate fresh daemon. Two committed
increments read back as 2; the committed SQL insert read back as one row.
All five actual inputs replayed unchanged in each mode, with zero
approximate/synthetic inputs or divergent turns.
The real public kronik.diff/v1 API agreed with the CLI replay's semantic
summary. Public policy evaluation kept deny stricter than later allow,
and a missing-field evaluation error required approval rather than allowing
promotion. The exact
released-component and contract proof
is retained; this was not a source-copy, default-value or decoder-only test.
The released v0.1.0/v0.3.0/v0.4.0/v0.4.1 WIT definitions and the committed d9b946f2
definition also resolve to the same actual Git blob,
86c3f0e739057aa08c460bda06f1a42c9679d87e. That confirms the legacy definition's
lineage without substituting today's component binary for the older binaries.
The final IO 0.2 adapter and subsequently integrated product still require
the same frozen consumer to pass again; this checkpoint does not certify them.
The ordinary source tests cover these distinct boundaries:
| Contract | Compatibility guard | Required product evidence |
|---|---|---|
| Log format v1 | Pinned complete released-producer catalog, unchanged manifests/inventory, and exact original-root assertions | The actual candidate reads or explicitly upgrades every published 0.x corpus, preserves bounded state/log integrity, and identity-replays every original root |
WIT kronik:actor@1.0.0
|
Selected-baseline ABI tokens, ignoring comments/layout but not field order, types, ownership or package identity; strict actual migration-error decoding | Genuine old components execute, or the product gives the clear migration response above and current components really execute; intended WIT 1.0 itself must first exist |
API /v1
|
Every baseline method/path, authorization/scope, parameter serialization, required body, status/header/media type and request/response schema | Existing generated-schema and routed-API checks bind the source to the real binary; actual public consumers must pass against that same candidate |
| CLI JSON | Every baseline command's JSON availability/output variants and typed error response; transitive schema references, types, fields, requiredness, nullability, enums and defaults | The existing typed-schema/Clap inventory tests keep the generated page complete; real CLI consumers must pass against the coherent candidate |
kronik.diff/v1 |
Full selected schema, including its real version constant and referenced definitions, plus API/CLI semantic-summary agreement | Existing real-diff schema tests and the released-component public diff consumer |
| Policy language | Versioned tests/compatibility/policy-cases.json: strictest-action precedence, no-match default, errors, short-circuiting, actual diff values, arithmetic, membership, collections, string methods and presence |
Each case is evaluated by the actual public /v1/policy/test implementation; no second policy interpreter or source-copy assertion |
scripts/compatibility-contracts.py is a conservative source comparison:
requests must continue to accept old inputs, while new responses must still
satisfy old consumers. It follows internal schema references, including
transitive and recursive definitions. Descriptions, examples and layout are
not wire contracts; changed defaults, closed objects, enum variants and
unknown changed validation keywords cannot silently pass. Unsupported schema
constructs fail closed and need a concrete compatibility proof, not a bypass.
Newly named properties must also preserve the old additionalProperties
contract: an optional integer field can reject previously accepted string
requests, or violate an old string-valued response map. Optionality alone is
not compatibility; declaring the same previously accepted value type is.
Enum, constant and default values use JSON equality, including nested values:
true/false are not 1/0, while equal JSON numbers such as 1 and 1.0
remain equal.
An explicitly reviewed baseline can be compared with a source checkout:
python3 scripts/compatibility-contracts.py \
--baseline tests/compatibility/v0.3.0/contracts \
--candidate-root .The historical directories are lineage and comparison inputs, not a claim
that all pre-v0.9 API/error-enum changes were forbidden. This command can reject
a deliberately documented pre-freeze change. It is not newly wired into
today's CI as a global freeze gate. The build brief starts the interface
promise after v0.9; the separate old-log requirement already covers every
published 0.x. No empty, future or invented v0.9 baseline is checked in.
Once a coherent product actually meets the acceptance criteria, retain its
reviewed source snapshots and provenance as the declared freeze baseline and
make this comparison against that exact baseline required. A successful
source comparison alone never proves the binary, old-WIT adapter or freeze.
For each newly published actual 0.x release, update the declared catalog and
add its case together: pinned published binary/source identity, unchanged
producer data/manifest, the observed original root count, genuine tagged
components, and exact tagged contract source bytes with Git-blob and SHA-256
identities. Do not delete a published release to make the matrix green, rewrite
old bytes for a new engine, or replace a tagged component with a new build.
The currently retained v0.1.0/v0.3.0/v0.4.0/v0.4.1/v0.5.0/v0.6.0/v0.6.1 snapshots were read
directly from source commits f4d9d9e2cccf515cb5cc4952c0e8a3f643372e34,
d9d460bc89f6ae30962ef16238b8fcaa6485a8de,
90e0c92194514ad141a6273f26fc99f34145acff,
34f0a8ce4251f10c44b243d337cbf0e9a203cdfc,
fcc5bf5a3eaa2dd68bc3bf3bdd0ef64b0cf5bf75,
8097759e3d0581ed3e29556d7433a0c5c86f62d7 and
038949e90f71fbd836b730cdc626842c8895d053, apart from the declared edit of
three CLI-JSON snapshots above. Each is the commit its release tag names; the
verifier refuses a catalog that adds, omits or moves a case across the
repository's v0.x tags. A later edit of a snapshot declares itself the same
way, or the verifier refuses it.
The case is produced from the published binary, never from a build or from the candidate:
-
Download the release's
kronik-x86_64-unknown-linux-musl.tar.gz, its.sigstore.jsonbundle,SHA256SUMSandreproducibility.json, and check the checksums withsha256sum -c. -
Verify the attestation the way
scripts/install.shdoes: run the release's owninstall.shon the downloaded files in a scrubbed environment, with no GitHub token orghlogin and a private home directory (env -i PATH=/usr/bin:/bin HOME=... GH_CONFIG_DIR=... KRONIK_BASE_URL=file://... KRONIK_INSTALL_DIR=... KRONIK_INSTALL_RUNSC=no sh install.sh). It fetches its source-pinned official verifier and refuses an archive that this repository's release workflow did not attest for the tag. A matching checksum alone is weaker evidence and does not qualify. -
Pin
sha256sumof the installedkronik. It must equal the ELF digest in the attestedreproducibility.json, and it is the--binary-sha256and the index'sproducer_binary_sha256. -
From a clean environment and a new work directory with a neutral name, run
scripts/compatibility-corpus.py produce --release vX.Y.Z --emit-fileswith that binary, the maintainedtests/guests/counter.wasmandnotes.wasm(from v0.5.0, and only then, also--media tests/guests/media.wasm --room tests/guests/room.wasm), the tag's commit fromgit rev-parse vX.Y.Z^{commit}as--revision, and a free fixture port. Promote its output withscripts/promote-compatibility-corpus.pyintotests/compatibility/vX.Y.Z.From v0.5.0 the scenario adds connection and blob records. Its configuration has no
[blobs]table: blobs are always on from v0.5.0, which refuses the development builds'enabledswitch.- The room (
room/compat): a WebSocket member with the subjectuser:7says something to the room, has a frame echoed and streams three frames withsend-now; a member without a subject has a frame echoed and saysbye, so the actor closes it; the operator closes an SSE follower; the first member closes as a client. The script waits for each frame, so each client's transcript (the frames it sent and received) is exact, and no connection is open in the corpus. - Blobs, at a 64 KiB threshold for the
mediakind, each at most 300 KB: an upload; a document of 150 KB that a fetch from a local server records as a blob (http:127.0.0.1is granted); a blob a turn writes and answers with; a blob put by one actor, sent on a message to another that retains it, then released by the first; a timer due in 50 years whose message carries a blob; and a call whose reply carries the caller's blob, which the caller keeps. - The manifest records each blob's hash, size, SHA-256 and roots, the holds and the pending timer, the transcripts, the room's state, the closed connections, and the root inputs of each kind.
- From v0.6.0 the scenario also has a call answered with a blob that the
callee wrote (
CALLEE_WRITTEN_REPLY). v0.5.0 already answered one, but its case was produced without it; earlier builds fail the caller.
- The room (
-
Store the tag's four contract sources under
vX.Y.Z/contracts/and its guest components undercomponents/(git show vX.Y.Z:<path>: counter and notes, and from v0.5.0 also media and room), and add the case toreleases.jsonand the tag topublished_releases. Take the root count from the release binary's ownkronik upgrade check. -
Run
scripts/verify-compatibility.pyas above, and scan every new file for environment details (absolute paths, host names, account names, addresses and e-mail) before committing.
Ordinary Python behavior tests and explicit source-CLI comparisons do not run the Kronik product, upgrade/replay an old log, or prove a production WIT migration rejection. The historical checkpoint evidence above remains historical. These source guards do not declare WIT 1.0, current coherent product acceptance, the v0.9 freeze or a v1/v2 support window already in force.
The source identities tested by the lightweight source verification are:
| Source | SHA-256 |
|---|---|
scripts/compatibility-contracts.py |
ddddce87b3b24d48ebc4179936b23f73a4d7bae7b686ab29839183b6cd8dc984 |
scripts/tests/test_compatibility_contracts.py |
1f7d2b92b72d686747d5bcbbcaf6ecacde245d85cbf29eb43087e1864a9fdb3b |
scripts/tests/test_compatibility.py |
e73f41e1fef0b37b0210b638b8137f7e8a6cc6f2d2d5ff0ff59fb43fded40e00 |
The suite reported 58 successful cases and zero skips. The two real source-CLI
pass/fail pairs and the 2.140556-second outer observation are separate from
any production acceptance. The raw failure/success outputs and exact
read-only source evidence are retained. Mutable candidates existed only in the
two finite --rm containers' tmpfs.