# proof: common-ground (planted fault) date: 2026-11-08T03:07:18Z commit: 3b0db4086c3ca464f939d4e0757d08b3ed775274 plus the planted change below (not committed) command: npm run test:forum-pg -- --verbose && npm run build && npm run proof:common-ground plant: lib/forum/consensus.ts, '<' becomes '<=' in the threshold check, so a group at exactly 60% no longer counts expect: both parts exit 1, naming the exactly-60% statements (t1-disclose, t3-optin) diff --git a/lib/forum/consensus.ts b/lib/forum/consensus.ts index 07a4834..155b476 100644 --- a/lib/forum/consensus.ts +++ b/lib/forum/consensus.ts @@ -37,7 +37,7 @@ export function broadAgreement(rows: CountRow[], rules = RULES): StatementResult const row = rows.find((r) => r.statementId === id && r.locale === locale); const votes = row ? row.agree + row.disagree : 0; if (!row || votes < rules.minVotes) continue; - if (row.agree / votes < rules.threshold / 100) allAgree = false; + if (row.agree / votes <= rules.threshold / 100) allAgree = false; groups.push({ locale, agree: Math.floor((row.agree / votes) * 100), votes }); } if (allAgree && groups.length >= rules.minGroups) { ## Part 1: real Postgres 17 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 (66 ms) ✓ stores one vote per browser under a hash, and a second vote replaces the first (22 ms) ✓ the voter cookie a real vote sets matches the privacy page: scripts can't read it, forum addresses only, 180 days (15 ms) ✓ the database itself refuses a vote other than agree, disagree or pass (4 ms) ✓ 'Clear my votes' deletes this browser's votes and no one else's (42 ms) ✓ votes flow through the results route into 'where groups agree' (474 ms) ✕ the common-ground rule holds at its edges (scripts/common-ground-cases.json) (1710 ms) ✓ a suggestion can be voted on only once approved, and rejecting it removes its votes (39 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 (24 ms) ✓ the report route stores only the statement, reason and language, and refuses reports on suggestions not yet approved (54 ms) ● forum on a real Postgres › the common-ground rule holds at its edges (scripts/common-ground-cases.json) expect(received).toEqual(expected) // deep equality - Expected - 32 + Received + 0 @@ -1,25 +1,9 @@ Array [ Object { "groups": Array [ Object { - "agree": 60, - "locale": "en", - "votes": 20, - }, - Object { - "agree": 60, - "locale": "fr", - "votes": 20, - }, - ], - "id": "t1-disclose", - "lowest": 60, - }, - Object { - "groups": Array [ - Object { "agree": 100, "locale": "en", "votes": 20, }, Object { @@ -28,26 +12,10 @@ "votes": 20, }, ], "id": "t2-reasons", "lowest": 100, - }, - Object { - "groups": Array [ - Object { - "agree": 60, - "locale": "en", - "votes": 20, - }, - Object { - "agree": 60, - "locale": "pt-BR", - "votes": 20, - }, - ], - "id": "t3-optin", - "lowest": 60, }, Object { "groups": Array [ Object { "agree": 68, 291 | const byKey = (a: CountRow, b: CountRow) => key(a).localeCompare(key(b)); 292 | expect([...rows].sort(byKey)).toEqual([...want].sort(byKey)); > 293 | expect(broadAgreement(rows)).toEqual(cases.expected); | ^ 294 | expect(progress(rows)).toEqual(cases.progress); 295 | }); 296 | Test Suites: 1 failed, 1 total Tests: 1 failed, 10 passed, 11 total Snapshots: 0 total Time: 2.79 s, estimated 3 s Ran all test suites matching /__tests__\/forum-postgres.integration.test.ts/i. exit: 1 build (planted): exit 0 ## Part 2: Chrome, 8 languages server: next start on http://localhost:3251 (local production build), DATABASE_URL at db.invalid browser: Chrome/157.0.8103.38; node: v26.13.0 rules (lib/forum/consensus.ts): {"threshold":60,"minVotes":20,"minGroups":2} served rows: 16 (scripts/common-ground-cases.json); expected listed: t1-disclose, t2-reasons, t3-optin, t3-clear; expected hidden: t1-credentials, t2-person, t4-together /en/forum results fetched once ok | rule sentence = RULES ok | progress 404 votes, 7 languages ok | 2/4 statements listed FAIL | t1-disclose at 60% FAIL | t1-disclose groups en 60%/20 fr 60%/20 FAIL | t2-reasons at 100% FAIL | t2-reasons groups en 100%/20 de 100%/20 FAIL | 3 hidden ok | 37 requests, none off-site or non-GET ok /es/forum results fetched once ok | rule sentence = RULES ok | progress 404 votes, 7 languages ok | 2/4 statements listed FAIL | t1-disclose at 60% FAIL | t1-disclose groups en 60%/20 fr 60%/20 FAIL | t2-reasons at 100% FAIL | t2-reasons groups en 100%/20 de 100%/20 FAIL | 3 hidden ok | 16 requests, none off-site or non-GET ok /pt/forum results fetched once ok | rule sentence = RULES ok | progress 404 votes, 7 languages ok | 2/4 statements listed FAIL | t1-disclose at 60% FAIL | t1-disclose groups en 60%/20 fr 60%/20 FAIL | t2-reasons at 100% FAIL | t2-reasons groups en 100%/20 de 100%/20 FAIL | 3 hidden ok | 16 requests, none off-site or non-GET ok /pt-BR/forum results fetched once ok | rule sentence = RULES ok | progress 404 votes, 7 languages ok | 2/4 statements listed FAIL | t1-disclose at 60% FAIL | t1-disclose groups en 60%/20 fr 60%/20 FAIL | t2-reasons at 100% FAIL | t2-reasons groups en 100%/20 de 100%/20 FAIL | 3 hidden ok | 16 requests, none off-site or non-GET ok /it/forum results fetched once ok | rule sentence = RULES ok | progress 404 votes, 7 languages ok | 2/4 statements listed FAIL | t1-disclose at 60% FAIL | t1-disclose groups en 60%/20 fr 60%/20 FAIL | t2-reasons at 100% FAIL | t2-reasons groups en 100%/20 de 100%/20 FAIL | 3 hidden ok | 16 requests, none off-site or non-GET ok /fr/forum results fetched once ok | rule sentence = RULES ok | progress 404 votes, 7 languages ok | 2/4 statements listed FAIL | t1-disclose at 60% FAIL | t1-disclose groups en 60%/20 fr 60%/20 FAIL | t2-reasons at 100% FAIL | t2-reasons groups en 100%/20 de 100%/20 FAIL | 3 hidden ok | 16 requests, none off-site or non-GET ok /de/forum results fetched once ok | rule sentence = RULES ok | progress 404 votes, 7 languages ok | 2/4 statements listed FAIL | t1-disclose at 60% FAIL | t1-disclose groups en 60%/20 fr 60%/20 FAIL | t2-reasons at 100% FAIL | t2-reasons groups en 100%/20 de 100%/20 FAIL | 3 hidden ok | 16 requests, none off-site or non-GET ok /hi/forum results fetched once ok | rule sentence = RULES ok | progress 404 votes, 7 languages ok | 2/4 statements listed FAIL | t1-disclose at 60% FAIL | t1-disclose groups en 60%/20 fr 60%/20 FAIL | t2-reasons at 100% FAIL | t2-reasons groups en 100%/20 de 100%/20 FAIL | 3 hidden ok | 16 requests, none off-site or non-GET ok ## Result FAIL: 40 finding(s) /en/forum: 2/4 statements listed /en/forum: t1-disclose at 60% (At least 100% agree in every language group: When software helps make a decision about you, you should get the top reasons in plain language.) /en/forum: t1-disclose groups en 60%/20 fr 60%/20 ([{"name":"English","value":"100% agree, 20 votes","bar":"100%"},{"name":"Deutsch","value":"100% agree, 20 votes","bar":"100%"}]) /en/forum: t2-reasons at 100% (At least 68% agree in every language group: You should be able to clear your chat history with one tap.) /en/forum: t2-reasons groups en 100%/20 de 100%/20 ([{"name":"English","value":"68% agree, 60 votes","bar":"68%"},{"name":"हिन्दी","value":"68% agree, 29 votes","bar":"68%"}]) /es/forum: 2/4 statements listed /es/forum: t1-disclose at 60% (Al menos el 100% está de acuerdo en cada grupo de idioma: Cuando un programa ayuda a tomar una decisión sobre ti, deberías recibir las razones principales en lenguaje claro.) /es/forum: t1-disclose groups en 60%/20 fr 60%/20 ([{"name":"English","value":"100% de acuerdo, 20 votos","bar":"100%"},{"name":"Deutsch","value":"100% de acuerdo, 20 votos","bar":"100%"}]) /es/forum: t2-reasons at 100% (Al menos el 68% está de acuerdo en cada grupo de idioma: Deberías poder borrar tu historial de chat con un solo toque.) /es/forum: t2-reasons groups en 100%/20 de 100%/20 ([{"name":"English","value":"68% de acuerdo, 60 votos","bar":"68%"},{"name":"हिन्दी","value":"68% de acuerdo, 29 votos","bar":"68%"}]) /pt/forum: 2/4 statements listed /pt/forum: t1-disclose at 60% (Pelo menos 100% concordam em cada grupo de idioma: Quando um programa ajuda a tomar uma decisão sobre si, devia receber as principais razões em linguagem simples.) /pt/forum: t1-disclose groups en 60%/20 fr 60%/20 ([{"name":"English","value":"100% concordam, 20 votos","bar":"100%"},{"name":"Deutsch","value":"100% concordam, 20 votos","bar":"100%"}]) /pt/forum: t2-reasons at 100% (Pelo menos 68% concordam em cada grupo de idioma: Devia poder apagar o seu histórico de conversas com um só toque.) /pt/forum: t2-reasons groups en 100%/20 de 100%/20 ([{"name":"English","value":"68% concordam, 60 votos","bar":"68%"},{"name":"हिन्दी","value":"68% concordam, 29 votos","bar":"68%"}]) /pt-BR/forum: 2/4 statements listed /pt-BR/forum: t1-disclose at 60% (Pelo menos 100% concordam em cada grupo de idioma: Quando um programa ajuda a tomar uma decisão sobre você, você deveria receber os principais motivos em linguagem simples.) /pt-BR/forum: t1-disclose groups en 60%/20 fr 60%/20 ([{"name":"English","value":"100% concordam, 20 votos","bar":"100%"},{"name":"Deutsch","value":"100% concordam, 20 votos","bar":"100%"}]) /pt-BR/forum: t2-reasons at 100% (Pelo menos 68% concordam em cada grupo de idioma: Você deveria poder apagar seu histórico de conversas com um só toque.) /pt-BR/forum: t2-reasons groups en 100%/20 de 100%/20 ([{"name":"English","value":"68% concordam, 60 votos","bar":"68%"},{"name":"हिन्दी","value":"68% concordam, 29 votos","bar":"68%"}]) /it/forum: 2/4 statements listed /it/forum: t1-disclose at 60% (Almeno il 100% è d'accordo in ogni gruppo linguistico: Quando un programma aiuta a prendere una decisione su di te, dovresti ricevere i motivi principali in parole semplici.) /it/forum: t1-disclose groups en 60%/20 fr 60%/20 ([{"name":"English","value":"100% d'accordo, 20 voti","bar":"100%"},{"name":"Deutsch","value":"100% d'accordo, 20 voti","bar":"100%"}]) /it/forum: t2-reasons at 100% (Almeno il 68% è d'accordo in ogni gruppo linguistico: Dovresti poter cancellare la cronologia delle chat con un solo tocco.) /it/forum: t2-reasons groups en 100%/20 de 100%/20 ([{"name":"English","value":"68% d'accordo, 60 voti","bar":"68%"},{"name":"हिन्दी","value":"68% d'accordo, 29 voti","bar":"68%"}]) /fr/forum: 2/4 statements listed /fr/forum: t1-disclose at 60% (Au moins 100 % d'accord dans chaque groupe de langue : Quand un logiciel aide à prendre une décision à votre sujet, vous devriez recevoir les principales raisons en langage simple.) /fr/forum: t1-disclose groups en 60%/20 fr 60%/20 ([{"name":"English","value":"100 % d'accord, 20 votes","bar":"100%"},{"name":"Deutsch","value":"100 % d'accord, 20 votes","bar":"100%"}]) /fr/forum: t2-reasons at 100% (Au moins 68 % d'accord dans chaque groupe de langue : Vous devriez pouvoir effacer votre historique de discussion d'un seul geste.) /fr/forum: t2-reasons groups en 100%/20 de 100%/20 ([{"name":"English","value":"68 % d'accord, 60 votes","bar":"68%"},{"name":"हिन्दी","value":"68 % d'accord, 29 votes","bar":"68%"}]) /de/forum: 2/4 statements listed /de/forum: t1-disclose at 60% (Mindestens 100 % Zustimmung in jeder Sprachgruppe: Wenn eine Software bei einer Entscheidung über Sie hilft, sollten Sie die wichtigsten Gründe in einfacher Sprache erhalten.) /de/forum: t1-disclose groups en 60%/20 fr 60%/20 ([{"name":"English","value":"100 % Zustimmung, 20 Stimmen","bar":"100%"},{"name":"Deutsch","value":"100 % Zustimmung, 20 Stimmen","bar":"100%"}]) /de/forum: t2-reasons at 100% (Mindestens 68 % Zustimmung in jeder Sprachgruppe: Sie sollten Ihren Chatverlauf mit einem Tippen löschen können.) /de/forum: t2-reasons groups en 100%/20 de 100%/20 ([{"name":"English","value":"68 % Zustimmung, 60 Stimmen","bar":"68%"},{"name":"हिन्दी","value":"68 % Zustimmung, 29 Stimmen","bar":"68%"}]) /hi/forum: 2/4 statements listed /hi/forum: t1-disclose at 60% (हर भाषा समूह में कम से कम 100% सहमत: जब सॉफ़्टवेयर आपके बारे में किसी फ़ैसले में मदद करे, तो आपको मुख्य कारण आसान भाषा में मिलने चाहिए।) /hi/forum: t1-disclose groups en 60%/20 fr 60%/20 ([{"name":"English","value":"100% सहमत, 20 वोट","bar":"100%"},{"name":"Deutsch","value":"100% सहमत, 20 वोट","bar":"100%"}]) /hi/forum: t2-reasons at 100% (हर भाषा समूह में कम से कम 68% सहमत: आपको एक टैप में अपनी चैट हिस्ट्री मिटाने की सुविधा मिलनी चाहिए।) /hi/forum: t2-reasons groups en 100%/20 de 100%/20 ([{"name":"English","value":"68% सहमत, 60 वोट","bar":"68%"},{"name":"हिन्दी","value":"68% सहमत, 29 वोट","bar":"68%"}]) exit: 1