disclosure-bureau/web/app/c/[slug]/page.tsx

220 lines
8.6 KiB
TypeScript
Raw Normal View History

W3.8: Investigation Bureau complete — Poirot, Taleb, Tetlock, Case-Writer Brings the bureau from 4 → 8 detectives. All eight run as Bun + claude-CLI subprocesses against the same Supabase + investigation_jobs LISTEN/NOTIFY queue, sharing search.ts hybridSearch and writer-side validators that gate writes against schema + FK. New detectives: Poirot (witness_analysis) - prompts/poirot.md — credibility / access / bias / corroboration / verdict; uses entity_mentions JOIN chunks to pull 12 chunks per person; resolves corroboration_refs chunk_ids defensively (accepts bare cNNNN even when the model emits pNNN/cNNNN). - INSERT into public.witnesses with W-NNNN naming. - Tone: purple (#9b5de5). Taleb (outlier_scan) - prompts/taleb.md — "surprise is relative to a model"; at most 3 outliers; each requires explicit dominant_model + why_surprising + what_it_implies; fan-out into public.gaps with scope.kind="outlier". - Same unscoped-fallback as Dupin (Pass 1 with doc_id, Pass 2 widens to corpus if hits < 3). - Tone: yellow (#ffd23f). Tetlock (calibrate_hypothesis) - prompts/tetlock.md — honest Bayesian update; emits new_posterior + Δ + recommended_action ∈ {keep, downgrade, upgrade, supersede}. - write_calibration UPDATEs public.hypotheses + APPENDS a "## Calibration history" section to the H-NNNN.md case file (calibration is append-only — each datapoint matters). Posterior band auto-corrected to match Tetlock thresholds. - NO_NEW_EVIDENCE sentinel handled; pure 'keep' with |Δ|<0.005 only touches updated_at + reviewed_by. - Tone: teal (#26d4cc). Case-Writer (case_report) - prompts/case-writer.md — Dr. Watson assembles all artefacts (E-NNNN, H-NNNN, R-NNNN, W-NNNN, G-NNNN) into a five-act narrative. ILIKE filter on topic; doc_id optional scope. - Larger budget cap (≥ $0.50) + longer timeout for prose generation. - Writes case/reports/<slug>.md with frontmatter (topic + counts); no DB table for v0. - New page /c/[slug] renders the report via MarkdownBody + stat chips. - Tone: gold (#e0c080). Hardening across the bureau: - Sentinel parsing now accepts backticked AND prose-trailing forms (Holmes NO_HYPOTHESES, Dupin NO_CONTRADICTIONS, Schneier INSUFFICIENT_HYPOTHESIS, Poirot INSUFFICIENT_TESTIMONY, Taleb NO_OUTLIERS, Tetlock NO_NEW_EVIDENCE, Case-Writer INSUFFICIENT_ARTEFACTS). Avoids the failure mode where the model refuses honestly but the runtime treated it as a parse error (observed live with Poirot+Hoover identifying the DIRECTOR false-positive disambiguation issue in entity_mentions). Chat tool extensions (web/lib/chat/tools.ts): - request_investigation now accepts 7 kinds. Each routes to its detective with appropriate validation (hypothesis_id regex, person_id kebab-case, topic non-empty, doc_id for evidence_chain). - ETA per kind: Holmes/Dupin 60s, Poirot 45s, Schneier/Tetlock 30s, Taleb 50s, Case-Writer 180s (longer prose), Locard 30×n_chunks. UI integration: - chat-bubble inline card paints each detective in its tone color. - /jobs/[id] page header swaps name/subtitle/tone per detective; question label adapts ("Topic" / "Hypothesis under attack" / "Witness under analysis" / "Topic to outlier-scan" / "Hypothesis under recalibration" / "Case to assemble"). - job-status-poller renders: case-report link card (gold), outlier cards (yellow), witness cards (purple) — alongside existing hypothesis, evidence, contradiction cards. - /api/jobs/[id] hydrates witnesses (JOIN entities for canonical_name) + gaps (with scope JSONB). - /c/[slug] page reads /data/ufo/case/reports/<slug>.md and renders with MarkdownBody, frontmatter parsed for stat chips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 01:11:39 +00:00
/**
W5.4 (Phase 3B): sitemap + robots + Article schema + magazine reading view GEO/SEO surface area: app/robots.ts (new — Next.js dynamic robots) Explicitly ALLOWS major AI crawlers: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-Web, anthropic-ai, PerplexityBot, Perplexity-User, Google-Extended, Applebot-Extended, CCBot, DuckAssistBot, YouBot, Bytespider, Amazonbot. The site exists to be cited by LLMs answering UAP/UFO questions — we want them in. /api/admin/, /admin/, /auth/ disallowed for everyone. app/sitemap.ts (new — Next.js dynamic sitemap) Lists 9 top-level routes + every /d/<doc> + every /c/<slug> from the filesystem + up to 500 entity URLs per class (event, person, uap_object, location, organization), sorted with summary-enriched entities first. ~3000 URLs total at current corpus size. lastModified honours summary_generated_at so crawlers re-index when entities are re-enriched. app/c/[slug]/page.tsx (rewritten — magazine reading view) - generateMetadata: per-case title, description (auto-extracted from the locale-preferred lead paragraph), canonical URL, hreflang alternate, OpenGraph article type with publishedTime, Twitter card. - JSON-LD Article schema embedded at end of page: schema.org Article + Organization publisher + inLanguage + isAccessibleForFree. This is what makes the case appear as a citable source in Google AI Overviews / Perplexity / ChatGPT search. - Reading view rewritten: display-serif headline (Fraunces), italic blockquotes with gold accent, prose-typography styling, no more detective stats line, no more "written by case-writer@detective" attribution. Locale-aware: PT-BR pulls topic_pt_br + lead in PT, English mirror. tailwind.config.ts + @tailwindcss/typography plugin + font-display family wired to var(--font-display) (Fraunces) package.json + "@tailwindcss/typography" devDependency Phase 3A note: bulk entity enrichment hit Claude OAuth weekly quota mid-run. 6 events + 3 uap_objects landed bilingual summaries before the quota exhausted. UI gracefully splits enriched vs bare entities so /sightings shows the magazine-grade cards (Kenneth Arnold 1947, Roswell, Maury Island, Joseph Perry 1960 lunar photo, Civil Defense Director 1966, etc.) on top of a compact table of the rest. Re-run when quota refreshes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:09:50 +00:00
* /c/[slug] Case file reader.
W3.8: Investigation Bureau complete — Poirot, Taleb, Tetlock, Case-Writer Brings the bureau from 4 → 8 detectives. All eight run as Bun + claude-CLI subprocesses against the same Supabase + investigation_jobs LISTEN/NOTIFY queue, sharing search.ts hybridSearch and writer-side validators that gate writes against schema + FK. New detectives: Poirot (witness_analysis) - prompts/poirot.md — credibility / access / bias / corroboration / verdict; uses entity_mentions JOIN chunks to pull 12 chunks per person; resolves corroboration_refs chunk_ids defensively (accepts bare cNNNN even when the model emits pNNN/cNNNN). - INSERT into public.witnesses with W-NNNN naming. - Tone: purple (#9b5de5). Taleb (outlier_scan) - prompts/taleb.md — "surprise is relative to a model"; at most 3 outliers; each requires explicit dominant_model + why_surprising + what_it_implies; fan-out into public.gaps with scope.kind="outlier". - Same unscoped-fallback as Dupin (Pass 1 with doc_id, Pass 2 widens to corpus if hits < 3). - Tone: yellow (#ffd23f). Tetlock (calibrate_hypothesis) - prompts/tetlock.md — honest Bayesian update; emits new_posterior + Δ + recommended_action ∈ {keep, downgrade, upgrade, supersede}. - write_calibration UPDATEs public.hypotheses + APPENDS a "## Calibration history" section to the H-NNNN.md case file (calibration is append-only — each datapoint matters). Posterior band auto-corrected to match Tetlock thresholds. - NO_NEW_EVIDENCE sentinel handled; pure 'keep' with |Δ|<0.005 only touches updated_at + reviewed_by. - Tone: teal (#26d4cc). Case-Writer (case_report) - prompts/case-writer.md — Dr. Watson assembles all artefacts (E-NNNN, H-NNNN, R-NNNN, W-NNNN, G-NNNN) into a five-act narrative. ILIKE filter on topic; doc_id optional scope. - Larger budget cap (≥ $0.50) + longer timeout for prose generation. - Writes case/reports/<slug>.md with frontmatter (topic + counts); no DB table for v0. - New page /c/[slug] renders the report via MarkdownBody + stat chips. - Tone: gold (#e0c080). Hardening across the bureau: - Sentinel parsing now accepts backticked AND prose-trailing forms (Holmes NO_HYPOTHESES, Dupin NO_CONTRADICTIONS, Schneier INSUFFICIENT_HYPOTHESIS, Poirot INSUFFICIENT_TESTIMONY, Taleb NO_OUTLIERS, Tetlock NO_NEW_EVIDENCE, Case-Writer INSUFFICIENT_ARTEFACTS). Avoids the failure mode where the model refuses honestly but the runtime treated it as a parse error (observed live with Poirot+Hoover identifying the DIRECTOR false-positive disambiguation issue in entity_mentions). Chat tool extensions (web/lib/chat/tools.ts): - request_investigation now accepts 7 kinds. Each routes to its detective with appropriate validation (hypothesis_id regex, person_id kebab-case, topic non-empty, doc_id for evidence_chain). - ETA per kind: Holmes/Dupin 60s, Poirot 45s, Schneier/Tetlock 30s, Taleb 50s, Case-Writer 180s (longer prose), Locard 30×n_chunks. UI integration: - chat-bubble inline card paints each detective in its tone color. - /jobs/[id] page header swaps name/subtitle/tone per detective; question label adapts ("Topic" / "Hypothesis under attack" / "Witness under analysis" / "Topic to outlier-scan" / "Hypothesis under recalibration" / "Case to assemble"). - job-status-poller renders: case-report link card (gold), outlier cards (yellow), witness cards (purple) — alongside existing hypothesis, evidence, contradiction cards. - /api/jobs/[id] hydrates witnesses (JOIN entities for canonical_name) + gaps (with scope JSONB). - /c/[slug] page reads /data/ufo/case/reports/<slug>.md and renders with MarkdownBody, frontmatter parsed for stat chips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 01:11:39 +00:00
*
W5.4 (Phase 3B): sitemap + robots + Article schema + magazine reading view GEO/SEO surface area: app/robots.ts (new — Next.js dynamic robots) Explicitly ALLOWS major AI crawlers: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-Web, anthropic-ai, PerplexityBot, Perplexity-User, Google-Extended, Applebot-Extended, CCBot, DuckAssistBot, YouBot, Bytespider, Amazonbot. The site exists to be cited by LLMs answering UAP/UFO questions — we want them in. /api/admin/, /admin/, /auth/ disallowed for everyone. app/sitemap.ts (new — Next.js dynamic sitemap) Lists 9 top-level routes + every /d/<doc> + every /c/<slug> from the filesystem + up to 500 entity URLs per class (event, person, uap_object, location, organization), sorted with summary-enriched entities first. ~3000 URLs total at current corpus size. lastModified honours summary_generated_at so crawlers re-index when entities are re-enriched. app/c/[slug]/page.tsx (rewritten — magazine reading view) - generateMetadata: per-case title, description (auto-extracted from the locale-preferred lead paragraph), canonical URL, hreflang alternate, OpenGraph article type with publishedTime, Twitter card. - JSON-LD Article schema embedded at end of page: schema.org Article + Organization publisher + inLanguage + isAccessibleForFree. This is what makes the case appear as a citable source in Google AI Overviews / Perplexity / ChatGPT search. - Reading view rewritten: display-serif headline (Fraunces), italic blockquotes with gold accent, prose-typography styling, no more detective stats line, no more "written by case-writer@detective" attribution. Locale-aware: PT-BR pulls topic_pt_br + lead in PT, English mirror. tailwind.config.ts + @tailwindcss/typography plugin + font-display family wired to var(--font-display) (Fraunces) package.json + "@tailwindcss/typography" devDependency Phase 3A note: bulk entity enrichment hit Claude OAuth weekly quota mid-run. 6 events + 3 uap_objects landed bilingual summaries before the quota exhausted. UI gracefully splits enriched vs bare entities so /sightings shows the magazine-grade cards (Kenneth Arnold 1947, Roswell, Maury Island, Joseph Perry 1960 lunar photo, Civil Defense Director 1966, etc.) on top of a compact table of the rest. Re-run when quota refreshes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:09:50 +00:00
* Renders a single narrated case file from /data/ufo/case/reports/<slug>.md.
* The reader sees a magazine-style article title, dateline, body. No
* detective attribution, no skeptic framing.
W3.8: Investigation Bureau complete — Poirot, Taleb, Tetlock, Case-Writer Brings the bureau from 4 → 8 detectives. All eight run as Bun + claude-CLI subprocesses against the same Supabase + investigation_jobs LISTEN/NOTIFY queue, sharing search.ts hybridSearch and writer-side validators that gate writes against schema + FK. New detectives: Poirot (witness_analysis) - prompts/poirot.md — credibility / access / bias / corroboration / verdict; uses entity_mentions JOIN chunks to pull 12 chunks per person; resolves corroboration_refs chunk_ids defensively (accepts bare cNNNN even when the model emits pNNN/cNNNN). - INSERT into public.witnesses with W-NNNN naming. - Tone: purple (#9b5de5). Taleb (outlier_scan) - prompts/taleb.md — "surprise is relative to a model"; at most 3 outliers; each requires explicit dominant_model + why_surprising + what_it_implies; fan-out into public.gaps with scope.kind="outlier". - Same unscoped-fallback as Dupin (Pass 1 with doc_id, Pass 2 widens to corpus if hits < 3). - Tone: yellow (#ffd23f). Tetlock (calibrate_hypothesis) - prompts/tetlock.md — honest Bayesian update; emits new_posterior + Δ + recommended_action ∈ {keep, downgrade, upgrade, supersede}. - write_calibration UPDATEs public.hypotheses + APPENDS a "## Calibration history" section to the H-NNNN.md case file (calibration is append-only — each datapoint matters). Posterior band auto-corrected to match Tetlock thresholds. - NO_NEW_EVIDENCE sentinel handled; pure 'keep' with |Δ|<0.005 only touches updated_at + reviewed_by. - Tone: teal (#26d4cc). Case-Writer (case_report) - prompts/case-writer.md — Dr. Watson assembles all artefacts (E-NNNN, H-NNNN, R-NNNN, W-NNNN, G-NNNN) into a five-act narrative. ILIKE filter on topic; doc_id optional scope. - Larger budget cap (≥ $0.50) + longer timeout for prose generation. - Writes case/reports/<slug>.md with frontmatter (topic + counts); no DB table for v0. - New page /c/[slug] renders the report via MarkdownBody + stat chips. - Tone: gold (#e0c080). Hardening across the bureau: - Sentinel parsing now accepts backticked AND prose-trailing forms (Holmes NO_HYPOTHESES, Dupin NO_CONTRADICTIONS, Schneier INSUFFICIENT_HYPOTHESIS, Poirot INSUFFICIENT_TESTIMONY, Taleb NO_OUTLIERS, Tetlock NO_NEW_EVIDENCE, Case-Writer INSUFFICIENT_ARTEFACTS). Avoids the failure mode where the model refuses honestly but the runtime treated it as a parse error (observed live with Poirot+Hoover identifying the DIRECTOR false-positive disambiguation issue in entity_mentions). Chat tool extensions (web/lib/chat/tools.ts): - request_investigation now accepts 7 kinds. Each routes to its detective with appropriate validation (hypothesis_id regex, person_id kebab-case, topic non-empty, doc_id for evidence_chain). - ETA per kind: Holmes/Dupin 60s, Poirot 45s, Schneier/Tetlock 30s, Taleb 50s, Case-Writer 180s (longer prose), Locard 30×n_chunks. UI integration: - chat-bubble inline card paints each detective in its tone color. - /jobs/[id] page header swaps name/subtitle/tone per detective; question label adapts ("Topic" / "Hypothesis under attack" / "Witness under analysis" / "Topic to outlier-scan" / "Hypothesis under recalibration" / "Case to assemble"). - job-status-poller renders: case-report link card (gold), outlier cards (yellow), witness cards (purple) — alongside existing hypothesis, evidence, contradiction cards. - /api/jobs/[id] hydrates witnesses (JOIN entities for canonical_name) + gaps (with scope JSONB). - /c/[slug] page reads /data/ufo/case/reports/<slug>.md and renders with MarkdownBody, frontmatter parsed for stat chips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 01:11:39 +00:00
*/
import { notFound } from "next/navigation";
import { readFile } from "node:fs/promises";
import path from "node:path";
W5.4 (Phase 3B): sitemap + robots + Article schema + magazine reading view GEO/SEO surface area: app/robots.ts (new — Next.js dynamic robots) Explicitly ALLOWS major AI crawlers: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-Web, anthropic-ai, PerplexityBot, Perplexity-User, Google-Extended, Applebot-Extended, CCBot, DuckAssistBot, YouBot, Bytespider, Amazonbot. The site exists to be cited by LLMs answering UAP/UFO questions — we want them in. /api/admin/, /admin/, /auth/ disallowed for everyone. app/sitemap.ts (new — Next.js dynamic sitemap) Lists 9 top-level routes + every /d/<doc> + every /c/<slug> from the filesystem + up to 500 entity URLs per class (event, person, uap_object, location, organization), sorted with summary-enriched entities first. ~3000 URLs total at current corpus size. lastModified honours summary_generated_at so crawlers re-index when entities are re-enriched. app/c/[slug]/page.tsx (rewritten — magazine reading view) - generateMetadata: per-case title, description (auto-extracted from the locale-preferred lead paragraph), canonical URL, hreflang alternate, OpenGraph article type with publishedTime, Twitter card. - JSON-LD Article schema embedded at end of page: schema.org Article + Organization publisher + inLanguage + isAccessibleForFree. This is what makes the case appear as a citable source in Google AI Overviews / Perplexity / ChatGPT search. - Reading view rewritten: display-serif headline (Fraunces), italic blockquotes with gold accent, prose-typography styling, no more detective stats line, no more "written by case-writer@detective" attribution. Locale-aware: PT-BR pulls topic_pt_br + lead in PT, English mirror. tailwind.config.ts + @tailwindcss/typography plugin + font-display family wired to var(--font-display) (Fraunces) package.json + "@tailwindcss/typography" devDependency Phase 3A note: bulk entity enrichment hit Claude OAuth weekly quota mid-run. 6 events + 3 uap_objects landed bilingual summaries before the quota exhausted. UI gracefully splits enriched vs bare entities so /sightings shows the magazine-grade cards (Kenneth Arnold 1947, Roswell, Maury Island, Joseph Perry 1960 lunar photo, Civil Defense Director 1966, etc.) on top of a compact table of the rest. Re-run when quota refreshes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:09:50 +00:00
import type { Metadata } from "next";
W3.8: Investigation Bureau complete — Poirot, Taleb, Tetlock, Case-Writer Brings the bureau from 4 → 8 detectives. All eight run as Bun + claude-CLI subprocesses against the same Supabase + investigation_jobs LISTEN/NOTIFY queue, sharing search.ts hybridSearch and writer-side validators that gate writes against schema + FK. New detectives: Poirot (witness_analysis) - prompts/poirot.md — credibility / access / bias / corroboration / verdict; uses entity_mentions JOIN chunks to pull 12 chunks per person; resolves corroboration_refs chunk_ids defensively (accepts bare cNNNN even when the model emits pNNN/cNNNN). - INSERT into public.witnesses with W-NNNN naming. - Tone: purple (#9b5de5). Taleb (outlier_scan) - prompts/taleb.md — "surprise is relative to a model"; at most 3 outliers; each requires explicit dominant_model + why_surprising + what_it_implies; fan-out into public.gaps with scope.kind="outlier". - Same unscoped-fallback as Dupin (Pass 1 with doc_id, Pass 2 widens to corpus if hits < 3). - Tone: yellow (#ffd23f). Tetlock (calibrate_hypothesis) - prompts/tetlock.md — honest Bayesian update; emits new_posterior + Δ + recommended_action ∈ {keep, downgrade, upgrade, supersede}. - write_calibration UPDATEs public.hypotheses + APPENDS a "## Calibration history" section to the H-NNNN.md case file (calibration is append-only — each datapoint matters). Posterior band auto-corrected to match Tetlock thresholds. - NO_NEW_EVIDENCE sentinel handled; pure 'keep' with |Δ|<0.005 only touches updated_at + reviewed_by. - Tone: teal (#26d4cc). Case-Writer (case_report) - prompts/case-writer.md — Dr. Watson assembles all artefacts (E-NNNN, H-NNNN, R-NNNN, W-NNNN, G-NNNN) into a five-act narrative. ILIKE filter on topic; doc_id optional scope. - Larger budget cap (≥ $0.50) + longer timeout for prose generation. - Writes case/reports/<slug>.md with frontmatter (topic + counts); no DB table for v0. - New page /c/[slug] renders the report via MarkdownBody + stat chips. - Tone: gold (#e0c080). Hardening across the bureau: - Sentinel parsing now accepts backticked AND prose-trailing forms (Holmes NO_HYPOTHESES, Dupin NO_CONTRADICTIONS, Schneier INSUFFICIENT_HYPOTHESIS, Poirot INSUFFICIENT_TESTIMONY, Taleb NO_OUTLIERS, Tetlock NO_NEW_EVIDENCE, Case-Writer INSUFFICIENT_ARTEFACTS). Avoids the failure mode where the model refuses honestly but the runtime treated it as a parse error (observed live with Poirot+Hoover identifying the DIRECTOR false-positive disambiguation issue in entity_mentions). Chat tool extensions (web/lib/chat/tools.ts): - request_investigation now accepts 7 kinds. Each routes to its detective with appropriate validation (hypothesis_id regex, person_id kebab-case, topic non-empty, doc_id for evidence_chain). - ETA per kind: Holmes/Dupin 60s, Poirot 45s, Schneier/Tetlock 30s, Taleb 50s, Case-Writer 180s (longer prose), Locard 30×n_chunks. UI integration: - chat-bubble inline card paints each detective in its tone color. - /jobs/[id] page header swaps name/subtitle/tone per detective; question label adapts ("Topic" / "Hypothesis under attack" / "Witness under analysis" / "Topic to outlier-scan" / "Hypothesis under recalibration" / "Case to assemble"). - job-status-poller renders: case-report link card (gold), outlier cards (yellow), witness cards (purple) — alongside existing hypothesis, evidence, contradiction cards. - /api/jobs/[id] hydrates witnesses (JOIN entities for canonical_name) + gaps (with scope JSONB). - /c/[slug] page reads /data/ufo/case/reports/<slug>.md and renders with MarkdownBody, frontmatter parsed for stat chips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 01:11:39 +00:00
import { MarkdownBody } from "@/components/markdown-body";
import { AuthBar } from "@/components/auth-bar";
W4.1+W4.2: anti-AI-tics house style + bureau nav (back/home everywhere) Two complaints in one wave: (W4.1) User: "Não pode ter vícios de IA como uso excessivo de '-' que a IA coloca geralmente no lugar de vírgulas por exemplo. Isso deve fazer parte do prompt geral." - New prompts/_house-style.md banning the 9 most common AI prose tells in both EN and PT-BR: 1. Em dashes as comma replacements (—) 2. Rule-of-three lists ("concrete, rigorous, and grounded") 3. Conjunctive openers ("Moreover", "Notably", "Ademais") 4. Superficial -ing analyses ("marking a shift", "destacando") 5. Inflated symbolism + AI vocab (tapestry, navigate, delve, underscore, robust, multifaceted, marco histórico, ...) 6. Negative parallelisms ("Not just X but Y") 7. Vague attribution ("Some scholars say...") 8. Summary closers ("In summary...", "Em suma...") 9. Hedging fluff ("It's important to note...") Verbatim chunk quotes are explicitly exempt; preserve as-is. - claude.ts callClaude() lazily loads _house-style.md once per process and PREPENDS it to every detective's system prompt: composedSystem = houseStyle + "---" + detective.systemPrompt This means all 7 detectives + future ones get the rules without any per-prompt change. (W4.2) User: "Quando entra em uma página da investigação não tem como voltar! UX terrível!" - New <BureauNav> sticky topbar with explicit "← home" + "🔎 bureau" buttons + clickable breadcrumb trail. Always visible at the top of every bureau page so the user can escape in one click. - Wired into /bureau, /h/[hypothesisId], /c/[slug], /jobs/[id]. Each page passes its sensible parent crumb (/bureau#hypotheses, /bureau#reports, /bureau#jobs). - Replaces the previous plain-text "disclosure.top / hypothesis / H-0004" line which had no visual affordance. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 16:27:58 +00:00
import { BureauNav } from "@/components/bureau-nav";
W5.4 (Phase 3B): sitemap + robots + Article schema + magazine reading view GEO/SEO surface area: app/robots.ts (new — Next.js dynamic robots) Explicitly ALLOWS major AI crawlers: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-Web, anthropic-ai, PerplexityBot, Perplexity-User, Google-Extended, Applebot-Extended, CCBot, DuckAssistBot, YouBot, Bytespider, Amazonbot. The site exists to be cited by LLMs answering UAP/UFO questions — we want them in. /api/admin/, /admin/, /auth/ disallowed for everyone. app/sitemap.ts (new — Next.js dynamic sitemap) Lists 9 top-level routes + every /d/<doc> + every /c/<slug> from the filesystem + up to 500 entity URLs per class (event, person, uap_object, location, organization), sorted with summary-enriched entities first. ~3000 URLs total at current corpus size. lastModified honours summary_generated_at so crawlers re-index when entities are re-enriched. app/c/[slug]/page.tsx (rewritten — magazine reading view) - generateMetadata: per-case title, description (auto-extracted from the locale-preferred lead paragraph), canonical URL, hreflang alternate, OpenGraph article type with publishedTime, Twitter card. - JSON-LD Article schema embedded at end of page: schema.org Article + Organization publisher + inLanguage + isAccessibleForFree. This is what makes the case appear as a citable source in Google AI Overviews / Perplexity / ChatGPT search. - Reading view rewritten: display-serif headline (Fraunces), italic blockquotes with gold accent, prose-typography styling, no more detective stats line, no more "written by case-writer@detective" attribution. Locale-aware: PT-BR pulls topic_pt_br + lead in PT, English mirror. tailwind.config.ts + @tailwindcss/typography plugin + font-display family wired to var(--font-display) (Fraunces) package.json + "@tailwindcss/typography" devDependency Phase 3A note: bulk entity enrichment hit Claude OAuth weekly quota mid-run. 6 events + 3 uap_objects landed bilingual summaries before the quota exhausted. UI gracefully splits enriched vs bare entities so /sightings shows the magazine-grade cards (Kenneth Arnold 1947, Roswell, Maury Island, Joseph Perry 1960 lunar photo, Civil Defense Director 1966, etc.) on top of a compact table of the rest. Re-run when quota refreshes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:09:50 +00:00
import { getLocale } from "@/components/locale-toggle";
W3.8: Investigation Bureau complete — Poirot, Taleb, Tetlock, Case-Writer Brings the bureau from 4 → 8 detectives. All eight run as Bun + claude-CLI subprocesses against the same Supabase + investigation_jobs LISTEN/NOTIFY queue, sharing search.ts hybridSearch and writer-side validators that gate writes against schema + FK. New detectives: Poirot (witness_analysis) - prompts/poirot.md — credibility / access / bias / corroboration / verdict; uses entity_mentions JOIN chunks to pull 12 chunks per person; resolves corroboration_refs chunk_ids defensively (accepts bare cNNNN even when the model emits pNNN/cNNNN). - INSERT into public.witnesses with W-NNNN naming. - Tone: purple (#9b5de5). Taleb (outlier_scan) - prompts/taleb.md — "surprise is relative to a model"; at most 3 outliers; each requires explicit dominant_model + why_surprising + what_it_implies; fan-out into public.gaps with scope.kind="outlier". - Same unscoped-fallback as Dupin (Pass 1 with doc_id, Pass 2 widens to corpus if hits < 3). - Tone: yellow (#ffd23f). Tetlock (calibrate_hypothesis) - prompts/tetlock.md — honest Bayesian update; emits new_posterior + Δ + recommended_action ∈ {keep, downgrade, upgrade, supersede}. - write_calibration UPDATEs public.hypotheses + APPENDS a "## Calibration history" section to the H-NNNN.md case file (calibration is append-only — each datapoint matters). Posterior band auto-corrected to match Tetlock thresholds. - NO_NEW_EVIDENCE sentinel handled; pure 'keep' with |Δ|<0.005 only touches updated_at + reviewed_by. - Tone: teal (#26d4cc). Case-Writer (case_report) - prompts/case-writer.md — Dr. Watson assembles all artefacts (E-NNNN, H-NNNN, R-NNNN, W-NNNN, G-NNNN) into a five-act narrative. ILIKE filter on topic; doc_id optional scope. - Larger budget cap (≥ $0.50) + longer timeout for prose generation. - Writes case/reports/<slug>.md with frontmatter (topic + counts); no DB table for v0. - New page /c/[slug] renders the report via MarkdownBody + stat chips. - Tone: gold (#e0c080). Hardening across the bureau: - Sentinel parsing now accepts backticked AND prose-trailing forms (Holmes NO_HYPOTHESES, Dupin NO_CONTRADICTIONS, Schneier INSUFFICIENT_HYPOTHESIS, Poirot INSUFFICIENT_TESTIMONY, Taleb NO_OUTLIERS, Tetlock NO_NEW_EVIDENCE, Case-Writer INSUFFICIENT_ARTEFACTS). Avoids the failure mode where the model refuses honestly but the runtime treated it as a parse error (observed live with Poirot+Hoover identifying the DIRECTOR false-positive disambiguation issue in entity_mentions). Chat tool extensions (web/lib/chat/tools.ts): - request_investigation now accepts 7 kinds. Each routes to its detective with appropriate validation (hypothesis_id regex, person_id kebab-case, topic non-empty, doc_id for evidence_chain). - ETA per kind: Holmes/Dupin 60s, Poirot 45s, Schneier/Tetlock 30s, Taleb 50s, Case-Writer 180s (longer prose), Locard 30×n_chunks. UI integration: - chat-bubble inline card paints each detective in its tone color. - /jobs/[id] page header swaps name/subtitle/tone per detective; question label adapts ("Topic" / "Hypothesis under attack" / "Witness under analysis" / "Topic to outlier-scan" / "Hypothesis under recalibration" / "Case to assemble"). - job-status-poller renders: case-report link card (gold), outlier cards (yellow), witness cards (purple) — alongside existing hypothesis, evidence, contradiction cards. - /api/jobs/[id] hydrates witnesses (JOIN entities for canonical_name) + gaps (with scope JSONB). - /c/[slug] page reads /data/ufo/case/reports/<slug>.md and renders with MarkdownBody, frontmatter parsed for stat chips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 01:11:39 +00:00
export const runtime = "nodejs";
export const dynamic = "force-dynamic";
const CASE_ROOT = process.env.CASE_ROOT || "/data/ufo/case";
W5.4 (Phase 3B): sitemap + robots + Article schema + magazine reading view GEO/SEO surface area: app/robots.ts (new — Next.js dynamic robots) Explicitly ALLOWS major AI crawlers: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-Web, anthropic-ai, PerplexityBot, Perplexity-User, Google-Extended, Applebot-Extended, CCBot, DuckAssistBot, YouBot, Bytespider, Amazonbot. The site exists to be cited by LLMs answering UAP/UFO questions — we want them in. /api/admin/, /admin/, /auth/ disallowed for everyone. app/sitemap.ts (new — Next.js dynamic sitemap) Lists 9 top-level routes + every /d/<doc> + every /c/<slug> from the filesystem + up to 500 entity URLs per class (event, person, uap_object, location, organization), sorted with summary-enriched entities first. ~3000 URLs total at current corpus size. lastModified honours summary_generated_at so crawlers re-index when entities are re-enriched. app/c/[slug]/page.tsx (rewritten — magazine reading view) - generateMetadata: per-case title, description (auto-extracted from the locale-preferred lead paragraph), canonical URL, hreflang alternate, OpenGraph article type with publishedTime, Twitter card. - JSON-LD Article schema embedded at end of page: schema.org Article + Organization publisher + inLanguage + isAccessibleForFree. This is what makes the case appear as a citable source in Google AI Overviews / Perplexity / ChatGPT search. - Reading view rewritten: display-serif headline (Fraunces), italic blockquotes with gold accent, prose-typography styling, no more detective stats line, no more "written by case-writer@detective" attribution. Locale-aware: PT-BR pulls topic_pt_br + lead in PT, English mirror. tailwind.config.ts + @tailwindcss/typography plugin + font-display family wired to var(--font-display) (Fraunces) package.json + "@tailwindcss/typography" devDependency Phase 3A note: bulk entity enrichment hit Claude OAuth weekly quota mid-run. 6 events + 3 uap_objects landed bilingual summaries before the quota exhausted. UI gracefully splits enriched vs bare entities so /sightings shows the magazine-grade cards (Kenneth Arnold 1947, Roswell, Maury Island, Joseph Perry 1960 lunar photo, Civil Defense Director 1966, etc.) on top of a compact table of the rest. Re-run when quota refreshes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:09:50 +00:00
const SITE_URL = process.env.NEXT_PUBLIC_SITE_URL || "https://disclosure.top";
W3.8: Investigation Bureau complete — Poirot, Taleb, Tetlock, Case-Writer Brings the bureau from 4 → 8 detectives. All eight run as Bun + claude-CLI subprocesses against the same Supabase + investigation_jobs LISTEN/NOTIFY queue, sharing search.ts hybridSearch and writer-side validators that gate writes against schema + FK. New detectives: Poirot (witness_analysis) - prompts/poirot.md — credibility / access / bias / corroboration / verdict; uses entity_mentions JOIN chunks to pull 12 chunks per person; resolves corroboration_refs chunk_ids defensively (accepts bare cNNNN even when the model emits pNNN/cNNNN). - INSERT into public.witnesses with W-NNNN naming. - Tone: purple (#9b5de5). Taleb (outlier_scan) - prompts/taleb.md — "surprise is relative to a model"; at most 3 outliers; each requires explicit dominant_model + why_surprising + what_it_implies; fan-out into public.gaps with scope.kind="outlier". - Same unscoped-fallback as Dupin (Pass 1 with doc_id, Pass 2 widens to corpus if hits < 3). - Tone: yellow (#ffd23f). Tetlock (calibrate_hypothesis) - prompts/tetlock.md — honest Bayesian update; emits new_posterior + Δ + recommended_action ∈ {keep, downgrade, upgrade, supersede}. - write_calibration UPDATEs public.hypotheses + APPENDS a "## Calibration history" section to the H-NNNN.md case file (calibration is append-only — each datapoint matters). Posterior band auto-corrected to match Tetlock thresholds. - NO_NEW_EVIDENCE sentinel handled; pure 'keep' with |Δ|<0.005 only touches updated_at + reviewed_by. - Tone: teal (#26d4cc). Case-Writer (case_report) - prompts/case-writer.md — Dr. Watson assembles all artefacts (E-NNNN, H-NNNN, R-NNNN, W-NNNN, G-NNNN) into a five-act narrative. ILIKE filter on topic; doc_id optional scope. - Larger budget cap (≥ $0.50) + longer timeout for prose generation. - Writes case/reports/<slug>.md with frontmatter (topic + counts); no DB table for v0. - New page /c/[slug] renders the report via MarkdownBody + stat chips. - Tone: gold (#e0c080). Hardening across the bureau: - Sentinel parsing now accepts backticked AND prose-trailing forms (Holmes NO_HYPOTHESES, Dupin NO_CONTRADICTIONS, Schneier INSUFFICIENT_HYPOTHESIS, Poirot INSUFFICIENT_TESTIMONY, Taleb NO_OUTLIERS, Tetlock NO_NEW_EVIDENCE, Case-Writer INSUFFICIENT_ARTEFACTS). Avoids the failure mode where the model refuses honestly but the runtime treated it as a parse error (observed live with Poirot+Hoover identifying the DIRECTOR false-positive disambiguation issue in entity_mentions). Chat tool extensions (web/lib/chat/tools.ts): - request_investigation now accepts 7 kinds. Each routes to its detective with appropriate validation (hypothesis_id regex, person_id kebab-case, topic non-empty, doc_id for evidence_chain). - ETA per kind: Holmes/Dupin 60s, Poirot 45s, Schneier/Tetlock 30s, Taleb 50s, Case-Writer 180s (longer prose), Locard 30×n_chunks. UI integration: - chat-bubble inline card paints each detective in its tone color. - /jobs/[id] page header swaps name/subtitle/tone per detective; question label adapts ("Topic" / "Hypothesis under attack" / "Witness under analysis" / "Topic to outlier-scan" / "Hypothesis under recalibration" / "Case to assemble"). - job-status-poller renders: case-report link card (gold), outlier cards (yellow), witness cards (purple) — alongside existing hypothesis, evidence, contradiction cards. - /api/jobs/[id] hydrates witnesses (JOIN entities for canonical_name) + gaps (with scope JSONB). - /c/[slug] page reads /data/ufo/case/reports/<slug>.md and renders with MarkdownBody, frontmatter parsed for stat chips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 01:11:39 +00:00
interface Frontmatter {
topic?: string;
W5.4 (Phase 3B): sitemap + robots + Article schema + magazine reading view GEO/SEO surface area: app/robots.ts (new — Next.js dynamic robots) Explicitly ALLOWS major AI crawlers: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-Web, anthropic-ai, PerplexityBot, Perplexity-User, Google-Extended, Applebot-Extended, CCBot, DuckAssistBot, YouBot, Bytespider, Amazonbot. The site exists to be cited by LLMs answering UAP/UFO questions — we want them in. /api/admin/, /admin/, /auth/ disallowed for everyone. app/sitemap.ts (new — Next.js dynamic sitemap) Lists 9 top-level routes + every /d/<doc> + every /c/<slug> from the filesystem + up to 500 entity URLs per class (event, person, uap_object, location, organization), sorted with summary-enriched entities first. ~3000 URLs total at current corpus size. lastModified honours summary_generated_at so crawlers re-index when entities are re-enriched. app/c/[slug]/page.tsx (rewritten — magazine reading view) - generateMetadata: per-case title, description (auto-extracted from the locale-preferred lead paragraph), canonical URL, hreflang alternate, OpenGraph article type with publishedTime, Twitter card. - JSON-LD Article schema embedded at end of page: schema.org Article + Organization publisher + inLanguage + isAccessibleForFree. This is what makes the case appear as a citable source in Google AI Overviews / Perplexity / ChatGPT search. - Reading view rewritten: display-serif headline (Fraunces), italic blockquotes with gold accent, prose-typography styling, no more detective stats line, no more "written by case-writer@detective" attribution. Locale-aware: PT-BR pulls topic_pt_br + lead in PT, English mirror. tailwind.config.ts + @tailwindcss/typography plugin + font-display family wired to var(--font-display) (Fraunces) package.json + "@tailwindcss/typography" devDependency Phase 3A note: bulk entity enrichment hit Claude OAuth weekly quota mid-run. 6 events + 3 uap_objects landed bilingual summaries before the quota exhausted. UI gracefully splits enriched vs bare entities so /sightings shows the magazine-grade cards (Kenneth Arnold 1947, Roswell, Maury Island, Joseph Perry 1960 lunar photo, Civil Defense Director 1966, etc.) on top of a compact table of the rest. Re-run when quota refreshes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:09:50 +00:00
topic_pt_br?: string;
W3.8: Investigation Bureau complete — Poirot, Taleb, Tetlock, Case-Writer Brings the bureau from 4 → 8 detectives. All eight run as Bun + claude-CLI subprocesses against the same Supabase + investigation_jobs LISTEN/NOTIFY queue, sharing search.ts hybridSearch and writer-side validators that gate writes against schema + FK. New detectives: Poirot (witness_analysis) - prompts/poirot.md — credibility / access / bias / corroboration / verdict; uses entity_mentions JOIN chunks to pull 12 chunks per person; resolves corroboration_refs chunk_ids defensively (accepts bare cNNNN even when the model emits pNNN/cNNNN). - INSERT into public.witnesses with W-NNNN naming. - Tone: purple (#9b5de5). Taleb (outlier_scan) - prompts/taleb.md — "surprise is relative to a model"; at most 3 outliers; each requires explicit dominant_model + why_surprising + what_it_implies; fan-out into public.gaps with scope.kind="outlier". - Same unscoped-fallback as Dupin (Pass 1 with doc_id, Pass 2 widens to corpus if hits < 3). - Tone: yellow (#ffd23f). Tetlock (calibrate_hypothesis) - prompts/tetlock.md — honest Bayesian update; emits new_posterior + Δ + recommended_action ∈ {keep, downgrade, upgrade, supersede}. - write_calibration UPDATEs public.hypotheses + APPENDS a "## Calibration history" section to the H-NNNN.md case file (calibration is append-only — each datapoint matters). Posterior band auto-corrected to match Tetlock thresholds. - NO_NEW_EVIDENCE sentinel handled; pure 'keep' with |Δ|<0.005 only touches updated_at + reviewed_by. - Tone: teal (#26d4cc). Case-Writer (case_report) - prompts/case-writer.md — Dr. Watson assembles all artefacts (E-NNNN, H-NNNN, R-NNNN, W-NNNN, G-NNNN) into a five-act narrative. ILIKE filter on topic; doc_id optional scope. - Larger budget cap (≥ $0.50) + longer timeout for prose generation. - Writes case/reports/<slug>.md with frontmatter (topic + counts); no DB table for v0. - New page /c/[slug] renders the report via MarkdownBody + stat chips. - Tone: gold (#e0c080). Hardening across the bureau: - Sentinel parsing now accepts backticked AND prose-trailing forms (Holmes NO_HYPOTHESES, Dupin NO_CONTRADICTIONS, Schneier INSUFFICIENT_HYPOTHESIS, Poirot INSUFFICIENT_TESTIMONY, Taleb NO_OUTLIERS, Tetlock NO_NEW_EVIDENCE, Case-Writer INSUFFICIENT_ARTEFACTS). Avoids the failure mode where the model refuses honestly but the runtime treated it as a parse error (observed live with Poirot+Hoover identifying the DIRECTOR false-positive disambiguation issue in entity_mentions). Chat tool extensions (web/lib/chat/tools.ts): - request_investigation now accepts 7 kinds. Each routes to its detective with appropriate validation (hypothesis_id regex, person_id kebab-case, topic non-empty, doc_id for evidence_chain). - ETA per kind: Holmes/Dupin 60s, Poirot 45s, Schneier/Tetlock 30s, Taleb 50s, Case-Writer 180s (longer prose), Locard 30×n_chunks. UI integration: - chat-bubble inline card paints each detective in its tone color. - /jobs/[id] page header swaps name/subtitle/tone per detective; question label adapts ("Topic" / "Hypothesis under attack" / "Witness under analysis" / "Topic to outlier-scan" / "Hypothesis under recalibration" / "Case to assemble"). - job-status-poller renders: case-report link card (gold), outlier cards (yellow), witness cards (purple) — alongside existing hypothesis, evidence, contradiction cards. - /api/jobs/[id] hydrates witnesses (JOIN entities for canonical_name) + gaps (with scope JSONB). - /c/[slug] page reads /data/ufo/case/reports/<slug>.md and renders with MarkdownBody, frontmatter parsed for stat chips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 01:11:39 +00:00
created_at?: string;
job_id?: string;
}
function parseFrontmatter(md: string): { fm: Frontmatter; body: string } {
const m = md.match(/^---\n([\s\S]+?)\n---\n([\s\S]*)$/);
if (!m) return { fm: {}, body: md };
const fm: Frontmatter = {};
for (const line of m[1].split("\n")) {
const kv = line.match(/^([a-z_]+):\s*(.+)$/);
if (!kv) continue;
W5.4 (Phase 3B): sitemap + robots + Article schema + magazine reading view GEO/SEO surface area: app/robots.ts (new — Next.js dynamic robots) Explicitly ALLOWS major AI crawlers: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-Web, anthropic-ai, PerplexityBot, Perplexity-User, Google-Extended, Applebot-Extended, CCBot, DuckAssistBot, YouBot, Bytespider, Amazonbot. The site exists to be cited by LLMs answering UAP/UFO questions — we want them in. /api/admin/, /admin/, /auth/ disallowed for everyone. app/sitemap.ts (new — Next.js dynamic sitemap) Lists 9 top-level routes + every /d/<doc> + every /c/<slug> from the filesystem + up to 500 entity URLs per class (event, person, uap_object, location, organization), sorted with summary-enriched entities first. ~3000 URLs total at current corpus size. lastModified honours summary_generated_at so crawlers re-index when entities are re-enriched. app/c/[slug]/page.tsx (rewritten — magazine reading view) - generateMetadata: per-case title, description (auto-extracted from the locale-preferred lead paragraph), canonical URL, hreflang alternate, OpenGraph article type with publishedTime, Twitter card. - JSON-LD Article schema embedded at end of page: schema.org Article + Organization publisher + inLanguage + isAccessibleForFree. This is what makes the case appear as a citable source in Google AI Overviews / Perplexity / ChatGPT search. - Reading view rewritten: display-serif headline (Fraunces), italic blockquotes with gold accent, prose-typography styling, no more detective stats line, no more "written by case-writer@detective" attribution. Locale-aware: PT-BR pulls topic_pt_br + lead in PT, English mirror. tailwind.config.ts + @tailwindcss/typography plugin + font-display family wired to var(--font-display) (Fraunces) package.json + "@tailwindcss/typography" devDependency Phase 3A note: bulk entity enrichment hit Claude OAuth weekly quota mid-run. 6 events + 3 uap_objects landed bilingual summaries before the quota exhausted. UI gracefully splits enriched vs bare entities so /sightings shows the magazine-grade cards (Kenneth Arnold 1947, Roswell, Maury Island, Joseph Perry 1960 lunar photo, Civil Defense Director 1966, etc.) on top of a compact table of the rest. Re-run when quota refreshes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:09:50 +00:00
let v = kv[2].trim();
W3.8: Investigation Bureau complete — Poirot, Taleb, Tetlock, Case-Writer Brings the bureau from 4 → 8 detectives. All eight run as Bun + claude-CLI subprocesses against the same Supabase + investigation_jobs LISTEN/NOTIFY queue, sharing search.ts hybridSearch and writer-side validators that gate writes against schema + FK. New detectives: Poirot (witness_analysis) - prompts/poirot.md — credibility / access / bias / corroboration / verdict; uses entity_mentions JOIN chunks to pull 12 chunks per person; resolves corroboration_refs chunk_ids defensively (accepts bare cNNNN even when the model emits pNNN/cNNNN). - INSERT into public.witnesses with W-NNNN naming. - Tone: purple (#9b5de5). Taleb (outlier_scan) - prompts/taleb.md — "surprise is relative to a model"; at most 3 outliers; each requires explicit dominant_model + why_surprising + what_it_implies; fan-out into public.gaps with scope.kind="outlier". - Same unscoped-fallback as Dupin (Pass 1 with doc_id, Pass 2 widens to corpus if hits < 3). - Tone: yellow (#ffd23f). Tetlock (calibrate_hypothesis) - prompts/tetlock.md — honest Bayesian update; emits new_posterior + Δ + recommended_action ∈ {keep, downgrade, upgrade, supersede}. - write_calibration UPDATEs public.hypotheses + APPENDS a "## Calibration history" section to the H-NNNN.md case file (calibration is append-only — each datapoint matters). Posterior band auto-corrected to match Tetlock thresholds. - NO_NEW_EVIDENCE sentinel handled; pure 'keep' with |Δ|<0.005 only touches updated_at + reviewed_by. - Tone: teal (#26d4cc). Case-Writer (case_report) - prompts/case-writer.md — Dr. Watson assembles all artefacts (E-NNNN, H-NNNN, R-NNNN, W-NNNN, G-NNNN) into a five-act narrative. ILIKE filter on topic; doc_id optional scope. - Larger budget cap (≥ $0.50) + longer timeout for prose generation. - Writes case/reports/<slug>.md with frontmatter (topic + counts); no DB table for v0. - New page /c/[slug] renders the report via MarkdownBody + stat chips. - Tone: gold (#e0c080). Hardening across the bureau: - Sentinel parsing now accepts backticked AND prose-trailing forms (Holmes NO_HYPOTHESES, Dupin NO_CONTRADICTIONS, Schneier INSUFFICIENT_HYPOTHESIS, Poirot INSUFFICIENT_TESTIMONY, Taleb NO_OUTLIERS, Tetlock NO_NEW_EVIDENCE, Case-Writer INSUFFICIENT_ARTEFACTS). Avoids the failure mode where the model refuses honestly but the runtime treated it as a parse error (observed live with Poirot+Hoover identifying the DIRECTOR false-positive disambiguation issue in entity_mentions). Chat tool extensions (web/lib/chat/tools.ts): - request_investigation now accepts 7 kinds. Each routes to its detective with appropriate validation (hypothesis_id regex, person_id kebab-case, topic non-empty, doc_id for evidence_chain). - ETA per kind: Holmes/Dupin 60s, Poirot 45s, Schneier/Tetlock 30s, Taleb 50s, Case-Writer 180s (longer prose), Locard 30×n_chunks. UI integration: - chat-bubble inline card paints each detective in its tone color. - /jobs/[id] page header swaps name/subtitle/tone per detective; question label adapts ("Topic" / "Hypothesis under attack" / "Witness under analysis" / "Topic to outlier-scan" / "Hypothesis under recalibration" / "Case to assemble"). - job-status-poller renders: case-report link card (gold), outlier cards (yellow), witness cards (purple) — alongside existing hypothesis, evidence, contradiction cards. - /api/jobs/[id] hydrates witnesses (JOIN entities for canonical_name) + gaps (with scope JSONB). - /c/[slug] page reads /data/ufo/case/reports/<slug>.md and renders with MarkdownBody, frontmatter parsed for stat chips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 01:11:39 +00:00
if (v.startsWith('"') && v.endsWith('"')) v = v.slice(1, -1);
W5.4 (Phase 3B): sitemap + robots + Article schema + magazine reading view GEO/SEO surface area: app/robots.ts (new — Next.js dynamic robots) Explicitly ALLOWS major AI crawlers: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-Web, anthropic-ai, PerplexityBot, Perplexity-User, Google-Extended, Applebot-Extended, CCBot, DuckAssistBot, YouBot, Bytespider, Amazonbot. The site exists to be cited by LLMs answering UAP/UFO questions — we want them in. /api/admin/, /admin/, /auth/ disallowed for everyone. app/sitemap.ts (new — Next.js dynamic sitemap) Lists 9 top-level routes + every /d/<doc> + every /c/<slug> from the filesystem + up to 500 entity URLs per class (event, person, uap_object, location, organization), sorted with summary-enriched entities first. ~3000 URLs total at current corpus size. lastModified honours summary_generated_at so crawlers re-index when entities are re-enriched. app/c/[slug]/page.tsx (rewritten — magazine reading view) - generateMetadata: per-case title, description (auto-extracted from the locale-preferred lead paragraph), canonical URL, hreflang alternate, OpenGraph article type with publishedTime, Twitter card. - JSON-LD Article schema embedded at end of page: schema.org Article + Organization publisher + inLanguage + isAccessibleForFree. This is what makes the case appear as a citable source in Google AI Overviews / Perplexity / ChatGPT search. - Reading view rewritten: display-serif headline (Fraunces), italic blockquotes with gold accent, prose-typography styling, no more detective stats line, no more "written by case-writer@detective" attribution. Locale-aware: PT-BR pulls topic_pt_br + lead in PT, English mirror. tailwind.config.ts + @tailwindcss/typography plugin + font-display family wired to var(--font-display) (Fraunces) package.json + "@tailwindcss/typography" devDependency Phase 3A note: bulk entity enrichment hit Claude OAuth weekly quota mid-run. 6 events + 3 uap_objects landed bilingual summaries before the quota exhausted. UI gracefully splits enriched vs bare entities so /sightings shows the magazine-grade cards (Kenneth Arnold 1947, Roswell, Maury Island, Joseph Perry 1960 lunar photo, Civil Defense Director 1966, etc.) on top of a compact table of the rest. Re-run when quota refreshes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:09:50 +00:00
(fm as Record<string, string>)[kv[1]] = v;
W3.8: Investigation Bureau complete — Poirot, Taleb, Tetlock, Case-Writer Brings the bureau from 4 → 8 detectives. All eight run as Bun + claude-CLI subprocesses against the same Supabase + investigation_jobs LISTEN/NOTIFY queue, sharing search.ts hybridSearch and writer-side validators that gate writes against schema + FK. New detectives: Poirot (witness_analysis) - prompts/poirot.md — credibility / access / bias / corroboration / verdict; uses entity_mentions JOIN chunks to pull 12 chunks per person; resolves corroboration_refs chunk_ids defensively (accepts bare cNNNN even when the model emits pNNN/cNNNN). - INSERT into public.witnesses with W-NNNN naming. - Tone: purple (#9b5de5). Taleb (outlier_scan) - prompts/taleb.md — "surprise is relative to a model"; at most 3 outliers; each requires explicit dominant_model + why_surprising + what_it_implies; fan-out into public.gaps with scope.kind="outlier". - Same unscoped-fallback as Dupin (Pass 1 with doc_id, Pass 2 widens to corpus if hits < 3). - Tone: yellow (#ffd23f). Tetlock (calibrate_hypothesis) - prompts/tetlock.md — honest Bayesian update; emits new_posterior + Δ + recommended_action ∈ {keep, downgrade, upgrade, supersede}. - write_calibration UPDATEs public.hypotheses + APPENDS a "## Calibration history" section to the H-NNNN.md case file (calibration is append-only — each datapoint matters). Posterior band auto-corrected to match Tetlock thresholds. - NO_NEW_EVIDENCE sentinel handled; pure 'keep' with |Δ|<0.005 only touches updated_at + reviewed_by. - Tone: teal (#26d4cc). Case-Writer (case_report) - prompts/case-writer.md — Dr. Watson assembles all artefacts (E-NNNN, H-NNNN, R-NNNN, W-NNNN, G-NNNN) into a five-act narrative. ILIKE filter on topic; doc_id optional scope. - Larger budget cap (≥ $0.50) + longer timeout for prose generation. - Writes case/reports/<slug>.md with frontmatter (topic + counts); no DB table for v0. - New page /c/[slug] renders the report via MarkdownBody + stat chips. - Tone: gold (#e0c080). Hardening across the bureau: - Sentinel parsing now accepts backticked AND prose-trailing forms (Holmes NO_HYPOTHESES, Dupin NO_CONTRADICTIONS, Schneier INSUFFICIENT_HYPOTHESIS, Poirot INSUFFICIENT_TESTIMONY, Taleb NO_OUTLIERS, Tetlock NO_NEW_EVIDENCE, Case-Writer INSUFFICIENT_ARTEFACTS). Avoids the failure mode where the model refuses honestly but the runtime treated it as a parse error (observed live with Poirot+Hoover identifying the DIRECTOR false-positive disambiguation issue in entity_mentions). Chat tool extensions (web/lib/chat/tools.ts): - request_investigation now accepts 7 kinds. Each routes to its detective with appropriate validation (hypothesis_id regex, person_id kebab-case, topic non-empty, doc_id for evidence_chain). - ETA per kind: Holmes/Dupin 60s, Poirot 45s, Schneier/Tetlock 30s, Taleb 50s, Case-Writer 180s (longer prose), Locard 30×n_chunks. UI integration: - chat-bubble inline card paints each detective in its tone color. - /jobs/[id] page header swaps name/subtitle/tone per detective; question label adapts ("Topic" / "Hypothesis under attack" / "Witness under analysis" / "Topic to outlier-scan" / "Hypothesis under recalibration" / "Case to assemble"). - job-status-poller renders: case-report link card (gold), outlier cards (yellow), witness cards (purple) — alongside existing hypothesis, evidence, contradiction cards. - /api/jobs/[id] hydrates witnesses (JOIN entities for canonical_name) + gaps (with scope JSONB). - /c/[slug] page reads /data/ufo/case/reports/<slug>.md and renders with MarkdownBody, frontmatter parsed for stat chips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 01:11:39 +00:00
}
return { fm, body: m[2] };
}
W5.4 (Phase 3B): sitemap + robots + Article schema + magazine reading view GEO/SEO surface area: app/robots.ts (new — Next.js dynamic robots) Explicitly ALLOWS major AI crawlers: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-Web, anthropic-ai, PerplexityBot, Perplexity-User, Google-Extended, Applebot-Extended, CCBot, DuckAssistBot, YouBot, Bytespider, Amazonbot. The site exists to be cited by LLMs answering UAP/UFO questions — we want them in. /api/admin/, /admin/, /auth/ disallowed for everyone. app/sitemap.ts (new — Next.js dynamic sitemap) Lists 9 top-level routes + every /d/<doc> + every /c/<slug> from the filesystem + up to 500 entity URLs per class (event, person, uap_object, location, organization), sorted with summary-enriched entities first. ~3000 URLs total at current corpus size. lastModified honours summary_generated_at so crawlers re-index when entities are re-enriched. app/c/[slug]/page.tsx (rewritten — magazine reading view) - generateMetadata: per-case title, description (auto-extracted from the locale-preferred lead paragraph), canonical URL, hreflang alternate, OpenGraph article type with publishedTime, Twitter card. - JSON-LD Article schema embedded at end of page: schema.org Article + Organization publisher + inLanguage + isAccessibleForFree. This is what makes the case appear as a citable source in Google AI Overviews / Perplexity / ChatGPT search. - Reading view rewritten: display-serif headline (Fraunces), italic blockquotes with gold accent, prose-typography styling, no more detective stats line, no more "written by case-writer@detective" attribution. Locale-aware: PT-BR pulls topic_pt_br + lead in PT, English mirror. tailwind.config.ts + @tailwindcss/typography plugin + font-display family wired to var(--font-display) (Fraunces) package.json + "@tailwindcss/typography" devDependency Phase 3A note: bulk entity enrichment hit Claude OAuth weekly quota mid-run. 6 events + 3 uap_objects landed bilingual summaries before the quota exhausted. UI gracefully splits enriched vs bare entities so /sightings shows the magazine-grade cards (Kenneth Arnold 1947, Roswell, Maury Island, Joseph Perry 1960 lunar photo, Civil Defense Director 1966, etc.) on top of a compact table of the rest. Re-run when quota refreshes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:09:50 +00:00
async function loadCase(slug: string): Promise<{ fm: Frontmatter; body: string } | null> {
try {
const md = await readFile(path.join(CASE_ROOT, "reports", `${slug}.md`), "utf-8");
return parseFrontmatter(md);
} catch {
return null;
}
}
W5.4 followup: hero illustration on /c/[slug] + sitemap fix Hero illustration: - Painterly 16:9 editorial illustration generated via Nano Banana Pro for the featured case (green-fireballs-narrative): late-1940s desert night, vivid emerald fireball over silhouetted Sandia mesas, 1948-era state-police sedan parked on US 66 shoulder with an officer in period uniform looking up, faint green glow on his face. Sandia Base 5 Miles roadsign. New Yorker-cover painterly register, NOT photorealistic, NOT sci-fi. - Stored at /data/disclosure/processing/case-art/<slug>.png, served through the existing /api/static/processing/ route. 2.7MB at 2K. - components/featured-case.tsx: prefers the illustration over the declassified-page thumbnail when present. Tags it "Editorial illustration" / "Ilustração editorial" so the reader knows it's not a photograph. - app/c/[slug]/page.tsx: full-bleed editorial hero at the top of the article when an illustration exists for the slug. Title sits on the image with gradient overlay; "Ilustração editorial" chip in the top-right corner labels the art honestly. When no illustration exists the page falls back to the plain title header. Sitemap fix: - Added export const dynamic = "force-dynamic" + revalidate = 3600 to app/sitemap.ts. Without these Next.js statically generated the sitemap at build time, when the DB and case-files volume were unreachable from the build container — which is why production was serving only the 9 static URLs instead of ~3000. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:16:20 +00:00
async function hasIllustration(slug: string): Promise<boolean> {
const fs = await import("node:fs/promises");
const UFO_ROOT = process.env.UFO_ROOT || "/data/ufo";
try {
await fs.stat(path.join(UFO_ROOT, "processing", "case-art", `${slug}.png`));
return true;
} catch {
return false;
}
}
W5.4 (Phase 3B): sitemap + robots + Article schema + magazine reading view GEO/SEO surface area: app/robots.ts (new — Next.js dynamic robots) Explicitly ALLOWS major AI crawlers: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-Web, anthropic-ai, PerplexityBot, Perplexity-User, Google-Extended, Applebot-Extended, CCBot, DuckAssistBot, YouBot, Bytespider, Amazonbot. The site exists to be cited by LLMs answering UAP/UFO questions — we want them in. /api/admin/, /admin/, /auth/ disallowed for everyone. app/sitemap.ts (new — Next.js dynamic sitemap) Lists 9 top-level routes + every /d/<doc> + every /c/<slug> from the filesystem + up to 500 entity URLs per class (event, person, uap_object, location, organization), sorted with summary-enriched entities first. ~3000 URLs total at current corpus size. lastModified honours summary_generated_at so crawlers re-index when entities are re-enriched. app/c/[slug]/page.tsx (rewritten — magazine reading view) - generateMetadata: per-case title, description (auto-extracted from the locale-preferred lead paragraph), canonical URL, hreflang alternate, OpenGraph article type with publishedTime, Twitter card. - JSON-LD Article schema embedded at end of page: schema.org Article + Organization publisher + inLanguage + isAccessibleForFree. This is what makes the case appear as a citable source in Google AI Overviews / Perplexity / ChatGPT search. - Reading view rewritten: display-serif headline (Fraunces), italic blockquotes with gold accent, prose-typography styling, no more detective stats line, no more "written by case-writer@detective" attribution. Locale-aware: PT-BR pulls topic_pt_br + lead in PT, English mirror. tailwind.config.ts + @tailwindcss/typography plugin + font-display family wired to var(--font-display) (Fraunces) package.json + "@tailwindcss/typography" devDependency Phase 3A note: bulk entity enrichment hit Claude OAuth weekly quota mid-run. 6 events + 3 uap_objects landed bilingual summaries before the quota exhausted. UI gracefully splits enriched vs bare entities so /sightings shows the magazine-grade cards (Kenneth Arnold 1947, Roswell, Maury Island, Joseph Perry 1960 lunar photo, Civil Defense Director 1966, etc.) on top of a compact table of the rest. Re-run when quota refreshes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:09:50 +00:00
/**
* Extract the first prose paragraph from the body for the meta description
* + OG. We pick the locale-preferred sub-section's opener.
*/
function pickLead(body: string, locale: "pt-br" | "en"): string {
const marker = locale === "pt-br" ? "(PT-BR)" : "(EN)";
const idx = body.indexOf(marker);
const slice = idx >= 0 ? body.slice(idx) : body;
const m = slice.match(/\n\n([^\n#>|`-][^\n]+(?:\n[^\n#>|`-][^\n]+)*)/);
return (m?.[1] ?? "").replace(/\s+/g, " ").trim();
}
export async function generateMetadata(
{ params }: { params: Promise<{ slug: string }> },
): Promise<Metadata> {
const { slug } = await params;
const locale = (await getLocale()) === "en" ? "en" : "pt-br";
const c = await loadCase(slug);
if (!c) return { title: "Case file not found" };
const title = locale === "pt-br" ? (c.fm.topic_pt_br ?? c.fm.topic ?? slug) : (c.fm.topic ?? slug);
const desc = pickLead(c.body, locale).slice(0, 200);
const canonical = `${SITE_URL}/c/${slug}`;
return {
title,
description: desc,
alternates: { canonical, languages: { "pt-BR": canonical, "en-US": canonical } },
openGraph: {
type: "article",
title,
description: desc,
url: canonical,
siteName: "The Disclosure Bureau",
locale: locale === "pt-br" ? "pt_BR" : "en_US",
publishedTime: c.fm.created_at,
},
twitter: {
card: "summary_large_image",
title,
description: desc,
},
};
}
W3.8: Investigation Bureau complete — Poirot, Taleb, Tetlock, Case-Writer Brings the bureau from 4 → 8 detectives. All eight run as Bun + claude-CLI subprocesses against the same Supabase + investigation_jobs LISTEN/NOTIFY queue, sharing search.ts hybridSearch and writer-side validators that gate writes against schema + FK. New detectives: Poirot (witness_analysis) - prompts/poirot.md — credibility / access / bias / corroboration / verdict; uses entity_mentions JOIN chunks to pull 12 chunks per person; resolves corroboration_refs chunk_ids defensively (accepts bare cNNNN even when the model emits pNNN/cNNNN). - INSERT into public.witnesses with W-NNNN naming. - Tone: purple (#9b5de5). Taleb (outlier_scan) - prompts/taleb.md — "surprise is relative to a model"; at most 3 outliers; each requires explicit dominant_model + why_surprising + what_it_implies; fan-out into public.gaps with scope.kind="outlier". - Same unscoped-fallback as Dupin (Pass 1 with doc_id, Pass 2 widens to corpus if hits < 3). - Tone: yellow (#ffd23f). Tetlock (calibrate_hypothesis) - prompts/tetlock.md — honest Bayesian update; emits new_posterior + Δ + recommended_action ∈ {keep, downgrade, upgrade, supersede}. - write_calibration UPDATEs public.hypotheses + APPENDS a "## Calibration history" section to the H-NNNN.md case file (calibration is append-only — each datapoint matters). Posterior band auto-corrected to match Tetlock thresholds. - NO_NEW_EVIDENCE sentinel handled; pure 'keep' with |Δ|<0.005 only touches updated_at + reviewed_by. - Tone: teal (#26d4cc). Case-Writer (case_report) - prompts/case-writer.md — Dr. Watson assembles all artefacts (E-NNNN, H-NNNN, R-NNNN, W-NNNN, G-NNNN) into a five-act narrative. ILIKE filter on topic; doc_id optional scope. - Larger budget cap (≥ $0.50) + longer timeout for prose generation. - Writes case/reports/<slug>.md with frontmatter (topic + counts); no DB table for v0. - New page /c/[slug] renders the report via MarkdownBody + stat chips. - Tone: gold (#e0c080). Hardening across the bureau: - Sentinel parsing now accepts backticked AND prose-trailing forms (Holmes NO_HYPOTHESES, Dupin NO_CONTRADICTIONS, Schneier INSUFFICIENT_HYPOTHESIS, Poirot INSUFFICIENT_TESTIMONY, Taleb NO_OUTLIERS, Tetlock NO_NEW_EVIDENCE, Case-Writer INSUFFICIENT_ARTEFACTS). Avoids the failure mode where the model refuses honestly but the runtime treated it as a parse error (observed live with Poirot+Hoover identifying the DIRECTOR false-positive disambiguation issue in entity_mentions). Chat tool extensions (web/lib/chat/tools.ts): - request_investigation now accepts 7 kinds. Each routes to its detective with appropriate validation (hypothesis_id regex, person_id kebab-case, topic non-empty, doc_id for evidence_chain). - ETA per kind: Holmes/Dupin 60s, Poirot 45s, Schneier/Tetlock 30s, Taleb 50s, Case-Writer 180s (longer prose), Locard 30×n_chunks. UI integration: - chat-bubble inline card paints each detective in its tone color. - /jobs/[id] page header swaps name/subtitle/tone per detective; question label adapts ("Topic" / "Hypothesis under attack" / "Witness under analysis" / "Topic to outlier-scan" / "Hypothesis under recalibration" / "Case to assemble"). - job-status-poller renders: case-report link card (gold), outlier cards (yellow), witness cards (purple) — alongside existing hypothesis, evidence, contradiction cards. - /api/jobs/[id] hydrates witnesses (JOIN entities for canonical_name) + gaps (with scope JSONB). - /c/[slug] page reads /data/ufo/case/reports/<slug>.md and renders with MarkdownBody, frontmatter parsed for stat chips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 01:11:39 +00:00
export default async function CaseReportPage({
params,
}: { params: Promise<{ slug: string }> }) {
const { slug } = await params;
if (!/^[a-z0-9][a-z0-9-]*$/.test(slug)) notFound();
W5.4 (Phase 3B): sitemap + robots + Article schema + magazine reading view GEO/SEO surface area: app/robots.ts (new — Next.js dynamic robots) Explicitly ALLOWS major AI crawlers: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-Web, anthropic-ai, PerplexityBot, Perplexity-User, Google-Extended, Applebot-Extended, CCBot, DuckAssistBot, YouBot, Bytespider, Amazonbot. The site exists to be cited by LLMs answering UAP/UFO questions — we want them in. /api/admin/, /admin/, /auth/ disallowed for everyone. app/sitemap.ts (new — Next.js dynamic sitemap) Lists 9 top-level routes + every /d/<doc> + every /c/<slug> from the filesystem + up to 500 entity URLs per class (event, person, uap_object, location, organization), sorted with summary-enriched entities first. ~3000 URLs total at current corpus size. lastModified honours summary_generated_at so crawlers re-index when entities are re-enriched. app/c/[slug]/page.tsx (rewritten — magazine reading view) - generateMetadata: per-case title, description (auto-extracted from the locale-preferred lead paragraph), canonical URL, hreflang alternate, OpenGraph article type with publishedTime, Twitter card. - JSON-LD Article schema embedded at end of page: schema.org Article + Organization publisher + inLanguage + isAccessibleForFree. This is what makes the case appear as a citable source in Google AI Overviews / Perplexity / ChatGPT search. - Reading view rewritten: display-serif headline (Fraunces), italic blockquotes with gold accent, prose-typography styling, no more detective stats line, no more "written by case-writer@detective" attribution. Locale-aware: PT-BR pulls topic_pt_br + lead in PT, English mirror. tailwind.config.ts + @tailwindcss/typography plugin + font-display family wired to var(--font-display) (Fraunces) package.json + "@tailwindcss/typography" devDependency Phase 3A note: bulk entity enrichment hit Claude OAuth weekly quota mid-run. 6 events + 3 uap_objects landed bilingual summaries before the quota exhausted. UI gracefully splits enriched vs bare entities so /sightings shows the magazine-grade cards (Kenneth Arnold 1947, Roswell, Maury Island, Joseph Perry 1960 lunar photo, Civil Defense Director 1966, etc.) on top of a compact table of the rest. Re-run when quota refreshes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:09:50 +00:00
const locale = (await getLocale()) === "en" ? "en" : "pt-br";
const c = await loadCase(slug);
if (!c) notFound();
const { fm, body } = c;
W3.8: Investigation Bureau complete — Poirot, Taleb, Tetlock, Case-Writer Brings the bureau from 4 → 8 detectives. All eight run as Bun + claude-CLI subprocesses against the same Supabase + investigation_jobs LISTEN/NOTIFY queue, sharing search.ts hybridSearch and writer-side validators that gate writes against schema + FK. New detectives: Poirot (witness_analysis) - prompts/poirot.md — credibility / access / bias / corroboration / verdict; uses entity_mentions JOIN chunks to pull 12 chunks per person; resolves corroboration_refs chunk_ids defensively (accepts bare cNNNN even when the model emits pNNN/cNNNN). - INSERT into public.witnesses with W-NNNN naming. - Tone: purple (#9b5de5). Taleb (outlier_scan) - prompts/taleb.md — "surprise is relative to a model"; at most 3 outliers; each requires explicit dominant_model + why_surprising + what_it_implies; fan-out into public.gaps with scope.kind="outlier". - Same unscoped-fallback as Dupin (Pass 1 with doc_id, Pass 2 widens to corpus if hits < 3). - Tone: yellow (#ffd23f). Tetlock (calibrate_hypothesis) - prompts/tetlock.md — honest Bayesian update; emits new_posterior + Δ + recommended_action ∈ {keep, downgrade, upgrade, supersede}. - write_calibration UPDATEs public.hypotheses + APPENDS a "## Calibration history" section to the H-NNNN.md case file (calibration is append-only — each datapoint matters). Posterior band auto-corrected to match Tetlock thresholds. - NO_NEW_EVIDENCE sentinel handled; pure 'keep' with |Δ|<0.005 only touches updated_at + reviewed_by. - Tone: teal (#26d4cc). Case-Writer (case_report) - prompts/case-writer.md — Dr. Watson assembles all artefacts (E-NNNN, H-NNNN, R-NNNN, W-NNNN, G-NNNN) into a five-act narrative. ILIKE filter on topic; doc_id optional scope. - Larger budget cap (≥ $0.50) + longer timeout for prose generation. - Writes case/reports/<slug>.md with frontmatter (topic + counts); no DB table for v0. - New page /c/[slug] renders the report via MarkdownBody + stat chips. - Tone: gold (#e0c080). Hardening across the bureau: - Sentinel parsing now accepts backticked AND prose-trailing forms (Holmes NO_HYPOTHESES, Dupin NO_CONTRADICTIONS, Schneier INSUFFICIENT_HYPOTHESIS, Poirot INSUFFICIENT_TESTIMONY, Taleb NO_OUTLIERS, Tetlock NO_NEW_EVIDENCE, Case-Writer INSUFFICIENT_ARTEFACTS). Avoids the failure mode where the model refuses honestly but the runtime treated it as a parse error (observed live with Poirot+Hoover identifying the DIRECTOR false-positive disambiguation issue in entity_mentions). Chat tool extensions (web/lib/chat/tools.ts): - request_investigation now accepts 7 kinds. Each routes to its detective with appropriate validation (hypothesis_id regex, person_id kebab-case, topic non-empty, doc_id for evidence_chain). - ETA per kind: Holmes/Dupin 60s, Poirot 45s, Schneier/Tetlock 30s, Taleb 50s, Case-Writer 180s (longer prose), Locard 30×n_chunks. UI integration: - chat-bubble inline card paints each detective in its tone color. - /jobs/[id] page header swaps name/subtitle/tone per detective; question label adapts ("Topic" / "Hypothesis under attack" / "Witness under analysis" / "Topic to outlier-scan" / "Hypothesis under recalibration" / "Case to assemble"). - job-status-poller renders: case-report link card (gold), outlier cards (yellow), witness cards (purple) — alongside existing hypothesis, evidence, contradiction cards. - /api/jobs/[id] hydrates witnesses (JOIN entities for canonical_name) + gaps (with scope JSONB). - /c/[slug] page reads /data/ufo/case/reports/<slug>.md and renders with MarkdownBody, frontmatter parsed for stat chips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 01:11:39 +00:00
W5.4 (Phase 3B): sitemap + robots + Article schema + magazine reading view GEO/SEO surface area: app/robots.ts (new — Next.js dynamic robots) Explicitly ALLOWS major AI crawlers: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-Web, anthropic-ai, PerplexityBot, Perplexity-User, Google-Extended, Applebot-Extended, CCBot, DuckAssistBot, YouBot, Bytespider, Amazonbot. The site exists to be cited by LLMs answering UAP/UFO questions — we want them in. /api/admin/, /admin/, /auth/ disallowed for everyone. app/sitemap.ts (new — Next.js dynamic sitemap) Lists 9 top-level routes + every /d/<doc> + every /c/<slug> from the filesystem + up to 500 entity URLs per class (event, person, uap_object, location, organization), sorted with summary-enriched entities first. ~3000 URLs total at current corpus size. lastModified honours summary_generated_at so crawlers re-index when entities are re-enriched. app/c/[slug]/page.tsx (rewritten — magazine reading view) - generateMetadata: per-case title, description (auto-extracted from the locale-preferred lead paragraph), canonical URL, hreflang alternate, OpenGraph article type with publishedTime, Twitter card. - JSON-LD Article schema embedded at end of page: schema.org Article + Organization publisher + inLanguage + isAccessibleForFree. This is what makes the case appear as a citable source in Google AI Overviews / Perplexity / ChatGPT search. - Reading view rewritten: display-serif headline (Fraunces), italic blockquotes with gold accent, prose-typography styling, no more detective stats line, no more "written by case-writer@detective" attribution. Locale-aware: PT-BR pulls topic_pt_br + lead in PT, English mirror. tailwind.config.ts + @tailwindcss/typography plugin + font-display family wired to var(--font-display) (Fraunces) package.json + "@tailwindcss/typography" devDependency Phase 3A note: bulk entity enrichment hit Claude OAuth weekly quota mid-run. 6 events + 3 uap_objects landed bilingual summaries before the quota exhausted. UI gracefully splits enriched vs bare entities so /sightings shows the magazine-grade cards (Kenneth Arnold 1947, Roswell, Maury Island, Joseph Perry 1960 lunar photo, Civil Defense Director 1966, etc.) on top of a compact table of the rest. Re-run when quota refreshes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:09:50 +00:00
const title = locale === "pt-br" ? (fm.topic_pt_br ?? fm.topic ?? slug) : (fm.topic ?? slug);
const dateLabel = fm.created_at ? new Date(fm.created_at).toLocaleDateString(locale === "pt-br" ? "pt-BR" : "en-US", { day: "numeric", month: "long", year: "numeric" }) : null;
const canonical = `${SITE_URL}/c/${slug}`;
const lead = pickLead(body, locale).slice(0, 280);
W5.4 followup: hero illustration on /c/[slug] + sitemap fix Hero illustration: - Painterly 16:9 editorial illustration generated via Nano Banana Pro for the featured case (green-fireballs-narrative): late-1940s desert night, vivid emerald fireball over silhouetted Sandia mesas, 1948-era state-police sedan parked on US 66 shoulder with an officer in period uniform looking up, faint green glow on his face. Sandia Base 5 Miles roadsign. New Yorker-cover painterly register, NOT photorealistic, NOT sci-fi. - Stored at /data/disclosure/processing/case-art/<slug>.png, served through the existing /api/static/processing/ route. 2.7MB at 2K. - components/featured-case.tsx: prefers the illustration over the declassified-page thumbnail when present. Tags it "Editorial illustration" / "Ilustração editorial" so the reader knows it's not a photograph. - app/c/[slug]/page.tsx: full-bleed editorial hero at the top of the article when an illustration exists for the slug. Title sits on the image with gradient overlay; "Ilustração editorial" chip in the top-right corner labels the art honestly. When no illustration exists the page falls back to the plain title header. Sitemap fix: - Added export const dynamic = "force-dynamic" + revalidate = 3600 to app/sitemap.ts. Without these Next.js statically generated the sitemap at build time, when the DB and case-files volume were unreachable from the build container — which is why production was serving only the 9 static URLs instead of ~3000. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:16:20 +00:00
const heroArt = (await hasIllustration(slug)) ? `/api/static/processing/case-art/${slug}.png` : null;
W3.8: Investigation Bureau complete — Poirot, Taleb, Tetlock, Case-Writer Brings the bureau from 4 → 8 detectives. All eight run as Bun + claude-CLI subprocesses against the same Supabase + investigation_jobs LISTEN/NOTIFY queue, sharing search.ts hybridSearch and writer-side validators that gate writes against schema + FK. New detectives: Poirot (witness_analysis) - prompts/poirot.md — credibility / access / bias / corroboration / verdict; uses entity_mentions JOIN chunks to pull 12 chunks per person; resolves corroboration_refs chunk_ids defensively (accepts bare cNNNN even when the model emits pNNN/cNNNN). - INSERT into public.witnesses with W-NNNN naming. - Tone: purple (#9b5de5). Taleb (outlier_scan) - prompts/taleb.md — "surprise is relative to a model"; at most 3 outliers; each requires explicit dominant_model + why_surprising + what_it_implies; fan-out into public.gaps with scope.kind="outlier". - Same unscoped-fallback as Dupin (Pass 1 with doc_id, Pass 2 widens to corpus if hits < 3). - Tone: yellow (#ffd23f). Tetlock (calibrate_hypothesis) - prompts/tetlock.md — honest Bayesian update; emits new_posterior + Δ + recommended_action ∈ {keep, downgrade, upgrade, supersede}. - write_calibration UPDATEs public.hypotheses + APPENDS a "## Calibration history" section to the H-NNNN.md case file (calibration is append-only — each datapoint matters). Posterior band auto-corrected to match Tetlock thresholds. - NO_NEW_EVIDENCE sentinel handled; pure 'keep' with |Δ|<0.005 only touches updated_at + reviewed_by. - Tone: teal (#26d4cc). Case-Writer (case_report) - prompts/case-writer.md — Dr. Watson assembles all artefacts (E-NNNN, H-NNNN, R-NNNN, W-NNNN, G-NNNN) into a five-act narrative. ILIKE filter on topic; doc_id optional scope. - Larger budget cap (≥ $0.50) + longer timeout for prose generation. - Writes case/reports/<slug>.md with frontmatter (topic + counts); no DB table for v0. - New page /c/[slug] renders the report via MarkdownBody + stat chips. - Tone: gold (#e0c080). Hardening across the bureau: - Sentinel parsing now accepts backticked AND prose-trailing forms (Holmes NO_HYPOTHESES, Dupin NO_CONTRADICTIONS, Schneier INSUFFICIENT_HYPOTHESIS, Poirot INSUFFICIENT_TESTIMONY, Taleb NO_OUTLIERS, Tetlock NO_NEW_EVIDENCE, Case-Writer INSUFFICIENT_ARTEFACTS). Avoids the failure mode where the model refuses honestly but the runtime treated it as a parse error (observed live with Poirot+Hoover identifying the DIRECTOR false-positive disambiguation issue in entity_mentions). Chat tool extensions (web/lib/chat/tools.ts): - request_investigation now accepts 7 kinds. Each routes to its detective with appropriate validation (hypothesis_id regex, person_id kebab-case, topic non-empty, doc_id for evidence_chain). - ETA per kind: Holmes/Dupin 60s, Poirot 45s, Schneier/Tetlock 30s, Taleb 50s, Case-Writer 180s (longer prose), Locard 30×n_chunks. UI integration: - chat-bubble inline card paints each detective in its tone color. - /jobs/[id] page header swaps name/subtitle/tone per detective; question label adapts ("Topic" / "Hypothesis under attack" / "Witness under analysis" / "Topic to outlier-scan" / "Hypothesis under recalibration" / "Case to assemble"). - job-status-poller renders: case-report link card (gold), outlier cards (yellow), witness cards (purple) — alongside existing hypothesis, evidence, contradiction cards. - /api/jobs/[id] hydrates witnesses (JOIN entities for canonical_name) + gaps (with scope JSONB). - /c/[slug] page reads /data/ufo/case/reports/<slug>.md and renders with MarkdownBody, frontmatter parsed for stat chips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 01:11:39 +00:00
return (
<div className="min-h-screen bg-[#0a0e1a] text-[#e7ecf3]">
W4.1+W4.2: anti-AI-tics house style + bureau nav (back/home everywhere) Two complaints in one wave: (W4.1) User: "Não pode ter vícios de IA como uso excessivo de '-' que a IA coloca geralmente no lugar de vírgulas por exemplo. Isso deve fazer parte do prompt geral." - New prompts/_house-style.md banning the 9 most common AI prose tells in both EN and PT-BR: 1. Em dashes as comma replacements (—) 2. Rule-of-three lists ("concrete, rigorous, and grounded") 3. Conjunctive openers ("Moreover", "Notably", "Ademais") 4. Superficial -ing analyses ("marking a shift", "destacando") 5. Inflated symbolism + AI vocab (tapestry, navigate, delve, underscore, robust, multifaceted, marco histórico, ...) 6. Negative parallelisms ("Not just X but Y") 7. Vague attribution ("Some scholars say...") 8. Summary closers ("In summary...", "Em suma...") 9. Hedging fluff ("It's important to note...") Verbatim chunk quotes are explicitly exempt; preserve as-is. - claude.ts callClaude() lazily loads _house-style.md once per process and PREPENDS it to every detective's system prompt: composedSystem = houseStyle + "---" + detective.systemPrompt This means all 7 detectives + future ones get the rules without any per-prompt change. (W4.2) User: "Quando entra em uma página da investigação não tem como voltar! UX terrível!" - New <BureauNav> sticky topbar with explicit "← home" + "🔎 bureau" buttons + clickable breadcrumb trail. Always visible at the top of every bureau page so the user can escape in one click. - Wired into /bureau, /h/[hypothesisId], /c/[slug], /jobs/[id]. Each page passes its sensible parent crumb (/bureau#hypotheses, /bureau#reports, /bureau#jobs). - Replaces the previous plain-text "disclosure.top / hypothesis / H-0004" line which had no visual affordance. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 16:27:58 +00:00
<BureauNav crumbs={[
W5.4 (Phase 3B): sitemap + robots + Article schema + magazine reading view GEO/SEO surface area: app/robots.ts (new — Next.js dynamic robots) Explicitly ALLOWS major AI crawlers: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-Web, anthropic-ai, PerplexityBot, Perplexity-User, Google-Extended, Applebot-Extended, CCBot, DuckAssistBot, YouBot, Bytespider, Amazonbot. The site exists to be cited by LLMs answering UAP/UFO questions — we want them in. /api/admin/, /admin/, /auth/ disallowed for everyone. app/sitemap.ts (new — Next.js dynamic sitemap) Lists 9 top-level routes + every /d/<doc> + every /c/<slug> from the filesystem + up to 500 entity URLs per class (event, person, uap_object, location, organization), sorted with summary-enriched entities first. ~3000 URLs total at current corpus size. lastModified honours summary_generated_at so crawlers re-index when entities are re-enriched. app/c/[slug]/page.tsx (rewritten — magazine reading view) - generateMetadata: per-case title, description (auto-extracted from the locale-preferred lead paragraph), canonical URL, hreflang alternate, OpenGraph article type with publishedTime, Twitter card. - JSON-LD Article schema embedded at end of page: schema.org Article + Organization publisher + inLanguage + isAccessibleForFree. This is what makes the case appear as a citable source in Google AI Overviews / Perplexity / ChatGPT search. - Reading view rewritten: display-serif headline (Fraunces), italic blockquotes with gold accent, prose-typography styling, no more detective stats line, no more "written by case-writer@detective" attribution. Locale-aware: PT-BR pulls topic_pt_br + lead in PT, English mirror. tailwind.config.ts + @tailwindcss/typography plugin + font-display family wired to var(--font-display) (Fraunces) package.json + "@tailwindcss/typography" devDependency Phase 3A note: bulk entity enrichment hit Claude OAuth weekly quota mid-run. 6 events + 3 uap_objects landed bilingual summaries before the quota exhausted. UI gracefully splits enriched vs bare entities so /sightings shows the magazine-grade cards (Kenneth Arnold 1947, Roswell, Maury Island, Joseph Perry 1960 lunar photo, Civil Defense Director 1966, etc.) on top of a compact table of the rest. Re-run when quota refreshes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:09:50 +00:00
{ label: locale === "en" ? "case files" : "casos", href: "/bureau" },
{ label: title.length > 32 ? title.slice(0, 32) + "…" : title },
W4.1+W4.2: anti-AI-tics house style + bureau nav (back/home everywhere) Two complaints in one wave: (W4.1) User: "Não pode ter vícios de IA como uso excessivo de '-' que a IA coloca geralmente no lugar de vírgulas por exemplo. Isso deve fazer parte do prompt geral." - New prompts/_house-style.md banning the 9 most common AI prose tells in both EN and PT-BR: 1. Em dashes as comma replacements (—) 2. Rule-of-three lists ("concrete, rigorous, and grounded") 3. Conjunctive openers ("Moreover", "Notably", "Ademais") 4. Superficial -ing analyses ("marking a shift", "destacando") 5. Inflated symbolism + AI vocab (tapestry, navigate, delve, underscore, robust, multifaceted, marco histórico, ...) 6. Negative parallelisms ("Not just X but Y") 7. Vague attribution ("Some scholars say...") 8. Summary closers ("In summary...", "Em suma...") 9. Hedging fluff ("It's important to note...") Verbatim chunk quotes are explicitly exempt; preserve as-is. - claude.ts callClaude() lazily loads _house-style.md once per process and PREPENDS it to every detective's system prompt: composedSystem = houseStyle + "---" + detective.systemPrompt This means all 7 detectives + future ones get the rules without any per-prompt change. (W4.2) User: "Quando entra em uma página da investigação não tem como voltar! UX terrível!" - New <BureauNav> sticky topbar with explicit "← home" + "🔎 bureau" buttons + clickable breadcrumb trail. Always visible at the top of every bureau page so the user can escape in one click. - Wired into /bureau, /h/[hypothesisId], /c/[slug], /jobs/[id]. Each page passes its sensible parent crumb (/bureau#hypotheses, /bureau#reports, /bureau#jobs). - Replaces the previous plain-text "disclosure.top / hypothesis / H-0004" line which had no visual affordance. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 16:27:58 +00:00
]} />
W3.8: Investigation Bureau complete — Poirot, Taleb, Tetlock, Case-Writer Brings the bureau from 4 → 8 detectives. All eight run as Bun + claude-CLI subprocesses against the same Supabase + investigation_jobs LISTEN/NOTIFY queue, sharing search.ts hybridSearch and writer-side validators that gate writes against schema + FK. New detectives: Poirot (witness_analysis) - prompts/poirot.md — credibility / access / bias / corroboration / verdict; uses entity_mentions JOIN chunks to pull 12 chunks per person; resolves corroboration_refs chunk_ids defensively (accepts bare cNNNN even when the model emits pNNN/cNNNN). - INSERT into public.witnesses with W-NNNN naming. - Tone: purple (#9b5de5). Taleb (outlier_scan) - prompts/taleb.md — "surprise is relative to a model"; at most 3 outliers; each requires explicit dominant_model + why_surprising + what_it_implies; fan-out into public.gaps with scope.kind="outlier". - Same unscoped-fallback as Dupin (Pass 1 with doc_id, Pass 2 widens to corpus if hits < 3). - Tone: yellow (#ffd23f). Tetlock (calibrate_hypothesis) - prompts/tetlock.md — honest Bayesian update; emits new_posterior + Δ + recommended_action ∈ {keep, downgrade, upgrade, supersede}. - write_calibration UPDATEs public.hypotheses + APPENDS a "## Calibration history" section to the H-NNNN.md case file (calibration is append-only — each datapoint matters). Posterior band auto-corrected to match Tetlock thresholds. - NO_NEW_EVIDENCE sentinel handled; pure 'keep' with |Δ|<0.005 only touches updated_at + reviewed_by. - Tone: teal (#26d4cc). Case-Writer (case_report) - prompts/case-writer.md — Dr. Watson assembles all artefacts (E-NNNN, H-NNNN, R-NNNN, W-NNNN, G-NNNN) into a five-act narrative. ILIKE filter on topic; doc_id optional scope. - Larger budget cap (≥ $0.50) + longer timeout for prose generation. - Writes case/reports/<slug>.md with frontmatter (topic + counts); no DB table for v0. - New page /c/[slug] renders the report via MarkdownBody + stat chips. - Tone: gold (#e0c080). Hardening across the bureau: - Sentinel parsing now accepts backticked AND prose-trailing forms (Holmes NO_HYPOTHESES, Dupin NO_CONTRADICTIONS, Schneier INSUFFICIENT_HYPOTHESIS, Poirot INSUFFICIENT_TESTIMONY, Taleb NO_OUTLIERS, Tetlock NO_NEW_EVIDENCE, Case-Writer INSUFFICIENT_ARTEFACTS). Avoids the failure mode where the model refuses honestly but the runtime treated it as a parse error (observed live with Poirot+Hoover identifying the DIRECTOR false-positive disambiguation issue in entity_mentions). Chat tool extensions (web/lib/chat/tools.ts): - request_investigation now accepts 7 kinds. Each routes to its detective with appropriate validation (hypothesis_id regex, person_id kebab-case, topic non-empty, doc_id for evidence_chain). - ETA per kind: Holmes/Dupin 60s, Poirot 45s, Schneier/Tetlock 30s, Taleb 50s, Case-Writer 180s (longer prose), Locard 30×n_chunks. UI integration: - chat-bubble inline card paints each detective in its tone color. - /jobs/[id] page header swaps name/subtitle/tone per detective; question label adapts ("Topic" / "Hypothesis under attack" / "Witness under analysis" / "Topic to outlier-scan" / "Hypothesis under recalibration" / "Case to assemble"). - job-status-poller renders: case-report link card (gold), outlier cards (yellow), witness cards (purple) — alongside existing hypothesis, evidence, contradiction cards. - /api/jobs/[id] hydrates witnesses (JOIN entities for canonical_name) + gaps (with scope JSONB). - /c/[slug] page reads /data/ufo/case/reports/<slug>.md and renders with MarkdownBody, frontmatter parsed for stat chips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 01:11:39 +00:00
<AuthBar />
W5.4 followup: hero illustration on /c/[slug] + sitemap fix Hero illustration: - Painterly 16:9 editorial illustration generated via Nano Banana Pro for the featured case (green-fireballs-narrative): late-1940s desert night, vivid emerald fireball over silhouetted Sandia mesas, 1948-era state-police sedan parked on US 66 shoulder with an officer in period uniform looking up, faint green glow on his face. Sandia Base 5 Miles roadsign. New Yorker-cover painterly register, NOT photorealistic, NOT sci-fi. - Stored at /data/disclosure/processing/case-art/<slug>.png, served through the existing /api/static/processing/ route. 2.7MB at 2K. - components/featured-case.tsx: prefers the illustration over the declassified-page thumbnail when present. Tags it "Editorial illustration" / "Ilustração editorial" so the reader knows it's not a photograph. - app/c/[slug]/page.tsx: full-bleed editorial hero at the top of the article when an illustration exists for the slug. Title sits on the image with gradient overlay; "Ilustração editorial" chip in the top-right corner labels the art honestly. When no illustration exists the page falls back to the plain title header. Sitemap fix: - Added export const dynamic = "force-dynamic" + revalidate = 3600 to app/sitemap.ts. Without these Next.js statically generated the sitemap at build time, when the DB and case-files volume were unreachable from the build container — which is why production was serving only the 9 static URLs instead of ~3000. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:16:20 +00:00
{/* Full-bleed editorial hero only when a painterly illustration
exists for this case. Other cases get the plain title header. */}
{heroArt && (
<div className="relative w-full overflow-hidden border-b border-[rgba(224,192,128,0.15)]">
<div className="relative aspect-[16/9] md:aspect-[21/9] max-h-[640px]">
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
src={heroArt}
alt={title}
className="absolute inset-0 w-full h-full object-cover"
/>
<div className="absolute inset-0 bg-gradient-to-t from-[#0a0e1a] via-[#0a0e1a]/30 to-transparent" />
<div className="absolute inset-0 bg-gradient-to-r from-[#0a0e1a]/70 via-transparent to-transparent" />
<div className="absolute bottom-0 left-0 right-0 px-4 md:px-8 pb-8 md:pb-12">
<div className="mx-auto max-w-3xl">
<div className="text-[10px] font-mono uppercase tracking-[0.18em] text-[#e0c080] mb-3">
{locale === "en" ? "Declassified case file" : "Arquivo desclassificado"}
{dateLabel && <> · {dateLabel}</>}
</div>
<h1 className="font-display text-4xl md:text-6xl font-semibold leading-[1.05] tracking-tight text-white drop-shadow-lg">
{title}
</h1>
</div>
</div>
<div className="absolute top-3 right-3 text-[9px] font-mono uppercase tracking-wider text-[#9aa6b8]/80 bg-[#0a0e1a]/70 px-2 py-1 rounded">
{locale === "en" ? "Editorial illustration" : "Ilustração editorial"}
</div>
W3.8: Investigation Bureau complete — Poirot, Taleb, Tetlock, Case-Writer Brings the bureau from 4 → 8 detectives. All eight run as Bun + claude-CLI subprocesses against the same Supabase + investigation_jobs LISTEN/NOTIFY queue, sharing search.ts hybridSearch and writer-side validators that gate writes against schema + FK. New detectives: Poirot (witness_analysis) - prompts/poirot.md — credibility / access / bias / corroboration / verdict; uses entity_mentions JOIN chunks to pull 12 chunks per person; resolves corroboration_refs chunk_ids defensively (accepts bare cNNNN even when the model emits pNNN/cNNNN). - INSERT into public.witnesses with W-NNNN naming. - Tone: purple (#9b5de5). Taleb (outlier_scan) - prompts/taleb.md — "surprise is relative to a model"; at most 3 outliers; each requires explicit dominant_model + why_surprising + what_it_implies; fan-out into public.gaps with scope.kind="outlier". - Same unscoped-fallback as Dupin (Pass 1 with doc_id, Pass 2 widens to corpus if hits < 3). - Tone: yellow (#ffd23f). Tetlock (calibrate_hypothesis) - prompts/tetlock.md — honest Bayesian update; emits new_posterior + Δ + recommended_action ∈ {keep, downgrade, upgrade, supersede}. - write_calibration UPDATEs public.hypotheses + APPENDS a "## Calibration history" section to the H-NNNN.md case file (calibration is append-only — each datapoint matters). Posterior band auto-corrected to match Tetlock thresholds. - NO_NEW_EVIDENCE sentinel handled; pure 'keep' with |Δ|<0.005 only touches updated_at + reviewed_by. - Tone: teal (#26d4cc). Case-Writer (case_report) - prompts/case-writer.md — Dr. Watson assembles all artefacts (E-NNNN, H-NNNN, R-NNNN, W-NNNN, G-NNNN) into a five-act narrative. ILIKE filter on topic; doc_id optional scope. - Larger budget cap (≥ $0.50) + longer timeout for prose generation. - Writes case/reports/<slug>.md with frontmatter (topic + counts); no DB table for v0. - New page /c/[slug] renders the report via MarkdownBody + stat chips. - Tone: gold (#e0c080). Hardening across the bureau: - Sentinel parsing now accepts backticked AND prose-trailing forms (Holmes NO_HYPOTHESES, Dupin NO_CONTRADICTIONS, Schneier INSUFFICIENT_HYPOTHESIS, Poirot INSUFFICIENT_TESTIMONY, Taleb NO_OUTLIERS, Tetlock NO_NEW_EVIDENCE, Case-Writer INSUFFICIENT_ARTEFACTS). Avoids the failure mode where the model refuses honestly but the runtime treated it as a parse error (observed live with Poirot+Hoover identifying the DIRECTOR false-positive disambiguation issue in entity_mentions). Chat tool extensions (web/lib/chat/tools.ts): - request_investigation now accepts 7 kinds. Each routes to its detective with appropriate validation (hypothesis_id regex, person_id kebab-case, topic non-empty, doc_id for evidence_chain). - ETA per kind: Holmes/Dupin 60s, Poirot 45s, Schneier/Tetlock 30s, Taleb 50s, Case-Writer 180s (longer prose), Locard 30×n_chunks. UI integration: - chat-bubble inline card paints each detective in its tone color. - /jobs/[id] page header swaps name/subtitle/tone per detective; question label adapts ("Topic" / "Hypothesis under attack" / "Witness under analysis" / "Topic to outlier-scan" / "Hypothesis under recalibration" / "Case to assemble"). - job-status-poller renders: case-report link card (gold), outlier cards (yellow), witness cards (purple) — alongside existing hypothesis, evidence, contradiction cards. - /api/jobs/[id] hydrates witnesses (JOIN entities for canonical_name) + gaps (with scope JSONB). - /c/[slug] page reads /data/ufo/case/reports/<slug>.md and renders with MarkdownBody, frontmatter parsed for stat chips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 01:11:39 +00:00
</div>
W5.4 followup: hero illustration on /c/[slug] + sitemap fix Hero illustration: - Painterly 16:9 editorial illustration generated via Nano Banana Pro for the featured case (green-fireballs-narrative): late-1940s desert night, vivid emerald fireball over silhouetted Sandia mesas, 1948-era state-police sedan parked on US 66 shoulder with an officer in period uniform looking up, faint green glow on his face. Sandia Base 5 Miles roadsign. New Yorker-cover painterly register, NOT photorealistic, NOT sci-fi. - Stored at /data/disclosure/processing/case-art/<slug>.png, served through the existing /api/static/processing/ route. 2.7MB at 2K. - components/featured-case.tsx: prefers the illustration over the declassified-page thumbnail when present. Tags it "Editorial illustration" / "Ilustração editorial" so the reader knows it's not a photograph. - app/c/[slug]/page.tsx: full-bleed editorial hero at the top of the article when an illustration exists for the slug. Title sits on the image with gradient overlay; "Ilustração editorial" chip in the top-right corner labels the art honestly. When no illustration exists the page falls back to the plain title header. Sitemap fix: - Added export const dynamic = "force-dynamic" + revalidate = 3600 to app/sitemap.ts. Without these Next.js statically generated the sitemap at build time, when the DB and case-files volume were unreachable from the build container — which is why production was serving only the 9 static URLs instead of ~3000. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:16:20 +00:00
</div>
)}
<article className="mx-auto max-w-3xl px-4 py-10 md:py-14">
{!heroArt && (
<header className="mb-10 md:mb-14">
<div className="text-[10px] font-mono uppercase tracking-[0.18em] text-[#e0c080] mb-4">
{locale === "en" ? "Declassified case file" : "Arquivo desclassificado"}
{dateLabel && <> · {dateLabel}</>}
</div>
<h1 className="font-display text-4xl md:text-6xl font-semibold leading-[1.05] tracking-tight text-[#e7ecf3] mb-6">
{title}
</h1>
</header>
)}
{lead && (
<p className={`text-lg md:text-xl text-[#cbd2dd] leading-relaxed font-light max-w-2xl ${heroArt ? "mb-10" : "mb-10 md:mb-14"}`}>
{lead}
</p>
)}
W3.8: Investigation Bureau complete — Poirot, Taleb, Tetlock, Case-Writer Brings the bureau from 4 → 8 detectives. All eight run as Bun + claude-CLI subprocesses against the same Supabase + investigation_jobs LISTEN/NOTIFY queue, sharing search.ts hybridSearch and writer-side validators that gate writes against schema + FK. New detectives: Poirot (witness_analysis) - prompts/poirot.md — credibility / access / bias / corroboration / verdict; uses entity_mentions JOIN chunks to pull 12 chunks per person; resolves corroboration_refs chunk_ids defensively (accepts bare cNNNN even when the model emits pNNN/cNNNN). - INSERT into public.witnesses with W-NNNN naming. - Tone: purple (#9b5de5). Taleb (outlier_scan) - prompts/taleb.md — "surprise is relative to a model"; at most 3 outliers; each requires explicit dominant_model + why_surprising + what_it_implies; fan-out into public.gaps with scope.kind="outlier". - Same unscoped-fallback as Dupin (Pass 1 with doc_id, Pass 2 widens to corpus if hits < 3). - Tone: yellow (#ffd23f). Tetlock (calibrate_hypothesis) - prompts/tetlock.md — honest Bayesian update; emits new_posterior + Δ + recommended_action ∈ {keep, downgrade, upgrade, supersede}. - write_calibration UPDATEs public.hypotheses + APPENDS a "## Calibration history" section to the H-NNNN.md case file (calibration is append-only — each datapoint matters). Posterior band auto-corrected to match Tetlock thresholds. - NO_NEW_EVIDENCE sentinel handled; pure 'keep' with |Δ|<0.005 only touches updated_at + reviewed_by. - Tone: teal (#26d4cc). Case-Writer (case_report) - prompts/case-writer.md — Dr. Watson assembles all artefacts (E-NNNN, H-NNNN, R-NNNN, W-NNNN, G-NNNN) into a five-act narrative. ILIKE filter on topic; doc_id optional scope. - Larger budget cap (≥ $0.50) + longer timeout for prose generation. - Writes case/reports/<slug>.md with frontmatter (topic + counts); no DB table for v0. - New page /c/[slug] renders the report via MarkdownBody + stat chips. - Tone: gold (#e0c080). Hardening across the bureau: - Sentinel parsing now accepts backticked AND prose-trailing forms (Holmes NO_HYPOTHESES, Dupin NO_CONTRADICTIONS, Schneier INSUFFICIENT_HYPOTHESIS, Poirot INSUFFICIENT_TESTIMONY, Taleb NO_OUTLIERS, Tetlock NO_NEW_EVIDENCE, Case-Writer INSUFFICIENT_ARTEFACTS). Avoids the failure mode where the model refuses honestly but the runtime treated it as a parse error (observed live with Poirot+Hoover identifying the DIRECTOR false-positive disambiguation issue in entity_mentions). Chat tool extensions (web/lib/chat/tools.ts): - request_investigation now accepts 7 kinds. Each routes to its detective with appropriate validation (hypothesis_id regex, person_id kebab-case, topic non-empty, doc_id for evidence_chain). - ETA per kind: Holmes/Dupin 60s, Poirot 45s, Schneier/Tetlock 30s, Taleb 50s, Case-Writer 180s (longer prose), Locard 30×n_chunks. UI integration: - chat-bubble inline card paints each detective in its tone color. - /jobs/[id] page header swaps name/subtitle/tone per detective; question label adapts ("Topic" / "Hypothesis under attack" / "Witness under analysis" / "Topic to outlier-scan" / "Hypothesis under recalibration" / "Case to assemble"). - job-status-poller renders: case-report link card (gold), outlier cards (yellow), witness cards (purple) — alongside existing hypothesis, evidence, contradiction cards. - /api/jobs/[id] hydrates witnesses (JOIN entities for canonical_name) + gaps (with scope JSONB). - /c/[slug] page reads /data/ufo/case/reports/<slug>.md and renders with MarkdownBody, frontmatter parsed for stat chips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 01:11:39 +00:00
W5.4 (Phase 3B): sitemap + robots + Article schema + magazine reading view GEO/SEO surface area: app/robots.ts (new — Next.js dynamic robots) Explicitly ALLOWS major AI crawlers: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-Web, anthropic-ai, PerplexityBot, Perplexity-User, Google-Extended, Applebot-Extended, CCBot, DuckAssistBot, YouBot, Bytespider, Amazonbot. The site exists to be cited by LLMs answering UAP/UFO questions — we want them in. /api/admin/, /admin/, /auth/ disallowed for everyone. app/sitemap.ts (new — Next.js dynamic sitemap) Lists 9 top-level routes + every /d/<doc> + every /c/<slug> from the filesystem + up to 500 entity URLs per class (event, person, uap_object, location, organization), sorted with summary-enriched entities first. ~3000 URLs total at current corpus size. lastModified honours summary_generated_at so crawlers re-index when entities are re-enriched. app/c/[slug]/page.tsx (rewritten — magazine reading view) - generateMetadata: per-case title, description (auto-extracted from the locale-preferred lead paragraph), canonical URL, hreflang alternate, OpenGraph article type with publishedTime, Twitter card. - JSON-LD Article schema embedded at end of page: schema.org Article + Organization publisher + inLanguage + isAccessibleForFree. This is what makes the case appear as a citable source in Google AI Overviews / Perplexity / ChatGPT search. - Reading view rewritten: display-serif headline (Fraunces), italic blockquotes with gold accent, prose-typography styling, no more detective stats line, no more "written by case-writer@detective" attribution. Locale-aware: PT-BR pulls topic_pt_br + lead in PT, English mirror. tailwind.config.ts + @tailwindcss/typography plugin + font-display family wired to var(--font-display) (Fraunces) package.json + "@tailwindcss/typography" devDependency Phase 3A note: bulk entity enrichment hit Claude OAuth weekly quota mid-run. 6 events + 3 uap_objects landed bilingual summaries before the quota exhausted. UI gracefully splits enriched vs bare entities so /sightings shows the magazine-grade cards (Kenneth Arnold 1947, Roswell, Maury Island, Joseph Perry 1960 lunar photo, Civil Defense Director 1966, etc.) on top of a compact table of the rest. Re-run when quota refreshes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:09:50 +00:00
<div className="prose prose-invert prose-lg max-w-none
prose-headings:font-display prose-headings:font-semibold
prose-h2:text-2xl prose-h2:md:text-3xl prose-h2:mt-12 prose-h2:mb-4
prose-h2:border-b prose-h2:border-[rgba(224,192,128,0.15)] prose-h2:pb-3
prose-p:text-[16px] prose-p:leading-relaxed prose-p:text-[#cbd2dd]
prose-blockquote:border-l-[#e0c080] prose-blockquote:bg-[rgba(224,192,128,0.05)]
prose-blockquote:not-italic prose-blockquote:font-display prose-blockquote:text-[#e7ecf3]
prose-blockquote:py-2 prose-blockquote:px-4 prose-blockquote:rounded-r
prose-a:text-[#7fdbff] prose-a:no-underline hover:prose-a:underline
prose-strong:text-[#e7ecf3]">
W3.8: Investigation Bureau complete — Poirot, Taleb, Tetlock, Case-Writer Brings the bureau from 4 → 8 detectives. All eight run as Bun + claude-CLI subprocesses against the same Supabase + investigation_jobs LISTEN/NOTIFY queue, sharing search.ts hybridSearch and writer-side validators that gate writes against schema + FK. New detectives: Poirot (witness_analysis) - prompts/poirot.md — credibility / access / bias / corroboration / verdict; uses entity_mentions JOIN chunks to pull 12 chunks per person; resolves corroboration_refs chunk_ids defensively (accepts bare cNNNN even when the model emits pNNN/cNNNN). - INSERT into public.witnesses with W-NNNN naming. - Tone: purple (#9b5de5). Taleb (outlier_scan) - prompts/taleb.md — "surprise is relative to a model"; at most 3 outliers; each requires explicit dominant_model + why_surprising + what_it_implies; fan-out into public.gaps with scope.kind="outlier". - Same unscoped-fallback as Dupin (Pass 1 with doc_id, Pass 2 widens to corpus if hits < 3). - Tone: yellow (#ffd23f). Tetlock (calibrate_hypothesis) - prompts/tetlock.md — honest Bayesian update; emits new_posterior + Δ + recommended_action ∈ {keep, downgrade, upgrade, supersede}. - write_calibration UPDATEs public.hypotheses + APPENDS a "## Calibration history" section to the H-NNNN.md case file (calibration is append-only — each datapoint matters). Posterior band auto-corrected to match Tetlock thresholds. - NO_NEW_EVIDENCE sentinel handled; pure 'keep' with |Δ|<0.005 only touches updated_at + reviewed_by. - Tone: teal (#26d4cc). Case-Writer (case_report) - prompts/case-writer.md — Dr. Watson assembles all artefacts (E-NNNN, H-NNNN, R-NNNN, W-NNNN, G-NNNN) into a five-act narrative. ILIKE filter on topic; doc_id optional scope. - Larger budget cap (≥ $0.50) + longer timeout for prose generation. - Writes case/reports/<slug>.md with frontmatter (topic + counts); no DB table for v0. - New page /c/[slug] renders the report via MarkdownBody + stat chips. - Tone: gold (#e0c080). Hardening across the bureau: - Sentinel parsing now accepts backticked AND prose-trailing forms (Holmes NO_HYPOTHESES, Dupin NO_CONTRADICTIONS, Schneier INSUFFICIENT_HYPOTHESIS, Poirot INSUFFICIENT_TESTIMONY, Taleb NO_OUTLIERS, Tetlock NO_NEW_EVIDENCE, Case-Writer INSUFFICIENT_ARTEFACTS). Avoids the failure mode where the model refuses honestly but the runtime treated it as a parse error (observed live with Poirot+Hoover identifying the DIRECTOR false-positive disambiguation issue in entity_mentions). Chat tool extensions (web/lib/chat/tools.ts): - request_investigation now accepts 7 kinds. Each routes to its detective with appropriate validation (hypothesis_id regex, person_id kebab-case, topic non-empty, doc_id for evidence_chain). - ETA per kind: Holmes/Dupin 60s, Poirot 45s, Schneier/Tetlock 30s, Taleb 50s, Case-Writer 180s (longer prose), Locard 30×n_chunks. UI integration: - chat-bubble inline card paints each detective in its tone color. - /jobs/[id] page header swaps name/subtitle/tone per detective; question label adapts ("Topic" / "Hypothesis under attack" / "Witness under analysis" / "Topic to outlier-scan" / "Hypothesis under recalibration" / "Case to assemble"). - job-status-poller renders: case-report link card (gold), outlier cards (yellow), witness cards (purple) — alongside existing hypothesis, evidence, contradiction cards. - /api/jobs/[id] hydrates witnesses (JOIN entities for canonical_name) + gaps (with scope JSONB). - /c/[slug] page reads /data/ufo/case/reports/<slug>.md and renders with MarkdownBody, frontmatter parsed for stat chips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 01:11:39 +00:00
<MarkdownBody>{body}</MarkdownBody>
W5.4 (Phase 3B): sitemap + robots + Article schema + magazine reading view GEO/SEO surface area: app/robots.ts (new — Next.js dynamic robots) Explicitly ALLOWS major AI crawlers: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-Web, anthropic-ai, PerplexityBot, Perplexity-User, Google-Extended, Applebot-Extended, CCBot, DuckAssistBot, YouBot, Bytespider, Amazonbot. The site exists to be cited by LLMs answering UAP/UFO questions — we want them in. /api/admin/, /admin/, /auth/ disallowed for everyone. app/sitemap.ts (new — Next.js dynamic sitemap) Lists 9 top-level routes + every /d/<doc> + every /c/<slug> from the filesystem + up to 500 entity URLs per class (event, person, uap_object, location, organization), sorted with summary-enriched entities first. ~3000 URLs total at current corpus size. lastModified honours summary_generated_at so crawlers re-index when entities are re-enriched. app/c/[slug]/page.tsx (rewritten — magazine reading view) - generateMetadata: per-case title, description (auto-extracted from the locale-preferred lead paragraph), canonical URL, hreflang alternate, OpenGraph article type with publishedTime, Twitter card. - JSON-LD Article schema embedded at end of page: schema.org Article + Organization publisher + inLanguage + isAccessibleForFree. This is what makes the case appear as a citable source in Google AI Overviews / Perplexity / ChatGPT search. - Reading view rewritten: display-serif headline (Fraunces), italic blockquotes with gold accent, prose-typography styling, no more detective stats line, no more "written by case-writer@detective" attribution. Locale-aware: PT-BR pulls topic_pt_br + lead in PT, English mirror. tailwind.config.ts + @tailwindcss/typography plugin + font-display family wired to var(--font-display) (Fraunces) package.json + "@tailwindcss/typography" devDependency Phase 3A note: bulk entity enrichment hit Claude OAuth weekly quota mid-run. 6 events + 3 uap_objects landed bilingual summaries before the quota exhausted. UI gracefully splits enriched vs bare entities so /sightings shows the magazine-grade cards (Kenneth Arnold 1947, Roswell, Maury Island, Joseph Perry 1960 lunar photo, Civil Defense Director 1966, etc.) on top of a compact table of the rest. Re-run when quota refreshes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 19:09:50 +00:00
</div>
</article>
{/* JSON-LD Article helps Google + AI crawlers parse the case as
a citation-bearing piece of journalism */}
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify({
"@context": "https://schema.org",
"@type": "Article",
headline: title,
description: lead,
url: canonical,
datePublished: fm.created_at,
inLanguage: locale === "pt-br" ? "pt-BR" : "en-US",
isAccessibleForFree: true,
publisher: {
"@type": "Organization",
name: "The Disclosure Bureau",
url: SITE_URL,
},
about: { "@type": "Thing", name: "UAP/UFO declassified record" },
}) }}
/>
W3.8: Investigation Bureau complete — Poirot, Taleb, Tetlock, Case-Writer Brings the bureau from 4 → 8 detectives. All eight run as Bun + claude-CLI subprocesses against the same Supabase + investigation_jobs LISTEN/NOTIFY queue, sharing search.ts hybridSearch and writer-side validators that gate writes against schema + FK. New detectives: Poirot (witness_analysis) - prompts/poirot.md — credibility / access / bias / corroboration / verdict; uses entity_mentions JOIN chunks to pull 12 chunks per person; resolves corroboration_refs chunk_ids defensively (accepts bare cNNNN even when the model emits pNNN/cNNNN). - INSERT into public.witnesses with W-NNNN naming. - Tone: purple (#9b5de5). Taleb (outlier_scan) - prompts/taleb.md — "surprise is relative to a model"; at most 3 outliers; each requires explicit dominant_model + why_surprising + what_it_implies; fan-out into public.gaps with scope.kind="outlier". - Same unscoped-fallback as Dupin (Pass 1 with doc_id, Pass 2 widens to corpus if hits < 3). - Tone: yellow (#ffd23f). Tetlock (calibrate_hypothesis) - prompts/tetlock.md — honest Bayesian update; emits new_posterior + Δ + recommended_action ∈ {keep, downgrade, upgrade, supersede}. - write_calibration UPDATEs public.hypotheses + APPENDS a "## Calibration history" section to the H-NNNN.md case file (calibration is append-only — each datapoint matters). Posterior band auto-corrected to match Tetlock thresholds. - NO_NEW_EVIDENCE sentinel handled; pure 'keep' with |Δ|<0.005 only touches updated_at + reviewed_by. - Tone: teal (#26d4cc). Case-Writer (case_report) - prompts/case-writer.md — Dr. Watson assembles all artefacts (E-NNNN, H-NNNN, R-NNNN, W-NNNN, G-NNNN) into a five-act narrative. ILIKE filter on topic; doc_id optional scope. - Larger budget cap (≥ $0.50) + longer timeout for prose generation. - Writes case/reports/<slug>.md with frontmatter (topic + counts); no DB table for v0. - New page /c/[slug] renders the report via MarkdownBody + stat chips. - Tone: gold (#e0c080). Hardening across the bureau: - Sentinel parsing now accepts backticked AND prose-trailing forms (Holmes NO_HYPOTHESES, Dupin NO_CONTRADICTIONS, Schneier INSUFFICIENT_HYPOTHESIS, Poirot INSUFFICIENT_TESTIMONY, Taleb NO_OUTLIERS, Tetlock NO_NEW_EVIDENCE, Case-Writer INSUFFICIENT_ARTEFACTS). Avoids the failure mode where the model refuses honestly but the runtime treated it as a parse error (observed live with Poirot+Hoover identifying the DIRECTOR false-positive disambiguation issue in entity_mentions). Chat tool extensions (web/lib/chat/tools.ts): - request_investigation now accepts 7 kinds. Each routes to its detective with appropriate validation (hypothesis_id regex, person_id kebab-case, topic non-empty, doc_id for evidence_chain). - ETA per kind: Holmes/Dupin 60s, Poirot 45s, Schneier/Tetlock 30s, Taleb 50s, Case-Writer 180s (longer prose), Locard 30×n_chunks. UI integration: - chat-bubble inline card paints each detective in its tone color. - /jobs/[id] page header swaps name/subtitle/tone per detective; question label adapts ("Topic" / "Hypothesis under attack" / "Witness under analysis" / "Topic to outlier-scan" / "Hypothesis under recalibration" / "Case to assemble"). - job-status-poller renders: case-report link card (gold), outlier cards (yellow), witness cards (purple) — alongside existing hypothesis, evidence, contradiction cards. - /api/jobs/[id] hydrates witnesses (JOIN entities for canonical_name) + gaps (with scope JSONB). - /c/[slug] page reads /data/ufo/case/reports/<slug>.md and renders with MarkdownBody, frontmatter parsed for stat chips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 01:11:39 +00:00
</div>
);
}