# proof: ai-precheck, planted faults date: 2026-11-08T06:29:25Z commit: 5cd6cd1b2f5698c15435f67f4b56dfdc0ce12aa7 (each fault is applied to the working tree, run, then reverted with git checkout) command: npm run test:forum-pg expect: exit 1 for each fault ## planted fault: the zero-data-retention setting is dropped from the request ## diff: - provider: { only: [endpoint], zdr: true, data_collection: "deny", require_parameters: true }, + provider: { only: [endpoint], data_collection: "deny", require_parameters: true }, ✓ db/schema.sql applies, and applying it again changes nothing (55 ms) ✓ stores one vote per browser under a hash, and a second vote replaces the first (18 ms) ✓ the voter cookie a real vote sets matches the privacy page: scripts can't read it, forum addresses only, 180 days (11 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 (31 ms) ✓ votes flow through the results route into 'where groups agree' (405 ms) ✓ a suggestion can be voted on only once approved, and rejecting it removes its votes (36 ms) ✓ the database refuses a suggestion over 140 characters ✓ the submit route saves a suggestion as pending and, with no AI key, unchecked; contact details and other sites are turned back unsaved (18 ms) ✓ the report route stores only the statement, reason and language, and refuses reports on suggestions not yet approved (30 ms) ✕ sends only the statement and its language, to EU zero-retention endpoints; a busy first model falls to the second; the flags are saved on the pending row (15 ms) ✓ when both models fail, or the answer is malformed, the suggestion is still saved, pending and 'not checked' (18 ms) ✓ past the daily AI limit, no outside call is made and the suggestion is saved unchecked (18 ms) ● forum on a real Postgres › the AI pre-check, with a stand-in for OpenRouter › sends only the statement and its language, to EU zero-retention endpoints; a busy first model falls to the second; the flags are saved on the pending row Tests: 1 failed, 12 passed, 13 total exit: 1 ## planted fault: a busy (429) model no longer falls through to the backup model ## diff: - return res.status === 429 || res.status === 404 || res.status >= 500 ? "next" : null; + return res.status === 404 || res.status >= 500 ? "next" : null; ✓ db/schema.sql applies, and applying it again changes nothing (67 ms) ✓ stores one vote per browser under a hash, and a second vote replaces the first (20 ms) ✓ the voter cookie a real vote sets matches the privacy page: scripts can't read it, forum addresses only, 180 days (12 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 (32 ms) ✓ votes flow through the results route into 'where groups agree' (436 ms) ✓ a suggestion can be voted on only once approved, and rejecting it removes its votes (36 ms) ✓ the database refuses a suggestion over 140 characters (1 ms) ✓ the submit route saves a suggestion as pending and, with no AI key, unchecked; contact details and other sites are turned back unsaved (21 ms) ✓ the report route stores only the statement, reason and language, and refuses reports on suggestions not yet approved (30 ms) ✕ sends only the statement and its language, to EU zero-retention endpoints; a busy first model falls to the second; the flags are saved on the pending row (13 ms) ✓ when both models fail, or the answer is malformed, the suggestion is still saved, pending and 'not checked' (18 ms) ✓ past the daily AI limit, no outside call is made and the suggestion is saved unchecked (21 ms) ● forum on a real Postgres › the AI pre-check, with a stand-in for OpenRouter › sends only the statement and its language, to EU zero-retention endpoints; a busy first model falls to the second; the flags are saved on the pending row Tests: 1 failed, 12 passed, 13 total exit: 1 ## planted fault: one extra field is sent with the statement ## diff: - { role: "user", content: JSON.stringify({ language: locale, statement: text }) }, + { role: "user", content: JSON.stringify({ language: locale, statement: text, site: SITE_URL }) }, ✓ db/schema.sql applies, and applying it again changes nothing (53 ms) ✓ stores one vote per browser under a hash, and a second vote replaces the first (19 ms) ✓ the voter cookie a real vote sets matches the privacy page: scripts can't read it, forum addresses only, 180 days (11 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 (37 ms) ✓ votes flow through the results route into 'where groups agree' (454 ms) ✓ a suggestion can be voted on only once approved, and rejecting it removes its votes (41 ms) ✓ the database refuses a suggestion over 140 characters (3 ms) ✓ the submit route saves a suggestion as pending and, with no AI key, unchecked; contact details and other sites are turned back unsaved (23 ms) ✓ the report route stores only the statement, reason and language, and refuses reports on suggestions not yet approved (35 ms) ✕ sends only the statement and its language, to EU zero-retention endpoints; a busy first model falls to the second; the flags are saved on the pending row (17 ms) ✓ when both models fail, or the answer is malformed, the suggestion is still saved, pending and 'not checked' (21 ms) ✓ past the daily AI limit, no outside call is made and the suggestion is saved unchecked (21 ms) ● forum on a real Postgres › the AI pre-check, with a stand-in for OpenRouter › sends only the statement and its language, to EU zero-retention endpoints; a busy first model falls to the second; the flags are saved on the pending row Tests: 1 failed, 12 passed, 13 total exit: 1