ID9 — Unified Gallery Panel Plan — AI Summary

**Date**: 2026-08-30 | **Source**: a789 (full report, 27 KB)

**Thread**: vibecoder-standalone-mavis (9) | **Operator directive**: r204 continuation, updated

---

TL;DR (5 bullets)

What this means for the operator

The Gallery is the **operator's single switchboard** between "what's on disk" (MAIN), "what I'm editing" (WORKING), "what I saved" (DRAFT), "what's about to ship" (PREVIEW), and "what's live in production" (ORIGIN). The current ID10 work (Preview Engine, 5 *rendering* modes) covers the operator-mode CSS behaviour (shadow / execution / template / device / breakpoint) but NOT the content-state lifecycle this plan adds. The two are orthogonal and can ship independently.

The plan is **3-4 days, 22-28h** of focused work, additive-only. No pact edits required for v1 (the new surface-state enumeration is recommended but optional). All FreshCards primitives are reused. The 5-line PM2 contract is the same pattern as ID9-Inspector (a788).

What's at risk

1. **Security**: `PreviewHostOrigin` fetches a remote URL and DOM-injects it. Even with server-side sanitization, this is a non-trivial attack surface. Bridge needs an `ALLOWED_ORIGINS` allowlist (or strict CSP) before v1 ships.

2. **Pact gap**: the 5 surface states have no constitutional home. The plan includes a recommended 1h pact add but treats it as optional. If the operator wants to ship the panel without the pact, drift-checks may flag it later.

3. **Edge Panel coupling**: the capability manifest binds the Gallery to the Edge Panel's contextual-tile system. If Edge changes, Gallery needs to re-emit capabilities. Mitigated by treating the manifest as a contract test (refresh on each Edge release).

Open questions (operator decides)

What doesn't change

Discuss-with-team topics

1. **The MAIN / WORKING / DRAFT / PREVIEW / ORIGIN state machine** — does the team agree with the state machine (§9)? In particular: should "DRAFT → WORKING" be allowed (user clicks Discard)? Should "ORIGIN → MAIN" be auto-fired on deploy, or operator-initiated?

2. **Origin security** — should `PreviewHostOrigin` require an explicit operator allowlist per URL, or rely on the bridge's `ALLOWED_ORIGINS` env var? The former is safer; the latter is faster.

3. **Preview Strip ordering** — the plan places the 3 category chips (VSIL / Origin / App) before the 5 surface state chips (MAIN / WORKING / DRAFT / PREVIEW / ORIGIN). Is the right grouping, or should it be alphabetical? Or by recency?

---

**Word count**: ~470. **Source report**: a789 (full, 27 KB). **Cross-references**: a786 (FreshCards), a787 (VPS), a788 (Inspector), ID10 Preview Engine.