Repository navigation
fork seams: after a rebase, exclude an upstream file named like a fork file (#432) - #567
Conversation
…k file (#432) From upstream, a file upstream has that a pull request's run takes for the fork's own (its name or a "forkFiles" pattern) was refused, so every such upstream file stopped fork-follow after the rebase until a pull request added a `!` entry by hand. Right after a rebase that writes a lowered list, the check now puts each one in that list instead: its own "forkFiles" entry goes, and a `!path` excludes it where a name or another pattern still takes it. That only narrows what a pull request's run takes for the fork's own (the run from upstream already judges the file as upstream's, so a fork change in it is still refused). Before a rebase, or with no list to write, it is still refused. Fixes #432 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review (lens B: main-move path, state): SAFE — but Lint is red, so not mergeable yetThe logic is safe. The new exclusion only ever makes a pull request's run stricter, and it only goes into a list that fork-follow commits after a good rebase. One blocking item before merge: CI Lint fails on lines this PR adds (main's Fork tests are green, so this PR caused it). Blocking
MajorNone. Minor
What I checked
State question
CI: everything else is green; |
Lens A (trust + state, main-move path): SAFE in logic. Not mergeable until Lint is greenReviewed head The exclusion only makes the gate stricter. The list is written only after a good rebase. Tests fail on the old code. I checked this: with main's Items 2-7 of #432, checked on main: State:
Blocking
MajorNone. Minor
Nits
|
…t still takes a hidden file Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Fix for both reviews (11f4515): the three comments are shortened for the comment rule, and the lowered-list run now fails closed. After lowerList, it refuses if any hidden upstream file is still a fork file under the list it would write, as lens A suggested. All 87 seam-check tests and the fork-follow checks pass. The nits (a |
Fixes #432
Where each point of #432 stands
files/pendingkeys must be repository pathsisRepoPath, a test row per bad shape).lostcounts cannot tell lines apartmain: CI before mergehas hadstrict_required_status_checks_policy: truesince 2026-11-18 (ruleset history version 58460387), so a list-editing PR has to be green on top of main's current list before it merges. That makes a list-hash check unnecessary. #398 and #412 merged before that change; main's list as it is now parses, and with this branch's script all three modes (below) exit 0.AFTER_REBASE_RISE).findDuplicateKey,printable(control, bidi and invisible characters), the fork-follow message, and named tests.announcedmust be a known keyWhat this PR changes (point 1, the general rule)
Before: from upstream,
findHiddenUpstreamFilesrefuses any upstream file that a pull request's run would take for a fork file, because of its name (fork-*,forkName*, …) or aforkFilespattern. Upstream has its own thread-"fork" feature and names files after it, so each new file like that stopped fork-follow after the rebase until someone added a!entry with a pull request. That is what happened withscripts/scenarios/fork-title-regenerates-from-inherited-history.e2e.ts.Now: right after a rebase that writes a lowered list (
--after-rebase --lowered-list, which is how fork-follow always calls it), each such file goes intolowered.hidden.lowerListtakes it out of the fork's files, in the lowering commit fork-follow already makes:forkFilesnames exactly that path, the entry is removed;!pathis added (it replaces the exact entry when the name alone would still take it).The lowered list is parsed again, and fork-follow checks it once more before going on, as it already does for counts.
Why this is safe, and why #436's reason for not doing it does not apply here: #436 turned down the rule "a file upstream has is never a fork file" because a pull request's run has no upstream commit, so it cannot apply that rule. This PR does not change the pull request's run. It changes the list that run reads, and only ever makes it stricter: an excluded file is judged as upstream's. The run from upstream already judges every file as upstream's (
findUnlistedChangesignoresisForkFilethere), so a fork change in such a file is still refused and nothing is written. Before a rebase, or after one without a list to write, the file is still refused, because nothing would commit the exclusion and main's pull request runs would keep the gap.Small extras: a comment in
fork-follow.sh, one sentence of the run summary ("…and each excluded file is upstream's"), and the docs indocs/fork/updates.md. The commit subject fork-follow writes stays "fork seams: lower counts after the rebase onto …"; the body lists each change.Proof
origin/main'sfork-seam-check.cjs):node --test .github/scripts/fork-seam-check.test.cjs: both new tests fail (the CLI one is refused with "Fork changes to upstream files must stay within the seam lines"; thelowerListone throws because nothing is lowered). With the change: 87/87 pass.bash .github/scripts/fork-follow.test.sh: the two new plan checks fail on the old code ("2 failed"). With the change: all pass.!scripts/scenarios/fork-title-…e2e.tsentry taken out (scratch commit, since reset), fromv0.1.11-nightly.20261119.4954:--from-upstreamexits 1 and names the file, as before;--from-upstream --after-rebase --lowered-listexits 0 and writes exactly the!entry fork seams: announce a new seam line, then add it; list guards and operator messages (#409, #432) #436 added by hand.--from-upstream,--from-upstream --after-rebase --lowered-list(writes nothing) and the PR shape--config-ref origin/main origin/main HEADall exit 0.State question
--after-rebase --lowered-list,--after-rebaseand plain run all exit 0, lower nothing and write no file (tested). fork-follow's plan test also runs the next plan from the new base and shows it releases with no new lowering.forkFileskey gets["!path"](tested);!path(tested);hiddenset tolowerList(the older{pending, lost}shape) work as before (existing tests).General vs project
forkFiles,.github/fork-seams.jsonand fork-follow's lowering commit are this fork's. The script reads them from the list, not from code.🤖 Generated with Claude Code