Versions 87 to 318
Lines 7–13 at 318 (were 7–12 at 87)
77// The engine's own key, so both sides match spellings the same way (#49). Not in core.ts: the edit mod installs core.ts alone.
Lines 42–48 at 318 (were 41–46 at 87)
4344import { applyMode, type FullMode, foldModes, onDisk, PLAIN, readKnownModes, writeKnownModes } from "./modes.ts";
4547
Lines 215–291 at 318 (were 213–250 at 87)
215217 if (sent === 0) return { sent: 0, paths, deleted, changed: [], news: undefined, leftOut, turnedBinary };
216− await uploadBlobs(api, blobs);
217− const answer = await api.record(
218− Object.fromEntries(files),
219− {},
220− modes,
221− Object.fromEntries([...blobs].map(([rel, b]) => [rel, b.sha])),
245+ // Commit known state only after this batch is confirmed; earlier successful batches stay committed on later failure.
250+ for (const rel of new Set([...Object.keys(batch.files), ...Object.keys(batch.blobs)])) knownBlobs.delete(rel);
223− if (!answer.ok) throw new Error(`the server refused the record: ${answer.reason ?? "no reason given"}`);
224− // Forget before writing: after a rename that changes only case, known/a.ts and known/A.ts are one file on Windows and macOS.
225− for (const [rel, text] of files) if (text === null) forgetKnown(root, rel);
226− for (const [rel, text] of files) if (text !== null) writeKnown(root, rel, text);
227− const knownBlobs = readKnownBlobs(root);
228− if (blobs.size > 0 || [...files.keys()].some((rel) => knownBlobs.has(rel))) {
229− for (const rel of files.keys()) knownBlobs.delete(rel);
230− for (const [rel, b] of blobs) {
231− forgetKnown(root, rel);
232− knownBlobs.set(rel, b.sha);
233− }
234− writeKnownBlobs(root, knownBlobs);
235− }
236− const gone = [...files].filter(([, text]) => text === null).map(([rel]) => rel);
237− const knownModes = readKnownModes(root);
238− if (Object.keys(modes).length > 0 || gone.some((rel) => knownModes.has(rel))) {
239− foldModes(knownModes, modes, gone);
240− writeKnownModes(root, knownModes);
241− }
242− // Another spelling of an existing file went in as that file (#49); a new name not in composed form gets a gentle word.
243− heard(root, [
244− ...newsLines(answer.news),
245− ...(answer.spelling ?? []).map(spellingText),
246− ...(answer.uncomposed ?? []).map(uncomposedText),
247− ]);
272+ const changed = answers.flatMap((answer) => (Array.isArray(answer.changed) ? answer.changed : []));
Lines 314–320 at 318 (were 273–279 at 87)
273314export function gitMarkerText(list: readonly { path: string; line: number }[] | undefined): string[] {
276− `Note: ${m.path} has lines that look like a git conflict (from line ${m.line}). abso records them as ordinary text and will publish them as they are. If a merge was left unfinished, fix the file first.`,
317+ `Note: ${m.path} has lines that look like a git conflict (from line ${m.line}). abso records them as ordinary text and will push them as they are. If a merge was left unfinished, fix the file first.`,
279320
Lines 361–367 at 318 (were 320–326 at 87)
321362
323− "this folder is a reader: it records and publishes nothing (abso reader off makes it a writer again)";
364+ "this folder is a reader: it records and pushes nothing (abso reader off makes it a writer again)";
324365
Lines 380–386 at 318 (were 339–345 at 87)
342− ? "Recording again. Changes made while paused go at the next abso record (or publish, sync, ...); abso status lists them."
383+ ? "Recording again. Changes made while paused go at the next abso record (or push, pull, ...); abso status lists them."
Lines 432–485 at 318 (were 391–399 at 87)
394− return applyAnswer(root, api, await api.sync({ full }));
396439
441+
443+ * Whether a pull here asked the server and never wrote its answer (abso-core 26): it timed out, or stopped
444+ * partway. The server moved the agent's base when it answered, and later pulls send only what changed since
450+
452+ * Ask the server for a pull, noting first that one is under way, so a pull whose answer never gets written
453+ * leaves the note behind. With that note, or `full`, it asks for every file in the agent's view, which the
454+ * folder's own checks then write only where the folder differs. pullWritten takes the note away.
458+ writeFileAtomic(join(stateDir(root), PULLING_FILE), `${JSON.stringify({ at: new Date().toISOString() })}\n`);
468+
473+
478+ "A pull here didn't finish (its answer never arrived or wasn't written), so files may be behind this folder's base. abso pull fetches every file and writes the ones that differ.",
482+
Lines 564–577 at 318 (were 478–491 at 87)
479565 const list = paths.map((p) => `${p} (version ${unwritten[p]!.version}: ${unwritten[p]!.why})`).join(", ");
481− `Stale here: a sync couldn't write ${paths.length === 1 ? "this file" : "these files"}, and no later sync sends ${paths.length === 1 ? "it" : "them"} again. Close whatever holds ${paths.length === 1 ? "it" : "them"}, then abso sync --full: ${list}`,
567+ `Stale here: a pull couldn't write ${paths.length === 1 ? "this file" : "these files"}, and no later pull sends ${paths.length === 1 ? "it" : "them"} again. Close whatever holds ${paths.length === 1 ? "it" : "them"}, then abso pull --full: ${list}`,
484570
485571/** Write the files a sync or switch answer lists into the folder (the same rules as sync). */
487573export async function applyAnswer(root: string, api: Api, unscreened: SyncAnswer): Promise<Applied> {
488− return withFolderLock(root, "sync", () => applyAnswerLocked(root, api, unscreened));
490576
491577async function applyAnswerLocked(root: string, api: Api, unscreened: SyncAnswer): Promise<Applied> {
- MCP
- compare on this site's /mcp
- CLI
- abso diff 87 318 client/src/commands.ts --json
- JSON
- /christopher/abso-core/compare/87..318?file=client%2Fsrc%2Fcommands.ts&format=json