IOS-114 · Задача · Инфраструктура · ios
ArchiveBox: вечные слепки страниц-пруфов фактчека (скаут №1)
Закрыт
P1 · важно
ведёт: —
Лента
2026-08-03T06:54:41.185Z · archive-engPatch: ~/Downloads/ARCHIVE-114.patch
Env contract:
- ARCHIVEBOX_ENDPOINT enables the contour. Empty/unset disables it. Expected Pi value: http://127.0.0.1:8891
- ARCHIVEBOX_TOKEN is optional. When set, requests use Authorization: Bearer <token>.
Runtime contract:
- After a done factcheck run emits factcheck.run.completed, the server collects up to 20 unique external http/https evidence.source_url values, excluding internal provider/private-local URLs.
- It fire-and-forgets POST /api/v1/cli/add with JSON {urls, tag: factcheck:<runId>, depth:0}. ArchiveBox down/non-2xx/timeout is a silent skip and never blocks the user response.
- If ArchiveBox returns id/timestamp for a URL, VerificationEvidence.archiveUrl is best-effort updated to <ARCHIVEBOX_ENDPOINT>/archive/<id>/.
How to verify:
1. Do not apply migration in this task; migration file only adds nullable VerificationEvidence.archiveUrl.
2. Set ARCHIVEBOX_ENDPOINT=http://127.0.0.1:8891 and optional ARCHIVEBOX_TOKEN, run a factcheck with external evidence, then check ArchiveBox receives tag factcheck:<runId>.
3. Mock-wrapper test: NODE_PATH=node_modules npx tsx --test src/lib/factcheck/__tests__/archiveSnapshots.test.ts
4. SourceCard/Markdown/PDF show link text "слепок" when archiveUrl exists. 2026-08-03T06:57:05.699Z · archive-engSCOPE: IOS-114 — ArchiveBox snapshots for factcheck evidence.
BASE: 000c8339b997ca9faf79888ae52b79aa1477f3ec (baseline from /tmp/canon-982bfd9.tar.gz in ~/Projects/archive114)
COMMIT: f913408c6f34911d729137623fc3ddd0d5d0acf9
ROOT/CONTRACT: env-gated ArchiveBox integration. Set ARCHIVEBOX_ENDPOINT=http://127.0.0.1:8891 on the server; optional ARCHIVEBOX_TOKEN sends Authorization: Bearer <token>. If endpoint is absent/down/non-2xx, wrapper returns empty and factcheck response is not blocked. REST path used: POST /api/v1/cli/add with JSON {urls, tag:"factcheck:<runId>", depth:0}.
CHANGES:
- src/lib/factcheck/archiveSnapshots.ts — collects up to 20 unique external http/https evidence.source_url values, skips internal provider/private hosts, submits to ArchiveBox with 1.5s timeout, and backfills VerificationEvidence.archiveUrl when ids/timestamps are returned.
- src/app/api/factcheck/run/route.ts — after done-run telemetry, fire-and-forget queueFactcheckArchiveSnapshots({runId, claims}); stored/readback evidence carries archive_url.
- prisma/schema.prisma + prisma/migrations/20260803100000_verification_evidence_archive_url/migration.sql — additive nullable VerificationEvidence.archiveUrl column; migration NOT applied here.
- SourceCard/export/PDF paths — show/pass through a visible "слепок" link when archiveUrl exists; UI marker factcheck-evidence-archive-snapshot-link.
PROOF:
- npx tsx --test src/lib/factcheck/__tests__/archiveSnapshots.test.ts => exit 0, 4/4 pass.
- npx tsx --test src/lib/factcheck/__tests__/pdfTemplate.test.ts => exit 0, 7/7 pass.
- npx eslint <scoped changed TS/TSX files> => exit 0.
- git diff 000c833..HEAD --check => exit 0.
- git apply --check /Users/milamarty/Downloads/ARCHIVE-114.patch on clean /tmp/archive114-apply-check.Jugyhl => exit 0.
ARTIFACTS:
- /Users/milamarty/Downloads/ARCHIVE-114.patch (27224 bytes)
- /Users/milamarty/.agent_runs/IOS-114/verify.json
HOW TO CHECK LIVE: deploy with migration applied and ARCHIVEBOX_ENDPOINT set; run a factcheck that produces external evidence; completed source cards should show "слепок" links to /archive/<id>/ and markdown/PDF exports should include the same snapshot URL.
NOT-DONE: no deploy, no push, migration not applied per brief. 2026-08-03T08:05:32.577Z · backup-opusЗАКРЫТ живым пруфом: фактчек-ран → 6 веб-эвиденсов автоматически заархивированы (archivebox list: wikipedia ru/en/bg, traveller-eu, baidu). Контур: ArchiveBox 0.7.4 (docker, Pi) + bridge-шим 127.0.0.1:8892 (REST-контракт /api/v1/cli/add поверх CLI — v0.7 без API) + fire-and-forget хук после done-рана + archiveUrl-колонка. Ссылки «слепок» в карточке/PDF подхватятся по мере заполнения archiveUrl.
Воркер
не привязан — привязать:
curl -X POST https://bugs.wool2.online/api/ios/assign -H 'content-type: application/json' \
-d '{"issueId":"IOS-114","session":"<имя tmux-сессии>","host":"m4"}'
Обновлён
2026-08-03T08:05:32.468Z