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.
Source builds and releases
Section titled “Source builds and releases”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.
SDK 0.5.1: history-free reducer
Section titled “SDK 0.5.1: history-free reducer”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].verificationRevisionslists everyverifyrevision of the run in arrival order.verifychecks it, instead of scanning the events, and refuses a repeat withDUPLICATE_ID. A run that was never verified has no such field.traceHeads[traceId]is{ latest: { id, spanId }, byRun: { <runId>: { id, spanId } } }.reduceupdates it from each appended event, and the next event takes itscausationIdandparentSpanIdfrom it.createMissionstarts 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:
SqliteStorenever stores a snapshot, andloadreplays the journal throughreduce, 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
traceHeadsis refused withINVALID_RECORD. Rebuild it withauditPlayback(contract, events)(audit_playbackin Rust and Python). Do not add the field by hand: an empty index would drop the causation chain and the duplicateverifycheck. Snapshot::without_events(Rust) returns the same snapshot witheventscleared. The shared fixtures are replayed witheventscleared before each command, and must append the same events and reach the same state, in all three SDKs.- The handoff-v1
stateDigestcovers the core snapshot, so the digests inspec/handoff-v1/runtime-cases.jsonchanged with the two fields. The handoff protocol, requests and results did not.
SDK 0.5.0: overrun settlement
Section titled “SDK 0.5.0: overrun settlement”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 withEXPOSURE_EXCEEDED. A finite-v1PREPAREDattempt is still capped at its amount. - A scope whose settled cost exceeds its bound is over budget by derivation. It refuses
admit,retryanddispatchwithBUDGET_EXHAUSTEDorGRANT_BUDGET_EXHAUSTED(finite-v1), or new reservations and dispatch withLIMIT_EXHAUSTED(aiws-limits/1). finite-v1dispatchnow refuses whenspent + reservedalready passes a bound. - A resulting total over 100 digits is refused:
INVALID_RECORDin finite-v1,SCHEMA_INVALIDinaiws-limits/1. aiws-limits/1reservation checks the handoff partition by the attempt’s purpose, so HANDOFF work can still use the remaining total headroom after an ordinary overrun.operationalSummaryadds theBUDGET_OVERRUNalert; 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/sdkon npm,aiws-sdkon crates.io,aiws-sdkon PyPI) ships the version-matched agent docs pack and theaiwsworkflow skills plugin. agentssubcommands on all three SDK CLIs:aiws agents,aiws-sdk agentsandaiws-python agentsoffer two subcommands:agents sync [DIR]: Copies the version-matched agent docs pack into.aiws/agent-docs/<language>/, creates or updates the managedAGENTS.mdblock, and installs the packagedaiwsworkflow 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.gitignorecontaining*so synced skills remain uncommitted.agents check [DIR]: Verifies that the installed agent docs pack,AGENTS.mdblock and synced skills match the installed SDK version and exits 1 on drift.
- Praxis engine skills: The
praxisworkflow 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) anddiagnose_graph(Rust, Python) return every fault of a graph as{ code, path, nodeId? };validateGraphstill throws, now with the code of the first diagnostic. See the capability matrix. - Cargo features. The Rust SDK gains
sqliteandhttp, both on by default. A consumer that wants only the core, workflow and validation API setsdefault-features = false. - Versioned schema id.
spec/schema.jsonand its three copies carry$id: https://aiws.dev/finite-v1/<schema-version>; the first version is0.4.0, and the wire records are unchanged. A definition editor can cite the$id. The version and the digest recorded for it are inspec/schema-version.json, andnpm run spec:schema:check(run inverify.yml) fails when the schema’s bytes change while its version stays the same. To change the schema: editscripts/generate-schema.py, bumpversioninspec/schema-version.json, runpython 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.0on19caf896,sdk-v0.5.0on the release merge commit, andsdk-v0.5.1oncbf9c34b, 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.
SDK 0.4.0 release notes
Section titled “SDK 0.4.0 release notes”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) asreadiness.schema.jsonand the frozen 1.0.0 schema beside it asreadiness.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/2andaiws-readiness/2profiles. Encoding a 1.0.0 record fails withUNSUPPORTED_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.Reportin TypeScript (import type {v1} from '@aiws/sdk/readiness'),aiws_sdk::readiness::v1in Rust andaiws.readiness.v1in Python. Code that named the 1.0.0 types by their plain names must switch tov1. - A 2.0.0 manifest has no
providerormodel. It hasmodelSet,configuration,usageReportingandgaps, and theMODELcapability 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 ofINVALID_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.reconcilerecords 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’sreconcilenow reads the clock once and gives the authorizer the time its rejection records, asapplydoes; 0.4.0 read the clock again for the authorizer. - Failed authorizer in reconciliation. When the authorizer throws (in Rust, returns
Err) duringCoordinator.reconcile, current source records the rejected settle command as AUTHORIZATION_ERROR, without context and at the time the authorizer was given, andreconcilefails with AUTHORIZATION_ERROR without calling the adapter, asapplydoes. In 0.4.0 the authorizer’s own error propagated fromreconcileand no rejection was recorded, in all three SDKs. A caller that caught that error fromreconcilenow receives AUTHORIZATION_ERROR instead. - Empty attribution. Rust’s
Coordinatorrefuses a decision whoseactororpolicyRevisionis an empty string with ATTRIBUTION_REQUIRED and records the rejection, inapplyandreconcilealike, as TypeScript and Python do.Context.actorandContext.policyRevisionhaveminLength: 1in the schema. In 0.4.0 Rust passed the empty value on:reconcilecalled the adapter andapplyreached the store, which refused the record as INVALID_RECORD. - Graph check order. Rust’s
validate_graphreports 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-sdkandaiws-pythonnow 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.snapshotandobservereport FILE_ERROR for a missing file instead of creating an empty database, and STORAGE_ERROR for a file SQLite cannot read.fixturesuses 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.
Existing journals
Section titled “Existing journals”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.
Application code and definitions
Section titled “Application code and definitions”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.
Release procedure
Section titled “Release procedure”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.
Adding nested limits from current source
Section titled “Adding nested limits from current source”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.