Ghost Visualizer is a React/Vite visual essay about a narrow but important evaluation problem: two guardrails can each score 90% on harmful examples while their composed OR safety is only bounded, not determined, unless dependence is inspected.
The current demo exists to visualize bounded claims under stated assumptions. It is not an AI safety certificate and does not claim deployment readiness.
- Plays a seven-scene cinematic story, “Why AI Safety Scores Lie.”
- Shows how identical marginal guardrail scores can hide shared misses.
- Computes harmful-class atom counts, marginals, OR composition, Frechet-Hoeffding bounds, endpoint witnesses, and a receipt object from deterministic sample rows.
- Provides Evidence Mode for inspecting the computed receipt and downloading JSON.
npm install
npm run devOpen the local Vite URL shown in the terminal. Story Mode is the default route:
/The repo now includes a real Remotion entry point at src/Root.tsx with two renderable compositions:
ShatteringPointEstimateScene- VIS-001 at 1920x1080, 30fps, 62 seconds.ComponentShowcase- Remotion-safe component inventory at 1920x1080, 30fps, 12 seconds.
Open Remotion Studio:
npm run studioRender the VIS-001 video:
npm run render:vis001Render the default VIS-001 still:
npm run still:vis001Render the component showcase still:
npm run still:showcaseThese still commands target the five review frames from the storyboard:
npx remotion still src/Root.tsx ShatteringPointEstimateScene renders/stills/01_false_certainty.png --frame=135
npx remotion still src/Root.tsx ShatteringPointEstimateScene renders/stills/02_hidden_assumption.png --frame=495
npx remotion still src/Root.tsx ShatteringPointEstimateScene renders/stills/03_world_split.png --frame=870
npx remotion still src/Root.tsx ShatteringPointEstimateScene renders/stills/04_interval_boundary.png --frame=1260
npx remotion still src/Root.tsx ShatteringPointEstimateScene renders/stills/05_receipt_snap.png --frame=1680The Remotion render path is frame-driven through useCurrentFrame(), useVideoConfig(), interpolate(), and cue helpers in src/remotion/timeline.ts. VIS-001 render-critical files do not import motion/react, use runtime timers, or rely on CSS keyframes.
Open:
/?mode=evidenceEvidence Mode shows the dataset summary, block atom table, marginal scores, observed OR safety/risk, Frechet-Hoeffding interval, endpoint witnesses, assumptions, non-claims, and a receipt JSON download.
The static generated receipt is also available at:
public/evidence/sample-receipt.jsonTo regenerate it:
npm run generate:evidenceOpen:
/?recording=trueKeyboard controls in Story Mode:
- Right arrow or space: next scene
- Left arrow: previous scene
R: recording modeP: pauseE: Evidence Mode
The overlap slider scene also supports shareable state:
/?overlap=0
/?overlap=10The Vite Story Mode, Evidence Mode, keyboard transport, recording chrome, and interactive overlap slider remain browser-preview-only. They are still useful for exploration, but deterministic exports should use the Remotion compositions.
npm run test
npm run build
npm run generate:evidencesrc/evidence/sampleEvaluations.tsdefines 100 deterministic harmful evaluation rows.src/math/guardrailComposition.tscomputes block atoms, marginals, OR composition, bounds, endpoint witnesses, and the receipt.src/math/guardrailComposition.test.tsproves the core invariants.src/evidence/sampleReceipt.tsbuilds the receipt from rows.public/evidence/sample-receipt.jsonis generated from the same receipt object.- Story and Evidence Mode read from the computed model where practical.
- The sample rows are constructed for demonstration.
- Only harmful examples are populated.
- The model has two binary guardrails and one OR rule.
- Prompt families are illustrative.
- The cinematic scenes are explanatory renderings of the computed v0 model, not a real deployment evaluation.
- No sampling uncertainty model.
- No benign-class false-positive analysis yet.
- No dataset upload or external artifact ingestion.
- No cryptographic provenance.
- No claim that the model, policy, or guardrails are safe.
- The Remotion VIS-001 scene is the deterministic production render path; the older Vite scene stack remains an interactive preview surface.
- Add benign rows and classwise false-positive analysis.
- Add CSV import with strict schema validation.
- Add confidence intervals or finite-sample uncertainty where appropriate.
- Add more composition rules after OR is fully documented.
- Add real artifact manifests only when real artifacts exist.
See docs/research/two-guardrail-or-toy-model.md for the formal v0 research note.