Skip to content

Upgrade readiness records from 1.0.0 to 2.0.0

SDK 0.5.0 makes readiness 2.0.0 the current readiness schema in TypeScript, Rust and Python (release notes, capability row “Readiness 2.0.0 (MODEL capability kind, model set, configuration projection)”). Upgrading the SDK changes which version the codec writes. It never changes a record that already exists: upgrading never rewrites what an approver approved (agent binding §9).

  • Decoding accepts 1.0.0 and 2.0.0, and a decoded record keeps the version it was written in.
  • Encoding writes 2.0.0 only. Encoding a 1.0.0 record fails with UNSUPPORTED_VERSION; the SDK has no conversion, and a host must not write one.
  • The manifest digest covers both versions, so a pin taken under 1.0.0 stays checkable after the upgrade.
  • SDK evaluation takes 1.0.0 inputs only and returns a 1.0.0 report. A 2.0.0 snapshot or requirements record is refused with UNSUPPORTED_VERSION; the Praxis engine evaluates 2.0.0 itself.
  • Types. The plain readiness type names describe 2.0.0. The 1.0.0 types are under v1: v1.Manifest in TypeScript, aiws_sdk::readiness::v1 in Rust and aiws.readiness.v1 in Python.

The recipe reads an approved 1.0.0 manifest and a 2.0.0 manifest, both verbatim cases of the shared readiness fixtures in spec/engine-v1. It shows the 1.0.0 record decoded with its version kept and refused by the encoder, its digest unchanged, the 2.0.0 record round-tripping with a stable digest, and SDK evaluation accepting 1.0.0 inputs and refusing 2.0.0 ones.

Read readiness 1.0.0 and 2.0.0 records across the upgrade · Executable SDK codec example; the manifests are shared fixture cases

import assert from 'node:assert/strict';
import {decodeReadiness,encodeReadiness,manifestDigest,evaluateReadiness,type Manifest,type v1} from '@aiws/sdk/readiness';
// A 1.0.0 manifest an approver approved, and a 2.0.0 manifest authored as new work for review. Both are verbatim
// cases of the shared fixtures in spec/engine-v1: "Manifest valid" of readiness.fixtures-1.0.0.json and
// "Manifest local-repo-prep" of readiness.fixtures.json.
const approved1='{"profile":"aiws-capabilities/1","version":"1.0.0","agentId":"local","provider":"local-process","model":"none","implementationDigest":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","capabilities":[{"kind":"TOOL","name":"node","supported":true}]}';
const authored2='{"profile":"aiws-capabilities/2","version":"2.0.0","agentId":"local-repo-prep","implementationDigest":"37c29827b5b379aa8c5c6f3e3b6fcd194e7d535749101e7e2c49413461b2787d","modelSet":[],"configuration":null,"usageReporting":null,"capabilities":[{"kind":"TOOL","name":"node","supported":true},{"kind":"TOOL","name":"command:git","supported":true},{"kind":"OUTPUT","name":"file-artifacts","supported":true},{"kind":"CONTEXT","name":"fresh","supported":true},{"kind":"CONTEXT","name":"provider-resume","supported":false},{"kind":"ISOLATION","name":"filesystem-sandbox","supported":false},{"kind":"ISOLATION","name":"network-deny","supported":false}],"gaps":[]}';
const refused=(code:string)=>(e:any)=>e.message===code;
// Decoding reads both versions, and a decoded record keeps the version it was written in.
const old:v1.Manifest=decodeReadiness(approved1);
assert.equal(old.version,'1.0.0');
assert.equal(old.provider,'local-process');
// Encoding writes 2.0.0 only: the approved 1.0.0 record is refused and never converted.
assert.throws(()=>encodeReadiness(old),refused('UNSUPPORTED_VERSION'));
// Its digest is the same after the upgrade, so a pin taken under 1.0.0 stays checkable.
assert.equal(manifestDigest(old),'8be7189c650c4d28481597d5074dc90c82241f6aeb102724c0936d5a4a2130ad');
// A 2.0.0 record round-trips through the canonical encoding with a stable digest.
const current:Manifest=decodeReadiness(authored2);
assert.equal(current.version,'2.0.0');
const encoded=encodeReadiness(current);
assert.deepEqual(decodeReadiness(encoded),current);
assert.equal(manifestDigest(decodeReadiness(encoded)),manifestDigest(current));
assert.equal(manifestDigest(current),'96ad57ca64f7961333865097935edaab16d38542c18a2c830c9b2e95f1e92f92');
// SDK evaluation takes 1.0.0 inputs only and returns a 1.0.0 report; 2.0.0 inputs are refused.
const report:v1.Report=evaluateReadiness(
{profile:'aiws-capability-snapshot/1',version:'1.0.0',manifest:old,observedAtMs:100,validUntilMs:200,evidence:[{kind:'TOOL',name:'node',evidenceRef:'host:checked',validUntilMs:180}]},
{profile:'aiws-requirements/1',version:'1.0.0',agentId:'local',capabilities:[{kind:'TOOL',name:'node',assurance:'VERIFIED'}]},
150,manifestDigest(old));
assert.equal(report.version,'1.0.0');
assert.equal(report.status,'READY');
assert.equal(report.pinMatches,true);
assert.throws(()=>evaluateReadiness(
{profile:'aiws-capability-snapshot/2',version:'2.0.0',manifest:current,observedAtMs:100,validUntilMs:200,evidence:[{kind:'TOOL',name:'node',evidenceRef:'host:checked',validUntilMs:180}]},
{profile:'aiws-requirements/2',version:'2.0.0',agentId:'local-repo-prep',capabilities:[{kind:'TOOL',name:'node',assurance:'VERIFIED'}]},
150),refused('UNSUPPORTED_VERSION'));
console.log(JSON.stringify({approved:{version:old.version,manifestDigest:manifestDigest(old)},current:{version:current.version,manifestDigest:manifestDigest(current)}}));
console.log('PASS: readiness-codec');

A record approved under 1.0.0 stays a 1.0.0 record. Keep it as it was stored, and keep its pin. To move an agent onto 2.0.0, author a new 2.0.0 manifest that describes the agent as it is (its modelSet, configuration, usageReporting and gaps, with no provider or model field) and put it through review again: the approval of the 1.0.0 record does not carry over, because its material is different. Record a fractional setting value, such as a sampling temperature, as a string; a non-integer number is refused with UNSAFE_NUMBER.

In Praxis, a run bound under readiness 1.0.0 keeps its reviewed binding and 1.0.0 semantics until it ends, and new work binds under 2.0.0. Agent replacement is the route onto a 2.0.0 binding, and the run’s 1.0.0 binding stays as history; a run can also finish under 1.0.0, or be canceled and created again as separately reviewed 2.0.0 work. Each of those is a human decision (engine readiness).

The agent skill aiws-upgrade teaches this upgrade, driven by the per-release migration notes in docs/migration-notes.json; see Coding agents.