Review Gallery, phases 2 and 3: does an “In the app” entry carry a door or a recipe, and where do the web specimens live?

Two owner choices. (i) Phase 2: an entry the gallery cannot fake honestly points at the real app — should it drive the app into the state (a baton: open the window, seed a fixture, land on the surface) or hand the reviewer a recipe to follow? (ii) Phase 3: the web states — do they ship as real React components inside the release bundle, as a page that exists only under serve --dev, or not at all in a release build? Both are judged on the same four consequences: the DEBUG-only gate, what check-release-binary.sh can and cannot see, maintenance per entry, and how a stale entry is caught.

Artefact: the gallery as it would lookCommentary: cost, gate, rot

Already built — Phase 2 is half there

  • ReviewGallerySpecimen.navigation(recipe:, open:) exists: every “In the app” entry carries recipe text and an optional door. 22 recipe entries; 3 have a door, all SettingsWindow.shared.show(pane:) (M04, M05, M10).
  • The canvas draws “Seen in the real app, not faked here.”, the recipe, and an Open It button when a door exists (ReviewGalleryCanvas).
  • Fixture seams already exist for a baton: DiagnosticFixture.load(name:) (the Diagnostics ▸ Diagnostic fixtures menu applies one to the selected project), PipelineRunner._debugSetState, ServeManager.debugMarkStartedByRetry, WhisperDownloadModel.debugApply.
  • Two gates: ReviewGalleryRegistryTests builds and draws every state at a real size; tests/test_review_gallery_registry.py resolves every commit hash in git (skips in a shallow clone, so CI never runs that one). “Mark Reviewed” is keyed to the commit list, so a grown list un-reviews.

Already built — Phase 3 is split in two places

  • Hand-written web specimens in a WKWebView inside the Mac gallery (ErrorPatternWebPreview.swift): HTML strings that describe RouteError.tsx and PanelErrorBoundary.tsx, not the components. A markup test checks their buttons. GA-2 (“hand-written versus the real view”) is held for this decision.
  • Two real specimen routes in the SPA, /report/specimen and /report/picker-specimen: always registered, lazy chunks of 7.5 KB and 2.5 KB, nav link only under IS_DEV, a door from the Diagnostics menu (openSpecimen). They ship in every release bundle (present in the signed sidecar’s static/assets).
  • The /report/dev/review page with a fault bar (§3 of the Phase 1 mockup) is not built; nothing in app.py or routes/dev.py mounts it.
  • check-release-binary.sh greps the Mach-O for "Review Gallery", BRISTLENOSE_DEBUG_ and two more literals. Nothing scans the sidecar’s static JS; a web fault injector in a release bundle would pass every gate.

1 · Choice (i): the “In the app” entry — recipe, door, or baton

The same entry, M08 “Stopped/failed study offers Analyse”, drawn three ways. Its recipe today: Select project-ikea ▸ Diagnostics ▸ Diagnostic fixtures ▸ selected project ▸ stopped (then run_failed_abandoned); check context menu, Project menu, toolbar. Everything above the canvas is the shipped gallery; only the group box changes.

Review GalleryA · recipe

Stopped/failed study offers Analyse

A study whose run stopped or failed offers Analyse (resume) as well as Re-analyse….
8c06f7f3landed 2026-10-20
Mark Reviewed
Seen in the real app, not faked here.

Select project-ikea ▸ Diagnostics ▸ Diagnostic fixtures ▸ selected project ▸ stopped (then run_failed_abandoned); check context menu, Project menu, toolbar.

⌥⌘↓ next · ⌥⌘↑ previous · ⌘↩ mark reviewed
A · Recipe only (today for 19 of 22)
Build
S · nothing
Per entry
~2 min to write; 1–3 min to follow, each time
Gate
#if DEBUG around the whole registry; no literal reaches Release
Stale caught by
a human noticing the menu path moved; nothing mechanical
Rules out
nothing
Review GalleryB · recipe + door + seed

Stopped/failed study offers Analyse

A study whose run stopped or failed offers Analyse (resume) as well as Re-analyse….
8c06f7f3landed 2026-10-20seed · stopped
Mark Reviewed
Seen in the real app, not faked here.

Check the context menu, the Project menu and the toolbar: Analyse and Re-analyse… are both offered.

Seeds the selected study with stopped, then run_failed_abandoned. Open It Undo Seed
Seeded project-ikea · stopped⌥⌘↓ next · ⌘↩ mark reviewed
B · Door where the app has one, with a named seed
Build
M · one optional seed: DiagnosticFixture.Name? on the navigation case; open applies it through the existing menu path then activates the surface; Undo Seed is the existing rescan
Per entry
~5 min: recipe shrinks to what to look at; door is a closure the compiler checks
Gate
unchanged: the seams it calls are already #if DEBUG or _debug-prefixed
Stale caught by
compile (a renamed pane or scene), summaryScenarioNames.contains(seed) in the registry test, and the recipe reads better because it says what to see, not how to get there
Rules out
nothing; C can be added entry by entry
Review GalleryC · baton

