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.
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, allSettingsWindow.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:
ReviewGalleryRegistryTestsbuilds and draws every state at a real size;tests/test_review_gallery_registry.pyresolves 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
WKWebViewinside the Mac gallery (ErrorPatternWebPreview.swift): HTML strings that describeRouteError.tsxandPanelErrorBoundary.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/specimenand/report/picker-specimen: always registered, lazy chunks of 7.5 KB and 2.5 KB, nav link only underIS_DEV, a door from the Diagnostics menu (openSpecimen). They ship in every release bundle (present in the signed sidecar’sstatic/assets). - The
/report/dev/reviewpage with a fault bar (§3 of the Phase 1 mockup) is not built; nothing inapp.pyorroutes/dev.pymounts it. check-release-binary.shgreps 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.
Stopped/failed study offers Analyse
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.
- Build
- S · nothing
- Per entry
- ~2 min to write; 1–3 min to follow, each time
- Gate
#if DEBUGaround the whole registry; no literal reaches Release- Stale caught by
- a human noticing the menu path moved; nothing mechanical
- Rules out
- nothing
Stopped/failed study offers Analyse
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.
stopped, then run_failed_abandoned. Open It Undo Seed- Build
- M · one optional
seed: DiagnosticFixture.Name?on the navigation case;openapplies 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 DEBUGor_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
Stopped/failed study offers Analyse
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.
- Build
- L · a temp
ProjectIndexentry, a window on it, state injection, teardown;ReviewGallerySidebarFixturedoes 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
ProjectIndexon disk or the serve fleet; needs its own test and acheck-window-surfaces.shclause - 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
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.
A Hand-written HTML in the Mac gallery (today)
ErrorPatternWebPreview, a WKWebView fed a string.- Release bytes
- 0 — it is Swift under
#if DEBUG - Gate
check-release-binary.shalready 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
/report/specimen and /report/picker-specimen — lazy chunk, nav link under IS_DEV, Diagnostics door./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.shthat 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
--dev playground and /api/dev/telemetry (mounted only under serve --dev), and Vite’s import.meta.env.DEV dead-code drop.- 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) instatic/assets/*.js, called frombuild-all.shbesidecheck-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/reviewlist 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
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.
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 gate | Per entry | Stale entry caught by | Fault states | Build | |
|---|---|---|---|---|---|
| (i) A recipe | #if DEBUG, scanned | 2 min write, 1–3 min each review | a human | — | S |
| (i) B recipe + door + seed | unchanged | 5 min; review is a click | compile + seed-name test | — | M |
| (i) C baton | new risk to the index and fleet | 20 min | compile; wrong landing: a human | — | L |
| (ii) A hand-written HTML | covered | 15 min, then drifts | nothing | drawn, not real | S |
| (ii) B shipped lazy route | none exists; ~30 KB ships | 5 min | vitest | cannot ship them | M |
| (ii) C dev-only page | 0 bytes; new static-asset scan | 5 min, or 1 min for a fault | vitest; one list for both halves | real, dev only | M |
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.
- Registry:
seed:on the navigation case;everySeedIsAScenario; rewrite six recipes. One Swift commit. - SPA:
/report/dev/reviewroute and fault bar behindDEV; the list isreview-gallery.jsonunderfrontend/src/data/, read by vitest and (later) by the Mac registry through the sidecar. Python: mount nothing new;--devalready serves the SPA from Vite. - Gate:
check-static-assets.sh+test_static_assets_dev_free.pywith the forced-DEV negative fixture; wire the script intobuild-all.shin the same commit, and list it indocs/testing/inventory.md’s source. - Then GA-2 closes: delete
ErrorPatternWebPreview.swiftand its markup test; the Mac entries point at the real thing or dim.
- Is a dev-only web page acceptable as the only home for web states? It means a plain Debug build with the bundled sidecar cannot show them; the reviewer runs the External Server scheme. If the owner wants web states visible in every Debug build, (ii) A stays for those four, with its drift accepted and noted in each entry’s
auditNote. - Undo Seed. The mockup draws it as a button beside Open It. The existing menu has no undo (a rescan restores the real state on the next poll). Whether the gallery should promise one is a small UX call; without it the footer line “Seeded project-ikea · stopped” is the only acknowledgement.
- The default audit verdict (GA-4) is still held: an entry lands as
.alignedunless the author says otherwise. Not drawn here; it is orthogonal to both choices and could be settled in the same sitting.