Goal
Turn the PR #7 side/headless renderer repro into a repeatable validation pipeline so renderer regressions are caught before we rely on manual Obsidian screenshots.
Why
During PR #7 recovery, Cytoscape runtime data had all 12 fixture nodes/11 edges, but Obsidian visibly painted only 7 nodes when using label-sized nodes. The working fix was validated by a mix of static renderer contracts, layout metrics, and Obsidian screenshots. We need that side-render loop formalized so basic MVP parity stays protected.
Scope
Build a no-surprises renderer validation script that can run locally and in CI/package validation:
- Render a frozen Profisee/MVP sidecar fixture outside Obsidian using the plugin renderer/style path or a faithful Cytoscape harness.
- Assert exact fixture structure: 12 nodes, 11 edges, expected IDs, valid endpoints, non-empty edge labels.
- Assert renderer contract: flat sidecar nodes before edges, no story-card compound parents, no render-time deterministic layout, visible labels/arrowheads, delayed fit strategy.
- Assert visual/runtime output: all nodes exist, all edges exist, node positions are preserved, no compound parents are present, labels are non-empty.
- Produce a stable artifact under a repo-owned validation directory for debugging failures.
- Add a package script such as
npm run validate:renderer:headless and include it in the appropriate validation path once stable.
Suggested implementation
- Reuse the current
scripts/renderer-contract.mjs fixture/contract checks as the source of static assertions.
- Promote the previous headless Cytoscape repro into a maintained script under
plugins/obsidian-plugin/scripts/.
- Prefer existing dependencies and system Chrome/Chromium first; only add Playwright if the no-new-deps approach proves too brittle.
- Keep generated screenshots/HTML out of source control and clean them between runs.
- Fail with a clear message if a local browser is unavailable.
Acceptance criteria
npm run validate:renderer or a sibling script catches the known regressions:
- synthetic story-card parent nodes
- render-time layout/backfill
- hidden weak/long edge labels
- label-sized-node paint regression where runtime has 12 nodes but output visibly drops nodes
- The script documents where its transient artifacts are written.
- The validation can be run without opening Obsidian.
- Existing
npm run validate, npm run build, and npm run lint remain green.
Goal
Turn the PR #7 side/headless renderer repro into a repeatable validation pipeline so renderer regressions are caught before we rely on manual Obsidian screenshots.
Why
During PR #7 recovery, Cytoscape runtime data had all 12 fixture nodes/11 edges, but Obsidian visibly painted only 7 nodes when using label-sized nodes. The working fix was validated by a mix of static renderer contracts, layout metrics, and Obsidian screenshots. We need that side-render loop formalized so basic MVP parity stays protected.
Scope
Build a no-surprises renderer validation script that can run locally and in CI/package validation:
npm run validate:renderer:headlessand include it in the appropriate validation path once stable.Suggested implementation
scripts/renderer-contract.mjsfixture/contract checks as the source of static assertions.plugins/obsidian-plugin/scripts/.Acceptance criteria
npm run validate:rendereror a sibling script catches the known regressions:npm run validate,npm run build, andnpm run lintremain green.