feat(queue): queue as data A2, migration, render and dispatch (#1508)
Filbert approved round 1 (f167b85e). Manifest 782bcb62, 21 files, plus the QUEUE.md markers and the TOOLS.md section. Lead decision 35. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -128,6 +128,28 @@ test("canonical checks: worktree, second clone, detached HEAD, wrong branch, GIT
|
||||
ok(cli(repo, ["list"], { cwd: join(link, "docs") }), /^1\tdone/);
|
||||
});
|
||||
|
||||
test("--by that differs from MOSAIC_AGENT_NAME warns on stderr and logs nothing more (N12)", (t) => {
|
||||
const warn = (by, env) => `warning: --by ${JSON.stringify(by)} differs from MOSAIC_AGENT_NAME=${JSON.stringify(env)}`;
|
||||
// Genesis goes through the same check.
|
||||
const fresh = scratchRepo(t);
|
||||
const g = ok(cli(fresh, [...genesisArgs(fresh), "--by", "sage"], { by: "darkwing" }), /^ok genesis-2026-09-26 rev 0 genesis/);
|
||||
assert.equal(g.err, `${warn("sage", "darkwing")}\n`);
|
||||
const repo = ready(t);
|
||||
// --by wins and the log records only the actor.
|
||||
const r = ok(cli(repo, ["note", "9", "hello", "--op", "note-n12-0001", "--by", "darkwing"], { by: "dewey" }), /^ok note-n12-0001 rev 1/);
|
||||
assert.equal(r.err.split("\n")[0], warn("darkwing", "dewey"));
|
||||
const e = doc(repo).log.at(-1);
|
||||
assert.deepEqual([e.by, Object.keys(e).join()], ["darkwing", "rev,op,verb,args,by,at,semantics,result,viewSha"]);
|
||||
// A refusal carries it too.
|
||||
const n = no(cli(repo, ["note", "9", "again", "--op", "note-n12-0002", "--by", "rocko"], { by: "darkwing" }), 2, /only the owner/);
|
||||
assert.equal(n.err.trimEnd().split("\n").at(-1), warn("rocko", "darkwing"));
|
||||
// Same name, or only one of the two: no warning.
|
||||
assert.equal(ok(cli(repo, ["note", "9", "three", "--op", "note-n12-0003", "--by", "darkwing"], { by: "darkwing" })).err, "");
|
||||
assert.equal(ok(cli(repo, ["note", "9", "four", "--op", "note-n12-0004"], { by: "darkwing" })).err, "");
|
||||
assert.equal(ok(cli(repo, ["note", "9", "five", "--op", "note-n12-0005", "--by", "darkwing"])).err, "");
|
||||
assert.equal(ok(cli(repo, ["note", "9", "six", "--op", "note-n12-0006", "--by", "darkwing"], { by: "" })).err, "");
|
||||
});
|
||||
|
||||
test("op ids: missing, too long, reserved; a retry answers; another payload refuses", (t) => {
|
||||
const repo = ready(t);
|
||||
no(cli(repo, ["note", "9", "hello"], { by: "darkwing" }), 4, /--op ID is required/);
|
||||
|
||||
Reference in New Issue
Block a user