Repository navigation
records.json serving (epic #615): data plane route - #707
Merged
Merged
Conversation
* feat: serve GET /<id>/<version>/records.json (#615) Adds the records.json serving route, mirroring the summary.json sibling (#559). New recordsJsonHandler in data.ts serves the S3 <id>/version/v<X>-records.json snapshot verbatim with s-maxage=86400; missing -> 404 no-store (no negative caching, so a freshly-published snapshot appears next request); S3 error -> uncached 500. s3.ts: factor loadSummary's fetch/fallback into a shared loadVersionJson + add loadRecords (behaviour-identical for summary); extract a pure, exported versionArtifactKey for the S3 key contract. Route registered right after summary.json, before the /:id/:version(/*) catch-alls. Tests (no mocks): route registration + ordering + invalid-id 404 + static-passthrough source check + versionArtifactKey unit cases. Closes #701. Part of epic #615. * review: no-store on 500 + headVersionArtifact reuses versionArtifactKey Addresses PR #706 review (both reviewers): (1) the 500 branches in records + summary handlers now set Cache-Control: no-store, matching the comment's stated intent (a transient S3 failure must not be CDN-pinned); (2) headVersionArtifact uses the shared versionArtifactKey and its suffix type widens to include '-records', so the key formula has a single authority and a future records-ready HEAD check type-checks.
Cross-phase review (epic #615 finalization) found the served manifest's bytes_url was request-relative (api.nemar.org/data/... off the canonical host) while the raw S3 manifest (emit_manifest.py) hardcodes data.nemar.org -- they disagreed off data.nemar.org. bytes_url is a stable, storable contract URL, so it must be host-invariant: hardcode the canonical data.nemar.org for annex files and drop the request-relative dataPlaneBaseUrl entirely (buildBytesUrl no longer takes a base or the request URL; manifestJsonHandler drops the reqUrl param). data.nemar.org is the public host, reachable from anywhere, so the URL resolves regardless of how the manifest was fetched; this now matches the raw S3 manifest in lockstep. Tests updated (dataPlaneBaseUrl tests removed; host-invariance asserted).
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR707Version: 🤖 Updated on each push. |
This was referenced Jun 7, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings the nemar-cli side of the records.json epic (#615) to dev: the data plane route
GET /<id>/<version>/records.json(+loadRecords/versionArtifactKeyin s3.ts), serving the per-version S3 snapshot.The records EMITTER, Tier-2 duration fill, and raw-manifest bytes_url all live in nemarDatasets/.github (P1 #32, P3 #34, P5 #35, all merged to .github main); this PR is the nemar-cli serving half (P2 #706).
Phases (epic #615)
Part of epic #615 (kept open: P4 upstream + P6 backfill remain). Merging to dev deploys the route to the dev environment; dev->main is the prod gate per the release flow.
Test plan