✔ sessionModel: agent vars win, then the system's execution settings (13.755567ms)
✔ a pi bundle: prompt, policy, tools and manifest, 0600 in a 0700 directory (5.041707ms)
✖ a claude-code bundle adds the wrapped gate hook and the MCP config (3.303408ms)
✔ a bundle is written once: an existing file refuses (2.427304ms)
✔ a path with a single quote can't go into the hook command (1.929757ms)
✔ allow exits 0, a deny exits 2 with the reason on stderr (124.002277ms)
✔ a missing or wrong policy, or a bad event, exits 2 (90.738011ms)
✔ the bundle's wrapped command: a missing gate or node still blocks (1091.680831ms)
✔ claude: typed tools through MCP, the hook blocks, builtins outside --tools don't exist (788.259361ms)
✔ claude: the hook alone blocks a path outside the workspace (451.984188ms)
✔ claude: a second turn resumes the first turn's session (695.642152ms)
✔ claude adapter: --restricted is always passed (5.390974ms)
✔ claude: CLAUDE.md files and auto-memory don't reach the model; without --restricted they do (741.569967ms)
✔ claude: a missing hook or MCP file refuses before claude starts (8.422858ms)
✔ pi: policy tools and typed tools pass, anything else is blocked (2.716548ms)
✔ claude: builtins map from pi names, typed tools need the mcp prefix (0.775047ms)
✔ file tool paths must resolve inside the workspace (0.898308ms)
✔ pi's own path normalisation can't be used to step out (1.037538ms)
✔ a symlink inside the workspace that points out is outside (0.809608ms)
✔ a dangling symlink is refused at any depth, in both harnesses (3.478412ms)
✔ claude path fields per tool (0.915426ms)
✔ glob patterns stay inside the workspace (0.869385ms)
✔ a path that can't be checked is blocked (0.542139ms)
✔ initialize, ping and tools/list (45.777057ms)
✔ tools/call goes through the tool socket; a refusal is an isError result (32.557805ms)
✔ unknown tools and methods are JSON-RPC errors and never reach the socket (33.320422ms)
✔ a missing argument is a usage error (29.77781ms)
✔ pi: typed tools reach the socket, the gate blocks, agent_end writes the marker (398.451117ms)
✔ pi: a write through a dangling symlink is blocked, and nothing appears outside (341.426143ms)
✔ pi: a missing extension refuses before any model call (6.625067ms)
✔ pi: an extension without its configuration fails pi's start (254.365203ms)
✔ founderCheck: founder variables, then a needed service without a usable token (1.33242ms)
✔ turnRequest names the sender, class, reply and decision (0.273994ms)
✔ a message becomes a turn, the answer goes back as a RESULT, SIGTERM releases and exits 0 (259.532962ms)
✔ a SIGTERM before the claim stops the runner with exit 0 and no claim (126.492501ms)
✔ typed tools carry the runner's capability; launch goes to the host's launch socket (430.083188ms)
✔ a RESULT gets no automatic reply; failed turns reply with the reason (1291.975499ms)
✔ SIGTERM during a turn kills the turn's process group and still exits 0 (161.287704ms)
✔ founder credentials stop before the claim (20) (178.200231ms)
✔ a refused claim exits 21; an ended run's capability exits 22 (193.500108ms)
✔ the launch ending under a running session exits 22 (159.092117ms)
✔ a broker that stays unreachable exits 23 after brokerRetries polls (245.273136ms)
✔ a broker that is down at the claim exits 23, not 21 (87.433738ms)
✔ no capability, or a malformed one, on stdin exits 2 (193.512304ms)
✔ a missing or malformed policy exits 2 before the claim (132.080472ms)
✔ the PM gets launch, its task verbs and the reads (7.388611ms)
✔ a coder gets no launch, no resolve_decision, and no task tools without a tracker (2.737055ms)
✔ launch only when the business's launch block names the instance as launcher (1.442548ms)
✔ an action outside the instance's authority has no tool (2.266333ms)
✔ callTool: one JSON line out, the result back, a refusal rejects (8.989301ms)
ℹ tests 50
ℹ suites 0
ℹ pass 49
ℹ fail 1
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 10395.052827

✖ failing tests:

test at packages/harness/tests/bundle.test.mjs:70:1
✖ a claude-code bundle adds the wrapped gate hook and the MCP config (3.303408ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  + actual - expected
  
  + "timeout -k 2 10 '/usr/bin/node' '/home/jwoltje/darkwing-scratch/r41b/wt/packages/harness/src/claude-gate.mjs' '/home/jwoltje/darkwing-scratch/tmp/mosaic-harness-OBpfCk/bundle/policy.json'"
  - "timeout -k 2 10 '/usr/bin/node' '/home/jwoltje/darkwing-scratch/r41b/wt/packages/harness/src/claude-gate.mjs' '/home/jwoltje/darkwing-scratch/tmp/mosaic-harness-OBpfCk/bundle/policy.json' || exit 2"
  
      at TestContext.<anonymous> (file:///home/jwoltje/darkwing-scratch/r41b/wt/packages/harness/tests/bundle.test.mjs:78: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: "timeout -k 2 10 '/usr/bin/node' '/home/jwoltje/darkwing-scratch/r41b/wt/packages/harness/src/claude-gate.mjs' '/home/jwoltje/darkwing-scratch/tmp/mosaic-harness-OBpfCk/bundle/policy.json'",
    expected: "timeout -k 2 10 '/usr/bin/node' '/home/jwoltje/darkwing-scratch/r41b/wt/packages/harness/src/claude-gate.mjs' '/home/jwoltje/darkwing-scratch/tmp/mosaic-harness-OBpfCk/bundle/policy.json' || exit 2",
    operator: 'strictEqual',
    diff: 'simple'
  }
