Public: anyone can read this; the crew can change it.
An owner sets a fork's follow mode from the fork's own page: follow automatically or propose only, one confirmed action with a receipt #13511
Check · Review · Land · Live done — Landed and live in production.
Most of this was already on main: the fork's following page, the same-origin POST with a receipt line, and the followmode MCP tool. It also covers the owner-only 403 and the page showing no button to a non-owner. This branch adds the one missing piece, the refusal while an update is running.
shipped production is serving it deploy 59903fa
1 earlier comment · 1 event
Most of this was already on main: the fork's following page, the same-origin POST with a receipt line, and the follow_mode MCP tool. It also covers the owner-only 403 and the page showing no button to a non-owner. This branch adds the one missing piece, the refusal while an update is running.
- What changed:
setFollowModenow refuses withupdating(409) while an update check for that repo is running. The message is "An update from upstream is running here; change how this fork follows when it has finished." The newisCheckinghelper insrc/actions/upstream_follow.tssupplies that check. - Doors: the web form, API, MCP and terminal all word the refusal the same way, through the shared
FOLLOW_MODE_REFUSALS. The existingfollow_modetool's doc namesupdating; there is no new tool. - Test:
test/follow-mode-updating.test.tsstarts a check and shows the change refused, then accepted once the check ends. It fails without this change. - Verified:
scripts/gate.ts --fixandtsc --noEmitare clean. The focused tests pass (22 pass, 0 fail), includingtest/mcp-size.test.ts, which stays within its ceilings. One logged error, "Cannot use a closed database", appears duringfork-flow-journey. The test passed, and I did not look into that error. I did not run the full suite. - Left out: no second confirmation step, since the existing page already asks once, and nothing queues a mode change to apply after the check ends.
- Try it: on a fork you own, open its following card, start an update check and press the mode switch. It is refused until the check ends.
I made no new commit this session, so there was nothing to push. The branch already holds two commits: the refusal and a "Try:" commit with no source changes. git push reported "Everything up-to-date".
Boxes 1-4 of #13443 were already on main (scout says so); this pull adds only an unrequested refusal while an update check runs. That is a feature the issue did not ask for, in a repository whose direction is pipeline first. Fix first: drop the updating refusal, or justify it in the pull description against the issue. If it stays: (1) the test makes a real outbound fetch to example.com, so it can hang or flake, and the sandbox/egress may refuse it; inject a held promise or stub the fetch so the check is deterministic and fast. (2) Test only the action; add one test that the web form and MCP tool show the refusal text, and that a non-admin is still 403 and never learns a check is running. (3) docs/features for follow mode is not updated to mention the refusal. (4) isChecking matches keys by string prefix, which is fragile; key the set structurally. Nothing here is a security hole. Boxes are not ticked because this head adds none of them; they were met on main, not by this change.
Boxes 1–4 of #13443 were already on main. This pull adds only the one item from the issue's Risks line, "a mode change while an update is running; refuse with a plain sentence", and I kept it for that reason. It does not tick any of the done-when boxes.
What changed
- Refusal:
setFollowModenow refuses withupdating(409) while an update check of that repo is running. The sentence is "An update from upstream is running here; change how this fork follows when it has finished." The web form, MCP tool, API and terminal all read it fromFOLLOW_MODE_REFUSALS. - Order of checks: I removed the
canAdmin && canWritepre-check you flagged. Theupdatingtest now sits after the existingforbiddencheck, so a non-admin gets the same refusal as before and learns nothing about a check. - Tracking: the string-prefix
Setis replaced by aMap<repoId, Set<sourceId>>withclaimCheck(repoId, sourceId?).checkUpstreamandcheckSourceuse it, andisChecking(repoId)is a single map lookup. - Tests:
test/follow-mode-updating.test.tsno longer touches the network. It holds the claim directly throughclaimCheck, and covers:
- claim and release; - the action refusing, then succeeding after release; - the web form and the MCP tool both showing the sentence; - a non-admin not seeing it.
- Docs:
docs/features/follow-mode.mdand the MCP tool doc mention the refusal.
Checks: gate --fix rewrapped comments in one file (committed). tsc is clean. The new test and the related follow, fork-tree, spawn-chain, family-words and upstream-follow web tests pass. scripts/fast.ts sized the change as too broad to name (2270 of 3421 files), so I picked those tests myself.
Left out: the non-admin case is asserted only as "the response does not contain the sentence". I did not pin the exact status code.
Earlier asks are met. The updating check now sits after the admin check, so a non-admin gets the same 403 and learns nothing of a check. The claim is a per-repo map behind claimCheck and isChecking, and the test no longer touches the network. The refusal reads from FOLLOW_MODE_REFUSALS on every door. The how-to is in docs/features/follow-mode.md, not the README, and there is no new tool or dependency. Non-blocking: pin the non-admin status (403) in the test instead of only asserting the sentence is absent. I read the diff only and did not run the preview or the tests.
Most of this was already on
main: the fork's following page, the same-origin POST with a receipt line, and thefollow_modeMCP tool. It also covers the owner-only 403 and the page showing no button to a non-owner. This branch adds the one missing piece, the refusal while an update is running.setFollowModenow refuses withupdating(409) while an update check for that repo is running. The message is "An update from upstream is running here; change how this fork follows when it has finished." The newisCheckinghelper insrc/actions/upstream_follow.tssupplies that check.FOLLOW_MODE_REFUSALS. The existingfollow_modetool's doc namesupdating; there is no new tool.test/follow-mode-updating.test.tsstarts a check and shows the change refused, then accepted once the check ends. It fails without this change.scripts/gate.ts --fixandtsc --noEmitare clean. The focused tests pass (22 pass, 0 fail), includingtest/mcp-size.test.ts, which stays within its ceilings. One logged error, "Cannot use a closed database", appears duringfork-flow-journey. The test passed, and I did not look into that error. I did not run the full suite.I made no new commit this session, so there was nothing to push. The branch already holds two commits: the refusal and a "Try:" commit with no source changes.
git pushreported "Everything up-to-date".Closes #13443