web01: building nwfqn3aikvhqbdm8a8k1jpp0dmzdhmgk-spaces-integration-gateway-unit-test.drv bun test v1.4.2 (744846f84) gateway-core.test.ts: ✓ discoverTools returns the server's tools with inputSchema as parameters [5.94ms] ✓ discoverTools resolves [] when the socket is unreachable [1.34ms] ✓ buildRegistry namespaces tools and precomputes the autoRun verdict [1.10ms] ✓ loadDefinition parses confirmPreview; absent ⇒ empty map [0.20ms] ✓ buildRegistry carries confirmPreview and hides preview tools from the registry [0.29ms] integrations: cannot read definition for ghost: Error: ENOENT: no such file or directory, open '/build/gateway-core-test-jv2g2k/reg2/ghost.json' ✓ buildRegistry skips disabled integrations and missing definitions [0.50ms] integrations: cannot read /build/gateway-core-test-jv2g2k/reg3/enabled.json: SyntaxError: JSON Parse error: Expected '}' ✓ buildRegistry yields nothing when enabled.json is unreadable/malformed [0.27ms] ✓ enabledMtimeMs is 0 when absent, positive once the file exists [0.34ms] ✓ refreshRegistry rebuilds only when enabled.json's mtime moves [0.47ms] ✓ integrationNames lists each enabled integration once [0.33ms] ✓ callIntegrationTool: initialize/initialized/tools-call, text concatenated [1.34ms] ✓ callIntegrationTool: server isError surfaces as isError [0.80ms] ✓ callIntegrationTool: connection failure resolves unavailable, never throws [0.29ms] ✓ callIntegrationTool: timeout resolves unavailable [200.86ms] ✓ callIntegrationTool: abort signal resolves unavailable [1.17ms] ✓ mcpExchange runs the step chain and yields the final reply [0.65ms] ✓ mcpExchange resolves a failure result, never rejects [0.24ms] mcp-server.test.ts: ✓ advertisedTools maps registry entries to MCP tool descriptors [0.11ms] ✓ initialize advertises the tool-list-changed capability and marks the session [0.24ms] ✓ notifications/initialized owes no reply [0.06ms] ✓ tools/list returns the aggregated advertised tools [0.08ms] ✓ an unknown method resolves a JSON-RPC method-not-found error [0.05ms] ✓ an autoRun tool forwards immediately with no confirm [0.26ms] ✓ a non-autoRun tool confirmed 'once' forwards but does not persist the grant [0.14ms] ✓ a non-autoRun tool confirmed 'session' skips the prompt on later calls [0.08ms] ✓ a session grant is scoped to its own session, not shared [0.06ms] ✓ a denied tool is never forwarded and returns the denial [0.06ms] ✓ an unavailable confirm command blocks the call and says nobody was asked [0.07ms] ✓ an unknown tool errors without confirming or forwarding [0.06ms] ✓ confirmPreview output is fetched and passed as the confirm context [0.08ms] ✓ a failed confirmPreview fails closed: surfaces the error, no prompt, no send [0.10ms] ✓ spaces/session is a notification: it owes no reply [0.13ms] ✓ two sessions sharing one key share a session grant [0.14ms] ✓ distinct keys keep grants isolated [0.14ms] ✓ a bad key (empty / oversized / non-string) does not bind a shared set [0.15ms] ✓ binding sweeps entries idle beyond the TTL [0.12ms] confirm.test.ts: ✓ returns the verdict the command writes to the verdict file [6.30ms] ✓ tolerates surrounding whitespace/newlines in the verdict [1.41ms] ✓ passes the request JSON to the command via SPACES_CONFIRM_REQUEST [1.80ms] integrations: confirm command unavailable: unknown verdict maybe ✓ reports unavailable when the command writes an unknown token [1.69ms] integrations: confirm command unavailable: no verdict file ✓ reports unavailable when the command writes nothing [1.18ms] integrations: confirm command unavailable: exit 3 ✓ reports unavailable on a non-zero exit even if a verdict was written [1.42ms] integrations: confirm command unavailable: SPACES_INTEGRATION_CONFIRM_CMD is empty ✓ reports unavailable when no confirm command is configured [0.11ms] integrations: confirm command unavailable: spawn failed: ENOENT: no such file or directory, posix_spawn '/build/no-such-confirm-command' ✓ reports unavailable when the command cannot be spawned [0.74ms] integrations: confirm command unavailable: no verdict within 200ms ✓ reports unavailable when the command exceeds the timeout [201.31ms] ✓ hands the command the user manager's WAYLAND_DISPLAY when its own env has none [4.15ms] ✓ keeps a display already in the gateway's env [3.46ms] ✓ ignores a quoted or otherwise non-plain user manager value [3.46ms] connect.test.ts: ✓ bridges bytes both directions and resolves when the socket closes [4.04ms] ✓ resolves (never hangs) when the socket is unreachable [0.26ms] ✓ bridge declares a spaces/session key as its first socket line [0.62ms] ✓ distinct bridge invocations declare distinct keys [0.65ms] notify.test.ts: ✓ broadcast sends one tools/list_changed notification per initialized client [0.08ms] ✓ broadcast skips a client that has not initialized [0.01ms] ✓ broadcast survives a write that throws [0.05ms] ✓ watch reports a change of the file, once per change [0.13ms] ✓ watch reports the file appearing and going away [0.03ms] ✓ a stopped watch schedules no further poll [0.04ms] ✓ watch keeps polling after onChange throws [0.04ms] ✓ the real mtime reader treats a missing file as no file [0.20ms] ✓ an empty path gives an inert watch [0.02ms] live-notify.test.ts: ✓ a live session hears about an integration enabled after it connected [67.38ms] 62 pass 0 fail 136 expect() calls Ran 62 tests across 6 files. [547.00ms]