# proof: suggest-and-report (mutation check) date: 2026-11-07T23:37:10Z commit: c250d64cb564f1d1d4758ed8700613c87c037cda, with the planted change below in app/api/forum/report/route.ts (not committed) command: npm run test:forum-pg -- --verbose database: throwaway postgres:17-alpine (PG_VERSION=17.11), podman version 5.7.0, bound to 127.0.0.1, removed on exit; no Neon, no shared database node: v26.13.0 expected: exit 1 on the report test only planted change: diff --git a/app/api/forum/report/route.ts b/app/api/forum/report/route.ts index 48ec6ea..659b94c 100644 --- a/app/api/forum/report/route.ts +++ b/app/api/forum/report/route.ts @@ -17,7 +17,7 @@ export async function POST(request: NextRequest) { if (!input) return fail(400, "invalid"); try { - if (looksLikeSuggestion(input.statementId) && !(await isApprovedSuggestion(input.statementId))) { + if (false && looksLikeSuggestion(input.statementId) && !(await isApprovedSuggestion(input.statementId))) { return fail(400, "invalid"); } if ((await reportsToday()) >= DAILY_REPORT_LIMIT) return fail(429, "busy"); output: 127.0.0.1:5432 - accepting connections FAIL __tests__/forum-postgres.integration.test.ts forum on a real Postgres ✓ db/schema.sql applies, and applying it again changes nothing (57 ms) ✓ stores one vote per browser under a hash, and a second vote replaces the first (16 ms) ✓ the database itself refuses a vote other than agree, disagree or pass (2 ms) ✓ 'Clear my votes' deletes this browser's votes and no one else's (35 ms) ✓ votes flow through the results route into 'where groups agree' (378 ms) ✓ a suggestion can be voted on only once approved, and rejecting it removes its votes (34 ms) ✓ the database refuses a suggestion over 140 characters (2 ms) ✓ the submit route saves a suggestion as pending and, with no AI key, unchecked; contact details and other sites are turned back unsaved (19 ms) ✕ the report route stores only the statement, reason and language, and refuses reports on suggestions not yet approved (14 ms) ● forum on a real Postgres › the report route stores only the statement, reason and language, and refuses reports on suggestions not yet approved expect(received).toBe(expected) // Object.is equality Expected: 400 Received: 200 328 | const suggestion = suggestionId(pending.id); 329 | const early = await postReport(request("/api/forum/report", "POST", { statementId: suggestion, reason: "hate", locale: "de" })); > 330 | expect(early.status).toBe(400); | ^ 331 | 332 | // Nothing about the reporter is kept: no cookie, address or browser code column exists. 333 | const columns = await query<{ column_name: string }>( at Object.toBe (__tests__/forum-postgres.integration.test.ts:330:26) Test Suites: 1 failed, 1 total Tests: 1 failed, 8 passed, 9 total Snapshots: 0 total Time: 0.855 s, estimated 1 s Ran all test suites matching /__tests__\/forum-postgres.integration.test.ts/i. exit: 1