- MCP
- blame on this site's /mcp
- CLI
- abso blame client/src/api-answers.ts --json
- JSON
- /christopher/abso-core/blame/client/src/api-answers.ts?format=json
228 linesFirst import 86% · autosettle 10% · speed 2% · engine 1% · onboard 1% · infra-split 1%Last change onboard in version 225,
228 lines from 8 changes in 8 versions.
init0Start the project1// What the server answers for recording, publishing, syncing, notes and status.
3import type { CiStatus, QueueState } from "./ci-answers.ts";
4import type { Modes } from "./modes.ts";
6/** A collision as publish and sync report it. */
7export interface Collision {
8 /**
9 * `lines`: both changed the same lines. `definition`: your draft uses `name`, whose definition they changed.
10 * `attribute`: both set `name` (exec or link). `duplicate`: you and they each define `name` at the top level of `file`.
11 */
12 readonly kind?: "lines" | "definition" | "attribute" | "duplicate";
13 /** A lines collision you synced into and haven't edited since (#37): both sides' lines are in your file. */
14 readonly untouched?: true;
15 /** A lines collision written into the file as a marker block (#11): `lines` is the block's range there. */
16 readonly marked?: true;
17 readonly lines?: readonly [number, number];
18 readonly name?: string;
19 readonly file: string;
20 readonly yours: { readonly lines: unknown; readonly text: string };
21 /** For a definition, `file` is where the definition is, and `text` is "" when it's gone. */
22 readonly theirs: {
23 readonly file?: string;
24 readonly agent: string;
25 readonly message: string;
26 readonly version: number;
27 readonly lines: unknown;
28 readonly text: string;
29 /** Theirs is waiting in the merge queue, not landed yet (#39): its queue id. */
30 readonly queued?: number;
31 };
32}
34/** News arrives as one plain sentence per collision; accept a single string too. */
35export type News = string | readonly string[] | undefined;
37export interface EditBody {
38 readonly file: string;
39 readonly old?: string;
40 readonly new?: string;
41 readonly content?: string;
42 readonly edits?: readonly { readonly old: string; readonly new: string }[];
43 readonly session?: string;
44 readonly subagent?: string;
45}
47/** A path recorded under another spelling of an existing file (#49): one file whatever its case. */
48export interface Spelling {
49 readonly path: string;
50 readonly existing: string;
51}
52export type EditAnswer =
53 | { ok: true; news?: News; spelling?: readonly Spelling[]; uncomposed?: readonly string[] }
54 | { ok: false; reason: string };
55/** A marker block still in an agent's draft (#11). */
56export interface OpenCollision {
57 readonly file: string;
58 readonly lines: readonly [number, number];
59 readonly theirs: { readonly agent: string; readonly version: number; readonly message: string };
60}
61/** What a publish settled, file by file, and which side survived (#11). */
62export interface Settled {
63 readonly file: string;
64 readonly kept: "yours" | "theirs" | "both" | "rewrote";
65 readonly theirs: { readonly agent: string; readonly version: number };
infra-split39More comments and test names give their reason without naming who raised it
The same cleanup as version 37, for notes it missed because they were wrapped or worded differently: "(#37, Playtester 1)" becomes "(#37)", "(#39, agreed with Engine)" becomes "(#39)", and a commit hash after a name goes with the name. Issue numbers stay. No behavior changes.Compare66 /** Lines both sides still had that the settled file no longer has (#37). */
speed160A held push keeps its message, and why tells every settle: the refusal stores the push's message; why on a line kept by abso settle --yours, --theirs or --both names the collision it was kept from, and both kinds of settle list the settler's held push with its reason; the settle's news and the change page carry it too, and a lone push's change now lists the refusals on its wayCompare68 /** The message of the settler's push that was held for this collision. */
69 readonly held?: string;
71export interface RecordAnswer {
72 readonly ok: boolean;
73 readonly changed?: readonly string[] | number;
74 readonly news?: News;
75 readonly reason?: string;
76 readonly spelling?: readonly Spelling[];
77 /** New names not in composed Unicode form (#49): a gentle warning. */
78 readonly uncomposed?: readonly string[];
79}
80export type PublishAnswer =
81 | {
82 ok: true;
83 version: number;
84 changes?: number;
85 settled?: readonly Settled[];
86 /** Others' versions this publish went on top of that the folder hasn't synced yet (#37): nothing of theirs was overwritten. */
87 mergedWith?: readonly { readonly version: number; readonly agent: string; readonly message: string }[];
onboard225push: after Pushed version N., say whether CI will check it, when the server's answer says where CI runs (ciWhere). off: CI is off for this project, so version N isn't checked; connect a Cloudflare account in the project's settings on the website to run it there. account: CI checks it in the project's Cloudflare account; abso ci N shows the result. The server's own compute, or a server that doesn't say, adds nothing, as before. --json carries ciWhere. Tests: client/test/push-ci-where.test.ts (3).Compare88 /** Where the project's CI runs, when the server says: off, the project's own Cloudflare account, or the server's own compute. */
89 ciWhere?: string;
91 /** With the merge queue on (#39): queued, not landed yet; `ahead` publishes wait in front of it. */
92 | { ok: true; queued: number; position: number; ahead: number; changes: number; settled?: readonly Settled[] }
autosettle204Auto-settle switch (abso 19): on advises, act also has the client settle
AUTOSETTLE=on now only adds advice to a held push; AUTOSETTLE=act adds settle: true, and the client settles the collisions advised a side only then (ABSO_AUTOSETTLE=off still stops it). The whole server hook is one function, withAdvice(env, op, agent, request, answer), so a Worker calls it in one line: return json(a.status, await withAdvice(env, op, agent, body, a.body)). Tested: the switch test, held-push tests, and the local demo under on (held with advice) and act (settled and pushed).Compare93 | {
94 ok: false;
95 collisions: readonly Collision[];
96 reason?: string;
97 advice?: readonly (Advice | null)[];
98 /** The server runs AUTOSETTLE=act: settle the collisions it advised a side of, and push again (#19). */
99 settle?: boolean;
100 };
autosettle196Auto-settle (#19), step 3 behind a switch: the open server gives a held push a first opinion. With AUTOSETTLE=on and an AI binding (both off unless set), a held push's answer carries advice for each lines collision: keep yours, theirs or both, or needs an agent, with how many of 5 Workers AI samples agree and one line why. Checks in code run first and after (server/src/autosettle.ts), and the scripts now use the same ones. The client prints the advice under the collisions; the agent still settles. A model that fails leaves no advice and never fails the push's answer. server/test/autosettle.test.ts covers it with a stand-in for Workers AI.Compare101/**
102 * A server's first opinion on one collision of a held push (#19), when it runs AUTOSETTLE: which settle fits,
autosettle201Auto-settle (#19): the open server's advice now comes from Clef, Cloudflare's decision model, by default. On project abso's 33 replayed past holds, Clef settled none wrong at confidence 0.5 or more, where the Llama text model was wrong once at 1.00 (it kept only theirs and would have dropped a 403 guard). A lean to one side under AUTOSETTLE_AT (0.5 unless set) is advice for an agent, marked unsure; AUTOSETTLE_MODEL picks clef-flash or a text model instead. Clef answers in about 0.3 s. The System One questions live in server/src/autosettle.ts, and scripts/autosettle/jev.ts asks Jev the same ones.Compare103 * how sure, and why. `by`: rule (code decided), model (Workers AI), turned down (the model's pick would break
104 * the file, so an agent settles), or unsure (the model leaned to a side under the server's threshold).
autosettle196Auto-settle (#19), step 3 behind a switch: the open server gives a held push a first opinion. With AUTOSETTLE=on and an AI binding (both off unless set), a held push's answer carries advice for each lines collision: keep yours, theirs or both, or needs an agent, with how many of 5 Workers AI samples agree and one line why. Checks in code run first and after (server/src/autosettle.ts), and the scripts now use the same ones. The client prints the advice under the collisions; the agent still settles. A model that fails leaves no advice and never fails the push's answer. server/test/autosettle.test.ts covers it with a stand-in for Workers AI.Compare105 */
106export interface Advice {
107 readonly pick: "yours" | "theirs" | "both" | "agent";
108 readonly confidence: number;
109 readonly reason: string;
autosettle201Auto-settle (#19): the open server's advice now comes from Clef, Cloudflare's decision model, by default. On project abso's 33 replayed past holds, Clef settled none wrong at confidence 0.5 or more, where the Llama text model was wrong once at 1.00 (it kept only theirs and would have dropped a 403 guard). A lean to one side under AUTOSETTLE_AT (0.5 unless set) is advice for an agent, marked unsure; AUTOSETTLE_MODEL picks clef-flash or a text model instead. Clef answers in about 0.3 s. The System One questions live in server/src/autosettle.ts, and scripts/autosettle/jev.ts asks Jev the same ones.Compare110 readonly by: "rule" | "model" | "turned down" | "unsure";
autosettle196Auto-settle (#19), step 3 behind a switch: the open server gives a held push a first opinion. With AUTOSETTLE=on and an AI binding (both off unless set), a held push's answer carries advice for each lines collision: keep yours, theirs or both, or needs an agent, with how many of 5 Workers AI samples agree and one line why. Checks in code run first and after (server/src/autosettle.ts), and the scripts now use the same ones. The client prints the advice under the collisions; the agent still settles. A model that fails leaves no advice and never fails the push's answer. server/test/autosettle.test.ts covers it with a stand-in for Workers AI.Compare111 readonly modelPick?: string;
112 readonly model?: string;
113 readonly ms: number;
114}
init0Start the project115/** A note on lines (#44): where its lines are now, or null when they're all gone. */
116export interface NoteAnswer {
117 readonly id: number;
118 readonly agent: string;
119 readonly kind: "comment" | "objection" | "read";
120 readonly file: string;
121 readonly lines: readonly [number, number] | null;
122 readonly text: string;
123 readonly change: number | null;
124 readonly reply: number | null;
125 readonly time: number;
126 readonly state: "open" | "addressed" | "outdated" | "resolved" | "withdrawn";
127}
128/** One change (#44): a start note's work, a named draft's, or a lone publish. Its id is the log position that began it. */
129export interface ChangeAnswer {
130 readonly id: number;
131 readonly agent: string;
132 readonly title: string;
133 readonly kind: "note" | "draft" | "publish";
134 readonly note: { readonly text: string; readonly files: readonly string[] } | null;
135 readonly draft: string | null;
136 readonly time: number;
137 /** Its start note still lasts, or its draft hasn't landed: more versions may come. */
138 readonly open: boolean;
139 readonly versions: readonly {
140 readonly version: number;
141 readonly draft: string | null;
142 readonly message: string;
143 readonly time: number;
144 readonly files: readonly string[];
145 }[];
146 readonly files: readonly string[];
147 readonly settled: readonly (Settled & { readonly version: number })[];
148 readonly refusals: readonly {
149 readonly time: number;
150 readonly kinds: readonly string[];
151 readonly files: readonly string[];
speed160A held push keeps its message, and why tells every settle: the refusal stores the push's message; why on a line kept by abso settle --yours, --theirs or --both names the collision it was kept from, and both kinds of settle list the settler's held push with its reason; the settle's news and the change page carry it too, and a lone push's change now lists the refusals on its wayCompare152 /** A held push's message. */
153 readonly message?: string;
155 readonly notes?: readonly NoteAnswer[];
156 readonly reviewers?: readonly { readonly agent: string; readonly files: readonly string[]; readonly read: boolean }[];
157}
158/** The body of a note: on lines, or a reply to one. */
159export type NoteBody =
160 | {
161 readonly file: string;
162 readonly from: number;
163 readonly to: number;
164 readonly text: string;
165 readonly kind?: "comment" | "objection" | "read";
166 readonly of?: string;
167 readonly version?: number;
168 }
169 | { readonly reply: number; readonly text: string };
171export interface SyncAnswer {
172 readonly version: number;
173 readonly files: Readonly<Record<string, string | null>>;
174 /** Files whose executable bit or link changed: {exec, link}. */
175 readonly modes?: Modes;
176 /** Binary files whose bytes changed: path -> sha256, or null when the file is no longer binary. */
177 readonly blobs?: Readonly<Record<string, string | null>>;
178 readonly collisions?: readonly Collision[];
179 /** Lines both sides changed that sync merged item by item (a one-line list both added to): not collisions, but worth a look (#37). */
180 readonly merged?: readonly MergedLine[];
181}
182export interface MergedLine {
183 readonly file: string;
184 readonly line: number;
185 readonly text: string;
186 readonly theirs: { readonly agent: string; readonly message: string; readonly version: number };
187}
188export interface StatusAnswer {
189 readonly version: number;
190 readonly agents: readonly {
191 readonly agent: string;
192 /** The named draft it works in, or null (or absent) for shared. */
193 readonly draft?: string | null;
194 readonly base: number | null;
195 readonly draftChanges: number;
196 readonly files: readonly string[] | number;
197 /** Unpublished work it left parked in other spaces. */
198 readonly parked?: readonly { readonly draft: string | null; readonly draftChanges: number }[];
199 /** Marker blocks still in its draft (#11): collisions to settle. */
200 readonly collisions?: readonly OpenCollision[];
201 /** It reads and records nothing (#37). */
202 readonly reader?: true;
203 /** Its publishes waiting in the merge queue (#39). */
204 readonly queued?: readonly number[];
205 }[];
206 readonly drafts?: readonly {
207 readonly name: string;
208 readonly version: number;
209 readonly sharedBase: number;
210 readonly changes: number;
211 readonly agents: readonly string[];
212 }[];
213 /** The project's CI (#39); absent from servers without it. */
214 readonly ci?: CiStatus;
215 /** The merge queue (#39), while anything waits or it's paused. */
216 readonly queue?: QueueState | null;
engine25Read abso.json first, then avcs.json (abso 224, ask 238): one helper (projectFileIn) for the queue, files kept whole, reviewers and init; publish, init and git intake check both files the same way; when shared has both, abso.json counts and status says avcs.json is ignored (status answer projectFile, printed by abso status). .abso/ is kept out of projects like .avcs/. Old projects with only avcs.json work as before.Compare217 /** Only when shared has both project files: abso.json counts, avcs.json is ignored. */
218 readonly projectFile?: { readonly used: string; readonly ignored: string };
220/** `POST /a/:agent/draft` answers like a sync, naming the space the agent is now in. */
221export interface SwitchAnswer extends SyncAnswer {
222 readonly draft: string | null;
223}
224export interface DraftSyncAnswer {
225 readonly draft: string;
226 readonly version: number;
227 readonly sharedBase: number;
228}