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
MCP
blame on this site's /mcp
CLI
abso blame worker/project/test/owed-definition-news.test.ts --version 296 --json
JSON
/christopher/abso-core/blame/worker/project/test/owed-definition-news.test.ts?version=296&format=json
130 linescapacity 85% · pinch 15%Last change pinch in version 296,

130 lines from 2 changes in 2 versions.

capacity295Owed news: a publish can leave its definition news for other agents for after its write (abso Capacity; prod abso's publishes reset its object, 2026-10-15) - With Project.owesDefinitionNews set, newsForOthers still tells same-lines and move news in the publish, but leaves the definition rule over other agents' drafts out. It records an OwedDefinitionNews {version, space, publisher, names} instead; takeOwedDefinitionNews hands it to the host once. - definitionNewsOwed(owed) works that news out later, as it would have been told at the publish: the rule runs against the space at that version, with the work published up to that version only (#newerFor and SharedAdditions take an end version). It reads only. An agent that has synced past the version since is left out. - deliverOwedNews(found) tells it through queueNews, so a key an agent was already told adds nothing. - Default off: the replay engine and every existing caller behave as before. abso's disk route turns it on, keeps the marker in the publish's own transaction, and delivers from the alarm. - Why: on abso's stored tables, the definition rule over ~40 drafts was 5.5 of a 1437-shaped publish's 7.3 s in the lab, about 45 s of one storage transaction in prod. That reset abso's object at 11:08 PM CT. With the rule owed, the publish's write is 18,622 statements instead of 105,252. - On prod since 11:35 PM CT as a patch (abso 2341e805), with Agent VCS's yes. This brings core level with it; abso's pin follows. - Keeps Observability's publishNews log lines (abso 702), and adds owed: 1 or 0 to the end line. Checks: tsc clean. node --test in worker/project/test, 41 of 41 pass: changed-definition, collision-streaming, collisions-kept-views, news-cap, news-lazy, news-lines, news-times, news-written, owed-definition-news (new: the same news, against the publish's version even after a later publish removes the name, synced agents left out, the replay engine unchanged), project-writer-storage, writer-adoption.Compare1// Owed news (abso Capacity, 2026-10-15): with owesDefinitionNews set (abso's disk route sets it), a publish leaves its
2// definition news for other agents for after its write. The same news, against the publish's version; told once; and
3// the publisher's own answer as before. abso's worker/test/owed-news.test.ts covers the disk route's marker and alarm.
4
5import assert from "node:assert/strict";
6import { test } from "node:test";
7import { MemoryStore, Project } from "../project.ts";
8
9// abso-core's changed-definition.test.ts scenario: parse.ts defines parsePattern, match.ts imports it.
10const START = {
11 "src/parse.ts": [
12 "export function parsePattern(text: string): Node {",
13 ' return { kind: "lit", text };',
14 "}",
15 "",
16 "export interface Node {",
17 " kind: string;",
18 " text: string;",
19 "}",
20 ].join("\n"),
pinch296Biome only: 295's two check errors (import order in worker/project/project.ts, formatting of worker/project/test/owed-definition-news.test.ts). No code changes.Compare21 "src/match.ts": [
22 'import { parsePattern } from "./parse.ts";',
23 "",
24 "export function run(p: string) {",
25 " return p;",
26 "}",
27 ].join("\n"),
capacity295Owed news: a publish can leave its definition news for other agents for after its write (abso Capacity; prod abso's publishes reset its object, 2026-10-15) - With Project.owesDefinitionNews set, newsForOthers still tells same-lines and move news in the publish, but leaves the definition rule over other agents' drafts out. It records an OwedDefinitionNews {version, space, publisher, names} instead; takeOwedDefinitionNews hands it to the host once. - definitionNewsOwed(owed) works that news out later, as it would have been told at the publish: the rule runs against the space at that version, with the work published up to that version only (#newerFor and SharedAdditions take an end version). It reads only. An agent that has synced past the version since is left out. - deliverOwedNews(found) tells it through queueNews, so a key an agent was already told adds nothing. - Default off: the replay engine and every existing caller behave as before. abso's disk route turns it on, keeps the marker in the publish's own transaction, and delivers from the alarm. - Why: on abso's stored tables, the definition rule over ~40 drafts was 5.5 of a 1437-shaped publish's 7.3 s in the lab, about 45 s of one storage transaction in prod. That reset abso's object at 11:08 PM CT. With the rule owed, the publish's write is 18,622 statements instead of 105,252. - On prod since 11:35 PM CT as a patch (abso 2341e805), with Agent VCS's yes. This brings core level with it; abso's pin follows. - Keeps Observability's publishNews log lines (abso 702), and adds owed: 1 or 0 to the end line. Checks: tsc clean. node --test in worker/project/test, 41 of 41 pass: changed-definition, collision-streaming, collisions-kept-views, news-cap, news-lazy, news-lines, news-times, news-written, owed-definition-news (new: the same news, against the publish's version even after a later publish removes the name, synced agents left out, the replay engine unchanged), project-writer-storage, writer-adoption.Compare28 "README.md": "Uses parsePattern.\n",
29};
31/** bob's draft calls parsePattern; ann's draft changes its signature; cat's touches something else. Nothing published. */
32function drafts(project: Project): void {
33 project.init(START, 0);
34 project.sync("bob");
35 project.sync("ann");
36 project.sync("cat");
37 project.edit(
pinch296Biome only: 295's two check errors (import order in worker/project/project.ts, formatting of worker/project/test/owed-definition-news.test.ts). No code changes.Compare38 "bob",
39 { file: "src/match.ts", old: " return p;\n", new: " const tree = parsePattern(p);\n return tree;\n" },
40 1,
41 );
42 project.edit(
capacity295Owed news: a publish can leave its definition news for other agents for after its write (abso Capacity; prod abso's publishes reset its object, 2026-10-15) - With Project.owesDefinitionNews set, newsForOthers still tells same-lines and move news in the publish, but leaves the definition rule over other agents' drafts out. It records an OwedDefinitionNews {version, space, publisher, names} instead; takeOwedDefinitionNews hands it to the host once. - definitionNewsOwed(owed) works that news out later, as it would have been told at the publish: the rule runs against the space at that version, with the work published up to that version only (#newerFor and SharedAdditions take an end version). It reads only. An agent that has synced past the version since is left out. - deliverOwedNews(found) tells it through queueNews, so a key an agent was already told adds nothing. - Default off: the replay engine and every existing caller behave as before. abso's disk route turns it on, keeps the marker in the publish's own transaction, and delivers from the alarm. - Why: on abso's stored tables, the definition rule over ~40 drafts was 5.5 of a 1437-shaped publish's 7.3 s in the lab, about 45 s of one storage transaction in prod. That reset abso's object at 11:08 PM CT. With the rule owed, the publish's write is 18,622 statements instead of 105,252. - On prod since 11:35 PM CT as a patch (abso 2341e805), with Agent VCS's yes. This brings core level with it; abso's pin follows. - Keeps Observability's publishNews log lines (abso 702), and adds owed: 1 or 0 to the end line. Checks: tsc clean. node --test in worker/project/test, 41 of 41 pass: changed-definition, collision-streaming, collisions-kept-views, news-cap, news-lazy, news-lines, news-times, news-written, owed-definition-news (new: the same news, against the publish's version even after a later publish removes the name, synced agents left out, the replay engine unchanged), project-writer-storage, writer-adoption.Compare43 "ann",
pinch296Biome only: 295's two check errors (import order in worker/project/project.ts, formatting of worker/project/test/owed-definition-news.test.ts). No code changes.Compare44 {
45 file: "src/parse.ts",
46 old: "parsePattern(text: string): Node",
47 new: "parsePattern(text: string, flags: string): Node",
48 },
capacity295Owed news: a publish can leave its definition news for other agents for after its write (abso Capacity; prod abso's publishes reset its object, 2026-10-15) - With Project.owesDefinitionNews set, newsForOthers still tells same-lines and move news in the publish, but leaves the definition rule over other agents' drafts out. It records an OwedDefinitionNews {version, space, publisher, names} instead; takeOwedDefinitionNews hands it to the host once. - definitionNewsOwed(owed) works that news out later, as it would have been told at the publish: the rule runs against the space at that version, with the work published up to that version only (#newerFor and SharedAdditions take an end version). It reads only. An agent that has synced past the version since is left out. - deliverOwedNews(found) tells it through queueNews, so a key an agent was already told adds nothing. - Default off: the replay engine and every existing caller behave as before. abso's disk route turns it on, keeps the marker in the publish's own transaction, and delivers from the alarm. - Why: on abso's stored tables, the definition rule over ~40 drafts was 5.5 of a 1437-shaped publish's 7.3 s in the lab, about 45 s of one storage transaction in prod. That reset abso's object at 11:08 PM CT. With the rule owed, the publish's write is 18,622 statements instead of 105,252. - On prod since 11:35 PM CT as a patch (abso 2341e805), with Agent VCS's yes. This brings core level with it; abso's pin follows. - Keeps Observability's publishNews log lines (abso 702), and adds owed: 1 or 0 to the end line. Checks: tsc clean. node --test in worker/project/test, 41 of 41 pass: changed-definition, collision-streaming, collisions-kept-views, news-cap, news-lazy, news-lines, news-times, news-written, owed-definition-news (new: the same news, against the publish's version even after a later publish removes the name, synced agents left out, the replay engine unchanged), project-writer-storage, writer-adoption.Compare49 2,
50 );
51 project.edit("cat", { file: "README.md", old: "Uses parsePattern.", new: "Uses parsePattern, twice." }, 3);
54const definitionNews = (news: readonly string[]) => news.filter((n) => /definition of parsePattern/.test(n)).sort();
56test("the news owed is the news a publish would have told, and the publisher's own answer is the same", () => {
57 const told = new Project(new MemoryStore());
58 drafts(told);
59 const toldAnswer = told.publish("ann", "parsePattern takes flags", 4);
60 const expected = definitionNews(told.news("bob").news);
61 assert.equal(expected.length, 1, "the scenario has a definition collision");
63 const owing = new Project(new MemoryStore());
64 owing.owesDefinitionNews = true;
65 drafts(owing);
66 assert.deepEqual(owing.publish("ann", "parsePattern takes flags", 4), toldAnswer, "the publisher's answer");
67 const owed = owing.takeOwedDefinitionNews();
pinch296Biome only: 295's two check errors (import order in worker/project/project.ts, formatting of worker/project/test/owed-definition-news.test.ts). No code changes.Compare68 assert.deepEqual(owed, [
69 { version: owing.version, space: owed[0]!.space, publisher: "ann", names: ["parsePattern"] },
70 ]);
capacity295Owed news: a publish can leave its definition news for other agents for after its write (abso Capacity; prod abso's publishes reset its object, 2026-10-15) - With Project.owesDefinitionNews set, newsForOthers still tells same-lines and move news in the publish, but leaves the definition rule over other agents' drafts out. It records an OwedDefinitionNews {version, space, publisher, names} instead; takeOwedDefinitionNews hands it to the host once. - definitionNewsOwed(owed) works that news out later, as it would have been told at the publish: the rule runs against the space at that version, with the work published up to that version only (#newerFor and SharedAdditions take an end version). It reads only. An agent that has synced past the version since is left out. - deliverOwedNews(found) tells it through queueNews, so a key an agent was already told adds nothing. - Default off: the replay engine and every existing caller behave as before. abso's disk route turns it on, keeps the marker in the publish's own transaction, and delivers from the alarm. - Why: on abso's stored tables, the definition rule over ~40 drafts was 5.5 of a 1437-shaped publish's 7.3 s in the lab, about 45 s of one storage transaction in prod. That reset abso's object at 11:08 PM CT. With the rule owed, the publish's write is 18,622 statements instead of 105,252. - On prod since 11:35 PM CT as a patch (abso 2341e805), with Agent VCS's yes. This brings core level with it; abso's pin follows. - Keeps Observability's publishNews log lines (abso 702), and adds owed: 1 or 0 to the end line. Checks: tsc clean. node --test in worker/project/test, 41 of 41 pass: changed-definition, collision-streaming, collisions-kept-views, news-cap, news-lazy, news-lines, news-times, news-written, owed-definition-news (new: the same news, against the publish's version even after a later publish removes the name, synced agents left out, the replay engine unchanged), project-writer-storage, writer-adoption.Compare71 assert.deepEqual(owing.takeOwedDefinitionNews(), [], "handed over once");
72 // Not told yet: bob's news holds no definition news until it's delivered.
73 assert.deepEqual(definitionNews(owing.news("bob").news), []);
74 const found = owing.definitionNewsOwed(owed[0]!);
75 assert.deepEqual(
76 found.map((f) => f.agent),
77 ["bob"],
78 );
79 assert.ok(owing.deliverOwedNews(found) > 0);
80 assert.deepEqual(definitionNews(owing.news("bob").news), expected);
81 // Told twice adds nothing, and a run of the read after delivery finds nothing left.
82 assert.equal(owing.deliverOwedNews(found), 0);
83 assert.deepEqual(owing.definitionNewsOwed(owed[0]!), []);
84});
86test("worked out against the publish's version, though more was published before the news went out", () => {
87 const told = new Project(new MemoryStore());
88 drafts(told);
89 told.publish("ann", "parsePattern takes flags", 4);
90 const expected = definitionNews(told.news("bob").news);
92 const owing = new Project(new MemoryStore());
93 owing.owesDefinitionNews = true;
94 drafts(owing);
95 owing.publish("ann", "parsePattern takes flags", 4);
96 const [first] = owing.takeOwedDefinitionNews();
97 // Then parsePattern is removed, before the first publish's news is out: against the newest version the news
98 // would say "removes"; against the first publish's, it says "changes", as told at publish time.
99 owing.sync("ann");
100 owing.edit(
101 "ann",
102 {
103 file: "src/parse.ts",
104 old: 'export function parsePattern(text: string, flags: string): Node {\n return { kind: "lit", text };\n}\n',
105 new: "",
106 },
107 5,
108 );
109 owing.publish("ann", "parsePattern goes", 6);
110 assert.ok(owing.deliverOwedNews(owing.definitionNewsOwed(first!)) > 0);
111 assert.deepEqual(definitionNews(owing.news("bob").news), expected, "the first publish's news, as it was");
112});
114test("an agent that synced past the version since isn't told it", () => {
115 const owing = new Project(new MemoryStore());
116 owing.owesDefinitionNews = true;
117 drafts(owing);
118 owing.publish("ann", "parsePattern takes flags", 4);
119 const [owed] = owing.takeOwedDefinitionNews();
120 owing.sync("bob");
121 assert.deepEqual(owing.definitionNewsOwed(owed!), []);
122});
124test("the replay engine tells it at publish time, as before", () => {
125 const told = new Project(new MemoryStore());
126 drafts(told);
127 told.publish("ann", "parsePattern takes flags", 4);
128 assert.deepEqual(told.takeOwedDefinitionNews(), []);
129 assert.equal(definitionNews(told.news("bob").news).length, 1);
130});