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:
2026-09-26 20:14:09 -05:00
co-authored by Claude Opus 5.5
parent c9539baa0f
commit 6ca116b7ba
32 changed files with 4886 additions and 103 deletions
+6 -1
View File
@@ -3,7 +3,7 @@
// the two discord helpers it imports, so the code-under-root check (8.3)
// passes there and nothing touches this checkout's .git.
import { spawnSync } from "node:child_process";
import { cpSync, mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from "node:fs";
import { cpSync, mkdirSync, mkdtempSync, realpathSync, rmSync, statfsSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { dirname, join } from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
@@ -74,6 +74,11 @@ export function queueMd(body = LEGACY) {
// `scripts`, it also commits queue-commit.sh, the guard and a one-test
// packages/queue/tests, so the commit procedure has an archive to run.
export function scratchRepo(t, { map = mapText(), commitMap = true, name = "repo", scripts = false } = {}) {
// The CLI refuses tmpfs (N5), and the child-process tests can't pass it a
// test layer, so a tmpfs temp directory would fail them all confusingly.
if (statfsSync(tmpdir()).type === 0x01021994) {
throw new Error(`${tmpdir()} is tmpfs, which the queue refuses; set TMPDIR to a directory on ext4, xfs or btrfs`);
}
const base = realpathSync(mkdtempSync(join(tmpdir(), "mosaic-queue-test-")));
if (t) t.after(() => rmSync(base, { recursive: true, force: true }));
const home = join(base, "home");