Skip to content

Versioning and safe upgrades

SDK 0.5.1 targets proposal edition 0.4. The SDK version and standard edition are different identifiers. The finite-v1 schema and journal event envelopes are version-bound; a package upgrade is not automatic migration of existing data.

A release commit carries the release’s version in all three SDK manifests (packages/typescript/package.json, crates/aiws/Cargo.toml, packages/python/pyproject.toml) and in aiws.__version__. Every other commit carries a later version ending in -dev: after SDK 0.5.1, source carries 0.5.2-dev. A build from source therefore never reports the version of a release whose rules differ from it. npm, Cargo, aiws.__version__, the agent docs pack’s sdkVersion, the AGENTS.md block and the synced skill stamps all show the -dev version, and pip shows its normal form (0.5.2.dev0). The -dev suffix names no rule; the capability matrix does.

A rule built in source that no release carries is a proposal. Its capability matrix row says so, this page has a section for it, and STANDARD.md follows the rule’s text with an informative implementation-status note, which goes when a release carries the rule. The release commit drops -dev and adds the release’s notes to docs/migration-notes.json in the same change. npm run skills:check and npm run docs:check fail on manifests that carry neither the newest release in that file nor a later version ending in -dev. Pages name releases, never a -dev version.

reduce and every other decision function (gate, readyNodes) now give the same next state, apart from events, and the same appended event, whatever snapshot.events holds. events is output only: a host may store a snapshot without it. The observability functions (operationalSummary, tracePayload, the metrics) and the audit export still read it, so a host that clears it loses what they compute.

  • runs[runId].verificationRevisions lists every verify revision of the run in arrival order. verify checks it, instead of scanning the events, and refuses a repeat with DUPLICATE_ID. A run that was never verified has no such field.
  • traceHeads[traceId] is { latest: { id, spanId }, byRun: { <runId>: { id, spanId } } }. reduce updates it from each appended event, and the next event takes its causationId and parentSpanId from it. createMission starts it empty.
  • Both are new snapshot fields. The wire records, the journal and the event envelope are unchanged; no schema revision.
  • Journals and SQLite stores need no migration: SqliteStore never stores a snapshot, and load replays the journal through reduce, which rebuilds both fields.
  • A snapshot you stored yourself must be rebuilt. A snapshot from SDK 0.5.0 or earlier that still holds events but has no traceHeads is refused with INVALID_RECORD. Rebuild it with auditPlayback(contract, events) (audit_playback in Rust and Python). Do not add the field by hand: an empty index would drop the causation chain and the duplicate verify check.
  • Snapshot::without_events (Rust) returns the same snapshot with events cleared. The shared fixtures are replayed with events cleared before each command, and must append the same events and reach the same state, in all three SDKs.
  • The handoff-v1 stateDigest covers the core snapshot, so the digests in spec/handoff-v1/runtime-cases.json changed with the two fields. The handoff protocol, requests and results did not.

A proposal, not a released API. Current source builds it in all three SDKs; it ships in SDK 0.5.0, all three SDKs and both profiles together, and SDK 0.4.0 keeps refusing an overrun. The wire does not change: no new field, event, error code or schema revision, and the standard stays at edition 0.4 (B-02, AT-59).

What changes, in finite-v1 and aiws-limits/1:

  • A settle of a dispatched attempt whose actual cost is above its amount records the true cost on the mission and every grant in its chain (finite-v1) or on the leaf scope and every ancestor (aiws-limits/1), instead of failing with EXPOSURE_EXCEEDED. A finite-v1 PREPARED attempt is still capped at its amount.
  • A scope whose settled cost exceeds its bound is over budget by derivation. It refuses admit, retry and dispatch with BUDGET_EXHAUSTED or GRANT_BUDGET_EXHAUSTED (finite-v1), or new reservations and dispatch with LIMIT_EXHAUSTED (aiws-limits/1). finite-v1 dispatch now refuses when spent + reserved already passes a bound.
  • A resulting total over 100 digits is refused: INVALID_RECORD in finite-v1, SCHEMA_INVALID in aiws-limits/1.
  • aiws-limits/1 reservation checks the handoff partition by the attempt’s purpose, so HANDOFF work can still use the remaining total headroom after an ordinary overrun.
  • operationalSummary adds the BUDGET_OVERRUN alert; see observability. The SDK gains no command to raise a finite-v1 budget; see budgets for the two human paths.

