- MCP
- blame on this site's /mcp
- CLI
- abso blame client/view/hooks/register.test.ts --json
- JSON
- /christopher/abso-core/blame/client/view/hooks/register.test.ts?format=json
138 linesFirst import 91% · review 7% · pinch 2% · rename 1%Last change rename in version 100,
138 lines from 5 changes in 5 versions.
review40Mods: the hooks mod is abso-hooks and the view mod abso-view; an install moves the old skills/avcs and skills/avcs-view folders to ~/.abso/retired-mods (moved, not deleted); the hook stands down for either name; status checks either. Tests cover the move.Compare1// abso-view against the engine: the server and the folder are answered here.
3import type { On } from "claude-code";
4import { expect, mock, test } from "claude-code/testing";
6const STATUS = {
7 version: 7,
8 agents: [
9 {
10 agent: "me",
11 draft: null,
12 base: 5,
13 draftChanges: 3,
14 files: ["src/a.ts", "src/b.ts"],
15 parked: [{ draft: "exp", draftChanges: 2 }],
16 },
17 { agent: "bob", draft: null, base: 7, draftChanges: 1, files: ["src/a.ts"] },
18 ],
19 drafts: [],
20};
21const WHERE = {
22 version: 7,
23 files: {
24 "src/a.ts": [
25 { agent: "me", lines: [[1, 2]], shared: [[1, 2]], changes: 2, lastEdit: 0 },
26 { agent: "bob", lines: [[9, 9]], shared: [[9, 9]], changes: 1, lastEdit: 0 },
27 ],
28 "src/b.ts": [{ agent: "me", lines: [[1, 1]], shared: [[1, 1]], changes: 1, lastEdit: 0 }],
29 },
30};
31const NEWS = "2026-10-05T01:00:00.000Z\tbob changed parse, which src/a.ts uses.\n";
33/** The world beneath the plugin: a session in /w/proj/src, an abso folder at /w/proj when `inFolder`. */
34function world(on: On, inFolder: boolean) {
35 mock.env(on, { AVCS_TOKEN: "test-token" });
36 const clock = mock.clock(on, { now: 1_000_000 });
37 const fetched: string[] = [];
38 const statuses: (string | undefined)[] = [];
39 const opened: string[] = [];
40 const reads: string[] = [];
41 on("session.start", (_$, e) => ({ cwd: (e as { cwd?: string }).cwd ?? "/w/proj/src" }));
42 on("session.cwd", () => ({ value: "/w/proj/src" }));
43 on("command.register", (_$, e) => ({ value: { command: e.name } }));
pinch56The mods' tests run on current Claude Code: a session.append hook passes the row on with next (the engine stores it and refuses an answer made without next), and the view's test answers fs.exists, which the view calls to find a folder's .abso/. Both mods' tests pass in the plugin test kit again, so their installers no longer refuse.Compare44 on("fs.exists", (_$, e) => ({
45 value: inFolder && e.path.replace(/\\/g, "/").replace(/^[A-Za-z]:/, "") === "/w/proj/.abso/config.json",
46 }));
48 // The engine hands hooks the path resolved for this machine (C:\w\proj on Windows).
49 const path = e.path.replace(/\\/g, "/").replace(/^[A-Za-z]:/, "");
50 reads.push(path);
review17New folders keep their state in .abso/, and the machine's sign-in, servers and admin token are read from ~/.abso/ first, then ~/.avcs/. A folder made before, with only .avcs/, is untouched: it keeps working, is never half-moved, and no older client or mod loses it. stateDir(root) and homeFile/homeWritePath are in the new client/src/state-dir.ts and replace the old AVCS_DIR constant everywhere. abso login writes only to ~/.abso/ and leaves ~/.avcs/ alone; logout removes both copies. The edit mod and the view mod read either folder. .abso is skipped like .avcs (including its odd spellings), the git exclude names whichever folder is in use, and the messages name .abso. Not changed: avcs.json (the server reads that name, so abso.json needs the server to learn it first), .avcsignore, env var names and wire headers. Tests: 709 run, 708 pass (one is skipped), including new ones for the folder choice, the home-file order and box sign-in; biome ci has no errors.Compare51 if (inFolder && path === "/w/proj/.abso/config.json")
init0Start the project52 return { value: JSON.stringify({ server: "https://avcs.test", project: "p", agent: "me" }) };
review17New folders keep their state in .abso/, and the machine's sign-in, servers and admin token are read from ~/.abso/ first, then ~/.avcs/. A folder made before, with only .avcs/, is untouched: it keeps working, is never half-moved, and no older client or mod loses it. stateDir(root) and homeFile/homeWritePath are in the new client/src/state-dir.ts and replace the old AVCS_DIR constant everywhere. abso login writes only to ~/.abso/ and leaves ~/.avcs/ alone; logout removes both copies. The edit mod and the view mod read either folder. .abso is skipped like .avcs (including its odd spellings), the git exclude names whichever folder is in use, and the messages name .abso. Not changed: avcs.json (the server reads that name, so abso.json needs the server to learn it first), .avcsignore, env var names and wire headers. Tests: 709 run, 708 pass (one is skipped), including new ones for the folder choice, the home-file order and box sign-in; biome ci has no errors.Compare53 if (inFolder && path === "/w/proj/.abso/news.log") return { value: NEWS };
55 });
56 on("http.fetch", (_$, e) => {
57 fetched.push(e.url);
58 const body = e.url.endsWith("/status") ? STATUS : WHERE;
59 return { value: { status: 200, ok: true, headers: {}, text: JSON.stringify(body) } };
60 });
61 on("ui.status", (_$, e) => {
62 statuses.push(e.text);
63 return { value: undefined };
64 });
65 on("ui.open", (_$, e) => {
66 opened.push(e.id);
67 return { value: { isPlaced: true } };
68 });
69 return { clock, fetched, statuses, opened, reads };
70}
72test("outside an abso folder it asks nothing and shows nothing", async ($, on) => {
73 const w = world(on, false);
74 await $.session.start({ cwd: "/w/proj/src" });
75 await w.clock.advance(120_000);
76 expect(w.fetched).toEqual([]);
77 expect(w.statuses).toEqual([]);
78});
80test("in an abso folder it keeps a status line, and refreshes on a timer", async ($, on) => {
81 const w = world(on, true);
82 await $.session.start({ cwd: "/w/proj/src" });
83 await w.clock.advance(1);
84 expect(w.fetched).toEqual(["https://avcs.test/p/p/status", "https://avcs.test/p/p/where"]);
85 expect(w.statuses.at(-1)).toBe(
rename100abso publish is now abso push, abso sync is now abso pull (abso 427)
Commands, help, flags, messages, MCP tool names and descriptions, hook text, README, SKILL.md and tests say push and pull; "shared" stays the noun ("Pushed version N"). No aliases, no notices. A queued push that was "pulled" is now "turned back", so pull means one thing.
push -f/--force/-u/--all/--tags and pull --rebase/--ff-only/--squash refuse with one plain line naming the abso way; push and pull take no remote or branch.
Kept as stored: log entry kinds (publish, sync, pulled), HTTP route paths, the pipeline trigger on: publish, the yours (unpublished) marker, npm-publish.Compare86 "abso: shared · 2 files unpushed · shared is 2 ahead (abso pull) · bob also on your files · 1 news item (/abso-view)",
88 await w.clock.advance(31_000);
89 expect(w.fetched.length).toBe(4);
90});
92test("the pane shows the space, the draft, who else is on the files, and news", async ($, on) => {
93 const w = world(on, true);
94 await $.session.start({ cwd: "/w/proj/src" });
95 await w.clock.advance(1);
96 for (const surface of ["terminal", "desktop"] as const) {
97 const ui = await $.ui.mount({
review40Mods: the hooks mod is abso-hooks and the view mod abso-view; an install moves the old skills/avcs and skills/avcs-view folders to ~/.abso/retired-mods (moved, not deleted); the hook stands down for either name; status checks either. Tests cover the move.Compare98 plugin: "abso-view",
100 component: "Pane",
review40Mods: the hooks mod is abso-hooks and the view mod abso-view; an install moves the old skills/avcs and skills/avcs-view folders to ~/.abso/retired-mods (moved, not deleted); the hook stands down for either name; status checks either. Tests cover the move.Compare101 requestId: "abso-view",
init0Start the project102 props: { title: "avcs", isFocused: false, bodyColumns: 80, placement: "dock" } as never,
103 });
104 expect(await ui.find({ text: /Working in shared, at version 7/ })).toBeDefined();
105 expect(await ui.find({ text: /3 changes in 2 files/ })).toBeDefined();
106 expect(await ui.find({ text: /bob: src\/a\.ts/ })).toBeDefined();
107 expect(await ui.find({ text: /Parked: exp \(2 changes\)/ })).toBeDefined();
108 expect(await ui.find({ text: /bob changed parse/ })).toBeDefined();
109 }
110});
review40Mods: the hooks mod is abso-hooks and the view mod abso-view; an install moves the old skills/avcs and skills/avcs-view folders to ~/.abso/retired-mods (moved, not deleted); the hook stands down for either name; status checks either. Tests cover the move.Compare112test("/abso-view opens the pane, and the status line stops counting the news it showed", async ($, on) => {
114 await $.session.start({ cwd: "/w/proj/src" });
115 await w.clock.advance(1);
116 expect(w.statuses.at(-1)).toContain("1 news item");
review40Mods: the hooks mod is abso-hooks and the view mod abso-view; an install moves the old skills/avcs and skills/avcs-view folders to ~/.abso/retired-mods (moved, not deleted); the hook stands down for either name; status checks either. Tests cover the move.Compare117 const answer = await $.command.run({ command: "abso-view", args: "" } as never);
118 expect(answer).toMatchObject({ text: "Opened the abso view." });
119 expect(w.opened).toEqual(["abso-view"]);
121});
123test("an edit brings a refresh a few seconds later, not 30", async ($, on) => {
124 const w = world(on, true);
125 on("tool.call", () => ({ result: { isError: false, text: "ok" } }) as never);
126 await $.session.start({ cwd: "/w/proj/src" });
127 await w.clock.advance(1);
128 expect(w.fetched.length).toBe(2);
129 await $.tool.call({
130 tool: "Edit",
131 tool_use_id: "t1",
132 file_path: "/w/proj/src/a.ts",
133 old_string: "a",
134 new_string: "b",
135 } as never);
136 await w.clock.advance(6_000);
137 expect(w.fetched.length).toBe(4);
138});