Description
The viewer currently reads entity files from disk at build time (via entity-loader.ts). It does NOT connect to the cb serve API. This means users who run cb serve --block my-block still see the wrong data in the viewer — it falls back to whatever entities it finds locally (usually the healthcare demo in synthetic-domains/).
The workaround is setting CB_OUTPUT_DIR=/path/to/block before starting the viewer, but this is undiscoverable and breaks the mental model that cb serve + viewer work together.
Current Behavior
cb serve --block cortex starts API on port 8321 — serves cortex entities correctly
npm run dev in viewer/ — reads files from disk, ignores the API
- User sees healthcare demo instead of their block data
The viewer has two disconnected data paths:
- Digest/Graph/Gaps pages: read from disk via
entity-loader.ts (build-time)
- Ask page: fetches from
cb serve API at runtime (correct)
Acceptance Criteria
Out of Scope
- Changing how
cb serve works (API is fine)
- Viewer redesign or new pages
- SSR/deployment concerns — dev mode is the priority
Description
The viewer currently reads entity files from disk at build time (via
entity-loader.ts). It does NOT connect to thecb serveAPI. This means users who runcb serve --block my-blockstill see the wrong data in the viewer — it falls back to whatever entities it finds locally (usually the healthcare demo insynthetic-domains/).The workaround is setting
CB_OUTPUT_DIR=/path/to/blockbefore starting the viewer, but this is undiscoverable and breaks the mental model thatcb serve+ viewer work together.Current Behavior
cb serve --block cortexstarts API on port 8321 — serves cortex entities correctlynpm run devin viewer/ — reads files from disk, ignores the APIThe viewer has two disconnected data paths:
entity-loader.ts(build-time)cb serveAPI at runtime (correct)Acceptance Criteria
cb serveAPI at runtime, not from disk at build timecb serve --block my-block+ opening the viewer shows that block's data automaticallyCB_OUTPUT_DIRenv var needed for the standard workflowOut of Scope
cb serveworks (API is fine)