✔ isRunId accepts the run id shape and nothing else (2.461841ms)
✔ a missing data root or runs directory lists nothing (4.122833ms)
✔ runs as a regular file lists nothing, as before (1.049435ms)
✔ listRunIds keeps r- names only, sorted oldest first (1.484169ms)
✔ listRunRecords returns each result, or null for an incomplete or unreadable one (5.953769ms)
✔ readRunRecord returns documents and artifacts in directory order (2.533866ms)
✔ readRunRecord is null for a missing run, a dangling link or a file (1.781628ms)
✔ readRunRecord and readRunDocument refuse an invalid run id before touching the disk (1.272589ms)
✔ readRunDocument reads only the three run documents (1.222564ms)
✔ a link inside the data root is followed (2.349315ms)
✔ a data root that is itself a link is trusted as configured (4.990435ms)
✔ a run directory linked out of the data root is never read (1.847834ms)
✔ a document linked out of the data root reads as null (1.825285ms)
✔ a runs directory linked out of the data root refuses (1.095073ms)
✔ a relative link that climbs out of the data root refuses (0.798642ms)
✔ a sibling whose name starts with the data root's name is outside it (0.914727ms)
✔ a link loop refuses instead of reading as missing (2.417719ms)
✔ an unreadable runs directory refuses instead of listing nothing (0.968089ms)
✔ an unreadable run directory refuses instead of reading as missing (1.041544ms)
✔ a link to the data root's parent is outside it (0.822282ms)
✔ listRunIds sorts whatever order the directory returns (1.693855ms)
✔ the readers write nothing (4.240004ms)
✔ no pointer is null (4.711471ms)
✔ the pointer release.sh writes reads back (3.19144ms)
✔ a pointer that isn't the version 1 shape refuses with exit 2 (3.698419ms)
✖ a pointer that is a directory refuses with exit 4 (2.271643ms)
✔ a state file linked out of the data root refuses (3.820894ms)
✔ a state directory linked out of the data root refuses (1.328242ms)
✔ a missing log is empty (0.757558ms)
✔ the log reads oldest first and counts malformed lines (3.341732ms)
✔ last must be a positive integer (1.01732ms)
✔ the state readers write nothing (2.075785ms)
✔ list prints each run in the established format (134.172955ms)
✔ show prints the run in the established format (111.604381ms)
✔ show of a missing run and an invalid id exit 4 as before (176.970683ms)
✔ list and show refuse a runs directory linked out of the data root (212.899331ms)
✔ show refuses a run linked out of the data root; list reports it unknown (174.178303ms)
ℹ tests 37
ℹ suites 0
ℹ pass 36
ℹ fail 1
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 930.307733

✖ failing tests:

test at packages/runs/tests/state.test.mjs:51:1
✖ a pointer that is a directory refuses with exit 4 (2.271643ms)
  AssertionError [ERR_ASSERTION]: Missing expected exception.
      at TestContext.<anonymous> (file:///home/jwoltje/darkwing-scratch/r56a/mutwt/packages/runs/tests/state.test.mjs:54: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: false,
    code: 'ERR_ASSERTION',
    actual: undefined,
    operator: 'throws',
    diff: 'simple'
  }
