Repository navigation
Epic: summary.json schema 1.1 + page-bundle (dataset detail perf) - #625
Conversation
* feat(admin): summary.json coverage report + backfill dispatch Phase 2 of epic #618. Backend: - new service backend/src/services/manifest-coverage.ts walks dataset_versions, probes data.nemar.org/<id>/<v>/summary.json for each, and classifies as ok/stale/missing/error against the target schema (currently 1.1). Bounded parallelism (8) protects the upstream rate limit. - new admin route GET /admin/summary/coverage returns the report. - new admin route POST /admin/manifest/dispatch fires repository_dispatch[generate-manifest] for a single version with skip_callback=true so the worker doesn't need a seeded manifest_jobs row. - triggerManifestGeneration() extended with skipCallback option. CLI: - new `nemar admin summary check [--fix] [--id <id>] [--only-stale] [--json]` walks the coverage report, prints a colored table or emits JSON, and with --fix dispatches generate-manifest for every stale or missing version (throttled 1.5s). - new typed api helpers getSummaryCoverage + dispatchManifest. Cron: - .github/workflows/check-summary-drift.yml runs weekly (Mon 09:00 UTC), opens or updates a drift issue when coverage is not clean. Tests: - 10 unit tests for schema-comparison + URL normalisation logic. Closes #620 (phase 2 of #618). * review(#623): drift cron resilience, labels, abort wiring, comments
* feat(data): page-bundle endpoint for one-RTT dataset detail SSR Phase 3 of epic #618 / Closes #621. New `GET /<id>/page-bundle.json?v=<v>` returns landing + enriched metadata + summary + catalog row in one JSON response so the website can render the dataset detail page in a single SSR fetch instead of its current 4-parallel-SSR + 2-deferred-client waterfall. Internals: - backend/src/services/page-bundle.ts owns the fan-in. Each upstream is wrapped in Promise.allSettled and surfaces as a tagged union ({ok: true, data} | {ok: false, error}) so a single failure doesn't blank the whole bundle. - bundle.complete drives the cache header: success path gets long s-maxage + SWR, partial-failure path gets no-store so a transient blip isn't pinned at the edge for 24h. - Skips the latestManifest read (multi-MB) — the website renders the tree progressively from summary.paths per nemarOrg/website#64, so metadata.bids_index would be unused work here. - pickVersion falls back to landing.latest when the requested version is missing or unknown rather than 404-ing the whole bundle; the consumer can render a 'version not found, showing latest' UI from the bundle's own data. Route is registered before /:datasetId/:version so Hono doesn't treat 'page-bundle.json' as a version param. Mirrors the metadata.json registration order. Tests: 10 new unit tests for the pure helpers (pickVersion + settled). Per project policy, no D1/S3 mocks for the full buildPageBundle — end-to-end coverage is via the post-deploy smoke against a real dataset. * review(#624): hard-fail D1, extract isBundleComplete, enrichment_degraded
… no-store coverage, P1 cron escalation, route registration test)
|
Cross-phase Fixed inline:
Deferred as follow-up issues (real but out of scope for this perf-focused epic):
Tests: 34 unit tests passing across 3 files (was 30 → +4). Backend typecheck clean. Phase reviews + this cross-phase review all addressed. CI pending on this push. |
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR625Version: 🤖 Updated on each push. |
Summary
Cut cold dataset-detail latency on ww2.nemar.org by (a) embedding README content in
summary.jsonso the website stops roundtripping GitHub for every page, (b) adding tooling to backfill + monitor schema drift across all published versions, and (c) introducing a singlepage-bundle.jsonendpoint that returns landing + metadata + summary + catalog in one response so the website's cold-load waterfall collapses to one RTT.Closes #618 (epic). Sub-issues #619, #620, #621 closed by their squash-merges.
Phases
readme.contentnemarDatasets/.githubnemarOrg/nemar-cli/page-bundle.jsonendpointnemarOrg/nemar-cliCompanion website work runs in parallel on a separate agent: nemarOrg/website#63 (consume inline README), #64 (progressive tree), #65 (cache invalidation).
What ships in this PR
GET /admin/summary/coverage,POST /admin/manifest/dispatch), one new public route (GET /<id>/page-bundle.json?v=<v>), one new service (manifest-coverage.ts+page-bundle.ts),triggerManifestGenerationextended withskipCallbackoption.nemar admin summary check [--fix] [--id <id>] [--only-stale] [--json]..github/workflows/check-summary-drift.yml(weekly Mon 09:00 UTC, opens or updates an issue when drift is detected; opens a separate P1 issue if the coverage probe itself is broken).Schema 1.1 contract
summary.jsonnow shipsschema_version: "1.1"withreadme.content(raw markdown) for non-annexed READMEs up to 256 KB. Annexed, oversize, binary, and unreadable READMEs shiptruncated: true, content: nullso consumers fall back. Schema 1.0 readers that consumereadme.pathkeep working; strict-equality consumers will see a shape change.Post-merge plan
deploy-backend.ymlon merge to dev → main).nemar admin summary check --jsonagainst prod to confirmversions: ~150, ok: 0, stale: ~120, missing: ~30(every existing version is schema 1.0 today).nemar admin summary check --fix --yesto backfill — workflow runs queue onnemarDatasets/.githubrunner pool, ~4 min throttled.nemar admin summary checkagain to confirm zero drift./<id>/page-bundle.json?v=v1.0.0against a known-healthy on* dataset to confirmcomplete: trueand the README embedded insidesummary.readme.content.Test plan
python3 scripts/test_emit_manifest.py)bun test test/manifest-coverage.unit.test.ts)bun test test/page-bundle.unit.test.ts)/pr-review-toolkit:review-prwith 4 agents (code, tests, errors, comments); findings addressed before merge/review-pragainst this epic PR (per project memoryfeedback_cross_phase_review)Merge strategy
Regular merge (
gh pr merge --merge), not squash — preserves the 3 phase commits per project convention (MEMORY.mdGit Merge Rules).