From d5b201764666dd7f1a8f0258c599b8a45fc03bde Mon Sep 17 00:00:00 2001 From: siddseethepalli Date: Sat, 11 Apr 2026 22:59:37 +0000 Subject: [PATCH] fix(test): route contacts-write trust-store writes to test workspace --- assistant/src/__tests__/contacts-write.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/assistant/src/__tests__/contacts-write.test.ts b/assistant/src/__tests__/contacts-write.test.ts index 4d3f5aa70bc..4a230a43dce 100644 --- a/assistant/src/__tests__/contacts-write.test.ts +++ b/assistant/src/__tests__/contacts-write.test.ts @@ -12,6 +12,16 @@ import { existsSync, readFileSync, writeFileSync } from "node:fs"; import { join } from "node:path"; import { beforeEach, describe, expect, mock, test } from "bun:test"; +// Route trust-store file writes at the test workspace's protected dir +// instead of the real ~/.vellum/protected/trust.json. Must be set before +// importing ../permissions/trust-store.js so getGatewaySecurityDir() picks +// up the override at module load time. Matches the pattern in +// checker.test.ts, trust-store.test.ts, etc. +process.env.GATEWAY_SECURITY_DIR = join( + process.env.VELLUM_WORKSPACE_DIR!, + "protected", +); + mock.module("../util/logger.js", () => ({ getLogger: () => new Proxy({} as Record, {