From 2f5303c1c730520e22b8937206080b15e11ac554 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Fri, 9 Oct 2026 07:49:38 -0500 Subject: [PATCH] feat(cli): the mosaic CLI, broker host and decision notifier (row 39, S4, rocko) packages/cli adds mosaic inbox, decide, tasks, agents and trail over the human-cli transport, and mosaic bus start, stop and status as the trusted host (unit mosaic-bus@, scripts/bus-service.sh). The host boots packages/bus/src/process.mjs, passes config.trackers from the tracker.* variables (lead decision 70), and runs a notifier child. The notifier DMs each open blocking decision once and sends an 08:00 America/Chicago digest, journaled in notify//sent.jsonl at 0600 with no Discord ids. A torn journal tail is copied aside and truncated; a malformed line, a directory looser than 0700 or a symlinked journal refuses (lead decision 71). packages/discord gains dmRecipient, createDm and notify.mjs. Candidate agents/rocko/work/slice1-s4, base b9b6cf00, build.patch b52f7d68, manifest e858504e (29 files). Darkwing approved round 2 on #1521 (comment 26855), Filbert approved round 2 (comment 26856). The packet's mutant table lists M28 as killed; it survived, and BUILD-LOG records the correction. Integration gate in a worktree on 2557e29d with the patch applied: bus 67, business 60, cli 49, control-board 124, discord 178, ledger 78, mosaic 69, queue 148, seat 19, tasks 51 and webui 14, all with no failures. Conversation is 149/3, the same K1, K3 and K10 cases that fail on the base; S4 doesn't touch the package. Every scripts/test-*.sh is green, with test-release 14/14 and test-task 98/98 on the existing gate2 compose network. A scratch test, not in this commit, booted the real host with trackers against S3's fake Vikunja: the adapter went ready and a task.close on a missing task answered task-not-found after a Vikunja read. Co-Authored-By: Claude Opus 5.5 --- docs/TOOLS.md | 22 ++ packages/cli/README.md | 225 +++++++++++++++++ packages/cli/package.json | 11 + packages/cli/src/cli.mjs | 211 ++++++++++++++++ packages/cli/src/config.mjs | 103 ++++++++ packages/cli/src/errors.mjs | 12 + packages/cli/src/format.mjs | 97 ++++++++ packages/cli/src/host.mjs | 247 ++++++++++++++++++ packages/cli/src/index.mjs | 8 + packages/cli/src/notifier-process.mjs | 52 ++++ packages/cli/src/notifier.mjs | 276 +++++++++++++++++++++ packages/cli/src/transport.mjs | 75 ++++++ packages/cli/systemd/mosaic-bus.service.in | 33 +++ packages/cli/tests/cli.test.mjs | 187 ++++++++++++++ packages/cli/tests/config.test.mjs | 67 +++++ packages/cli/tests/format.test.mjs | 27 ++ packages/cli/tests/helpers.mjs | 113 +++++++++ packages/cli/tests/host.test.mjs | 222 +++++++++++++++++ packages/cli/tests/notifier.test.mjs | 244 ++++++++++++++++++ packages/cli/tests/transport.test.mjs | 50 ++++ packages/discord/README.md | 10 +- packages/discord/src/binding.mjs | 17 +- packages/discord/src/notify.mjs | 46 ++++ packages/discord/src/rest.mjs | 14 ++ packages/discord/tests/binding.test.mjs | 14 +- packages/discord/tests/notify.test.mjs | 80 ++++++ packages/discord/tests/rest.test.mjs | 26 ++ scripts/bus-service.sh | 122 +++++++++ scripts/mosaic | 5 + 29 files changed, 2610 insertions(+), 6 deletions(-) create mode 100644 packages/cli/README.md create mode 100644 packages/cli/package.json create mode 100644 packages/cli/src/cli.mjs create mode 100644 packages/cli/src/config.mjs create mode 100644 packages/cli/src/errors.mjs create mode 100644 packages/cli/src/format.mjs create mode 100644 packages/cli/src/host.mjs create mode 100644 packages/cli/src/index.mjs create mode 100644 packages/cli/src/notifier-process.mjs create mode 100644 packages/cli/src/notifier.mjs create mode 100644 packages/cli/src/transport.mjs create mode 100644 packages/cli/systemd/mosaic-bus.service.in create mode 100644 packages/cli/tests/cli.test.mjs create mode 100644 packages/cli/tests/config.test.mjs create mode 100644 packages/cli/tests/format.test.mjs create mode 100644 packages/cli/tests/helpers.mjs create mode 100644 packages/cli/tests/host.test.mjs create mode 100644 packages/cli/tests/notifier.test.mjs create mode 100644 packages/cli/tests/transport.test.mjs create mode 100644 packages/discord/src/notify.mjs create mode 100644 packages/discord/tests/notify.test.mjs create mode 100755 scripts/bus-service.sh diff --git a/docs/TOOLS.md b/docs/TOOLS.md index da706aec..e07eabfa 100644 --- a/docs/TOOLS.md +++ b/docs/TOOLS.md @@ -190,6 +190,28 @@ Exit codes: `0` ok · `2` invalid file or credential reference · `3` system config problem · `4` usage or a required file missing. Details: `packages/business/README.md`. +## Inbox, decisions and the bus host (`scripts/mosaic`) + +```bash +scripts/mosaic inbox | tasks | agents [--business ] [--json] +scripts/mosaic decide