gi-build-x86-02: building jrhfqwpg36q9mprs8rq2c8jqxryhwq91-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 [4.01ms] ✓ discoverTools resolves [] when the socket is unreachable [1.36ms] ✓ buildRegistry namespaces tools and precomputes the autoRun verdict [1.14ms] ✓ loadDefinition parses confirmPreview; absent ⇒ empty map [0.17ms] ✓ buildRegistry carries confirmPreview and hides preview tools from the registry [0.27ms] integrations: cannot read definition for ghost: Error: ENOENT: no such file or directory, open '/build/gateway-core-test-Ti8UkN/reg2/ghost.json' ✓ buildRegistry skips disabled integrations and missing definitions [0.31ms] integrations: cannot read /build/gateway-core-test-Ti8UkN/reg3/enabled.json: SyntaxError: JSON Parse error: Expected '}' ✓ buildRegistry yields nothing when enabled.json is unreadable/malformed [0.22ms] ✓ enabledMtimeMs is 0 when absent, positive once the file exists [0.26ms] ✓ refreshRegistry rebuilds only when enabled.json's mtime moves [0.40ms] ✓ integrationNames lists each enabled integration once [0.27ms] ✓ callIntegrationTool: initialize/initialized/tools-call, text concatenated [1.00ms] ✓ callIntegrationTool: server isError surfaces as isError [0.54ms] ✓ callIntegrationTool: connection failure resolves unavailable, never throws [0.20ms] ✓ callIntegrationTool: timeout resolves unavailable [201.05ms] ✓ callIntegrationTool: abort signal resolves unavailable [3.10ms] ✓ mcpExchange runs the step chain and yields the final reply [0.71ms] ✓ mcpExchange resolves a failure result, never rejects [0.21ms] mcp-server.test.ts: ✓ advertisedTools maps registry entries to MCP tool descriptors [0.09ms] ✓ initialize advertises the tool-list-changed capability and marks the session [0.19ms] ✓ notifications/initialized owes no reply [0.05ms] ✓ 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.24ms] ✓ a non-autoRun tool confirmed 'once' forwards but does not persist the grant [0.12ms] ✓ a non-autoRun tool confirmed 'session' skips the prompt on later calls [0.07ms] ✓ a session grant is scoped to its own session, not shared [0.05ms] ✓ a denied tool is never forwarded and returns the denial [0.05ms] ✓ an unavailable confirm command blocks the call and says nobody was asked [0.10ms] ✓ an unknown tool errors without confirming or forwarding [0.08ms] ✓ confirmPreview output is fetched and passed as the confirm context [0.09ms] ✓ a failed confirmPreview fails closed: surfaces the error, no prompt, no send [0.09ms] ✓ spaces/session is a notification: it owes no reply [0.10ms] ✓ two sessions sharing one key share a session grant [0.14ms] ✓ distinct keys keep grants isolated [0.12ms] ✓ a bad key (empty / oversized / non-string) does not bind a shared set [0.13ms] ✓ binding sweeps entries idle beyond the TTL [0.09ms] confirm.test.ts: ✓ returns the verdict the command writes to the verdict file [4.77ms] ✓ tolerates surrounding whitespace/newlines in the verdict [1.04ms] ✓ passes the request JSON to the command via SPACES_CONFIRM_REQUEST [1.14ms] integrations: confirm command unavailable: unknown verdict maybe ✓ reports unavailable when the command writes an unknown token [1.10ms] integrations: confirm command unavailable: no verdict file ✓ reports unavailable when the command writes nothing [0.90ms] integrations: confirm command unavailable: exit 3 ✓ reports unavailable on a non-zero exit even if a verdict was written [1.02ms] integrations: confirm command unavailable: SPACES_INTEGRATION_CONFIRM_CMD is empty ✓ reports unavailable when no confirm command is configured [0.10ms] 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.60ms] integrations: confirm command unavailable: no verdict within 200ms ✓ reports unavailable when the command exceeds the timeout [201.58ms] ✓ hands the command the user manager's WAYLAND_DISPLAY when its own env has none [3.25ms] ✓ keeps a display already in the gateway's env [2.27ms] ✓ ignores a quoted or otherwise non-plain user manager value [2.11ms] connect.test.ts: ✓ bridges bytes both directions and resolves when the socket closes [3.37ms] ✓ resolves (never hangs) when the socket is unreachable [0.23ms] ✓ bridge declares a spaces/session key as its first socket line [0.52ms] ✓ distinct bridge invocations declare distinct keys [0.52ms] notify.test.ts: ✓ broadcast sends one tools/list_changed notification per initialized client [0.06ms] ✓ broadcast skips a client that has not initialized [0.01ms] ✓ broadcast survives a write that throws [0.04ms] ✓ watch reports a change of the file, once per change [0.09ms] ✓ watch reports the file appearing and going away [0.02ms] ✓ a stopped watch schedules no further poll [0.02ms] ✓ watch keeps polling after onChange throws [0.04ms] ✓ the real mtime reader treats a missing file as no file [0.18ms] ✓ an empty path gives an inert watch [0.02ms] live-notify.test.ts: ✓ a live session hears about an integration enabled after it connected [63.52ms] 62 pass 0 fail 136 expect() calls Ran 62 tests across 6 files. [522.00ms]