✔ inbox lists only decisions routed to the human, with what approving authorizes and how to decide (109.913293ms)
✔ decide resolves by id prefix with --yes, and the trail shows it in broker order with the task to follow (118.003851ms)
✔ decide refuses without a terminal or --yes, on an unknown option and on a short reference (112.137885ms)
✔ decide prints a declining choice as declining (89.265726ms)
✔ an unknown outcome is reported once and never resent (89.912343ms)
✔ a decision closed before the answer arrives exits 2 and points at its trail (85.265998ms)
✔ a prefix that matches two open decisions exits 2 and resolves neither (52.238147ms)
✔ without --business a command uses the live host's business, and a stale host.json is not a host (68.233399ms)
✔ every human command refuses inside an agent run before it touches the bus (67.127441ms)
✔ usage errors exit 4; no business and no host is a usage error (71.682669ms)
✔ agents and tasks print through the broker (79.521375ms)
✔ notify.json: missing, loose, malformed and extra keys refuse; a binding or null passes (1.228315ms)
✔ bootConfig builds the broker's boot message for one business, with no trackers key when no project names one (38.366322ms)
✔ trackers come from the tracker.* variables of the one project that names a tracker project (31.004033ms)
✔ with two projects, the one that sets tracker.project supplies the tracker and the other is no conflict (32.779757ms)
✔ two projects that each name a tracker project refuse, since the boot shape holds one (35.905233ms)
✔ a business without tracker.baseUrl gets no trackers entry (26.900284ms)
✔ an unknown business and a broken system config refuse with exit 3 (50.20401ms)
✔ empty views say so (0.627154ms)
✔ the trail keeps the broker's order and names a decision's task without its rows (0.788734ms)
✔ tasks print the tracker fields the snapshot carries (0.125733ms)
✔ the host boots the broker, binds a launch in process, and the notifier DMs a blocking decision exactly once (880.818489ms)
✔ a notifier that dies takes the host down with exit 1, so the unit restarts the pair (212.656955ms)
✔ a second host for the same data root refuses with exit 3 while the first runs (107.839478ms)
✔ a broker reply that misses the wait breaks the channel: the late reply answers nothing, later requests refuse, the host exits 1 (1114.602676ms)
✔ a broker reply with another request's id, or none, breaks the channel and the host exits 1 (237.868839ms)
✔ a notifier that refuses stops the broker and the host refuses with exit 3 (165.633158ms)
✔ a notifier that refuses after the broker died still refuses with exit 3, without a send to the dead broker (196.857419ms)
✔ a notifier that dies before it replies, after the broker died, still refuses, without a send to the dead broker (106.479174ms)
✔ a close send that fails with EPIPE after the notifier refuses still gives the notifier's refusal, exit 3 (154.774028ms)
✔ a close send that fails with EPIPE after the notifier dies unanswered still gives the notifier's error (112.580721ms)
✔ close() whose stop and close sends fail with EPIPE still finishes, with exit 1 (164.633695ms)
✔ watchChildren reports a child that died before it was called, and one that dies later (22.667092ms)
✔ bus stop refuses to signal a live pid that is not a bus host (202.90696ms)
✔ bus start refuses with exit 3 and the code when the broker refuses to boot; bus status names the lock (220.56323ms)
✔ bus start refuses with exit 3 without a notifier config (91.521228ms)
✔ bus start runs until bus stop; status reports it while it runs (654.540544ms)
✔ bus-service.sh renders the unit and installs it into a given directory (28.054852ms)
✔ bus start --pm: the PM runs under its own PID namespace, registered, with a manifest (255.366834ms)
✔ the PM launches a coder through its launch tool; the coder answers; refusals name their code (633.879827ms)
✔ a runner that stops at once ends its launch with the runner's reason (238.334932ms)
✖ a host that died hard leaves its sessions to the next host, which kills them and ends their runs so the role can be launched again (5389.23578ms)
✔ a host that died hard leaves its sessions to the next host, which finds one already exited (23) and ends their runs so the role can be launched again (3591.216651ms)
✔ a malformed sessions.json refuses the host start with exit 3 and stays as it was (109.661685ms)
✔ an over-long launch request is refused at once, not at the 10 s idle timeout (109.2473ms)
✔ a launch client that never closes its side doesn't hold the host's close (117.02329ms)
✔ a runner that ignores SIGTERM is killed when the host closes (1223.335505ms)
✔ zoned uses the IANA zone across DST (24.090291ms)
✔ each open blocking decision is DM'd once, across polls and a restart; non-blocking ones are not (107.844441ms)
✔ two blocking decisions get two DMs with different nonces (108.944801ms)
✔ the digest nonce differs per business and per day and fits Discord's 25 characters (0.180553ms)
✔ a failed DM is journaled, backs off, and is retried until it lands (114.135107ms)
✔ five definite refusals stop a DM: one gave-up line, one log line, and a restart keeps the count (92.814309ms)
✔ 429s, 5xx-style unknowns and refusals without a status never count toward the limit (89.814961ms)
✔ a crash between the fifth refusal and its gave-up line: the next poll appends it and sends nothing (91.252846ms)
✔ polled every POLL_MS against a permanent 403, a DM is sent at 0, 30, 60, 90 and 120 min and gives up only then (107.781293ms)
✔ a restart after the second refusal does not send before that refusal's 30 min are up (111.991959ms)
✔ the digest goes at 08:00 Chicago once a day, with blocking ones marked as DM'd (112.477383ms)
✔ a late start with no digest for the day sends one at once; an empty inbox gets one line (90.654855ms)
✔ an inbox read failure is logged and the next poll retries (0.62123ms)
✔ no Discord id reaches the journal or the log (57.000052ms)
✔ the journal: a torn tail is copied out and truncated, so an append after it reopens cleanly (18.664385ms)
✔ the journal: a crash between the copy and the truncate leaves a tail the next open repairs (20.990527ms)
✔ the journal: a whole file that is one torn line truncates to empty (10.493841ms)
✔ the journal: a malformed complete line refuses and leaves the file and any torn tail alone (0.584681ms)
✔ the journal: a loose file mode, a loose directory or a symlinked journal refuses (0.551121ms)
✔ the journal: a line with a wrong type refuses with exit 3 and names the field (1.801933ms)
✔ the journal: a symlinked directory refuses and says it is a link (0.307542ms)
✔ the journal: a dangling directory link, a parent that is a file and a journal that is a directory each refuse with exit 3 (0.475672ms)
✔ the journal: an append after the file was swapped for a symlink refuses and writes nothing through it (0.351519ms)
✔ the journal: a directory it cannot write or create refuses with exit 3 and names the path (0.426221ms)
✔ digest content stays within Discord's 2000 characters (0.257949ms)
✔ runLoop never overlaps ticks and stops after the one in flight (110.73641ms)
task.close {} answered: invalid-request; fake saw 18 requests, first GET /info 200, GET /projects/1 200, GET /projects/1/views 200
task.close on a missing task answered: task-not-found; it made GET /tasks/999 404
✔ bootConfig trackers reach the S3 adapter in the real broker child, which goes ready against a fake Vikunja (346.30492ms)
✔ the transport writes {business, verb, args} to the child and reads its JSON (34.874451ms)
✔ a bus code on stderr becomes the exit code; garbage and timeouts are outcome problems (2130.964328ms)
✔ busExit and refuseInsideAgent (0.412311ms)
✔ talk sends a REQUEST, prints and reads everything that arrives, and stops at the reply (195.456423ms)
✔ talk --wait 0 only sends; no reply within --wait exits 1 and says where it will show (1130.733553ms)
✔ talk, stop and launches off/on refuse inside an agent run; bad arguments are usage errors (47.180538ms)
✔ launches off and on go to the broker and change the business's launch state (56.131748ms)
✔ launches list reads sessions.json and marks a stale entry; stop reports it and refuses a non-runner (54.65592ms)
ℹ tests 82
ℹ suites 0
ℹ pass 81
ℹ fail 1
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 11744.146829

✖ failing tests:

test at packages/cli/tests/launcher.test.mjs:253:3
✖ a host that died hard leaves its sessions to the next host, which kills them and ends their runs so the role can be launched again (5389.23578ms)
  AssertionError [ERR_ASSERTION]: the old session process is gone
  + actual - expected
  
  + '293295372'
  - null
  
      at TestContext.<anonymous> (file:///home/jwoltje/darkwing-scratch/r41b/wt/packages/cli/tests/launcher.test.mjs:288:12)
      at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
      at async Test.run (node:internal/test_runner/test:1409:7)
      at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) {
    generatedMessage: false,
    code: 'ERR_ASSERTION',
    actual: '293295372',
    expected: null,
    operator: 'strictEqual',
    diff: 'simple'
  }
