Repository navigation
Phase 6f: status, resume, the merge gate and the release - #1958
Merged
neuromechanist merged 17 commits intoOct 25, 2026
Merged
neuromechanist merged 17 commits into
neuromechanist merged 17 commits into
Conversation
The verified merge route records a pull request found merged while the row is pr_open (outside the tools, at an unscreened head); merged repeats to record why the release is not recorded yet; every step past prepared that keeps a record open re-reads the dataset fences; a released N.0.0 must record its locked objects before complete or N.0.1 (lock-unrecorded), and the released self-edge carries the count or the lock's error; a stuck claim expires (outcome expired) once 30 minutes old and GitHub says it did not merge. Tested: backend/test/upstream-repull* and the state unit test pass; seven mutants of the new guards each fail a test.
resume takes an open re-pull past its pull request: a merge found on GitHub is recorded through the verified route, a closed one ends the record abandoned, a head moved by enrichment is recorded and any other is head-foreign, main must be the base or moved by enrichment only (re-synthesized onto it with a lease when GitHub says dirty or behind), the identifier screen is dispatched and acknowledged when asked, and gates_clear is recorded once it passes and GitHub says clean. A held claim is resolved from GitHub and expires once old enough. status shows the record, its screens and the next command. Never merges. Tested: test/repull-gates-cli.test.ts (14 pass) against a re-pull executed to pr_open by the real execute; pr-review-approve tests pass.
nemar admin repull merge <id> merges a gates_clear re-pull only after reading, before anything is written: the open pull request at the screened head, main moved by enrichment only, the automated review of that head (failed, running or unread needs --force), the identifier screen, GitHub clean, and a squash message whose last paragraph is the commit's two trailers as git reads them. Then it confirms (one DOI), claims a unit of the daily cap, squash-merges at the screened sha, and records the merge; a held claim is reused, a lost answer keeps it. The pull request body and the execute help now name resume and merge. Tested: test/repull-merge-cli.test.ts (10 pass), the trailers unit test, the command-text test and the execute CLI suite.
approve --merge and y in next ask, for a release/* pull request, whether a re-pull record names it; a re-pull's pull request runs the re-pull gate's checks before the approval is written (a refusal writes nothing), is squash-merged by the gate after it (claim, sha, trailers, record), and an explicit --method other than squash is refused. A NEMAR API that cannot say refuses the merge; an ordinary release pull request is merged as before. Tested: test/admin-pr-reviews-repull.test.ts (6 pass) and the existing admin-pr-reviews CLI suite.
From merged, resume waits (bounded) for the v<N.0.0> tag on origin and the version row, verifies the tagged tree against the synthesized one outside .nemar/ and .github/, and records the release through the Worker's verified route (lineage only when verified; the sweep stamps are re-armed there). Then it locks the dataset's objects through the existing s3-lock route, records the count only when every object was locked (else the error, and the row stays released for the next run), and completes a record with no corrections. The object lock batch honors the test-only S3 endpoint override; the S3 stand-in answers PutObjectRetention. Tested: test/repull-release-cli.test.ts (5 pass) through the real s3-lock route against the S3 stand-in.
Append the Phase 6f slice: resume past the pull request, the re-synthesis onto a moved main, the merge gate shared by repull merge and pr-reviews, a stuck claim's expiry, the fences on every step past prepared, the release and the lock, and what only stand-ins answered; annotate the earlier sentences it builds. AGENTS.md's ADR 0093 line names the re-pull's one gate, as decision 7 asks. Tested: the ADR index and docs link tests pass.
The scratch repository that reads origin is now per purpose and per
process (repull/<id>/{resume,merge}/<digest8>-<pid>), so a merge from
pr-reviews and a resume of one record never remove each other's; and a
pull request that moves while resume reads its state waits a turn
instead of reading again at once.
Tested: the four Phase 6f CLI suites pass (126 with the unit tests).
The four CLI suites name TEST_API_URL in their headers, so the workflow routes them to the integration tier their headers claim; the trailers test claims unit-pure; the API export surface pins the six new /admin/repulls client functions. Tested: ci-tier-routing and api-export-surface pass.
The Phase 6f slice now names the per-purpose, per-process scratch repository resume and the merge gate read origin through. Not tested (text only).
The s3-lock route reads retention back before it counts a 403 as locked, and locks an explicit list of annex keys at their current versions. The Worker refuses a released count below the record's copied, skipped and local uploads. Shared dispatch codes and lock docs updated. Tested: backend upstream-repull suites.
POST /admin/repulls/:id/merge-claim/check re-reads what the claim's statement read (dataset fences, the screen for this administrator, the live head) and refuses a claim 25 minutes old or more. It writes nothing. Route inventory pinned. Tested: backend upstream-repull suites.
The merge gate holds the record's plan lock from claim to record, checks a held claim with the Worker before sending under it, treats a lost claim answer as a claim that may be held, keeps its claim when GitHub did not merge, and refuses a head branch GitHub does not name. An unrecorded merge exits 3. Help and token wording match the code. Tested: repull-merge-cli and admin-pr-reviews-repull suites.
The release reads the staging manifest the copy wrote (digest checked against the record), locks those keys by name through the s3-lock route, and records the count only when every key is confirmed. Before the tag it reads the squash commit on main and refuses one whose last paragraph lacks both trailers (merge-trailers). Export pins updated. Tested: repull-release-cli and api-export-surface suites.
The re-synthesized commit applies what enrichment did on main (the .bidsignore line on the recorded file, a participants placeholder when N.0.0 has none) instead of undoing it. A re-synthesis pushed and not recorded is recognized from the head and recorded by the next resume. Tested: repull-resynthesize and repull-gates-cli suites.
Resume help and headers name what it does and does not do; the trailers docblock and AGENTS.md's ADR 0093 summary name the merge paths. ADR 0111 gains dated annotations where Phase 6f built, changed or did not build what earlier text promised, and its Phase 6f slice is rewritten to match the code. Tested: adr-index and repull-command-text suites.
Biome's noUnusedTemplateLiteral. Tested: repull-resynthesize suite.
neuromechanist
force-pushed
the
feature/issue-1912-phase6f-gates-merge
branch
from
October 25, 2026 23:13
153fb08 to
6648c96
Compare
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR1958Version: 🤖 Updated on each push. |
approve --merge exits 3 and next stops, counting it unknown, when GitHub merged a re-pull pull request and the record write failed; both name nemar admin repull resume. Neither prints a green Merged. Tested: admin-pr-reviews-repull suite, both checks mutated and killed.
neuromechanist
merged commit Oct 25, 2026
895fa5a
into
feature/issue-1046-epic-upstream-freshness
24 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
Builds the gates, resume and merge of a re-pull through
released(ADR 0111, dated 2026-10-25 for this slice).nemar admin repull statusreports a record and what it waits on;nemar admin repull resumecarries a record from where it stopped throughreleased, re-synthesizing the release commit onto a movedmainand handling a pull request merged while it was stillpr_open.nemar admin repull mergeis the one merge gate, shared withnemar admin pr-reviews: it checks the head, the screen, the review, the trailers and the cap, merges with the head'ssha, and writes the squash message's two trailers as its last paragraph. The release records the locked object count and locks the copied objects; a lock that fails leaves the record resumable. A claim whose pull request is still open for thirty minutes is expired only when GitHub confirms it is not merged. Nothing here sends mail.Phase 6f of epic #1046, part of #1912 (which stays open until 6g). It builds on 6a to 6e. The N.0.1 replay, abandon and supersede are 6g.
What is in it
shared/repull-state.ts(the new edges and their words),backend/src/services/upstream-repull.ts,upstream-repull-verified.ts(the verified merged route, theexpiredrelease, the released count), and the resume routes with their tests.statusandresumecommands and their helpers, the single gate insrc/lib/repull/merge.ts, the trailer check intrailers.ts, the release and the object lock, and thepr-reviewsapprove --mergepath delegated to the gate.repull-pr-world.ts.Owner notes
failedrow that holds a claim stays unreconciled and the dataset stays blocked; no 6f path writesfailed.Test plan
bun teston the implementer's run: 20642 pass, 242 skip, 8 fail. Six were its own test headers and one API export pin, now fixed; the other two are the website parity test against a drifted sibling checkout and a route-skew test that passes alone.sha(409); itsmergeable_statewords and how fasthead.shafollows a push; that a leased force push to a release branch is accepted; that the dataset workflows tag a squash-merged re-pull the way they tag other merges; that the tag read resolves an annotated tag; that the real bucket answers PutObjectRetention on copied objects (the existing s3-lock route counts a 403 as already locked).