Skip to content

Delegate the staged-publishing challenge pause to the fleet - #308

Closed
John-David Dalton (jdalton) wants to merge 1 commit into
mainfrom
jdalton/delegate-staged-publishing-pause
Closed

Delegate the staged-publishing challenge pause to the fleet#308
John-David Dalton (jdalton) wants to merge 1 commit into
mainfrom
jdalton/delegate-staged-publishing-pause

Conversation

@jdalton

@jdalton John-David Dalton (jdalton) commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

The staged-publishing configurator kept its own copy of the fleet's challenge pause, pauseForOperatorInPlace. This removes the copy and calls the fleet's pauseForChallenge at both sites.

The copy existed for exactly one reason, and the reason is gone. The fleet pause used to goto the URL on every fresh pause. On a live run that reload closed the trusted-publisher form the write lane had just opened, and the reload traffic then provoked the very Cloudflare challenges it was pausing for — settings page, form opens, reload, challenge, pause, reload, once per lap. So this module stripped the goto and kept its own version. The fleet pause now waits in place and never navigates, so the copy had nothing left to diverge for and was only holding later fixes to the challenge rhythm out of this repo: the branded holding screen, the rerun hint, and the injectable clock all land here for free now.

The no-navigation invariant is now asserted against the pause the run actually uses. Every existing test in that file injects a fake pause, which proves the wait loop's own restraint but says nothing about what it delegates to. The new test drives the real pause and counts goto calls.

This is blocked on a cascade and must not merge yet. main still carries the older browser-session.mts, whose pauseForChallenge navigates at line 235. Against that base this change reintroduces the exact regression it describes, and the new test catches it — see below. The in-place pause is already cascaded into working checkouts; it just has not reached main. Once it does, this goes green with no edits.

Evidence for the ordering dependency

Same commit, same tree, two bases:

Base test/scripts/npm/
main today (03c21f7a0) 1 failed, 260 passed
with the in-place pause cascaded 261 passed

The single failure is the new test, and it fails the right way — expected 2 to be 1, the second goto being the fleet pause reloading the page.

Baseline on main without this commit is 260 passed, 22 files, so there are no pre-existing failures in this suite.

What was deliberately left alone

The write lane stays local. The fleet's driveVerifiedSave still re-navigates on every attempt (driveFormEdits does a page.goto per pass), so configure-staged-publishing-write.mts keeps opening the form once and treating the in-place re-read as the arbiter of success.

fetchJsonInPage stays local. The fleet's fetchInPage returns only status and body; this one also returns the URL the fetch finally landed on, which is the only thing separating the access page from npm's sign-in interstitial when both answer HTTP 200 JSON.

The wait loop does not move onto runChallengeAware. That helper models three outcomes; this loop classifies seven readiness states, and collapsing them would lose the sign-in, two-factor, and unsettled distinctions the module exists for.

The operator overlay is untouched.

Lint, format, and the playwright-launches-are-sanctioned check all pass.


Note

Medium Risk
Touches live npm browser operator flows during Cloudflare/2FA pauses; behavior now depends on fleet pauseForChallenge staying in-place (no reload). PR description notes merge is blocked until that fleet change is on main.

Overview
Staged-publishing browser automation stops maintaining a local copy of the fleet challenge pause and calls pauseForChallenge from browser-session.mts in waitForAccessPage and during trusted-publisher writes.

pauseForOperatorInPlace is removed from the operator module (along with its gate/cooldown imports). Operator helpers now focus on overlays, notifications, and tab hygiene; comments document that the no-navigation pause contract lives in the fleet.

Tests extend the fake Page so the real fleet pause can run without a browser, and add the DELEGATED fleet pause never navigates either, which asserts only the wait loop’s initial goto occurs across challenge polling—not a second navigation from the pause.

Reviewed by Cursor Bugbot for commit 98c040d. Configure here.

The staged-publishing configurator kept its own copy of the fleet's
challenge pause. The copy existed for one reason: the fleet pause used
to reload the URL on every fresh pause, and on a live run that reload
closed the trusted-publisher form the write lane had just opened, then
provoked more challenges with the reload traffic.

The fleet pause now waits in place and never navigates, so the copy had
nothing left to diverge for and only kept later fixes to the challenge
rhythm out of this repo. Both call sites now use pauseForChallenge,
which also brings the branded holding screen and the injectable clock.

The no-navigation invariant is now asserted against the pause the run
really uses rather than an injected stand-in.
cursor[bot]

This comment was marked as resolved.

@jdalton

Copy link
Copy Markdown
Collaborator Author

Landed on main as 1992cfb with the test slice in f960a89. Main's scripts/repo move had relocated these files, so the change was re-applied at scripts/repo/npm/ and the conflict resolved there. Closing unmerged since fleet work lands directly on main.

@jdalton
John-David Dalton (jdalton) deleted the jdalton/delegate-staged-publishing-pause branch August 6, 2026 18:58
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