Skip to content

Extend summary.json schema: embed README content (schema_version 1.1) #616

Closed

Description

@neuromechanist

Motivation

Today's summary.json (schema_version: 1.0) carries readme: { path: \"README.md\" } — a pointer, not the content. The website's readme partial (`nemarOrg/website/src/pages/api/dataset/[id]/readme.ts`) therefore has to fetch `raw.githubusercontent.com///main/README.md` on every cold render. That GitHub round-trip is the dominant first-paint latency on the dataset detail page for low-bandwidth users.

Companion issue: nemarOrg/website#63 (consumer side — switch to inline content when available).

Proposal

Bump schema to 1.1. Add readme.content (and optionally readme.html) inline:

{
  \"schema_version\": \"1.1\",
  \"dataset_id\": \"on005505\",
  \"version\": \"1.0.0\",
  ...
  \"readme\": {
    \"path\": \"README.md\",
    \"content\": \"# Healthy Brain Network ...\\n\\nThe HBN EEG Release 1 dataset...\",
    \"content_bytes\": 4827,
    \"sha256\": \"abc123...\",
    \"truncated\": false
  }
}

Design constraints:

  • Inline only if small. Cap at e.g. 256 KB; over that, set truncated: true and leave content null. Today's typical README is < 20 KB, so this is rarely triggered.
  • Raw markdown, not HTML. Keeps the generator simple and avoids re-rendering when the markdown renderer changes.
  • Optional content_html as a follow-up if we ever ship a pre-rendered variant.
  • Back-compat. Consumers that only read readme.path (schema 1.0) keep working. The website falls back to GitHub raw when content is null/absent.

Implementation

Generator lives at nemarDatasets/.github (per #564). The git-tree walk in scripts/emit_manifest.py already has the file blobs in hand; reading the README is one extra git cat-file (or equivalent S3 fetch if the README is annexed — for nm* datasets we'd need to dereference; for on* the README is in plain git).

Tasks:

  1. Generator: read README blob, embed in summary.json under readme.content. Skip annexed READMEs (set truncated: true).
  2. Bump schema_version to 1.1 and update the documented shape in Generate + serve compact summary.json alongside manifest.json (small artifact for path-only views) #558.
  3. Backfill: re-run workflow_dispatch generate-manifest for every published version. This re-publishes summary.json with the new schema in place.
  4. Update the local test fixture so unit tests for summary parsing cover both 1.0 and 1.1.

Acceptance

  • summary.json v1.1 written by every new publish, includes inline readme.content for non-annexed READMEs
  • Backfill of all 123 published on*+nm* datasets complete
  • Website consuming inline content (Eliminate per-pageload GitHub roundtrip for README website#63) renders README without GitHub round-trip
  • Schema 1.0 consumers still parse 1.1 (additive change only)

Backfill prerequisite (this ticket)

Three on* datasets are confirmed missing summary.json at their latest version and need a regular generator run regardless of the schema bump: on002718, on004022, on007181 (HTTP 404 on data.nemar.org/<id>/v1.0.0/summary.json as of 2026-05-26). Several nm* may also be gaps; could not be confirmed under rate limit.

Related

Activity

  1. added
    enhancement
    on May 26, 2026
  2. neuromechanist commented on May 27, 2026

    @neuromechanist
    ContributorAuthor

    Acceptance verification (post-backfill, 2026-05-26)

    This issue was auto-closed by an earlier referencing PR; documenting the full verification here for the record.

    Bullet Status
    Every new publish writes summary.json schema_version 1.1 with readme.content for non-annexed ✓ shipped via nemarDatasets/.github#15
    Backfill of all currently-published versions ✓ done — staged on* (53) then nm* (77); 130/130 at 1.1
    Website consuming inline content (nemarOrg/website#63) renders README without GitHub round-trip Handed off — see comment on website#63
    Schema 1.0 consumers still parse 1.1 (additive change only) ✓ — readme.path unchanged; new fields additive
    $ nemar admin summary check --json | jq '.totals'
    { "versions": 130, "ok": 130, "stale": 0, "missing": 0, "error": 0 }
    

    Sample sanity (random nm + on):

    Companion epic #618 also closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions