✔ inbox lists only decisions routed to the human, with what approving authorizes and how to decide (116.271488ms)
✔ decide resolves by id prefix with --yes, and the trail shows it in broker order with the task to follow (124.069222ms)
✔ decide refuses without a terminal or --yes, on an unknown option and on a short reference (104.243829ms)
✔ decide prints a declining choice as declining (97.196386ms)
✔ an unknown outcome is reported once and never resent (79.174498ms)
✔ a decision closed before the answer arrives exits 2 and points at its trail (88.606533ms)
✔ a prefix that matches two open decisions exits 2 and resolves neither (87.768697ms)
✔ without --business a command uses the live host's business, and a stale host.json is not a host (47.324214ms)
✔ every human command refuses inside an agent run before it touches the bus (64.01629ms)
✔ usage errors exit 4; no business and no host is a usage error (60.613922ms)
✔ agents and tasks print through the broker (89.36753ms)
✔ notify.json: missing, loose, malformed and extra keys refuse; a binding or null passes (1.407524ms)
✔ bootConfig builds the broker's boot message for one business, with no trackers key when no project names one (54.927595ms)
✔ trackers come from the tracker.* variables of the one project that names a tracker project (40.01449ms)
✔ with two projects, the one that sets tracker.project supplies the tracker and the other is no conflict (36.208705ms)
✔ two projects that each name a tracker project refuse, since the boot shape holds one (35.601892ms)
✔ a business without tracker.baseUrl gets no trackers entry (34.864903ms)
✔ an unknown business and a broken system config refuse with exit 3 (68.275677ms)
✔ empty views say so (1.01893ms)
✔ the trail keeps the broker's order and names a decision's task without its rows (1.571284ms)
✔ tasks print the tracker fields the snapshot carries (0.274696ms)
✔ the host boots the broker, binds a launch in process, and the notifier DMs a blocking decision exactly once (918.699061ms)
✔ a notifier that dies takes the host down with exit 1, so the unit restarts the pair (191.902414ms)
✔ a second host for the same data root refuses with exit 3 while the first runs (117.63791ms)
✔ a broker reply that misses the wait breaks the channel: the late reply answers nothing, later requests refuse, the host exits 1 (1156.488334ms)
✔ a broker reply with another request's id, or none, breaks the channel and the host exits 1 (235.475124ms)
✖ a broker reply with no request waiting breaks the channel and the host exits 1 (5114.342057ms)
✔ a notifier that refuses stops the broker and the host refuses with exit 3 (170.136813ms)
✔ a notifier that refuses after the broker died still refuses with exit 3, without a send to the dead broker (152.483597ms)
✔ a notifier that dies before it replies, after the broker died, still refuses, without a send to the dead broker (103.739555ms)
✔ a close send that fails with EPIPE after the notifier refuses still gives the notifier's refusal, exit 3 (160.130914ms)
✔ a close send that fails with EPIPE after the notifier dies unanswered still gives the notifier's error (107.057276ms)
✔ close() whose stop and close sends fail with EPIPE still finishes, with exit 1 (162.775445ms)
✔ watchChildren reports a child that died before it was called, and one that dies later (24.15224ms)
✔ bus stop refuses to signal a live pid that is not a bus host (202.679021ms)
✔ bus start refuses with exit 3 and the code when the broker refuses to boot; bus status names the lock (300.192263ms)
✔ bus start refuses with exit 3 without a notifier config (118.208902ms)
✔ bus start runs until bus stop; status reports it while it runs (723.480686ms)
✔ bus-service.sh renders the unit and installs it into a given directory (33.590569ms)
✔ bus start --pm: the PM runs under its own PID namespace, registered, with a manifest (1268.563017ms)
✔ the PM launches a coder through its launch tool; the coder answers; refusals name their code (605.423586ms)
✔ a runner that stops at once ends its launch with the runner's reason (186.260867ms)
✔ 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 (638.409248ms)
✔ 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 (3565.207706ms)
✔ a malformed sessions.json refuses the host start with exit 3 and stays as it was (109.678021ms)
✔ an over-long launch request is refused at once, not at the 10 s idle timeout (113.427619ms)
✔ a launch client that never closes its side doesn't hold the host's close (124.913124ms)
✔ a runner that ignores SIGTERM is killed when the host closes (1224.938589ms)
✔ zoned uses the IANA zone across DST (18.314057ms)
✔ each open blocking decision is DM'd once, across polls and a restart; non-blocking ones are not (118.717327ms)
✔ two blocking decisions get two DMs with different nonces (110.677761ms)
✔ the digest nonce differs per business and per day and fits Discord's 25 characters (0.300255ms)
✔ a failed DM is journaled, backs off, and is retried until it lands (92.543944ms)
✔ five definite refusals stop a DM: one gave-up line, one log line, and a restart keeps the count (95.966315ms)
✔ 429s, 5xx-style unknowns and refusals without a status never count toward the limit (88.423173ms)
✔ a crash between the fifth refusal and its gave-up line: the next poll appends it and sends nothing (90.76417ms)
✔ 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 (156.662576ms)
✔ a restart after the second refusal does not send before that refusal's 30 min are up (100.982989ms)
✔ the digest goes at 08:00 Chicago once a day, with blocking ones marked as DM'd (103.052373ms)
✔ a late start with no digest for the day sends one at once; an empty inbox gets one line (59.556795ms)
✔ an inbox read failure is logged and the next poll retries (0.580257ms)
✔ no Discord id reaches the journal or the log (72.423056ms)
✔ the journal: a torn tail is copied out and truncated, so an append after it reopens cleanly (10.998211ms)
✔ the journal: a crash between the copy and the truncate leaves a tail the next open repairs (21.426466ms)
✔ the journal: a whole file that is one torn line truncates to empty (19.539524ms)
✔ the journal: a malformed complete line refuses and leaves the file and any torn tail alone (0.666391ms)
✔ the journal: a loose file mode, a loose directory or a symlinked journal refuses (0.640771ms)
✔ the journal: a line with a wrong type refuses with exit 3 and names the field (1.802934ms)
✔ the journal: a symlinked directory refuses and says it is a link (0.299762ms)
✔ 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.471224ms)
✔ the journal: an append after the file was swapped for a symlink refuses and writes nothing through it (0.348548ms)
✔ the journal: a directory it cannot write or create refuses with exit 3 and names the path (0.413823ms)
✔ digest content stays within Discord's 2000 characters (0.255603ms)
✔ runLoop never overlaps ticks and stops after the one in flight (110.982927ms)
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 (375.284603ms)
✔ the transport writes {business, verb, args} to the child and reads its JSON (42.802247ms)
✔ a bus code on stderr becomes the exit code; garbage and timeouts are outcome problems (2170.769467ms)
✔ busExit and refuseInsideAgent (0.403611ms)
✔ talk sends a REQUEST, prints and reads everything that arrives, and stops at the reply (201.152444ms)
✔ talk --wait 0 only sends; no reply within --wait exits 1 and says where it will show (1129.541481ms)
✔ talk, stop and launches off/on refuse inside an agent run; bad arguments are usage errors (78.064968ms)
✔ launches off and on go to the broker and change the business's launch state (71.657225ms)
✔ launches list reads sessions.json and marks a stale entry; stop reports it and refuses a non-runner (68.686108ms)
ℹ tests 83
ℹ suites 0
ℹ pass 82
ℹ fail 1
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 10130.129185

✖ failing tests:

test at packages/cli/tests/host.test.mjs:265:1
✖ a broker reply with no request waiting breaks the channel and the host exits 1 (5114.342057ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  + actual - expected
  
  + 'still running'
  - 1
  
      at TestContext.<anonymous> (file:///home/jwoltje/darkwing-scratch/r41c/wt/packages/cli/tests/host.test.mjs:283:10)
      at async Test.run (node:internal/test_runner/test:1409:7)
      at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: 'still running',
    expected: 1,
    operator: 'strictEqual',
    diff: 'simple'
  }
