{
  "schema": "freshvibe-way-v8.trace-atlas",
  "schema_version": "1.0.0",
  "app_id": "studio.oscar.platform",
  "app_version": "1.1.0",
  "generated_at": "2026-07-17T01:50:00Z",
  "last_refactor": "AI Bundle shape (FVW v8 \u00a710/\u00a717/\u00a718). 12 sub-modules extracted from app/src/assistant/ into app/src/modules/ai-bundle/. Compatibility shim at app/src/assistant/ai-bundle-shim.ts. 12 pact fragments written to pact/fragments/oscar.ai-bundle.*.001.md via GLM-4.7/4.5-flash (2026-07-17).",
  "surfaces": {
    "home": {
      "id": "home",
      "name": "Home",
      "file": "app/src/views/Home.tsx",
      "behaviours": [
        "render-anchors",
        "navigate-via-anchor"
      ],
      "module": "views",
      "test": "tests/views.test.ts (planned)"
    },
    "surveys-list": {
      "id": "surveys-list",
      "name": "Surveys list",
      "file": "app/src/views/Surveys.tsx",
      "behaviours": [
        "list-surveys",
        "create-survey",
        "edit-survey",
        "delete-survey",
        "load-survey-data"
      ],
      "module": "views",
      "test": "vp/views.test.ts (planned)"
    },
    "notes-list": {
      "id": "notes-list",
      "name": "Notes list",
      "file": "app/src/views/Notes.tsx",
      "behaviours": [
        "list-notes",
        "create-note",
        "edit-note",
        "delete-note",
        "extract-tags"
      ],
      "module": "views",
      "test": "vp/views.test.ts (planned)"
    },
    "reports-list": {
      "id": "reports-list",
      "name": "Reports list",
      "file": "app/src/views/Reports.tsx",
      "behaviours": [
        "list-reports",
        "create-report",
        "edit-report",
        "export-pdf",
        "export-docx",
        "load-from-survey"
      ],
      "module": "views",
      "test": "vp/views.test.ts (planned)"
    },
    "settings": {
      "id": "settings",
      "name": "Settings",
      "file": "app/src/views/Settings.tsx",
      "behaviours": [
        "select-provider",
        "download-brain",
        "set-theme",
        "replay-tour",
        "reset-data"
      ],
      "module": "views",
      "test": "vp/views.test.ts (planned)"
    },
    "blog": {
      "id": "blog",
      "name": "Blog",
      "file": "app/src/views/Blog.tsx",
      "behaviours": [
        "list-posts",
        "create-post",
        "edit-post",
        "ai-draft",
        "ai-outline",
        "ai-suggest-title",
        "ai-suggest-tags",
        "ai-generate-summary",
        "ai-rewrite-tone",
        "export-md",
        "export-html"
      ],
      "module": "writing",
      "test": "vp/views.test.ts (planned)"
    },
    "assistant-dock-bar": {
      "id": "assistant-dock-bar",
      "name": "AssistantDock (bar state)",
      "file": "app/src/assistant/Bar.tsx",
      "behaviours": [
        "render-bar",
        "tap-to-expand"
      ],
      "module": "assistant",
      "test": "vp/runtime.test.ts RT-2.1, RT-2.3"
    },
    "assistant-dock-sheetmin": {
      "id": "assistant-dock-sheetmin",
      "name": "AssistantDock (sheet-min state)",
      "file": "app/src/assistant/SheetMin.tsx",
      "behaviours": [
        "render-peek",
        "quick-input"
      ],
      "module": "assistant",
      "test": "vp/runtime.test.ts"
    },
    "assistant-dock-sheetfull": {
      "id": "assistant-dock-sheetfull",
      "name": "AssistantDock (sheet-full state)",
      "file": "app/src/assistant/SheetFull.tsx",
      "behaviours": [
        "render-conversation",
        "send-prompt",
        "render-action-chips",
        "execute-action"
      ],
      "module": "assistant",
      "test": "vp/runtime.test.ts"
    },
    "smart-adapter": {
      "id": "smart-adapter",
      "name": "SmartAdapter dispatcher",
      "file": "app/src/intelligence/adapters/smart.ts",
      "behaviours": [
        "dispatch-layer-0-writing",
        "dispatch-layer-1-heuristic",
        "dispatch-layer-1-5-web-search",
        "dispatch-layer-2-data",
        "dispatch-layer-3-history",
        "dispatch-layer-4-classify",
        "dispatch-layer-5-standard",
        "dispatch-layer-6-howto",
        "dispatch-layer-7-off-topic",
        "dispatch-layer-8-medium-heuristic",
        "dispatch-layer-9-clarify",
        "format-answer-claim-evidence-hedge-action",
        "render-action-chips"
      ],
      "module": "intelligence",
      "test": "vp/intelligence.test.ts"
    },
    "brain-orchestrator": {
      "id": "brain-orchestrator",
      "name": "Brain orchestrator",
      "file": "app/src/brain/orchestrator.ts",
      "behaviours": [
        "try-rules",
        "try-cached",
        "fallback-ai"
      ],
      "module": "brain",
      "test": "vp/intelligence.test.ts"
    },
    "brain-rules-classify": {
      "id": "brain-rules-classify",
      "name": "Tree classification rules",
      "file": "app/src/brain/rules/classify-tree.ts",
      "behaviours": [
        "parse-tree",
        "run-rules",
        "select-highest-confidence"
      ],
      "module": "brain",
      "test": "vp/intelligence.test.ts"
    },
    "writing-draft": {
      "id": "writing-draft",
      "name": "Writing service",
      "file": "app/src/writing/draft.ts",
      "behaviours": [
        "draft-full-post",
        "draft-outline",
        "draft-section",
        "rewrite-tone",
        "suggest-title",
        "suggest-tags",
        "generate-summary",
        "blog-to-html",
        "slugify",
        "word-count",
        "reading-minutes"
      ],
      "module": "writing",
      "test": "vp/writing.test.ts (planned)"
    },
    "export-pdf": {
      "id": "export-pdf",
      "name": "PDF export",
      "file": "app/src/export/pdf.ts",
      "behaviours": [
        "render-pdf"
      ],
      "module": "export",
      "test": "vp/export.test.ts (planned)"
    },
    "export-docx": {
      "id": "export-docx",
      "name": "DOCX export",
      "file": "app/src/export/docx.ts",
      "behaviours": [
        "render-docx"
      ],
      "module": "export",
      "test": "vp/export.test.ts (planned)"
    },
    "search-cmd-k": {
      "id": "search-cmd-k",
      "name": "Cmd+K global search",
      "file": "app/src/search/cmd-k.ts",
      "behaviours": [
        "global-search",
        "rank-results"
      ],
      "module": "search",
      "test": "vp/ux.test.ts UX-4.1 to UX-4.3"
    },
    "onboarding": {
      "id": "onboarding",
      "name": "Onboarding tour",
      "file": "app/src/onboarding/tour.ts",
      "behaviours": [
        "step-next",
        "step-goTo",
        "step-finish"
      ],
      "module": "onboarding",
      "test": "vp/ux.test.ts UX-3.1, UX-3.2"
    }
  },
  "behaviours": {
    "render-anchors": {
      "handler": "Home.renderAnchors",
      "module": "views",
      "file": "app/src/views/Home.tsx"
    },
    "list-surveys": {
      "handler": "Surveys.listSurveys",
      "module": "views",
      "file": "app/src/views/Surveys.tsx"
    },
    "create-survey": {
      "handler": "Surveys.createSurvey",
      "module": "views",
      "file": "app/src/views/Surveys.tsx"
    },
    "edit-survey": {
      "handler": "Surveys.editSurvey",
      "module": "views",
      "file": "app/src/views/Surveys.tsx"
    },
    "delete-survey": {
      "handler": "Surveys.deleteSurvey",
      "module": "views",
      "file": "app/src/views/Surveys.tsx"
    },
    "list-notes": {
      "handler": "Notes.listNotes",
      "module": "views",
      "file": "app/src/views/Notes.tsx"
    },
    "create-note": {
      "handler": "Notes.createNote",
      "module": "views",
      "file": "app/src/views/Notes.tsx"
    },
    "edit-note": {
      "handler": "Notes.editNote",
      "module": "views",
      "file": "app/src/views/Notes.tsx"
    },
    "extract-tags": {
      "handler": "Notes.extractTags",
      "module": "views",
      "file": "app/src/views/Notes.tsx"
    },
    "list-reports": {
      "handler": "Reports.listReports",
      "module": "views",
      "file": "app/src/views/Reports.tsx"
    },
    "create-report": {
      "handler": "Reports.createReport",
      "module": "views",
      "file": "app/src/views/Reports.tsx"
    },
    "export-pdf": {
      "handler": "Export.renderPdf",
      "module": "export",
      "file": "app/src/export/pdf.ts"
    },
    "export-docx": {
      "handler": "Export.renderDocx",
      "module": "export",
      "file": "app/src/export/docx.ts"
    },
    "send-prompt": {
      "handler": "askOscar",
      "module": "assistant",
      "file": "app/src/assistant/ask.ts"
    },
    "render-action-chips": {
      "handler": "AssistantDock.renderActions",
      "module": "assistant",
      "file": "app/src/assistant/SheetFull.tsx"
    },
    "execute-action": {
      "handler": "AssistantDock.executeAction",
      "module": "assistant",
      "file": "app/src/assistant/actions.ts"
    },
    "try-rules": {
      "handler": "Brain.orchestrator.tryRules",
      "module": "brain",
      "file": "app/src/brain/orchestrator.ts"
    },
    "try-cached": {
      "handler": "Brain.orchestrator.tryCached",
      "module": "brain",
      "file": "app/src/brain/orchestrator.ts"
    },
    "fallback-ai": {
      "handler": "Brain.orchestrator.fallbackAI",
      "module": "brain",
      "file": "app/src/brain/orchestrator.ts"
    },
    "dispatch-layer-4-classify": {
      "handler": "SmartAdapter.dispatchClassify",
      "module": "intelligence",
      "file": "app/src/intelligence/adapters/smart.ts"
    },
    "format-answer-claim-evidence-hedge-action": {
      "handler": "SmartAdapter.formatAnswer",
      "module": "intelligence",
      "file": "app/src/intelligence/adapters/smart.ts"
    },
    "draft-full-post": {
      "handler": "draftFullPost",
      "module": "writing",
      "file": "app/src/writing/draft.ts"
    },
    "draft-outline": {
      "handler": "draftOutline",
      "module": "writing",
      "file": "app/src/writing/draft.ts"
    },
    "rewrite-tone": {
      "handler": "rewriteForTone",
      "module": "writing",
      "file": "app/src/writing/draft.ts"
    }
  },
  "modules": {
    "assistant": {
      "directory": "app/src/assistant",
      "files": 11,
      "loc": 888,
      "test": "vp/intelligence.test.ts (smart adapter), vp/runtime.test.ts (dock)",
      "note": "Compat shim layer. Real code lives at app/src/modules/ai-bundle/<sub>/. New code should import from the new path."
    },
    "ai-bundle/ai-ask": {
      "directory": "app/src/modules/ai-bundle/ai-ask",
      "files": 12,
      "loc": 786,
      "test": "vp/ai-bundle/ai-ask.test.ts (planned)",
      "bundle": "ai-bundle",
      "visibility": "public",
      "feature": "chat"
    },
    "ai-bundle/ai-orchestrator": {
      "directory": "app/src/modules/ai-bundle/ai-orchestrator",
      "files": 5,
      "loc": 447,
      "test": "vp/ai-bundle/ai-orchestrator.test.ts (planned)",
      "bundle": "ai-bundle",
      "visibility": "public",
      "feature": "multi-step reasoning"
    },
    "ai-bundle/ai-adapters": {
      "directory": "app/src/modules/ai-bundle/ai-adapters",
      "files": 11,
      "loc": 1823,
      "test": "vp/ai-bundle/ai-adapters.test.ts (planned)",
      "bundle": "ai-bundle",
      "visibility": "public",
      "feature": "chat",
      "note": "5 LLM adapters: minimax, zai, anthropic, openai, local. Plus Oscar-specific smart + stub."
    },
    "ai-bundle/ai-settings": {
      "directory": "app/src/modules/ai-bundle/ai-settings",
      "files": 3,
      "loc": 139,
      "test": "vp/ai-bundle/ai-settings.test.ts (planned)",
      "bundle": "ai-bundle",
      "visibility": "public",
      "feature": "settings"
    },
    "ai-bundle/ai-credentials": {
      "directory": "app/src/modules/ai-bundle/ai-credentials",
      "files": 3,
      "loc": 183,
      "test": "vp/ai-bundle/ai-credentials.test.ts (planned)",
      "bundle": "ai-bundle",
      "visibility": "public",
      "feature": "settings"
    },
    "ai-bundle/ai-fragments": {
      "directory": "app/src/modules/ai-bundle/ai-fragments",
      "files": 4,
      "loc": 375,
      "test": "vp/ai-bundle/ai-fragments.test.ts (planned)",
      "bundle": "ai-bundle",
      "visibility": "public",
      "feature": "history"
    },
    "ai-bundle/ai-ambient": {
      "directory": "app/src/modules/ai-bundle/ai-ambient",
      "files": 3,
      "loc": 218,
      "test": "vp/ai-bundle/ai-ambient.test.ts (planned)",
      "bundle": "ai-bundle",
      "visibility": "public",
      "feature": "suggestions"
    },
    "ai-bundle/ai-input": {
      "directory": "app/src/modules/ai-bundle/ai-input",
      "files": 3,
      "loc": 854,
      "test": "vp/ai-bundle/ai-input.test.ts (planned)",
      "bundle": "ai-bundle",
      "visibility": "private",
      "feature": "chat",
      "note": "InputBar + AskUnit surface. Private chrome."
    },
    "ai-bundle/ai-mic": {
      "directory": "app/src/modules/ai-bundle/ai-mic",
      "files": 1,
      "loc": 21,
      "test": "vp/ai-bundle/ai-mic.test.ts (planned)",
      "bundle": "ai-bundle",
      "visibility": "private",
      "feature": "voice",
      "note": "MicButton + voice STT. Private chrome. Sourced from ai-shell v0.3.0."
    },
    "ai-bundle/ai-toast": {
      "directory": "app/src/modules/ai-bundle/ai-toast",
      "files": 1,
      "loc": 18,
      "test": "vp/ai-bundle/ai-toast.test.ts (planned)",
      "bundle": "ai-bundle",
      "visibility": "private",
      "feature": "chat",
      "note": "ToastHost for AI errors. Private chrome. Sourced from ai-shell v0.3.0."
    },
    "ai-bundle/ai-history": {
      "directory": "app/src/modules/ai-bundle/ai-history",
      "files": 4,
      "loc": 680,
      "test": "vp/ai-bundle/ai-history.test.ts (planned)",
      "bundle": "ai-bundle",
      "visibility": "private",
      "feature": "history",
      "note": "Conversations page. Private chrome."
    },
    "ai-bundle/ai-actions": {
      "directory": "app/src/modules/ai-bundle/ai-actions",
      "files": 2,
      "loc": 301,
      "test": "vp/ai-bundle/ai-actions.test.ts (planned)",
      "bundle": "ai-bundle",
      "visibility": "private",
      "feature": "chat",
      "note": "Copy / View conversation actions. Private chrome."
    },
    "revibe/ai-bundle": {
      "directory": "app/src/modules/revibe/ai-bundle",
      "files": "varies",
      "loc": "varies",
      "test": "TBD (planned)",
      "bundle": "ai-bundle",
      "note": "Oscar's re-vibe of the AI Bundle (FVW v8 \u00a718). 5 pointers, 3 handlers, empty forks folder."
    },
    "brain": {
      "directory": "app/src/brain",
      "files": 7,
      "loc": 520,
      "test": "vp/intelligence.test.ts"
    },
    "branding": {
      "directory": "app/src/branding",
      "files": 2,
      "loc": 80,
      "test": "vp/sovereignty.test.ts SOV-2.1, SOV-2.2"
    },
    "data": {
      "directory": "app/src/data",
      "files": 11,
      "loc": 880,
      "test": "vp/data.test.ts"
    },
    "export": {
      "directory": "app/src/export",
      "files": 2,
      "loc": 250,
      "test": "vp/export.test.ts (planned)"
    },
    "intelligence": {
      "directory": "app/src/intelligence",
      "files": 13,
      "loc": 1100,
      "test": "vp/intelligence.test.ts"
    },
    "lib": {
      "directory": "app/src/lib",
      "files": "varies",
      "loc": "varies",
      "test": "TBD"
    },
    "onboarding": {
      "directory": "app/src/onboarding",
      "files": 1,
      "loc": 120,
      "test": "vp/ux.test.ts UX-3.1, UX-3.2"
    },
    "search": {
      "directory": "app/src/search",
      "files": 1,
      "loc": 200,
      "test": "vp/ux.test.ts UX-4.1 to UX-4.3"
    },
    "settings": {
      "directory": "app/src/settings",
      "files": "varies",
      "loc": "varies",
      "test": "vp/intelligence.test.ts"
    },
    "shell": {
      "directory": "app/src/shell",
      "files": "varies",
      "loc": "varies",
      "test": "vp/runtime.test.ts"
    },
    "ux": {
      "directory": "app/src/ux",
      "files": 6,
      "loc": 600,
      "test": "vp/ux.test.ts"
    },
    "views": {
      "directory": "app/src/views",
      "files": 6,
      "loc": 3000,
      "test": "vp/views.test.ts (planned)"
    },
    "writing": {
      "directory": "app/src/writing",
      "files": 1,
      "loc": 237,
      "test": "vp/writing.test.ts (planned)"
    }
  },
  "tests": {
    "vp/sovereignty.test.ts": {
      "suite": "sovereignty",
      "invariants": 8
    },
    "vp/runtime.test.ts": {
      "suite": "runtime",
      "invariants": 12
    },
    "vp/intelligence.test.ts": {
      "suite": "intelligence",
      "invariants": 11
    },
    "vp/data.test.ts": {
      "suite": "data",
      "invariants": 8
    },
    "vp/ux.test.ts": {
      "suite": "ux",
      "invariants": 9
    },
    "vp/build.test.ts": {
      "suite": "build",
      "invariants": 11
    },
    "vp/adversarial.test.ts": {
      "suite": "adversarial",
      "invariants": 8
    },
    "vp/rules-md-checks.test.ts (planned)": {
      "suite": "rules-md",
      "invariants": "9 \u00d7 12 modules"
    },
    "vp/c1-c9-codex-checks.test.ts (planned)": {
      "suite": "codex",
      "invariants": "9 \u00d7 12 modules"
    },
    "vp/c8-shape-matrix-checks.test.ts (planned)": {
      "suite": "c8-shape-matrix",
      "invariants": "per module"
    },
    "vp/c9-state-shape-checks.test.ts (planned)": {
      "suite": "c9-state-shape",
      "invariants": "per module"
    },
    "vp/constitutional-fragments.test.ts (planned)": {
      "suite": "constitutional-fragments",
      "invariants": "per module"
    },
    "vp/smart-features-checks.test.ts (planned)": {
      "suite": "smart-features",
      "invariants": 6
    },
    "vp/ai-ask.test.ts (planned)": {
      "suite": "ai-bundle",
      "module": "ai-ask",
      "invariants": 8
    },
    "vp/ai-orchestrator.test.ts (planned)": {
      "suite": "ai-bundle",
      "module": "ai-orchestrator",
      "invariants": 5
    },
    "vp/ai-adapters.test.ts (planned)": {
      "suite": "ai-bundle",
      "module": "ai-adapters",
      "invariants": 7
    },
    "vp/ai-settings.test.ts (planned)": {
      "suite": "ai-bundle",
      "module": "ai-settings",
      "invariants": 5
    },
    "vp/ai-credentials.test.ts (planned)": {
      "suite": "ai-bundle",
      "module": "ai-credentials",
      "invariants": 7
    },
    "vp/ai-fragments.test.ts (planned)": {
      "suite": "ai-bundle",
      "module": "ai-fragments",
      "invariants": 6
    },
    "vp/ai-ambient.test.ts (planned)": {
      "suite": "ai-bundle",
      "module": "ai-ambient",
      "invariants": 4
    },
    "vp/ai-input.test.ts (planned)": {
      "suite": "ai-bundle",
      "module": "ai-input",
      "invariants": 5
    },
    "vp/ai-mic.test.ts (planned)": {
      "suite": "ai-bundle",
      "module": "ai-mic",
      "invariants": 7
    },
    "vp/ai-toast.test.ts (planned)": {
      "suite": "ai-bundle",
      "module": "ai-toast",
      "invariants": 5
    },
    "vp/ai-history.test.ts (planned)": {
      "suite": "ai-bundle",
      "module": "ai-history",
      "invariants": 5
    },
    "vp/ai-actions.test.ts (planned)": {
      "suite": "ai-bundle",
      "module": "ai-actions",
      "invariants": 5
    },
    "vp/ai-bundle-integration.test.ts (planned)": {
      "suite": "ai-bundle",
      "module": "all",
      "invariants": 4,
      "note": "Verifies bundle-level coverage matrix: every recipe claim maps to a codex C-section"
    }
  },
  "chain_template": {
    "level_1": "UI surface (surfaces[*].id)",
    "level_2": "Behaviour (behaviours[*])",
    "level_3": "Module (modules[*])",
    "level_4": "File (modules[*].directory / behaviours[*].file)",
    "level_5": "Test (tests[*])"
  }
}
