disclosure-bureau/web/app
Luiz Gustavo 2ac42b99a7
Some checks failed
CI / Web — typecheck + lint + build (push) Failing after 33s
CI / Scripts — Python smoke (push) Failing after 5s
CI / Web — npm audit (push) Failing after 24s
CI / Retrieval — golden set (Recall@5 + MRR) (push) Failing after 3s
W5.5 (Phase 3C): Sun-Tzu strategist feeder + entity hero illustrations
Sun-Tzu (silent backend) — builds the strongest pro-anomaly brief the
corpus supports for any topic. Bilingual JSON: thesis + 2-4 pillars
(each with claim + citation-backed support) + honest residual
unexplained clause. NEVER surfaced reader-facing.

  Migration 0009 (apply as supabase_admin):
    public.pro_anomaly_briefs  brief_pk BIGSERIAL PK
                               brief_id B-NNNN unique
                               topic + topic_pt_br
                               thesis + thesis_pt_br
                               pillars JSONB
                               unexplained + unexplained_pt_br
                               doc_id, job_id, created_by, created_at
    + brief_id_seq sequence
    + GIN trigram indexes on topic + topic_pt_br
    + RLS policies (investigator INSERT, public SELECT)
    + GRANTs on seq + table to investigator

  prompts/sun-tzu.md
    "Adversarial strategist who plays the pro-disclosure side with the
    same rigour a red-team plays skeptic" — single thesis, 2-4 pillars,
    honest residual. Every claim cites a chunk. No fabrication from
    training-time knowledge. Output INTERNAL — case-writer pulls it.
    Bilingual mandatory. NO_STRONG_CASE sentinel when corpus is thin.

  detectives/sun_tzu.ts
    Grounds with hybridSearch top 18 chunks, calls Sonnet, parses
    JSON strict, calls writeProAnomalyBrief.

  tools/write_pro_anomaly_brief.ts
    Validates 2-4 pillars with bilingual claim+support, requires at
    least one [[wiki-link]] citation per pillar, INSERTs.

  orchestrator: new kind "anomaly_brief" dispatches Sun-Tzu.

Case-writer integration (detectives/case_writer.ts):
  - Pulls most recent matching brief via ILIKE on topic or doc_id.
  - Renders brief as a separate prompt section labelled
    "Strategic brief (internal — do NOT cite or attribute)".
  - Instructs the narrator to weave the thesis as a quiet through-
    line, use pillar facts in scenes, let the unexplained clause
    inform the closing paragraph. Forbidden to name "the analyst",
    say "a brief argues", or use the words "thesis"/"pillar"
    explicitly. Translate it into prose.

Entity hero illustrations:
  - 3 painterly editorial illustrations generated via Nano Banana
    Pro at 2K, stored under /data/disclosure/processing/case-art/:
    * EV-1947-06-24-kenneth-arnold-sighting.png — cockpit POV of
      Arnold in a CallAir A-2 over Mount Rainier, 9 chevron disc
      objects in formation, 1947 Life-magazine register.
    * EV-1947-07-08-roswell-incident.png — debris field in NM
      desert, USAAF officer in 1947 uniform examining foil
      fragments, period staff car.
    * EV-1947-06-21-maury-island-incident.png — wooden patrol
      boat on Puget Sound, 6 doughnut craft hovering, one
      shedding glowing slag, Harold Dahl + son + dog watching.
  - app/e/[cls]/[id]/page.tsx: full-bleed editorial hero replaces
    the old gradient header card when an illustration exists for
    that entity_id. Title sits over the painting with gradient
    overlay. "Ilustração editorial" chip in the top-right.

Quota note: Claude OAuth still rate-limited as of this commit, so
Sun-Tzu hasn't been smoke-tested in production. Code is shipped and
ready; first brief will land when the weekly quota refreshes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 16:41:20 -03:00
..
admin baseline: Disclosure Bureau pipeline + Next.js UI + Supabase stack 2026-05-17 22:44:36 -03:00
api W4: bilingual EN + PT-BR Investigation Bureau (CLAUDE.md §3 contract) 2026-05-24 12:02:59 -03:00
auth ship: synthesize 158 entities, AG-UI artifacts, chat persistence, auth flow 2026-05-18 03:52:59 -03:00
bureau W5.1: enthusiast pivot — strip detective surfacing, magazine homepage 2026-05-24 14:09:46 -03:00
c/[slug] W5.4 followup: hero illustration on /c/[slug] + sitemap fix 2026-05-24 16:16:20 -03:00
d/[docId] W3.10: clickable detective tiles + quick-launch form + doc bureau panel 2026-05-23 23:33:00 -03:00
documents W5.1: enthusiast pivot — strip detective surfacing, magazine homepage 2026-05-24 14:09:46 -03:00
e/[cls] W5.5 (Phase 3C): Sun-Tzu strategist feeder + entity hero illustrations 2026-05-24 16:41:20 -03:00
graph W2: rerank opt-in, analyze_image_region tool, RAG eval, graph cleanup, ADRs 2026-05-23 19:20:09 -03:00
h/[hypothesisId] W4.1+W4.2: anti-AI-tics house style + bureau nav (back/home everywhere) 2026-05-24 13:27:58 -03:00
jobs/[id] W5.1: enthusiast pivot — strip detective surfacing, magazine homepage 2026-05-24 14:09:46 -03:00
locations W5.1: enthusiast pivot — strip detective surfacing, magazine homepage 2026-05-24 14:09:46 -03:00
objects W5.1: enthusiast pivot — strip detective surfacing, magazine homepage 2026-05-24 14:09:46 -03:00
operations W5.1: enthusiast pivot — strip detective surfacing, magazine homepage 2026-05-24 14:09:46 -03:00
search baseline: Disclosure Bureau pipeline + Next.js UI + Supabase stack 2026-05-17 22:44:36 -03:00
sightings W5.1: enthusiast pivot — strip detective surfacing, magazine homepage 2026-05-24 14:09:46 -03:00
timeline baseline: Disclosure Bureau pipeline + Next.js UI + Supabase stack 2026-05-17 22:44:36 -03:00
witnesses W5.1: enthusiast pivot — strip detective surfacing, magazine homepage 2026-05-24 14:09:46 -03:00
globals.css W5.1: enthusiast pivot — strip detective surfacing, magazine homepage 2026-05-24 14:09:46 -03:00
layout.tsx W5.1 hotfix: Fraunces must be variable when using axes (next/font) 2026-05-24 14:11:11 -03:00
page.tsx W5.1: enthusiast pivot — strip detective surfacing, magazine homepage 2026-05-24 14:09:46 -03:00
robots.ts W5.4 (Phase 3B): sitemap + robots + Article schema + magazine reading view 2026-05-24 16:09:50 -03:00
sitemap.ts W5.4 followup: hero illustration on /c/[slug] + sitemap fix 2026-05-24 16:16:20 -03:00