social-reporting-tool/v2/server
DJP 821d9cbc45 Fix UK→GB geo normalisation + clear Stage 8 too-few-videos error
The Dove2 run on prod failed because every hashtag/search seed 400'd
with "Field input.proxyCountryCode must be equal to one of the allowed
values" — Apify uses ISO codes ("GB"), not the colloquial "UK" stored
on the brief. Only profile scrapes (which don't pass proxyCountryCode)
got through, leaving 24 videos and a 16% manifest gate.

Two layers of fix:
- Brief Zod schema transforms geo: trims, uppercases, maps "UK" → "GB".
  All briefs created or edited from now on are normalised at the form
  boundary.
- Stage 2 also normalises at actor-input time, as belt-and-braces for
  briefs already in the DB with "UK" written before this commit.

Plus a clear pre-flight error in Stage 8: when fewer than 5 videos made
it through analysis the trends schema literally can't be satisfied (each
trend needs ≥5 supporting_video_ids). Previously Claude tried, Zod
rejected with a 50-line "too_small" wall, and the operator was left
guessing. Now we throw a single sentence pointing at the actual cause:
the dataset is too small — adjust the brief and force re-run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 08:49:03 -04:00
..
__tests__ Add V2: multi-team social-reporting platform with manifest-gated linking 2026-04-29 17:39:07 -04:00
auth Add V2: multi-team social-reporting platform with manifest-gated linking 2026-04-29 17:39:07 -04:00
db Brief detail: surface this brief's report runs so status survives navigation 2026-04-29 20:22:38 -04:00
lib Add V2: multi-team social-reporting platform with manifest-gated linking 2026-04-29 17:39:07 -04:00
middleware Add V2: multi-team social-reporting platform with manifest-gated linking 2026-04-29 17:39:07 -04:00
routes Add Cancel button + POST /api/reports/:id/cancel route 2026-04-29 21:48:40 -04:00
schemas Fix UK→GB geo normalisation + clear Stage 8 too-few-videos error 2026-04-30 08:49:03 -04:00
index.ts Add Cancel button + POST /api/reports/:id/cancel route 2026-04-29 21:48:40 -04:00