✔ sessionModel: agent vars win, then the system's execution settings (18.802442ms)
✔ a pi bundle: prompt, policy, tools and manifest, 0600 in a 0700 directory (8.290629ms)
✔ a claude-code bundle adds the wrapped gate hook and the MCP config (4.265218ms)
✔ a bundle is written once: an existing file refuses (4.837663ms)
✔ a path with a single quote can't go into the hook command (2.936744ms)
✔ allow exits 0, a deny exits 2 with the reason on stderr (173.049276ms)
✔ a missing or wrong policy, or a bad event, exits 2 (123.911977ms)
✔ the bundle's wrapped command: a missing gate or node still blocks (1128.878137ms)
✔ claude: typed tools through MCP, the hook blocks, builtins outside --tools don't exist (994.036261ms)
✔ claude: the hook alone blocks a path outside the workspace (557.302735ms)
✔ claude: a second turn resumes the first turn's session (832.823388ms)
✔ claude adapter: --restricted is always passed (5.786433ms)
✔ claude: CLAUDE.md files and auto-memory don't reach the model; without --restricted they do (859.822688ms)
✔ claude: a missing hook or MCP file refuses before claude starts (7.864382ms)
✔ pi: policy tools and typed tools pass, anything else is blocked (4.576156ms)
✔ claude: builtins map from pi names, typed tools need the mcp prefix (1.113849ms)
✔ file tool paths must resolve inside the workspace (2.677582ms)
✔ pi's own path normalisation can't be used to step out (1.510552ms)
✔ a symlink inside the workspace that points out is outside (1.41079ms)
✖ a dangling symlink is refused at any depth, in both harnesses (2.226421ms)
✔ read is checked under every spelling pi's read would open, in both harnesses (26.104867ms)
✖ other spellings cover directories, dangling links and pi's cwd (2.137358ms)
✔ claude path fields per tool (1.05581ms)
✔ glob patterns stay inside the workspace (1.137006ms)
✔ a path that can't be checked is blocked (0.84172ms)
✔ initialize, ping and tools/list (69.514094ms)
✔ tools/call goes through the tool socket; a refusal is an isError result (49.843343ms)
✔ unknown tools and methods are JSON-RPC errors and never reach the socket (39.762264ms)
✔ a missing argument is a usage error (37.288971ms)
✔ pi: typed tools reach the socket, the gate blocks, agent_end writes the marker (495.019496ms)
✖ pi: a write through a dangling symlink is blocked, and nothing appears outside (422.140334ms)
✔ pi: a read is refused when pi would open another spelling outside (433.998971ms)
✔ pi: a missing extension refuses before any model call (8.617714ms)
✔ pi: an extension without its configuration fails pi's start (326.295407ms)
✔ founderCheck: founder variables, then a needed service without a usable token (1.908048ms)
✔ turnRequest names the sender, class, reply and decision (0.300329ms)
✔ a message becomes a turn, the answer goes back as a RESULT, SIGTERM releases and exits 0 (285.748828ms)
✔ a SIGTERM before the claim stops the runner with exit 0 and no claim (113.620011ms)
✔ typed tools carry the runner's capability; launch goes to the host's launch socket (433.85822ms)
✔ a RESULT gets no automatic reply; failed turns reply with the reason (1314.045957ms)
✔ SIGTERM during a turn kills the turn's process group and still exits 0 (150.182168ms)
✔ founder credentials stop before the claim (20) (188.63084ms)
✔ a refused claim exits 21; an ended run's capability exits 22 (238.87844ms)
✔ the launch ending under a running session exits 22 (152.787017ms)
✔ a broker that stays unreachable exits 23 after brokerRetries polls (253.577522ms)
✔ a broker that is down at the claim exits 23, not 21 (100.818778ms)
✔ no capability, or a malformed one, on stdin exits 2 (220.636759ms)
✔ a missing or malformed policy exits 2 before the claim (135.30631ms)
✔ the PM gets launch, its task verbs and the reads (9.883022ms)
✔ a coder gets no launch, no resolve_decision, and no task tools without a tracker (2.967614ms)
✔ launch only when the business's launch block names the instance as launcher (3.548277ms)
✔ an action outside the instance's authority has no tool (2.842622ms)
✔ callTool: one JSON line out, the result back, a refusal rejects (13.441611ms)
ℹ tests 53
ℹ suites 0
ℹ pass 50
ℹ fail 3
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 10443.473356

✖ failing tests:

test at packages/harness/tests/gate.test.mjs:82:1
✖ a dangling symlink is refused at any depth, in both harnesses (2.226421ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  
  true !== false
  
      at blocked (file:///home/jwoltje/darkwing-scratch/r41c/wt/packages/harness/tests/gate.test.mjs:19:10)
      at TestContext.<anonymous> (file:///home/jwoltje/darkwing-scratch/r41c/wt/packages/harness/tests/gate.test.mjs:92: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/gate.test.mjs:137:1
✖ other spellings cover directories, dangling links and pi's cwd (2.137358ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  
  true !== false
  
      at blocked (file:///home/jwoltje/darkwing-scratch/r41c/wt/packages/harness/tests/gate.test.mjs:19:10)
      at TestContext.<anonymous> (file:///home/jwoltje/darkwing-scratch/r41c/wt/packages/harness/tests/gate.test.mjs:146:3)
      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:99:1
✖ pi: a write through a dangling symlink is blocked, and nothing appears outside (422.140334ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  
  false !== true
  
      at TestContext.<anonymous> (file:///home/jwoltje/darkwing-scratch/r41c/wt/packages/harness/tests/pi-session.test.mjs:112: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: false,
    expected: true,
    operator: 'strictEqual',
    diff: 'simple'
  }
