Repository navigation
Seam check: count pending-file text changes from upstream; refuse duplicate keys and dropped announcements (#796, #813) - #939
Conversation
…licate keys and dropped announcements (#796, #813) - A pull request that changes a pending file's text is now counted from upstream in its run, against main's ceiling and lost entry, even with its list unchanged. Swapping an upstream line for a fork line kept every count the run could see, so it passed and fork-follow refused it after the merge. - Every list the checker reads (main's, the merge-base's, fork-follow's head) now refuses a duplicate key, naming the commit and the key. Before, only the pull request's own list was checked. - A pull request that changes a file and whose list drops an in-date announcement on main's list is refused. A list-only pull request may still withdraw one, and an expired one may go in any change. - Tests for each fix (each fails without it); docs updated. Fixes #796 Fixes #813 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… cause Lint: comments keep the reason, not the issue number; the JSDoc of findDroppedAnnouncements fits in four lines; readConfigAt's rethrow keeps the original error as its cause. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
lens: merge-path · reviewer: lens agent (Opus 5.5) · read at: 2a2d3b6 |
|
lens: code · reviewer: lens agent · read at: 2a2d3b6 |
|
override for head 2a2d3b6: the merge-path lens's only major was the PR body's "Fixes #813"; the body now says "Part of #813" and #813 lists what is left (#813 (comment)). No code changed. The code lens is safe; both lenses' minors are on #813 or need no change (the up-to-date required checks close the skipped-count cases). |
What and why
Three gaps in
.github/scripts/fork-seam-check.cjs:pendingfile whose ceiling (andlostentry) was already reached, a PR could swap an upstream line for a fork line with its list unchanged: every count stayed the same, the PR's run passed, and fork-follow refused main after the merge (fork lines and lost counts rose). Fix: a PR that changes a pending file's text is now counted from upstream in its own run (fork-checks), against main's ceiling andlostentry, even with its list unchanged. Untouched pending files still need no upstream fetch.--no-upstream(fork-tests) prints a note, as for list edits.JSON.parsekeeps the last of two equal keys. Only the PR's own list was checked for duplicates. Main's list, the merge-base's list and fork-follow's head list were parsed without the check, so a duplicate there was silently halved. Fix:parseConfigitself refuses a duplicate key, so every list read is checked. A bad list read at a commit names that commit, e.g..github/fork-seams.json at <sha12>: duplicate key "a.ts" (...): merge them into one entry.announcedor move toaddedin the change that adds it. A list-only PR may still withdraw one on purpose, and an expired announcement may go in any change. The count is per copy: it only refuses copies the merge-base already had (or main's, when the merge-base list cannot be read).docs/fork/updates.mdnow describes all three.Not covered here (#813 part 3): the Settings → Fork note for threads not loaded in this window, and the thread-menu step-2 pull request. Neither is seam-check work; both stay open as follow-ups.
Tests (each fails without its fix)
The three new tests in
.github/scripts/fork-seam-check.test.cjs, run against main's script without this change:tests 3, pass 0, fail 3.0(expected1).1with only an unrelated refusal (adds import ...), never naming the key (expected exit3naming it).0(expected1).After the fix, the full file passes:
tests 117, pass 117, fail 0. One existing passing case ("dropped" in the step-2 test) now keeps main's in-date announcement in its list, because it had dropped it by accident. The duplicate-key message test now matches the shorter text.Other checks:
node .github/scripts/fork-seam-check.cjs --config-ref origin/main origin/main HEAD→ exit 0.vp fmt --check→ clean.Note: fork-checks runs main's copy of the checker (pull_request_target), so these checks apply to later pull requests once this merges. This PR is judged by today's rules.
State question
.github/fork-upstream.json, or with a bad URL, refuses a PR that changes a pending file's text ("cannot be counted"), the same as it already refuses list edits.General vs project
General: the seam checker, its tests and its doc are fork tooling for any fork that pins its seams this way. No project facts are added; the upstream URL still comes from
.github/fork-upstream.json.Fixes #796
Part of #813 (parts 1 and 2; part 3 stays open in #813)
🤖 Generated with Claude Code