Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
test(mcp-host): assert the raw title leaks on no console channel
Diego Zacarias3b5905da2221
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.jsonindex e4431e759..8d9c2ddb2 100644--- a/mcp-host/package-lock.json+++ b/mcp-host/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-mcp-host",- "version": "0.1.323",+ "version": "0.1.324","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-mcp-host",- "version": "0.1.323",+ "version": "0.1.324","license": "SEE LICENSE IN LICENSE","dependencies": {"@anthropic-ai/sdk": "^0.32.0",diff --git a/mcp-host/package.json b/mcp-host/package.jsonindex 5c11cea1f..05b5b2722 100644--- a/mcp-host/package.json+++ b/mcp-host/package.json@@ -1,6 +1,6 @@{"name": "clerum-mcp-host",- "version": "0.1.323",+ "version": "0.1.324","description": "MCP Host - reads Host CRD and provides LLM access via OpenAI/Claude","main": "dist/main.js","engines": {diff --git a/mcp-host/src/server/__tests__/setTitleRoute.test.ts b/mcp-host/src/server/__tests__/setTitleRoute.test.tsindex 03ba3b899..dd7cf987a 100644--- a/mcp-host/src/server/__tests__/setTitleRoute.test.ts+++ b/mcp-host/src/server/__tests__/setTitleRoute.test.ts@@ -137,9 +137,13 @@ describe('handleSetTitleRoute (spec 15 Fase B)', () => {expect(captured.jsonBody).toEqual({ ok: true, title: 'Quarterly plan' })})- it('never logs the raw title — only titleLength (T4)', async () => {+ it('never logs the raw title on ANY console channel — only titleLength (T4)', async () => {const manager = await managerWithSession()- const infoSpy = vi.spyOn(console, 'info').mockImplementation(() => {})+ // Spy every channel: the success path logs via console.info, but a future+ // leak could surface on error/warn/log, and the invariant is "the raw title+ // never reaches a log", not "console.info is clean".+ const channels = ['info', 'error', 'warn', 'log', 'debug'] as const+ const spies = channels.map(ch => vi.spyOn(console, ch).mockImplementation(() => {}))try {const captured = makeRes()const secretish = 'MyPrivateBoardName'@@ -149,11 +153,14 @@ describe('handleSetTitleRoute (spec 15 Fase B)', () => {makeHandlers({ setTitleHandler: realHandler(manager) }))expect(captured.statusCode).toBe(200)- const allLogs = infoSpy.mock.calls.map(args => args.join(' ')).join('\n')+ const allLogs = spies+ .flatMap(spy => spy.mock.calls)+ .map(args => args.join(' '))+ .join('\n')expect(allLogs).not.toContain(secretish)expect(allLogs).toContain('titleLength')} finally {- infoSpy.mockRestore()+ spies.forEach(spy => spy.mockRestore())}})})