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
show on this site's /mcp
CLI
abso show 161 --json
JSON
/christopher/abso-core/versions/161?format=json

A pull keeps the news of what a settle kept: it used to drop it with the news it makes moot, though the pull only brings the file, not whose side survived

of shared·speed··Not checked

Version 160 · Files at version 161

4 files, 24 lines added, 3 removed.

--- a/client/test/held-push.test.ts
+++ b/client/test/held-push.test.ts
@@ -103,6 +103,17 @@
103103 assert.ok(news.out.includes(`Its held push said: "${HELD}"`), news.out);
104104 });
105105
106+ it("a pull doesn't drop the news of what a settle kept", async () => {
107+ const { alice, bob } = await held();
108+ assert.equal((await run(bob, "pull")).exit, 0);
109+ assert.equal((await run(bob, "settle", "store-policy.md", "--both")).exit, 0);
110+ assert.equal((await run(bob, "push", "-m", "Settle: keep both")).exit, 0);
111+ const pulled = await run(alice, "pull");
112+ assert.equal(pulled.exit, 0, pulled.out);
113+ const news = await run(alice, "news");
114+ assert.match(news.out, /bob settled its collision with your version 1 in store-policy\.md, pushing version 2/);
115+ });
106117 it("the change page says what a settle kept in words that read for each choice", async () => {
107118 for (const [how, said] of [
108119 ["yours", "kept bob's"],
--- a/worker/project/apply-entry.ts
+++ b/worker/project/apply-entry.ts
@@ -3,6 +3,7 @@
33// which space) is applied first, in spaces.ts.
44
55import type { AtomId, Graph } from "../../src/engine/index.ts";
6+import { outlastsSync } from "./news.ts";
67import { ProjectError } from "./project-error.ts";
78import type {
89 AgentState,
@@ -211,11 +212,11 @@
211212 }
212213 case "heard": {
213214 const agent = host.agentOf(entry.agent);
214− // A sync's stale heard keeps announcements, so it hears no tell.
215+ // A sync's stale heard keeps announcements and settles' news (outlastsSync), so it hears no tell.
215216 if (entry.stale !== true)
216217 for (const tell of host.tells.values())
217218 if (tell.heard.get(agent.name) === null) tell.heard.set(agent.name, { at: time });
218− const keep = agent.news.map((t) => entry.stale === true && t.startsWith("Announcement from "));
219+ const keep = agent.news.map((t) => entry.stale === true && outlastsSync(t));
219220 agent.news = agent.news.filter((_, i) => keep[i]);
220221 agent.newsAt = agent.newsAt.filter((_, i) => keep[i]);
221222 break;
--- a/worker/project/news.ts
+++ b/worker/project/news.ts
@@ -122,6 +122,14 @@
122122 };
123123}
124124
125+/**
126+ * News a sync doesn't make moot, so it is kept through one: announcements,
127+ * and what a settle kept (the pull brings the file, not whose side survived).
128+ */
129+export function outlastsSync(text: string): boolean {
130+ return text.startsWith("Announcement from ") || / settled its collision with your version \d+ in /.test(text);
131+}
125133const SETTLED_WHAT: Record<Kept, string> = {
126134 theirs: "it kept your lines",
127135 yours: "it kept its own lines, not yours",
--- a/worker/project/sync.ts
+++ b/worker/project/sync.ts
@@ -3,6 +3,7 @@
33// SyncHost; today the host is Project.
44
55import type { AtomId, Graph, ReadView } from "../../src/engine/index.ts";
6+import { outlastsSync } from "./news.ts";
67import { ProjectError } from "./project-error.ts";
78import type { AgentState, Entry, MergedLine, SyncAnswer } from "./project-types.ts";
89import { last, SHARED, type Space } from "./spaces.ts";
@@ -79,7 +80,7 @@
7980 entries.push({ type: "sync", agent: agent.name, version: target });
8081 host.apply(entries[entries.length - 1]!);
8182 // News about versions the agent has now synced past is moot: the sync answer lists what's still open (#37).
82− if (agent.news.some((t) => !t.startsWith("Announcement from "))) {
83+ if (agent.news.some((t) => !outlastsSync(t))) {
8384 const heard: Entry = { type: "heard", agent: agent.name, stale: true };
8485 entries.push(heard);
8586 host.apply(heard);