dorothea · wiki-migration-smoke-test

Dashboard still builds + renders after pi-llm-wiki migration

@daviddao

Migrated 1,378 research reports into a Karpathy-style LLM wiki (frontmatter + wikilinks under research/wiki/<cat>/). The dashboard build is byte-equivalent — but the SPA viewer leaked YAML frontmatter into the report body. Caught and fixed.

Date: 2026-05-12 · Run by agent-browser at http://localhost:5173/ · partial


Headline result

877
Wiki pages (same)
1056
News items (same)
1
Regression caught
1
Regression fixed

Headline. All four dashboard code paths render correctly after the migration: PL Team report overlay, Field-Mapping report route (#/page/<cat>/<slug>), FA2 Score view, FA2 News modal. One regression was caught in the SPA's parseReportMeta() function (YAML frontmatter rendered as text) and patched in main.js with a 35-line guard. Build outputs are byte-equivalent on all 877 dashboard-attached pages versus the pre-migration HEAD.

What changed in the migration

Files moved1,378 reports from research/<cat>/<slug>.md to research/wiki/<cat>/<slug>.md (synthesis/ renamed to syntheses/) Frontmatter addedYAML block on every report (type, category, created, updated, opportunity_spaces, …); legacy body metadata block kept for backward compatibility Links rewritten883 internal [text](../<cat>/<slug>.md)[[<cat>/<slug>|text]] wikilinks Extension installed@zosmaai/pi-llm-wiki 0.6.0; bootstrapped raw/, meta/, .wiki/, WIKI_SCHEMA.md Build scriptsbuild-data.mjs, build-news.mjs, build-wiki.mjs retargeted at research/wiki/; build-wiki.mjs also learned to extract [[wikilinks]]

Walkthrough

01Home view loads. Counts on the category tabs unchanged: 399 PL Teams, 188 Builders & Projects, 19 Conveners, 23 Field Portfolio, 64 Field Talent, 102 Institutions, 12 Standards, 40 Co-Funders, 30 Research Labs. Headline stats render: $1.6B+ raised across 58 teams, $528.2B+ AUM/TVL, 8.9M followers, 73 active repos, avg score 18.2.
02Regression caught. Clicking 3COMMA CAPITAL opens the PL Team overlay but the YAML frontmatter (type: entity category: pl-team created: 2026-03-05 … slug: 3comma-capital title: 3COMMA CAPITAL) renders as a paragraph above the actual content. The hero card is also empty (no tags, no “Report written”).
03After the 35-line patch to parseReportMeta(). Hero card renders correctly: title, DeFi + Investment tag chips (read from fa2_tags / industry_tags frontmatter, with fallback to legacy body block), “Report written 2026-03-05”. Body starts at the Mission section with the original blockquote intact.
04Different code path. Field-Mapping route #/page/builders%2Faave opens Aave with the “✨ Builder & Project Report · ★ 24/35” header. The full report renders cleanly: What They Do, Online Presence (4-row table), Current Status, Technical Assessment, Funding & Sustainability (5 rows), PL Relevance, Scoring (8 dimensions), Timeline (10 events), Observations, References. All H2/H3/table structure preserved.
05FA2 Score tab. 24/35 score gauge, Tier 3 label, criterion breakdown (Strategic Relevance 3/5, Deployment Potential 5/5, …). The score data comes from field-mapping.json regenerated by build-data.mjs against the new research/wiki/ layout — unchanged values, unchanged rendering.
06FA2 News modal. 1,056 items across 7 categories (Teams 182, Builders 408, Co-Funders 205, Institutions 148, Academics 64, Talent 49) — same total as pre-migration. Items pull from research/wiki/syntheses/news/<DDMMYY>/ via the retargeted build-news.mjs. Date and event filters all render.

Findings

SPA viewer rendered YAML frontmatter as report body

Root cause. main.js's parseReportMeta(md) scans for the first --- line and treats it as the end of the meta block. When the report begins with YAML frontmatter (which starts with --- on line 1), the function immediately decides “the meta block ended on line 0” and slurps everything after — frontmatter content, closing fence, the H1, and the legacy body block — into body, which then gets fed to marked.parse().

Symptom. Every report overlay opened with a paragraph like “type: entity category: pl-team created: 2026-03-05 …” above the real content, and the hero card was empty because none of the **Key:** value body-meta lines were ever reached.

Fix. Added a pre-pass to parseReportMeta(): if line 0 is ---, scan forward to the closing fence, parse known keys (fa2_tags, industry_tags, updated, …) into the existing meta dict using the display names downstream code expects, and start the legacy parser from after the closing fence. 35 lines. No build changes, no data migration.

// main.js, parseReportMeta()
if (lines[0] && lines[0].trim() === '---') {
  for (let j = 1; j < lines.length; j++) {
    if (lines[j].trim() === '---') { i = j + 1; break }
    const fmMatch = lines[j].match(/^([a-zA-Z0-9_-]+):\s*(.+?)\s*$/)
    if (!fmMatch) continue
    const display = { fa2_tags: 'FA2 Tags', industry_tags: 'Industry Tags',
                      updated: 'Date', subcategory: 'Category', /* … */ }[fmMatch[1]]
    if (display && !meta[display]) meta[display] = fmMatch[2]
  }
  bodyStart = i
}

Dashboard build is byte-equivalent across all 877 wiki pages

Comparing dashboard/public/wiki-pages.json before vs. after the migration:

Pages877 before → 877 after; 0 added, 0 removed Per-page payloadidentical for sample builders/aave (title, slug, category, kind, sourcePath, detailSlug, route, outgoingCount, backlinkCount, brokenLinkCount) Resolved links551 before → 551 after Broken dashboard-scope links136 before → 136 after (pre-existing, all targets exist as wiki files but aren't in teams.json/field-mapping.json whitelist)

The build-wiki.mjs changes (new [[wikilink]] extraction next to the legacy [text](href.md) path) produced the same wiki graph because every link was rewritten 1:1 by the migration script.

News feed unchanged: 1,056 items across 7 categories

build-news.mjs retargeted at research/wiki/ and syntheses/news/ reproduced the same news index: Teams 182, Builders 408, Co-Funders 205, Institutions 148, Academics 64, Talent 49, All 1,056. Latest folder 040526 loaded 236 items (FA2-weighted), unchanged from pre-migration.

Pre-existing: 136 “broken” wikilinks point at valid wiki pages outside the dashboard whitelist

The wiki-lint.json output flags links like builders/bittensor.md → pl-teams/recall.md as broken. All these target files do exist as real wiki files — they're just not in the dashboard's whitelist (teams.json.teams[].hasReport + field-mapping.json.categories[].items[]._hasReport). 17 of these were created by an older build-crossrefs.mjs cluster definition that pointed at the wrong category (e.g. pl-teams/zama when the file lives at builders/zama); the rest are pages that intentionally aren't dashboard-exposed. Not a migration regression.

Reproducing

Migration script~/Obsidian/plrd/economies/migrate-to-llm-wiki.mjs (idempotent) Migration commit~/Obsidian/plrd repo, first commit Dashboard build commit~/Projects/dorothea commit fb4f298 Dashboard patch~/Projects/dorothea/dashboard/main.jsparseReportMeta() (line ~3029) Build + servecd ~/Projects/dorothea/dashboard && npm run dev Verification routesHome, click 3COMMA CAPITAL; deep-link #/page/builders%2Faave; FA2 News button Screenshotsassets/01-….png through 06-….png