- MCP
- blame on this site's /mcp
- CLI
- abso blame worker/project/test/owed-definition-news.test.ts --version 310 --json
- JSON
- /christopher/abso-core/blame/worker/project/test/owed-definition-news.test.ts?version=310&format=json
190 linescapacity 91% · pinch 9%Last change capacity in version 310,
190 lines from 5 changes in 5 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.
5import assert from "node:assert/strict";
6import { test } from "node:test";
7import { MemoryStore, Project } from "../project.ts";
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);
52}
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();
capacity310Formatting only: owed-definition-news.test.ts as Biome prints it (Capacity's 309 missed it; abso's check fails on the pinned copy). No other change.Compare68 assert.deepEqual(owed, [{ version: owing.version, space: owed[0]!.space, publisher: "ann", all: true }]);
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.Compare69 assert.deepEqual(owing.takeOwedDefinitionNews(), [], "handed over once");
70 // Not told yet: bob's news holds no definition news until it's delivered.
71 assert.deepEqual(definitionNews(owing.news("bob").news), []);
72 const found = owing.definitionNewsOwed(owed[0]!);
73 assert.deepEqual(
74 found.map((f) => f.agent),
75 ["bob"],
76 );
77 assert.ok(owing.deliverOwedNews(found) > 0);
78 assert.deepEqual(definitionNews(owing.news("bob").news), expected);
79 // Told twice adds nothing, and a run of the read after delivery finds nothing left.
80 assert.equal(owing.deliverOwedNews(found), 0);
81 assert.deepEqual(owing.definitionNewsOwed(owed[0]!), []);
82});
84test("worked out against the publish's version, though more was published before the news went out", () => {
85 const told = new Project(new MemoryStore());
86 drafts(told);
87 told.publish("ann", "parsePattern takes flags", 4);
88 const expected = definitionNews(told.news("bob").news);
90 const owing = new Project(new MemoryStore());
91 owing.owesDefinitionNews = true;
92 drafts(owing);
93 owing.publish("ann", "parsePattern takes flags", 4);
94 const [first] = owing.takeOwedDefinitionNews();
95 // Then parsePattern is removed, before the first publish's news is out: against the newest version the news
96 // would say "removes"; against the first publish's, it says "changes", as told at publish time.
97 owing.sync("ann");
98 owing.edit(
99 "ann",
100 {
101 file: "src/parse.ts",
102 old: 'export function parsePattern(text: string, flags: string): Node {\n return { kind: "lit", text };\n}\n',
103 new: "",
104 },
105 5,
106 );
107 owing.publish("ann", "parsePattern goes", 6);
108 assert.ok(owing.deliverOwedNews(owing.definitionNewsOwed(first!)) > 0);
109 assert.deepEqual(definitionNews(owing.news("bob").news), expected, "the first publish's news, as it was");
110});
112test("an agent that synced past the version since isn't told it", () => {
113 const owing = new Project(new MemoryStore());
114 owing.owesDefinitionNews = true;
115 drafts(owing);
116 owing.publish("ann", "parsePattern takes flags", 4);
117 const [owed] = owing.takeOwedDefinitionNews();
118 owing.sync("bob");
119 assert.deepEqual(owing.definitionNewsOwed(owed!), []);
120});
122test("the replay engine tells it at publish time, as before", () => {
123 const told = new Project(new MemoryStore());
124 drafts(told);
125 told.publish("ann", "parsePattern takes flags", 4);
126 assert.deepEqual(told.takeOwedDefinitionNews(), []);
127 assert.equal(definitionNews(told.news("bob").news).length, 1);
128});
capacity308Owed news can be worked out a few agents at a time: owedAgents lists who may be owed, and definitionNewsOwed takes only those named (abso 714; Cloud's (b), Capacity)
- On prod abso at 6:31 PM CT, one owed-news read over every draft ran as one storage transaction and reset the object. Core 307 cut that read about ninefold; this lets the host bound it outright.
- owedAgents(owed): every other agent in the space, behind the version, with a draft, in the order definitionNewsOwed takes them. Cheap: no definition rule.
- definitionNewsOwed(owed, only?): the same news, for only those agents when named. Per agent it's the same work and the same items as before, so the news one agent at a time adds up to the whole.
- abso's DiskRoute (worker side, with Cloud) lists them once per owed row, then works out and tells up to four a tick, each in its own read and write, keeping the rest on the row.
Checks: core tsc clean; Biome clean; node --test worker/project/test/owed-definition-news (new: owedAgents lists bob and cat, one agent at a time equals the whole, a synced agent drops out), changed-definition, news-lazy, news-cap, news-lines, news-written, news-times, shared-additions, project: 46 of 46 pass.Compare129
130test("owedAgents lists who may be owed, and the news one agent at a time adds up to the whole (abso 714)", () => {
131 const owing = new Project(new MemoryStore());
132 owing.owesDefinitionNews = true;
133 drafts(owing);
134 owing.publish("ann", "parsePattern takes flags", 4);
135 const [owed] = owing.takeOwedDefinitionNews();
136 assert.deepEqual(owing.owedAgents(owed!), ["bob", "cat"], "every other agent behind it with a draft");
137 const whole = owing.definitionNewsOwed(owed!);
138 assert.equal(whole.length, 1);
139 assert.deepEqual(
140 owing.owedAgents(owed!).flatMap((agent) => owing.definitionNewsOwed(owed!, [agent])),
141 whole,
142 );
143 owing.sync("bob");
144 assert.deepEqual(owing.owedAgents(owed!), ["cat"], "synced past it");
capacity309A publish owes all its news for other agents after the commit, not only definition news (abso 714, piece 2 of Christopher's base fix)
- With owesDefinitionNews set (abso's disk route), newsForOthers no longer works out other agents' news inside the publish. At the first other agent with a draft, it owes { version, space, publisher, all: true } and returns. Nothing else changes in the publish or its answer.
- newsOwed(owed, only?) works the news out against the publish's version, for those agents only: same lines (pairsIn at the owed version), definitions (changed names, from owed.names or worked out once), and moves. Items an agent was already told are left out. definitionNewsOwed stays as an alias. A row from before all: true (names only) still tells definition news only.
- owedNewsNames(owed) works out the changed definitions once, so a host can keep them on its row. New host hooks are setAt and collisionAt (project.ts), and moveNews takes the version to read at.
- The publishNews end line no longer reports files: changed names are now worked out only when an agent needs them.
- Tests: owed-definition-news.test.ts adds a test that each of three agents' full news (definition and same-lines), told one agent at a time after the publish, equals the news told at publish time, plus one where nothing is owed. news-lines.test.ts drops the files check.
Checks: tsc and tsc -p server clean. Biome clean on the changed files; the existing errors in server/ are untouched. Core tests: worker/project and src, 762 passed, none failed.
Lab, on abso's Oct 14 tables with abso's disk route on top, in the 1470-shaped publish: publish 24,209 statements (was 36,038). The owed news then goes out in 17 short transactions (longest 3.8 s) for 16 agents.Compare145});
147test("everything a publish tells other agents is owed and told after it, the same news (abso 714)", () => {
148 // bob's draft calls parsePattern (definition news), dee's changes the line ann's publish changes (same-lines news),
149 // and cat's touches nothing of it (no news).
150 const scenario = (project: Project) => {
151 drafts(project);
152 project.sync("dee");
153 project.edit(
154 "dee",
155 { file: "src/parse.ts", old: "parsePattern(text: string): Node", new: "parsePattern(input: string): Node" },
156 5,
157 );
158 };
159 const told = new Project(new MemoryStore());
160 scenario(told);
161 const toldAnswer = told.publish("ann", "parsePattern takes flags", 6);
162 const expected = Object.fromEntries(["bob", "cat", "dee"].map((a) => [a, told.news(a).news.toSorted()]));
163 assert.ok(expected.bob!.length > 0 && expected.dee!.length > 0, "the scenario has both kinds of news");
165 const owing = new Project(new MemoryStore());
166 owing.owesDefinitionNews = true;
167 scenario(owing);
168 assert.deepEqual(owing.publish("ann", "parsePattern takes flags", 6), toldAnswer, "the publisher's answer");
169 const [owed] = owing.takeOwedDefinitionNews();
170 assert.equal(owed!.all, true);
capacity310Formatting only: owed-definition-news.test.ts as Biome prints it (Capacity's 309 missed it; abso's check fails on the pinned copy). No other change.Compare171 for (const a of ["bob", "cat", "dee"])
172 assert.deepEqual(owing.news(a).news, [], `${a} is told nothing in the publish`);
capacity309A publish owes all its news for other agents after the commit, not only definition news (abso 714, piece 2 of Christopher's base fix)
- With owesDefinitionNews set (abso's disk route), newsForOthers no longer works out other agents' news inside the publish. At the first other agent with a draft, it owes { version, space, publisher, all: true } and returns. Nothing else changes in the publish or its answer.
- newsOwed(owed, only?) works the news out against the publish's version, for those agents only: same lines (pairsIn at the owed version), definitions (changed names, from owed.names or worked out once), and moves. Items an agent was already told are left out. definitionNewsOwed stays as an alias. A row from before all: true (names only) still tells definition news only.
- owedNewsNames(owed) works out the changed definitions once, so a host can keep them on its row. New host hooks are setAt and collisionAt (project.ts), and moveNews takes the version to read at.
- The publishNews end line no longer reports files: changed names are now worked out only when an agent needs them.
- Tests: owed-definition-news.test.ts adds a test that each of three agents' full news (definition and same-lines), told one agent at a time after the publish, equals the news told at publish time, plus one where nothing is owed. news-lines.test.ts drops the files check.
Checks: tsc and tsc -p server clean. Biome clean on the changed files; the existing errors in server/ are untouched. Core tests: worker/project and src, 762 passed, none failed.
Lab, on abso's Oct 14 tables with abso's disk route on top, in the 1470-shaped publish: publish 24,209 statements (was 36,038). The owed news then goes out in 17 short transactions (longest 3.8 s) for 16 agents.Compare173 const names = owing.owedNewsNames(owed!);
174 assert.deepEqual(names, ["parsePattern"]);
175 // One agent at a time, as the host works it out.
176 for (const agent of owing.owedAgents(owed!)) owing.deliverOwedNews(owing.newsOwed({ ...owed!, names }, [agent]));
177 for (const a of ["bob", "cat", "dee"]) assert.deepEqual(owing.news(a).news.toSorted(), expected[a], a);
178 // Twice tells nothing more.
179 assert.deepEqual(owing.newsOwed({ ...owed!, names }), []);
180});
182test("a publish that no other draft can collide with owes nothing", () => {
183 const owing = new Project(new MemoryStore());
184 owing.owesDefinitionNews = true;
185 owing.init({ "a.txt": "one\n" }, 0);
186 owing.sync("ann");
187 owing.edit("ann", { file: "a.txt", old: "one", new: "two" }, 1);
188 owing.publish("ann", "alone", 2);
189 assert.deepEqual(owing.takeOwedDefinitionNews(), []);
capacity308Owed news can be worked out a few agents at a time: owedAgents lists who may be owed, and definitionNewsOwed takes only those named (abso 714; Cloud's (b), Capacity)
- On prod abso at 6:31 PM CT, one owed-news read over every draft ran as one storage transaction and reset the object. Core 307 cut that read about ninefold; this lets the host bound it outright.
- owedAgents(owed): every other agent in the space, behind the version, with a draft, in the order definitionNewsOwed takes them. Cheap: no definition rule.
- definitionNewsOwed(owed, only?): the same news, for only those agents when named. Per agent it's the same work and the same items as before, so the news one agent at a time adds up to the whole.
- abso's DiskRoute (worker side, with Cloud) lists them once per owed row, then works out and tells up to four a tick, each in its own read and write, keeping the rest on the row.
Checks: core tsc clean; Biome clean; node --test worker/project/test/owed-definition-news (new: owedAgents lists bob and cat, one agent at a time equals the whole, a synced agent drops out), changed-definition, news-lazy, news-cap, news-lines, news-written, news-times, shared-additions, project: 46 of 46 pass.Compare190});