✔ sessionModel: agent vars win, then the system's execution settings (14.299541ms)
✔ a pi bundle: prompt, policy, tools and manifest, 0600 in a 0700 directory (5.780738ms)
✔ a claude-code bundle adds the wrapped gate hook and the MCP config (3.604431ms)
✔ a bundle is written once: an existing file refuses (2.734256ms)
✔ a path with a single quote can't go into the hook command (2.413831ms)
✔ allow exits 0, a deny exits 2 with the reason on stderr (110.199454ms)
✔ a missing or wrong policy, or a bad event, exits 2 (78.793969ms)
✔ the bundle's wrapped command: a missing gate or node still blocks (1088.879771ms)
✔ claude: typed tools through MCP, the hook blocks, builtins outside --tools don't exist (714.853734ms)
✔ claude: the hook alone blocks a path outside the workspace (470.857176ms)
✔ claude: a second turn resumes the first turn's session (784.713208ms)
✔ claude adapter: --restricted is always passed (5.282364ms)
✔ claude: CLAUDE.md files and auto-memory don't reach the model; without --restricted they do (758.968543ms)
✔ claude: a missing hook or MCP file refuses before claude starts (7.18475ms)
✔ pi: policy tools and typed tools pass, anything else is blocked (3.258612ms)
✔ claude: builtins map from pi names, typed tools need the mcp prefix (0.984727ms)
✔ file tool paths must resolve inside the workspace (1.751711ms)
✔ pi's own path normalisation can't be used to step out (1.275253ms)
✔ a symlink inside the workspace that points out is outside (1.244755ms)
✔ a dangling symlink is refused at any depth, in both harnesses (3.65246ms)
✖ read is checked under every spelling pi's read would open, in both harnesses (8.041349ms)
✔ other spellings cover directories, dangling links and pi's cwd (1.519293ms)
✔ a relative path climbs from the workspace's real path, in both harnesses (4.833057ms)
✔ claude path fields per tool (0.725909ms)
✔ glob patterns stay inside the workspace (0.611487ms)
✔ a path that can't be checked is blocked (0.668466ms)
✔ initialize, ping and tools/list (44.543011ms)
✔ tools/call goes through the tool socket; a refusal is an isError result (30.236293ms)
✔ unknown tools and methods are JSON-RPC errors and never reach the socket (27.704757ms)
✔ a missing argument is a usage error (28.079649ms)
✔ pi: typed tools reach the socket, the gate blocks, agent_end writes the marker (341.746079ms)
✔ pi: a write through a dangling symlink is blocked, and nothing appears outside (320.111724ms)
✖ pi: a read is refused when pi would open another spelling outside (314.753427ms)
✔ pi: a relative path climbs from the real path of a workspace behind a symlink (331.960128ms)
✔ pi: a relative path climbs from the real path of a dataRoot behind a symlink (334.444342ms)
✔ pi: a missing extension refuses before any model call (6.529418ms)
✔ pi: an extension without its configuration fails pi's start (266.191834ms)
✔ founderCheck: founder variables, then a needed service without a usable token (1.131708ms)
✔ turnRequest names the sender, class, reply and decision (0.183711ms)
✔ a message becomes a turn, the answer goes back as a RESULT, SIGTERM releases and exits 0 (280.144771ms)
✔ a SIGTERM before the claim stops the runner with exit 0 and no claim (100.874182ms)
✔ typed tools carry the runner's capability; launch goes to the host's launch socket (366.9824ms)
✔ a RESULT gets no automatic reply; failed turns reply with the reason (1296.333652ms)
✔ SIGTERM during a turn kills the turn's process group and still exits 0 (187.993487ms)
✔ founder credentials stop before the claim (20) (216.463256ms)
✔ a refused claim exits 21; an ended run's capability exits 22 (265.774441ms)
✔ the launch ending under a running session exits 22 (165.246864ms)
✔ a broker that stays unreachable exits 23 after brokerRetries polls (289.815346ms)
✔ a broker that is down at the claim exits 23, not 21 (129.57063ms)
✔ no capability, or a malformed one, on stdin exits 2 (223.535501ms)
✔ a missing or malformed policy exits 2 before the claim (155.040694ms)
✔ the PM gets launch, its task verbs and the reads (6.487345ms)
✔ a coder gets no launch, no resolve_decision, and no task tools without a tracker (2.088694ms)
✔ launch only when the business's launch block names the instance as launcher (1.70404ms)
✔ an action outside the instance's authority has no tool (1.440948ms)
✔ callTool: one JSON line out, the result back, a refusal rejects (9.461132ms)
ℹ tests 56
ℹ suites 0
ℹ pass 54
ℹ fail 2
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 10346.50573

✖ failing tests:

test at packages/harness/tests/gate.test.mjs:117:1
✖ read is checked under every spelling pi's read would open, in both harnesses (8.041349ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  
  true !== false
  
      at blocked (file:///home/jwoltje/darkwing-scratch/r41d/wt/packages/harness/tests/gate.test.mjs:19:10)
      at TestContext.<anonymous> (file:///home/jwoltje/darkwing-scratch/r41d/wt/packages/harness/tests/gate.test.mjs:125:7)
      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: true,
    expected: false,
    operator: 'strictEqual',
    diff: 'simple'
  }

test at packages/harness/tests/pi-session.test.mjs:123:1
✖ pi: a read is refused when pi would open another spelling outside (314.753427ms)
  AssertionError [ERR_ASSERTION]: The input was expected to not match the regular expression /SECRET/. Input:
  
  `ANSWER [[true,"mosaic gate: read path is outside the workspace under another spelling: notes's."],[true,"mosaic gate: read path is outside the workspace under another spelling: shot 9.4"],[true,"mosaic gate: read path is outside the workspace under another spelling: résumé.t"],[false,"SECRET-OUTSIDE\\n"],[true,"mosaic gate: read path is outside the workspace under another spelling: l'été.tx"],[true,"mosaic gate: read path is outside the workspace under another spelling: l'été.md"],[false,"inside\\n"]]\n`
  
      at TestContext.<anonymous> (file:///home/jwoltje/darkwing-scratch/r41d/wt/packages/harness/tests/pi-session.test.mjs:145:10)
      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: true,
    code: 'ERR_ASSERTION',
    actual: `ANSWER [[true,"mosaic gate: read path is outside the workspace under another spelling: notes's."],[true,"mosaic gate: read path is outside the workspace under another spelling: shot 9.4"],[true,"mosaic gate: read path is outside the workspace under another spelling: résumé.t"],[false,"SECRET-OUTSIDE\\n"],[true,"mosaic gate: read path is outside the workspace under another spelling: l'été.tx"],[true,"mosaic gate: read path is outside the workspace under another spelling: l'été.md"],[false,"inside\\n"]]\n`,
    expected: /SECRET/,
    operator: 'doesNotMatch',
    diff: 'simple'
  }