Upgrade every reader of a store to SDK 0.5.0 before any writer can record an overrun. An SDK 0.4.0 reader refuses a journal, audit playback or limits store that holds an overrun settle with EXPOSURE_EXCEEDED on load. Released code cannot be fixed, so logs and snapshots carry no version stamp; the troubleshooting row covers the error. Journals written before the change replay unchanged under SDK 0.5.0, because a refused settle was never journaled.

SDK 0.5.0: agent toolkit and packaged skills

Section titled “SDK 0.5.0: agent toolkit and packaged skills”

SDK 0.5.0 introduces the M11 agent skill toolkit shipped directly inside each SDK package in TypeScript, Rust and Python:

  • New package contents: Every SDK package (@aiws/sdk on npm, aiws-sdk on crates.io, aiws-sdk on PyPI) ships the version-matched agent docs pack and the aiws workflow skills plugin.
  • agents subcommands on all three SDK CLIs: aiws agents, aiws-sdk agents and aiws-python agents offer two subcommands:
    • agents sync [DIR]: Copies the version-matched agent docs pack into .aiws/agent-docs/<language>/, creates or updates the managed AGENTS.md block, and installs the packaged aiws workflow skills (aiws-effect-adapter, aiws-host-scaffold, aiws-workflow-graph, aiws-governance-review, aiws-protocol-wiring, aiws-upgrade) into .claude/skills/ and .agents/skills/. Each copied skill directory receives a .gitignore containing * so synced skills remain uncommitted.
    • agents check [DIR]: Verifies that the installed agent docs pack, AGENTS.md block and synced skills match the installed SDK version and exits 1 on drift.
  • Praxis engine skills: The praxis workflow skills (praxis-coding-plan, praxis-host-setup, praxis-hold-triage, praxis-agent-binding, praxis-workflow) are engine-source tools that load only in a Praxis source checkout or the extracted source zip; they are not shipped in the SDK packages.

SDK 0.5.0: graph diagnostics, Cargo features and the versioned schema id

Section titled “SDK 0.5.0: graph diagnostics, Cargo features and the versioned schema id”
  • Graph diagnostics. diagnoseGraph (TypeScript) and diagnose_graph (Rust, Python) return every fault of a graph as { code, path, nodeId? }; validateGraph still throws, now with the code of the first diagnostic. See the capability matrix.
  • Cargo features. The Rust SDK gains sqlite and http, both on by default. A consumer that wants only the core, workflow and validation API sets default-features = false.
  • Versioned schema id. spec/schema.json and its three copies carry $id: https://aiws.dev/finite-v1/<schema-version>; the first version is 0.4.0, and the wire records are unchanged. A definition editor can cite the $id. The version and the digest recorded for it are in spec/schema-version.json, and npm run spec:schema:check (run in verify.yml) fails when the schema’s bytes change while its version stays the same. To change the schema: edit scripts/generate-schema.py, bump version in spec/schema-version.json, run python scripts/generate-schema.py --record, and commit the four copies with the record.
  • Release tags. Each SDK release gets an annotated tag sdk-v<version> on its release commit: sdk-v0.4.0 on 19caf896, sdk-v0.5.0 on the release merge commit, and sdk-v0.5.1 on cbf9c34b, the last commit before the skipped-target COMPENSATION rule landed.

SDK source after 0.5.1: a COMPENSATION node whose target was skipped

Section titled “SDK source after 0.5.1: a COMPENSATION node whose target was skipped”

A proposal, not a released API. Current source builds it in all three SDKs, and no SDK release carries it yet; a source build reports a version ending in -dev (see source builds and releases). completeNode on a COMPENSATION node accepts { skippedTargetNodeId } with no operationId when the named node is a skipped TASK the node depends on; see the capability matrix. The wire does not change: a completeNode result is an open object, so spec/schema.json and its version stay as they are, and no command, event or error code is new.

Upgrade every reader of a journal before any writer can record such a completion. Every SDK release, SDK 0.5.1 included, completes a COMPENSATION node only with an applied operation, so a reader built from a release refuses a journal or audit playback that holds this completion, with NOT_FOUND. Journals without one replay unchanged in both directions. Never edit the journal to suit an older reader.

