feat(queue): queue as data A1, journal, lock, CLI and verify (#1508)
packages/queue, scripts/queue-commit.sh, scripts/git-hooks and scripts/test-queue.sh, plus docs/plans/BRIEF-TEMPLATE.md. There is no queue.json yet, so verify skips until the genesis commit after A2. Darkwing built it, and Filbert reviewed R0 (6933b885, changes requested) and r1 (e464be6c, approved). The 20 files match manifest 85a8a453. The nine suites passed on an index export, including the new queue suite. test-queue.sh joins the suite list in AGENTS.md. Lead decisions 20, 23 and 26. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
// Child process for the SIGKILL tests. argv: SRC_DIR STEP REQUEST_JSON.
|
||||
// Runs one mutation from the working directory and kills itself with
|
||||
// SIGKILL when the write path reaches STEP (8.5).
|
||||
import { join } from "node:path";
|
||||
import { pathToFileURL } from "node:url";
|
||||
|
||||
const [src, step, json] = process.argv.slice(2);
|
||||
const store = await import(pathToFileURL(join(src, "store.mjs")).href);
|
||||
store.mutate({ hook: (name) => { if (name === step) process.kill(process.pid, "SIGKILL"); } }, JSON.parse(json));
|
||||
process.stdout.write("finished without reaching the step\n");
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// Child process for the lock tests. argv: GITDIR MODE
|
||||
// kill-before-link SIGKILL itself after the temp record is written
|
||||
// hold take the lock, print "held", then wait to be killed
|
||||
import { realIo, sleepMs } from "../../src/io.mjs";
|
||||
import { acquire } from "../../src/lock.mjs";
|
||||
|
||||
const [gitDir, mode] = process.argv.slice(2);
|
||||
if (mode === "kill-before-link") {
|
||||
acquire({ gitDir, io: realIo, verb: "move", hook: (n) => { if (n === "lock-temp-written") process.kill(process.pid, "SIGKILL"); } });
|
||||
} else if (mode === "hold") {
|
||||
acquire({ gitDir, io: realIo, op: "holder-op-1", verb: "move" });
|
||||
process.stdout.write("held\n");
|
||||
sleepMs(60000);
|
||||
}
|
||||
Reference in New Issue
Block a user