Repository navigation
Phase 4c: upstream-status --measure - #1937
Merged
neuromechanist merged 13 commits intoOct 24, 2026
Merged
neuromechanist merged 13 commits into
neuromechanist merged 13 commits into
Conversation
Pure summarizeSnapshotDelta over two OpenNeuro file listings: added, changed (by id), deleted, annexed counts, new keys and bytes to copy (null when a size is unknown). Tested on two recorded listings.
estimateRepullDoiVolume over the upstream snapshot lists: catch-up, per snapshot, at most one per 30 days, busiest day, a doubled upper bound for N.0.1 patches. Unreadable dates are counted, not dropped. Tested on the recorded lists.
fetchSnapshotFilePair reads two OpenNeuro snapshots' recursive file listings in one request, on the administrator's machine. Any failure is an error result, never an empty listing. Tested against a stand-in serving two recorded listings.
Reads OpenNeuro file listings from the administrator's machine for each stale mirror, totals the deltas and the DOI volume, and exits 2 when a delta could not be read. Unknown is null with an at-least sum, never zero. Tested through the spawned CLI against a stand-in serving two recorded listings.
Amendment for the measurement: what it measures, the DOI volume estimate, its two limits, and that the conflict and unexplained counts belong to the Phase 5 plan. Docs only.
Read key sizes with the strict field parser, count future-dated snapshots, and name the import by date, keeping every snapshot of a dataset with an unreadable date. Tested, including mutations.
An empty listing, one without a root dataset_description.json, data beside errors, a bad size or a repeated filename now fails the pair instead of becoming a delta. One malformed-entry case per field. Tested, including mutations.
Totals carry the pass scope, a not_comparable breakdown and a complete flag; the DOI block lists what it left out; reading stops after five consecutive failures with a progress line every ten; sizes near a unit boundary are promoted. Tested.
A pass that threw, was refused, hit --max-pages, changed population or had unchecked rows is not measured: measurement is null with the reason. Help text and header comments corrected. Tested through the spawned CLI.
Records the listing refusals, the complete-pass rule, the not-comparable counts and scope, the stop after repeated failures, and the date handling. Docs only.
Help text for NEMAR_OPENNEURO_GRAPHQL_URL on upstream-status. Tested by running --help-all.
neuromechanist
force-pushed
the
feature/issue-1910-phase4c-measure
branch
from
October 24, 2026 16:37
ebd9935 to
032390e
Compare
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR1937Version: 🤖 Updated on each push. |
Not-comparable states, completeness with an unsized key, and the transport-only stop. Docs only.
not_comparable lists in_progress, parked and unpublished; only transport failures count toward the stop after five; no progress line after the stop; complete implies a known byte total. Tested, including mutations.
neuromechanist
merged commit Oct 24, 2026
403da20
into
feature/issue-1046-epic-upstream-freshness
14 checks 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
Adds
nemar admin upstream-status --measure(ADR 0111): for the stale mirrors the 4a route reports, it reads OpenNeuro's file listing at the recorded tag and at the latest tag and summarizes the delta (files added, changed, removed, annexed versus git, bytes to copy, metadata-only or data-changing), then estimates how many version DOIs a catch-up would mint at the 30-day pace (one to two per re-pull, the second only when NEMAR corrections replay as N.0.1) and how many days the open cap needs. An unread listing never counts as zero: the total bytes become null with the known sum beside it, the delta is reported as unknown, and the run exits 2; a deliberate--measure-limitleaves mirrorsnot_measuredand does not. A pass that failed part-way is not measured (exit 1,measurement: null). The conflict and unexplained counts that the design's second gate lists come from Phase 5'snemar admin repull plan, not from this measurement, so that gate cannot close in this phase.Phase 4c of epic #1046; closes the Phase 4 work in #1910 (the issue is closed by hand once this merges).
What is in it
shared/upstream-staleness.ts:summarizeSnapshotDeltaandestimateRepullDoiVolume, pure and unit-tested over recorded real OpenNeuro listings (test/fixtures/openneuro-snapshot-files/, with provenance).src/lib/openneuro.tsfetchSnapshotFilePair(typed result, no throw),src/lib/upstream-measure.ts(orchestration, totals, rendering),src/commands/admin-upstream-status.ts(--measure,--measure-limit,NEMAR_OPENNEURO_GRAPHQL_URLoverride).Test plan
--measure-limitbound the run).