Repository navigation
Description
Symptom
Cold dataset detail pages on ww2.nemar.org block on a synchronous fetch to raw.githubusercontent.com/<org>/<id>/main/README.md whenever summary.json doesn't carry the README inline. From low-bandwidth connections this is the dominant first-paint latency for the description panel.
Reproduction with on005505:
summary.jsonis present (428 KB) and includesreadme: { path: "README.md" }onlyreadme.tsstep 1 fast path resolves the path, then firesfetchGithubReadme()for the actual content- On a cold Pages isolate, that GitHub round-trip is the main wall-clock cost
Root cause (design)
src/pages/api/dataset/[id]/readme.ts (current code) resolves in this order:
- summary fast path → reads
summary.readme.path, then fetches GitHub raw for content - manifest README via presigned URL
- GitHub raw without summary signal
- BIDS dataset_description
All four steps either roundtrip GitHub or download a multi-MB manifest. There is no path where the README content is served from a pre-rendered artifact on data.nemar.org. Every visitor pays the round-trip the first time the response isn't in the local edge cache.
Proposal
Stop fetching GitHub at request time. Have the website's readme partial read the README content directly from summary.json once the generator publishes it there (see companion issue on nemarOrg/nemar-cli).
Website-side change (this issue)
- Add
readme.content(raw markdown) and optionallyreadme.html(server-rendered) to the consumer types insrc/lib/data-api.ts. - In
readme.ts:- If
summary.readme.contentis present, render markdown and return immediately. No GitHub call, no manifest fetch. - Keep current fallbacks intact for older summary.json files (schema_version 1.0) so deployment is decoupled from backfill.
- If
- Optional: if generator ships
readme.html, skip markdown render entirely in the worker.
Acceptance
-
/api/dataset/<id>/readme?v=<v>returns README HTML in < 200 ms on a cold isolate whensummary.jsoncarriesreadme.content - Zero outbound fetches to
raw.githubusercontent.comin the README hot path under flag-on conditions - Fallback to GitHub raw still works for legacy schema_version 1.0 summaries
- CI green; design-review verifies no visible change
Related
- Companion: nemarOrg/nemar-cli#XXX (extend summary.json schema with embedded README content)
- Closed: Use compact summary.json instead of full manifest.json for dataset detail page #29 (introduced summary.json fast path), fix(api): don't cache failure-fallback HTML on tree/readme partials #53 (cache poisoning fix)
- Builds on Dashboard omits collaborated datasets (nm000974) and Collaborators button redirects to 404 on private datasets #559 epic deliverable (
summary.jsongenerator)
Activity
review(#63): address pr-review-toolkit findings
Merge pull request #68 from nemarOrg/feature/issue-63-readme-inline-f…
neuromechanist commentedon May 27, 2026
Backend side is live and backfilled — schema 1.1 with embedded
readme.contentis now present for all 130 published versions ondata.nemar.org. nemarOrg/nemar-cli#616 closed.Quick verification:
Whenever you're ready, this issue's consumer change can land. The fast path:
For consumers that want everything in one shot (also live now): nemarOrg/nemar-cli#617 shipped
GET /<id>/page-bundle.json?v=<v>returning landing + metadata + summary + catalog in a single SSR fetch. Docs atdocs/reference/data-api.md. Use it if you want to collapse the cold-load waterfall to 1 RTT — the bundle'ssummary.data.readme.contentis the same field as the standalone summary's.Follow-ups filed and intentionally non-blocking:
kind: "corrupt"for invalid summary.json JSON nemar-cli#631, Quality inventory copy and state model #632, Data quality tab drawn from the inventory #633 (observability + DRY refactor)