BIT-21924: staging verification smoke seed + /api/ui/articles #22

Merged
spark merged 3 commits from task/BIT-21924-staging-smoke-seed into main 2026-05-13 06:01:58 +01:00
Owner

What

Lands the staging verification smoke-seed work that was sitting un-pushed on the lab host's local main clone. Three commits:

  1. ec20391 — Restore /api/ui/articles and add staging verification smoke seed (Xika, 2026-05-12 13:04 UTC, BIT-21924). Adds the GET /api/ui/articles endpoint that the ops UI links but that returned 404 in 4175fe5; adds an idempotent seedSmokeVerificationArticle() helper, an npm run seed:smoke-verification script, and an admin POST /ui/seed/smoke-verification route so operators without SSH on the staging container can populate one verification row. +227 LOC, 6 files, 3 new tests.
  2. 492ab8f — Align BIT-21924 smoke seed with verification AC paths (Xika, 2026-05-12 15:41 UTC, BIT-21924). Switches the seeded verification_report.sources keys to google_factcheck, claimcheck, and cross_reference (matching the orchestrator on main) with per-source status: 'found' and per-source confidences; idempotent on the dedicated slug and on any pre-existing AC-compliant row. +56/-10, 3 files, +1 test.
  3. This PR's only new commit — fix(lint): drop missing import/no-extraneous-dependencies rule disable (BIT-21924). The repo's ESLint config has no eslint-plugin-import, so the inline disable comment in tools/seed-smoke-verification-article.js itself raised an "unknown rule" error. Strip the import token; keep only the still-valid global-require disable for the lazy dotenv require. No behaviour change.

Why

BIT-21863 is the staging product pass for BIT-3602 (multi-source fact verification). The orchestrator + persist follow-up are already on main (d31b50b + e77fc46), and staging deploy is live at 4175fe5, but the staging UI table has zero rows so AC bullet 2 ("results aggregated in editorial UI") and bullet 3 ("confidence per source") cannot be visually verified. BIT-21924 was filed to add a safe non-publishing seed; the recovery agent (Xika) authored these commits and pushed them to the lab host's local main, but main is protected so a direct push fails (419 Conflict). This PR moves both commits onto a feature branch and adds the lint-fix needed for CI to pass.

Acceptance criteria coverage (BIT-21924)

AC Status Where
Idempotent seed appends one row with verification_report.sources containing all three AC paths ✅ src/store/smoke-verification-seed.js + tests
Operator can seed without SSH ✅ npm run seed:smoke-verification and POST /ui/seed/smoke-verification
GET /api/ui/articles works (was 404) ✅ src/http/ui-handlers.js route + test
Visible row exists for the BIT-21863 product pass to inspect ✅ once seed runs in staging post-merge

Tests / lint

Local on this branch:

  • node --test --test-concurrency=1 src/store/smoke-verification-seed.test.js src/http/ui-handlers-api-articles.test.js → 3/3 green
  • npx eslint src/store/smoke-verification-seed.js src/store/smoke-verification-seed.test.js src/http/ui-handlers-api-articles.test.js src/http/ui-handlers.js tools/seed-smoke-verification-article.js → 0 errors, 2 warnings (pre-existing no-console in the CLI seed script — harmless for a one-shot operator tool)

CI on the PR is the authoritative gate.

Operator runbook (post-merge, in staging)

# Option A — admin POST (no SSH; same auth as the ops admin endpoints)
curl -X POST -u admin:… https://10.10.50.23:3200/ui/seed/smoke-verification

# Option B — npm script (on the host)
cd /opt/ai-news-writer && npm run seed:smoke-verification

Either option is idempotent: re-running once a row with the AC paths exists is a no-op.

Reviewer notes

  • Original commits keep author Xika <[email protected]> and Paperclip-Issue: BIT-21924 trailers; no forbidden vendor Co-Authored-By: lines (per agents/_shared/BITREPORT_GIT_COMMIT_POLICY.md).
  • Branch is task/BIT-21924-staging-smoke-seed ← main.
  • Once merged + staging deploy picks up the new revision, run the seed (Option A or B above), then BIT-21863 can rerun its four-AC checks against /ui and /api/ui/articles.
