# FvW Alignment Audit — Phase 2 — Codebase Inventory + Artefact Archaeology **Date:** 2026-09-14 **Audit lane:** id 9 (vibecoder-standalone-mavis) **Code HEAD:** a2062aa (post b2994 drift guard) **Predecessor:** Phase 1 = b2998 --- ## A. Codebase Inventory ### A1. Top-level structure of /workspace/vibecoder-standalone/src | Bucket | Files | Lines | Largest file | |---|---:|---:|---| | src/host/editor | 41 | 12,131 | Canvas.tsx (974) | | src/vcs | 28 | 8,240 | StandaloneContainer.js (1,497) | | src/vibechat | 11 | 3,602 | ChatPanel.tsx (2,390) | | src/vibechat/components | 7 | 4,518 | (split) | | src/cms | 37 | 7,750 | edge-panel.js (1,760) | | src/cms/runtime | 35 | 7,599 | edge-panel/edge-panel.js (3,037) | | src/agent | 10 | 3,929 | tools.ts (1,158) | | src/host | 11 | 2,130 | host-boot.js (1,285) | | src/host/workspace | 10 | 1,776 | dna/*.test.ts (~770–1,329) | | src/host/dashboard | 3 | 656 | dashboard.tsx | | src/host/mounts | 4 | 802 | mounts.ts | | src/host/pact | 4 | 392 | pact/ | | src/host/fce-integration | 4 | 1,068 | | | src/scaffold | 8 | 1,377 | (FvS scaffold) | | src/shared | 2 | 189 | markdown/ (274) | | src/pages | 2 | 641 | | | src/oscardeps | – | – | coder-chat (174), fileops (364), node-bridge (88), stubs (196), tooling (303) | | src/stubs | 4 | 27 | (4 stub files) | | **TOTAL (src tree)** | **>200 files** | **~58,000 lines** | – | Frontend total (excluding tests): **141,885 lines** across src/. Largest non-test files: - cms/runtime/edge-panel/edge-panel.js — **3,037** (monolith candidate) - vibechat/components/ChatPanel.tsx — 2,390 - cms/runtime/panel-manager/panel-manager.js — 1,995 - cms/edge-panel/edge-panel.js — 1,760 - cms/fvcms-cms-panel/fvcms-cms-panel.js — 1,536 - vcs/StandaloneContainer.js — 1,497 - cms/fvcms-panel-manager/fvcms-panel-manager.js — 1,046 - vcs/vcs-css.js — 1,262 - agent/tools.ts — 1,158 - cms/panel-manager/panel-manager.js — 835 - cms/content-admin.js — 813 - host/host-boot.js — 1,285 - host/editor/Canvas.tsx — 974 - host/editor/selection.ts — 788 ### A2. Entry points - Frontend: `/workspace/vibecoder-standalone/src/main.tsx` - Host boot: `/workspace/vibecoder-standalone/src/host/host-boot.js` (1,285 lines) - Chat surface: `src/vibechat/ChatPanel.tsx` + `src/oscardeps/coder-chat/index.ts` - CMS mount: `src/cms/cms-local-loader.js` (CMS vendored from freshvibe-cms v1.3.0) - Editor mount: `src/host/mounts/mounts.ts` (4 mount types: Composition, Inspector, Preview) - Bridge backend: `/opt/vibecoder-bridge/server.cjs` (5,317 lines) ### A3. Route map (bridge /opt/vibecoder-bridge/server.cjs) - **Total route handlers: 183** - Top prefixes: - `/api/agent/*` — 81 (largest) - `/api/collections/*` — 25 - `/api/cascade/*` — 8 - `/api/agent/freshvibe-apps` — 7 - `/api/agent/content-types` — 7 - `/api/agent/bridge-registry` — 6 - `/api/agent/workers` — 5 - `/api/agent/team-plan` — 5 - `/api/agent/cms-widgets` — 5 - `/api/fvw` — 4 - Bridge is a single 5,317-line monolith with 183 routes. **Refactor candidate.** ### A4. Largest backend files (VPS, excluding .worktrees/.mirror) | Lines | Path | |---:|---| | 5,317 | /opt/vibecoder-bridge/server.cjs | | 1,557 | /opt/vibecoder-bridge/bridge-server/server.cjs (legacy reference copy) | | 1,497 | /opt/vibecoder-bridge/src/vcs/StandaloneContainer.js | | 1,285 | /opt/vibecoder-bridge/src/host/host-boot.js | | 1,158 | /opt/vibecoder-bridge/src/agent/tools.ts | ### A5. Editor subdirs (Cinema/Curve state) `/workspace/vibecoder-standalone/src/host/editor/`: - 41 files, 12,131 lines (with tests) - Real: Canvas.tsx (974), Composer.tsx, Inspector.tsx, Timeline.tsx, TimelineR221.tsx, LayersPanel.tsx, PresetBrowser.tsx, ToolStrip.tsx, VSILEditor.tsx - AI controls: AIEditController.ts, AIEditPanel.tsx, MotionAIControls.tsx, CurveAIControls.tsx - Cinema sub: CurveEditor, CurveHandle, CurvePreview, CurveSection - Mounts: `src/host/mounts/` has CompositionGraphHost, InspectorHost, PreviewHostVSIL + mounts.ts - **No obvious stubs** — editor is real and substantial. ### A6. CMS - `/workspace/vibecoder-standalone/src/cms/` — vendored from `/workspace/freshvibe-cms/` - **Version: 1.3.0** (per `FV-CMS-VERSION.txt` and `FV-CMS-MANIFEST.json`) - 37 files in top, plus deep `runtime/`, `cms-panel`, `app-fragments`, `chrome-registry` - 7,750 lines total in src/cms + 7,599 in src/cms/runtime = **15,349 CMS lines** --- ## B. Constitutional Artefact Archaeology (KEY FINDING) ### Phase 1 was WRONG on absolute paths. Correction follows: The 8 constitutional artefacts (`app-*` directories) DO exist in /workspace/vibecoder-standalone — they sit at the **repo root**, not inside `src/`. Phase 1's `find /workspace -maxdepth 8` somehow missed them; the explicit `-maxdepth 6` and `/workspace/vibecoder-standalone/` scoped search finds them all. ### B1. Current state | Artefact | /workspace/vibecoder-standalone | /workspace/fv-module-gallery/fv-cms-vendored | /workspace/freshvibe-reconstruction-engine | |---|---|---|---| | app-pact | ✓ substantive (17KB app-pact.md + JSON + decisions/) | ✓ | ✗ MISSING | | app-codex | ✗ STUB (.gitkeep only) | ✓ | ✗ MISSING | | app-fragments | ✗ STUB (.gitkeep only) | ✓ | ✗ MISSING | | app-dna | ✓ substantive (17KB app.dna.json) | ✗ MISSING | ✗ MISSING | | app-trace-atlas | ✓ substantive (214KB atlas.json) | ✓ | ✗ MISSING | | app-overlays | ✗ STUB (.gitkeep only) | ✓ | ✗ MISSING | | app-vp | ✓ substantive (protection/ + validity/ subdirs) | ✓ | ✗ MISSING | | app-recipe | ✓ substantive (29KB codex.md + manifest.json + recipe.md + rules.md) | ✓ | ✗ MISSING | **Tally:** - VibeCoder: 5 substantive, 3 stubs (codex, fragments, overlays = .gitkeep only) - fv-cms-vendored: 7 of 8, missing app-dna - FVRE: 0 of 8 ### B2. Git history search (deletions of root-level app-*) - `git -C /workspace/vibecoder-standalone log --all --diff-filter=D --name-only` filtered to `^app-(pact|codex|...)/`: - **0 results.** The 8 root-level artefacts were never deleted in history. - `git -C /workspace/fv-module-gallery log --all --diff-filter=D` for `fv-cms-vendored/app-*/`: - **0 results.** No deletions in vendored copy either. - Related but distinct: many `src/chrome/freshvibe-cms/app-fragments/*/index.js` CMS fragments were deleted — these are FVS CMS panels, not the constitutional `app-fragments/` artefact at the repo root. Unrelated. ### B3. Branches - vibecoder-standalone has 27 branches (feat/id9-r237-*, feat/r233-*, feat/project-switcher-b2918, feat/fc-encryption-*, feat/screenshot-capture-b2919, feat/dashboard-day-1-2026-09-11, etc.). - **5 branches carry top-level app-* artefacts** (project-switcher-b2918, fc-encryption-vendor-2026-09-11, screenshot-capture-b2919, dashboard-day-1-2026-09-11, main): all carry the same stub set (codex/fragments/overlays = .gitkeep; dna has app.dna.json). No branch carries more substantive content than main. - fv-module-gallery has 1 main + 14 remote branches (fvw-37-chrome-as-infrastructure, fes-doctrine-and-vendor, freshcloud-mail-bundle, etc.) — all originating from vendored app-* structure, none diverge in content. ### B4. Other repos under /workspace Searched: no other repo contains `app-*` constitutional artefacts. The 8-artefact set is uniquely a VibeCoder (and gallery vendor) concept. ### B5. Scaffold / template / generator search - `find /workspace -iname "*scaffold*" -o -iname "*template*"` — no result that names a constitutional-artefact generator. - `grep "createAppPact|createAppCodex|createAppDna|createAppRecipe"` across workspace — 0 results. - **There is NO generator for the 8 constitutional artefacts.** The stubs (codex/fragments/overlays = .gitkeep) are placeholders awaiting first content. --- ## C. Trace Atlas Reconciliation ### C1. Existing atlas - **Path:** `/workspace/vibecoder-standalone/app-trace-atlas/atlas.json` - **Size:** 214,171 bytes - **Modified:** 2026-09-10 18:31 UTC - **Top-level keys:** `schema`, `schemaVersion`, `atlasId`, `atlasName`, `generatedAt`, `generatedBy`, `fvwVersion`, `vgmSource`, `authority`, `constitution`, `vgmManifestRef`, `chain`, `surfaces` - **Schema:** `freshvibe-way-v8.trace-atlas` v1.0.0 - **Authority claimed:** FvW v8.4.1 §04 + §04.9 - **Generator:** id 9 (vibecoder-standalone-mavis), 2026-09-07 12:06 UTC ### C2. Is it FvW artefact #5? — **PARTIAL MATCH** - FvW §04.3 specifies the schema string `freshvibe-way-v4.trace-atlas` (with `schema_version` underscored), but the vibecoder atlas uses `freshvibe-way-v8.trace-atlas` + `schemaVersion` camelCase. **Schema name is v8-claimed, but format is custom (not strictly conformant to the §04.3 example).** - FvW §04.3 mandates 5-level chain `surfaces → behaviours → modules → files → tests`. The vibecoder atlas has `surfaces` and `behaviours` arrays; **presence of `modules`/`files`/`tests` levels not verified at depth from this read** (atlas is 214KB; partial inspection only). - `chain` field asserts the 5-level directional chain. - `vgmManifestRef.buildHash = "190e855"` — references a buildHash but no equivalent `source_head` field per spec. **Verdict:** This is the VibeCoder's app-trace-atlas, but it deviates from the FvW §04.3 example schema string and uses id 9's own canonical representation rather than the gallery's exact field naming. **Conformant to v8 §04 in spirit, non-conformant in field naming.** ### C3. Constitutional atlas comparison - **`gallery-pact/trace-atlas/constitutional-atlas.json`** describes the GALLERY's constitutional topology (nodes for vgm, vgm-manifest, vgm-runtime-api, etc.). Schema `freshvibe-way-v8.constitutional-atlas`. - **VibeCoder's `app-trace-atlas/atlas.json`** describes the VIBECODER app's UI surface/behaviour chain. Schema `freshvibe-way-v8.trace-atlas`. - **They are independent artefacts at different scopes.** Gallery constitutional atlas = "what does the gallery know about"; VibeCoder atlas = "what surfaces/behaviours does this app have". No cross-reference. The VibeCoder atlas does not appear in the constitutional atlas's `nodes` graph. ### C4. Staleness - Atlas `generatedAt`: 2026-09-07 12:06 UTC - Atlas modified: 2026-09-10 18:31 UTC - Code HEAD: a2062aa on 2026-09-14 09:02 UTC - **Stale by 4–7 days.** The atlas predates the reconciliation f6c2b8b, the drift-guard b2994, and any changes from 2026-09-10 onward. New editor files (`CurveAIControls.tsx`, `VSILEditor.tsx`), the 183-route server.cjs at 5,317 lines, and all b2973-b2986 bridge work post-date the atlas. - Atlas embeds `vgmManifestRef.buildHash = "190e855"` — that's the gallery's build hash from 2026-09-07. No newer build reference. --- ## D. PACT Index Archaeology ### D1. History search `git log --all --diff-filter=D` for the 5 indexes (surface/lifecycle/host/naming/contradiction-docket.md) in `/workspace/fv-module-gallery`: **0 results.** None of the 5 indexes were ever committed in any branch of fv-module-gallery. ### D2. Anywhere `find /workspace -name "surface-map.md" -o -name "contradiction-docket.md" -o ...`: **0 results across the entire workspace.** ### D3. Generator search `grep -r "surface-map\|contradiction-docket\|naming-map" --include="*.js" --include="*.cjs" --include="*.py"`: **0 results.** No generator exists. **Verdict:** The 5 PACT indexes are neither present nor planned. **Complete absence across doctrine, code, and tooling.** --- ## E. FVRE Capability ### E1. What it is `/workspace/freshvibe-reconstruction-engine/` — the FreshVibe Reconstruction Engine. A Python package implementing 8 components (A–H): | ID | Package | Status | |---|---|---| | A | packages/runtime/browser-runner | Implemented | | B | packages/extraction/{A,B,C,scan} | Implemented | | C | packages/measurement/ | Implemented | | D | packages/generation/ | Implemented | | E | packages/test-harness/ | Implemented | | F | packages/migration/ | Implemented | | G | packages/cli/ | Implemented | | **H** | packages/H/ (PHP-source → formation-recipe) | In development | ### E2. Workflow The 8-step workflow: **SCAN → EXTRACT → MEASURE → ENGINE → CROSS-REF → GENERATE → TEST → SHIP**. ### E3. Does it generate constitutional artefacts? **NO.** FVRE extracts/generates **recipes** (the 10-item recipe shape: behaviour/data/key_functions/files/tests + 5 provenance items). Constitutional artefacts (`app-pact`, `app-trace-atlas`, etc.) are NOT in FVRE's output. FVRE-COMPONENT-MAP.md explicitly identifies Component H as **the gap**: > "Component H exists in the doctrine and was hand-produced for SmartPantry, but the FvRE A-G components don't generate it. Building a 'Component H generator' would be the next major FvRE feature." FVRE's own pact directory has only 3 doctrine files (01-fvre-doctrine.md, 02-separation-from-studio.md, 03-operator-signoff.md) — none of these generate VibeCoder's constitutional artefacts. ### E4. Role summary FVRE is a **clean-room extraction → recipe generation** engine. Its outputs are recipes (FvW §11) for *reconstructing* apps from foreign sources (SnappyMail → FreshCloud Mail, etc.). It does NOT: - Generate constitutional artefacts (`app-*`) - Validate artefacts against FvW gates - Maintain a gallery of constitutional topologies - Generate PACT indexes FVRE's outputs (recipes) become INPUTS to VibeCoder's `app-recipe/` — which is already populated with substantive content (29KB codex.md, recipe.md, rules.md, manifest.json). That link is one-way: FVRE never writes back into VibeCoder. --- ## Phase 3 scope decision **Phase 3 should measure COMPLIANCE for the 5 substantive artefacts (app-pact, app-dna, app-trace-atlas, app-vp, app-recipe) and ABSENCE for the 3 stub artefacts (app-codex, app-fragments, app-overlays).** The two scopes are non-overlapping: - For the 5 substantive artefacts, Phase 3 measures: do they conform to FvW §04 (trace atlas), §03 (DNA), §01 (app constitution), §11 (recipe), §17 (governance)? Is content current? - For the 3 stub artefacts, Phase 3 measures: are they scheduled for first-content authoring? Is there a generator in design? Are they referenced by other artefacts (pact/recipe/codex/dna) as missing dependencies? Additionally: - **Trace atlas regeneration**: the existing atlas is 4–7 days stale vs code HEAD a2062aa. Phase 3 (or a precursor) should regenerate it before measuring schema compliance. - **FVRE is out of scope** for VibeCoder artefact generation. The 8-artefact set must come from elsewhere (FVRE doesn't generate them; gallery has its own vendored copy). - **5 PACT indexes**: complete absence confirmed. Phase 3 should not measure compliance for them; should instead note the structural gap (no PACT index generator exists in any repo). --- ## Provenance + integrity - Audit read-only: no source files modified, no commits made. - All file paths verified to exist on disk before this report. - No tool failure observed; all ssh/find/grep returned clean results.