Repository navigation
fork seams: judge the route tree as generated output; announce the Fork settings page lines - #542
Conversation
Review (independent, Opus)Head reviewed: Verdict: 1 blocking finding. The seam-check side is correct, and the proof test does what it says. But the PR itself controls the proof's contents, so a PR can switch off its own guard. BLOCKINGB1. A PR can weaken the proof test and hand-edit the route tree in the same change, and both gates pass. fork-checks runs the seam script and the seam list from main ( Reproduced on top of this branch. Each scenario is a branch with a hand edit
So "hand edit + token route file + neutered proof" merges with every check green. The impact is limited: vite rewrites the working-tree copy, so the edit never reaches a build. It does leave a committed upstream file that is not generator output, which this PR says cannot happen. The fix is a few lines and keeps the main-pinned model. Fix: on a PR run, take the skip only when the proof is unchanged against main. Otherwise judge the tree line by line, or refuse with "change forkRouteTree.test.ts in its own PR". For example: if (atHead(generated.proof) === undefined || (!upstream && atBase(generated.proof) !== atHead(generated.proof))) reasons.push(...)The upstream run has no proof at its base, so it keeps the presence check. There it judges the head's own script and list anyway. Add a case to the new test: route change + changed proof → refused. (Residual, not counted: a PR can also edit SHOULD-FIXS1. The test copies the router plugin's options instead of reading them. The test builds its config from three hard-coded keys and the generator's defaults. Dev and builds use whatever Failure scenario: upstream adds a tree-shaping option such as Either read the plugin's options from the vite config, or have the test also fail with a clear message when S2. The state question "generator bump / clean rebase" is not covered by the docs. The docs only cover a rebase conflict in the tree. When upstream bumps Add to the same paragraph: "also when forkRouteTree.test.ts fails after a rebase or a router bump: regenerate and commit, in a list-free PR". If fork-follow can run this single test before pushing, even better. NITN1. The new seam-check case does not pin the trailing slash of Mutation test: changing N2. The old import and Checked and fine
Blocking findings: 1 |
|
Fix round for the review above. Head:
State question:
Run: seam-check tests 76/76; seam check as CI runs it (main's list and this branch's list) and |
|
Fixed the red Lint check (fork-owned-reads.test.py: app code read |
…rk settings page lines A fork route makes TanStack's generator add lines to apps/web/src/routeTree.gen.ts that repeat upstream's own (`} as any)`), which no seam entry can list. The seam check now skips that file's line rules when the same change touches apps/web/src/routes/, and a new fork test, apps/web/src/forkRouteTree.test.ts, runs the generator on the committed routes and requires the committed tree to match, so a hand edit is still refused. A tree change without a route change is judged line by line as before, and the skip needs the proof test in the change. The list announces the lines the Fork settings page needs: settingsSearch.ts moves from "pending" to a seam entry (its two lines kept, six announced), SettingsSidebarNav.tsx gets an entry for its icon, and the page's route file and the Review rules panel files become fork files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…main's On a pull request the seam check skipped routeTree.gen.ts whenever the proof test existed at the head, so a change could hand-edit the tree and weaken forkRouteTree.test.ts in the same commit. The skip now also needs the proof to be byte-identical to the list's commit (main); otherwise the tree is judged line by line and the refusal says why. From upstream the presence check stays. forkRouteTree.test.ts reads the router plugin's options from vite.config.ts's tanstackRouter(...) call (and tsr.config.json) through the plugin's own getConfig, and checks that the seam check's GENERATED table names the same tree and routes folder. A call that is not a plain literal fails with a clear message. docs/fork/updates.md: a router bump or a new option that rebases cleanly but stops fork-follow's release tests on this test; the fix is regenerating in the rebased series, not a tree-only PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route-tree proof test read .github/scripts/fork-seam-check.cjs to compare its GENERATED table with the router plugin's paths. App code must not read a fork-owned file (fork-owned-reads.test.py): a fork-only change to the script would skip the app job that reads it. That is a real read, not a name NOT_READS may excuse. So fork-seam-check.test.cjs now reads apps/web/vite.config.ts (and tsr.config.json if present), resolves the routes folder and tree, and checks GENERATED names them, that the files and proof exist and the folder ends with /. The proof test no longer opens the script; it pins what the plugin resolves vite.config.ts's options to (apps/web/src/routes/, apps/web/src/routeTree.gen.ts), so a change to either side fails the test its own jobs run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
73796c2 to
c50b20a
Compare
|
Rebased onto main (after #535 and #540); #543 and #544 rebased on top with Text conflicts
Semantic conflict with #535 (not fixed here, needs a decision)
#535 lets a pending file move to "files" only when it has no fork line left, even when the new seam entry lists those lines in Route tree Local checks on all three branches: typecheck, lint, |
The fork's settings are moving to one Settings page, "Fork" (
/settings/fork). This pull request clears the way for it. It is the gate pull request; the page itself comes in the stacked pull requests after it.Problem
The seam check refuses a new settings route for two reasons:
apps/web/src/routeTree.gen.ts. A fork route's block repeats lines upstream already has (getParentRoute: () => ChatSettingsRoute,,} as any)), and a pull request can never add a seam line that upstream also has.settingsSearch.tswas "pending" (it may not grow), andSettingsSidebarNav.tsxhad no entry.Fix
Route tree, judged as generated output. The seam check has a small
GENERATEDtable:apps/web/src/routeTree.gen.ts→apps/web/src/routes/. In a change that also touches a route file, the tree is not judged line by line. In every other case the old rules still apply:The skip also requires the proof test,
apps/web/src/forkRouteTree.test.ts, to be present in the change. That test runs TanStack's real generator (the router plugin's own dependency) on the committed route files and requires the committedrouteTree.gen.tsto match it byte for byte. So a hand edit to the tree fails CI even when a route file changed too.The test reads both the routes and the tree from git
HEAD, not the working tree. Every vite run, including the vitest run itself, rewrites the working-tree copy before any test reads it. I checked this: a hand edit in the working tree vanished at test start, and the same hand edit committed made the test red.Why not regenerate inside the seam check? The seam check runs on bare checkouts with no
node_modules(fork-checks and fork-tests' workflow job), so it cannot load the generator. Splitting the job keeps the seam check git-only, and the proof runs where dependencies are installed: the web unit tests.Seam list. These are step 1 (announce) for the page's lines:
settingsSearch.tsmoves frompendingto a seam entry. Its two existing lines stay inadded, and six lines are announced: the import, theSettingsPathmember, the label, the nav entry in the Agents group, the search scope, and the reworded comment on the fork items' spread.SettingsSidebarNav.tsxgets an entry announcingGitForkIcon,and its icon-table line.forkFilesadds the page's route file,apps/web/src/routes/_chat.settings.fork.tsx, and the Review rules panel files. Those panel files are not fork-named, so until now a fix to them was judged as an upstream file.docs/fork/updates.mdsays how the route tree is judged and what to do on a rebase conflict in it: take either side, regenerate, commit.Tests
fork-seam-check.test.cjsgets a new case, "the route tree is judged as generated output…". It covers the upstream run and the PR run: a route change with the proof passes; a tree change alone is refused as 3 fork lines; a route change without the proof is refused; a deleted tree is refused. The case was red before the script change (the forked lines were refused) and is green after.forkRouteTree.test.tsis green on main's routes and red on a committed hand edit (checked locally).vp run check:changed: format, lint, knip, typecheck (42 packages) and the touched tests all pass. The seam check run as CI runs it (--config-ref origin/main origin/main HEAD) passes.Upstream fit
No upstream source file changes. The changed files are the fork's CI script, its list, its docs and one new fork test. Upstream's
routeTree.gen.tsstays generator output; this only stops the check from treating generated lines as hand-written ones.General vs project
Nothing here is a setting. The page's own settings follow in the stacked pull requests.
Screenshot
None: no visible change.
State question
Stacked after this: PR A (the Fork page, the moved sections and usage pacing), then PR B (updates, handoff, playtest).
🤖 Generated with Claude Code