feat: isNewerMajor + store write-refusal backstop (F5 SLICE-2, INV-16, #14)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import { describe, it, expect } from "vitest";
|
||||
import {
|
||||
SCHEMA_VERSION,
|
||||
emptyArtifact,
|
||||
isNewerMajor,
|
||||
serializeArtifact,
|
||||
type Artifact,
|
||||
} from "../src/model";
|
||||
@@ -103,6 +104,13 @@ describe("cross-rung identity (F5 SLICE-2)", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("isNewerMajor (F5 SLICE-2, INV-16)", () => {
|
||||
it("is false for v1 and true for a newer major", () => {
|
||||
expect(isNewerMajor(emptyArtifact("d.md"))).toBe(false);
|
||||
expect(isNewerMajor({ schemaVersion: 2 })).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("unknown-field preservation (F5 SLICE-2, INV-15)", () => {
|
||||
it("a rewrite preserves unknown fields at every level, after known keys, sorted", () => {
|
||||
const foreign = {
|
||||
|
||||
Reference in New Issue
Block a user