## What Lands the **staging verification smoke-seed** work that was sitting un-pushed on the lab host's local `main` clone. Three commits: 1. [`ec20391`](https://git.bitreport.pt/BitReport.pt/ai-news-writer/commit/ec20391) — *Restore `/api/ui/articles` and add staging verification smoke seed* (Xika, 2026-05-12 13:04 UTC, BIT-21924). Adds the `GET /api/ui/articles` endpoint that the ops UI links but that returned 404 in `4175fe5`; adds an idempotent `seedSmokeVerificationArticle()` helper, an `npm run seed:smoke-verification` script, and an admin `POST /ui/seed/smoke-verification` route so operators without SSH on the staging container can populate one verification row. +227 LOC, 6 files, 3 new tests. 2. [`492ab8f`](https://git.bitreport.pt/BitReport.pt/ai-news-writer/commit/492ab8f) — *Align BIT-21924 smoke seed with verification AC paths* (Xika, 2026-05-12 15:41 UTC, BIT-21924). Switches the seeded `verification_report.sources` keys to `google_factcheck`, `claimcheck`, and `cross_reference` (matching the orchestrator on `main`) with per-source `status: 'found'` and per-source confidences; idempotent on the dedicated slug **and** on any pre-existing AC-compliant row. +56/-10, 3 files, +1 test. 3. **This PR's only new commit** — *fix(lint): drop missing `import/no-extraneous-dependencies` rule disable* (BIT-21924). The repo's ESLint config has no `eslint-plugin-import`, so the inline disable comment in `tools/seed-smoke-verification-article.js` itself raised an "unknown rule" error. Strip the import token; keep only the still-valid `global-require` disable for the lazy `dotenv` require. No behaviour change. ## Why [BIT-21863](/BIT/issues/BIT-21863) is the staging product pass for [BIT-3602](/BIT/issues/BIT-3602) (multi-source fact verification). The orchestrator + persist follow-up are already on `main` (`d31b50b` + `e77fc46`), and staging deploy is live at `4175fe5`, but the staging UI table has zero rows so AC bullet 2 ("results aggregated in editorial UI") and bullet 3 ("confidence per source") cannot be visually verified. [BIT-21924](/BIT/issues/BIT-21924) was filed to add a safe non-publishing seed; the recovery agent (Xika) authored these commits and pushed them to the lab host's local `main`, but `main` is protected so a direct push fails (`419 Conflict`). This PR moves both commits onto a feature branch and adds the lint-fix needed for CI to pass. ## Acceptance criteria coverage (BIT-21924) | AC | Status | Where | |---|---|---| | Idempotent seed appends one row with `verification_report.sources` containing all three AC paths | ✅ | `src/store/smoke-verification-seed.js` + tests | | Operator can seed without SSH | ✅ | `npm run seed:smoke-verification` and `POST /ui/seed/smoke-verification` | | `GET /api/ui/articles` works (was 404) | ✅ | `src/http/ui-handlers.js` route + test | | Visible row exists for the BIT-21863 product pass to inspect | ✅ once seed runs in staging post-merge | ## Tests / lint Local on this branch: - `node --test --test-concurrency=1 src/store/smoke-verification-seed.test.js src/http/ui-handlers-api-articles.test.js` → **3/3 green** - `npx eslint src/store/smoke-verification-seed.js src/store/smoke-verification-seed.test.js src/http/ui-handlers-api-articles.test.js src/http/ui-handlers.js tools/seed-smoke-verification-article.js` → **0 errors**, 2 warnings (pre-existing `no-console` in the CLI seed script — harmless for a one-shot operator tool) CI on the PR is the authoritative gate. ## Operator runbook (post-merge, in staging) ```bash # Option A — admin POST (no SSH; same auth as the ops admin endpoints) curl -X POST -u admin:… https://10.10.50.23:3200/ui/seed/smoke-verification # Option B — npm script (on the host) cd /opt/ai-news-writer && npm run seed:smoke-verification ``` Either option is idempotent: re-running once a row with the AC paths exists is a no-op. ## Reviewer notes - Original commits keep author `Xika <[email protected]>` and `Paperclip-Issue: BIT-21924` trailers; no forbidden vendor `Co-Authored-By:` lines (per `agents/_shared/BITREPORT_GIT_COMMIT_POLICY.md`). - Branch is `task/BIT-21924-staging-smoke-seed` ← `main`. - Once merged + staging deploy picks up the new revision, run the seed (Option A or B above), then [BIT-21863](/BIT/issues/BIT-21863) can rerun its four-AC checks against `/ui` and `/api/ui/articles`.
spark added 3 commits 2026-05-13 05:37:00 +01:00
Wire GET /api/ui/articles (documented but missing) so curl/JQ checks work against the article log.
Add idempotent seed helper, npm run seed:smoke-verification, and admin POST /ui/seed/smoke-verification for operators without SSH to the CT.

Paperclip-Issue: BIT-21924
Paperclip-Run: 4105a0ac-e90c-477f-8065-10419988abdf
verification_report.sources now use google_factcheck, claimcheck, and cross_reference with per-source status/confidence.
Slug smoke-verification-bit21924; skip if any row already has the three paths (idempotent across legacy smoke rows).

Paperclip-Issue: BIT-21924
Paperclip-Run: 6be4879b-b739-479f-a6f9-f08d0654678d
fix(lint): drop missing import/no-extraneous-dependencies rule disable
ai-news-writer-ci / test (pull_request) Successful in 36s
65fa4014d0
CI lint job has no eslint-plugin-import installed, so the inline
disable-next-line for that rule itself raises an "unknown rule" error
on `tools/seed-smoke-verification-article.js`. Drop the import-related
token from the disable comment and keep only the still-valid
`global-require` disable for the lazy require of `dotenv`. No
behaviour change; the file still tries dotenv and silently continues
without it.

Paperclip-Issue: BIT-21924
Paperclip-Run: bb6e49a5-4f6d-4a8e-a4dd-ee75d961b36f
paperclip-review-bot left a comment
Member

auto-approve: CI success (gitea_auto_approve_open_prs_once.py)

auto-approve: CI success (gitea_auto_approve_open_prs_once.py)
founding-engineer left a comment
Member

auto-approve: CI success (gitea_auto_approve_open_prs_once.py)

auto-approve: CI success (gitea_auto_approve_open_prs_once.py)
devops-engineer left a comment
Member

auto-approve: CI success (gitea_auto_approve_open_prs_once.py)

auto-approve: CI success (gitea_auto_approve_open_prs_once.py)
spark scheduled this pull request to auto merge when all checks succeed 2026-05-13 06:01:57 +01:00
spark merged commit 5b5562a06c into main 2026-05-13 06:01:58 +01:00
Sign in to join this conversation.