✔ isRunId accepts the run id shape and nothing else (2.040623ms)
✔ a missing data root or runs directory lists nothing (3.167511ms)
✔ runs as a regular file lists nothing, as before (1.148056ms)
✔ listRunIds keeps r- names only, sorted oldest first (1.529862ms)
✔ listRunRecords returns each result, or null for an incomplete or unreadable one (4.035385ms)
✔ readRunRecord returns documents and artifacts in directory order (2.356077ms)
✔ readRunRecord is null for a missing run, a dangling link or a file (1.382285ms)
✔ readRunRecord and readRunDocument refuse an invalid run id before touching the disk (1.21881ms)
✔ readRunDocument reads only the three run documents (1.081942ms)
✔ a link inside the data root is followed (1.529533ms)
✔ a data root that is itself a link is trusted as configured (1.029457ms)
✔ a run directory linked out of the data root is never read (1.182624ms)
✔ a document linked out of the data root reads as null (1.55228ms)
✔ a runs directory linked out of the data root refuses (0.964271ms)
✔ a relative link that climbs out of the data root refuses (0.735934ms)
✔ a sibling whose name starts with the data root's name is outside it (0.835571ms)
✔ a link loop refuses instead of reading as missing (1.106386ms)
✔ an unreadable runs directory refuses instead of listing nothing (0.726369ms)
✔ an unreadable run directory refuses instead of reading as missing (0.851219ms)
✔ a link to the data root's parent is outside it (0.763768ms)
✔ listRunIds sorts whatever order the directory returns (1.218202ms)
✔ the readers write nothing (3.280544ms)
✔ no pointer is null (2.733337ms)
✔ the pointer release.sh writes reads back (1.378784ms)
✔ a pointer that isn't the version 1 shape refuses with exit 2 (5.183544ms)
✔ a pointer that is a directory refuses with exit 4 (1.322104ms)
✔ a state file linked out of the data root refuses (1.28962ms)
✔ a state directory linked out of the data root refuses (0.633332ms)
✔ a missing log is empty (0.439431ms)
✔ the log reads oldest first and counts malformed lines (0.988303ms)
✖ last must be a positive integer (1.077906ms)
✔ the state readers write nothing (1.24199ms)
✔ list prints each run in the established format (110.647803ms)
✔ show prints the run in the established format (110.994361ms)
✔ show of a missing run and an invalid id exit 4 as before (129.235851ms)
✔ list and show refuse a runs directory linked out of the data root (177.07234ms)
✔ show refuses a run linked out of the data root; list reports it unknown (199.262239ms)
ℹ tests 37
ℹ suites 0
ℹ pass 36
ℹ fail 1
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 806.760074

✖ failing tests:

test at packages/runs/tests/state.test.mjs:106:1
✖ last must be a positive integer (1.077906ms)
  AssertionError [ERR_ASSERTION]: Missing expected exception: 0
      at TestContext.<anonymous> (file:///home/jwoltje/darkwing-scratch/r56a/mutwt/packages/runs/tests/state.test.mjs:109:12)
      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: false,
    code: 'ERR_ASSERTION',
    actual: undefined,
    expected: /last must be a positive integer/,
    operator: 'throws',
    diff: 'simple'
  }
