Skip to content

Phase 6g: N.0.1 replay, abandon, supersede, the manual-major refusal and the mirror rehearsal - #1962

Merged
neuromechanist merged 25 commits into
feature/issue-1046-epic-upstream-freshnessfrom
feature/issue-1912-phase6g-patch
Oct 26, 2026
Merged

neuromechanist merged 25 commits into
feature/issue-1046-epic-upstream-freshnessfrom
feature/issue-1912-phase6g-patch

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

Completes the manual re-pull path (ADR 0111, dated 2026-10-25 for this slice). A correction a re-pull did not already carry is replayed as an N.0.1 release after N.0.0 is merged and tagged, with the replay resolutions an administrator chooses (a conflict waits for --take-ours or --keep-upstream before the record can complete). nemar admin repull abandon ends a record that has not merged; --supersede ends an earlier attempt's release branch and pull request after a separate read confirms they are the old record's own. A manual major bump on a mirror (on*) is refused by the CLI; the fleet version-check workflow is not changed (ADR 0020). A rehearsal exemplar with --mirror lets the path run end to end on dev without publishing an on dataset.

Phase 6g of epic #1046, part of #1912. This is the last manual-execution PR; issue #1912 closes when it merges. It builds on 6a to 6f.

Behavior changes to merged 6f (please read)

  • A plan with conflicts now waits for an administrator decision before N.0.1 or complete; 6f completed such a plan with no one deciding.
  • execute without --supersede now refuses repull-in-flight before planning.

Judgment calls (recorded in the ADR slice)

  • An A:<key> correction is replayed as NEMAR's own entry, byte for byte, not through git annex fromkey; the key must be in the bucket at its size, at nemar-s3, and not dead.
  • The N.0.1 commit is dated with the N.0.0 merge commit's time, so a rerun makes the same commit.
  • N.0.1's re-synthesis applies its own changes to the moved main; if enrichment touched a replayed path it refuses (patch-main-moved).
  • Abandon ends automatic records too, as the 7b slice says; supersede refuses them.
  • --mirror renames the inherited nemar-s3 remote to nemar-s3-source, so the dev remote can take the name nemar-s3.

Size

The production code is about 2,500 lines against the plan's 520. Much of it is comments and guard text; the review should judge it as written.

Test plan

  • Typecheck and lint clean (164 files).
  • Targeted suites: patch-cli 7, patch 16, abandon-cli 5, supersede-cli 5, mirror-major 5, exemplar 53, dispatch-words 7; all pass.
  • Full bun test on the implementer's run: 21029 pass, 242 skip, 5 fail; four fixed (its own tests), one is the website-parity check against a drifted local checkout.
  • Mutation log: 22 of 22 killed.
  • CI on this head (the lead runs the Tests workflow).
  • Only a canary or the production runs can check: opening and squash-merging a second release pull request, listing pull requests with head=, closing a pull request, deleting a branch, reading merged state after a close; the dataset workflows tagging v2.0.1 and minting its DOI; the real bucket's listing; for the fixture, whether the dev bucket answers the anonymous annex-uuid read and whether a rehearsal plan sets the lineage that create needs.

Still open (named in the ADR)

  • A failed record that holds a claim is still unreconciled.
  • A dead mark left by an abandoned attempt can make the next plan refuse with dead-recording-unpinned.
  • version-check is unchanged, so a major merged outside the CLI is not stopped.

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR1962

Version: 0.10.24-PR1962.a559d7c
Commit: a559d7c


🤖 Updated on each push.

After N.0.0 is merged, tagged, minted and its objects locked, resume
makes N.0.1 from the reviewed plan: NEMAR's side of each correction
(and of each conflict resolved with --take-ours) replayed onto the
new main byte for byte, the README family as a unit, the description
keys set and Version N.0.1; no scrub, no copy; replayed annexed keys
must be in the bucket and at nemar-s3. Conflicts wait for a decision
(--take-ours or --keep-upstream) before anything is made. N.0.1 then
takes the same screen, gates, merge gate (claiming the cap as n1),
pr-reviews delegation and release as N.0.0, ending complete.

Tested: repull-patch (real git) and repull-patch-cli (real CLI and
Worker routes, GitHub and S3 stand-ins); release and pr-reviews
suites updated for N.0.1 being built.
nemar admin repull abandon <id> ends an open record: before N.0.0's
merge it closes the pull request, deletes the release branch (only
when its head is the record's commit or enrichment's), reports the
orphans the staging manifest names (objects and bytes, nothing
deleted) and ends it abandoned; between merge and release it refuses
(wait-for-release); after the release it declines N.0.1
(patch_declined). Every pull request of the branch is read first, and
a merged one, or a held claim, refuses before anything is written.

