Repository navigation
fork seam check: allow promoting a pending file to a declared seam - #549
Conversation
A pull request may now move a file from "pending" to "files" while fork lines are left, when the change adds no fork line and the new entry's "added" lists exactly the copies left, each one the file has. The run from upstream then holds each of them to that entry. A move with "added": [] still needs no fork line left, and a pending file that stays pending keeps the exact ceiling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review (independent lens, head 4d4bd7a)No blocking findings. The move cannot widen the gate. Every move the PR run accepts either is right or is refused by the next fork-follow run on main. No fork line gets past both runs. What I checked:
Findings (most severe first)1. follow-up (strongly suggested; small): a move that also edits the file is held only by an honest
2. follow-up: the PR run still cannot tell an upstream line from a fork line. It can be closed for moves without much work.
3. follow-up: one condition has no test. Only
4. follow-up (wording):
State question (runs again / stops half-way / old or empty state)
The fork-follow end-to-end test (PR run, then Verdict: MERGE. Findings 1 to 4 are follow-ups. I suggest doing 1 in this PR, because it is a 3-line guard and #542 already meets it. |
Review of 4d4bd7a (merge-path lens): no blocking findings
Point 1: can the move widen the gate? No, not past fork-follow. The PR run needs the listed count to equal
Each variant whose list is wrong still passes the PR run, but fork-follow's first, plain seam run on main refuses it ( Point 3: fork-follow and main. A correct move passes both plain and Findings (all follow-up)
Verdict: MERGE. No blocking findings. I suggest folding finding 1 (hoist |
- With fork lines left, a move to "files" is allowed only in a list-only change (the file's text unchanged), so a stale "lost" cannot hide an upstream line swapped for a fork line. - A pending file may not gain a fork line whether it stays in "pending" or moves: the own list's "lost" can no longer raise the ceiling. - The listed-lines check also runs with no fork line left: the entry must then list none. - An "announced" line in a moved entry that the file already has is refused. - Tests for each new refusal and for "announced" lines in a moved entry; wording fixes; docs name the owner's check of a move's listed lines (#552 moves that check into CI). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-ups folded in (head 662f507)Both reviews said MERGE. These follow-ups are now in the PR. Each new refusal has a test that fails on the first commit's checker (6 tests fail there). Undoing each change on its own also fails at least one test.
Not folded in: B-5 (a stale branch whose listed lines are checked against the head, not main's tip). The merge queue makes this unlikely. It is left as a possible later addition to #552. Checks run locally:
|
Unblocks #542.
#542 makes
apps/web/src/components/settings/settingsSearch.tsa declared seam. It moves the file frompendingtofilesand lists its 2 remaining fork lines underadded. Main's checker refuses that move. Since #535, a file may leavependingforfilesonly when it has no fork line left. CI runs main's copy of the checker, so #542 can't fix this from inside the PR.The rule
A pull request may move a file from
pendingtofileswhile fork lines are left, but only when all of these hold:lostplays no part, so a stalelostcannot hide an upstream line swapped for a fork line. Trimming the file goes in its own PR under the pending rules; any growth goes in a later PR, judged under the newfilesentry.addedlists exactly as many copies as are left. The number left is the same exact count fork seam check: #506 lens follow-ups (exact pending ceiling, summary, tests) #535 computes: main's ceiling, plus lines added, less lines removed, less upstream lines put back. Fewer copies would leave a line undeclared. More copies would let a later PR add a line without announcing it first. Onlyaddedcounts here. Anannouncedline is for a future line, and the run from upstream refuses one the file already has.announcedline in the new entry is already in the file. An announced line is one a later change adds.Nothing else in #535 changes:
"added": []still needs no fork line left. Its refusal now also names the other fix ("or list exactly those N lines underadded"). With no fork line left, the entry must list none (before, any lines passed).pendingor moves. Before, a file that stayed pending could swap an upstream line for a fork line if its own list raised both the ceiling andlost.Why it is safe, and what fork-follow expects
From upstream (
fork-follow.sh,seam_run), afilesentry is judged byfindSeamBreaches: every copy the head has over upstream must be withinadded(plusannounced). Lost upstream lines are held tolostexactly as they are for a pending file. Afilesentry is never lowered (lowerListonly touchespendingandlost). So once the move merges, the next fork-follow run on main checks each moved fork line against the new entry, and a line can't be hidden.There is one limit. A pull request's run has no upstream commit, so it can check how many fork lines are listed but not which ones they are. If an upstream line is listed in place of a fork line, the count still matches and the PR run passes. The next fork-follow run then refuses main, naming the unlisted line. One test asserts exactly this. The owner checks which lines are listed, the same review every seam entry already gets, with the
--from-upstreammerge-base command the docs now give. Follow-up #552 moves that check into CI.I checked this explicitly with an end-to-end test (
the command line lets a pull request make a pending file a seam, and fork-follow then passes main). It runs the real checker on a throwaway repository through these steps:--config-refset to main, and passes.--from-upstreamagainst the upstream commit, both plain and with--after-rebase --lowered-list. Both pass, and no lowered list is written.The property test now also checks moves: a list-only move whose entry lists main's real fork lines passes the PR run and the run from upstream, and a move that edits the file while fork lines are left is refused. Every list the PR run accepts passes the run from upstream. The right pending list passes the PR run whenever the change neither grows the file nor gains a fork line, and is refused otherwise.
#542 under the new checker
I ran it as the "Fork lines in upstream files" step does, with this branch's head as
--config-refand current main as the base:Main's checker on the same commits exits 1 with the refusal quoted in #542. The 2 lines #542 lists are the only lines in the file marked as the fork's, which matches main's ceiling of 2.
Review follow-ups (second commit)
Both reviews said MERGE; these follow-ups are folded in:
pendingtoo (B-1).announcedline the file already has is refused in a moved entry (B-4).announcedlines in a moved entry (A-3 / B-6), and wording fixes (A-4).Tests
node --test .github/scripts/fork-seam-check.test.cjs: 82 pass. Against the first commit's checker, 6 of them fail; each new refusal and theannouncedcounting each also fail a test when undone one at a time. From the first commit:announcedline);announced, or an announced line the file has;lostswap);node --test .github/scripts/*.test.cjs: 287 pass.vp lintandvp fmt --check: clean (lint has only warnings, none new).Upstream fit
Only fork files change:
.github/scripts/fork-seam-check*.cjsanddocs/fork/updates.md. No upstream file gains a line.General vs project
General: the rule fits any fork that follows upstream with this seam check. A file whose fork lines predate counting can become a declared seam once its lines are named, without moving them out first. Project: none. The only project fact is that #542's
settingsSearch.tsentry is the first to need the move, and that is in #542, not here.🤖 Generated with Claude Code