Versions 7 to 318
Lines 2–9 at 318 (were 2–8 at 7)
22
5−import { type Api, ApiError, type Collision, type Settled } from "./api.ts";
89import { collisionsHeading, collisionText, mergedLinesText, mergedText } from "./collision-text.ts";
Lines 13–36 at 318 (were 12–31 at 7)
24−import { absolute, forgetKnown, isLocalOnly, loadIgnore, readText, writeFileAtomic } from "./folder.ts";
25−import { PROJECT_FILE, readProjectFile } from "./project-file.ts";
28+import { absolute, forgetKnown, isLocalOnly, type LeftOut, loadIgnore, readText, writeFileAtomic } from "./folder.ts";
2934
Lines 66–85 at 318 (were 61–66 at 7)
6368
70+ * After "Pushed version N.": whether CI will check it, where the server says (its `ciWhere`). Nothing for the server's own
76+ `CI is off for this project, so version ${version} isn't checked. Connect a Cloudflare account in the project's settings on the website to run it there.`,
79+ return [`CI checks it in the project's Cloudflare account: abso ci ${version} shows the result.`];
82+
Lines 89–95 at 318 (were 70–76 at 7)
73− `--wait is how many seconds to wait for a queued publish to land, like 100 (got ${JSON.stringify(rawWait)})`,
92+ `--wait is how many seconds to wait for a queued push to land, like 100 (got ${JSON.stringify(rawWait)})`,
7594 const waitSeconds = bool(args, "no-wait") ? 0 : rawWait === undefined ? WAIT_SECONDS : Number(rawWait);
Lines 105–111 at 318 (were 86–91 at 7)
86105 // --check alone: the build and check in the draft's own avcs.json, as the server's job runs them on
91111 pf === null ? `there is no ${PROJECT_FILE}` : "error" in pf ? pf.error : `${PROJECT_FILE} has no "check"`;
Lines 116–175 at 318 (were 96–155 at 7)
99− // Your draft on newest shared, as it would land, must pass the check (#37, Builder 1):
100120 // two changes that each passed alone turned shared red twice. Sync first, then run it in the box.
102− // Known to have no prep: refuse before syncing and running (#37, Artist 1). Unknown: the run below tells.
122+ // Known to have no prep: refuse before syncing and running (#37). Unknown: the run below tells.
104− "your box has no prep, so a check would run without node_modules and its result couldn't be trusted. Run abso prep 'npm ci --ignore-scripts' once (every fresh box then starts from it), then publish --check again.";
124+ "your box has no prep, so a check would run without node_modules and its result couldn't be trusted. Run abso prep 'npm ci --ignore-scripts' once (every fresh box then starts from it), then push --check again.";
105125 if (knownPrep(root, boxOf(args, env)) === null && existsSync(join(root, "package-lock.json"))) {
108− text: `Not published: ${noPrep} (Nothing was run: this folder's last run in that box said it had no prep.)`,
128+ text: `Not pushed: ${noPrep} (Nothing was run: this folder's last run in that box said it had no prep.)`,
114− "Nothing was published, and the check didn't run.",
120− text: `${synced.text}\nNot published: the sync before the check left collisions. Settle them, then publish --check again.`,
140+ text: `${synced.text}\nNot pushed: the pull before the check left collisions. Settle them, then push --check again.`,
125− // Paths the sync wouldn't write (safety.ts) don't block: the check just ran without them (Cloud).
128− `avcs: the sync didn't write these: ${sj.refused!.map((r) => r.path).join(", ")}; the check runs without them.\n`,
148+ `abso: the pull didn't write these: ${sj.refused!.map((r) => r.path).join(", ")}; the check runs without them.\n`,
130− say(`avcs: checking your draft on newest shared in the box: ${check}\n`);
134154 const ran = await runRun({ positionals: [check], flags }, { ...env, runKind: "publish-check" });
135155 // No prep and a package-lock: the box had no node_modules, so the check can't be trusted either way
136− // (#37, Builder 1: npx tsc fetched an unrelated, deprecated tsc package).
137157 if ((ran.json as { prep?: string | null }).prep === null && existsSync(join(root, "package-lock.json"))) {
140− text: "Not published: your box has no prep, so the check ran without node_modules and its result can't be trusted. Run abso prep 'npm ci --ignore-scripts' once (every fresh box then starts from it), then publish --check again.",
160+ text: "Not pushed: your box has no prep, so the check ran without node_modules and its result can't be trusted. Run abso prep 'npm ci --ignore-scripts' once (every fresh box then starts from it), then push --check again.",
145− // Whose is it? Run the check once more on shared alone, at the version just synced to (#36, Builder 6:
146166 // stopped by someone else's red test, nothing said whose). One extra run, only when the check fails.
152− say(`avcs: the check failed; running it on shared alone (version ${newest}) to see whose it is.\n`);
172+ say(`abso: the check failed; running it on shared alone (version ${newest}) to see whose it is.\n`);
Lines 191–197 at 318 (were 171–177 at 7)
174− `Not published: the check failed (exit ${ran.exit}) on your draft with newest shared. Its output is above.`,
194+ `Not pushed: the check failed (exit ${ran.exit}) on your draft with newest shared. Its output is above.`,
Lines 203–231 at 318 (were 183–205 at 7)
186− say("avcs: the check passed; publishing.\n");
189− const steps = publishSteps(args, env, root, config, api, message, checked, waitSeconds, skippedCheck);
210+ const steps = publishSteps(args, env, root, config, api, message, checked, waitSeconds, skippedCheck, leftOut);
190211 // Say how far it got when the server can't be reached (#37, GAME - UI/UX: did the check run? did the draft go up?).
191− const out = await unreached(
193− checked
194− ? "The check passed, but the publish never reached the server: nothing was published."
195− : "Nothing was published.",
196− `${checked ? "The check passed; " : ""}the publish may have reached the server before its answer was lost: abso status shows whether your draft was published.`,
214+ checked ? "The check passed, but the push never reached the server: nothing was pushed." : "Nothing was pushed.",
215+ `${checked ? "The check passed; " : ""}the push may have reached the server before its answer was lost: abso status shows whether your draft was pushed.`,
198− // --done: this publish finishes the work the start note named (#44): take the note back once it's published or queued.
199− const went =
200− (out.json as { version?: unknown; queued?: unknown }).version !== undefined ||
201− (out.json as { queued?: unknown }).queued !== undefined;
202− if (!bool(args, "done") || !went) return out;
218+ // --done: this publish finishes the work the start note named (#44): take the note back once it's published.
219+ // A publish still in the merge queue may yet be pulled, so its note and issue stay as they are until it lands.
221+ const { version, queued, outcome } = out.json as { version?: unknown; queued?: unknown; outcome?: unknown };
226+ text: `${out.text}\nYour start note stays (--done): push ${queued} hasn't landed yet. Once it has, abso start --done takes the note back and abso issue <N> --done closes the issue it names.`,
Lines 258–264 at 318 (were 232–238 at 7)
235− text: `Published version ${landed.version}. The server's answer was lost (${why}), but shared's log shows your publish landed.`,
261+ text: `Pushed version ${landed.version}. The server's answer was lost (${why}), but shared's log shows your push landed.`,
Lines 268–280 at 318 (were 242–254 at 7)
245− text: `Queued as publish ${queued.id}. The server's answer was lost (${why}), but the merge queue holds your publish; the outcome comes as news on your next edit, and abso status shows the queue.`,
271+ text: `Queued as push ${queued.id}. The server's answer was lost (${why}), but the merge queue holds your push; the outcome comes as news on your next edit, and abso status shows the queue.`,
251− text: `Not published: ${why}. Shared's newest versions and the merge queue don't have it, so it's safe to publish again.`,
277+ text: `Not pushed: ${why}. Shared's newest versions and the merge queue don't have it, so it's safe to push again.`,
Lines 308–324 at 318 (were 282–295 at 7)
287316 const pre = [...recordedFirst(recorded), ...droppedIgnoredText(await dropIgnoredFromDraft(root, api))];
289318 // Publishing now would leave the others on the file's old text without anyone noticing (#25).
292− text: [...pre, ...turnedBinaryText(recorded.turnedBinary), "Not published."].join("\n"),
Lines 337–343 at 318 (were 308–314 at 7)
311− // The answer can be lost after the publish committed (Cloud: a storage reset killed the reply to
312341 // two publishes that had landed). Look before saying it failed; never publish again by itself.
Lines 346–352 at 318 (were 317–323 at 7)
320− const head = `Queued as publish ${answer.queued}${answer.ahead === 0 ? "" : `, ${answer.ahead} ${answer.ahead === 1 ? "publish" : "publishes"} ahead of it`}: it lands once the project's check passes on it in the merge queue.`;
349+ const head = `Queued as push ${answer.queued}${answer.ahead === 0 ? "" : `, ${answer.ahead} ${answer.ahead === 1 ? "push" : "pushes"} ahead of it`}: it lands once the project's check passes on it in the merge queue.`;
Lines 369–386 at 318 (were 340–359 at 7)
343− say(`avcs: ${head} Waiting up to ${waitSeconds} s for it (--no-wait returns at once).\n`);
349− Number(env.env.AVCS_QUEUE_POLL_MS) || 3000,
354− text: [...notes, `Published version ${out.version}: it passed the project's check in the merge queue.`].join(
355− "\n",
356− ),
383+ text: [...notes, `Pushed version ${out.version}: it passed the project's check in the merge queue.`].join("\n"),
Lines 394–400 at 318 (were 367–373 at 7)
370− `Publish ${answer.queued} left the merge queue, but nothing said whether it landed: abso log -n 3 shows it if it did.`,
397+ `Push ${answer.queued} left the merge queue, but nothing said whether it landed: abso log -n 3 shows it if it did.`,
Lines 404–410 at 318 (were 377–385 at 7)
380− text: [...notes, `Still queued after ${waitSeconds} s: publish ${answer.queued} is ${where}. ${later}`].join(
381− "\n",
382− ),
407+ text: [...notes, `Still queued after ${waitSeconds} s: push ${answer.queued} is ${where}. ${later}`].join("\n"),
Lines 413–420 at 318 (were 388–395 at 7)
391− : `Published version ${answer.version}.${merged.length > 0 ? ` ${mergedText(merged)}` : ""}`;
392− // The check ran on shared as it was; what landed since went in unchecked (Cloud).
Lines 426–443 at 318 (were 401–416 at 7)
404− // --check alone was skipped for a queue that turned out not to be on: the answer, not the draft's avcs.json, says (Cloud).
429+ // --check alone was skipped for a queue that turned out not to be on: the answer, not the draft's avcs.json, says.
407432 `It landed directly, with no check: your avcs.json says "queue": true, but shared's doesn't yet, so the merge queue isn't on and --check alone was skipped. abso ci ${answer.version} shows CI's result once it has run.`,
Lines 453–474 at 318 (were 426–447 at 7)
429− `Not published: ${files.join(", ")} still ${files.length === 1 ? "has" : "have"} collision markers (${plural(collisions.length, "block")}).`,
456+ `Not pushed: ${files.join(", ")} still ${files.length === 1 ? "has" : "have"} collision markers (${plural(collisions.length, "block")}).`,
431− `Settle each: keep yours, theirs or a mix and delete the marker lines, or abso settle <file> --yours|--theirs|--both. Then publish again. abso publish --as-is keeps both sides everywhere; the other authors hear it.`,
458+ `Settle each: keep yours, theirs or a mix and delete the marker lines, or abso settle <file> --yours|--theirs|--both. Then push again. abso push --as-is keeps both sides everywhere; the other authors hear it.`,
436− // Lines both sides changed, still as the sync left them (#37, Builder 1): publishing would put both in shared.
463+ // Lines both sides changed, still as the sync left them (#37): publishing would put both in shared.
442− `Not published: ${plural(collisions.length, "collision")} you synced into and haven't edited since. Both sides' lines are still in the file, so publishing now would put them in shared twice.`,
469+ `Not pushed: ${plural(collisions.length, "collision")} you pulled into and haven't edited since. Both sides' lines are still in the file, so pushing now would put them in shared twice.`,
444− "Edit each to what it should be (keep yours, theirs, or a mix), then publish again. If both really belong, abso publish --as-is keeps both.",
471+ "Edit each to what it should be (keep yours, theirs, or a mix), then push again. If both really belong, abso push --as-is keeps both.",
Lines 477–629 at 318 (were 450–486 at 7)
482+ // When the server says to settle (its AUTOSETTLE=act) and to keep a side of every collision, settle them here and
492+ text === null || text === undefined ? null : settleText(text, a.pick as "yours" | "theirs" | "both");
499+ // No marker block: the pull merged the lines itself. That counts when the file already holds the
508+ const wanted = sides.flatMap((t) => t.split(/\r?\n/).map((l) => l.trim())).filter((l) => l !== "");
518+ `Not pushed: the server advised settling ${left.join(", ")}, but the pull left no marker block there. Settle as the pull says, then push again.`,
539+ `Held: ${plural(collisions.length, "collision")} with work pushed since your last pull. Settled automatically, as the server advised:`,
542+ "Check what was kept with abso show <version>:<file>; to change it, edit the file and push. ABSO_AUTOSETTLE=off settles nothing by itself.",
458− `Not published: ${plural(collisions.length, "collision")}${newer.length > 0 ? " with work published since your last sync" : ""}.${answer.reason ? ` (${answer.reason})` : ""}`,
552+ `Not pushed: ${plural(collisions.length, "collision")}${newer.length > 0 ? " with work pushed since your last pull" : ""}.${answer.reason ? ` (${answer.reason})` : ""}`,
557+ ...collisions.flatMap((c, i) => (advice[i] ? [` ${c.file}: ${adviceWords(advice[i]!)}`] : [])),
462− ` ${local.map((c) => c.file).join(", ")}: local files that should never have been shared. abso sync drops them from your draft and leaves your copy on disk.`,
562+ ` ${local.map((c) => c.file).join(", ")}: local files that should never have been shared. abso pull drops them from your draft and leaves your copy on disk.`,
467− "Some of theirs are still in the merge queue, not in shared: once they land (abso status shows the queue), abso sync brings them in to settle; if they're pulled, publish again as you are.",
567+ "Some of theirs are still in the merge queue, not in shared: once they land (abso status shows the queue), abso pull brings them in to settle; if they're turned back, push again as you are.",
471− ? `Run abso sync: each of those files comes back holding both sides' lines, with no markers. Edit it to what it should be${twice.length > 0 ? ", keep one definition of each name defined twice" : ""}, then publish again.`
571+ ? `Run abso pull: each of those files comes back holding both sides' lines, in a marker block where you both changed the same lines. Settle each as the pull says${twice.length > 0 ? ", keep one definition of each name defined twice" : ""}, then push again.`
473− ? "Keep one definition of each name defined twice (delete yours, or theirs), then publish again."
474− : "Run abso sync, then publish again.",
476− json: { collisions, recorded: recorded.sent, ...(answer.reason ? { reason: answer.reason } : {}) },
479584
597+
599+ * What to settle by itself (#19), file by file, or null to leave it to the agent: every collision a lines collision
600+ * the server advised keeping a side of (it advises a side only at or above its threshold), each file's advice the
612+ if ((c.kind ?? "lines") !== "lines" || c.untouched || c.marked || c.theirs.queued !== undefined) return null;
620+
625+ // A pull here that never wrote its answer (abso-core 26): this one asks for every file to catch up.
Lines 633–649 at 318 (were 490–503 at 7)
493− `Synced to version ${s.version}: ${changes === 0 ? "no files changed" : `${plural(updated.length, "file")} updated, ${removed.length} deleted${s.renamed.length > 0 ? `, ${s.renamed.length} renamed` : ""}`}.`,
494− ...changedFilesText("sync", updated, removed, s.renamed, bool(args, "verbose")),
636+ `Pulled to version ${s.version}: ${changes === 0 ? "no files changed" : `${plural(updated.length, "file")} updated, ${removed.length} deleted${s.renamed.length > 0 ? `, ${s.renamed.length} renamed` : ""}`}.`,
639+ ? ["The last pull here didn't finish, so this one asked for every file and wrote the ones that differed."]
500− ? [`Left alone because they changed while syncing (run abso sync again): ${s.kept.join(", ")}`]
646+ ? [`Left alone because they changed while pulling (run abso pull again): ${s.kept.join(", ")}`]
Lines 674–680 at 318 (were 528–534 at 7)
530676 const said = { yours: "kept yours", theirs: "kept theirs", both: "kept both", rewrote: "rewrote them" } as const;
531− // Lines both sides still had that the settled file no longer has (#37, Playtester 1): the settler should look.
677+ // Lines both sides still had that the settled file no longer has (#37): the settler should look.
532678 const quote = (l: string) => `"${l.trim().length > 60 ? `${l.trim().slice(0, 57)}...` : l.trim()}"`;
534680 `Settled ${plural(settled.length, "collision")}: ${settled.map((s) => `${s.file} (${said[s.kept]}, against ${s.theirs.agent}'s version ${s.theirs.version})`).join("; ")}. ${[...new Set(settled.map((s) => s.theirs.agent))].join(", ")} will hear what you kept.`,
Lines 688–694 at 318 (were 542–548 at 7)
543689
545− * What an empty publish says (#37, Artist 1: "Nothing to publish: your draft
Lines 701–712 at 318 (were 555–566 at 7)
558− const empty = `Nothing to publish: your draft is empty. Shared is at version ${version}.`;
563− for (const line of readFileSync(join(root, ".avcs", "hook.log"), "utf8").split("\n")) {
Lines 720–730 at 318 (were 574–584 at 7)
577− return `Nothing published: shared already has ${found.length === 1 ? "the file you changed" : "the files you changed"} as you have ${found.length === 1 ? "it" : "them"}, so nothing of yours is lost. Last changed in ${found.join("; ")}. Shared is at version ${version}.`;
723+ return `Nothing pushed: shared already has ${found.length === 1 ? "the file you changed" : "the files you changed"} as you have ${found.length === 1 ? "it" : "them"}, so nothing of yours is lost. Last changed in ${found.join("; ")}. Shared is at version ${version}.`;
579725
581− * Several files marked against one version (#37, Builder 6: twenty tool
- MCP
- compare on this site's /mcp
- CLI
- abso diff 7 318 client/src/publish-commands.ts --json
- JSON
- /christopher/abso-core/compare/7..318?file=client%2Fsrc%2Fpublish-commands.ts&format=json