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:
@@ -1,8 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
# `mosaic launch <seat>` and `mosaic seat task <seat> <text>`: seat launch
|
||||
# with registration for the control board. See packages/seat/README.md.
|
||||
# `mosaic queue <verb>`: the work queue. See packages/queue/README.md.
|
||||
# Not the npm-global `mosaic` CLI from the estate tooling; this one is
|
||||
# repository-local and only reachable as scripts/mosaic.
|
||||
set -euo pipefail
|
||||
REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
if [ "${1:-}" = queue ]; then
|
||||
shift
|
||||
exec node "$REPO/packages/queue/src/cli.mjs" "$@"
|
||||
fi
|
||||
exec node "$REPO/packages/seat/src/cli.mjs" "$@"
|
||||
|
||||
+16
-10
@@ -7,8 +7,10 @@
|
||||
# NO_COLOR=1 scripts/test-queue.sh plain output
|
||||
#
|
||||
# Once HEAD holds docs/plans/queue.json (the genesis commit), the suite also
|
||||
# runs `verify` on the live queue, which takes the queue lock for a moment
|
||||
# and writes nothing.
|
||||
# runs `verify` and `render --check` on the live queue through
|
||||
# `scripts/mosaic queue`. Each takes the queue lock for a moment and writes
|
||||
# nothing. Before genesis it only checks that `scripts/mosaic queue help`
|
||||
# answers, which reads no queue file and takes no lock.
|
||||
set -uo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
@@ -29,16 +31,16 @@ echo "toolchain: node $(node --version), $(git --version)"
|
||||
echo
|
||||
|
||||
# --- syntax ---
|
||||
for f in packages/queue/src/*.mjs packages/queue/tests/*.mjs packages/queue/tests/fixtures/*.mjs scripts/queue-commit.sh scripts/git-hooks/pre-commit; do
|
||||
for f in packages/queue/src/*.mjs packages/queue/tests/*.mjs packages/queue/tests/fixtures/*.mjs packages/queue/tests/fixtures/*.sh scripts/queue-commit.sh scripts/git-hooks/pre-commit scripts/mosaic; do
|
||||
case "$f" in
|
||||
*.sh) bash -n "$f" >/dev/null 2>&1 ;;
|
||||
*.sh|scripts/mosaic) bash -n "$f" >/dev/null 2>&1 ;;
|
||||
*/pre-commit) sh -n "$f" >/dev/null 2>&1 ;;
|
||||
*) node --check "$f" >/dev/null 2>&1 ;;
|
||||
esac
|
||||
check "syntax: $f" $?
|
||||
done
|
||||
[ -x scripts/queue-commit.sh ] && [ -x scripts/git-hooks/pre-commit ]
|
||||
check "queue-commit.sh and the guard are executable" $?
|
||||
[ -x scripts/queue-commit.sh ] && [ -x scripts/git-hooks/pre-commit ] && [ -x scripts/mosaic ]
|
||||
check "queue-commit.sh, the guard and scripts/mosaic are executable" $?
|
||||
node -e 'const p=require("./packages/queue/package.json"); process.exit(p.dependencies||p.devDependencies?1:0)' >/dev/null 2>&1
|
||||
check "packages/queue declares no dependencies" $?
|
||||
|
||||
@@ -49,12 +51,16 @@ grep -E '^ℹ (tests|pass|fail) ' "$SANDBOX/tests.log"
|
||||
if [ "$rc" != 0 ]; then grep -E '^✖|Error' "$SANDBOX/tests.log" | head -40; fi
|
||||
check "node --test packages/queue/tests/" "$rc"
|
||||
|
||||
# --- the live queue, once genesis is committed ---
|
||||
# --- the dispatch, then the live queue once genesis is committed ---
|
||||
scripts/mosaic queue help > "$SANDBOX/help.out" 2>&1 && grep -q '^usage: queue list' "$SANDBOX/help.out"
|
||||
check "scripts/mosaic queue help" $?
|
||||
if git cat-file -e HEAD:docs/plans/queue.json 2>/dev/null; then
|
||||
node packages/queue/src/cli.mjs verify
|
||||
check "queue verify (live queue)" $?
|
||||
scripts/mosaic queue verify
|
||||
check "scripts/mosaic queue verify (live queue)" $?
|
||||
scripts/mosaic queue render --check
|
||||
check "scripts/mosaic queue render --check (live queue)" $?
|
||||
else
|
||||
echo "skip queue verify: HEAD has no docs/plans/queue.json (before the genesis commit)"
|
||||
echo "skip queue verify and render --check: HEAD has no docs/plans/queue.json (before the genesis commit)"
|
||||
fi
|
||||
|
||||
echo
|
||||
|
||||
Reference in New Issue
Block a user