execute --supersede ends the administrator's open record of another
tag, from the same from_tag and before its merge, as superseded, after
the new plan is proved and made again from live sources (the old
record's own release branch and pull request tolerated in its
preflight). Without the flag, another open record is repull-in-flight.
An automatic record is never superseded.

Tested: repull-abandon-cli and repull-supersede-cli (real CLI and
Worker routes, GitHub and S3 stand-ins).
On an on dataset, or a row recorded as an OpenNeuro import, a higher
major in nemar dataset release (--type major, --version, the
prompt's major or custom version) or nemar dataset update --bump
major is refused before anything is cloned or changed: a mirror's
major is an upstream re-pull. The CLI's rule only; the dataset
repositories' version-check workflow is not changed.

Tested: dataset-release-mirror-major (the rule, and the real CLI
against a loopback stand-in with git and gh shims).
nemar admin exemplar create <xx> --source <on> --mirror <ds> makes a
staging exemplar whose row says source openneuro and source_id <ds>,
so an upstream re-pull can be rehearsed on an xx id. Its dev-bucket
remote takes the name nemar-s3 (the one a re-pull reads) after the
inherited production remote is renamed out of its way. The route
stays staging-only, refuses an anonymous exemplar, and refuses a pair
that is not an on dataset and the ds it mirrors.

Tested: exemplar-endpoint (the route's refusals and the recorded
source) and exemplar-clone (the rename on real git-annex).
Abandon keeps (and says it keeps) a release branch whose head is not the re-pull's; a supersede whose new plan finds another release pull request beside the old record's stays not executable. Tested: both suites pass.
Abandon refuses to decline N.0.1 of a released record whose lock is not recorded (lock-unrecorded), so a released version's objects are never left unlocked by giving up. The conflict wait points at the reviewed plan file, and resume says when --take-ours or --keep-upstream come after N.0.1 is made. Tested: repull-patch-cli (7 pass), with a mutant of the guard killed.
The Phase 6g slice (N.0.1 and its resolutions, abandon and supersede with what each can and cannot end, the manual-major refusal and its CLI-only limit, the mirror rehearsal fixture, what only stand-ins checked), twelve annotations on the sentences it builds, and the README index entry for ADR 0111. Tested: adr-index passes.
squashMessage read the record's corrections count for N.0.0 too, which a caller with a partial row does not hold. Tested: repull-trailers passes.
The command list and help now name abandon, --supersede, --take-ours and --keep-upstream and no unbuilt step; N.0.1's pull request body names its commands and trailers and counts only; repull-patch claims the unit-pure tier it is routed to. Tested: repull-command-text and ci-tier-routing pass.
One reader of a dataset's pull request list (pulls.ts) for the plan's release-pr check, the open of the release pull request, abandon and supersede: a list is answered only whole, never short. The release-pr check always reads it and hands what it read to a supersede, which judges the old record's own release from that read (no second read): another release branch or pull request, a second pull request of its branch, a pre-push status or a list not read whole refuses, and says why. A held merge claim refuses the supersede before anything is planned. Abandon reads the recorded pull request by its number whatever the list says, deletes a release branch only with a lease on the head it judged (the write guard refuses a delete without one, delete-without-lease), and refuses with exit 1 before writes and exit 3 after.

Tested: repull-supersede-cli (18), repull-abandon-cli (9), repull-write-guard, repull-plan, repull-plan-cli, repull-execute-cli, repull-execute-prepare pass; mutants killed.
N.0.1 refuses a replayed path enrichment wrote after the merge (patch-main-moved), a description value that does not parse or a __proto__ key (patch-description-unreadable), and waits while a conflict is neither named nor left by --keep-upstream, saying how many it resolved and left. Its tagged tree must be its gated head outside .nemar/ and .github/ (patch-tree-mismatch leaves patch_merged), and its merge gate refuses a record that does not state its corrections. Re-reads use the moved-ref fetch depth, and a recognized re-synthesis records its real tree. A fixture option replaces a recording with NEMAR's own annexed content.

Tested: repull-patch (19), repull-patch-cli (20), repull-patch-resolutions-cli (6), repull-release-cli, repull-gates-cli, repull-merge-cli, admin-pr-reviews-repull pass; mutants killed.
On a mirror, a current or next version the rule cannot read (empty, none, 1.0, a prerelease) is refused: whether it is a major is then not known. A dataset that is not a mirror is not this rule's to judge.

Tested: dataset-release-mirror-major passes; mutant killed.
The inherited remote's rename refuses when the git-annex branch cannot be read, instead of reading it as naming nothing. Steps 5 and 6 of prepare are one seam (prepareDevRemote: rename, ignore, configure, uuid) tested with real git-annex over directory remotes; the s3-remote imports are merged and nemarS3DevUuid is documented.

Tested: exemplar-clone (40) passes; mutants killed.
The exemplar route's success path, against a GitHub stand-in: a mirror fixture records source openneuro and the ds, an ordinary one nemar-exemplar and its clone source, and the audit row keeps the source it was cloned from.

Tested: exemplar-endpoint (20) passes; mutant killed.
Abandon's help says main's current tree and that exit 3 is resumable; resume's says a conflict not named stays upstream's only with --keep-upstream and that a record without counts exits 0 at released. The Phase 6g slice records the whole reads, the leased delete, the early claim check, the N.0.1 refusals, the unreadable mirror version and the fixture's source_id overlap; two stale decision 3 lines are annotated, and the index names the 7f slice.

Tested: adr-index and repull-command-text pass.
Enrichment can move main after a pull request's gates on two paths outside .nemar/ and .github/ (the .bidsignore line, a placeholder participants.tsv); the squash then tags a tree the gates did not clear, and N.0.1's release refused it after the DOI, wedging the record. The merge gate now refuses such a main before any claim (merge-main-moved), for N.0.0 and N.0.1; resume takes the record back to its open status and makes the commit again on the new main, even when GitHub reports it clean. A tag that still differs is released only with resume --accept-tag-tree "<reason>", which its refusal names. A fixture option leaves participants.tsv absent on both sides.

Tested: repull-patch-resolutions-cli (8), repull-patch-cli (20), repull-gates-cli, repull-merge-cli, repull-release-cli, admin-pr-reviews-repull pass; mutants killed.
A supersede refused for another release branch names it, so the stale one can be deleted by hand. With no pull request recorded (registered), exactly one open pull request of the old record's branch from the dataset's own repository is its own; a fork's, or a second one, refuses. Abandon names a merged pull request of the branch that is not the record's (foreign-pull-request-merged) instead of sending the administrator to resume. The GitHub stand-in can answer a fork's head repository.

Tested: repull-supersede-cli (21), repull-abandon-cli (10) pass; mutants killed.
The refusal of an unreadable version on a mirror now says a version is of the form X.Y.Z and how to give one.

Tested: dataset-release-mirror-major passes; mutant killed.
An unreadable git-annex branch in the exemplar's rename says to run git annex init (the clone step does). The mirror fixture tests take their git identity from test/helpers/git-identity.ts, since git-annex commits to its branch and a CI runner has no global identity; they asserted nothing about the inits they rely on before, and now do.

Tested: exemplar-clone (40) passes, also with GIT_CONFIG_GLOBAL=/dev/null and user.useConfigOnly=true, where it failed 5 tests before; mutant killed.
The Phase 6g slice states the merge gate's rule for a main enrichment moved outside .nemar/ and .github/ (merge-main-moved), the case it closes, the recovery through resume, and the named path for a tag that still differs (resume --accept-tag-tree), with its reason printed and not stored; also the supersede's fork and unrecorded pull request rule, abandon's foreign merged pull request, and the two refusal remedies.

Tested: adr-index passes.
The abandon import landed beside Phase 7d's automatic import in the rebase; Biome orders them. Tested: bun run lint passes.
With Phase 7d's unattended run built, the abandon paragraph no longer says the run is not built: abandon touches no dispatch and no workflow run and ends the record only. The index entry names the unattended run and the 7d slice; the Worker's merge is still not built.

Tested: adr-index passes.
The re-pull world can save a point (refs, bucket, database, pulls) and restore to it. repull-patch-cli, repull-patch-resolutions-cli, repull-release-cli and repull-supersede-cli reach their shared starting points (N.0.0 merged, released and locked, N.0.1 opened and gated, tag C planned) once in beforeAll, with the same assertions, instead of driving every case through the same CLI runs again. No wait or sleep was in them.

Tested: the four suites pass (patch-cli 55s to 32s, release-cli 30s to 25s, supersede-cli 36s to 27s locally; resolutions-cli unchanged at about 48s, its three world builds dominate). The whole live tier passes locally against stand-ins: 1925 pass, 138 skip, 0 fail in 1178s.
The integration-dev job's tests project to about 30 minutes on current runners with the re-pull world suites of Phases 6g and 7d; the owner chose a 35 minute cap. Only the job's timeout-minutes changes.
The comment above integration-dev's timeout now gives the measured time (about 16 minutes before Phases 6g and 7d, about 30 projected with them) and the 35 minute cap the owner chose.
@neuromechanist
neuromechanist merged commit e475481 into feature/issue-1046-epic-upstream-freshness Oct 26, 2026
23 of 24 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-1912-phase6g-patch branch October 26, 2026 08:43

This branch was previously deployed

1 inactive deployment
npm — a559d7cd Deployed Oct 26, 2026 by neuromechanist via publish #4019
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