Repository navigation
Phase 4: fix contract drift (getCurrentUser, version prefix) (#899) - #939
Merged
neuromechanist merged 2 commits intoJul 6, 2026
Merged
neuromechanist merged 2 commits into
neuromechanist merged 2 commits into
Conversation
Epic #896 Phase 4 (#899). Applies the #898 contract to the known drift. - getCurrentUser() unwraps the {user, token} envelope (.user) and validates against userMeResponseSchema. It previously declared flat UserInfo and read the envelope top level, so every field was undefined at runtime -- silently writing undefined over stored account config on 'auth status --refresh' and disabling the upload ORCID auto-match. Consumers coerce nullable username/ github_username -> undefined for config. - Catalog latest_version is emitted in the canonical vX.Y.Z tag form (withCanonicalLatestVersion) at the list/fallback/detail responses, matching the data plane + what hallu-sync's archives/<v>.zip URLs need. Fixes the website vv1.0.0 double-prefix (website PR nemarOrg/website#145 coerces too). - file_size (#895): the compute is already annex-aware (getDatasetS3Stats sums real S3 object sizes); the ~36B symptom is stale legacy folded rows -> fixed by an operational reindex backfill at finalize, no code change. - /datasets/:id parity (#864) is backend-complete (#853); website backfillSearchHit removal tracked separately.
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR939Version: 🤖 Updated on each push. |
- Live contract test now asserts the RAW catalog latest_version is the canonical tag via the non-coercing strictVersionTagSchema, so a dropped withCanonicalLatestVersion call site fails CI (the coercing envelope schema couldn't catch that). - Added a getCurrentUser() live-integration test that calls the function and asserts flat access (config dir is isolated by setup.ts). - Removed the now-dead UserInfo interface and a redundant cast at the detail return. - Cross-repo: nemarDatasets/.github#61 normalizes the Hallu zarr-queue version comparison so #899's tagged latest_version doesn't re-drain the queue.
Contributor
Author
Review (sonnet) — findings addressed in 08a6a01
|
neuromechanist
merged commit Jul 6, 2026
019e8ed
into
feature/issue-896-epic-arch-hardening
1 check passed
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
Applies the #898 contract to the known live drift.
getCurrentUser()now unwraps the nested{user, token}envelope (.user) and validates againstuserMeResponseSchema. It previously declared flatUserInfoandrequest<UserInfo>'d the envelope, so every field (.username,.role,.orcid, ...) wasundefinedat runtime — silently writingundefinedover stored account config onauth status --refreshand disabling the upload ORCID auto-match. Consumers coerce nullableusername/github_username->undefined.latest_versionis emitted in the canonicalvX.Y.Ztag form (withCanonicalLatestVersion) at the list/fallback/detail responses — matching the data plane and whathallu-sync'sarchives/<v>.zipURLs need. Fixes the websitevv1.0.0double-prefix (companion coercion: Fix vv1.0.0: coerce dataset version prefix website#145, deploy-order-safe).Scope notes
file_size(Catalog file_size ignores git-annex content: annexed datasets report ~36 B (should sum resolved/manifest sizes) #895): the compute is already annex-aware (getDatasetS3Statssums real S3 object sizes;dataset-metadata-columns.ts:155). The~36 Bsymptom is stale legacy folded catalog rows — fixed by an operational reindex backfill at epic finalize, no code change./datasets/:idparity (Release: detail-endpoint parity + channel/montage classification #864): already backend-complete (/datasets/:id detail endpoint returns participants + latest_version as null #853 addedparticipants+latest_version); the websitebackfillSearchHitworkaround removal is a separate cleanup.Test plan
backend/test/catalog-version-normalize.test.ts(bare->tag, idempotent, null-safe, field-preserving).userMeResponseSchemaunit test (rejects the flat shape) +tsc(return type + consumer coercion) + the live contract test.tsc(root+backend) + Biome clean.Closes #899. Part of epic #896.