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 166 to 167

Compare

+21 −4 in 3 places
Lines 3–9 at 167 (were 3–8 at 166)
33// 2 MB) is split across rows and joined on load. Ported from the platform's worker/src/engine-project.ts; the
44// writer-adoption and R2 version parts are left out.
55
6+import { jsonValueChunks } from "../../src/engine/json-value-chunks.ts";
67import { blame, folderBlame, why } from "../../worker/project/blame.ts";
78import { feedEvents } from "../../worker/project/feed.ts";
89import { type Entry, type ProjectStore as LogStore, MemoryStore, Project } from "../../worker/project/project.ts";
Lines 34–55 at 167 (were 33–38 at 166)
3334 return parts;
3435}
3536
37+/** Retains one log row plus an encoder fragment, preserving legacy row boundaries. */
38+export function* streamedLogParts(value: unknown): IterableIterator<string> {
39+ let pending = "";
40+ for (const chunk of jsonValueChunks(value)) {
41+ pending += chunk;
42+ while (pending.length > LOG_PART_CHARACTERS) {
43+ let end = LOG_PART_CHARACTERS;
44+ const last = pending.charCodeAt(end - 1);
45+ if (last >= 0xd800 && last <= 0xdbff) end--;
46+ yield pending.slice(0, end);
47+ pending = pending.slice(end);
48+ }
49+ }
50+ if (pending) yield pending;
51+}
3653/** The lines an entry's atoms write: what a loaded project's size grows with (#46, #56). */
3754function linesIn(entry: Entry): number {
3855 let n = 0;
Lines 441–451 at 167 (were 424–434 at 166)
424441 if (keys > 0) this.storage.sql.exec("UPDATE counts SET value = value + ? WHERE name = 'keys'", keys);
425442 let chars = 0;
426443 for (const entry of entries) {
427− const json = JSON.stringify(entry);
428− logParts(json).forEach((text, part) => {
444+ let part = 0;
445+ for (const text of streamedLogParts(entry)) {
429446 chars += text.length;
430− this.storage.sql.exec("INSERT INTO log (seq, part, text) VALUES (?, ?, ?)", next, part, text);
431− });
447+ this.storage.sql.exec("INSERT INTO log (seq, part, text) VALUES (?, ?, ?)", next, part++, text);
448+ }
432449 next++;
433450 }
434451 // Chars are only added to once counted: a log from before the count is summed whole first (logSize).
MCP
compare on this site's /mcp
CLI
abso diff 166 167 server/src/engine-project.ts --json
JSON
/christopher/abso-core/compare/166..167?file=server%2Fsrc%2Fengine-project.ts&format=json