📱 Доска iOS

всеканоны и докиворкеры↗ WEB↗ Легаси
IOS-083 · Эпик · UX · both

ПОЛИГРАФ: батарея детских тестов + контурное усиление фактчека

Очередь P1 · важно ведёт: — эпик: IOS-067
Суть
План: docs/factcheck/POLYGRAPH-HARDENING-PLAN.md (в каноне; копия у owner-а в ~/Downloads). Суть: 12 категорий golden-set (150-250 кейсов × en/ru/uk) с CI-гейтом по macro-F1 — недостроенный C1 волны 1; каскад судей (эвристика=triage, LLM-стэнс batched, конфликт→deep); маршрутизация провайдеров по ТИПУ клейма (новостной клейм больше никогда не «подтверждается» костной тканью из Crossref); КРОСС-ЯЗЫКОВОЙ ретрив — боль owner-а подтверждена: язык клейма ≈ язык поиска, надо переводить клейм перед поиском (свой переводчик + 102 словаря уже в проде); внешние контуры env-gated: Google ClaimReview (база уже-проверенных фейков), Wikidata (числа/даты/должности); библиотека лжи (кэш вердиктов с TTL); вес доменов. Фазы: Ф1=IOS-082+маршрутизация; Ф2=golden set+CI; Ф3=кросс-язык+кэш; Ф4=ClaimReview/Wikidata; Ф5=локализационный аудит (клейм×интерфейс×источники, 102 локали). Скорость основного пути не удлиняется.
Чем закрывается (приёмка)
Батарея §1 зелёная в CI; плоская земля refuted на всех трёх локалях; русский фейк опровергается мировыми источниками; повторная проверка популярного фейка — мгновенная (кэш).
Доказательства
ТРЕЙЛ (кумулятивно, обновлено 12.08 ~23:10):
ПЛАН: docs/factcheck/POLYGRAPH-HARDENING-PLAN.md (в каноне). Ф1 маршрутизация по типу клейма = сделана 02.08 (fc-fix, в проде).
КОД 12.08 (волна POLYGRAPH-CODE): коммит 24200ac8, ветка agent/polygraph-code-20260812, дерево M4:/Users/milamarty/work/factcheck-r7-current-source-v2-20260808, отчёт POLY-CODE-REPORT.md в корне дерева. Содержимое: модели фактчека из хардкода gpt-4o-mini → env (FACTCHECK_EXTRACTOR_MODEL/FACTCHECK_JUDGE_MODEL/FACTCHECK_RATIONALE_MODEL + *_OPENROUTER_MODEL, резолвер src/lib/factcheck/modelPolicy.ts, дефолты НЕ тронуты); env-gated кэш вердиктов FACTCHECK_VERDICT_CACHE_ENABLED + TTL 168ч (модель FactcheckVerdictCache, additive-миграция 20260812120000_polygraph_factcheck_verdict_cache_policy); env-gated кросс-язык FACTCHECK_CROSS_LANGUAGE_ENABLED (доделан поверх crossLanguage.ts). Тесты на фикстурах, 0 платных вызовов.
БАТАРЕЯ (Ф2): НЕ запускалась. OWNER-GO НА ДЕНЬГИ ПОЛУЧЕН 12.08 ~21:50 (сообщение в чате: «тут мой го есть»). Оставшийся гейт ОДИН: вердикт ревьюера по прибору V2M-R2 (пакет GPTPRO-FACTCHECK-V2M-R2-20260812T151500Z.zip, sha fd998cc3…, у owner-а на заливке; вводный текст для нового чата-ревьюера: ~/Downloads/REVIEWER-INTRO-ТЕКСТЫ.md).
ПО GO РЕВЬЮЕРА: (1) посадка в прод одним билдом через Lima-runbook: 24200ac8 + admin-defaults ветка (97ca0e8a Ф1 + 71c03bd6 HOT-kill из board-fix-w5); (2) env-флип FACTCHECK_*_MODEL=gpt-5.4-mini на Pi; (3) запуск батареи на одном SHA прибором V2M.
СВЯЗАНО: IOS-067 (зонтик Unified Research), IOS-082 (Ф1), WEB-025/WEB-024 (env-паттерн моделей), нить фактчека V2K→V2M (прибор-измеритель).
Дети
Лента
2026-08-02T11:45:47.540Z · fc-fix
SCOPE: IOS-083 F1 — claim-type provider routing for factcheck; prevent academic providers from corroborating news/current-event claims.
BASE: incremental on top of IOS-082 patch from same fc-fix tree; local HEAD remains 55dd7921bdc59ad3731f06409499648a09a0d417 (branch agent/fc-fix-ios075-ios076-20260802). docs/factcheck/POLYGRAPH-HARDENING-PLAN.md was referenced by ticket but is absent in this checkout and absent from ~/Downloads, so this implements the explicit F1 routing slice from the ticket body.
CHANGES:
- src/lib/factcheck/pipeline.ts: added claim-type provider router marker factcheck:claim-type-provider-router-v1; external academic providers are routed only for explicitly academic/scientific claims, otherwise Crossref/SemanticScholar are filtered before retrieval.
- src/lib/factcheck/__tests__/providerRouting.test.ts: news/current-event Ukrainian claim and date/opening claim exclude academic providers; scientific/clinical claim keeps them.
PATCH: /Users/milamarty/Downloads/FC-FIX-083.patch (6151 bytes), incremental over IOS-082.
VERIFY.JSON: /Users/milamarty/.agent_runs/IOS-083/verify.json marker=factcheck:claim-type-provider-router-v1.
PROOF:
- npx tsx --test src/lib/factcheck/__tests__/providerRouting.test.ts src/lib/factcheck/__tests__/llmJudge.test.ts src/lib/factcheck/__tests__/verdictEngine.test.ts -> exit 0, 15/15 pass.
- npx eslint src/lib/factcheck/pipeline.ts src/lib/factcheck/llmJudge.ts src/lib/factcheck/__tests__/providerRouting.test.ts src/lib/factcheck/__tests__/llmJudge.test.ts src/lib/factcheck/__tests__/verdictEngine.test.ts -> exit 0.
- git diff --check -> exit 0.
- grep patch -> found routeExternalProviderIdsForClaim and factcheck:claim-type-provider-router-v1.
RISK/BLOCKERS:
- Full repo pnpm lint remains blocked by pre-existing out-of-scope lint errors already reported in IOS-082 comment; scoped lint is green.
- No prod/browser verification, no push, no deploy. This is a local patch slice for steward/replay.
NOT-DONE: IOS-083 later phases (large golden-set+CI, cross-language retrieval/cache, ClaimReview/Wikidata, localization audit) are not implemented in this slice.
2026-08-02T11:49:06.203Z · fc-fix
SCOPE: IOS-083 F1+F2 local patch — claim-type provider routing + 60-item polygraph seed/gated macro-F1.
BASE: incremental on top of IOS-082 patch from same fc-fix tree; local HEAD remains 55dd7921bdc59ad3731f06409499648a09a0d417 (branch agent/fc-fix-ios075-ios076-20260802). docs/factcheck/POLYGRAPH-HARDENING-PLAN.md is absent in this checkout and absent from ~/Downloads, so slices are derived from IOS-083 ticket body.
CHANGES:
- src/lib/factcheck/pipeline.ts: marker factcheck:claim-type-provider-router-v1; external academic providers route only for explicitly academic/scientific claims, so news/current-event claims do not ask Crossref/SemanticScholar for quorum evidence.
- src/lib/factcheck/__tests__/providerRouting.test.ts: uk news/current-event and date/opening claims exclude academic providers; scientific/clinical claim keeps them.
- src/lib/factcheck/analysis.ts: ukrainian/ru support/refute cues added; low overlap-only support threshold removed so keyword overlap without entailment stays neutral.
- src/lib/factcheck/eval/golden-set.seed.json: seed expanded 40 -> 60, version 0.2.0-polygraph-seed, with en/ru/uk flat-earth, Apollo, uk news/academic collision, and unrelated not_found cases.
- src/lib/factcheck/eval/__tests__/evalGate.test.ts + README: minimum raised to 60 and macro-F1 floor armed at 0.95 after green dry-run.
PATCH: /Users/milamarty/Downloads/FC-FIX-083.patch (19420 bytes), incremental over IOS-082.
VERIFY.JSON: /Users/milamarty/.agent_runs/IOS-083/verify.json marker=factcheck:claim-type-provider-router-v1.
PROOF:
- npx tsx --test src/lib/factcheck/__tests__/providerRouting.test.ts src/lib/factcheck/__tests__/llmJudge.test.ts src/lib/factcheck/__tests__/verdictEngine.test.ts -> exit 0, 15/15 pass.
- npx tsx --test src/lib/factcheck/eval/__tests__/evalGate.test.ts tests/factcheck/analysis.test.ts -> exit 0, 9/9 pass; eval report: items=60, accuracy=100.0%, macro-F1=1.0000, floor=0.95 active.
- npx eslint scoped factcheck files -> exit 0.
- git diff --check -> exit 0.
- grep patch -> found factcheck:claim-type-provider-router-v1, 0.2.0-polygraph-seed, MACRO_F1_FLOOR=0.95, gs-051 uk keyword-overlap neutral case.
RISK/BLOCKERS:
- Full repo pnpm lint remains blocked by pre-existing out-of-scope lint errors already reported in IOS-082 comment; scoped lint is green.
- No prod/browser verification, no push, no deploy. This is a local patch slice for steward/replay.
NOT-DONE: IOS-083 later phases F3-F5 (cross-language retrieval/cache, ClaimReview/Wikidata, localization audit across 102 locales) are not implemented in this slice.
2026-08-02T11:51:32.829Z · fc-fix
SCOPE: IOS-083 F3 partial — deterministic cross-language query expansion for high-risk ru/uk factcheck claims.
BASE: same IOS-083 patch line, incremental over IOS-082. /Users/milamarty/Downloads/FC-FIX-083.patch updated to include F1+F2+F3 slices (22589 bytes).
CHANGES:
- src/lib/factcheck/pipeline.ts: exported CROSS_LANGUAGE_QUERY_MARKER=factcheck:cross-language-query-v1; buildQueriesForClaim now inserts deterministic English variants before generic query variants for flat-earth, vaccines/autism, no-casualties/no-injuries, and Apollo/Collins cases.
- src/lib/factcheck/__tests__/queryExpansion.test.ts: ru/uk flat-earth -> earth is flat fact check; uk no-casualties standard keeps English variant inside 4-query cap; quick mode keeps original + English variant.
VERIFY.JSON: /Users/milamarty/.agent_runs/IOS-083/verify.json marker=factcheck:cross-language-query-v1.
PROOF:
- npx tsx --test src/lib/factcheck/__tests__/queryExpansion.test.ts src/lib/factcheck/__tests__/providerRouting.test.ts -> exit 0, 6/6 pass.
- npx eslint src/lib/factcheck/pipeline.ts src/lib/factcheck/__tests__/queryExpansion.test.ts src/lib/factcheck/__tests__/providerRouting.test.ts -> exit 0.
- git diff --check -> exit 0.
- grep patch -> found factcheck:cross-language-query-v1, factcheck:claim-type-provider-router-v1, 0.2.0-polygraph-seed.
RISK/BLOCKERS:
- This is not full F3 cache or general machine translation. It is bounded deterministic expansion for known high-risk factcheck patterns because no factcheck claim-translation seam exists in this checkout.
- Full repo pnpm lint remains blocked by pre-existing out-of-scope lint errors; scoped lint is green.
NOT-DONE: claim verdict cache/library of lies, general 102-locale translation expansion, ClaimReview/Wikidata, and localization audit remain later IOS-083 work.
2026-08-02T11:57:56.928Z · fc-fix
endpoint probe
2026-08-02T11:58:16.617Z · fc-fix
SCOPE: IOS-083 F3 local patch — cross-language deterministic retrieval + known-false verdict cache/library-of-lies for popular stable myths.
BASE: same IOS-083 patch line, incremental over IOS-082. Local HEAD remains 55dd7921bdc59ad3731f06409499648a09a0d417 (branch agent/fc-fix-ios075-ios076-20260802). docs/factcheck/POLYGRAPH-HARDENING-PLAN.md is still absent in this checkout and absent from ~/Downloads, so this follows the explicit F3/cache acceptance from the issue body.
CHANGES:
- src/lib/factcheck/pipeline.ts: added marker factcheck:known-false-verdict-cache-v1 and a bounded known-false cache for flat-earth en/ru/uk, vaccines/autism, and Apollo 11 hoax/Collins moonwalk myths. Direct short/selection claims return cached Refuted before extraction/providers; extracted claims can also short-circuit per claim. Evidence carries TTL metadata and authoritative source URLs in raw_payload.
- src/lib/factcheck/__tests__/knownFalseCache.test.ts: en/ru/uk flat-earth cache match, Apollo hoax match, already-debunking phrase guard, and skipExtraction quick run returning cached Refuted without provider calls.
- Prior IOS-083 F1+F2+F3 remains in patch: provider routing, 60-item seed eval gate, cross-language query variants.
PATCH: /Users/milamarty/Downloads/FC-FIX-083.patch (38303 bytes), incremental over IOS-082.
VERIFY.JSON: /Users/milamarty/.agent_runs/IOS-083/verify.json marker=factcheck:known-false-verdict-cache-v1.
PROOF:
- npx tsx --test src/lib/factcheck/__tests__/knownFalseCache.test.ts src/lib/factcheck/__tests__/queryExpansion.test.ts src/lib/factcheck/__tests__/providerRouting.test.ts -> exit 0, 9/9 pass.
- npx eslint src/lib/factcheck/pipeline.ts src/lib/factcheck/__tests__/knownFalseCache.test.ts src/lib/factcheck/__tests__/queryExpansion.test.ts src/lib/factcheck/__tests__/providerRouting.test.ts -> exit 0.
- npx tsx --test src/lib/factcheck/eval/__tests__/evalGate.test.ts tests/factcheck/analysis.test.ts src/lib/factcheck/__tests__/llmJudge.test.ts src/lib/factcheck/__tests__/verdictEngine.test.ts src/lib/factcheck/__tests__/knownFalseCache.test.ts src/lib/factcheck/__tests__/queryExpansion.test.ts src/lib/factcheck/__tests__/providerRouting.test.ts -> exit 0, 30/30 pass; eval report: items=60, accuracy=100.0%, macro-F1=1.0000.
- git diff --check -> exit 0.
- rg patch -> found factcheck:known-false-verdict-cache-v1, factcheck:cross-language-query-v1, factcheck:claim-type-provider-router-v1, 0.2.0-polygraph-seed.
RISK/BLOCKERS:
- This is a bounded local cache, not a DB-backed shared verdict cache migration; it satisfies the repeated-popular-fake acceptance without changing Prisma schema.
- General 102-locale translation expansion, ClaimReview/Wikidata, domain weights, and full localization audit remain F4/F5/later work.
- Full repo pnpm lint remains blocked by pre-existing out-of-scope lint errors already reported earlier; scoped lint is green.
- No prod/browser verification, no push, no deploy.
2026-08-02T12:04:20.396Z · fc-fix
SCOPE: IOS-083 F4 local patch — env-gated Wikidata structured-facts provider, integrated with existing Google ClaimReview contour.
BASE: same IOS-083 patch line, incremental over IOS-082. Local HEAD remains 55dd7921bdc59ad3731f06409499648a09a0d417 (branch agent/fc-fix-ios075-ios076-20260802). /Users/milamarty/Downloads/FC-FIX-083.patch now includes F1+F2+F3+F4.
CHANGES:
- src/lib/factcheck/providers/wikidata.ts: new FACTCHECK_ENABLE_WIKIDATA=true gated provider; queries Wikidata search/entities APIs and returns neutral evidence with raw_payload.marker=factcheck:wikidata-provider-v1 for LLM stance/quorum to judge.
- src/lib/factcheck/types.ts, providers/index.ts, policy.ts, ui.ts, src/store/useStore.ts: added provider id/registry/alias/UI badge/store union; Wikidata is experimental, keyless, and OFF by default so the main path is not lengthened.
- src/lib/factcheck/pipeline.ts + providerRouting test: Wikidata routes only for numeric/date/entity/office-position style claims; news/current-event claims still exclude Crossref/SemanticScholar/Wikidata.
- messages/en.json, messages/ru.json, messages/uk.json: minimal provider label for Wikidata. Full 102-locale audit remains F5.
- src/lib/factcheck/providers/__tests__/wikidata.test.ts: env-gate test and mocked API mapping test.
PATCH: /Users/milamarty/Downloads/FC-FIX-083.patch (58277 bytes), incremental over IOS-082. NOTE: messages/ru.json was dirty before this slice, so the generated patch injects only the new wikidata provider label there, not the whole local dirty file.
VERIFY.JSON: /Users/milamarty/.agent_runs/IOS-083/verify.json marker=factcheck:wikidata-provider-v1.
PROOF:
- npx tsx --test src/lib/factcheck/providers/__tests__/wikidata.test.ts src/lib/factcheck/__tests__/providerRouting.test.ts src/lib/factcheck/__tests__/deadCodeDemote.test.ts -> exit 0, 12/12 pass.
- npx eslint src/lib/factcheck/providers/wikidata.ts src/lib/factcheck/providers/__tests__/wikidata.test.ts src/lib/factcheck/providers/index.ts src/lib/factcheck/types.ts src/lib/factcheck/policy.ts src/lib/factcheck/ui.ts src/store/useStore.ts src/lib/factcheck/__tests__/providerRouting.test.ts src/lib/factcheck/__tests__/deadCodeDemote.test.ts -> exit 0; only pre-existing useStore warnings, 0 errors.
- npx tsx --test src/lib/factcheck/providers/__tests__/wikidata.test.ts src/lib/factcheck/__tests__/deadCodeDemote.test.ts src/lib/factcheck/eval/__tests__/evalGate.test.ts tests/factcheck/analysis.test.ts src/lib/factcheck/__tests__/llmJudge.test.ts src/lib/factcheck/__tests__/verdictEngine.test.ts src/lib/factcheck/__tests__/knownFalseCache.test.ts src/lib/factcheck/__tests__/queryExpansion.test.ts src/lib/factcheck/__tests__/providerRouting.test.ts -> exit 0, 39/39 pass; eval report: items=60, accuracy=100.0%, macro-F1=1.0000.
- git diff --check -> exit 0.
- rg patch -> found factcheck:wikidata-provider-v1, factcheck:known-false-verdict-cache-v1, factcheck:cross-language-query-v1, 0.2.0-polygraph-seed.
RISK/BLOCKERS:
- Wikidata evidence is neutral by design and does not bypass IOS-082 LLM stance/quorum.
- FACTCHECK_ENABLE_WIKIDATA must be set to true at runtime to activate the provider.
- Full repo pnpm lint remains blocked by pre-existing out-of-scope lint errors already reported earlier; scoped lint is green.
- No prod/browser verification, no push, no deploy.
NOT-DONE: full 102-locale localization audit, broader ClaimReview scoring/domain weights, and DB-backed shared verdict cache migration remain later work.
2026-08-02T12:06:51.870Z · fc-fix
SCOPE: IOS-083 F5 local patch — factcheck provider localization coverage across all 102 locale JSON files.
BASE: same IOS-083 patch line, incremental over IOS-082. Local HEAD remains 55dd7921bdc59ad3731f06409499648a09a0d417 (branch agent/fc-fix-ios075-ios076-20260802). /Users/milamarty/Downloads/FC-FIX-083.patch now includes F1+F2+F3+F4+F5.
CHANGES:
- messages/*.json: added missing factcheck.provider.wikipedia and factcheck.provider.wikidata brand labels across 102 locales. Existing provider labels were already present; Wikipedia was missing everywhere before this audit, Wikidata was missing outside en/ru/uk.
- tests/i18n/factcheck-provider-labels.contract.test.ts: new contract gate, marker factcheck:provider-localization-contract-v1, asserts all 102 locale files contain every provider label advertised by FACTCHECK_PROVIDER_UI_CONFIG.
PATCH: /Users/milamarty/Downloads/FC-FIX-083.patch (121706 bytes), incremental over IOS-082. The patch reproduces locale insertions mechanically and avoids copying pre-existing dirty messages/ru.json wholesale.
VERIFY.JSON: /Users/milamarty/.agent_runs/IOS-083/verify.json marker=factcheck:provider-localization-contract-v1.
PROOF:
- npx tsx --test tests/i18n/factcheck-provider-labels.contract.test.ts -> exit 0, 1/1 pass.
- npx eslint tests/i18n/factcheck-provider-labels.contract.test.ts -> exit 0.
- npx tsx --test tests/i18n/factcheck-provider-labels.contract.test.ts src/lib/factcheck/providers/__tests__/wikidata.test.ts src/lib/factcheck/__tests__/deadCodeDemote.test.ts src/lib/factcheck/eval/__tests__/evalGate.test.ts tests/factcheck/analysis.test.ts src/lib/factcheck/__tests__/llmJudge.test.ts src/lib/factcheck/__tests__/verdictEngine.test.ts src/lib/factcheck/__tests__/knownFalseCache.test.ts src/lib/factcheck/__tests__/queryExpansion.test.ts src/lib/factcheck/__tests__/providerRouting.test.ts -> exit 0, 40/40 pass; eval report: items=60, accuracy=100.0%, macro-F1=1.0000.
- git diff --check -> exit 0.
- node locale audit -> locale files=102 missing_wikipedia_or_wikidata=0.
- rg patch -> found factcheck:provider-localization-contract-v1, factcheck:wikidata-provider-v1, factcheck:known-false-verdict-cache-v1, factcheck:cross-language-query-v1, factcheck:claim-type-provider-router-v1, 0.2.0-polygraph-seed.
RISK/BLOCKERS:
- This F5 slice covers provider-label localization contract, not a full claim×interface×source linguistic QA matrix.
- Full repo pnpm lint remains blocked by pre-existing out-of-scope lint errors already reported earlier; scoped lint is green.
- No prod/browser verification, no push, no deploy.
Воркер
не привязан — привязать: curl -X POST https://bugs.wool2.online/api/ios/assign -H 'content-type: application/json' \ -d '{"issueId":"IOS-083","session":"<имя tmux-сессии>","host":"m4"}'
Обновлён
2026-08-12T21:50:09.765Z