Stopped/failed study offers Analyse

A study whose run stopped or failed offers Analyse (resume) as well as Re-analyse….
8c06f7f3fixture study
Mark Reviewed
Opens a fixture study in a new window, in this state.

A temporary study “Review · stopped run” is added to the sidebar, selected, its context menu opened. Closing the window removes it.

Open It Close Fixture Window
Fixture study lives under the app container’s tmp; not indexed
C · Full baton: a seeded fixture study driven into the state
Build
L · a temp ProjectIndex entry, a window on it, state injection, teardown; ReviewGallerySidebarFixture does the first third already but never touches the real index
Per entry
~20 min: a scenario per entry, plus the drive sequence
Gate
new risk: a fixture study must never reach ProjectIndex on disk or the serve fleet; needs its own test and a check-window-surfaces.sh clause
Stale caught by
compile, plus a drive that lands somewhere else, which only a human sees
Rules out
cheap entries: every entry now costs a scenario, so fewer get written
Commentary Three doors exist and 19 recipes do not have one because 19 entries have no cheap door to call: a Finder drop, a keyboard chord in the report, a second window. B does not change that; it gives the 6–8 entries whose recipe begins “Diagnostics ▸ Diagnostic fixtures ▸ …” a one-click seed, and keeps the recipe for what the reviewer must look at, which is the half a door cannot do. C is the owner rule “the appliance copes” applied to a tool whose user is the developer, and it buys a fixture study in the real sidebar: the one object the sandbox, the reaper and the index all care about.

What B adds to the registry

// ReviewGalleryRegistry.swift — the navigation case grows one optional field
case navigation(recipe: String, open: (@MainActor () -> Void)?, seed: DiagnosticFixture.Name? = nil)

