✔ inbox lists only decisions routed to the human, with what approving authorizes and how to decide (126.592557ms)
✔ decide resolves by id prefix with --yes, and the trail shows it in broker order with the task to follow (130.171901ms)
✔ decide refuses without a terminal or --yes, on an unknown option and on a short reference (125.162483ms)
✔ decide prints a declining choice as declining (104.33608ms)
✔ an unknown outcome is reported once and never resent (89.318318ms)
✔ a decision closed before the answer arrives exits 2 and points at its trail (105.532354ms)
✔ a prefix that matches two open decisions exits 2 and resolves neither (105.868605ms)
✔ without --business a command uses the live host's business, and a stale host.json is not a host (65.576879ms)
✔ every human command refuses inside an agent run before it touches the bus (111.297337ms)
✔ usage errors exit 4; no business and no host is a usage error (98.771393ms)
✔ agents and tasks print through the broker (255.048787ms)
✔ notify.json: missing, loose, malformed and extra keys refuse; a binding or null passes (1.546141ms)
✔ bootConfig builds the broker's boot message for one business, with no trackers key when no project names one (45.672646ms)
✔ trackers come from the tracker.* variables of the one project that names a tracker project (32.240318ms)
✔ with two projects, the one that sets tracker.project supplies the tracker and the other is no conflict (29.603951ms)
✔ two projects that each name a tracker project refuse, since the boot shape holds one (33.350544ms)
✔ a business without tracker.baseUrl gets no trackers entry (26.705721ms)
✔ an unknown business and a broken system config refuse with exit 3 (54.028045ms)
✔ empty views say so (0.997992ms)
✔ the trail keeps the broker's order and names a decision's task without its rows (1.124414ms)
✔ tasks print the tracker fields the snapshot carries (0.15378ms)
✔ the host boots the broker, binds a launch in process, and the notifier DMs a blocking decision exactly once (895.526588ms)
✔ a notifier that dies takes the host down with exit 1, so the unit restarts the pair (212.725435ms)
✔ a second host for the same data root refuses with exit 3 while the first runs (273.362879ms)
✔ a notifier that refuses stops the broker and the host refuses with exit 3 (245.235107ms)
✔ a notifier that refuses after the broker died still refuses with exit 3, without a send to the dead broker (198.483689ms)
✔ a notifier that dies before it replies, after the broker died, still refuses, without a send to the dead broker (167.789165ms)
✔ a close send that fails with EPIPE after the notifier refuses still gives the notifier's refusal, exit 3 (197.473695ms)
✔ a close send that fails with EPIPE after the notifier dies unanswered still gives the notifier's error (124.052455ms)
✔ close() whose stop and close sends fail with EPIPE still finishes, with exit 1 (201.202702ms)
✔ watchChildren reports a child that died before it was called, and one that dies later (23.250612ms)
✔ bus stop refuses to signal a live pid that is not a bus host (202.761707ms)
✔ bus start refuses with exit 3 and the code when the broker refuses to boot; bus status names the lock (213.465669ms)
✔ bus start refuses with exit 3 without a notifier config (86.816406ms)
✔ bus start runs until bus stop; status reports it while it runs (658.567869ms)
✔ bus-service.sh renders the unit and installs it into a given directory (28.128558ms)
✔ bus start --pm: the PM runs under its own PID namespace, registered, with a manifest (1360.589465ms)
✔ the PM launches a coder through its launch tool; the coder answers; refusals name their code (776.641584ms)
✔ a runner that stops at once ends its launch with the runner's reason (199.870832ms)
✖ 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 (711.911393ms)
✖ 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 (3581.287492ms)
✔ a malformed sessions.json refuses the host start with exit 3 and stays as it was (123.48589ms)
✔ zoned uses the IANA zone across DST (17.451622ms)
✔ each open blocking decision is DM'd once, across polls and a restart; non-blocking ones are not (132.26037ms)
✔ two blocking decisions get two DMs with different nonces (118.678545ms)
✔ the digest nonce differs per business and per day and fits Discord's 25 characters (0.218622ms)
✔ a failed DM is journaled, backs off, and is retried until it lands (129.429198ms)
✔ five definite refusals stop a DM: one gave-up line, one log line, and a restart keeps the count (109.642392ms)
✔ 429s, 5xx-style unknowns and refusals without a status never count toward the limit (90.790543ms)
✔ a crash between the fifth refusal and its gave-up line: the next poll appends it and sends nothing (101.894504ms)
✔ 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 (159.050941ms)
✔ a restart after the second refusal does not send before that refusal's 30 min are up (147.116141ms)
✔ the digest goes at 08:00 Chicago once a day, with blocking ones marked as DM'd (142.57825ms)
✔ a late start with no digest for the day sends one at once; an empty inbox gets one line (249.598656ms)
✔ an inbox read failure is logged and the next poll retries (0.635093ms)
✔ no Discord id reaches the journal or the log (112.597633ms)
✔ the journal: a torn tail is copied out and truncated, so an append after it reopens cleanly (24.68035ms)
✔ the journal: a crash between the copy and the truncate leaves a tail the next open repairs (66.147162ms)
✔ the journal: a whole file that is one torn line truncates to empty (50.965235ms)
✔ the journal: a malformed complete line refuses and leaves the file and any torn tail alone (2.213804ms)
✔ the journal: a loose file mode, a loose directory or a symlinked journal refuses (0.663316ms)
✔ the journal: a line with a wrong type refuses with exit 3 and names the field (1.799538ms)
✔ the journal: a symlinked directory refuses and says it is a link (0.308098ms)
✔ 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.665486ms)
✔ the journal: an append after the file was swapped for a symlink refuses and writes nothing through it (0.365494ms)
✔ the journal: a directory it cannot write or create refuses with exit 3 and names the path (0.426602ms)
✔ digest content stays within Discord's 2000 characters (0.260771ms)
✔ runLoop never overlaps ticks and stops after the one in flight (110.010563ms)
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 (365.325466ms)
✔ the transport writes {business, verb, args} to the child and reads its JSON (42.334679ms)
✔ a bus code on stderr becomes the exit code; garbage and timeouts are outcome problems (2132.640014ms)
✔ busExit and refuseInsideAgent (0.431379ms)
✔ talk sends a REQUEST, prints and reads everything that arrives, and stops at the reply (226.693198ms)
✔ talk --wait 0 only sends; no reply within --wait exits 1 and says where it will show (1151.320994ms)
✔ talk, stop and launches off/on refuse inside an agent run; bad arguments are usage errors (103.217521ms)
✔ launches off and on go to the broker and change the business's launch state (173.616665ms)
✔ launches list reads sessions.json and marks a stale entry; stop reports it and refuses a non-runner (134.088458ms)
ℹ tests 77
ℹ suites 0
ℹ pass 75
ℹ fail 2
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 6835.150141

✖ failing tests:

test at packages/cli/tests/launcher.test.mjs:252: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 (711.911393ms)
  AssertionError [ERR_ASSERTION]: run r3e4b2104c041 (pm) from an earlier host ended: host-lost
      at TestContext.<anonymous> (file:///home/jwoltje/darkwing-scratch/r41/wt/packages/cli/tests/launcher.test.mjs:297: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: false,
    expected: true,
    operator: '==',
    diff: 'simple'
  }

test at packages/cli/tests/launcher.test.mjs:252:3
✖ 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 (3581.287492ms)
  AssertionError [ERR_ASSERTION]: run r86d98d19d98a (pm) from an earlier host ended: host-lost
      at TestContext.<anonymous> (file:///home/jwoltje/darkwing-scratch/r41/wt/packages/cli/tests/launcher.test.mjs:297: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: false,
    expected: true,
    operator: '==',
    diff: 'simple'
  }
