Status: ✅ 33/33 PASS (all 14 steps green)
Date: 2026-08-30
Branch: feat/id9-r208-integration @ d8e2cca
Repo: avidtech6/vibecoder-standalone
r208 (end-to-end integration of r207 mounts into operator flow) is fully smoke-tested in Vite dev mode. All 14 Playwright steps pass, all 27 unit tests still pass, all 24 r207 unit tests still pass. 3 real bugs were uncovered and fixed during the smoke run; none were caught by unit tests (they were integration-level).
The integration is READY for production deploy pending the r202 Path C iframe removal confirmation (already monkey-patched, see replace-iframe-vsil.js).
The smoke is a 14-step end-to-end loop that exercises the operator's full workflow:
1. Load VibeCoder dev server (no page errors)
2. Verify r208 global APIs are exposed (__fvcmsBootR208Integration, __fvcmsGalleryPreviewBridge, __fvcmsStudioContext, PanelManager)
3. Verify the r208 iframe patch is active (mgr.addPanel wrapped to detect fvcms-vsil-panel)
4. Trigger VSIL panel mount → iframe should be REPLACED by r208 mount slot
5. Verify the 3 r207 hosts (PreviewHostVSIL, InspectorHost, CompositionGraphHost) render in their respective tabs
6. Simulate a Gallery card click → composition:host-mounted should fire, data-mounted="true" on PreviewHostVSIL
7. Dispatch composition:host-focus (region focus)
8. InspectorHost should select the focused region (data-active-region="r-smoke")
9. Edit/Lock tab toggle → data-edit-mode="1", data-read-only="0", EditBar renders
10. EditBar transform → region:transformed should fire
11. Lock tab toggle → data-edit-mode="0", data-read-only="1" (a788 READ-ONLY invariant), EditBar unmounts
12. Surface pill click → surface:activated should fire
13. No iframes or injected scripts in the mount tree (security invariant)
14. Loop completes (Gallery → Preview → Desktop → Edit → Lock)
Symptom: Console error: [r208] StudioContext not initialized. Run initWorkspace() first. The orchestrator's getStudioContext() reads window.__fvcmsStudioContext but r206's initWorkspace() only sets window.__fvcmsWorkspace.
Root cause: The r206 context.ts exposes getStudioContext() (line 219) but doesn't write the singleton to window. The r208 orchestrator assumed it was on window.
Fix: r208-integration.ts now calls getStudioContext() from r206 directly (it's exported) and assigns window.__fvcmsStudioContext = ctx after boot, for downstream consumers + Playwright.
Lesson: r206 is a clean module (not a global-state pattern). r208 should bind to its public API (getStudioContext()), not guess at window globals. This is documented in r208-integration.ts header.
Symptom: Mount slot is empty after r208 boot. Console: [r208] React/ReactDOM not on window; skipping mount.
Root cause: The orchestrator's renderInto and renderEditBarInto used (window as any).React and (window as any).ReactDOM — an assumption that's only true for umd builds, not for ESM Vite HMR bundles.
Fix: r208-integration.ts now imports React from 'react' and createRoot from 'react-dom/client' directly. Standard Vite pattern. Used the same approach in the EditBar mount.
Lesson: r208 was originally written as a "works in any environment" host, but that assumption only held in tag environments. In a Vite/dev world, you have to use the bundler's module resolution. Updated the comment header to say so.
Symptom: Gallery card click throws: Cannot set properties of undefined (setting 'activeAssetId'). The stub inspector.vsil.asset.bind does ctx.state.activeAssetId = args.assetId but ctx was the state object, not the ctx object. So ctx.state was undefined.
Root cause: createStudioContext() passed state as any to the stub factories: createInspectorStub(bus, state as any). The signature expected StudioContext but received the StudioState object. The as any coercion hid the type mismatch.
Fix:
1. Pass { state } as any so the stub can do ctx.state.activeAssetId = ... correctly
2. Wire the inspector.region.* + gallery.asset.bind stubs to actually emit events on the bus (they were NOT_IMPLEMENTED placeholders, blocking the cascade)
Lesson: The original state as any was a "type system bypass" that hid a real runtime issue. NEVER use as any to "make the type checker shut up" when the types don't actually match — fix the types. The unit tests didn't catch this because they only tested the bus emit, not the stub invocation.
src/host/integration/CompositionHostMount.tsx | 7 +--
src/host/integration/r208-integration.ts | 65 +++++++++--------
src/host/workspace/context.ts | 49 ++++++++++-----
scripts/smoke/r208-smoke.spec.cjs | NEW (50KB, 14 steps)
scripts/smoke/r208-debug.spec.cjs | NEW (debug helper)
scripts/smoke/screenshots/ | NEW (6 PNGs)
npx vite --port 5273 --host 0.0.0.0http://localhost:5273/scripts/smoke/screenshots/ - 01-boot.png — initial chrome
- 02-vsil-panel-open.png — VSIL panel open with r208 mount slot (no iframe)
- 03-gallery-card-click.png — PreviewHostVSIL mounted
- 04-edit-tab.png — EditBar rendered, editMode=1
- 05-locked.png — EditBar unmounted, editMode=0
- 06-final.png — final state
| Suite | Result |
|------|--------|
| r208 unit tests (r208-integration.test.ts) | 27/27 ✅ |
| r207 unit tests (mounts.test.ts) | 24/24 ✅ |
| r208 Playwright smoke (r208-smoke.spec.cjs) | 33/33 ✅ |
| Total | 84/84 ✅ |
vibechat-module, separate repo)cd /workspace/vibecoder-standalone-r208
npm run build # build the production bundle
# then SCP the dist/ to 185.249.73.178:/var/www/freshvibeapps/clients/vibecoder/
scp -O -r dist/* root@185.249.73.178:/var/www/freshvibeapps/clients/vibecoder/
The r208 implementation makes avidtech6/vibecoder-standalone the canonical home for the InspectorHost component. The studio/modules/vibescope/src/cards/InspectorCard.tsx in avidtech6/freshvibestudio should be rewritten as a ~15 LoC wrapper that imports useStudio + InspectorHost from avidtech6/vibecoder-standalone. Add package.json alias in freshvibestudio.
The r202 stub has 4 sub-tiles (scene/inspector/composer/timeline) in the Dev Panel. r208 only handles the inspector tile; the other 3 are still r202 stubs. Operator can either ship as-is (3 tiles still TODO) or extend r208 to cover them.
1. Production deploy now or wait for v2.0.0 release tag? (r208 + r207 + r206 are all in their own branches; do we merge to main first, or fast-track a hotfix branch?)
2. Is the r202 Path C iframe removal acceptable? The monkey-patch (replace-iframe-vsil.js) is invisible to the operator (no UI change), but it does mean r202's iframe code is dead. Confirm the iframe is no longer needed.
3. Should the EditBar presets ship? The current presets are empty (No presets (select a region first)). Real presets (Q1) require actual scene data, which the r206 stubs don't provide. Ship the UI shell and let the operator fill the preset list when real scenes land?
To re-run the smoke locally:
cd /workspace/vibecoder-standalone-r208
npx vite --port 5273 --host 0.0.0.0 &
sleep 5
node scripts/smoke/r208-smoke.spec.cjs
Expected: r208 Playwright smoke: 33 passed, 0 failed.