No description
Find a file
DJP 508804b84f Manifest: transcripts advisory + rebuild after backfill trim
The Dove run hit 51% manifest coverage with 17 transcripts + 9 bundles
missing. Three real bugs uncovered in sequence by the manifest jq
introspection:

1. Transcripts gated as required. The Apify TIKTOK_TRANSCRIPTS actor
   only returns text for videos with captions/subtitles; haircare,
   beauty, dance, ASMR, and lifestyle TikTok content (which IS the
   target audience for this kind of brief) often has none. Stage 6's
   prompt already handles bundle.transcript === null gracefully — it
   logs "(no transcript)" and Claude analyses on caption + 30 comments
   + frame note. Made transcripts advisory by default; opt back into
   strict via MANIFEST_TRANSCRIPT_REQUIRED=true.

2. Backfill-exhaustion path didn't rebuild the manifest. When Stage 5
   ran out of pass1 candidates to backfill with, it trimmed
   selected_video_ids to survivors and broke the loop — but never
   re-evaluated the manifest against the trimmed list. coverage_pct
   stayed at the pre-trim value (e.g. 51%) and the gate failed even
   though every remaining id was 100% bundled. Now rebuilds.

3. Added a fast-fail when fewer than 5 videos pass the gate. Stage 8b
   trends require ≥5 supporting videos per trend; running Stage 6 + 7
   on 3 passing videos burns Claude budget for an unsatisfiable
   downstream schema. The cli error now distinguishes "coverage too
   low" from "passing-set too small" and points at the right remedy
   (lower min_likes/min_plays vs. raise min_plays to filter junk).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 10:30:03 -04:00
v2 Manifest: transcripts advisory + rebuild after backfill trim 2026-04-30 10:30:03 -04:00
.gitignore Stop .gitignore from swallowing src/routes/briefs/ 2026-04-29 18:44:08 -04:00
DEVELOPER_BRIEF_V2.md Add V2: multi-team social-reporting platform with manifest-gated linking 2026-04-29 17:39:07 -04:00
README.md README: document the cd /opt/social-reporting && git pull && cutover-in-place flow 2026-04-29 18:40:55 -04:00

Social Reporting

V2 lives in v2/. All commands run from there.

cd v2
docker compose -f docker-compose.v2.yml --env-file .env up -d --build
npm install
npm test                       # 62 unit tests
npm run pipe seed --report <brief-id>

For the full V2 spec see DEVELOPER_BRIEF_V2.md.

Deploying V2 over an existing V1 install

If V1 is already deployed at /opt/social-reporting, cut over in place:

ssh you@optical-dev.oliver.solutions
cd /opt/social-reporting
git pull origin main                          # pulls in v2/, removes V1 dirs
bash v2/deploy/cutover-in-place.sh            # stops V1, migrates secrets, starts V2

The script prompts before doing anything destructive, migrates APIFY/Anthropic/Azure secrets from V1's .env into a fresh v2/.env, swaps the Apache conf to V2's, and starts the V2 docker stack. It also prompts for the email that will be auto-promoted to super-admin on first SSO sign-in (BOOTSTRAP_SUPER_ADMIN_EMAIL).

The Azure-registered redirect URI https://optical-dev.oliver.solutions/social-reports/login.html is preserved by V2 (Vite base: /social-reports/, React Router basename, and an explicit /login.html route alias).

V1 archive

V1 source is preserved on the v1-archive branch (frozen at the last V1 commit) and is no longer kept on the deployed server. To roll back from V2 to V1, the rollback script will re-clone v1-archive if needed:

# On the server
export REPO_URL="https://x-token-auth:YOUR_TOKEN@bitbucket.org/zlalani/social-reporting-tool.git"
bash /opt/social-reporting-v2/v2/deploy/rollback-to-v1.sh

To inspect or check out V1 source locally:

git checkout v1-archive