Repository navigation
Phase 7a: automatic re-pull switches - #1949
Merged
neuromechanist merged 8 commits intoOct 25, 2026
Merged
neuromechanist merged 8 commits into
neuromechanist merged 8 commits into
Conversation
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR1949Version: 🤖 Updated on each push. |
Add repull-switches.ts: exact-production test, the open and merge switches (exact "1"; merge needs open), and the one cap reader. The merge cap and the create fence now read through it, unchanged in behavior. The three variables stay absent from every wrangler vars block, pinned by a flag test. Tested: unit cross product, flag test, merge-claim suite.
Add GET /admin/repulls/switches, registered before /repulls/:id, answering what the Worker reads: production, both switches and the open cap. No raw binding value. Pinned in the route inventory (entry and order). Tested: route suite and inventory.
Add NEMAR_APP_BOT_LOGIN and NEMAR_APP_BOT_USER_ID beside NEMAR_APP_ID, measured 2026-10-24. Constants only; later phases read them. Tested: typecheck.
Append the 7a amendment: the switch and cap rules, the measured ruleset and review facts, and the split of the ruleset check (installation permissions read; organization rulesets need an admin:org token and stay an owner step before the Worker's merge). Documentation only.
A three-digit binding with leading zeros ('005') must read unreadable; the max check alone did not catch a widened digit rule. Tested: unit suite, mutation killed.
Move the merge cap reader into repull-switches.ts and report both caps. Tests: newline and tab cap values, every switch mix in the report, an ENVIRONMENT that is truly unset in the route suite. Mutants killed.
The flag test walks the whole parsed wrangler file for the two switches and both caps, and a new test pins the App's bot login and user id. The redundant read-every-block test is removed; the unit suite covers the readers. Mutants killed.
Four variables, one sentence for when the owner adds them, the dashboard remark on the pacing macro, switch wording in bindings, and the ADR's administrator attribution and merge cap line. Documentation only.
neuromechanist
force-pushed
the
feature/issue-1913-phase7a-switches
branch
from
October 25, 2026 02:50
6f94b03 to
97f4083
Compare
neuromechanist
merged commit Oct 25, 2026
aa7234d
into
feature/issue-1046-epic-upstream-freshness
20 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
Declares the switches that gate automatic re-pull (ADR 0111) and nothing else.
AUTO_REPULL_ENABLEDandAUTO_REPULL_MERGE_ENABLEDare on only as the exact string"1"and only whenENVIRONMENTis exactlyproduction(no trim, no case folding, unset is not production); the merge switch also needs the first.REPULL_DAILY_OPEN_CAPdefaults to 2; a cap is one or two digits up to 20, and a value that is set but unreadable reads 0. One shared reader (readCap) now serves both caps, so Phase 6e's merge cap (default 5, unreadable 0, max 20) uses the same rule with unchanged behavior, and the environment fence of the record calls the same production test. No value is added to any wrangler vars block: the three variables are deliberately absent, which means off, and a test pins that. An administrator routeGET /admin/repulls/switchesreports the state, registered beforeGET /repulls/:id. The App's bot login and user id are recorded beside its app id for the later review and merge slices.Phase 7a of epic #1046, part of #1913 (which stays open until Phase 7 completes). Nothing acts on the switches yet.
What is in it
backend/src/services/repull-switches.ts(new), the bindings types, comment blocks inwrangler-sccn.toml(no values),upstream-repull.ts(the cap reader replaced by the shared one).GET /admin/repulls/switchesand the route inventory pin;NEMAR_APP_BOT_LOGINandNEMAR_APP_BOT_USER_IDinbranch-protection.ts.admin:orgtoken and must be read before the Worker-merge phase is built).Test plan
bun testran once: 19715 pass, 242 skip, 1 fail (website parity against a stale sibling checkout, untouched by this PR). Typecheck and Biome clean. 14 single-line mutants applied; one survived (widening the cap regex) and was closed with new cases.