// M08, rewritten: the recipe says what to see; the seed and door do the getting there
navigation(id: "M08", title: "Stopped/failed study offers Analyse", …
           recipe: "Check the context menu, the Project menu and the toolbar: Analyse and Re-analyse… are both offered.",
           seed: .stopped,
           open: { DiagnosticFixture.applyToSelectedProject(.stopped); NSApp.sendAction(#selector(ContentView.showProjectMenu), to: nil, from: nil) })

// ReviewGalleryRegistryTests — a seed that is not a scenario fails the build of the gallery, not the review
@Test func everySeedIsAScenario() {
    for entry in ReviewGalleryRegistry.entries { for state in entry.states {
        if case .navigation(_, _, let seed?) = state.make(ctx) {
            #expect(DiagnosticFixture.summaryScenarioNames.contains(seed.rawValue), "\(entry.id) seeds \(seed)")
        } } }
}

2 · Choice (ii): where the web specimens live, and what “bundle-size budget” means here

The budget turns out not to be bytes. Today’s two real specimen routes add 10 KB to a 3.8 MB asset folder; a review page with a fault bar would add perhaps 40–60 KB. What differs between the options is whether a fault injector (crash this lens, fail this request) exists in a researcher’s binary at all, and whether any gate would notice if it did.

api 188 KBmain 170 KBthe rest of 3.8 MBtoday’s two specimen routes, 10 KBa review page + fault bar if it shipped, ~50 KB (estimate)

A Hand-written HTML in the Mac gallery (today)

Sibling: ErrorPatternWebPreview, a WKWebView fed a string.
⌧
Quotes couldn’t be shown.
Give feedback
RouteError.tsx · lens scope (as described in Swift, not rendered from it)
Release bytes
0 — it is Swift under #if DEBUG
Gate
check-release-binary.sh already covers it (“Review Gallery” literal)
Per entry
~15 min to write the HTML; a second copy of the component’s look that nobody updates with it
Stale caught by
nothing: the markup test checks buttons, not fidelity. This is GA-2.
Rules out
reviewing a change to the real component; the specimen shows the Swift author’s memory of it

B Real components on always-registered lazy routes

Sibling: /report/specimen and /report/picker-specimen — lazy chunk, nav link under IS_DEV, Diagnostics door.
Add /report/review: the real RouteError, PanelErrorBoundary, chips and dialogs mounted with props. Benign states only: no fault bar, because a request-fault injector on a shipped route is a back door whatever the nav shows.
Release bytes
~20–30 KB lazy chunk, loaded only when visited; reachable by URL in any browser on a serve
Gate
none today for static JS; would need a check-static-assets.sh that greps the bundle for a marker literal (the Mach-O scan’s sibling)
Per entry
~5 min: a props fixture per state; the component is the component
Stale caught by
vitest on the route (a renamed prop fails the build); the Mac gallery can show it only through a live sidecar
Rules out
crash and failed-request states — the 7 of 26 “hands” items the Phase 1 mockup wanted the fault bar for

C A dev-only page, compiled out of release and export

Sibling: the --dev playground and /api/dev/telemetry (mounted only under serve --dev), and Vite’s import.meta.env.DEV dead-code drop.
localhost:8484/report/dev/review#lens-crash
Fault Crash ▾ in Signals lens ▾ every time ▾ ApplyorFail ▾ GET /sessions ▾ 500 ▾
⌧
Signals couldn’t be shown.
Give feedback
Release bytes
0 — the route, the fault bar and its fetch wrapper sit behind if (import.meta.env.DEV), so the production and export builds never contain them; the Python side mounts nothing without --dev
Gate
a static-asset scan for one marker literal (e.g. bn-fault-bar) in static/assets/*.js, called from build-all.sh beside check-bundle-integrity.py; a gate with no caller is not a gate
Per entry
~5 min props fixture, or ~1 min when the state is a fault (pick lens + fault, no code)
Stale caught by
vitest on the registry; the /dev/review list is the same JSON the Mac reads for “In the app” web entries, so one list, one rot
Needs
the full stack to review (Vite on 5173 + serve on 8484); the Mac gallery shows web states only in the External Server scheme
Rules out
reviewing web states in a plain Debug build of the app with the bundled sidecar — a door that opens a URL the sidecar does not serve must dim, not 404
Commentary The Phase 1 mockup’s §3 described C and said “compiled out of release and export builds”; nobody built it, and A grew in its place because A needed no sidecar. A is the cheapest to look at and the most expensive to trust: it is a drawing of the component with the component’s name on it, which is the class of artefact this repo’s mockup register exists to warn about. B ships a review surface in a researcher’s binary for no researcher reason; harmless at 10 KB today, and a precedent that stops being harmless the day someone adds a fault switch to it “just for dev”. C is the only option where the fault bar can exist, because it is the only one where it cannot ship.

3 · The gate, drawn as it would run

# desktop/scripts/check-static-assets.sh — sibling of check-release-binary.sh, for the sidecar's JS
# Called from build-all.sh step 1d (after check-bundle-integrity.py). An assertion is `cmd || die`.
ASSETS="$APP/Contents/Resources/bristlenose-sidecar/_internal/bristlenose/server/static/assets"
hits=$(grep -l -F -e "bn-fault-bar" -e "/report/dev/review" "$ASSETS"/*.js || true)
[ -z "$hits" ] || die "dev-only review page reached the release bundle: $hits"

# tests/test_static_assets_dev_free.py — the same check against frontend/dist after `npm run build`,
# so CI fails before the Mac ever archives. Negative fixture: a build with DEV forced on must trip it.
Commentary Two places, one literal, and a negative fixture, because a gate that has never failed is not known to work (gate policy, root CLAUDE.md). The literal is a class name the fault bar must carry; the test asserts it is present in a dev build and absent in a production one, so the gate cannot pass by the fault bar being renamed.

4 · Comparison

Release gatePer entryStale entry caught byFault statesBuild
(i) A recipe#if DEBUG, scanned2 min write, 1–3 min each reviewa human—S
(i) B recipe + door + seedunchanged5 min; review is a clickcompile + seed-name test—M
(i) C batonnew risk to the index and fleet20 mincompile; wrong landing: a human—L
(ii) A hand-written HTMLcovered15 min, then driftsnothingdrawn, not realS
(ii) B shipped lazy routenone exists; ~30 KB ships5 minvitestcannot ship themM
(ii) C dev-only page0 bytes; new static-asset scan5 min, or 1 min for a faultvitest; one list for both halvesreal, dev onlyM
Recommendation. (i) B: keep the recipe as the required field, make it say what to look at, and add an optional named seed beside the optional door; convert the six fixture-driven entries (M08, M09, M10, B03, the two Whisper rows) first, leave the Finder-drop and chord entries as recipes. (ii) C: build the dev-only review page with the fault bar under import.meta.env.DEV and serve --dev, add the static-asset scan with its negative fixture, and retire ErrorPatternWebPreview once the four states it draws exist there — its Mac entries become .navigation doors that open the dev URL in the report webview and dim when the window’s serve is not a dev serve.
  1. Registry: seed: on the navigation case; everySeedIsAScenario; rewrite six recipes. One Swift commit.
  2. SPA: /report/dev/review route and fault bar behind DEV; the list is review-gallery.json under frontend/src/data/, read by vitest and (later) by the Mac registry through the sidecar. Python: mount nothing new; --dev already serves the SPA from Vite.
  3. Gate: check-static-assets.sh + test_static_assets_dev_free.py with the forced-DEV negative fixture; wire the script into build-all.sh in the same commit, and list it in docs/testing/inventory.md’s source.
  4. Then GA-2 closes: delete ErrorPatternWebPreview.swift and its markup test; the Mac entries point at the real thing or dim.
Open for the owner