re-voice/site/red-team-shadow-dossiers/README.md

64 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# InfraFabric Red Team — Shadow Dossiers (Front-End)
A minimalist React + Vite publication hub for InfraFabrics “Shadow Dossiers” drops:
- serious, paper/ink layout
- staged/publication statuses (draft/scheduled/live)
- verifiability hooks (evidence index + optional SHA-256 + size)
- **no client-side model keys** (roast generator is feature-flagged and calls a server endpoint)
## Local dev
Prereqs: Node.js 18+
```bash
npm install
npm run dev
```
Open: http://localhost:3000
## Production (self-host)
```bash
npm install
npm run build
PORT=8080 npm run start
```
## Environment variables
Create `.env.local` from `.env.example`:
- `VITE_PUBLIC_BASE_URL`
Optional. When set (e.g. `https://infrafabric.io`) it will prefix dossier `pdfPath`/`evidencePath`.
- `VITE_ENABLE_ROAST`
Defaults to `false`. When `true`, renders the Roast Generator UI which calls `POST /api/roast`.
## Staging behavior (important)
This bundle is **pre-launch**. Dossier buttons are gated by `dossier.status`:
- `draft` / `scheduled`: download + evidence links remain disabled, and the UI shows “staged.”
- `live`: links activate (and optional SHA-256/bytes render if populated).
Update dossier status and paths in `constants.tsx`.
## Codex/server implementation checklist
See `CODEX_IMPLEMENTATION.md` for the complete checklist and stubs.
Quick summary:
1. Publish PDFs and evidence pages at:
- `/static/hosted/<dossier>.pdf`
- `/static/hosted/evidence/index.html`
2. Set `VITE_PUBLIC_BASE_URL` in the deployment environment if needed.
3. (Optional) Implement `POST /api/roast` server-side and set `VITE_ENABLE_ROAST=true`.
## Hash helper
Compute SHA-256 + bytes for a PDF and paste into the dossier entry:
```bash
node scripts/hash.mjs /path/to/file.pdf
```