# Spectra

- **Event:** [Meta Global AI Developer Hackathon](https://cerebralvalley.ai/e/meta-ai-developer-hackathon)
- **When:** Oct 26, 12:00 PM – Nov 4, 9:00 PM (EST)
- **Where:** Online
- **Team:** [Bhavik Joshi](https://cerebralvalley.ai/u/Bhavikk)
- **GitHub:** https://github.com/Bhav-ikkk/spectra.git
- **Demo video:** https://youtu.be/EzLCtu6Q2kc?si=dW64LMwWR-ZQ3hGa
- **Gallery:** https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery
- **Page:** https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/1976

Spectra ("Don't trust 'done.' Measure it.") is an open-source, dual-instrument optical visual referee for AI coding agents, featuring a Swiss-industrial Field Monitor Workbench (https://spectra-lyart.vercel.app), a 5-command CLI, and a 4-tool stdio MCP server for Muse Code, Claude Code, and Cursor.

THE PROBLEM:
When AI coding agents build or modify frontend UI, they rely on Playwright DOM hit-tests (`document.elementFromPoint`) or single-shot VLM screenshot checks to verify their work. Both systematically lie on partial occlusions: if a sticky cart drawer slices off the bottom 10% of a "Complete Checkout" button, its center pixel `(1080, 625)` remains uncovered so the DOM hit-test returns a false PASS—and raw VLMs hallucinate "fully visible" up to 61.1% of the time.

HOW SPECTRA SOLVES IT:
Instead of trusting the DOM or a single uncalibrated model guess, Spectra captures an 8-frame settling video (`8f @ 4FPS, 1280×720`) and measures actual pixel visibility using two independent instruments calibrated to a measured 3-sigma noise floor (`3σ = 1.35%`, `σ = 0.45%`):
1. Instrument A (Meta SAM 3.1 Optical Segmentation): Uses `sam-3.1` + `@meta-sam/parser` for Zero-BBox Frame-0 target discovery and tracks the visible pixel mask ratio `R_SAM = min(1, Area(t_k) / Area(t_0))`.
2. Instrument B (Deterministic Pixel Matcher): Computes Euclidean RGB tolerance (`tol=5.0`) + zero-mean Normalized Cross-Correlation (`rNcc`) against the baseline template.
3. Fail-Closed Referee & Autonomous Repair: Both instruments must agree within a calibrated delta bound (`δ = 4.10%`). When pixel loss exceeds `3σ` (`1.35%`), Spectra rejects the build, feeds exact pixel-loss coordinates to `meta-models/muse-spark-open-1026` on Baseten to synthesize a minimal CSS repair patch, re-renders Pass #2, and optically verifies `0.00%` visibility loss.

EMPIRICAL BENCHMARK RESULTS (21 Canonical v1 Clips + 45-Clip Sweep):
- Playwright DOM Center Hit-Test: 94.4% False-Pass Rate (1/18 occlusions caught)
- Muse Spark 1.3 (Single-Shot VLM Judge): 61.1% False-Pass Rate (7/18 caught)
- Muse Spark Open 1026 (Open-Weight VLM Judge): 44.4% False-Pass Rate (10/18 caught)
- Spectra Dual-Instrument Referee: 0.0% False-Pass Rate (18/18 caught, 1.11% Mean Absolute Error, ~480ms cached replay)

## More from Meta Global AI Developer Hackathon

- [Md sabbir sikder](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/1973)
- [continuum](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/1974)
- [ProofPatcher](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/1975)
- [Epicenter](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/1977)
- [E-Sheba AI](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/1978)
- [SRIJALABS](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/1979)

---

Markdown version of https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/1976. Site index for agents: https://cerebralvalley.ai/llms.txt · full text: https://cerebralvalley.ai/llms-full.txt
