✔ isRunId accepts the run id shape and nothing else (2.009126ms)
✔ a missing data root or runs directory lists nothing (13.094847ms)
✔ runs as a regular file lists nothing, as before (2.278303ms)
✔ listRunIds keeps r- names only, sorted oldest first (2.327495ms)
✔ listRunRecords returns each result, or null for an incomplete or unreadable one (4.905919ms)
✔ readRunRecord returns documents and artifacts in directory order (7.96623ms)
✔ readRunRecord is null for a missing run, a dangling link or a file (3.918579ms)
✔ readRunRecord and readRunDocument refuse an invalid run id before touching the disk (5.602756ms)
✔ readRunDocument reads only the three run documents (3.521732ms)
✔ a link inside the data root is followed (3.442024ms)
✔ a data root that is itself a link is trusted as configured (2.005087ms)
✔ a run directory linked out of the data root is never read (2.084232ms)
✔ a document linked out of the data root reads as null (7.619635ms)
✔ a runs directory linked out of the data root refuses (1.250289ms)
✔ a relative link that climbs out of the data root refuses (0.818784ms)
✔ a sibling whose name starts with the data root's name is outside it (3.850288ms)
✔ a link loop refuses instead of reading as missing (4.675288ms)
✔ an unreadable runs directory refuses instead of listing nothing (1.954118ms)
✔ an unreadable run directory refuses instead of reading as missing (1.858696ms)
✔ a link to the data root's parent is outside it (1.178473ms)
✔ listRunIds sorts whatever order the directory returns (1.430997ms)
✔ listRunRecords lists an r- name that isn't a valid run id, as before (3.626875ms)
✔ the readers write nothing (3.631659ms)
✔ no pointer is null (12.722881ms)
✔ the pointer release.sh writes reads back (2.956634ms)
✔ a pointer that isn't the version 1 shape refuses with exit 2 (23.610773ms)
✔ a pointer that is a directory refuses with exit 4 (2.467786ms)
✔ a state file linked out of the data root refuses (9.154475ms)
✔ a state directory linked out of the data root refuses (5.636323ms)
✔ a state directory linked out to nothing reads as no release and an empty log (0.989436ms)
✔ a missing log is empty (0.893401ms)
✖ the log reads oldest first and counts malformed lines (3.734558ms)
✔ last must be a positive integer (0.948278ms)
✔ the state readers write nothing (2.050762ms)
✔ list prints each run in the established format (139.06499ms)
✔ show prints the run in the established format (91.810125ms)
✔ show of a missing run and an invalid id exit 4 as before (268.025853ms)
✔ list and show refuse a runs directory linked out of the data root (205.373671ms)
✔ show refuses a run linked out of the data root; list reports it unknown (196.491701ms)
✔ list shows an r- name that isn't a valid run id, as before (89.089467ms)
✔ show refuses an invalid id before reading the config (49.958959ms)
ℹ tests 41
ℹ suites 0
ℹ pass 40
ℹ fail 1
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 1233.510304

✖ failing tests:

test at packages/runs/tests/state.test.mjs:87:1
✖ the log reads oldest first and counts malformed lines (3.734558ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
  + actual - expected
  ... Skipped lines
  
    {
      entries: [
        {
          at: '2026-09-03T20:57:00Z',
          event: 'package',
  ...
      ],
  +   malformed: 8
  -   malformed: 7
    }
  
      at TestContext.<anonymous> (file:///home/jwoltje/darkwing-scratch/r56b/mutwt/packages/runs/tests/state.test.mjs:110:10)
      at Test.runInAsyncScope (node:async_hooks:226:14)
      at Test.run (node:internal/test_runner/test:1402:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:974:18)
      at Test.postRun (node:internal/test_runner/test:1542:19)
      at Test.run (node:internal/test_runner/test:1467:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: { entries: [ [Object], [Object], [Object], [Object] ], malformed: 8 },
    expected: { entries: [ [Object], [Object], [Object], [Object] ], malformed: 7 },
    operator: 'deepStrictEqual',
    diff: 'simple'
  }
