Shared backlog across the crew
Assignee
chris
Project
mission-control
Created
11 May 2026, 8:18 pm
Updated
90d ago
Tags
Dependencies
Blocked By
Description
The findings-storage unit test (__tests__/findings-storage.test.ts) triggers logger.warn() and logger.error() calls during tests that test corrupt JSON handling. These write to /tmp/mission-control-app.log β the SAME log file the MC server uses.
This means every time the tests run, the MC Logs page (and log viewer) shows:
WARN findings-storage Failed to load bad.json: SyntaxError: Unexpected token 'c', "corrupt" is not valid JSONERR findings-storage Failed to load state for finding-1: SyntaxError: Unexpected token 'o', "not-json" is not valid JSONThese are NOT real errors β they are TEST artifacts that shouldn't appear in the application log.
findings-storage.ts imports { warn, error } from ./logger, which writes to /tmp/mission-control-app.log. During tests, the logger writes to the same global file as the MC production server. The test expects loadFindingState to gracefully handle corrupt JSON and return defaults, which it does correctly β but the error logging happens regardless of whether we're in a test context.
Add to __tests__/findings-storage.test.ts:
jest.mock("@/lib/logger", () => ({
info: jest.fn(),
warn: jest.fn(),
error: jest.fn(),
}));
This prevents any log writes to the real file when tests exercise error paths.
In findings-storage.ts, wrap the error/warn calls:
if (!process.env.JEST_WORKER_ID) {
logError("findings-storage", ...);
}
But this is less clean β library code shouldn't care about test context.
In logger.ts, if process.env.JEST_WORKER_ID is set, use a no-op:
This is the defense-in-depth approach β prevents ALL logger pollution from any test.
Do BOTH options A and C:
Also clean up the stale /tmp/mc-test-findings/ test dir (rm -rf /tmp/mc-test-findings).
[bug, tests, logger, cleanup]
Please finish this one
Unblocked by mass-fix on 2026-05-12 because the 3-failure deadlock logic was buggy:
Failure baseline set to NOW. Only failures after this timestamp count toward the next 3-strike trigger. Infra failures (ECONNREFUSED, gateway OOM) are now excluded permanently.
Review
Subtasks
Run history