Versions 33 to 318
new file, 565 lines
4+import { CachedStateStorage, StableOverlaySet, storedLists, storedNumbers } from "../state-source.ts";
7+
8+test("counter writes avoid rereads while respecting failed writes, rollback and cache bounds", () => {
44+ assert.equal(Object.is(cache.read("counter", "negative-zero"), source.read("counter", "negative-zero")), true);
49+
50+// The line-by-line layout, which a graph adopted before packed file history still uses (packFiles: false).
51+test("current visibility stops at the first included deletion while history retains every deleter", () => {
77+ assert.equal(storage.pageReads, 0, "current visibility needs no later deleters after the first match");
83+ assert.equal(lastOnly.text("a.txt"), "live\n", "excluded early deletions must not hide a later included one");
88+
131+
153+ assert.equal(pagesRead, 1, "first claimant reads one claim page, not the entire hot-key history");
158+ for (const [, page] of source.entries(`${name}:pages`)) assert.ok((page as string[]).length <= 256);
170+
191+
217+ for (const [, page] of source.entries("files:pages")) assert.ok((page as string[]).length <= 256);
224+
225+test("numeric pages cross boundaries, reopen, mutate and roll back without retaining history", () => {
258+
270+
271+test("stored graph reopens without replay and preserves moves, conflicts and new edits", () => {
310+
314+ const right = oracle.draft({ edits: [{ file: "a.txt", old: "one", new: "uno" }], author: "right" }, ["a0"]);
319+ assert.deepEqual(checkDraft(new Graph({ storage }), oracle.shared, right), oracle.check(right));
322+ assert.deepEqual(new Graph({ storage }).writersOf("L:a0.0"), oracle.graph.writersOf("L:a0.0"));
323+ assert.deepEqual(new Graph({ storage }).deletedLines(right.id), oracle.graph.deletedLines(right.id));
326+
343+
361+
408+
446+ assert.equal(storage.pageReads, 1, "the implicit child needs no page; the next sibling needs one");
465+
466+test("persistent layout uses ordered successors without retaining deep or wide history frontiers", () => {
471+ "a.txt": shape === "deep" ? Array.from({ length: 1024 }, (_, n) => `line ${n}\n`).join("") : "base\n",
514+
532+ assert.equal(storage.priorityReads, 0, "single-child traversal does not decode sort priority");
539+
540+test("ordered layout refuses missing format or child metadata instead of dropping history", () => {
548+ () => new View(new Graph({ storage, packFiles: false }), new StableOverlaySet(["a0"])).text("a.txt"),
- MCP
- compare on this site's /mcp
- CLI
- abso diff 33 318 src/engine/test/state-source.test.ts --json
- JSON
- /christopher/abso-core/compare/33..318?file=src%2Fengine%2Ftest%2Fstate-source.test.ts&format=json