Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed

Versions 238 to 239

Compare

+21 −11 in 9 places
Lines 21–34 at 239 (were 21–32 at 238)
2121import { withProjectionScratch } from "./projection-scratch.ts";
2222import {
2323 type GraphStateStorage,
24+ readonlyPagedArray,
2425 readonlyStoredArray,
2526 type StateMap,
2627 storedArray,
2728 storedLists,
2829 storedMap,
2930 storedNumbers,
31+ writePagedArray,
3032} from "./state-source.ts";
3133import { StoredText } from "./stored-text.ts";
3234import {
Lines 355–361 at 239 (were 353–359 at 238)
353355 insertionFormat?: 1;
354356 insertionRuns?: string;
355357 textFormat?: 1;
356− listFormat?: 1;
358+ listFormat?: 1 | 2;
357359 listCount?: number;
358360 lists?: Partial<Record<(typeof listFields)[number], string>>;
359361 atom: Atom;
Lines 367–375 at 239 (were 365–373 at 238)
365367 const encoded = value as unknown as Partial<EncodedAtom>;
366368 if (encoded.textFormat !== undefined && encoded.textFormat !== 1)
367369 throw Error("invalid stored atom text format");
368− if (encoded.listFormat !== undefined && encoded.listFormat !== 1)
370+ if (encoded.listFormat !== undefined && encoded.listFormat !== 1 && encoded.listFormat !== 2)
369371 throw Error("invalid stored atom list format");
370− if (encoded.listFormat === 1) {
372+ if (encoded.listFormat === 1 || encoded.listFormat === 2) {
371373 if (
372374 !encoded.lists ||
373375 typeof encoded.lists !== "object" ||
Lines 384–393 at 239 (were 382–388 at 238)
382384 if (encoded.insertionFormat !== undefined && encoded.insertionFormat !== 1)
383385 throw Error("invalid stored insertion format");
384386 const atom =
385− encoded.textFormat === 1 || encoded.listFormat === 1 || encoded.insertionFormat === 1
387+ encoded.textFormat === 1 ||
388+ encoded.listFormat === 1 ||
389+ encoded.listFormat === 2 ||
390+ encoded.insertionFormat === 1
386391 ? encoded.atom!
387392 : value;
388393 if (encoded.insertionFormat === 1 && (!Array.isArray(atom.inserts) || atom.inserts.length !== 0))
Lines 467–474 at 239 (were 462–468 at 238)
462467 (author) => author,
463468 text,
464469 );
465− if (encoded.listFormat !== 1 && encoded.insertionFormat !== 1) return streamed(frozen);
470+ if (encoded.listFormat !== 1 && encoded.listFormat !== 2 && encoded.insertionFormat !== 1)
471+ return streamed(frozen);
466472 const result = { ...frozen };
467473 if (encoded.insertionFormat === 1) {
468474 const collection = `atom-inserts:${atom.seq}`;
Lines 498–508 at 239 (were 492–498 at 238)
492498 if (collection === undefined) continue;
493499 if (typeof collection !== "string" || collection !== `atom-list:${atom.seq}:${field}`)
494500 throw Error("invalid stored atom list reference");
495− Object.defineProperty(result, field, { value: readonlyStoredArray(storage, collection), enumerable: true });
501+ const list =
502+ encoded.listFormat === 2
503+ ? readonlyPagedArray(storage, collection)
504+ : readonlyStoredArray(storage, collection);
505+ Object.defineProperty(result, field, { value: list, enumerable: true });
496506 }
497507 return streamed(Object.freeze(result));
498508 },
Lines 512–520 at 239 (were 502–510 at 238)
502512 for (const field of listFields) {
503513 const values = input[field];
504514 if (!values || values.length <= 256) continue;
515+ // 256 to a row from list format 2 on (abso Capacity); an atom stored before keeps a row per value.
505516 const collection = `atom-list:${input.seq}:${field}`;
506− const saved = storedArray<unknown>(storage, collection);
507− for (const value of values) saved.push(value);
517+ writePagedArray(storage, collection, values);
508518 lists[field] = collection;
509519 Object.defineProperty(atom, field, { value: [], enumerable: true });
510520 }
Lines 545–556 at 239 (were 535–546 at 238)
535545 return {
536546 insertionFormat: 1,
537547 insertionRuns: collection,
538− ...(hasLists ? { listFormat: 1, listCount, lists } : {}),
548+ ...(hasLists ? { listFormat: 2, listCount, lists } : {}),
539549 atom: { ...atom, inserts: [] },
540550 };
541551 }
542552 if (!atom.inserts.some((run) => run.lines.some((line) => line.length > StoredText.chunkCharacters)))
543− return hasLists ? { listFormat: 1, listCount, lists, atom } : atom;
553+ return hasLists ? { listFormat: 2, listCount, lists, atom } : atom;
544554 let index = 0;
545555 const inserts = atom.inserts.map((run) => ({
546556 ...run,
Lines 563–569 at 239 (were 553–559 at 238)
553563 }));
554564 return {
555565 textFormat: 1,
556− ...(hasLists ? { listFormat: 1, listCount, lists } : {}),
566+ ...(hasLists ? { listFormat: 2, listCount, lists } : {}),
557567 atom: { ...atom, inserts },
558568 };
559569 },
MCP
compare on this site's /mcp
CLI
abso diff 238 239 src/engine/graph.ts --json
JSON
/christopher/abso-core/compare/238..239?file=src%2Fengine%2Fgraph.ts&format=json