Wiki Content Bundle Pipeline

Vercel deploys cannot read parent ../wiki at runtime when Root Directory is ui; prebuild copies markdown into the serverless bundle. Source: ui/README.md; ui/scripts/bundle-wiki.mjs; AGENTS.md Indexing section

Problem

Serverless functions only see files inside the traced deployment bundle. The wiki source of truth lives adjacent to ui/, not inside it. Source: ui/README.md

Pipeline

  1. prebuild invokes scripts/bundle-wiki.mjs.
  2. Script copies ../wiki to ui/.content/wiki.
  3. next.config.ts sets outputFileTracingIncludes for .content/**/*.
  4. Runtime default WIKI_DIR points at bundled copy unless overridden.

Source: ui/README.md

Local vs production

Environment Wiki path
Local dev Filesystem ../wiki at request time
Vercel .content/wiki inside ui bundle

Optional WIKI_DIR env overrides both. Source: ui/README.md

Maintenance coupling

Agent edits land in wiki/ at repo root. Production UI updates only after rebuild/redeploy triggers bundle copy. Index rebuild (npx tsx scripts/build-index.ts) and qmd embed remain separate from UI bundle but should run before deploy when search metadata changes. Source: AGENTS.md Indexing section; ui/README.md

Schema Compiler and build-index regenerate _index.md and _backlinks.json in source wiki; bundle step ships whatever is current at build time.

Architecture Position

Axis Value
Family Memory, context, and retrieval
Boundary owned Build-time content bundle from flat markdown into the UI deployable.
Read with Kevin Wiki UI Architecture, Generated Surface Contract, QMD Embed Workflow
Use this page when changing wiki UI deployment or content bundling

Timeline