Repository navigation
Phase 2: serve GET /<id>/<version>/records.json (#615) - #706
Merged
neuromechanist merged 2 commits intoJun 5, 2026
Merged
neuromechanist merged 2 commits into
neuromechanist merged 2 commits into
Conversation
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.
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.
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR706Version: 🤖 Updated on each push. |
neuromechanist
merged commit Jun 5, 2026
8d2aeb5
into
feature/issue-615-epic-records-json
1 check passed
This was referenced Jun 5, 2026
neuromechanist
added a commit
that referenced
this pull request
Jun 5, 2026
* Phase 2: serve GET /<id>/<version>/records.json (#615) (#706) * 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. * refactor: make bytes_url host-invariant (canonical data.nemar.org) 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).
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
Closes the serving loop for records.json (epic #615 P2). The Tier-1 emitter (.github#32) produces records.json but nothing served it; this adds the route, mirroring the summary.json sibling (#559).
<id>/version/v<X>-records.jsonsnapshot verbatim, s-maxage=86400; missing -> 404 no-store; S3 error -> uncached 500. Registered before the /:id/:version(/*) catch-alls.Coupled follow-up (separate PR to .github main, under #701): un-gate generate-records.yml S3 upload. Committed .nemar/records.json is a deferred dedicated change.
Closes #701
Part of epic #615
Test plan