Versions 293 to 318
new file, 55 lines
1+// Moves before laying out files (abso 714, piece 3): expressMoves looks at the draft's own written and deleted lines
2+// first, and lays out no file when none of its written lines with real content has a deleted line's text. moves.test.ts
4+
10+
11+/** A draft of two atoms: "del" deletes one line, "add" writes the others. Any view laid out throws. */
39+
41+
45+
46+test("a deleted text written again with only brackets or blanks in common lays out no file", () => {
49+
50+test("a written line with real content that the draft also deleted goes on to the files", () => {
new file, 49 lines
1+// fileExactAt (version-log.ts, abso Capacity, 2026-10-17): the same answer as fileAt for exactly that spelling, at
2+// every version, read from the file's own lines without the version's list of files. abso's worker/test/
4+
8+
13+ p.record("ann", { "abso.yml": "pipelines:\n ci:\n on: [push]\n", "docs/abso.yml": "not this one\n" }, 1);
15+ p.record("ann", { "abso.json": '{ "check": "false" }\n', "empty.txt": "" }, 3, {}, { "abso.yaml": "b".repeat(64) });
21+
33+
39+ for (const path of PATHS) assert.deepEqual(p.fileExactAt(path, v), p.fileAt(path, v), `${path} at ${v}`);
41+
42+test("a name nothing ever wrote is null, and another spelling is that spelling, not the stored one", () => {
45+ assert.deepEqual(p.fileExactAt("never.txt", last), { path: "never.txt", version: last, text: null });
46+ // fileAt reads the stored spelling for any spelling (#41); fileExactAt reads only the one asked.
47+ assert.equal((p.fileAt("ABSO.json", last) as { text: string | null }).text, '{ "check": "false" }\n');
48+ assert.deepEqual(p.fileExactAt("ABSO.json", last), { path: "ABSO.json", version: last, text: null });
Lines 105–124 at 318 (were 105–107 at 293)
106106 assert.deepEqual(project.pathsAt(version).files, oracle.draftOf(agent)!.view.paths(), `paths at ${version}`);
108+
109+test("an agent's files on a writer, from its base version's kept list when it has nothing of its own, as the in-memory project says", () => {
110+ // abso - Performance (abso 711): a status for an agent behind shared listed its files by laying out every known file.
115+ // v0 and v1 are behind shared with nothing of their own, v2 is at shared, and bob, cy, dee and eve have drafts.
Lines 37–42 at 318 (were 37–43 at 293)
40− assert.equal(news[1]!.files, 1);
new file, 190 lines
1+// 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+
8+
9+// abso-core's changed-definition.test.ts scenario: parse.ts defines parsePattern, match.ts imports it.
30+
31+/** bob's draft calls parsePattern; ann's draft changes its signature; cat's touches something else. Nothing published. */
39+ { file: "src/match.ts", old: " return p;\n", new: " const tree = parsePattern(p);\n return tree;\n" },
51+ project.edit("cat", { file: "README.md", old: "Uses parsePattern.", new: "Uses parsePattern, twice." }, 3);
53+
54+const definitionNews = (news: readonly string[]) => news.filter((n) => /definition of parsePattern/.test(n)).sort();
55+
56+test("the news owed is the news a publish would have told, and the publisher's own answer is the same", () => {
62+
66+ assert.deepEqual(owing.publish("ann", "parsePattern takes flags", 4), toldAnswer, "the publisher's answer");
68+ assert.deepEqual(owed, [{ version: owing.version, space: owed[0]!.space, publisher: "ann", all: true }]);
83+
84+test("worked out against the publish's version, though more was published before the news went out", () => {
89+
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.
102+ old: 'export function parsePattern(text: string, flags: string): Node {\n return { kind: "lit", text };\n}\n',
109+ assert.deepEqual(definitionNews(owing.news("bob").news), expected, "the first publish's news, as it was");
111+
121+
129+
130+test("owedAgents lists who may be owed, and the news one agent at a time adds up to the whole (abso 714)", () => {
136+ assert.deepEqual(owing.owedAgents(owed!), ["bob", "cat"], "every other agent behind it with a draft");
146+
147+test("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),
155+ { file: "src/parse.ts", old: "parsePattern(text: string): Node", new: "parsePattern(input: string): Node" },
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");
164+
168+ assert.deepEqual(owing.publish("ann", "parsePattern takes flags", 6), toldAnswer, "the publisher's answer");
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);
181+
Lines 36–87 at 318 (were 36–38 at 293)
39+
40+test("shared additions read each atom's version from the membership pages, and answer as its events do (abso - Performance, 714)", (t) => {
45+ const ids = (from: number, to: number) => Array.from({ length: to - from }, (_, i) => `a${from + i}`);
47+ addVersion(space, { version: space.versions.length, agent: "test", message: "version", time: 0, atoms, dropped });
48+ // Three pages of atoms; a5 and a400 dropped and a5 back, a601 added and dropped: their events are read.
78+ assert.deepEqual([...new SharedAdditions(space, 1, membership.at(space, 1), membership.at(space, 3), 3)], ["a600"]);
83+ assert.deepEqual([...new SharedAdditions(space, 3, membership.at(space, 3), membership.at(space, 5), 5)], []);
- MCP
- compare on this site's /mcp
- CLI
- abso diff 293 318 worker/project/test --json
- JSON
- /christopher/abso-core/compare/293..318?file=worker%2Fproject%2Ftest&format=json