Skip to content

docs: finish the nemar-cli pointers for re-pulls (8d) - #1982

Merged
neuromechanist merged 20 commits into
feature/issue-1046-epic-upstream-freshnessfrom
feature/issue-1046-phase8d
Oct 27, 2026
Merged

neuromechanist merged 20 commits into
feature/issue-1046-epic-upstream-freshnessfrom
feature/issue-1046-phase8d

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Phase 8d of epic #1046 (issue #1914) is the nemar-cli half of Phase 8: the AGENTS.md pointers, the ADR 0111 final amendment, the two index lines, the changelog and one typed contract field. It changes no Worker behavior.

Order and release

This PR merges into the epic branch feature/issue-1046-epic-upstream-freshness only, and reaches production with the release of the epic (R1). Its base is c4d19950, the epic head after the dev sync (#1981); git merge-base --is-ancestor origin/dev origin/feature/issue-1046-epic-upstream-freshness exited 0 before I started.

The docs it points at were merged ahead of the release (nemarOrg/docs#90 and #92, both 2026-10-27T09:00Z), so every link in this PR resolves now, and until the release is deployed those pages describe commands and a field the deployed API lacks (https://api.nemar.org/health answered 0.10.25 at 2026-10-27T12:40Z). The ADR amendment states the rule and records that dated fact in one sentence.

Commits

  1. 8c74d1ae docs: finish the AGENTS.md pointers for re-pulls. The ADR 0111 entry is replaced by its final state, the new hard rule "The re-pull switches and caps are the owner's" is added (AGENTS.md:327), and the public and gated table rows are added. The ADR 0093 entry already carries the narrowing for the App's re-pull pull requests (AGENTS.md:168-182), so it is unchanged.
  2. 8b4f55ca docs: link the upstream design from the index. The design-upstream-repull.md row of .context/README.md names ADR 0111 as the verdict and the three runbooks, and keeps public. Line 139 of the design record (line 140 at the head, after the two pointers round 1 added above it) said a tag missing from the GitHub mirror is "transient and retried"; it now says it parks after 14 days with one admin issue and no mail, as ADR 0111's amendment of 2026-10-24 says and the code does: backend/src/services/import-retry.ts:47 sets the 14-day window and :152-157 parks a still-refused lag as mirror_lag, import-recovery.ts:149 sends no mail for it, and import-failure-issue.ts:105 files one issue when it parks.
  3. c95db38e docs: record Phase 8 in ADR 0111. Amendment 2026-10-27 (Phase 8: Docs and website contract #1914), now lines 2099-2224 of the ADR, the end of the file: page paths, the mirror field contract, the order the pieces reach production, the workflow pairs, the relation on a re-pull's DOI, what is not yet verified, and two items left open for the owner. Three dated annotations (header, opening of the Decision section, decision 5) and the rewritten index line in .context/decisions/README.md. No decision text is changed.
  4. ea8cf5d7 docs: consolidate the re-pull changelog. The Unreleased block held only Phase 3's bullets (git log -- CHANGELOG.md shows no other phase touched it), so Phases 2, 4, 5, 6, 7 and 8 are added, and the sections are Changed per phase, Production behavior changes, Deploy coupling, Owner steps after release and Known limits. The first pass dropped some facts of the old bullets; round 1 restored them (S4).
  5. 9004e10a feat: type the mirror flag in the contract. dataPlaneVersionListingSchema takes mirror as an optional boolean that may be null and still passes every other key through; test/data-plane-mirror-contract.test.ts serves the real landing route over real SQLite and reads it with the CLI's reader.

Round 1 added nine commits on top of these five (Round 1 fixes), db1ef687 and cfcd4462 correct the copy-pinning claim (C3 and C4), and round 2 added four more (Round 2 fixes). That is 20 commits since the epic head c4d19950; the branch head is a8dac724, and git diff --stat c4d19950 a8dac724 shows 10 files changed, 487 insertions and 32 deletions.

Verification results this PR relies on

Where the source is another pull request's body, I did not run the check again; I say so.

  • V1 (version rule): confirmed. nemarOrg/docs#90 checked src/lib/repull/preflight.ts versionCheck, shared/repull-state.ts and mirrorFlagOf; I read shared/source-snapshot.ts:248-273 and ADR 0111 decisions 1 and 5.
  • V2 (the eleven states, exit codes of upstream-status): confirmed in nemarOrg/docs#92 (shared/upstream-staleness.ts, src/commands/admin-upstream-status.ts); I read the ADR's Phase 4a and 4b amendments and bun src/index.ts admin upstream-status --help, not the code.
  • V3 (manual-major refusal): confirmed. I read src/lib/version-policy.ts:17-40, src/commands/dataset.ts:3481-3496 (exit 1 after "Nothing was changed"), its two call sites at dataset.ts:3098 and :3784, and test/dataset-release-mirror-major.test.ts:24-63,189-205,250-277; nemarOrg/docs#90 ran that file with test/source-snapshot.unit.test.ts (47 pass, exit 0). The full run below includes it.
  • V4 (the mirror field): confirmed. I read backend/src/services/data-router.ts:1746-1759,1798-1808, shared/source-snapshot.ts:259-273 and backend/src/routes/datasets/manifests.ts:109-199, and ran backend/test/landing-mirror-flag.test.ts, backend/test/page-bundle-mirror-flag.test.ts, test/http-download.unit.test.ts and the new test together: 50 pass, exit 0. One correction: the versions route is open to the owner, collaborators and administrators (manifests.ts:109,132-141), not owner-or-admin as the Phase 4b amendment said; the amendment says so.
  • V5 (the App's re-pull class admitted to the review), V6 (screen states, callback, no mail) and V7 (--mirror): confirmed in nemarOrg/docs#92; I read ADR 0111's Phase 7e, 6e and 6g amendments but did not re-read their code.
  • V9 (which relation a re-pull's DOI carries): not settled by the code. I read backend/src/services/datacite.ts (SourceDatasets to IsDerivedFrom at 1496-1503, enrichment's related identifiers at 697-718 and 1471-1477, de-duplication by identifier and relation at 1461), src/lib/import-openneuro.ts:976-983 (seeds IsIdenticalTo), src/lib/repull/description.ts:8-9 and src/lib/repull/execute/materialize.ts:76-107,465-478 (a re-pull rewrites both to the new tag's DOI). DataCite's live record for 10.82901/nemar.on005506.v1.0.0, read 2026-10-27, lists IsIdenticalTo 10.18112/openneuro.ds005506.v1.0.1 and no IsDerivedFrom. The amendment records the finding and states no relation as fact until the first real N.0.0 DOI exists.
  • V10 (switches and caps): confirmed. The file is backend/src/services/repull-switches.ts, not upstream-repull-switches.ts as the brief says: a switch is on only as "1" and only in exact production (lines 13, 43-59), the defaults are 2 and 5 (36, 38), a cap is 0 to 20 and anything else reads 0 as unreadable (40, 67-74). backend/wrangler-sccn.toml is the deployed configuration; its [vars] is at line 241 and [env.dev.vars] at 594, and the four names appear only in comments (388-393, 700). The one other wrangler file, backend/scripts/mcp-smoke.wrangler.toml, is a throwaway config for the MCP smoke script that its own header (lines 1-6) says is never deployed; backend/scripts/mcp-smoke.sh:43 is its only user, and it holds none of the four names. The test below reads only the first file (repull-switches-flag.test.ts:26-28). backend/test/repull-switches-flag.test.ts:64-66 pins that no table of the file holds one; its header (lines 15-17) says a Worker secret of the same name is not covered, which the new hard rule repeats.
  • V12 and V13 (commands, flags, exit codes): I ran --help for admin repull plan|execute|status|resume|merge|abandon|auto, admin upstream-status and admin upstream-backfill on this branch; exit codes are from the ADR and nemarOrg/docs#92 (V13).
  • V14 (states): shared/repull-state.ts:12-30 lists 17. V15 (--tag, 14-day park): backend/src/services/import-retry.ts:47,152-157, import-recovery.ts:149, import-failure-issue.ts:105. V16 (canary): scripts/repull-canary.ts exists and is a script, not a subcommand. V17 (cron): backend/wrangler-sccn.toml:137 has 0 3 * * * and */30 * * * *, and backend/src/index.ts calls the advance tick, the dispatch watchdog and the scheduler. V18 (backfill): --help.
  • The documentation paths: platform/doi-and-versioning, platform/data-api, admin/operations/upstream-freshness, upstream-repull and upstream-repull-automatic all exist on nemarOrg/docs main (gh api repos/nemarOrg/docs/contents/..., 2026-10-27). The anchors #versions-of-an-openneuro-mirror (heading at line 66) and #the-mirror-flag (an h4 at line 350) exist; nemarOrg/docs#90 checked both in the built HTML. The gated pages answer an anonymous request with the sign-in redirect.
  • The website: Drive the mirror chip from the API's mirror flag website#489 (merged to staging) keeps the vN.0.0 fallback and follows mirror === true once any version carries the key; its ordering note is the source of the rule that the website is promoted after the backfill.

Not confirmed, and what I cut

  • Production behavior of the field and of the new commands: the release is not deployed. Nothing I wrote states it as current behavior; the changelog's "Production behavior changes" describes the release.
  • The relation names on a real N.0.0 DOI (gate G4). Cut: no relation is stated as fact in the ADR, the changelog or AGENTS.md.
  • The plan's risk list asks for a grep of the OSA assistant prompt at 8d time. I did not read the OSA repository. In this repository the words mirror, versions[], re-pull and repull appear only in implementation, tests, ADRs and docs, and backend/src/mcp has no tool that exposes the flag.
  • I did not claim that docs#90 and docs#92 were merged with the owner's agreement; the ADR says only that they were merged before the release.
  • The docs repository carries the sentence round 1 removed here, that the dry-run plan "compares trees and sees" a tag re-created under the same name (admin/operations/upstream-freshness.md line 262 and admin/operations/upstream-repull.md line 566 at docs b3b07315). I did not edit the docs repository; D1 below states the scope the code supports, for whoever corrects those two sentences.

Differences from the brief and the plan

  • The switches file is repull-switches.ts (see V10).
  • The plan's "correction at design-upstream-repull.md:139" is the Phase 4 plan's: its phrase is "Tags compare numerically" (plans/phase4.md lines 25 and 497), to be replaced by creation order. Phase 4a (80cb1190) already made that fix, in the staleness predicate bullet that was line 140 at 9004e10a ("Order is upstream's CREATION order, not the tag's number"). Line 139 is a different, still-stale sentence, and I changed it on the evidence of the code, not of the plan: it said a tag missing from the GitHub mirror is "transient and retried", and the code parks it after 14 days (see commit 2).
  • The header "Decisions 4 and 10 are built" paragraph of ADR 0111 is left as written and a dated annotation line is appended, as the file does for every earlier phase.
  • docs-links.unit.test.ts resolves a sibling docs checkout; the one at ../../docs has an origin/main of 2026-10-14, so it reports the three new gated links as missing (14 pass, 3 skip, 1 fail). CI supplies a fresh checkout (NEMAR_DOCS_CHECKOUT, .github/workflows/test.yml:1044), and I ran with a fresh clone of nemarOrg/docs main (b3b07315): 18 pass.

Noticed, not changed

  • .github/dataset-workflows/run-upstream-repull.yml:5-9 still says it is held until the epic ships, though nemarDatasets/.github#148 is merged. The two copies are compared byte for byte, so changing the header means changing both.
  • The import's warning in src/lib/import-openneuro.ts (line 1480 at 9004e10a, 1481 now) said "ADR 0111 decision 8 is not built", true of the import's copy and not of a re-pull's; fixed in round 1 (0e347953) and its wording corrected afterwards (C3 and C4).

Gates

  • At the first push, 9004e10a: bun run typecheck exit 0, bun run lint exit 0 (174 files), bun test test/adr-index.unit.test.ts exit 0, 8 pass, 0 fail.
  • Root bun test, once, before the first push, on a tree that differs from 9004e10a only by the two wording fixes described below, with NEMAR_DOCS_CHECKOUT pointing at a fresh clone of nemarOrg/docs main (b3b07315): exit 1, 21923 pass, 242 skip, 4 fail, 22169 tests in 859 files, 2981.74 s. None of the four failures touches this PR, and each passes when run on its own or against what CI compares:
    • Two in test/data-host-cli.test.ts and one in test/repull-release-cli.test.ts are one Bun v1.4.3 fault: a spawned bun run src/index.ts ... died at start with panic(main thread): Trap instruction at address 0x18E502C58 (1 ms in; the repull-release-cli case exited 133, a trap signal). In the first file the crash reporter's call to bun.report:443 also trips that file's network spy, which is the second failure. Run alone: test/data-host-cli.test.ts 14 pass, 0 fail; test/repull-release-cli.test.ts 11 pass, 0 fail.
    • One in test/account-copy-parity.test.ts: the sibling website checkout at ../../website is on a feature branch from 2026-10-12, so three upload_access.* strings differ. CI compares the website's staging (.github/workflows/test.yml:941-950, ref: staging); against staging's src/lib/account-copy.ts the file passes (9 pass, 0 fail).
  • After that run I folded two small fixes into their commits (autosquash, before the push): one ADR sentence about which version to compare with https://api.nemar.org/health, and labelled to labeled in a test comment. Those are the only differences between the tested tree and the pushed one: one sentence in the ADR amendment's "The order the pieces reach production" and one word in a test comment. At 9004e10a, test/adr-index.unit.test.ts, test/docs-links.unit.test.ts (fresh docs checkout), test/changelog-format.unit.test.ts, test/data-plane-mirror-contract.test.ts, test/ci-tier-routing.unit.test.ts and test/http-download.unit.test.ts ran together: 149 pass, 0 fail, exit 0. Commit 5's message was then corrected to count eight mutations; its tree is unchanged.
  • Mutation log for commit 5, each a change to one line or one call of production code, run, and reverted (git status clean after): deleting the mirror declaration fails 2 tests; dropping .nullable() fails 4; dropping .optional() fails 2; widening to z.unknown() fails 1; widening to also accept numbers fails 1; dropping the entry's .passthrough() fails 1; mirrorFlagOf returning the tag instead of true fails 4; mirrorFlagOf returning undefined instead of null fails 2.

Round 1 fixes

Review round 1 reported on 9004e10a. The fixes are nine commits on top of it, pushed once, and I checked each item against the code before changing anything.

  • B1, fixed in 0d4c3f53: src/lib/repull/preflight.ts:157-158 refuses a tag equal to the mirrored tag as nothing-to-pull before any tree is compared. The changelog no longer says the plan "compares trees and sees it", and ADR 0111 has a dated annotation on that sentence. D1 below scopes the replacement claim, which was too strong.
  • B2, fixed in 4a942c61: the amendment's list now holds every item of the twelve passages of the earlier amendments that say what only the canary or a production run can check (read in the ADR), grouped by what shows them: the canary and the first copy, the first two re-pulls, the first unattended run, the first Worker merge, and the release with its first weeks. That adds the App's login, id and type, the leased push and the lock calls, the 204 and the runner's masking, the second release pull request and the N.0.1 tag, and the unstable state. The ADR index line and the changelog describe the same scope.
  • S1, S2 and S7, fixed in b99540cc: the metadata.json claim cites backend/src/services/data-router.ts (the extensions.nemar.versions mapping) and test/data-route.unit.test.ts:1337-1342, the fixtures are said to be in nemarOrg/website, the garbled "these last three" is gone with the regrouped list, decision 5's annotation says the chip is on the website's staging branch only, the sentence about the two docs pull requests keeps the dated fact and drops the status and the health-check procedure, and the changelog gains one deploy-coupling line for it.
  • S3, fixed in dcd673fe: the plan command prints "Plan file: " (src/lib/repull/render.ts:106), so the changelog says it prints the file's location and nothing of the dataset; "absent from the Worker's configuration" is now "absent from the wrangler configuration" in the changelog and the ADR index line.
  • S4, fixed in 033e04b6: the Phase 3 facts the first pass dropped are back (the audit row, the lag on a latest tag OpenNeuro cannot name, that git reset --soft drops .github/, and the rest), the epic cleanup (Epic cleanup: approved simplifications #1976) is named where the text describes it, and one bullet names what the two dev syncs (Sync the epic with dev and follow the App rename #1979, chore: sync dev into the epic #1981) carry: the App rename and the authenticated data host read (Read datasets held on an authenticated data host #1978, ADR 0114). The release has no other changelog entry for those two.
  • S5, fixed in b3c9c47c: one dated pointer to the amendment's DOI section on decision 2, on the Phase 7c gate G4 sentence, and in the design record at its release-path bullet (line 101) and its gate G4 (line 156).
  • C3 and C4, fixed in 0e347953 and corrected by db1ef687 and cfcd4462: the import's warning and its doc comment (src/lib/import-openneuro.ts:1281-1282 and :1481) say that the copy phase of an import takes the object currently at each upstream path and that a re-pull's copy pins the object version. The first holds because buildManifestItems (src/lib/import-openneuro.ts:1225-1246) keeps a bucket and a key through parseS3Url and no version, while the re-pull's copy passes ?versionId= (src/lib/repull/execute/copy.ts:12,167). 0e347953 wrote that ONLY a re-pull's copy pins, which was too strong: the separate content-recovery tool also copies a named object version (copySourceArgument, src/lib/content-recovery.ts:656-670). The two later commits drop "only" from the warning, the doc comment, the changelog line (CHANGELOG.md:32) and the test, which asserts the new wording and that "only a re-pull" is gone (test/import-prepare-pin.test.ts:234-237). The Phase 3 amendment's sentence has a dated annotation.
  • C1 and C2, fixed in 7414904b: null is for an N.0.0 of an OpenNeuro dataset only, and every other version, a NEMAR N.0.0 included, sends false (shared/source-snapshot.ts:267-272); the file header names the version listing's mirror as the one typed exception to passthrough.
  • S6, fixed in d6fa34a6: DOI, API, S3, BIDS, CLI, ADR and UTC are each spelled out once at their first use in the amendment and in the changelog's Unreleased block (the ADR never spells any of them out, and the changelog's older entries come after the block). The DOI section's heading carries the full name, so the four annotations that quote it were updated. D3 below adds the abbreviations this pass missed.
  • C5, rejected: the test spells out what fetchVersions does on purpose. fetchVersions calls getApiUrl(), which reads the live-tier variable (src/lib/api/client.ts:51-52), and scripts/ci/unit-pure-files.sh:24 moves any file that names it out of the required tier, so a live call would move the contract test to the live tier.
  • P1 and P2 are this body.

Round 1 gates at d6fa34a6: bun run typecheck exit 0; bun run lint exit 0; bun test test/adr-index.unit.test.ts test/data-plane-mirror-contract.test.ts exit 0, 16 pass, 0 fail; the 16 test files that import src/lib/import-openneuro.ts plus the tag-option, changelog format, docs links (fresh docs clone), tier routing and http-download tests, 21 files, exit 0, 519 pass, 1 skip, 0 fail. The full root suite was not run this round; the code changes are two comments, one console string and one assertion.

Round 2 fixes

Round 2 applies items D1 to D5. The branch head before the push was db1ef687; cfcd4462 (the follow-up that finishes the same copy-pinning fix) and the four commits below went up together in one push, a fast-forward to a8dac724.

  • D1, fixed in 48430112: B1's replacement sentence said nothing detects a tag re-created upstream under the same name. Two checks do part of it. A plan to the mirrored tag is refused as nothing-to-pull before upstream is cloned or compared (src/lib/repull/preflight.ts:157-158, src/lib/repull/plan.ts:278-294), so a mirror's recorded tag that upstream re-creates is not detected. A target tag re-created after a plan has read it is caught: assertUpstreamTag (src/lib/repull/execute/advance.ts:146-176) refuses with upstream-tag-moved before the copy (:364), the registration (:419) and the pull request (:453), and the record has to be ended with abandon and the dataset planned again. The ADR annotation after the Phase 4a known limit and the changelog's known limit now say exactly that.
  • D2, fixed in f16e4a30: two items are added to the amendment's list of what only a first run can show. The reading of gate G4 (the new major's DOI resolves and the previous version still serves, read by the owner before a switch is turned on) is in the first-two-re-pulls group (ADR line 2193, from the Phase 7c amendment). The first automatic run through the plan handoff and through the dispatch word list cut to 57 words is in the first-unattended-run group (line 2208, from the test plan of Epic cleanup: approved simplifications #1976 and the 2026-10-26 annotations at lines 1131 and 1747). The ADR index line and the changelog name the groups only, so their scope sentences still match.
  • D3, fixed in ee17c464 and a8dac724: continuous integration (CI), Amazon Web Services (AWS) and JavaScript Object Notation (JSON) are spelled out at first use in the amendment, and content delivery network (CDN), uniform resource locator (URL) and JSON in the changelog's Unreleased block; "screened SHA" now reads "screened commit", so no SHA is left to define. null is for an N.0.0 of an on dataset whose tag is unknown or not yet examined, and every other version sends false (shared/source-snapshot.ts:267-272); the changelog and the ADR index line now say so, as the contract comment and the amendment already did.
  • D4 is this body, rewritten: the head, the counts, the amendment's line range, the gate lines and the copy-pinning wording.
  • D5: a search for "only a re-pull" across the repository's TypeScript, Markdown and YAML files finds the negative assertion at test/import-prepare-pin.test.ts:237 and nothing else. backend/test/repull-lineage-writer-scan.test.ts:3 says that only a re-pull's plan compares a tree with upstream's, a claim about which code compares trees and not about copy pinning, and I left it.

Round 2 gates at a8dac724: bun run typecheck exit 0; bun run lint exit 0 (174 files); bun test test/adr-index.unit.test.ts test/changelog-format.unit.test.ts exit 0, 14 pass, 0 fail. I did not rerun the import tests: the epic lead ran 28 import-related test files at cfcd4462 (789 pass, 1 skip, 0 fail), and the four round 2 commits change only the ADR, the ADR index and the changelog (git diff --stat cfcd4462 a8dac724).

Replace the ADR 0111 entry with its final state. Add the hard rule
that the four re-pull switches and caps are the owner's and that the
CLI refuses a manual major on a mirror. Add the public row (mirror
versions and the mirror flag) and the gated row (upstream freshness
and the re-pull runbooks).

The ADR 0093 entry already names the Worker's merge of an automatic
re-pull, so it is unchanged. Docs only; test/docs-links.unit.test.ts
passes against a fresh docs checkout.
The design-upstream-repull.md row in .context/README.md now says it is
analysis, names ADR 0111 as the verdict and points at the three gated
runbooks; its destination stays public. In the design record, a tag
missing from the GitHub mirror is no longer described as retried
without end: it is parked after 14 days, as ADR 0111's amendment of
2026-10-24 says and the retry engine does.

Docs only; test/docs-links.unit.test.ts passes against a fresh docs
checkout.
Append Amendment 2026-10-27 (#1914): the page paths, the mirror field
contract, the order docs, website and backfill reach production, the
workflow pairs, the finding that a re-pull's DOI may carry IsIdenticalTo
as well as IsDerivedFrom (the public page says only "related
identifier" until the first real record), what is still not verified,
and the two items left open for the owner. Add a dated annotation to
the header, the Decision section and decision 5, and rewrite the ADR
0111 index line to the built state. No decision text is changed.

Docs only; test/adr-index.unit.test.ts passes.
Turn the Unreleased block, which held only Phase 3's bullets, into one
entry for the epic: Changed per phase (2 to 8), Production behavior
changes, Deploy coupling, Owner steps after release and Known limits.
Every earlier bullet's fact is kept, shorter; the Phase 3 bullet about
a non-latest explicit tag no longer says the pinned copy is unbuilt.

Docs only; test/changelog-format.unit.test.ts passes.
dataPlaneVersionListingSchema now declares the entry's mirror as an
optional boolean that may be null, and still passes every other key
through. A listing whose mirror is anything else fails the CLI's read
of it with the existing "did not match the expected shape" sentence,
and a backend that predates the flag (no key) still parses.

test/data-plane-mirror-contract.test.ts serves the real landing route
over real SQLite and reads it with the CLI's reader; a second loopback
server serves the real payload with one value changed for the failing
cases. Eight one-line mutations of the schema and of mirrorFlagOf each
fail at least one test. Tested: the new file (8 pass), that file with
http-download and the two backend mirror-flag suites (50 pass),
typecheck, lint.
The changelog and ADR 0111 said the dry-run plan compares trees and so
sees a tag re-created upstream under the same name. It does not: a plan
to a tag equal to the mirrored tag is refused as nothing-to-pull before
any tree is compared (src/lib/repull/preflight.ts, lines 157 and 158).
The changelog now says nothing detects it, and the ADR gets a dated
annotation. The amendment's note on annotations no longer counts them.

Docs only; the changelog and ADR index tests pass.
The amendment's list held only some of what the earlier amendments say
only the canary or a production run can check. It now holds all of it,
grouped by what shows it: the canary and the first copy, the first two
re-pulls, the first unattended run, the first Worker merge, and the
release with its first weeks. That adds the App's login, id and type,
the leased push and the lock calls, the 204 and the runner's masking,
the second release pull request and the N.0.1 tag, and the BIDS
unstable state. The ADR index line and the changelog now describe the
same scope. Every item was read in the amendment that records it.

Docs only; the changelog and ADR index tests pass.
The amendment cited two backend tests for "metadata.json is unchanged",
but neither reads that file. It now cites the mapping in
backend/src/services/data-router.ts and test/data-route.unit.test.ts,
which pins the four keys of each extensions.nemar.versions entry, and
says the recorded payload fixtures are in the website repository.
Decision 5's annotation says the chip is on the website's staging
branch only. The sentence about the two docs pull requests keeps the
dated fact and drops the status and the health-check procedure; the
changelog gains one deploy-coupling line for the same fact.

Docs only; the changelog and ADR index tests pass.
The changelog said the plan command prints counts and never a path,
but it also prints "Plan file: <path>" (src/lib/repull/render.ts,
line 106); it now says it prints that file's location and nothing of
the dataset. The changelog and the ADR index said the four switches
are absent from the Worker's configuration. The test pins the wrangler
configuration file and not Worker secrets, so both now say "wrangler
configuration", and the changelog adds that a secret of the same name
would turn the path on and that /admin/repulls/switches reports it.

Docs only; the changelog and ADR index tests pass.
The Phase 3 bullets were condensed past what the pull request body
said was kept. This restores the audit row the dispatch writes, the
reset of the clone to the tag, the lag on a latest tag OpenNeuro cannot
name, that git reset --soft drops .github/ until finalize deploys it
again, the warning when the guard cannot fire, what the preflight does
when its comparison is incomplete, the manual restart of a parked
annex conflict, the staging clean-up details, and how the snapshot
entry is read and written.

It also names the epic cleanup (#1976) where the text describes its
effects (the canary script, the plan handoff, the origin filter, the
migration number) and adds one bullet for what the two dev syncs
(#1979, #1981) carry: the App rename and the authenticated data host.

Docs only; the changelog format test passes.
Decision 2, the Phase 7c gate G4 and the design record (the release
path and gate G4) state that a re-pull's DOI carries IsDerivedFrom, as
a fact or as the gate's pass criterion. The Phase 8 amendment records
that a second source names the same DOI as IsIdenticalTo, so which
relation the first record carries is not known until G4 runs. Each of
the four places gets one dated annotation pointing at that section; no
other text changes.

Docs only; the ADR index test passes.
The import's warning for an explicit tag that is not OpenNeuro's
latest, and the doc comment above it, said ADR 0111 decision 8 is not
built. It is built for a re-pull's copy, which pins the S3 version; the
import's copy still takes the object currently at each upstream path
(its manifest items carry a bucket and a key and no version, as
parseS3Url returns them). Both now say only a re-pull's copy pins the
object version. The ADR gets a dated annotation on the Phase 3
amendment's sentence.

test/import-prepare-pin.test.ts asserts the new wording; with the old
string restored it fails. Tested: the 16 test files that import
src/lib/import-openneuro.ts and the tag-option test (386 pass), typecheck
and lint.
The comment on the version listing said null is for an N.0.0 whose tag
is unknown, which read as any dataset's N.0.0. mirrorFlagOf sends null
only for an N.0.0 of an OpenNeuro dataset and false for every other
version, a NEMAR dataset's N.0.0 included (shared/source-snapshot.ts,
line 267 and the lines after it). The file header said passthrough on
the entry is deliberate with no exception; it now names the version
listing's mirror field as the one typed exception.

Comments only; typecheck passes and the contract test passes (8).
The ADR 0111 amendment and the changelog's Unreleased block used DOI,
API, S3, BIDS, CLI, ADR and UTC without defining them. Each is now
spelled out once, at its first use in that text (the changelog's older
entries come later in the file, and the ADR never spells any of them
out). The amendment's DOI section heading carries the full name, so the
four annotations that quote it now quote the new heading, and the
amendment no longer quotes a code comment that held BIDS.

Docs only; the ADR index, changelog format and docs links tests pass.
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR1982

Version: 0.10.26-PR1982.a8dac72
Commit: a8dac72


🤖 Updated on each push.

Recovery also copies a recorded version (pinned sources from .log.rmet, copySourceArgument in src/lib/content-recovery.ts), so 'only a re-pull's copy pins' was false. The import warning and its CHANGELOG line now say a re-pull's copy pins the object version. Tested: typecheck, Biome, changelog-format and adr-index tests pass.
The import's doc comment and its test still said only a re-pull's copy pins the object version. The test now asserts the new wording, and that the old phrase and 'is not built' are absent. Tested: typecheck, Biome, the 28 import-related test files, the ADR index and CHANGELOG format tests: 789 pass, 1 skip, 0 fail.
The previous fix said nothing detects a tag re-created upstream under
the same name. Two checks do part of it. A plan to the mirrored tag is
refused as nothing-to-pull before any tree of upstream is cloned or
compared (preflight.ts lines 157 and 158, plan.ts lines 278 to 294), so
a mirror's recorded tag that upstream re-creates is not detected. A
target tag re-created after a plan has read it is caught: execute
refuses with upstream-tag-moved before the copy, the registration and
the pull request (advance.ts lines 146 to 176). The ADR annotation and
the changelog limit now say exactly that.

Docs only; the ADR index and changelog format tests pass.
The amendment's list of what only a first run can show lacked two
items. Gate G4's reading, that the new major's DOI resolves and the
previous version still serves, is in the first-two-re-pulls group (ADR
0111, Phase 7c amendment: the owner reads both before turning a switch
on). The epic cleanup's own test plan (#1976) leaves the first
automatic run through the plan handoff and the 57-word dispatch list
for production; it is in the first-unattended-run group, with the
two annotations of 2026-10-26 that describe the change.

The ADR index line and the changelog name groups, not items, so their
scope sentences still match the list. Docs only; tests pass.
The amendment and the changelog's Unreleased block now spell out CI,
AWS and JSON (amendment) and CDN, URL and JSON (changelog) at their
first use; the ADR never defines them and the changelog's older entries
come after the block. The changelog's "screened SHA" now says "screened
commit", so no SHA remains to define.

Docs only; the ADR index and changelog format tests pass.
The changelog and the ADR index line said the mirror flag is null for
an N.0.0 whose tag is unknown, which reads as any dataset's N.0.0.
mirrorFlagOf sends null only for an N.0.0 of an on dataset and false
for every other version (shared/source-snapshot.ts, line 267 and the
lines after it). Both now say so, as the contract comment and the ADR
amendment already do.

Docs only; the ADR index and changelog format tests pass.
@neuromechanist
neuromechanist merged commit b78f11c into feature/issue-1046-epic-upstream-freshness Oct 27, 2026
17 of 20 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-1046-phase8d branch October 27, 2026 16:05
@neuromechanist

Copy link
Copy Markdown
Contributor Author

Review record for PR 1982 (Phase 8d), squash-merged into the epic branch as b78f11c after two review rounds.

Round 1 ran two Sonnet reviewers on the first head, 9004e10: one checked the docs, ADR and CHANGELOG claims against the code, and one checked the contract code and its tests. Nine fix commits answered them (0d4c3f5 through d6fa34a). One suggestion, the re-spelling of fetchVersions in test/, was left as it was, because a live-tier call would move that file to the live tier (src/lib/api/client.ts reads TEST_API_URL, and scripts/ci/unit-pure-files.sh moves any file that names it).

Round 2 was a delta over the round-1 fixes, run by two Sonnet reviewers on db1ef68. It found that the copy-pinning claim was still false, because the content-recovery tool also copies a recorded version (src/lib/content-recovery.ts, copySourceArgument). db1ef68 and cfcd446 correct the import warning, its doc comment, the CHANGELOG line and the test, which had asserted the old wording and was failing at db1ef68. The same round found docs items D1 to D5: the re-created tag claim is scoped to the preflight refusal and to the upstream-tag-moved check, the G4 and plan-handoff checks join the not-yet-verified list, more abbreviations are spelled out, and the PR body is rewritten. They are fixed in 4843011, f16e4a3, ee17c46 and a8dac72.

Per the two-round cap, the commits after round 2 (cfcd446 and 4843011 through a8dac72) were not reviewed again. They were checked with the gates instead: typecheck and Biome exit 0, the ADR index and CHANGELOG format tests pass (14 of 14), and at cfcd446 the 28 import-related test files pass (789 pass, 1 skip, 0 fail).

Squash-merged at head a8dac72 on local gates, as the owner directed for phase PRs. CI on a8dac72 had unit-pure shard 1/6 fail in the git-annex install step after an apt mirror timeout, so no test ran in that shard and the unit-pure aggregate stayed red. Shard 4/6 passed, and integration-dev was still running at the merge.

This branch was previously deployed

1 inactive deployment
npm — a8dac724 Deployed Oct 27, 2026 by neuromechanist via publish #4062
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant