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

Versions 99 to 100

Compare

+342 −349 in 130 places
Lines 256–285 at 100 (were 256–285 at 99)
256256 writeFileSync(join(dir, "b.txt"), new Uint8Array([0, 1]));
257257 const diff = await main(["diff", "pic.bin"], { cwd: dir, env: ENV, write: () => {} });
258258 assert.match(diff.stdout, /Binary file pic\.bin changed: [0-9a-f]{12} -> [0-9a-f]{12}/);
259− const refused = await main(["publish", "-m", "new picture"], { cwd: dir, env: ENV, write: () => {} });
259+ const refused = await main(["push", "-m", "new picture"], { cwd: dir, env: ENV, write: () => {} });
260260 assert.equal(refused.exit, 2);
261261 assert.match(
262262 refused.stdout,
263− /NOT SENT: b\.txt was text and now has a NUL byte at line 1 \(byte 0\)\..*pass --binary b\.txt\.\nNot published\./,
263+ /NOT SENT: b\.txt was text and now has a NUL byte at line 1 \(byte 0\)\..*pass --binary b\.txt\.\nNot pushed\./,
264264 );
265265 // The publish goes through, and still says the huge file was left out, with a non-zero exit.
266− const published = await avcs(dir, "publish", "-m", "new picture, b is binary now", "--binary", "b.txt");
266+ const published = await avcs(dir, "push", "-m", "new picture, b is binary now", "--binary", "b.txt");
267267 assert.equal(published.exit, 1, published.out);
268− assert.ok(published.json.version !== undefined, "the rest was published");
268+ assert.ok(published.json.version !== undefined, "the rest was pushed");
269269 assert.deepEqual(published.json.leftOut, [{ path: "huge.bin", reason: "too big" }]);
270270 rmSync(join(dir, "huge.bin")); // the rest of the test is about the files that do go
271271 assert.equal("b.txt" in shared("blobs"), false);
272272 assert.ok("b.txt" in hosted.project.blobs());
273− assert.equal((await avcs(bob, "sync")).exit, 0);
273+ assert.equal((await avcs(bob, "pull")).exit, 0);
274274 assert.deepEqual(new Uint8Array(readFileSync(join(bob, "pic.bin"))), new Uint8Array([9, 0, 9]));
275275 assert.deepEqual(new Uint8Array(readFileSync(join(bob, "b.txt"))), new Uint8Array([0, 1]));
276276
277277 // Unrecorded binary work is never overwritten by a sync.
278278 writeFileSync(join(bob, "pic.bin"), new Uint8Array([7, 0, 7]));
279279 writeFileSync(join(dir, "pic.bin"), new Uint8Array([8, 0, 8]));
280− assert.equal((await avcs(dir, "publish", "-m", "another picture")).exit, 0);
280+ assert.equal((await avcs(dir, "push", "-m", "another picture")).exit, 0);
281281 // sync records first, so bob's picture goes into his draft and collides with alice's rather than being lost.
282− const synced = JSON.parse((await main(["sync", "--json"], { cwd: bob, env: ENV, write: () => {} })).stdout);
282+ const synced = JSON.parse((await main(["pull", "--json"], { cwd: bob, env: ENV, write: () => {} })).stdout);
283283 assert.equal(synced.ok, true);
284284 assert.deepEqual(new Uint8Array(readFileSync(join(bob, "pic.bin"))), new Uint8Array([7, 0, 7]), "bob's bytes stay");
285285
Lines 414–428 at 100 (were 414–428 at 99)
414414 assert.match(read(root, ".avcs/hook.log"), /\tEdit\ta\.txt\terror: could not reach/);
415415 writeFileSync(join(root, ".avcs", "config.json"), JSON.stringify(config));
416416 assert.equal((await avcs(root, "record")).json.sent, 1);
417− assert.equal((await avcs(root, "publish", "-m", "caps")).exit, 0);
417+ assert.equal((await avcs(root, "push", "-m", "caps")).exit, 0);
418418 assert.equal(shared(name)["a.txt"], "ONE\n");
419419 });
420420
421− it("hands news back as additionalContext when someone publishes lines in the draft", async () => {
421+ it("hands news back as additionalContext when someone pushes lines in the draft", async () => {
422422 const { folders } = await project({ "a.txt": "one\ntwo\n", "b.txt": "b\n" }, "alice", "bob");
423423 await edit(folders.bob!, "a.txt", "one\n", "uno\n");
424424 await edit(folders.alice!, "a.txt", "one\n", "ONE\n");
425− assert.equal((await avcs(folders.alice!, "publish", "-m", "shout one")).exit, 0);
425+ assert.equal((await avcs(folders.alice!, "push", "-m", "shout one")).exit, 0);
426426 const r = await edit(folders.bob!, "b.txt", "b\n", "bee\n");
427427 const out = JSON.parse(r.stdout);
428428 assert.equal(out.hookSpecificOutput.hookEventName, "PostToolUse");
Lines 449–455 at 100 (were 449–455 at 99)
449449 });
450450});
451451
452−describe("record, publish and sync", () => {
452+describe("record, push and pull", () => {
453453 it("records changes and deletions made outside the hook", async () => {
454454 const { name, folders } = await project({ "a.txt": "a\n", "gone.txt": "g\n" }, "alice");
455455 write(folders.alice!, { "a.txt": "A\n", "new.txt": "n\n" });
Lines 462–483 at 100 (were 462–483 at 99)
462462 assert.equal((await avcs(folders.alice!, "record")).json.sent, 0);
463463 });
464464
465− it("publishes, syncs into another folder, refuses a collision, and settles it", async () => {
465+ it("pushes, pulls into another folder, refuses a collision, and settles it", async () => {
466466 const { folders } = await project({ "a.txt": "one\n", "b.txt": "b\n" }, "alice", "bob");
467467 await edit(folders.alice!, "a.txt", "one\n", "alice one\n");
468− const pub = await avcs(folders.alice!, "publish", "-m", "alice was here");
468+ const pub = await avcs(folders.alice!, "push", "-m", "alice was here");
469469 assert.equal(pub.exit, 0, pub.out);
470470 assert.equal(pub.json.version, 1);
471471
472472 await edit(folders.bob!, "a.txt", "one\n", "bob one\n");
473473 write(folders.bob!, { "c.txt": "c\n" }); // not through the hook: publish records it first
474− const refused = await avcs(folders.bob!, "publish", "-m", "bob too");
474+ const refused = await avcs(folders.bob!, "push", "-m", "bob too");
475475 assert.equal(refused.exit, 2, refused.out);
476476 assert.equal(refused.json.collisions[0].file, "a.txt");
477477 assert.equal(refused.json.collisions[0].theirs.agent, "alice");
478478 assert.equal(refused.json.recorded, 1);
479479
480− const sync = await avcs(folders.bob!, "sync");
480+ const sync = await avcs(folders.bob!, "pull");
481481 assert.equal(sync.json.version, 1);
482482 assert.deepEqual(
483483 sync.json.collisions.map((c: any) => c.file),
Lines 488–498 at 100 (were 488–498 at 99)
488488 assert.match(both, /bob one/);
489489
490490 await put(folders.bob!, "a.txt", "alice one\nbob one\n");
491− const ok = await avcs(folders.bob!, "publish", "-m", "keep both");
491+ const ok = await avcs(folders.bob!, "push", "-m", "keep both");
492492 assert.equal(ok.exit, 0, ok.out);
493493 assert.equal(ok.json.version, 2);
494494
495− const back = await avcs(folders.alice!, "sync");
495+ const back = await avcs(folders.alice!, "pull");
496496 assert.deepEqual([...back.json.written].sort(), ["a.txt", "c.txt"]);
497497 assert.equal(read(folders.alice!, "a.txt"), "alice one\nbob one\n");
498498 assert.equal(read(folders.alice!, "c.txt"), "c\n");
Lines 502–520 at 100 (were 502–520 at 99)
502502 const { folders } = await project({ "a.txt": "a\n", "b.txt": "b\n" }, "alice", "bob");
503503 unlinkSync(join(folders.alice!, "b.txt"));
504504 write(folders.alice!, { "a.txt": "A\n" });
505− assert.equal((await avcs(folders.alice!, "publish", "-m", "drop b")).exit, 0);
506− const s = await avcs(folders.bob!, "sync");
505+ assert.equal((await avcs(folders.alice!, "push", "-m", "drop b")).exit, 0);
506+ const s = await avcs(folders.bob!, "pull");
507507 assert.deepEqual(s.json.deleted, ["b.txt"]);
508508 assert.ok(!existsSync(join(folders.bob!, "b.txt")));
509509 assert.equal(read(folders.bob!, "a.txt"), "A\n");
510510 });
511511
512− it("keeps CRLF line endings when sync rewrites a CRLF file", async () => {
512+ it("keeps CRLF line endings when pull rewrites a CRLF file", async () => {
513513 const { folders } = await project({ "w.txt": "one\r\ntwo\r\n" }, "alice", "bob");
514514 assert.equal(read(folders.bob!, "w.txt"), "one\ntwo\n", "a new file comes in the server form");
515515 await edit(folders.bob!, "w.txt", "two\n", "TWO\n");
516− assert.equal((await avcs(folders.bob!, "publish", "-m", "caps")).exit, 0);
517− const s = await avcs(folders.alice!, "sync");
516+ assert.equal((await avcs(folders.bob!, "push", "-m", "caps")).exit, 0);
517+ const s = await avcs(folders.alice!, "pull");
518518 assert.deepEqual(s.json.written, ["w.txt"]);
519519 assert.equal(read(folders.alice!, "w.txt"), "one\r\nTWO\r\n");
520520 });
Lines 529–536 at 100 (were 529–536 at 99)
529529 write(bob, { ".gitattributes": "*.txt eol=crlf\n*.bin -text\n" });
530530 assert.equal((await avcs(bob, "join", name, "--agent", "bob", "--server", fake.url)).exit, 0);
531531 write(folders.alice!, { "a.txt": "one\ntwo\n", "b.md": "one\ntwo\n", "c.bin": "x\ny\n" });
532− assert.equal((await avcs(folders.alice!, "publish", "-m", "three files")).exit, 0);
533− assert.equal((await avcs(bob, "sync")).exit, 0);
532+ assert.equal((await avcs(folders.alice!, "push", "-m", "three files")).exit, 0);
533+ assert.equal((await avcs(bob, "pull")).exit, 0);
534534 assert.equal(readFileSync(join(bob, "a.txt"), "utf8"), "one\r\ntwo\r\n", "eol=crlf");
535535 assert.equal(
536536 readFileSync(join(bob, "b.md"), "utf8"),
Lines 540–583 at 100 (were 540–583 at 99)
540540 assert.equal(readFileSync(join(bob, "c.bin"), "utf8"), "x\ny\n", "-text: left alone");
541541 git("config", "core.autocrlf", "true");
542542 write(folders.alice!, { "d.md": "x\n" });
543− assert.equal((await avcs(folders.alice!, "publish", "-m", "d")).exit, 0);
544− assert.equal((await avcs(bob, "sync")).exit, 0);
543+ assert.equal((await avcs(folders.alice!, "push", "-m", "d")).exit, 0);
544+ assert.equal((await avcs(bob, "pull")).exit, 0);
545545 assert.equal(readFileSync(join(bob, "d.md"), "utf8"), "x\r\n", "core.autocrlf true");
546546 assert.equal((await avcs(bob, "record")).json.sent, 0, "CRLF on disk is the same text to the server");
547547 });
548548
549− it("keeps each line's own ending in a mixed-ending file when sync rewrites it (lone CR too)", async () => {
549+ it("keeps each line's own ending in a mixed-ending file when pull rewrites it (lone CR too)", async () => {
550550 const { folders } = await project({ "m.txt": "a\r\nb\nc\rd\r\ne\r\n" }, "alice", "bob");
551551 await edit(folders.bob!, "m.txt", "b\n", "B\nnew\n");
552− assert.equal((await avcs(folders.bob!, "publish", "-m", "change b, add a line")).exit, 0);
553− assert.equal((await avcs(folders.alice!, "sync")).exit, 0);
552+ assert.equal((await avcs(folders.bob!, "push", "-m", "change b, add a line")).exit, 0);
553+ assert.equal((await avcs(folders.alice!, "pull")).exit, 0);
554554 // a, c, d and e keep their endings; the changed and the new line take the most common one (CRLF).
555555 assert.equal(read(folders.alice!, "m.txt"), "a\r\nB\r\nnew\r\nc\rd\r\ne\r\n");
556556 assert.equal((await avcs(folders.alice!, "record")).json.sent, 0);
557557 });
558558
559− it("keeps a missing final newline (LF or CRLF) when sync rewrites the file, with nothing left to record", async () => {
559+ it("keeps a missing final newline (LF or CRLF) when pull rewrites the file, with nothing left to record", async () => {
560560 const { folders } = await project({ "n.txt": "one\ntwo", "c.txt": "x\r\ny" }, "alice", "bob");
561561 await edit(folders.bob!, "n.txt", "two\n", "TWO\n");
562562 await edit(folders.bob!, "c.txt", "y\n", "Y\n");
563− assert.equal((await avcs(folders.bob!, "publish", "-m", "caps")).exit, 0);
564− const s = await avcs(folders.alice!, "sync");
563+ assert.equal((await avcs(folders.bob!, "push", "-m", "caps")).exit, 0);
564+ const s = await avcs(folders.alice!, "pull");
565565 assert.deepEqual(s.json.written.sort(), ["c.txt", "n.txt"]);
566566 assert.equal(read(folders.alice!, "n.txt"), "one\nTWO");
567567 assert.equal(read(folders.alice!, "c.txt"), "x\r\nY");
568568 assert.equal((await avcs(folders.alice!, "record")).json.sent, 0);
569569 });
570570
571− it("says so when there is nothing to publish", async () => {
571+ it("says so when there is nothing to push", async () => {
572572 const { folders } = await project({ "a.txt": "a\n" }, "alice");
573− const r = await main(["publish", "-m", "nothing"], { cwd: folders.alice!, env: ENV, write: () => {} });
573+ const r = await main(["push", "-m", "nothing"], { cwd: folders.alice!, env: ENV, write: () => {} });
574574 assert.equal(r.exit, 0);
575− assert.match(r.stdout, /Nothing to publish: your draft is empty\. Shared is at version 0\./);
575+ assert.match(r.stdout, /Nothing to push: your draft is empty\. Shared is at version 0\./);
576576 });
577577
578− it("refuses publish without a message", async () => {
578+ it("refuses push without a message", async () => {
579579 const { folders } = await project({ "a.txt": "a\n" }, "alice");
580− const r = await avcs(folders.alice!, "publish");
580+ const r = await avcs(folders.alice!, "push");
581581 assert.equal(r.exit, 1);
582582 assert.equal(r.json.error.code, "usage");
583583 });
Lines 611–627 at 100 (were 611–627 at 99)
611611 assert.ok(LOCK in shared(name));
612612
613613 await edit(folders.lazy!, "a.txt", "one\n", "one lazy\n");
614− const refused = await main(["publish", "-m", "lazy work"], { cwd: folders.lazy!, env: ENV, write: () => {} });
614+ const refused = await main(["push", "-m", "lazy work"], { cwd: folders.lazy!, env: ENV, write: () => {} });
615615 assert.equal(refused.exit, 2);
616616 assert.match(refused.stdout, /\.claude\/scheduled_tasks\.lock: local files that should never have been shared/);
617− assert.match(refused.stdout, /Run abso sync, then publish again\./);
617+ assert.match(refused.stdout, /Run abso pull, then push again\./);
618618
619619 for (const agent of ["lazy", "pike", "prefix"]) {
620− const s = await avcs(folders[agent]!, "sync");
620+ const s = await avcs(folders[agent]!, "pull");
621621 assert.deepEqual(s.json.collisions, [], `${agent} sees no collision`);
622622 assert.equal(read(folders[agent]!, LOCK), `lock ${agent}\n`, `${agent}'s lock file is untouched`);
623623 if (agent === "pike") await edit(folders.pike!, "b.txt", "two\n", "two pike\n");
624− const pub = await avcs(folders[agent]!, "publish", "-m", `${agent} work`);
624+ const pub = await avcs(folders[agent]!, "push", "-m", `${agent} work`);
625625 assert.equal(pub.exit, 0, `${agent}: ${pub.out}`);
626626 }
627627 assert.ok(!(LOCK in shared(name)), "shared no longer has it");
Lines 630–651 at 100 (were 630–651 at 99)
630630 });
631631});
632632
633−describe("named drafts: switch, land and draft-sync", () => {
633+describe("named drafts: switch, land and draft-pull", () => {
634634 it("carries work into a new draft, parks and restores it, lands it, and moves it onto shared", async () => {
635635 const { name, folders } = await project({ "a.txt": "a\n", "b.txt": "b\n", "c.txt": "c\n" }, "alice", "bob");
636636 const alice = folders.alice!;
637637
638− // Unpublished work carried into a new draft stays in the folder.
638+ // Unpushed work carried into a new draft stays in the folder.
639639 await edit(alice, "a.txt", "a\n", "a in exp\n");
640640 const started = await avcs(alice, "switch", "-c", "exp");
641641 assert.equal(started.exit, 0, started.out);
642642 assert.equal(started.json.draft, "exp");
643643 assert.equal(read(alice, "a.txt"), "a in exp\n");
644− assert.equal((await avcs(alice, "publish", "-m", "exp: change a")).exit, 0);
645− assert.equal(shared(name)["a.txt"], "a\n", "publishing into the draft leaves shared alone");
644+ assert.equal((await avcs(alice, "push", "-m", "exp: change a")).exit, 0);
645+ assert.equal(shared(name)["a.txt"], "a\n", "pushing into the draft leaves shared alone");
646646
647647 // A folder-only edit (no hook) is recorded before switching, so it is parked, not lost.
648− write(alice, { "b.txt": "b unpublished in exp\n" });
648+ write(alice, { "b.txt": "b unpushed in exp\n" });
649649 const back = await avcs(alice, "switch", "shared");
650650 assert.equal(back.exit, 0, back.out);
651651 assert.equal(back.json.draft, null);
Lines 659–680 at 100 (were 659–680 at 99)
659659 const again = await avcs(alice, "switch", "exp");
660660 assert.equal(again.exit, 0, again.out);
661661 assert.equal(read(alice, "a.txt"), "a in exp\n");
662− assert.equal(read(alice, "b.txt"), "b unpublished in exp\n", "the parked work came back");
662+ assert.equal(read(alice, "b.txt"), "b unpushed in exp\n", "the parked work came back");
663663
664664 // Shared moves on; draft-sync brings it into the draft and this folder.
665665 await edit(folders.bob!, "c.txt", "c\n", "c from bob\n");
666− assert.equal((await avcs(folders.bob!, "publish", "-m", "bob: change c")).exit, 0);
667− const moved = await avcs(alice, "draft-sync");
666+ assert.equal((await avcs(folders.bob!, "push", "-m", "bob: change c")).exit, 0);
667+ const moved = await avcs(alice, "draft-pull");
668668 assert.equal(moved.exit, 0, moved.out);
669669 assert.equal(moved.json.sharedBase, 1);
670670 assert.equal(read(alice, "c.txt"), "c from bob\n");
671671
672672 // Land the draft: its published work goes into shared as one unit.
673− assert.equal((await avcs(alice, "publish", "-m", "exp: change b")).exit, 0);
673+ assert.equal((await avcs(alice, "push", "-m", "exp: change b")).exit, 0);
674674 const landed = await avcs(alice, "land", "-m", "land exp");
675675 assert.equal(landed.exit, 0, landed.out);
676676 assert.equal(shared(name)["a.txt"], "a in exp\n");
677− assert.equal(shared(name)["b.txt"], "b unpublished in exp\n");
677+ assert.equal(shared(name)["b.txt"], "b unpushed in exp\n");
678678 assert.equal(shared(name)["c.txt"], "c from bob\n");
679679
680680 // Switching back syncs: the folder shows shared as it is now, landed work included.
Lines 693–699 at 100 (were 693–699 at 99)
693693 assert.equal((await avcs(alice, "switch", "exp")).exit, 0);
694694 assert.equal(read(alice, "a.txt"), "one\ntwo\nthree\n", "the shared edit is parked");
695695 await edit(folders.bob!, "a.txt", "two\n", "two bob\n");
696− assert.equal((await avcs(folders.bob!, "publish", "-m", "bob: line two")).exit, 0);
696+ assert.equal((await avcs(folders.bob!, "push", "-m", "bob: line two")).exit, 0);
697697
698698 const back = await avcs(alice, "switch", "shared");
699699 assert.equal(back.exit, 0, back.out);
Lines 712–732 at 100 (were 712–732 at 99)
712712describe("announcements", () => {
713713 it("reach every other agent once, as news on their next edit or abso news", async () => {
714714 const { folders } = await project({ "a.txt": "a\n" }, "lead", "bob", "carol");
715− const sent = await avcs(folders.lead!, "announce", "Stop", "publishing", "until", "v12", "lands");
715+ const sent = await avcs(folders.lead!, "announce", "Stop", "pushing", "until", "v12", "lands");
716716 assert.equal(sent.exit, 0, sent.out);
717717 assert.deepEqual([...sent.json.to].sort(), ["bob", "carol"]);
718718
719719 const bob = await avcs(folders.bob!, "news");
720− assert.deepEqual(bob.json.news, ["Announcement from lead (as claimed): Stop publishing until v12 lands"]);
720+ assert.deepEqual(bob.json.news, ["Announcement from lead (as claimed): Stop pushing until v12 lands"]);
721721 assert.match(
722722 read(folders.bob!, ".avcs/news.log"),
723− /\tAnnouncement from lead \(as claimed\): Stop publishing until v12 lands\n$/,
723+ /\tAnnouncement from lead \(as claimed\): Stop pushing until v12 lands\n$/,
724724 );
725725 assert.deepEqual((await avcs(folders.bob!, "news")).json.news, [], "each item comes once");
726726
727727 // carol gets it on her next edit instead.
728728 const hooked = await edit(folders.carol!, "a.txt", "a\n", "a from carol\n");
729− assert.match(hooked.stdout, /lead \(as claimed\) told you:\\n {2}Stop publishing until v12 lands/);
729+ assert.match(hooked.stdout, /lead \(as claimed\) told you:\\n {2}Stop pushing until v12 lands/);
730730 });
731731
732732 it("go only to the agents named with --to, and refuse unknown ones", async () => {
Lines 748–754 at 100 (were 748–754 at 99)
748748 const started = await text(folders.builder6!, "start", "Storm cloud art", "storm.ts");
749749 assert.equal(started.exit, 0, started.stderr);
750750 assert.match(started.stdout, /Starting on "Storm cloud art", naming storm\.ts\./);
751− assert.match(started.stdout, /storm\.ts: builder3 \(1 unpublished change\)/);
751+ assert.match(started.stdout, /storm\.ts: builder3 \(1 unpushed change\)/);
752752 const where = await text(folders.builder3!, "where");
753753 assert.match(where.stdout, /Starting on:\n {2}builder6: "Storm cloud art" \(storm\.ts\), since /);
754754 assert.match(
Lines 768–784 at 100 (were 768–784 at 99)
768768 writeFileSync(join(alice, "fuzz.ts"), "one\ntwo\nth\u0000ree\n");
769769 const status = await main(["status"], { cwd: alice, env: ENV, write: () => {} });
770770 assert.match(status.stdout, /NOT SENT: fuzz\.ts was text and now has a NUL byte at line 3 \(byte 10\)/);
771− const refused = await avcs(alice, "publish", "-m", "oops");
771+ const refused = await avcs(alice, "push", "-m", "oops");
772772 assert.equal(refused.exit, 2);
773773 assert.deepEqual(refused.json.turnedBinary, [{ path: "fuzz.ts", why: "a NUL byte", offset: 10, line: 3 }]);
774774 assert.equal(shared(name)["fuzz.ts"], "one\ntwo\nthree\n", "the server keeps the text");
775775
776776 writeFileSync(join(alice, "fuzz.ts"), "one\ntwo\nthree, fixed\n");
777− assert.equal((await avcs(alice, "publish", "-m", "fixed")).exit, 0);
777+ assert.equal((await avcs(alice, "push", "-m", "fixed")).exit, 0);
778778 assert.equal(shared(name)["fuzz.ts"], "one\ntwo\nthree, fixed\n");
779779
780780 writeFileSync(join(alice, "fuzz.ts"), Buffer.concat([Buffer.from("ok\n"), Buffer.from([0xc3, 0x28])]));
781− assert.deepEqual((await avcs(alice, "publish", "-m", "bad utf-8")).json.turnedBinary, [
781+ assert.deepEqual((await avcs(alice, "push", "-m", "bad utf-8")).json.turnedBinary, [
782782 { path: "fuzz.ts", why: "bytes that are not UTF-8", offset: 3, line: 2 },
783783 ]);
784784 });
Lines 787–809 at 100 (were 787–809 at 99)
787787describe("drop, pluck, amend, labels and follow (#10, #27)", () => {
788788 const text = async (cwd: string, ...argv: string[]) => main(argv, { cwd, env: ENV, write: () => {} });
789789
790− it("drops a published version, refuses one others build on, and says so in the log", async () => {
790+ it("drops a pushed version, refuses one others build on, and says so in the log", async () => {
791791 const { name, folders } = await project({ "a.txt": "a\n", "b.txt": "b\n" }, "alice", "bob");
792792 const [alice, bob] = [folders.alice!, folders.bob!];
793793 write(alice, { "a.txt": "a, changed\n" });
794− assert.equal((await avcs(alice, "publish", "-m", "change a")).exit, 0);
794+ assert.equal((await avcs(alice, "push", "-m", "change a")).exit, 0);
795795 write(alice, { "a.txt": "a, changed again\n" });
796− assert.equal((await avcs(alice, "publish", "-m", "change a again")).exit, 0);
796+ assert.equal((await avcs(alice, "push", "-m", "change a again")).exit, 0);
797797 write(alice, { "b.txt": "b, changed\n" });
798− assert.equal((await avcs(alice, "publish", "-m", "change b")).exit, 0);
799− assert.equal((await avcs(bob, "sync")).exit, 0);
798+ assert.equal((await avcs(alice, "push", "-m", "change b")).exit, 0);
799+ assert.equal((await avcs(bob, "pull")).exit, 0);
800800
801801 // Version 2 builds on version 1: refused, then dropped together.
802802 const refused = await text(alice, "drop", "1", "-m", "a was wrong");
803803 assert.equal(refused.exit, 2);
804804 assert.match(
805805 refused.stdout,
806− /Not dropped\.\nLater published versions build on it:\n {2}version 2 by alice: change a again\nPass --with-dependents/,
806+ /Not dropped\.\nLater pushed versions build on it:\n {2}version 2 by alice: change a again\nPass --with-dependents/,
807807 );
808808 assert.equal((await text(alice, "drop", "1")).exit, 1, "a drop needs a message");
809809 const dropped = await avcs(alice, "drop", "1", "-m", "a was wrong", "--with-dependents");
Lines 814–820 at 100 (were 814–820 at 99)
814814 assert.equal(shared(name)["b.txt"], "b, changed\n", "version 3 stays");
815815
816816 // The other agent's sync takes it out of their folder; the log says what happened.
817− assert.equal((await avcs(bob, "sync")).exit, 0);
817+ assert.equal((await avcs(bob, "pull")).exit, 0);
818818 assert.equal(read(bob, "a.txt"), "a\n");
819819 const log = await text(bob, "log");
820820 assert.match(log.stdout, /version 4 by alice, .*: a was wrong\n {2}1 file: a\.txt\n {2}drops versions 1, 2/);
Lines 824–835 at 100 (were 824–835 at 99)
824824 );
825825 });
826826
827− it("refuses a publish that builds on lines a drop took out, plainly, with exit 2", async () => {
827+ it("refuses a push that builds on lines a drop took out, plainly, with exit 2", async () => {
828828 const { folders } = await project({ "a.txt": "one\ntwo\n" }, "alice", "bob");
829829 const [alice, bob] = [folders.alice!, folders.bob!];
830830 write(alice, { "a.txt": "one\nTWO\n" });
831− assert.equal((await avcs(alice, "publish", "-m", "shout two")).exit, 0);
832− assert.equal((await avcs(bob, "sync")).exit, 0);
831+ assert.equal((await avcs(alice, "push", "-m", "shout two")).exit, 0);
832+ assert.equal((await avcs(bob, "pull")).exit, 0);
833833 // A drop never touches unpublished work.
834834 write(bob, { "a.txt": "one\nTWO?\n" });
835835 assert.equal((await avcs(bob, "record")).exit, 0);
Lines 837–880 at 100 (were 837–880 at 99)
837837 assert.equal(blocked.exit, 2);
838838 assert.match(
839839 blocked.stdout,
840− /Unpublished work builds on it, and a drop never touches unpublished work:\n {2}agent bob: a\.txt/,
840+ /Unpushed work builds on it, and a drop never touches unpushed work:\n {2}agent bob: a\.txt/,
841841 );
842842 assert.equal((await avcs(bob, "restore", "a.txt")).exit, 0);
843843 // The drop lands before bob syncs; bob's edit still builds on the dropped line.
844844 assert.equal((await avcs(alice, "drop", "1", "-m", "no shouting")).exit, 0);
845845 write(bob, { "a.txt": "one\nTWO!\n" });
846− const publish = await text(bob, "publish", "-m", "more shouting");
846+ const publish = await text(bob, "push", "-m", "more shouting");
847847 assert.equal(publish.exit, 2);
848848 assert.match(
849849 publish.stderr,
850− /^abso publish: refused: your unpublished changes to a\.txt build on lines a drop took out of shared; restore those files \(abso restore a\.txt\)/,
850+ /^abso push: refused: your unpushed changes to a\.txt build on lines a drop took out of shared; restore those files \(abso restore a\.txt\)/,
851851 );
852852 });
853853
854− it("amends the newest publish, and the log keeps the first message", async () => {
854+ it("amends the newest push, and the log keeps the first message", async () => {
855855 const { folders } = await project({ "a.txt": "a\n" }, "alice");
856856 const alice = folders.alice!;
857857 write(alice, { "a.txt": "a2\n" });
858− assert.equal((await avcs(alice, "publish", "-m", "chnage a")).exit, 0);
858+ assert.equal((await avcs(alice, "push", "-m", "chnage a")).exit, 0);
859859 const amended = await text(alice, "amend", "-m", "change a");
860860 assert.equal(amended.exit, 0, amended.stderr);
861861 assert.match(amended.stdout, /^Version 1 of shared now says: change a\n\(It said: chnage a\.\)/);
862862 assert.match(
863863 (await text(alice, "log")).stdout,
864− /version 1 by alice, .*: change a\n {2}1 file: a\.txt\n {2}amended; first published as: chnage a/,
864+ /version 1 by alice, .*: change a\n {2}1 file: a\.txt\n {2}amended; first pushed as: chnage a/,
865865 );
866− assert.match((await text(alice, "show", "1")).stdout, /: change a\n {2}amended; first published as: chnage a/);
866+ assert.match((await text(alice, "show", "1")).stdout, /: change a\n {2}amended; first pushed as: chnage a/);
867867 });
868868
869− it("labels versions, and a folder that follows a label syncs to it", async () => {
869+ it("labels versions, and a folder that follows a label pulls to it", async () => {
870870 const { folders } = await project({ "a.txt": "a\n" }, "alice", "bob");
871871 const [alice, bob] = [folders.alice!, folders.bob!];
872872 write(alice, { "a.txt": "a1\n" });
873− assert.equal((await avcs(alice, "publish", "-m", "one")).exit, 0);
873+ assert.equal((await avcs(alice, "push", "-m", "one")).exit, 0);
874874 const labeled = await text(alice, "label", "stable");
875875 assert.equal(labeled.stdout, "Put label stable on version 1. It marks 1 version: 1.\n");
876876 write(alice, { "a.txt": "a2\n" });
877− assert.equal((await avcs(alice, "publish", "-m", "two")).exit, 0);
877+ assert.equal((await avcs(alice, "push", "-m", "two")).exit, 0);
878878 assert.equal((await text(alice, "label", "bad name!")).exit, 1);
879879 assert.deepEqual((await avcs(alice, "labels")).json.labels, { stable: [1] });
880880 assert.match(
Lines 892–898 at 100 (were 892–898 at 99)
892892
893893 // Moving the label moves the folder on its next sync.
894894 assert.equal((await avcs(alice, "label", "stable", "--version", "2")).exit, 0);
895− assert.equal((await avcs(bob, "sync")).exit, 0);
895+ assert.equal((await avcs(bob, "pull")).exit, 0);
896896 assert.equal(read(bob, "a.txt"), "a2\n");
897897
898898 assert.equal((await avcs(alice, "label", "stable", "--version", "2", "--remove")).json.versions.join(), "1");
Lines 908–916 at 100 (were 908–916 at 99)
908908 const alice = folders.alice!;
909909 assert.equal((await avcs(alice, "switch", "-c", "exp")).exit, 0);
910910 write(alice, { "a.txt": "a in exp\n" });
911− assert.equal((await avcs(alice, "publish", "-m", "exp: a")).exit, 0);
911+ assert.equal((await avcs(alice, "push", "-m", "exp: a")).exit, 0);
912912 write(alice, { "b.txt": "b in exp\n" });
913− assert.equal((await avcs(alice, "publish", "-m", "exp: b")).exit, 0);
913+ assert.equal((await avcs(alice, "push", "-m", "exp: b")).exit, 0);
914914 const plucked = await text(folders.bob!, "pluck", "exp", "2", "-m", "just b");
915915 assert.equal(plucked.exit, 0, plucked.stderr);
916916 assert.match(plucked.stdout, /^Plucked 1 version of draft exp into shared as version 1/);
Lines 919–925 at 100 (were 919–925 at 99)
919919 assert.equal((await text(folders.bob!, "pluck", "exp", "-m", "nothing")).exit, 1);
920920 });
921921
922− it("blames a named draft, and marks your own unpublished lines with --mine", async () => {
922+ it("blames a named draft, and marks your own unpushed lines with --mine", async () => {
923923 const { folders } = await project({ "a.txt": "one\ntwo\n" }, "alice");
924924 const alice = folders.alice!;
925925 write(alice, { "a.txt": "one\ntwo\nthree\n" });
Lines 928–934 at 100 (were 928–934 at 99)
928928 assert.equal(mine.exit, 0, mine.stderr);
929929 assert.match(mine.stdout, /^a\.txt as your view has it now \(lines 1-3 of 3\):/);
930930 assert.match(mine.stdout, /\n {2}3 {2}\* {4}alice {2}three\n/);
931− assert.match(mine.stdout, /\* not published yet/);
931+ assert.match(mine.stdout, /\* not pushed yet/);
932932 assert.match((await text(alice, "blame", "a.txt")).stdout, /lines 1-2 of 2/, "shared does not have it");
933933 assert.equal((await text(alice, "blame", "a.txt", "--mine", "--draft", "x")).exit, 1);
934934 const why = await avcs(alice, "why", "a.txt:3", "--mine");
Lines 936–942 at 100 (were 936–942 at 99)
936936 assert.equal(why.json.text, "three");
937937
938938 assert.equal((await avcs(alice, "switch", "-c", "exp")).exit, 0);
939− assert.equal((await avcs(alice, "publish", "-m", "exp: three")).exit, 0);
939+ assert.equal((await avcs(alice, "push", "-m", "exp: three")).exit, 0);
940940 assert.match(
941941 (await text(alice, "blame", "a.txt", "--draft", "exp")).stdout,
942942 /^a\.txt as draft exp has it at version 1 \(lines 1-3 of 3\):/,
Lines 948–958 at 100 (were 948–958 at 99)
948948 const text = async (cwd: string, ...argv: string[]) => main(argv, { cwd, env: ENV, write: () => {} });
949949 const SRC = "export function f() {\n return 1;\n}\n\nexport const x = 2;\n";
950950
951− it("shows a rename as one change in diff, show and sync, and log follows it back", async () => {
951+ it("shows a rename as one change in diff, show and pull, and log follows it back", async () => {
952952 const { name, folders } = await project({ "lib/old.ts": SRC, "keep.ts": "k\n" }, "alice", "bob");
953953 const [alice, bob] = [folders.alice!, folders.bob!];
954954 write(alice, { "lib/old.ts": SRC.replace("return 1", "return 2") });
955− assert.equal((await avcs(alice, "publish", "-m", "f returns 2")).exit, 0);
955+ assert.equal((await avcs(alice, "push", "-m", "f returns 2")).exit, 0);
956956
957957 // Renamed with one line changed: one file, 1 line added and 1 removed.
958958 renameSync(join(alice, "lib", "old.ts"), join(alice, "lib", "new.ts"));
Lines 967–973 at 100 (were 967–973 at 99)
967967 /rename from lib\/old\.ts/,
968968 "the old path picks the rename too",
969969 );
970− assert.equal((await avcs(alice, "publish", "-m", "rename old to new")).exit, 0);
970+ assert.equal((await avcs(alice, "push", "-m", "rename old to new")).exit, 0);
971971 assert.equal(shared(name)["lib/new.ts"], SRC.replace("return 1", "return 2").replace("x = 2", "x = 3"));
972972
973973 const show = await text(alice, "show", "2");
Lines 976–982 at 100 (were 976–982 at 99)
976976 /1 file \(1 renamed\), 1 line added, 1 removed\.\nsimilarity index 80%\nrename from lib\/old\.ts\nrename to lib\/new\.ts/,
977977 );
978978
979− const sync = await avcs(bob, "sync");
979+ const sync = await avcs(bob, "pull");
980980 assert.deepEqual(sync.json.renamed, [{ from: "lib/old.ts", to: "lib/new.ts" }]);
981981 write(bob, { "keep.ts": "k\n" });
982982
Lines 993–1003 at 100 (were 993–1003 at 99)
993993 (await text(alice, "diff")).stdout,
994994 /: 1 file \(1 renamed\), 0 lines added, 0 removed\.\nsimilarity index 100%\nrename from keep\.ts\nrename to kept\.ts\n$/,
995995 );
996− assert.equal((await avcs(alice, "publish", "-m", "rename keep")).exit, 0);
997− const synced = await text(bob, "sync");
996+ assert.equal((await avcs(alice, "push", "-m", "rename keep")).exit, 0);
997+ const synced = await text(bob, "pull");
998998 assert.match(
999999 synced.stdout,
1000− /Synced to version 3: 0 files updated, 0 deleted, 1 renamed\.\n {2}renamed: keep\.ts -> kept\.ts/,
1000+ /Pulled to version 3: 0 files updated, 0 deleted, 1 renamed\.\n {2}renamed: keep\.ts -> kept\.ts/,
10011001 );
10021002 });
10031003
Lines 1046–1052 at 100 (were 1046–1052 at 99)
10461046 });
10471047});
10481048
1049−describe("a quieter sync (trial request)", () => {
1049+describe("a quieter pull (trial request)", () => {
10501050 it("names up to 8 files per line, and --verbose lists every one", async () => {
10511051 const files: Record<string, string> = {};
10521052 for (let i = 0; i < 11; i++) files[`f${String(i).padStart(2, "0")}.txt`] = `${i}\n`;
Lines 1055–1069 at 100 (were 1055–1069 at 99)
10551055 const changed: Record<string, string> = {};
10561056 for (const f of Object.keys(files)) changed[f] = `${files[f]}changed\n`;
10571057 write(alice, changed);
1058− assert.equal((await avcs(alice, "publish", "-m", "change all")).exit, 0);
1059− const quiet = await main(["sync"], { cwd: bob, env: ENV, write: () => {} });
1058+ assert.equal((await avcs(alice, "push", "-m", "change all")).exit, 0);
1059+ const quiet = await main(["pull"], { cwd: bob, env: ENV, write: () => {} });
10601060 assert.equal(
10611061 quiet.stdout,
1062− "Synced to version 1: 11 files updated, 0 deleted.\n updated: f00.txt, f01.txt, f02.txt, f03.txt, f04.txt, f05.txt, f06.txt, f07.txt, and 3 more\n (abso sync --verbose lists every file)\n",
1062+ "Pulled to version 1: 11 files updated, 0 deleted.\n updated: f00.txt, f01.txt, f02.txt, f03.txt, f04.txt, f05.txt, f06.txt, f07.txt, and 3 more\n (abso pull --verbose lists every file)\n",
10631063 );
10641064 write(alice, files);
1065− assert.equal((await avcs(alice, "publish", "-m", "change back")).exit, 0);
1066− const loud = await main(["sync", "--verbose"], { cwd: bob, env: ENV, write: () => {} });
1065+ assert.equal((await avcs(alice, "push", "-m", "change back")).exit, 0);
1066+ const loud = await main(["pull", "--verbose"], { cwd: bob, env: ENV, write: () => {} });
10671067 assert.equal(loud.stdout.split("\n").filter((l) => l.startsWith(" updated f")).length, 11);
10681068 });
10691069});
Lines 1239–1245 at 100 (were 1239–1245 at 99)
12391239 assert.equal(
12401240 text,
12411241 [
1242− ` src/re.ts: parse is defined twice, yours (lines 10-12) and bob's from version 7 ("add parse") (lines 3-4). Keep one, then publish.`,
1242+ ` src/re.ts: parse is defined twice, yours (lines 10-12) and bob's from version 7 ("add parse") (lines 3-4). Keep one, then push.`,
12431243 " yours:",
12441244 " export function parse(s) {",
12451245 " return s;",
Lines 1251–1280 at 100 (were 1251–1280 at 99)
12511251 );
12521252 });
12531253
1254− it("refuses a publish that defines a name another agent defined in the same file", async () => {
1254+ it("refuses a push that defines a name another agent defined in the same file", async () => {
12551255 const { folders } = await project({ "a.ts": "export const x = 1;\n" }, "alice", "bob");
12561256 const [alice, bob] = [folders.alice!, folders.bob!];
12571257 write(alice, { "a.ts": "export const x = 1;\nexport function parseClassSet() {\n return 1;\n}\n" });
1258− assert.equal((await avcs(alice, "publish", "-m", "add parse")).exit, 0);
1258+ assert.equal((await avcs(alice, "push", "-m", "add parse")).exit, 0);
12591259 write(bob, { "a.ts": "export function parseClassSet() {\n return 2;\n}\nexport const x = 1;\n" });
12601260 // Sync brings alice's parse into bob's view, where it is defined twice: sync lists it, publish refuses.
1261− const synced = await main(["sync"], { cwd: bob, env: ENV, write: () => {} });
1261+ const synced = await main(["pull"], { cwd: bob, env: ENV, write: () => {} });
12621262 assert.match(
12631263 synced.stdout,
1264− /1 collision: a name defined twice needs one definition kept before you publish\.\n/,
1264+ /1 collision: a name defined twice needs one definition kept before you push\.\n/,
12651265 "no talk of both sides' lines: none changed",
12661266 );
12671267 // Where each definition is: the declaration line, or (engine after e94f772) the whole definition.
12681268 assert.match(
12691269 synced.stdout,
1270− /a\.ts: parseClassSet is defined twice, yours \((line 1|lines 1-3)\) and alice's from version 1 \("add parse"\) \((line 5|lines 5-7)\)\. Keep one, then publish\./,
1270+ /a\.ts: parseClassSet is defined twice, yours \((line 1|lines 1-3)\) and alice's from version 1 \("add parse"\) \((line 5|lines 5-7)\)\. Keep one, then push\./,
12711271 );
1272− const refused = await main(["publish", "-m", "my parse"], { cwd: bob, env: ENV, write: () => {} });
1272+ const refused = await main(["push", "-m", "my parse"], { cwd: bob, env: ENV, write: () => {} });
12731273 assert.equal(refused.exit, 2, refused.stdout + refused.stderr);
1274− assert.match(refused.stdout, /^Not published: 1 collision\.\n {2}a\.ts: parseClassSet is defined twice/);
1274+ assert.match(refused.stdout, /^Not pushed: 1 collision\.\n {2}a\.ts: parseClassSet is defined twice/);
12751275 assert.match(
12761276 refused.stdout,
1277− /\nKeep one definition of each name defined twice \(delete yours, or theirs\), then publish again\.\n$/,
1277+ /\nKeep one definition of each name defined twice \(delete yours, or theirs\), then push again\.\n$/,
12781278 );
12791279 });
12801280});
Lines 1333–1339 at 100 (were 1333–1339 at 99)
13331333 const files = Object.fromEntries([...HOSTILE.map((p) => [p, "pwned\n"] as const), ["fine/new.txt", "fine\n"]]);
13341334 const parent = dirname(bob);
13351335 fake.injectSync = { files };
1336− const sync = await main(["sync", "--json"], { cwd: bob, env: ENV, write: () => {} });
1336+ const sync = await main(["pull", "--json"], { cwd: bob, env: ENV, write: () => {} });
13371337 const json = JSON.parse(sync.stdout);
13381338 assert.equal(json.ok, true, sync.stdout);
13391339 assert.deepEqual(json.refused.map((r: { path: string }) => r.path).sort(), [...HOSTILE].sort());
Lines 1345–1351 at 100 (were 1345–1351 at 99)
13451345 assert.equal(existsSync(join(bob, ".claude")), false);
13461346 assert.equal(existsSync(join(bob, "abs.txt")), false);
13471347 fake.injectSync = { files };
1348− const text = await main(["sync"], { cwd: folders.carol!, env: ENV, write: () => {} });
1348+ const text = await main(["pull"], { cwd: folders.carol!, env: ENV, write: () => {} });
13491349 assert.match(text.stdout, /REFUSED 15 paths from the server, and wrote nothing there/);
13501350 assert.match(text.stdout, /\n {2}"\.\.\/escape\.txt": it has a "\.\." part\n/);
13511351 assert.match(
Lines 1414–1420 at 100 (were 1414–1420 at 99)
14141414 fake.injectSync = {
14151415 files: { "CLAUDE~1/settings.json": '{"hooks":"pwned"}\n', "GIT~1/config": "pwned\n", "fine.txt": "fine\n" },
14161416 };
1417− const json = JSON.parse((await main(["sync", "--json"], { cwd: bob, env: ENV, write: () => {} })).stdout);
1417+ const json = JSON.parse((await main(["pull", "--json"], { cwd: bob, env: ENV, write: () => {} })).stdout);
14181418 assert.deepEqual(json.refused.map((r: { path: string }) => r.path).sort(), [
14191419 "CLAUDE~1/settings.json",
14201420 "GIT~1/config",
Lines 1446–1474 at 100 (were 1446–1474 at 99)
14461446 assert.deepEqual(readdirSync(dir), ["a.txt"], "the temporary file is gone");
14471447 });
14481448
1449− it("a write the disk refuses is named, and the rest of the sync still lands", async () => {
1449+ it("a write the disk refuses is named, and the rest of the pull still lands", async () => {
14501450 const { folders } = await project({ "ok.txt": "ok\n" }, "alice", "bob");
14511451 const bob = folders.bob!;
14521452 // "block" is a file here, so block/x.txt can't be written; z.txt after it still is.
14531453 write(bob, { block: "a file, not a folder\n" });
14541454 fake.injectSync = { files: { "block/x.txt": "x\n", "z.txt": "z\n" } };
1455− const sync = await main(["sync", "--json"], { cwd: bob, env: ENV, write: () => {} });
1455+ const sync = await main(["pull", "--json"], { cwd: bob, env: ENV, write: () => {} });
14561456 const json = JSON.parse(sync.stdout);
14571457 assert.equal(json.ok, true, sync.stdout + sync.stderr);
14581458 assert.equal(json.refused.length, 1);
14591459 assert.equal(json.refused[0].path, "block/x.txt");
14601460 assert.match(json.refused[0].why, /^writing it here failed \(/);
1461− assert.equal(read(bob, "z.txt"), "z\n", "the rest of the sync still lands");
1461+ assert.equal(read(bob, "z.txt"), "z\n", "the rest of the pull still lands");
14621462
14631463 // Remembered (#51): no later sync sends it again, so status and every sync name it until a write works.
14641464 const stale =
1465− /Stale here: a sync couldn't write this file, and no later sync sends it again\. Close whatever holds it, then abso sync --full: block\/x\.txt \(version \d+: [A-Z]+\)/;
1465+ /Stale here: a pull couldn't write this file, and no later pull sends it again\. Close whatever holds it, then abso pull --full: block\/x\.txt \(version \d+: [A-Z]+\)/;
14661466 assert.match((await main(["status"], { cwd: bob, env: ENV, write: () => {} })).stdout, stale);
1467− const again = await main(["sync"], { cwd: bob, env: ENV, write: () => {} });
1467+ const again = await main(["pull"], { cwd: bob, env: ENV, write: () => {} });
14681468 assert.match(again.stdout, stale);
14691469 rmSync(join(bob, "block"));
14701470 fake.injectSync = { files: { "block/x.txt": "x\n" } };
1471− assert.equal((await main(["sync"], { cwd: bob, env: ENV, write: () => {} })).exit, 0);
1471+ assert.equal((await main(["pull"], { cwd: bob, env: ENV, write: () => {} })).exit, 0);
14721472 assert.equal(read(bob, "block/x.txt"), "x\n");
14731473 assert.doesNotMatch((await main(["status"], { cwd: bob, env: ENV, write: () => {} })).stdout, /Stale here/);
14741474 });
Lines 1480–1486 at 100 (were 1480–1486 at 99)
14801480 files: { up: "", "in-folder": "" },
14811481 modes: { up: { link: "../../.ssh" }, "in-folder": { link: "ok.txt" } },
14821482 };
1483− const json = JSON.parse((await main(["sync", "--json"], { cwd: bob, env: ENV, write: () => {} })).stdout);
1483+ const json = JSON.parse((await main(["pull", "--json"], { cwd: bob, env: ENV, write: () => {} })).stdout);
14841484 assert.deepEqual(json.refused, [{ path: "up", why: "it links to ../../.ssh, outside this folder" }]);
14851485 assert.equal(existsSync(join(bob, "up")), false);
14861486
Lines 1631–1640 at 100 (were 1631–1640 at 99)
16311631 const { folders } = await project({ "v.txt": "one\n", "show.js": SHOW }, "alice");
16321632 const alice = folders.alice!;
16331633 write(alice, { "v.txt": "two\n" });
1634− assert.equal((await avcs(alice, "publish", "-m", "two")).exit, 0);
1634+ assert.equal((await avcs(alice, "push", "-m", "two")).exit, 0);
16351635 write(alice, { "v.txt": "three\n", "new.txt": "n\n" });
1636− assert.equal((await avcs(alice, "publish", "-m", "three, and new")).exit, 0);
1637− write(alice, { "v.txt": "four, unpublished\n" });
1636+ assert.equal((await avcs(alice, "push", "-m", "three, and new")).exit, 0);
1637+ write(alice, { "v.txt": "four, unpushed\n" });
16381638 const run = async (...a: string[]) => {
16391639 let out = "";
16401640 let err = "";
Lines 1648–1654 at 100 (were 1648–1654 at 99)
16481648 };
16491649
16501650 const now = await run("node", "show.js");
1651− assert.equal(now.out, "four, unpublished new -\n");
1651+ assert.equal(now.out, "four, unpushed new -\n");
16521652 const v1 = await run("--at", "1", "node", "show.js");
16531653 assert.equal(v1.out, "two no new 1\n", v1.err);
16541654 assert.match(v1.err, /^abso: running version 1 of shared in the box \(3 files\); your folder is untouched\.\n/);
Lines 1663–1669 at 100 (were 1663–1669 at 99)
16631663 assert.equal(gone.out, "two no new 1 files new.txt,v.txt\n", gone.err);
16641664 assert.match(gone.err, /left out, not there at version 1: new\.txt/);
16651665
1666− assert.equal(read(alice, "v.txt"), "four, unpublished\n", "the folder is untouched");
1666+ assert.equal(read(alice, "v.txt"), "four, unpushed\n", "the folder is untouched");
16671667 assert.equal((await avcs(alice, "record")).json.sent, 0, "nothing old was recorded");
16681668 assert.equal((await run("--files", "v.txt", "node", "show.js")).exit, 1);
16691669 assert.equal((await run("--at", "two", "node", "show.js")).exit, 1);
Lines 1698–1713 at 100 (were 1698–1713 at 99)
16981698 assert.equal(hooked.outcome, "skipped: recording is paused (abso resume)");
16991699 const record = await avcs(alice, "record");
17001700 assert.equal(record.exit, 2);
1701− const publish = await main(["publish", "-m", "nothing"], { cwd: alice, env: ENV, write: () => {} });
1701+ const publish = await main(["push", "-m", "nothing"], { cwd: alice, env: ENV, write: () => {} });
17021702 assert.match(
17031703 publish.stdout,
1704− /^Recording is paused \(abso resume\): your folder's changes were not sent first\.\nNothing to publish/,
1704+ /^Recording is paused \(abso resume\): your folder's changes were not sent first\.\nNothing to push/,
17051705 );
17061706 assert.equal(shared(name)["a.txt"], "one\n");
17071707 assert.match((await main(["resume"], { cwd: alice, env: ENV, write: () => {} })).stdout, /^Recording again\./);
17081708 write(alice, { "b.txt": "b2\n" });
1709− const sent = await main(["publish", "-m", "now"], { cwd: alice, env: ENV, write: () => {} });
1710− assert.match(sent.stdout, /^Recorded first: 2 changed \(a\.txt, b\.txt\)\.\nPublished version 1\./);
1709+ const sent = await main(["push", "-m", "now"], { cwd: alice, env: ENV, write: () => {} });
1710+ assert.match(sent.stdout, /^Recorded first: 2 changed \(a\.txt, b\.txt\)\.\nPushed version 1\./);
17111711 assert.equal(shared(name)["a.txt"], "old copy\n");
17121712 });
17131713
Lines 1725–1760 at 100 (were 1725–1760 at 99)
17251725 });
17261726});
17271727
1728−describe("publish and sync say what happened to others' work (#37, the game trial)", () => {
1729− it("a publish on top of versions the folder lacks says nothing was overwritten", async () => {
1728+describe("push and pull say what happened to others' work (#37, the game trial)", () => {
1729+ it("a push on top of versions the folder lacks says nothing was overwritten", async () => {
17301730 const { folders } = await project({ "a.txt": "a\n", "b.txt": "b\n" }, "alice", "bob");
17311731 write(folders.bob!, { "a.txt": "a by bob\n" });
1732− assert.equal((await avcs(folders.bob!, "publish", "-m", "Pitch five")).exit, 0);
1732+ assert.equal((await avcs(folders.bob!, "push", "-m", "Pitch five")).exit, 0);
17331733 write(folders.alice!, { "b.txt": "b by alice\n" });
1734− const r = await main(["publish", "-m", "mine"], { cwd: folders.alice!, env: ENV, write: () => {} });
1734+ const r = await main(["push", "-m", "mine"], { cwd: folders.alice!, env: ENV, write: () => {} });
17351735 assert.match(
17361736 r.stdout,
1737− /Published version 2\. It went on top of version 1 \(bob: "Pitch five"\), which your folder doesn't have yet\. Nothing of theirs was overwritten; run abso sync to see both\.\n/,
1737+ /Pushed version 2\. It went on top of version 1 \(bob: "Pitch five"\), which your folder doesn't have yet\. Nothing of theirs was overwritten; run abso pull to see both\.\n/,
17381738 );
17391739 });
17401740
1741− it("lines changed on both sides: sync writes a marker block, publish refuses it, --as-is keeps both (#11)", async () => {
1741+ it("lines changed on both sides: pull writes a marker block, push refuses it, --as-is keeps both (#11)", async () => {
17421742 const { folders } = await project({ "a.txt": "one\ntwo\nthree\n" }, "alice", "bob");
17431743 write(folders.bob!, { "a.txt": "one\nTWO by bob\nthree\n" });
1744− assert.equal((await avcs(folders.bob!, "publish", "-m", "bob")).exit, 0);
1744+ assert.equal((await avcs(folders.bob!, "push", "-m", "bob")).exit, 0);
17451745 write(folders.alice!, { "a.txt": "one\ntwo by alice\nthree\n" });
1746− const synced = await main(["sync"], { cwd: folders.alice!, env: ENV, write: () => {} });
1746+ const synced = await main(["pull"], { cwd: folders.alice!, env: ENV, write: () => {} });
17471747 assert.match(synced.stdout, /1 collision: where lines changed on both sides, the file now holds a marker block/);
17481748 assert.equal(
17491749 read(folders.alice!, "a.txt"),
17501750 'one\n<<<<<<< yours (unpublished)\ntwo by alice\n||||||| before (version 0)\ntwo\n=======\nTWO by bob\n>>>>>>> theirs: bob, version 1 "bob"\nthree\n',
17511751 );
1752− const refused = await main(["publish", "-m", "both kept"], { cwd: folders.alice!, env: ENV, write: () => {} });
1752+ const refused = await main(["push", "-m", "both kept"], { cwd: folders.alice!, env: ENV, write: () => {} });
17531753 assert.equal(refused.exit, 2);
17541754 assert.equal(
1755− (await avcs(folders.alice!, "publish", "-m", "both kept", "--as-is")).exit,
1755+ (await avcs(folders.alice!, "push", "-m", "both kept", "--as-is")).exit,
17561756 0,
1757− "--as-is publishes both and settles it",
1757+ "--as-is pushes both and settles it",
17581758 );
17591759 assert.equal(read(folders.alice!, "a.txt"), "one\ntwo by alice\nTWO by bob\nthree\n");
17601760 });
Lines 1763–1771 at 100 (were 1763–1771 at 99)
17631763 const { folders } = await project({ "a.txt": "one\ntwo\nthree\n", "b.txt": "b\n" }, "alice", "bob");
17641764 const [alice, bob] = [folders.alice!, folders.bob!];
17651765 write(bob, { "a.txt": "one\nTWO by bob\nthree\n" });
1766− assert.equal((await avcs(bob, "publish", "-m", "Bob says TWO")).exit, 0);
1766+ assert.equal((await avcs(bob, "push", "-m", "Bob says TWO")).exit, 0);
17671767 write(alice, { "a.txt": "one\ntwo by alice\nthree\n" });
1768− const synced = await main(["sync"], { cwd: alice, env: ENV, write: () => {} });
1768+ const synced = await main(["pull"], { cwd: alice, env: ENV, write: () => {} });
17691769 assert.match(
17701770 synced.stdout,
17711771 /Box runs fail while markers are in the folder\.\n {2}a\.txt lines 2-8: yours against bob's version 1 \("Bob says TWO"\)\.\n/,
Lines 1773–1785 at 100 (were 1773–1785 at 99)
17731773 const status = await main(["status"], { cwd: alice, env: ENV, write: () => {} });
17741774 assert.match(
17751775 status.stdout,
1776− /\n1 collision to settle before you publish \(keep yours, theirs or a mix and delete the marker lines, or abso settle <file> --yours\|--theirs\|--both\):\n {2}a\.txt lines 2-8, with bob's version 1 \("Bob says TWO"\)\n/,
1776+ /\n1 collision to settle before you push \(keep yours, theirs or a mix and delete the marker lines, or abso settle <file> --yours\|--theirs\|--both\):\n {2}a\.txt lines 2-8, with bob's version 1 \("Bob says TWO"\)\n/,
17771777 );
1778− const refused = await main(["publish", "-m", "mine"], { cwd: alice, env: ENV, write: () => {} });
1778+ const refused = await main(["push", "-m", "mine"], { cwd: alice, env: ENV, write: () => {} });
17791779 assert.equal(refused.exit, 2);
17801780 assert.match(
17811781 refused.stdout,
1782− /Not published: a\.txt still has collision markers \(1 block\)\.\n {2}a\.txt lines 2-8: yours against bob's version 1 \("Bob says TWO"\)\.\nSettle each: keep yours, theirs or a mix and delete the marker lines, or abso settle <file> --yours\|--theirs\|--both\./,
1782+ /Not pushed: a\.txt still has collision markers \(1 block\)\.\n {2}a\.txt lines 2-8: yours against bob's version 1 \("Bob says TWO"\)\.\nSettle each: keep yours, theirs or a mix and delete the marker lines, or abso settle <file> --yours\|--theirs\|--both\./,
17831783 );
17841784 // Settle: a file with no markers is refused, and settles nothing.
17851785 assert.match(
Lines 1803–1809 at 100 (were 1803–1809 at 99)
18031803 [],
18041804 );
18051805 write(alice, { "b.txt": "b by alice\n" });
1806− const published = await main(["publish", "-m", "Alice"], { cwd: alice, env: ENV, write: () => {} });
1806+ const published = await main(["push", "-m", "Alice"], { cwd: alice, env: ENV, write: () => {} });
18071807 assert.equal(published.exit, 0, published.stdout + published.stderr);
18081808 assert.match(
18091809 published.stdout,
Lines 1812–1830 at 100 (were 1812–1830 at 99)
18121812 const heard = await avcs(bob, "news");
18131813 assert.match(
18141814 JSON.stringify(heard.json),
1815− /alice settled its collision with your version 1 in a\.txt, publishing version 2: it kept your lines\. abso show 2:a\.txt shows the file\./,
1815+ /alice settled its collision with your version 1 in a\.txt, pushing version 2: it kept your lines\. abso show 2:a\.txt shows the file\./,
18161816 );
18171817 });
18181818
18191819 it("a settle that loses lines both sides had says which, under the Settled line (#37)", async () => {
18201820 const { folders } = await project({ "a.txt": "one\nx\nthree\n" }, "alice", "bob");
18211821 write(folders.bob!, { "a.txt": "one\nB1\nshared line\nthree\n" });
1822− assert.equal((await avcs(folders.bob!, "publish", "-m", "bob")).exit, 0);
1822+ assert.equal((await avcs(folders.bob!, "push", "-m", "bob")).exit, 0);
18231823 write(folders.alice!, { "a.txt": "one\nA1\nshared line\nthree\n" });
1824− assert.equal((await avcs(folders.alice!, "sync")).exit, 0);
1824+ assert.equal((await avcs(folders.alice!, "pull")).exit, 0);
18251825 // Settled by hand, keeping only A1: "shared line", which both had, is gone.
18261826 write(folders.alice!, { "a.txt": "one\nA1\nthree\n" });
1827− const r = await main(["publish", "-m", "mine"], { cwd: folders.alice!, env: ENV, write: () => {} });
1827+ const r = await main(["push", "-m", "mine"], { cwd: folders.alice!, env: ENV, write: () => {} });
18281828 assert.equal(r.exit, 0, r.stdout + r.stderr);
18291829 assert.match(r.stdout, /\n {2}a\.txt: lost 1 line you both had: "shared line"; check abso show 2:a\.txt\n/);
18301830 });
Lines 1832–1843 at 100 (were 1832–1843 at 99)
18321832 it("a marker line left behind after settling is named on its own line, to delete (#11)", async () => {
18331833 const { folders } = await project({ "a.txt": "one\ntwo\nthree\n" }, "alice", "bob");
18341834 write(folders.bob!, { "a.txt": "one\nTWO by bob\nthree\n" });
1835− assert.equal((await avcs(folders.bob!, "publish", "-m", "bob")).exit, 0);
1835+ assert.equal((await avcs(folders.bob!, "push", "-m", "bob")).exit, 0);
18361836 write(folders.alice!, { "a.txt": "one\ntwo by alice\nthree\n" });
1837− assert.equal((await avcs(folders.alice!, "sync")).exit, 0);
1837+ assert.equal((await avcs(folders.alice!, "pull")).exit, 0);
18381838 // Settled by hand, but one marker line stays.
18391839 write(folders.alice!, { "a.txt": 'one\ntwo by alice\n=======\n>>>>>>> theirs: bob, version 1 "bob"\nthree\n' });
1840− const refused = await main(["publish", "-m", "mine"], { cwd: folders.alice!, env: ENV, write: () => {} });
1840+ const refused = await main(["push", "-m", "mine"], { cwd: folders.alice!, env: ENV, write: () => {} });
18411841 assert.equal(refused.exit, 2);
18421842 assert.match(refused.stdout, /\n {2}a\.txt line 4: a marker line left from a collision; delete it\.\n/);
18431843 });
Lines 1887–1893 at 100 (were 1887–1893 at 99)
18871887 );
18881888 });
18891889
1890− it("screens the box's paths as a sync's: nothing outside the folder, in .git, or a link", async () => {
1890+ it("screens the box's paths as a pull's: nothing outside the folder, in .git, or a link", async () => {
18911891 const { folders } = await project({ "make.js": `${MAKE}\n` }, "alice");
18921892 const alice = folders.alice!;
18931893 writeFileSync(join(alice, ".absoignore"), `${read(alice, ".absoignore")}out/\n`);
Lines 1917–1923 at 100 (were 1917–1923 at 99)
19171917 rmSync(join(alice, "gone1.ts"));
19181918 rmSync(join(alice, "gone2.ts"));
19191919 write(alice, { "a.txt": "a2\n" });
1920− const synced = await main(["sync"], { cwd: alice, env: ENV, write: () => {} });
1920+ const synced = await main(["pull"], { cwd: alice, env: ENV, write: () => {} });
19211921 assert.match(synced.stdout, /^Recorded first: 1 changed \(a\.txt\), 2 deleted \(gone1\.ts, gone2\.ts\)\.\n/);
19221922 write(alice, { "a.txt": "a3\n" });
19231923 assert.match(
Lines 1935–1956 at 100 (were 1935–1956 at 99)
19351935 .map((e) => relative(dir, join(e.parentPath, e.name)).split(sep).join("/"))
19361936 .sort();
19371937
1938− it("writes one published version to its own folder, stamped, and leaves the folder and the agent alone", async () => {
1938+ it("writes one pushed version to its own folder, stamped, and leaves the folder and the agent alone", async () => {
19391939 const { folders } = await project(FILES, "alice", "tester");
19401940 write(folders.alice!, { "src/game.ts": "game v1\n", "src/new.ts": "new\n" });
19411941 rmSync(join(folders.alice!, "src", "old.ts"));
1942− assert.equal((await avcs(folders.alice!, "publish", "-m", "v1")).exit, 0);
1942+ assert.equal((await avcs(folders.alice!, "push", "-m", "v1")).exit, 0);
19431943 write(folders.alice!, { "src/game.ts": "game v2\n" });
1944− assert.equal((await avcs(folders.alice!, "publish", "-m", "v2")).exit, 0);
1944+ assert.equal((await avcs(folders.alice!, "push", "-m", "v2")).exit, 0);
19451945 const tester = folders.tester!;
1946− write(tester, { "index.html": "<p>mine, unpublished</p>\n" });
1946+ write(tester, { "index.html": "<p>mine, unpushed</p>\n" });
19471947 const out = join(temp(), "build");
19481948 const one = await avcs(tester, "export", out, "--version", "1");
19491949 assert.equal(one.exit, 0, one.out);
19501950 assert.equal(one.json.version, 1);
19511951 assert.deepEqual(listAll(out), [".abso-export", ".absoignore", "index.html", "src/game.ts", "src/new.ts"]);
19521952 assert.equal(read(out, "src/game.ts"), "game v1\n");
1953− assert.equal(read(out, "index.html"), "<p>v0</p>\n", "published files, not the unpublished edit");
1953+ assert.equal(read(out, "index.html"), "<p>v0</p>\n", "pushed files, not the unpushed edit");
19541954 // One line, no extension: the exported project's own formatter has nothing to say about it.
19551955 const stamp = read(out, ".abso-export");
19561956 assert.equal(stamp.split("\n").length, 2, stamp);
Lines 1979–1988 at 100 (were 1979–1988 at 99)
19791979 assert.equal(existsSync(join(out, "stray.txt")), false);
19801980 assert.equal(read(out, "src/game.ts"), "game v2\n");
19811981 // The folder is untouched, and so is the agent: still on version 0 with its unpublished edit.
1982− assert.equal(read(tester, "index.html"), "<p>mine, unpublished</p>\n");
1982+ assert.equal(read(tester, "index.html"), "<p>mine, unpushed</p>\n");
19831983 assert.equal(read(tester, "src/game.ts"), "game v0\n");
19841984 const short = await main(["status", "--short"], { cwd: tester, env: ENV, write: () => {} });
1985− assert.equal(short.stdout, "0+unpublished\n");
1985+ assert.equal(short.stdout, "0+unpushed\n");
19861986 });
19871987
19881988 it("refuses a folder with other files in it, and one inside the abso folder that abso would record", async () => {
Lines 2002–2011 at 100 (were 2002–2011 at 99)
20022002 assert.equal(read(folders.alice!, "build/src/game.ts"), "game v0\n");
20032003 });
20042004
2005− it("status --short is the version alone when the folder holds nothing unpublished", async () => {
2005+ it("status --short is the version alone when the folder holds nothing unpushed", async () => {
20062006 const { folders } = await project(FILES, "alice", "bob");
20072007 write(folders.alice!, { "src/game.ts": "game v1\n" });
2008− assert.equal((await avcs(folders.alice!, "publish", "-m", "v1")).exit, 0);
2008+ assert.equal((await avcs(folders.alice!, "push", "-m", "v1")).exit, 0);
20092009 assert.equal((await main(["status", "--short"], { cwd: folders.alice!, env: ENV, write: () => {} })).stdout, "1\n");
20102010 assert.equal((await main(["status", "--short"], { cwd: folders.bob!, env: ENV, write: () => {} })).stdout, "0\n");
20112011 });
Lines 2022–2028 at 100 (were 2022–2028 at 99)
20222022 it("a join under an agent name the server already knows writes every file, not only what changed since", async () => {
20232023 const { name, folders } = await project(FILES, "alice", "bob");
20242024 write(folders.alice!, { "src/main.ts": "main v1\n" });
2025− assert.equal((await avcs(folders.alice!, "publish", "-m", "v1")).exit, 0);
2025+ assert.equal((await avcs(folders.alice!, "push", "-m", "v1")).exit, 0);
20262026 const again = temp();
20272027 const joined = await avcs(again, "join", name, "--agent", "bob", "--server", fake.url);
20282028 assert.equal(joined.exit, 0, joined.out);
Lines 2032–2038 at 100 (were 2032–2038 at 99)
20322032 assert.deepEqual((await avcs(again, "status")).json.missing, []);
20332033 });
20342034
2035− it("status names files the folder lacks, files marks them, and sync --full writes them", async () => {
2035+ it("status names files the folder lacks, files marks them, and pull --full writes them", async () => {
20362036 const { folders } = await project(FILES, "alice", "bob");
20372037 const bob = folders.bob!;
20382038 // What a partial join leaves: neither the file nor avcs's copy of it.
Lines 2043–2055 at 100 (were 2043–2055 at 99)
20432043 const status = await main(["status"], { cwd: bob, env: ENV, write: () => {} });
20442044 assert.match(
20452045 status.stdout,
2046− /Everything in this folder is recorded\.\nMissing from this folder though your view has them \(abso sync --full writes them; abso files lists them all\): src\/state\.ts, vite\.config\.ts\n/,
2046+ /Everything in this folder is recorded\.\nMissing from this folder though your view has them \(abso pull --full writes them; abso files lists them all\): src\/state\.ts, vite\.config\.ts\n/,
20472047 );
20482048 const listed = await main(["files"], { cwd: bob, env: ENV, write: () => {} });
20492049 assert.equal(
20502050 listed.stdout,
20512051 [
2052− "Your view holds 5 files: shared at version 0, with your unpublished changes. 2 of them are missing from this folder (abso sync --full writes them).",
2052+ "Your view holds 5 files: shared at version 0, with your unpushed changes. 2 of them are missing from this folder (abso pull --full writes them).",
20532053 ".absoignore",
20542054 "src/main.ts",
20552055 "src/state.ts (missing from this folder)",
Lines 2060–2067 at 100 (were 2060–2067 at 99)
20602060 );
20612061 assert.deepEqual((await avcs(bob, "files", "src/**")).json.files, ["src/main.ts", "src/state.ts"]);
20622062 // A plain sync has nothing new to send; --full writes them.
2063− assert.equal((await avcs(bob, "sync")).json.written.length, 0);
2064− const full = await avcs(bob, "sync", "--full");
2063+ assert.equal((await avcs(bob, "pull")).json.written.length, 0);
2064+ const full = await avcs(bob, "pull", "--full");
20652065 assert.deepEqual(full.json.written.sort(), ["src/state.ts", "vite.config.ts"]);
20662066 assert.equal(read(bob, "vite.config.ts"), "vite\n");
20672067 const after = await avcs(bob, "status");
Lines 2069–2088 at 100 (were 2069–2088 at 99)
20692069 assert.deepEqual(after.json.unrecorded, []);
20702070 });
20712071
2072− it("a file deleted and not yet recorded is not called missing, and sync --full leaves the deletion alone", async () => {
2072+ it("a file deleted and not yet recorded is not called missing, and pull --full leaves the deletion alone", async () => {
20732073 const { folders } = await project(FILES, "alice", "bob");
20742074 rmSync(join(folders.bob!, "tools", "play.mjs"));
20752075 const status = await avcs(folders.bob!, "status");
20762076 assert.deepEqual(status.json.missing, []);
20772077 assert.deepEqual(status.json.unrecorded, ["tools/play.mjs"]);
2078− await avcs(folders.bob!, "sync", "--full");
2079− assert.equal(existsSync(join(folders.bob!, "tools", "play.mjs")), false, "sync records the deletion first");
2078+ await avcs(folders.bob!, "pull", "--full");
2079+ assert.equal(existsSync(join(folders.bob!, "tools", "play.mjs")), false, "pull records the deletion first");
20802080 });
20812081
20822082 it("files --draft shared --version N lists shared's files at that version", async () => {
20832083 const { folders } = await project(FILES, "alice", "bob");
20842084 write(folders.alice!, { "src/new.ts": "new\n" });
2085− assert.equal((await avcs(folders.alice!, "publish", "-m", "new")).exit, 0);
2085+ assert.equal((await avcs(folders.alice!, "push", "-m", "new")).exit, 0);
20862086 assert.equal((await avcs(folders.bob!, "files", "--version", "0")).json.files.length, 5, "4 files and .absoignore");
20872087 const now = await main(["files", "--draft", "shared"], { cwd: folders.bob!, env: ENV, write: () => {} });
20882088 assert.match(now.stdout, /^shared at version 1 holds 6 files\.\n/);
Lines 2090–2114 at 100 (were 2090–2118 at 99)
20902090 });
20912091});
20922092
2093−describe("lines merged item by item at sync (#37)", () => {
2094− it("names the merged line, so the agent reads it before publishing", async () => {
2093+describe("lines merged item by item at pull (#37)", () => {
2094+ it("names the merged line, so the agent reads it before pushing", async () => {
20952095 const { folders } = await project({ "src/main.ts": "const SYSTEMS = [input, physics, render];\n" }, "alice", "bob");
20962096 write(folders.bob!, { "src/main.ts": "const SYSTEMS = [input, physics, audio, render];\n" });
2097− assert.equal((await avcs(folders.bob!, "publish", "-m", "Audio system")).exit, 0);
2097+ assert.equal((await avcs(folders.bob!, "push", "-m", "Audio system")).exit, 0);
20982098 write(folders.alice!, { "src/main.ts": "const SYSTEMS = [input, physics, render, hud];\n" });
2099− const synced = await main(["sync"], { cwd: folders.alice!, env: ENV, write: () => {} });
2099+ const synced = await main(["pull"], { cwd: folders.alice!, env: ENV, write: () => {} });
21002100 assert.match(
21012101 synced.stdout,
2102− /\nMerged 1 line that both you and bob changed, item by item\. Check it reads right, then publish:\n {2}src\/main\.ts line 1, with bob's version 1 \("Audio system"\): const SYSTEMS = \[[^\]]*\];\n/,
2102+ /\nMerged 1 line that both you and bob changed, item by item\. Check it reads right, then push:\n {2}src\/main\.ts line 1, with bob's version 1 \("Audio system"\): const SYSTEMS = \[[^\]]*\];\n/,
21032103 );
21042104 const text = read(folders.alice!, "src/main.ts");
21052105 assert.match(text, /audio/);
21062106 assert.match(text, /hud/);
2107− assert.equal(
2108− (await avcs(folders.alice!, "publish", "-m", "hud")).exit,
2109− 0,
2110− "a merged line does not hold up a publish",
2111− );
2107+ assert.equal((await avcs(folders.alice!, "push", "-m", "hud")).exit, 0, "a merged line does not hold up a push");
21122108 });
21132109});
21142110
2115−describe("a failing publish --check says whose it is (#36)", () => {
2111+describe("a failing push --check says whose it is (#36)", () => {
21162112 const CHECK =
21172113 "const fs = require('fs'); const t = fs.readFileSync('state.txt', 'utf8') + fs.readFileSync('mine.txt', 'utf8'); process.exit(t.includes('bad') ? 1 : 0);\n";
21182114
Lines 2119–2127 at 100 (were 2123–2131 at 99)
21232119 "bob",
21242120 );
21252121 write(folders.bob!, { "state.txt": "bad, by bob\n" });
2126− assert.equal((await avcs(folders.bob!, "publish", "-m", "Bob breaks the test")).exit, 0);
2122+ assert.equal((await avcs(folders.bob!, "push", "-m", "Bob breaks the test")).exit, 0);
21272123 write(folders.alice!, { "a.txt": "a by alice\n" });
2128− const theirs = await main(["publish", "-m", "mine", "--check", "node check.cjs"], {
2124+ const theirs = await main(["push", "-m", "mine", "--check", "node check.cjs"], {
21292125 cwd: folders.alice!,
21302126 env: ENV,
21312127 write: () => {},
Lines 2134–2142 at 100 (were 2138–2146 at 99)
21382134 );
21392135 // bob fixes it; now alice's own draft is what breaks it.
21402136 write(folders.bob!, { "state.txt": "ok again\n" });
2141− assert.equal((await avcs(folders.bob!, "publish", "-m", "Bob fixes it")).exit, 0);
2137+ assert.equal((await avcs(folders.bob!, "push", "-m", "Bob fixes it")).exit, 0);
21422138 write(folders.alice!, { "mine.txt": "bad, by alice\n" });
2143− const mine = await main(["publish", "-m", "mine", "--check", "node check.cjs"], {
2139+ const mine = await main(["push", "-m", "mine", "--check", "node check.cjs"], {
21442140 cwd: folders.alice!,
21452141 env: ENV,
21462142 write: () => {},
Lines 2158–2194 at 100 (were 2162–2198 at 99)
21622158 };
21632159 const publish = async (cwd: string, ...more: string[]) => {
21642160 let err = "";
2165− const r = await main(["publish", ...more], { cwd, env: QENV, write: () => {}, writeErr: (t) => (err += t) });
2161+ const r = await main(["push", ...more], { cwd, env: QENV, write: () => {}, writeErr: (t) => (err += t) });
21662162 return { ...r, err };
21672163 };
21682164
2169− it("publish waits for its publish to land, or to be pulled with the check's output", async () => {
2165+ it("push waits for its push to land, or to be turned back with the check's output", async () => {
21702166 const { folders } = await project(files, "alice", "bob");
21712167 write(folders.alice!, { "state.txt": "ok, by alice\n" });
21722168 const landed = await publish(folders.alice!, "-m", "fine");
21732169 assert.equal(landed.exit, 0, landed.stdout + landed.stderr);
21742170 assert.equal(
21752171 landed.stdout,
2176− "Recorded first: 1 changed (state.txt).\nPublished version 1: it passed the project's check in the merge queue.\n",
2172+ "Recorded first: 1 changed (state.txt).\nPushed version 1: it passed the project's check in the merge queue.\n",
21772173 );
21782174 assert.match(
21792175 landed.err,
2180− /^abso: Queued as publish 1: it lands once the project's check passes on it in the merge queue\. Waiting up to 100 s for it \(--no-wait returns at once\)\.\n/,
2176+ /^abso: Queued as push 1: it lands once the project's check passes on it in the merge queue\. Waiting up to 100 s for it \(--no-wait returns at once\)\.\n/,
21812177 );
21822178 assert.doesNotMatch(landed.stdout, /landed as version/, "the outcome is said once, not again as news");
21832179
2184− await avcs(folders.bob!, "sync");
2180+ await avcs(folders.bob!, "pull");
21852181 write(folders.bob!, { "state.txt": "bad, by bob\n" });
21862182 const pulled = await publish(folders.bob!, "-m", "breaks it");
21872183 assert.equal(pulled.exit, 2, pulled.stdout + pulled.stderr);
21882184 assert.equal(
21892185 pulled.stdout,
2190− `Recorded first: 1 changed (state.txt).\nNot published: your queued publish "breaks it" was pulled: the project's check failed on it on top of version 1. Its changes are still in your draft; fix them, then publish again.\n`,
2186+ `Recorded first: 1 changed (state.txt).\nNot pushed: your queued push "breaks it" was turned back: the project's check failed on it on top of version 1. Its changes are still in your draft; fix them, then push again.\n`,
21912187 );
21922188 assert.equal((await avcs(folders.bob!, "status")).json.version, 1, "shared stayed at version 1");
21932189 });
21942190
2195− it("--done takes the start note back only once the queued publish lands", async () => {
2191+ it("--done takes the start note back only once the queued push lands", async () => {
21962192 const { folders } = await project(files, "alice");
21972193 const noted = async () =>
21982194 /Starting on:/.test((await main(["where"], { cwd: folders.alice!, env: QENV, write: () => {} })).stdout);
Lines 2200–2208 at 100 (were 2204–2212 at 99)
22042200 assert.equal(queued.exit, 0, queued.stdout + queued.stderr);
22052201 assert.match(
22062202 queued.stdout,
2207− /\nYour start note stays \(--done\): publish 1 hasn't landed yet\. Once it has, abso start --done takes the note back and abso issue <N> --done closes the issue it names\.\n$/,
2203+ /\nYour start note stays \(--done\): push 1 hasn't landed yet\. Once it has, abso start --done takes the note back and abso issue <N> --done closes the issue it names\.\n$/,
22082204 );
2209− assert.equal(await noted(), true, "a queued publish may yet be pulled");
2205+ assert.equal(await noted(), true, "a queued push may yet be turned back");
22102206 assert.equal((await main(["unqueue"], { cwd: folders.alice!, env: QENV, write: () => {} })).exit, 0);
22112207 } finally {
22122208 fake.queueHold = false;
Lines 2211–2228 at 100 (were 2215–2232 at 99)
22152211 const pulled = await publish(folders.alice!, "-m", "breaks it", "--done");
22162212 assert.equal(pulled.exit, 2, pulled.stdout + pulled.stderr);
22172213 assert.doesNotMatch(pulled.stdout, /start note/);
2218− assert.equal(await noted(), true, "a pulled publish leaves the note");
2214+ assert.equal(await noted(), true, "a pulled push leaves the note");
22192215 write(folders.alice!, { "state.txt": "ok, fixed\n" });
22202216 const landed = await publish(folders.alice!, "-m", "fixed", "--done");
22212217 assert.equal(landed.exit, 0, landed.stdout + landed.stderr);
22222218 assert.match(
22232219 landed.stdout,
2224− /\nPublished version 1: it passed the project's check in the merge queue\.\nYour start note is taken back \(--done\): this work is finished\.\n$/,
2220+ /\nPushed version 1: it passed the project's check in the merge queue\.\nYour start note is taken back \(--done\): this work is finished\.\n$/,
22252221 );
22262222 assert.equal(await noted(), false);
22272223 });
22282224
2229− it("--no-wait and --wait, status shows the queue, unqueue takes it back, and a collision names the queued publish", async () => {
2225+ it("--no-wait and --wait, status shows the queue, unqueue takes it back, and a collision names the queued push", async () => {
22302226 const { folders } = await project(files, "alice", "bob");
22312227 fake.queueHold = true;
22322228 try {
Lines 2231–2243 at 100 (were 2235–2247 at 99)
22352231 assert.equal(queued.exit, 0, queued.stdout + queued.stderr);
22362232 assert.match(
22372233 queued.stdout,
2238− /^Recorded first: 1 changed \(other\.txt\)\.\nQueued as publish 1: it lands once the project's check passes on it in the merge queue\.\nNot waiting \(--no-wait\)\. The outcome comes as news on your next edit; abso status shows the queue, and abso unqueue takes it back\.\n$/,
2234+ /^Recorded first: 1 changed \(other\.txt\)\.\nQueued as push 1: it lands once the project's check passes on it in the merge queue\.\nNot waiting \(--no-wait\)\. The outcome comes as news on your next edit; abso status shows the queue, and abso unqueue takes it back\.\n$/,
22392235 );
22402236 const status = await main(["status"], { cwd: folders.alice!, env: QENV, write: () => {} });
22412237 assert.match(status.stdout, /\nMerge queue: waiting: yours \(1\)\.\n/);
22422238 assert.equal(
22432239 (await main(["status", "--short"], { cwd: folders.alice!, env: QENV, write: () => {} })).stdout,
2244− "0+unpublished+queued\n",
2240+ "0+unpushed+queued\n",
22452241 );
22462242 // waiting --mine lists it beside the asks (an Issues stand-in with none open).
22472243 const stub = createHttpServer((_req, res) =>
Lines 2254–2260 at 100 (were 2258–2264 at 99)
22582254 assert.equal(waiting.exit, 0, waiting.stdout + waiting.stderr);
22592255 assert.match(
22602256 waiting.stdout,
2261− /^Your publish 1 \("two"\) is in the merge queue: [^\n]+\.\nIt lands or is pulled once the project's check runs on it; the outcome comes as news, and abso unqueue takes it back\.\nNo open asks of alice\.\n$/,
2257+ /^Your push 1 \("two"\) is in the merge queue: [^\n]+\.\nIt lands or is turned back once the project's check runs on it; the outcome comes as news, and abso unqueue takes it back\.\nNo open asks of alice\.\n$/,
22622258 );
22632259 } finally {
22642260 await new Promise((ok) => stub.close(ok));
Lines 2264–2270 at 100 (were 2268–2274 at 99)
22682264 write(folders.bob!, { "other.txt": "two, by bob\n" });
22692265 const refused = await publish(folders.bob!, "-m", "mine");
22702266 assert.equal(refused.exit, 2);
2271− assert.match(refused.stdout, /theirs, by alice in queued publish 1 \(not landed yet\) \("two"\)/);
2267+ assert.match(refused.stdout, /theirs, by alice in queued push 1 \(not landed yet\) \("two"\)/);
22722268 assert.match(refused.stdout, /\nSome of theirs are still in the merge queue, not in shared: once they land/);
22732269
22742270 write(folders.alice!, { "state.txt": "ok again\n" });
Lines 2272–2287 at 100 (were 2276–2294 at 99)
22762272 assert.equal(still.exit, 3, still.stdout + still.stderr);
22772273 assert.match(
22782274 still.stdout,
2279− /^Recorded first: 1 changed \(state\.txt\)\.\nStill queued after 1 s: publish 2 is waiting, 1 publish ahead of it\. The outcome comes as news/,
2275+ /^Recorded first: 1 changed \(state\.txt\)\.\nStill queued after 1 s: push 2 is waiting, 1 push ahead of it\. The outcome comes as news/,
22802276 );
22812277 assert.match(
22822278 still.err,
2283− /^abso: Queued as publish 2, 1 publish ahead of it: [^\n]*\nabso: your publish is waiting, 1 publish ahead of it\.\n/,
2279+ /^abso: Queued as push 2, 1 push ahead of it: [^\n]*\nabso: your push is waiting, 1 push ahead of it\.\n/,
22842280 );
22852281
22862282 const back = await main(["unqueue"], { cwd: folders.alice!, env: QENV, write: () => {} });
22872283 assert.equal(back.exit, 0, back.stdout + back.stderr);
2288− assert.equal(
2289− back.stdout,
2290− "Took back queued publishes 1, 2: their changes are still in your draft, unpublished.\n",
2291− );
2284+ assert.equal(back.stdout, "Took back queued pushes 1, 2: their changes are still in your draft, unpushed.\n");
22922285 const none = await main(["unqueue"], { cwd: folders.alice!, env: QENV, write: () => {} });
22932286 assert.equal(none.exit, 1);
22942287 assert.match(none.stderr, /alice has nothing queued/);
Lines 2291–2317 at 100 (were 2298–2324 at 99)
22982291 });
22992292
23002293 it("a pull puts the check's output first and the verdict last", () => {
2301− const news = `Your queued publish "breaks it" was pulled: the project's check failed on it on top of version 1:\n== check\n== check exited 1\n. Its changes are still in your draft.`;
2294+ const news = `Your queued push "breaks it" was turned back: the project's check failed on it on top of version 1:\n== check\n== check exited 1\n. Its changes are still in your draft.`;
23022295 assert.equal(
23032296 pulledText(news),
2304− `The check's output ends:\n== check\n== check exited 1\nNot published: your queued publish "breaks it" was pulled: the project's check failed on it on top of version 1. Its changes are still in your draft; fix them, then publish again.`,
2297+ `The check's output ends:\n== check\n== check exited 1\nNot pushed: your queued push "breaks it" was turned back: the project's check failed on it on top of version 1. Its changes are still in your draft; fix them, then push again.`,
23052298 );
23062299 assert.equal(
23072300 pulledText(
2308− 'Your queued publish "x" was pulled: it builds on queued publish 3, which was pulled. Its changes are still in your draft.',
2301+ 'Your queued push "x" was turned back: it builds on queued push 3, which was turned back. Its changes are still in your draft.',
23092302 ),
2310− 'Not published: your queued publish "x" was pulled: it builds on queued publish 3, which was pulled. Its changes are still in your draft; fix them, then publish again.',
2303+ 'Not pushed: your queued push "x" was turned back: it builds on queued push 3, which was turned back. Its changes are still in your draft; fix them, then push again.',
23112304 );
23122305 });
23132306
2314− it("--check alone skipped for a queue that is only in the draft says the publish landed directly, unchecked", async () => {
2307+ it("--check alone skipped for a queue that is only in the draft says the push landed directly, unchecked", async () => {
23152308 const { folders } = await project({ "avcs.json": '{"check": "node -e 0"}\n', "a.txt": "a\n" }, "alice");
23162309 write(folders.alice!, { "avcs.json": '{"check": "node -e 0", "queue": true}\n' });
23172310 const r = await publish(folders.alice!, "-m", "turn the queue on", "--check");
23182311 assert.equal(r.exit, 0, r.stdout + r.stderr);
23192312 assert.match(
23202313 r.stdout,
2321− /\nPublished version 1\.\nIt 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\./,
2314+ /\nPushed version 1\.\nIt 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\./,
23222315 );
23232316 });
23242317
Lines 2324–2330 at 100 (were 2331–2337 at 99)
23312324 assert.equal(fake.runStarts.length, startsBefore, "no box run");
23322325 assert.match(
23332326 r.stdout,
2334− /^Recorded first: 1 changed \(other\.txt\)\.\nThe merge queue runs the project's check on what lands, so --check alone was skipped\.\nPublished version 1: /,
2327+ /^Recorded first: 1 changed \(other\.txt\)\.\nThe merge queue runs the project's check on what lands, so --check alone was skipped\.\nPushed version 1: /,
23352328 );
23362329 });
23372330});
Lines 2338–2344 at 100 (were 2345–2351 at 99)
23452338 const holder = spawn(process.execPath, ["-e", "setTimeout(() => {}, 20000)"]);
23462339 try {
23472340 // Renewed a minute ago, and its process runs: held.
2348− writeFileSync(lock, JSON.stringify({ pid: holder.pid, time: Date.now() - 60_000, what: "sync" }));
2341+ writeFileSync(lock, JSON.stringify({ pid: holder.pid, time: Date.now() - 60_000, what: "pull" }));
23492342 write(root, { "a.txt": "two\n" });
23502343 process.env.AVCS_LOCK_WAIT_MS = "200";
23512344 const blocked = await main(["record"], { cwd: root, env: ENV, write: () => {} });
Lines 2346–2352 at 100 (were 2353–2359 at 99)
23532346 assert.match(
23542347 blocked.stderr,
23552348 new RegExp(
2356− `another abso command \\(sync, process ${holder.pid}, since [0-9:]+ UTC\\) is changing this folder's records; run this again when it has finished\\. If none is running, delete \\.avcs/lock\\.`,
2349+ `another abso command \\(pull, process ${holder.pid}, since [0-9:]+ UTC\\) is changing this folder's records; run this again when it has finished\\. If none is running, delete \\.avcs/lock\\.`,
23572350 ),
23582351 );
23592352 const hooked = await hook(root, "Write", { file_path: join(root, "a.txt"), content: "two\n" });
Lines 2370–2379 at 100 (were 2377–2386 at 99)
23772370
23782371 it("the mod's check: a lock renewed in the last 2 minutes is held, and so is one it can't read", () => {
23792372 const now = Date.parse("2026-10-07T04:00:00Z");
2380− assert.equal(lockHeld(JSON.stringify({ pid: 1, time: now - 5_000, what: "sync" }), now), true);
2381− assert.equal(lockHeld(JSON.stringify({ pid: 1, time: now - 100_000, what: "sync" }), now), true);
2373+ assert.equal(lockHeld(JSON.stringify({ pid: 1, time: now - 5_000, what: "pull" }), now), true);
2374+ assert.equal(lockHeld(JSON.stringify({ pid: 1, time: now - 100_000, what: "pull" }), now), true);
23822375 assert.equal(
2383− lockHeld(JSON.stringify({ pid: 1, time: now - 3 * 60_000, what: "sync" }), now),
2376+ lockHeld(JSON.stringify({ pid: 1, time: now - 3 * 60_000, what: "pull" }), now),
23842377 false,
23852378 "not renewed: left behind",
23862379 );
Lines 2398–2404 at 100 (were 2405–2411 at 99)
24052398 letGo();
24062399 assert.equal(existsSync(lock), false);
24072400 // A running process's id (this one's), but not renewed for 3 minutes: left behind, as when a pid is reused.
2408− writeFileSync(lock, JSON.stringify({ pid: process.pid, time: Date.now() - 3 * 60_000, what: "sync" }));
2401+ writeFileSync(lock, JSON.stringify({ pid: process.pid, time: Date.now() - 3 * 60_000, what: "pull" }));
24092402 const again = tryFolderLock(root, "hook");
24102403 assert.ok(again);
24112404 again();
Lines 2411–2417 at 100 (were 2418–2424 at 99)
24182411});
24192412
24202413describe("files the server keeps whole (#46, found in the #56 import rehearsal)", () => {
2421− it("are recorded after init, and a sync brings another agent's change to one", async () => {
2414+ it("are recorded after init, and a pull brings another agent's change to one", async () => {
24222415 const files = {
24232416 "avcs.json": '{"whole": ["package-lock.json", "logs/**"]}\n',
24242417 "package-lock.json": '{\n "v": 1\n}\n',
Lines 2427–2435 at 100 (were 2434–2442 at 99)
24342427
24352428 write(folders.bob!, { "package-lock.json": '{\n "v": 2\n}\n' });
24362429 assert.deepEqual((await avcs(folders.bob!, "status")).json.unrecorded, ["package-lock.json"]);
2437− const published = await main(["publish", "-m", "lock two"], { cwd: folders.bob!, env: ENV, write: () => {} });
2430+ const published = await main(["push", "-m", "lock two"], { cwd: folders.bob!, env: ENV, write: () => {} });
24382431 assert.equal(published.exit, 0, published.stdout + published.stderr);
2439− const synced = await main(["sync"], { cwd: folders.alice!, env: ENV, write: () => {} });
2432+ const synced = await main(["pull"], { cwd: folders.alice!, env: ENV, write: () => {} });
24402433 assert.equal(synced.exit, 0, synced.stderr);
24412434 assert.equal(
24422435 readFileSync(join(folders.alice!, "package-lock.json"), "utf8"),
Lines 2453–2461 at 100 (were 2460–2468 at 99)
24602453 const { folders } = await project({ "a.ts": "one\ntwo\nthree\n" }, "alice", "bob");
24612454 assert.equal((await run(folders.alice!, "start", "Sign-in", "a.ts")).exit, 0);
24622455 write(folders.alice!, { "a.ts": "one\ntwo, checked\nthree\n" });
2463− assert.equal((await run(folders.alice!, "publish", "-m", "check two")).exit, 0);
2456+ assert.equal((await run(folders.alice!, "push", "-m", "check two")).exit, 0);
24642457 write(folders.alice!, { "a.ts": "one\ntwo, checked\nthree, too\n" });
2465− assert.equal((await run(folders.alice!, "publish", "-m", "and three", "--done")).exit, 0);
2458+ assert.equal((await run(folders.alice!, "push", "-m", "and three", "--done")).exit, 0);
24662459
24672460 const first = await run(folders.bob!, "review");
24682461 assert.equal(first.exit, 0, first.stderr);
Lines 2480–2486 at 100 (were 2487–2493 at 99)
24872480 assert.match((await run(folders.bob!, "review")).stdout, /^No changes lately/);
24882481 for (let i = 1; i <= 5; i++) {
24892482 write(folders.alice!, { "a.ts": `a${i}\n` });
2490− assert.equal((await run(folders.alice!, "publish", "-m", `p${i}`)).exit, 0);
2483+ assert.equal((await run(folders.alice!, "push", "-m", `p${i}`)).exit, 0);
24912484 }
24922485 process.env.AVCS_REVIEW_PAGE = "2";
24932486 try {
Lines 2626–2632 at 100 (were 2633–2639 at 99)
26332626 }
26342627 });
26352628
2636− it("waits for a publish and a land as long as the server may work on them, past the base timeout", async () => {
2629+ it("waits for a push and a land as long as the server may work on them, past the base timeout", async () => {
26372630 assert.ok(PUBLISH_TIMEOUT_MS > 120_000, "longer than the server's 2 minutes for one request");
26382631 // Every answer comes after 300 ms; the client's base timeout here is 100 ms.
26392632 const slow = createHttpServer((_req, res) => {
Lines 2662–2669 at 100 (were 2669–2676 at 99)
26692662 it("abso note leaves a note on the lines as your folder shows them, and replies and closing work", async () => {
26702663 const { folders } = await project({ "a.ts": "one\ntwo\nthree\n" }, "alice", "bob");
26712664 write(folders.alice!, { "a.ts": "one\ntwo, by alice\nthree\n" });
2672− assert.equal((await run(folders.alice!, "publish", "-m", "two")).exit, 0);
2673− await run(folders.bob!, "sync");
2665+ assert.equal((await run(folders.alice!, "push", "-m", "two")).exit, 0);
2666+ await run(folders.bob!, "pull");
26742667 // bob's own unpublished edit puts two lines on top: his line 4 is shared's line 2.
26752668 write(folders.bob!, { "a.ts": "zero\nzero again\none\ntwo, by alice\nthree\n" });
26762669 const noted = await run(folders.bob!, "note", "a.ts:4", "the state isn't checked", "--object");
Lines 2752–2762 at 100 (were 2759–2769 at 99)
27592752 inputSchema: { properties: Record<string, unknown> };
27602753 }[];
27612754 const names = tools.map((t) => t.name);
2762− for (const name of ["status", "log", "diff", "why", "publish", "check_ignore", "unqueue"])
2755+ for (const name of ["status", "log", "diff", "why", "push", "check_ignore", "unqueue"])
27632756 assert.ok(names.includes(name), name);
27642757 for (const name of ["run", "shot", "init", "hook", "drop"])
27652758 assert.ok(!names.includes(name), `${name} stays in the shell`);
2766− assert.ok("message" in tools.find((t) => t.name === "publish")!.inputSchema.properties);
2759+ assert.ok("message" in tools.find((t) => t.name === "push")!.inputSchema.properties);
27672760
27682761 write(folders.alice!, { "a.txt": "two\n" });
27692762 const status = await server.call("tools/call", { name: "status", arguments: {} });
Lines 2768–2777 at 100 (were 2775–2784 at 99)
27752768 assert.equal(JSON.parse(asJson.result.content[0].text).command, "status");
27762769
27772770 const published = await server.call("tools/call", {
2778− name: "publish",
2771+ name: "push",
27792772 arguments: { message: "two, through MCP" },
27802773 });
2781− assert.match(published.result.content[0].text, /Published version 1\./);
2774+ assert.match(published.result.content[0].text, /Pushed version 1\./);
27822775 const shown = await server.call("tools/call", { name: "show", arguments: { args: ["1"] } });
27832776 assert.match(shown.result.content[0].text, /^version 1 of shared by alice, [0-9 :-]+ UTC: two, through MCP\n/);
27842777 const bad = await server.call("tools/call", { name: "show", arguments: { args: ["nope"] } });
Lines 2784–2800 at 100 (were 2791–2807 at 99)
27912784 });
27922785
27932786 it("turns a tool call into the command line, flags first and the words after --", () => {
2794− assert.deepEqual(argvFor("publish", { message: "why", "as-is": true, check: "", args: [] }), [
2795− "publish",
2787+ assert.deepEqual(argvFor("push", { message: "why", "as-is": true, check: "", args: [] }), [
2788+ "push",
27962789 "--message=why",
27972790 "--as-is",
27982791 "--check=",
27992792 ]);
28002793 assert.deepEqual(argvFor("log", { args: ["-weird.txt"], limit: "3" }), ["log", "--limit=3", "--", "-weird.txt"]);
28012794 // An input can't add a flag of its own: a value stays one entry, and a free word comes after --.
2802− const argv = argvFor("publish", { message: "--server=x", args: ["--server=x"] });
2803− assert.deepEqual(argv, ["publish", "--message=--server=x", "--", "--server=x"]);
2804− const parsed = parseArgs("publish", argv.slice(1), commandTable().publish!.flags);
2795+ const argv = argvFor("push", { message: "--server=x", args: ["--server=x"] });
2796+ assert.deepEqual(argv, ["push", "--message=--server=x", "--", "--server=x"]);
2797+ const parsed = parseArgs("push", argv.slice(1), commandTable().push!.flags);
28052798 assert.equal(parsed.flags.get("message"), "--server=x");
28062799 assert.deepEqual(parsed.positionals, ["--server=x"]);
28072800 });
Lines 2854–2868 at 100 (were 2861–2875 at 99)
28612854 }
28622855 });
28632856
2864− it("publish --done takes the start note back once it is published", async () => {
2857+ it("push --done takes the start note back once it is pushed", async () => {
28652858 const { folders } = await project({ "a.txt": "one\n" }, "alice");
28662859 assert.equal((await avcs(folders.alice!, "start", "Two", "a.txt")).exit, 0);
28672860 write(folders.alice!, { "a.txt": "two\n" });
2868− const r = await main(["publish", "-m", "two", "--done"], { cwd: folders.alice!, env: ENV, write: () => {} });
2861+ const r = await main(["push", "-m", "two", "--done"], { cwd: folders.alice!, env: ENV, write: () => {} });
28692862 assert.equal(r.exit, 0, r.stdout + r.stderr);
28702863 assert.match(
28712864 r.stdout,
2872− /\nPublished version 1\.\nYour start note is taken back \(--done\): this work is finished\.\n$/,
2865+ /\nPushed version 1\.\nYour start note is taken back \(--done\): this work is finished\.\n$/,
28732866 );
28742867 assert.doesNotMatch(
28752868 (await main(["where"], { cwd: folders.alice!, env: ENV, write: () => {} })).stdout,
Lines 2871–2904 at 100 (were 2878–2911 at 99)
28782871 });
28792872});
28802873
2881−describe("a publish whose answer is lost (a storage reset after the publish landed)", () => {
2882− it("looks at shared before saying it failed, and never publishes again by itself", async () => {
2874+describe("a push whose answer is lost (a storage reset after the push landed)", () => {
2875+ it("looks at shared before saying it failed, and never pushes again by itself", async () => {
28832876 const { folders } = await project({ "a.txt": "a\n" }, "alice");
28842877 write(folders.alice!, { "a.txt": "b\n" });
28852878 fake.failPublish = "after";
2886− const landed = await main(["publish", "-m", "lands anyway"], { cwd: folders.alice!, env: ENV, write: () => {} });
2879+ const landed = await main(["push", "-m", "lands anyway"], { cwd: folders.alice!, env: ENV, write: () => {} });
28872880 assert.equal(landed.exit, 0, landed.stdout + landed.stderr);
28882881 assert.match(
28892882 landed.stdout,
2890− /\nPublished version 1\. The server's answer was lost \(POST \/a\/alice\/publish answered 500: Internal error in Durable Object storage caused object to be reset\.?\), but shared's log shows your publish landed\.\n$/,
2883+ /\nPushed version 1\. The server's answer was lost \(POST \/a\/alice\/publish answered 500: Internal error in Durable Object storage caused object to be reset\.?\), but shared's log shows your push landed\.\n$/,
28912884 );
28922885
28932886 write(folders.alice!, { "a.txt": "c\n" });
28942887 fake.failPublish = "before";
2895− const lost = await main(["publish", "-m", "never landed"], { cwd: folders.alice!, env: ENV, write: () => {} });
2888+ const lost = await main(["push", "-m", "never landed"], { cwd: folders.alice!, env: ENV, write: () => {} });
28962889 assert.equal(lost.exit, 1);
28972890 assert.match(
28982891 lost.stdout,
2899− /\nNot published: POST \/a\/alice\/publish answered 500: [^\n]*\. Shared's newest versions and the merge queue don't have it, so it's safe to publish again\.\n$/,
2892+ /\nNot pushed: POST \/a\/alice\/publish answered 500: [^\n]*\. Shared's newest versions and the merge queue don't have it, so it's safe to push again\.\n$/,
29002893 );
2901− assert.equal((await avcs(folders.alice!, "status")).json.version, 1, "nothing was published again by itself");
2894+ assert.equal((await avcs(folders.alice!, "status")).json.version, 1, "nothing was pushed again by itself");
29022895 // The same message as an earlier publish doesn't count when it's an older version: only this attempt's.
2903− assert.equal((await avcs(folders.alice!, "publish", "-m", "never landed")).exit, 0);
2896+ assert.equal((await avcs(folders.alice!, "push", "-m", "never landed")).exit, 0);
29042897 });
29052898});
29062899
29072900describe("a server that can't be reached (#37, GAME - UI/UX)", () => {
2908− it("tries a connection that never opened once more, and says nothing reached the server and how far publish got", async () => {
2901+ it("tries a connection that never opened once more, and says nothing reached the server and how far push got", async () => {
29092902 const { folders } = await project({ "a.txt": "a\n" }, "alice");
29102903 write(folders.alice!, { "a.txt": "b\n" });
29112904 // A port nothing listens on: the connection is refused before any request goes out.
Lines 2915–2923 at 100 (were 2922–2930 at 99)
29222915 status.stderr,
29232916 /Can't reach http:\/\/127\.0\.0\.1:\d+: .*Tried twice, the second time IPv4 first; the connection never opened, so nothing reached the server\. Check your connection; abso doctor checks the rest\.\n$/,
29242917 );
2925− const plain = await main(["publish", "-m", "x"], { cwd: folders.alice!, env: ENV, write: () => {} });
2926− assert.match(plain.stderr, /nothing reached the server\. Nothing was published\. Run the same command again\.\n$/);
2927− const checked = await main(["publish", "-m", "x", "--check", "node -e 0"], {
2918+ const plain = await main(["push", "-m", "x"], { cwd: folders.alice!, env: ENV, write: () => {} });
2919+ assert.match(plain.stderr, /nothing reached the server\. Nothing was pushed\. Run the same command again\.\n$/);
2920+ const checked = await main(["push", "-m", "x", "--check", "node -e 0"], {
29282921 cwd: folders.alice!,
29292922 env: ENV,
29302923 write: () => {},
Lines 2925–2931 at 100 (were 2932–2938 at 99)
29322925 });
29332926 assert.match(
29342927 checked.stderr,
2935− /nothing reached the server\. Nothing was published, and the check didn't run\. Run the same command again\.\n$/,
2928+ /nothing reached the server\. Nothing was pushed, and the check didn't run\. Run the same command again\.\n$/,
29362929 );
29372930 });
29382931});
Lines 2979–2985 at 100 (were 2986–2992 at 99)
29862979 assert.equal(existsSync(join(bare, "abso.json")), false);
29872980 assert.match(
29882981 off.stdout,
2989− /\nNo abso.json written: package\.json gives no check or build to guess, so CI has nothing to run on each new version\. To give it a check, publish an abso.json like \{"check": "npm test"\}/,
2982+ /\nNo abso.json written: package\.json gives no check or build to guess, so CI has nothing to run on each new version\. To give it a check, push an abso.json like \{"check": "npm test"\}/,
29902983 );
29912984 // --as-is (an import, #58): the folder goes up exactly as it is, with nothing of avcs's own added.
29922985 const asIs = temp();
Lines 2995–3001 at 100 (were 3002–3008 at 99)
30022995 assert.doesNotMatch(imported.stdout, /Wrote|No avcs\.json written/);
30032996 });
30042997
3005− it("publish --check alone runs the check in the draft's avcs.json, wherever --check sits", async () => {
2998+ it("push --check alone runs the check in the draft's avcs.json, wherever --check sits", async () => {
30062999 const CHECK = "process.exit(require('fs').readFileSync('state.txt', 'utf8').includes('bad') ? 1 : 0);\n";
30073000 const { folders } = await project(
30083001 { "avcs.json": '{"check": "node check.cjs"}\n', "check.cjs": CHECK, "state.txt": "ok\n" },
Lines 3004–3010 at 100 (were 3011–3017 at 99)
30113004 write(folders.alice!, { "state.txt": "bad\n" });
30123005 let err = "";
30133006 const startsBefore = fake.runStarts.length;
3014− const bad = await main(["publish", "--check", "-m", "breaks it"], {
3007+ const bad = await main(["push", "--check", "-m", "breaks it"], {
30153008 cwd: folders.alice!,
30163009 env: ENV,
30173010 write: () => {},
Lines 3022–3028 at 100 (were 3029–3035 at 99)
30293022 assert.equal(fake.runStarts.at(-1)!.kind, "run");
30303023 // The draft's copy of avcs.json is the one that runs.
30313024 write(folders.alice!, { "avcs.json": '{"check": "node -e 0"}\n' });
3032− const ok = await main(["publish", "-m", "a new check", "--check"], {
3025+ const ok = await main(["push", "-m", "a new check", "--check"], {
30333026 cwd: folders.alice!,
30343027 env: ENV,
30353028 write: () => {},
Lines 3036–3042 at 100 (were 3043–3049 at 99)
30433036 "avcs.json": '{"build": "node build.cjs", "check": "node check.cjs"}\n',
30443037 });
30453038 err = "";
3046− const broken = await main(["publish", "-m", "breaks the build", "--check"], {
3039+ const broken = await main(["push", "-m", "breaks the build", "--check"], {
30473040 cwd: folders.alice!,
30483041 env: ENV,
30493042 write: () => {},
Lines 3046–3056 at 100 (were 3053–3063 at 99)
30533046 assert.match(err, /in the box: node build\.cjs && node check\.cjs\n/);
30543047 });
30553048
3056− it("publish --check alone refuses when there is no check to run", async () => {
3049+ it("push --check alone refuses when there is no check to run", async () => {
30573050 const { folders } = await project({ "a.txt": "a\n" }, "alice");
30583051 assert.equal(existsSync(join(folders.alice!, "avcs.json")), false, "nothing to guess: no avcs.json");
30593052 write(folders.alice!, { "a.txt": "b\n" });
3060− const missing = await main(["publish", "-m", "x", "--check"], {
3053+ const missing = await main(["push", "-m", "x", "--check"], {
30613054 cwd: folders.alice!,
30623055 env: ENV,
30633056 write: () => {},
Lines 3062–3068 at 100 (were 3069–3075 at 99)
30693062 /--check alone runs the project's check, but there is no abso.json\. Set "check" in abso.json/,
30703063 );
30713064 write(folders.alice!, { "avcs.json": '{"build": "", "check": ""}\n' });
3072− const none = await main(["publish", "-m", "x", "--check"], {
3065+ const none = await main(["push", "-m", "x", "--check"], {
30733066 cwd: folders.alice!,
30743067 env: ENV,
30753068 write: () => {},
Lines 3074–3094 at 100 (were 3081–3101 at 99)
30813074 /--check alone runs the project's check, but avcs\.json has no "check"\. Set "check" in avcs\.json/,
30823075 );
30833076 write(folders.alice!, { "avcs.json": '{"check": ' });
3084− const broken = await main(["publish", "-m", "x", "--check"], {
3077+ const broken = await main(["push", "-m", "x", "--check"], {
30853078 cwd: folders.alice!,
30863079 env: ENV,
30873080 write: () => {},
30883081 writeErr: () => {},
30893082 });
30903083 assert.match(broken.stdout + broken.stderr, /but avcs\.json isn't valid JSON/);
3091− assert.equal((await avcs(folders.alice!, "status")).json.version, 0, "nothing was published");
3084+ assert.equal((await avcs(folders.alice!, "status")).json.version, 0, "nothing was pushed");
30923085 });
30933086
30943087 it("status says whether shared is green or red, log marks shared versions, and abso ci shows a job (#39)", async () => {
30953088 const { name, folders } = await project({ "a.txt": "a\n" }, "alice", "bob");
30963089 for (const n of [1, 2, 3]) {
30973090 write(folders.bob!, { "a.txt": `a ${n}\n` });
3098− assert.equal((await avcs(folders.bob!, "publish", "-m", `step ${n}`)).exit, 0);
3091+ assert.equal((await avcs(folders.bob!, "push", "-m", `step ${n}`)).exit, 0);
30993092 }
31003093 const plain = await main(["status"], { cwd: folders.alice!, env: ENV, write: () => {} });
31013094 assert.doesNotMatch(plain.stdout, /Shared is|checked|Preview/, "a server without CI adds nothing");
Lines 3230–3238 at 100 (were 3237–3245 at 99)
32373230
32383231 it("an optional flag takes the next word unless it is another option or missing", () => {
32393232 const spec = { check: "optional", message: "string" } as const;
3240− assert.equal(parseArgs("publish", ["--check", "npm test", "-m", "x"], spec).flags.get("check"), "npm test");
3241− assert.equal(parseArgs("publish", ["--check", "-m", "x"], spec).flags.get("check"), "");
3242− assert.equal(parseArgs("publish", ["-m", "x", "--check"], spec).flags.get("check"), "");
3233+ assert.equal(parseArgs("push", ["--check", "npm test", "-m", "x"], spec).flags.get("check"), "npm test");
3234+ assert.equal(parseArgs("push", ["--check", "-m", "x"], spec).flags.get("check"), "");
3235+ assert.equal(parseArgs("push", ["-m", "x", "--check"], spec).flags.get("check"), "");
32433236 });
32443237});
32453238
Lines 3272–3281 at 100 (were 3279–3288 at 99)
32793272});
32803273
32813274describe("Recorded first names new files on their own, in full (#37)", () => {
3282− it("a file a script made, which no hook saw, is listed as new at publish", async () => {
3275+ it("a file a script made, which no hook saw, is listed as new at push", async () => {
32833276 const { folders } = await project({ "a.txt": "a\n" }, "alice");
32843277 write(folders.alice!, { "a.txt": "a, edited\n", "tests/made-by-a-script.test.ts": "test\n" });
3285− const r = await main(["publish", "-m", "x"], { cwd: folders.alice!, env: ENV, write: () => {} });
3278+ const r = await main(["push", "-m", "x"], { cwd: folders.alice!, env: ENV, write: () => {} });
32863279 assert.equal(r.exit, 0);
32873280 assert.match(r.stdout, /^Recorded first: 1 new \(tests\/made-by-a-script\.test\.ts\), 1 changed \(a\.txt\)\.\n/);
32883281 });
Lines 3348–3360 at 100 (were 3355–3367 at 99)
33553348 assert.match(r.stderr, /^News:\n {2}bob \(as claimed\) told you:\n {4}heads up\n$/);
33563349 });
33573350
3358− it("publish --check refuses when the box has no prep and the project has a package-lock", async () => {
3351+ it("push --check refuses when the box has no prep and the project has a package-lock", async () => {
33593352 const { folders } = await project(
33603353 { "a.txt": "a\n", "package-lock.json": "{}\n", "ok.cjs": "process.exit(0);\n" },
33613354 "alice",
33623355 );
33633356 write(folders.alice!, { "a.txt": "a by alice\n" });
3364− const r = await main(["publish", "-m", "x", "--check", "node ok.cjs"], {
3357+ const r = await main(["push", "-m", "x", "--check", "node ok.cjs"], {
33653358 cwd: folders.alice!,
33663359 env: ENV,
33673360 write: () => {},
Lines 3363–3373 at 100 (were 3370–3380 at 99)
33703363 assert.equal(r.exit, 2);
33713364 assert.match(
33723365 r.stdout,
3373− /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/,
3366+ /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/,
33743367 );
33753368 // Now the folder knows: the next --check refuses before running anything (#37).
33763369 const runs = fake.runStarts.length;
3377− const again = await main(["publish", "-m", "x", "--check", "node ok.cjs"], {
3370+ const again = await main(["push", "-m", "x", "--check", "node ok.cjs"], {
33783371 cwd: folders.alice!,
33793372 env: ENV,
33803373 write: () => {},
Lines 3376–3386 at 100 (were 3383–3393 at 99)
33833376 assert.equal(again.exit, 2);
33843377 assert.match(
33853378 again.stdout,
3386− /Not published: your box has no prep, so a check would run without node_modules .*\(Nothing was run: this folder's last run in that box said it had no prep\.\)/,
3379+ /Not pushed: your box has no prep, so a check would run without node_modules .*\(Nothing was run: this folder's last run in that box said it had no prep\.\)/,
33873380 );
33883381 assert.equal(fake.runStarts.length, runs, "no run started");
33893382 // Another box, never heard of: it runs, as the first time.
3390− const other = await main(["publish", "-m", "x", "--check", "node ok.cjs", "--box", "b2"], {
3383+ const other = await main(["push", "-m", "x", "--check", "node ok.cjs", "--box", "b2"], {
33913384 cwd: folders.alice!,
33923385 env: ENV,
33933386 write: () => {},
Lines 3390–3404 at 100 (were 3397–3411 at 99)
33973390 });
33983391});
33993392
3400−describe("abso bisect and publish --check (#37)", () => {
3393+describe("abso bisect and push --check (#37)", () => {
34013394 const CHECK = "const t = require('fs').readFileSync('state.txt', 'utf8'); process.exit(t.includes('bad') ? 1 : 0);\n";
34023395
34033396 it("bisect names the first failing version, its author and message", async () => {
34043397 const { folders } = await project({ "state.txt": "ok 0\n", "check.cjs": CHECK }, "alice", "bob");
34053398 const pub = async (who: string, text: string) => {
3406− await avcs(folders[who]!, "sync");
3399+ await avcs(folders[who]!, "pull");
34073400 write(folders[who]!, { "state.txt": text });
3408− assert.equal((await avcs(folders[who]!, "publish", "-m", text.trim())).exit, 0);
3401+ assert.equal((await avcs(folders[who]!, "push", "-m", text.trim())).exit, 0);
34093402 };
34103403 await pub("alice", "ok 1\n");
34113404 await pub("alice", "ok 2\n");
Lines 3426–3432 at 100 (were 3433–3439 at 99)
34333426 const { folders } = await project({ "state.txt": "ok 0\n", "check.cjs": SKIPPING }, "alice");
34343427 for (const s of states) {
34353428 write(folders.alice!, { "state.txt": `${s}\n` });
3436− assert.equal((await avcs(folders.alice!, "publish", "-m", s)).exit, 0);
3429+ assert.equal((await avcs(folders.alice!, "push", "-m", s)).exit, 0);
34373430 }
34383431 let err = "";
34393432 const r = await main(["bisect", "--", "node", "check.cjs"], {
Lines 3450–3462 at 100 (were 3457–3469 at 99)
34573450 );
34583451 });
34593452
3460− it("publish --check says when shared moved during the check, and paths the sync didn't write don't block it", async () => {
3453+ it("push --check says when shared moved during the check, and paths the pull didn't write don't block it", async () => {
34613454 const WAIT = "setTimeout(() => process.exit(0), 1500);\n";
34623455 const { folders } = await project({ "a.txt": "a\n", "b.txt": "b\n", "wait.cjs": WAIT }, "alice", "bob");
34633456 write(folders.alice!, { "a.txt": "a by alice\n" });
34643457 fake.injectSync = { files: { "../outside.txt": "x\n" } };
34653458 let err = "";
3466− const publishing = main(["publish", "-m", "alice", "--check", "node wait.cjs"], {
3459+ const publishing = main(["push", "-m", "alice", "--check", "node wait.cjs"], {
34673460 cwd: folders.alice!,
34683461 env: ENV,
34693462 write: () => {},
Lines 3466–3510 at 100 (were 3473–3517 at 99)
34733466 const started = fake.runStarts.length;
34743467 for (let i = 0; i < 200 && fake.runStarts.length === started; i++) await new Promise((r) => setTimeout(r, 10));
34753468 write(folders.bob!, { "b.txt": "b by bob\n" });
3476− assert.equal((await avcs(folders.bob!, "publish", "-m", "bob meanwhile")).exit, 0);
3469+ assert.equal((await avcs(folders.bob!, "push", "-m", "bob meanwhile")).exit, 0);
34773470 const r = await publishing;
34783471 assert.equal(r.exit, 0, r.stdout + err);
3479− assert.match(err, /abso: the sync didn't write these: \.\.\/outside\.txt; the check runs without them\./);
3472+ assert.match(err, /abso: the pull didn't write these: \.\.\/outside\.txt; the check runs without them\./);
34803473 assert.match(r.stdout, /\nShared moved during the check: version 1 merged in without being checked\.\n/);
34813474 });
34823475
3483− it("publish --check publishes only when the check passes on the draft with newest shared", async () => {
3476+ it("push --check pushes only when the check passes on the draft with newest shared", async () => {
34843477 const { folders } = await project({ "state.txt": "ok\n", "check.cjs": CHECK }, "alice");
34853478 write(folders.alice!, { "state.txt": "bad\n" });
3486− const refused = await main(["publish", "-m", "breaks it", "--check", "node check.cjs"], {
3479+ const refused = await main(["push", "-m", "breaks it", "--check", "node check.cjs"], {
34873480 cwd: folders.alice!,
34883481 env: ENV,
34893482 write: () => {},
34903483 writeErr: () => {},
34913484 });
34923485 assert.equal(refused.exit, 2);
3493− assert.match(refused.stdout, /Not published: the check failed \(exit 1\)/);
3486+ assert.match(refused.stdout, /Not pushed: the check failed \(exit 1\)/);
34943487 assert.equal((await avcs(folders.alice!, "log")).json.version, 0, "shared did not move");
34953488 write(folders.alice!, { "state.txt": "ok, better\n" });
3496− const ok = await main(["publish", "-m", "fine", "--check", "node check.cjs"], {
3489+ const ok = await main(["push", "-m", "fine", "--check", "node check.cjs"], {
34973490 cwd: folders.alice!,
34983491 env: ENV,
34993492 write: () => {},
35003493 writeErr: () => {},
35013494 });
35023495 assert.equal(ok.exit, 0, ok.stdout);
3503− assert.match(ok.stdout, /Published version 1\./);
3496+ assert.match(ok.stdout, /Pushed version 1\./);
35043497 });
35053498});
35063499
35073500describe("every command that takes news prints it (#37, News Report)", () => {
3508− it("sync and diff print the news their record took, --json carries it, a command that records nothing leaves it waiting, and it prints once", async () => {
3501+ it("pull and diff print the news their record took, --json carries it, a command that records nothing leaves it waiting, and it prints once", async () => {
35093502 const { folders } = await project({ "a.txt": "a\n", "b.txt": "b\n" }, "alice", "bob");
35103503 const [alice, bob] = [folders.alice!, folders.bob!];
35113504 const say = async (text: string) => assert.equal((await avcs(alice, "announce", text)).exit, 0);
35123505 await say("Ruling: playtest builds come from v40 only.");
35133506 write(bob, { "a.txt": "a by bob\n" });
3514− const synced = await main(["sync"], { cwd: bob, env: ENV, write: () => {} });
3507+ const synced = await main(["pull"], { cwd: bob, env: ENV, write: () => {} });
35153508 assert.match(
35163509 synced.stdout,
35173510 /\nNews:\n {2}alice \(as claimed\) told you:\n {4}Ruling: playtest builds come from v40 only\.\n$/,
Lines 3528–3560 at 100 (were 3535–3567 at 99)
35353528 });
35363529});
35373530
3538−describe("wishlist: publish clarity, who, fix-eol, one-version hint (#37)", () => {
3539− it("an empty publish says shared already has the file and who changed it, not that work vanished", async () => {
3531+describe("wishlist: push clarity, who, fix-eol, one-version hint (#37)", () => {
3532+ it("an empty push says shared already has the file and who changed it, not that work vanished", async () => {
35403533 const { folders } = await project({ "tools/look.mjs": "look\n" }, "artist", "builder2");
35413534 write(folders.builder2!, { "tools/look.mjs": "look --mute-audio\n" });
3542− assert.equal((await avcs(folders.builder2!, "publish", "-m", "Mute audio in look")).exit, 0);
3535+ assert.equal((await avcs(folders.builder2!, "push", "-m", "Mute audio in look")).exit, 0);
35433536 // The same change, made here before syncing: sync merges it away, and the draft is empty.
35443537 await edit(folders.artist!, "tools/look.mjs", "look\n", "look --mute-audio\n");
3545− assert.equal((await avcs(folders.artist!, "sync")).exit, 0);
3546− const r = await main(["publish", "-m", "mute"], { cwd: folders.artist!, env: ENV, write: () => {} });
3538+ assert.equal((await avcs(folders.artist!, "pull")).exit, 0);
3539+ const r = await main(["push", "-m", "mute"], { cwd: folders.artist!, env: ENV, write: () => {} });
35473540 assert.equal(r.exit, 0, r.stdout + r.stderr);
35483541 assert.match(
35493542 r.stdout,
3550− /Nothing published: shared already has the file you changed as you have it, so nothing of yours is lost\. Last changed in tools\/look\.mjs \(version 1, builder2: "Mute audio in look"\)\./,
3543+ /Nothing pushed: shared already has the file you changed as you have it, so nothing of yours is lost\. Last changed in tools\/look\.mjs \(version 1, builder2: "Mute audio in look"\)\./,
35513544 );
35523545 });
35533546
35543547 it("who names the last change, the drafts, and the starting notes for a file", async () => {
35553548 const { folders } = await project({ "a.txt": "a\n", "b.txt": "b\n" }, "alice", "bob");
35563549 write(folders.alice!, { "a.txt": "a1\n" });
3557− assert.equal((await avcs(folders.alice!, "publish", "-m", "alice a1")).exit, 0);
3550+ assert.equal((await avcs(folders.alice!, "push", "-m", "alice a1")).exit, 0);
35583551 write(folders.bob!, { "a.txt": "a by bob\n" });
35593552 assert.equal((await avcs(folders.bob!, "record")).exit, 0);
35603553 assert.equal((await avcs(folders.bob!, "start", "tidy the texts", "*.txt")).exit, 0);
35613554 const r = await main(["who", "a.txt", "b.txt"], { cwd: folders.alice!, env: ENV, write: () => {} });
35623555 assert.match(
35633556 r.stdout,
3564− /^a\.txt:\n {2}last changed in version 1 by alice, .*: alice a1\n {2}bob has unpublished changes at lines 1, last at .*\n {2}bob started "tidy the texts", .*\nb\.txt:\n {2}last changed in version 0 by .*\n {2}nobody has unpublished changes in it\n {2}bob started "tidy the texts"/,
3557+ /^a\.txt:\n {2}last changed in version 1 by alice, .*: alice a1\n {2}bob has unpushed changes at lines 1, last at .*\n {2}bob started "tidy the texts", .*\nb\.txt:\n {2}last changed in version 0 by .*\n {2}nobody has unpushed changes in it\n {2}bob started "tidy the texts"/,
35653558 );
35663559 });
35673560
Lines 3635–3642 at 100 (were 3642–3649 at 99)
36423635 // A sync writes the file and its known copy, so what was kept for them no longer holds.
36433636 writeFileSync(join(root, "b.txt"), "b\n");
36443637 write(folders.bob!, { "a.txt": "a2\n" });
3645− assert.equal((await avcs(folders.bob!, "publish", "-m", "a2")).exit, 0);
3646− assert.equal((await avcs(root, "sync")).exit, 0);
3638+ assert.equal((await avcs(folders.bob!, "push", "-m", "a2")).exit, 0);
3639+ assert.equal((await avcs(root, "pull")).exit, 0);
36473640 assert.equal(readFileSync(join(root, "a.txt"), "utf8"), "a2\n");
36483641 swap("a.txt", "a3\n");
36493642 assert.deepEqual((await avcs(root, "status")).json.unrecorded, ["a.txt"]);
Lines 3669–3675 at 100 (were 3676–3682 at 99)
36763669 assert.equal(joined.exit, 0, joined.stdout + joined.stderr);
36773670 assert.match(
36783671 joined.stdout,
3679− /It is a reader: status, sync, log, show, files and export work, and nothing it does is recorded or published\./,
3672+ /It is a reader: status, pull, log, show, files and export work, and nothing it does is recorded or pushed\./,
36803673 );
36813674 assert.equal(read(dir, "a.txt"), "a\n");
36823675 // Edits: the command hook stands down, record and publish refuse here, sync skips its record step.
Lines 3677–3694 at 100 (were 3684–3701 at 99)
36843677 write(dir, { "notes.md": "mine\n" });
36853678 const recorded = await main(["record"], { cwd: dir, env: ENV, write: () => {} });
36863679 assert.equal(recorded.exit, 1);
3687− assert.match(recorded.stdout + recorded.stderr, /this folder is a reader: it records and publishes nothing/);
3688− assert.equal((await main(["publish", "-m", "x"], { cwd: dir, env: ENV, write: () => {} })).exit, 1);
3680+ assert.match(recorded.stdout + recorded.stderr, /this folder is a reader: it records and pushes nothing/);
3681+ assert.equal((await main(["push", "-m", "x"], { cwd: dir, env: ENV, write: () => {} })).exit, 1);
36893682 write(folders.alice!, { "a.txt": "a by alice\n" });
3690− assert.equal((await avcs(folders.alice!, "publish", "-m", "alice")).exit, 0);
3691− assert.equal((await avcs(dir, "sync")).exit, 0);
3683+ assert.equal((await avcs(folders.alice!, "push", "-m", "alice")).exit, 0);
3684+ assert.equal((await avcs(dir, "pull")).exit, 0);
36923685 const status = await avcs(dir, "status");
36933686 const rep = status.json.agents.find((a: { agent: string }) => a.agent === "rep");
36943687 assert.equal(rep.reader, true);
36953688 assert.equal(rep.draftChanges, 0, "nothing reached a draft");
36963689 assert.match(
36973690 (await main(["status"], { cwd: dir, env: ENV, write: () => {} })).stdout,
3698− /This folder is rep, a reader \(it records and publishes nothing\)/,
3691+ /This folder is rep, a reader \(it records and pushes nothing\)/,
36993692 );
37003693 assert.match(read(dir, ".avcs/hook.log"), /\tskipped: this folder is a reader\t/);
37013694 // The server refuses too, whatever the folder says.
Lines 3702–3713 at 100 (were 3709–3720 at 99)
37093702 assert.equal((await avcs(dir, "reader", "off")).exit, 0);
37103703 assert.equal(JSON.parse(read(dir, ".avcs/config.json")).reader, undefined);
37113704 write(dir, { "notes.md": "now recorded\n" });
3712− assert.equal((await avcs(dir, "publish", "-m", "rep writes")).exit, 0);
3705+ assert.equal((await avcs(dir, "push", "-m", "rep writes")).exit, 0);
37133706 });
37143707
3715− it("reader on is refused while the agent has unpublished work, and changes nothing here", async () => {
3708+ it("reader on is refused while the agent has unpushed work, and changes nothing here", async () => {
37163709 const { folders } = await project({ "a.txt": "a\n" }, "alice");
3717− write(folders.alice!, { "a.txt": "a, unpublished\n" });
3710+ write(folders.alice!, { "a.txt": "a, unpushed\n" });
37183711 assert.equal((await avcs(folders.alice!, "record")).exit, 0);
37193712 const on = await main(["reader", "on"], { cwd: folders.alice!, env: ENV, write: () => {} });
37203713 assert.equal(on.exit, 2);
Lines 3771–3782 at 100 (were 3778–3789 at 99)
37783771 const { folders } = await project({ "a.txt": "a\n", "b.txt": "b\n" }, "alice", "bob");
37793772 const pub = async (who: string, file: string, text: string) => {
37803773 write(folders[who]!, { [file]: text });
3781− assert.equal((await avcs(folders[who]!, "publish", "-m", `${who} ${text.trim()}`)).exit, 0);
3782− await avcs(folders[who]!, "sync");
3774+ assert.equal((await avcs(folders[who]!, "push", "-m", `${who} ${text.trim()}`)).exit, 0);
3775+ await avcs(folders[who]!, "pull");
37833776 };
37843777 await pub("alice", "a.txt", "a1\n");
37853778 await pub("bob", "b.txt", "b1\n");
3786− await avcs(folders.alice!, "sync");
3779+ await avcs(folders.alice!, "pull");
37873780 await pub("alice", "a.txt", "a2\n");
37883781 await pub("alice", "b.txt", "b2\n");
37893782 const since = await avcs(folders.alice!, "log", "--since", "1");
Lines 3820–3826 at 100 (were 3827–3833 at 99)
38273820 const said = await main(["status"], { cwd: alice, env: ENV, write: () => {} });
38283821 assert.match(
38293822 said.stdout,
3830− /\nEverything in this folder is recorded\.\nAdded to your draft by an earlier record and deleted since, so they never reach shared; the next record \(sync, publish, run\) takes them out of your draft: _ab\/x\.ts, tools\/_perf\.sh\n/,
3823+ /\nEverything in this folder is recorded\.\nAdded to your draft by an earlier record and deleted since, so they never reach shared; the next record \(pull, push, run\) takes them out of your draft: _ab\/x\.ts, tools\/_perf\.sh\n/,
38313824 );
38323825 assert.equal((await avcs(alice, "record")).exit, 0);
38333826 assert.deepEqual((await avcs(alice, "diff")).json.files, [], "the next record clears the draft");
Lines 3971–3984 at 100 (were 3978–3991 at 99)
39783971});
39793972
39803973describe("ignored files an old edit mod put in the draft (#37, Reporter)", () => {
3981− it("sync and publish drop new ones from the draft and keep them on disk; a file shared has stays", async () => {
3974+ it("pull and push drop new ones from the draft and keep them on disk; a file shared has stays", async () => {
39823975 const { folders } = await project({ "a.txt": "a\n", "out/keep.txt": "keep\n" }, "alice");
39833976 const alice = folders.alice!;
39843977 // What a mod without nested ignore files does: the files reach the draft, then out/.avcsignore says "*".
39853978 write(alice, { "out/cards.mjs": "cards\n", "out/keep.txt": "keep, edited\n" });
39863979 assert.equal((await avcs(alice, "record")).exit, 0);
39873980 write(alice, { "out/.avcsignore": "# scratch\n*\n" });
3988− const synced = await main(["sync"], { cwd: alice, env: ENV, write: () => {} });
3981+ const synced = await main(["pull"], { cwd: alice, env: ENV, write: () => {} });
39893982 assert.match(
39903983 synced.stdout,
39913984 /Dropped from your draft, kept on disk \(your ignore rules leave it out; abso check-ignore says which line\): out\/cards\.mjs\n/,
Lines 3995–4001 at 100 (were 4002–4008 at 99)
40023995 rmSync(join(alice, "out", ".avcsignore"));
40033996 assert.equal((await avcs(alice, "record")).exit, 0);
40043997 write(alice, { "out/.avcsignore": "*\n" });
4005− const published = await avcs(alice, "publish", "-m", "keep");
3998+ const published = await avcs(alice, "push", "-m", "keep");
40063999 assert.equal(published.exit, 0, published.out);
40074000 const shown = await avcs(alice, "show", "1");
40084001 assert.deepEqual(shown.json.files, ["out/keep.txt"]);
Lines 4149–4170 at 100 (were 4156–4177 at 99)
41564149});
41574150
41584151describe("empty files", () => {
4159− it('are files: a Write of "" empties a file without deleting it, and sync brings empty files', async () => {
4152+ it('are files: a Write of "" empties a file without deleting it, and pull brings empty files', async () => {
41604153 const { name, folders } = await project({ "a.txt": "a\n" }, "alice", "bob");
41614154 const alice = folders.alice!;
41624155 assert.match((await put(alice, "new.txt", "")).outcome, /^sent/);
41634156 assert.match((await put(alice, "a.txt", "")).outcome, /^sent/);
41644157 assert.equal((await avcs(alice, "record")).json.sent, 0, "the hook kept the known copies in step");
4165− assert.equal((await avcs(alice, "publish", "-m", "empty two files")).exit, 0);
4158+ assert.equal((await avcs(alice, "push", "-m", "empty two files")).exit, 0);
41664159 assert.equal(shared(name)["a.txt"], "");
41674160 assert.equal(shared(name)["new.txt"], "");
41684161
41694162 const bob = folders.bob!;
4170− assert.equal((await avcs(bob, "sync")).exit, 0);
4163+ assert.equal((await avcs(bob, "pull")).exit, 0);
41714164 assert.equal(read(bob, "a.txt"), "");
41724165 assert.equal(read(bob, "new.txt"), "");
41734166 unlinkSync(join(bob, "new.txt"));
4174− assert.equal((await avcs(bob, "publish", "-m", "remove the empty file")).exit, 0);
4167+ assert.equal((await avcs(bob, "push", "-m", "remove the empty file")).exit, 0);
41754168 assert.equal("new.txt" in shared(name), false, "deleting an empty file removes it");
41764169 });
41774170});
Lines 4195–4201 at 100 (were 4202–4208 at 99)
42024195 assert.deepEqual(hosted.project.modes()["run.sh"], { exec: true });
42034196
42044197 const alice = folders.alice!;
4205− const synced = await avcs(alice, "sync");
4198+ const synced = await avcs(alice, "pull");
42064199 assert.equal(synced.exit, 0, synced.out);
42074200 assert.deepEqual(JSON.parse(read(alice, ".avcs/modes.json")), { "run.sh": { exec: true } });
42084201 if (process.platform !== "win32")
Lines 4211–4217 at 100 (were 4218–4224 at 99)
42184211 hosted.project.publish("bob", "link to a", Date.now());
42194212
42204213 const alice = folders.alice!;
4221− assert.equal((await avcs(alice, "sync")).exit, 0);
4214+ assert.equal((await avcs(alice, "pull")).exit, 0);
42224215 assert.equal(linkOnDisk(alice, "to-a"), "a.txt");
42234216 assert.equal((await avcs(alice, "record")).json.sent, 0, "the link (or its stand-in) matches what the server has");
42244217 const path = join(alice, "to-a");
Lines 4233–4239 at 100 (were 4240–4246 at 99)
42404233 writeFileSync(path, "b.txt");
42414234 }
42424235 writeFileSync(join(alice, "a.txt"), "a\n");
4243− assert.equal((await avcs(alice, "publish", "-m", "point the link at b")).exit, 0);
4236+ assert.equal((await avcs(alice, "push", "-m", "point the link at b")).exit, 0);
42444237 assert.deepEqual(hosted.project.modes()["to-a"], { link: "b.txt" });
42454238 assert.equal(shared(name)["a.txt"], "a\n");
42464239 });
Lines 4243–4249 at 100 (were 4250–4256 at 99)
42504243 }, async () => {
42514244 const { name, folders } = await project({ "a.txt": "a\n" }, "alice");
42524245 symlinkSync("a.txt", join(folders.alice!, "link"));
4253− assert.equal((await avcs(folders.alice!, "publish", "-m", "add a link")).exit, 0);
4246+ assert.equal((await avcs(folders.alice!, "push", "-m", "add a link")).exit, 0);
42544247 assert.equal(shared(name).link, "");
42554248 assert.deepEqual(fake.projects.get(name)!.project.modes().link, { link: "a.txt" });
42564249 });
Lines 4272–4278 at 100 (were 4279–4285 at 99)
42794272});
42804273
42814274describe("diff, log, show and restore", () => {
4282− it("shows unpublished changes line by line, the versions, one version, and a file at a version", async () => {
4275+ it("shows unpushed changes line by line, the versions, one version, and a file at a version", async () => {
42834276 const { folders } = await project({ "a.txt": "one\ntwo\nthree\n", "b.txt": "b\n" }, "alice", "bob");
42844277 const alice = folders.alice!;
42854278 await edit(alice, "a.txt", "two\n", "TWO\n");
Lines 4292–4298 at 100 (were 4299–4305 at 99)
42994292 const text = await main(["diff", "a.txt"], { cwd: alice, env: ENV, write: () => {} });
43004293 assert.match(
43014294 text.stdout,
4302− /^Your unpublished changes to a\.txt in shared \(on version 0\): 1 file, 1 line added, 1 removed\.\n--- a\/a\.txt/,
4295+ /^Your unpushed changes to a\.txt in shared \(on version 0\): 1 file, 1 line added, 1 removed\.\n--- a\/a\.txt/,
43034296 );
43044297
43054298 // bob reviews alice's draft: what she recorded, read only.
Lines 4300–4306 at 100 (were 4307–4313 at 99)
43074300 assert.equal(theirs.exit, 0, theirs.stderr);
43084301 assert.match(
43094302 theirs.stdout,
4310− /^alice's recorded, unpublished changes to a\.txt in shared \(on version 0\): 1 file, 1 line added, 1 removed\.\n--- a\/a\.txt\n\+\+\+ b\/a\.txt\n@@ -1,3 \+1,3 @@\n one\n-two\n\+TWO\n three/,
4303+ /^alice's recorded, unpushed changes to a\.txt in shared \(on version 0\): 1 file, 1 line added, 1 removed\.\n--- a\/a\.txt\n\+\+\+ b\/a\.txt\n@@ -1,3 \+1,3 @@\n one\n-two\n\+TWO\n three/,
43114304 );
43124305 assert.deepEqual((await avcs(folders.bob!, "diff", "--agent", "alice")).json.files.map((f: any) => f.path).sort(), [
43134306 "a.txt",
Lines 4308–4314 at 100 (were 4315–4321 at 99)
43154308 ]);
43164309 assert.match(
43174310 (await main(["diff", "--agent", "bob"], { cwd: folders.bob!, env: ENV, write: () => {} })).stdout,
4318− /^bob has no recorded, unpublished changes in shared/,
4311+ /^bob has no recorded, unpushed changes in shared/,
43194312 );
43204313 const nobody = await main(["diff", "--agent", "carol"], { cwd: folders.bob!, env: ENV, write: () => {} });
43214314 assert.notEqual(nobody.exit, 0);
Lines 4318–4326 at 100 (were 4325–4333 at 99)
43254318 1,
43264319 );
43274320
4328− assert.equal((await avcs(alice, "publish", "-m", "alice: shout two, add c")).exit, 0);
4321+ assert.equal((await avcs(alice, "push", "-m", "alice: shout two, add c")).exit, 0);
43294322 await edit(folders.bob!, "b.txt", "b\n", "b from bob\n");
4330− assert.equal((await avcs(folders.bob!, "publish", "-m", "bob: change b")).exit, 0);
4323+ assert.equal((await avcs(folders.bob!, "push", "-m", "bob: change b")).exit, 0);
43314324
43324325 const log = await avcs(alice, "log");
43334326 assert.equal(log.exit, 0, log.out);
Lines 4371–4377 at 100 (were 4378–4384 at 99)
43784371 );
43794372 const alice = folders.alice!;
43804373 write(alice, { "src/a.ts": "a2\n", "src/deep/b.ts": "b2\n", "top.txt": "y\n" });
4381− assert.equal((await avcs(alice, "publish", "-m", "change src and top")).exit, 0);
4374+ assert.equal((await avcs(alice, "push", "-m", "change src and top")).exit, 0);
43824375
43834376 const between = await avcs(alice, "diff", "0", "1", "src/", "test/", "nope/");
43844377 assert.deepEqual(between.json.files.map((f: any) => f.path).sort(), ["src/a.ts", "src/deep/b.ts"]);
Lines 4411–4417 at 100 (were 4418–4424 at 99)
44184411 const alice = folders.alice!;
44194412 await edit(alice, "a.txt", "a\n", "a in exp\n");
44204413 assert.equal((await avcs(alice, "switch", "-c", "exp")).exit, 0);
4421− assert.equal((await avcs(alice, "publish", "-m", "exp: a")).exit, 0);
4414+ assert.equal((await avcs(alice, "push", "-m", "exp: a")).exit, 0);
44224415 const inDraft = await avcs(alice, "log");
44234416 assert.equal(inDraft.json.draft, "exp");
44244417 assert.equal(inDraft.json.versions[0].message, "exp: a");
Lines 4457–4466 at 100 (were 4464–4473 at 99)
44644457}
44654458
44664459describe("renames that change only case", { skip: !caseInsensitiveDisk() && "this disk is case-sensitive" }, () => {
4467− it("records the rename, and a sync brings it in without deleting the file", async () => {
4460+ it("records the rename, and a pull brings it in without deleting the file", async () => {
44684461 const { name, folders } = await project({ "a.ts": "one\n", "b.ts": "b\n" }, "alice", "bob");
44694462 renameSync(join(folders.alice!, "a.ts"), join(folders.alice!, "A.ts"));
4470− assert.equal((await avcs(folders.alice!, "publish", "-m", "rename a.ts to A.ts")).exit, 0);
4463+ assert.equal((await avcs(folders.alice!, "push", "-m", "rename a.ts to A.ts")).exit, 0);
44714464 assert.deepEqual(Object.keys(shared(name)).sort(), [".absoignore", "A.ts", "b.ts"]);
44724465 assert.equal(
44734466 (await avcs(folders.alice!, "status")).json.unrecorded?.length ?? 0,
Lines 4468–4493 at 100 (were 4475–4500 at 99)
44754468 "nothing left to record after the rename",
44764469 );
44774470
4478− const synced = await avcs(folders.bob!, "sync");
4471+ const synced = await avcs(folders.bob!, "pull");
44794472 assert.equal(synced.exit, 0, synced.out);
44804473 assert.ok(
44814474 readdirSync(folders.bob!).includes("A.ts"),
44824475 `bob's folder has A.ts: ${readdirSync(folders.bob!).join(", ")}`,
44834476 );
44844477 assert.equal(read(folders.bob!, "A.ts"), "one\n");
4485− assert.equal((await avcs(folders.bob!, "record")).json.sent, 0, "the known copy matches after the sync");
4478+ assert.equal((await avcs(folders.bob!, "record")).json.sent, 0, "the known copy matches after the pull");
44864479 });
44874480});
44884481
44894482describe("one file whatever its spelling, and abso mv (#49)", () => {
4490− it("abso mv changes a file's case and moves a file, keeping its history, and others sync it in", async () => {
4483+ it("abso mv changes a file's case and moves a file, keeping its history, and others pull it in", async () => {
44914484 const { name, folders } = await project({ "readme.md": "one\ntwo\n", "src/a.ts": "a\n" }, "alice", "bob");
44924485 const run = (cwd: string, ...argv: string[]) => main(argv, { cwd, env: ENV, write: () => {} });
44934486 const cased = await run(folders.alice!, "mv", "readme.md", "README.md");
44944487 assert.equal(cased.exit, 0, cased.stderr);
44954488 assert.equal(
44964489 cased.stdout,
4497− "Moved readme.md to README.md in your draft; its lines keep their history. It reaches shared with your next publish.\n",
4490+ "Moved readme.md to README.md in your draft; its lines keep their history. It reaches shared with your next push.\n",
44984491 );
44994492 assert.ok(readdirSync(folders.alice!).includes("README.md"), readdirSync(folders.alice!).join(", "));
45004493 assert.equal((await run(folders.alice!, "mv", "src/a.ts", "lib/a.ts")).exit, 0);
Lines 4498–4508 at 100 (were 4505–4515 at 99)
45054498 0,
45064499 "nothing left to record: the moves are in the draft",
45074500 );
4508− assert.equal((await avcs(folders.alice!, "publish", "-m", "renames")).exit, 0);
4501+ assert.equal((await avcs(folders.alice!, "push", "-m", "renames")).exit, 0);
45094502 assert.deepEqual(Object.keys(shared(name)).sort(), [".absoignore", "README.md", "lib/a.ts"]);
45104503 // The lines kept their history: blame still names the init version.
45114504 assert.match((await run(folders.alice!, "blame", "README.md")).stdout, /\binit\b/);
4512− assert.equal((await avcs(folders.bob!, "sync")).exit, 0);
4505+ assert.equal((await avcs(folders.bob!, "pull")).exit, 0);
45134506 assert.ok(readdirSync(folders.bob!).includes("README.md"), readdirSync(folders.bob!).join(", "));
45144507 assert.equal(read(folders.bob!, "lib/a.ts"), "a\n");
45154508
Lines 4590–4601 at 100 (were 4597–4608 at 99)
45974590 await edit(folders.alice!, "src/a.txt", "two\n", "alice two\n");
45984591 const where = await main(["where"], { cwd: folders.bob!, env: ENV, write: () => {} });
45994592 assert.match(where.stdout, /src\/a\.txt\n {4}alice: lines 2, at shared lines 2; 1 change/);
4600− assert.equal((await avcs(folders.alice!, "publish", "-m", "alice changes two")).exit, 0);
4593+ assert.equal((await avcs(folders.alice!, "push", "-m", "alice changes two")).exit, 0);
46014594 await edit(folders.bob!, "src/a.txt", "two\n", "bob two\n");
4602− assert.equal((await avcs(folders.bob!, "publish", "-m", "bob changes two")).exit, 2);
4603− await avcs(folders.bob!, "sync");
4595+ assert.equal((await avcs(folders.bob!, "push", "-m", "bob changes two")).exit, 2);
4596+ await avcs(folders.bob!, "pull");
46044597 await put(folders.bob!, "src/a.txt", "one\nsettled two\nthree\n");
4605− assert.equal((await avcs(folders.bob!, "publish", "-m", "settle two")).exit, 0);
4598+ assert.equal((await avcs(folders.bob!, "push", "-m", "settle two")).exit, 0);
46064599
46074600 // From inside src/, the path is relative to where the command runs.
46084601 const inSrc = join(folders.alice!, "src");
Lines 4618–4624 at 100 (were 4625–4631 at 99)
46254618 assert.match(bad.stderr, /has 3 lines; ask for one in 1-3/);
46264619 assert.match(
46274620 (await main(["where"], { cwd: inSrc, env: ENV, write: () => {} })).stdout,
4628− /^Nobody has unpublished changes\. Shared is at version 2\./,
4621+ /^Nobody has unpushed changes\. Shared is at version 2\./,
46294622 );
46304623 });
46314624});
Lines 4667–4673 at 100 (were 4674–4680 at 99)
46744667 assert.equal(gitMarkerLine(mine), undefined, "abso's own blocks are settled with abso settle");
46754668 });
46764669
4677− it("record and publish say so, once, and still send the file", async () => {
4670+ it("record and push say so, once, and still send the file", async () => {
46784671 const { folders } = await project({ "a.txt": "a\n" }, "alice");
46794672 const dir = folders.alice!;
46804673 writeFileSync(join(dir, "a.txt"), "a\n<<<<<<< HEAD\nmine\n=======\ntheirs\n>>>>>>> feature\n");
MCP
compare on this site's /mcp
CLI
abso diff 99 100 client/test/client.test.ts --json
JSON
/christopher/abso-core/compare/99..100?file=client%2Ftest%2Fclient.test.ts&format=json