Breaking change: readiness 2.0.0 is the current readiness schema in all three SDKs. It is the only SDK part of M10 (agent binding §9); the rest of M10 is a source-only engine profile.

  • Each SDK carries 2.0.0 (https://aiws.dev/readiness/2.0.0) as readiness.schema.json and the frozen 1.0.0 schema beside it as readiness.schema-1.0.0.json.
  • Encoding produces only 2.0.0 records, with the aiws-capabilities/2, aiws-requirements/2, aiws-capability-snapshot/2, aiws-readiness-binding/2 and aiws-readiness/2 profiles. Encoding a 1.0.0 record fails with UNSUPPORTED_VERSION; nothing is converted.
  • Decoding accepts both versions, and a decoded record keeps its version. A headerless part (Capability, Requirement, Evidence, Check) is read under 2.0.0.
  • The exported readiness types now describe 2.0.0. The 1.0.0 types moved to v1: v1.Report in TypeScript (import type {v1} from '@aiws/sdk/readiness'), aiws_sdk::readiness::v1 in Rust and aiws.readiness.v1 in Python. Code that named the 1.0.0 types by their plain names must switch to v1.
  • A 2.0.0 manifest has no provider or model. It has modelSet, configuration, usageReporting and gaps, and the MODEL capability kind, which is VERIFIED only.
  • A number in a 2.0.0 setting value is a safe integer. Record a fraction, such as a sampling temperature, as a string; a non-integer is refused with UNSAFE_NUMBER.
  • Readiness evaluation still takes 1.0.0 inputs only and returns a 1.0.0 report; 2.0.0 inputs are refused with UNSUPPORTED_VERSION. The manifest digest covers both versions, so pins taken under 1.0.0 stay checkable.
  • Upgrade readiness records from 1.0.0 to 2.0.0 runs the codec on an approved 1.0.0 manifest and a 2.0.0 manifest in all three languages.
  • The Rust strict JSON parser now refuses a lone surrogate escape with INVALID_UNICODE, as TypeScript and Python do, instead of INVALID_JSON.

The 0.4.0 packages are also the first archives to contain the M2 handoff, M3 limits, M7 dynamic-control and M9 protocol-correlation source additions. Finite-v1 records, journals and event hashes are unchanged from 0.3.0.

SDK source after the 0.4.0 archives: parity fixes

Section titled “SDK source after the 0.4.0 archives: parity fixes”

Current source makes the three SDKs agree where the 0.4.0 archives differ by language, and makes Coordinator.reconcile record an authorizer failure as apply does. These changes reach users in the next 0.4.x release; the source still reports version 0.4.0. Finite-v1 records, journals and event hashes are unchanged.

Behaviour that changes:

  • Denied reconciliation. In TypeScript and Python, Coordinator.reconcile records a denied read-back as AUTHORITY_DENIED and a decision without actor or policyRevision as ATTRIBUTION_REQUIRED, and does not call the adapter, as Rust already did. In 0.4.0 they threw AUTHORITY_DENIED without a record, and an unattributed decision reached the adapter before the settlement was refused. Rust’s reconcile now reads the clock once and gives the authorizer the time its rejection records, as apply does; 0.4.0 read the clock again for the authorizer.
  • Failed authorizer in reconciliation. When the authorizer throws (in Rust, returns Err) during Coordinator.reconcile, current source records the rejected settle command as AUTHORIZATION_ERROR, without context and at the time the authorizer was given, and reconcile fails with AUTHORIZATION_ERROR without calling the adapter, as apply does. In 0.4.0 the authorizer’s own error propagated from reconcile and no rejection was recorded, in all three SDKs. A caller that caught that error from reconcile now receives AUTHORIZATION_ERROR instead.
  • Empty attribution. Rust’s Coordinator refuses a decision whose actor or policyRevision is an empty string with ATTRIBUTION_REQUIRED and records the rejection, in apply and reconcile alike, as TypeScript and Python do. Context.actor and Context.policyRevision have minLength: 1 in the schema. In 0.4.0 Rust passed the empty value on: reconcile called the adapter and apply reached the store, which refused the record as INVALID_RECORD.
  • Graph check order. Rust’s validate_graph reports INVALID_DEPENDENCY before a node schema error, as TypeScript and Python do.
  • Protocol correlation records. Every object takes an exact key set and the first failing rule is reported in record order, in all three SDKs; see spec/protocol-correlation-v1. A record a 0.4.0 SDK accepted can now be refused: an unknown key or a missing null-able key (Rust), a remote reference over 2048 UTF-8 bytes, containing a C1 control or a lone surrogate (TypeScript and Python), or a protocol family that is not a string (TypeScript).
  • CLIs. aiws, aiws-sdk and aiws-python now give identical output. A usage error, including an unknown command, writes the usage text to stderr and exits 2, where TypeScript and Rust exited 1 with the usage inside an error record and reported an unknown command as UNKNOWN_COMMAND. Errors are compact {"error":"CODE"} in Python too. A non-UTF-8 file is FILE_ERROR. snapshot and observe report FILE_ERROR for a missing file instead of creating an empty database, and STORAGE_ERROR for a file SQLite cannot read. fixtures uses the strict JSON parser and refuses a file that is not a fixture list with INVALID_RECORD; a fixture whose contract is refused is reported beside the others.

Additions: a TypeScript Clock type in @aiws/sdk/runtime; Python Clock and Authorizer in aiws.runtime and LimitAuthorizer in aiws.limits_store; Rust ProtocolCorrelation::from_value; and fixtures, snapshot and observe in the TypeScript CLI. A shared fixture may carry a fixture-level error for a contract that createMission must refuse.

Praxis engine source: the attempt environment rule

Section titled “Praxis engine source: the attempt environment rule”

Breaking change for every agent the engine runs, in source only; no SDK carries it. M10 slice 3 builds every attempt’s environment from nothing: the platform baseline, the variables the adapter or the engine sets on purpose, and a credential delivered through HC-09, the host credential provider. No other host variable reaches an attempt, so an agent or script that relied on an ambient GITHUB_TOKEN, cloud credentials or any other ambient variable stops working. HC-09 delivers only the credential a run’s reviewed projection names, at most one, and only to a run bound under readiness 2.0.0.

Before upgrading, run the upgrade preflight (control-cli upgrade-preflight, or Upgrade preflight in the web view) on the host you are upgrading. It lists every active run that would lose an ambient variable, by name and never by value. Reconcile each listed run to an end, or cancel it and create the work again as reviewed work whose projection names the one credential its agent needs. The full note, with the baseline variables and the preflight’s flags, is the attempt environment release note.

Edition 0.4 adds observation metadata and changes event hashes. Preserve edition 0.3 journals with the SDK version that produced them for historical playback. Do not relabel a contract or recompute historical events to make the new parser accept them. That would replace evidence rather than prove compatible migration.

Under the SDK 0.5.0 overrun settlement proposal, finite-v1 and aiws-limits/1 journals written by SDK 0.4.0 replay unchanged. A store that records an overrun settle needs an SDK 0.5.0 reader; see the upgrade order above. Never edit the journal to suit an older reader. The same holds for a journal that records a COMPENSATION node completed on a skipped target: it needs a reader built from current source; see the note above.

Before changing execution ownership or format, reconcile in-flight effects and record the source’s final disposition. Create an explicitly linked new mission only through a reviewed migration procedure, carrying forward authorized resource exposure, artifact lineage and relevant decisions. An audit import in this release produces a snapshot; it is not an import-into-store or live migration command.

Keep the workflow definition revision, adapter implementation version and material artifact revisions in your application records. Updating a code package can change behavior even when the graph JSON is unchanged. A months-long workflow needs a strategy for compatibility and dependency availability; the current SDK does not bundle a worker-version router or historical runtime images.

activatePlan appends plan identity and checks expectedPlan. It does not migrate graph topology or modify mission limits. Registration of a new trigger ID changes its deduplication namespace; preserve the relationship to past occurrences and prevent repeated external work during transition.

Run all language examples and the shared corpus, test reopening representative stored missions, review changed error semantics and verify package entrypoints. Test the actual adapter’s result parsing and external deduplication contract. Back up databases with a consistent SQLite procedure and retain artifact bytes for the required period.

After the release merge, create the annotated tag sdk-v<version> on the release merge commit and push it (with the owner’s go-ahead). Run npm run spec:schema:check; if the schema changed, the schema version in spec/schema-version.json moves with it.

The documentation source contains a verification script so future changes can detect copied examples that no longer match the package. Update text exports, API tables and executable sources together, then build the site. Never leave a documentation tab showing a new API while the downloadable package still has the old one.

Enable aiws-limits/1 explicitly using a new, human-approved scope tree and shared ledger. Do not reopen a mission/handoff database as a limit ledger or import running work with zero consumption. Automatic import and topology changes are unsupported. Every affected external call must pass both ledger and existing dispatch checks. The host reconciles crashes between databases conservatively; restarting never proves a dispatched effect did not occur. The SDK 0.4.0 packages include it; the old 0.3.0 packages do not.