Files
openclaw/test/scripts/check-native-state-schema-version.test.ts
Peter Steinberger b6548e509a refactor(state): retire commitments schema (#122176)
* refactor(state): retire commitments schema

* fix(state): complete commitments retirement safeguards

* test(state): expect doctor retirement report

* test(state): prove doctor v7 markers atomically

* fix(state): align schema support metadata

* fix(state): report actual commitments retirement

* fix(state): validate retired commitments schema

* fix(state): preserve early commitments upgrades

* fix(state): require exact commitments index set

* fix(state): reject non-exact retired schemas

* fix(state): recognize supported retirement layouts

* fix(state): expose commitments retirement to doctor

* fix(voice-call): describe commitments retirement

* test(state): align v7 rebase proof

* fix(state): protect commitments retirement dependencies

* fix(state): accept partial commitments layouts

* chore(docs): refresh v7 api baselines
2026-08-12 14:21:34 -07:00

21 lines
789 B
TypeScript

import { describe, expect, it } from "vitest";
import {
checkNativeStateSchemaVersion,
compareNativeStateSchemaVersions,
} from "../../scripts/check-native-state-schema-version.mjs";
describe("native state schema version guard", () => {
it("keeps the checked-in Swift and TypeScript contracts aligned", () => {
expect(checkNativeStateSchemaVersion()).toBe(7);
});
it("fails when a deliberate Swift fixture drifts behind TypeScript", () => {
expect(() =>
compareNativeStateSchemaVersions({
swiftSource: "private static let maximumSupportedSchemaVersion: Int64 = 5\n",
typescriptSource: "export const OPENCLAW_STATE_SCHEMA_VERSION = 7;\n",
}),
).toThrow("Native state schema version drift: Swift supports 5, TypeScript owns 7");
});
});