Skip to content

fix(diffs): sort *.gen.* files and drizzle-kit metadata as generated - #933

Merged
incognitojam merged 1 commit into
mainfrom
styal/diff-sort-generated-files
Oct 20, 2026
Merged

incognitojam merged 1 commit into
mainfrom
styal/diff-sort-generated-files

Conversation

@incognitojam

Copy link
Copy Markdown
Owner

Drizzle projects' pull requests and diffs listed drizzle/meta/_journal.json and the drizzle/meta/NNNN_snapshot.json files as source, so hundreds of lines of drizzle-kit bookkeeping sat above the code a reviewer needs to read and started expanded. TanStack Router's routeTree.gen.ts and other *.gen.* output had the same problem.

diffFileTier now classifies two more name patterns as generated:

  • *.gen.*, alongside the existing *.generated.*.
  • drizzle-kit's _journal.json and NNNN_snapshot.json, only when they sit directly in a meta/ directory.

The SQL migrations drizzle-kit writes stay in the source group, because they are what runs against the database. Repositories can still mark other generated paths through linguist-generated in .gitattributes. The classification is shared, so the change covers turn, working-tree, branch and pull request diffs on web and desktop, the changed-files card, and mobile review.

Validation

  • New diffFileTier cases: drizzle journal and snapshot files and routeTree.gen.ts are generated; drizzle/0004_small_mentor.sql, src/meta/settings.json and src/codegen.ts stay source. vp test run packages/shared/src/diffFileOrder.test.ts passes (25 tests).
  • Ran orderUnloadedDiffFiles on file names from a real drizzle pull request. The SQL migrations, README.md and src/ files come first, then home.test.ts, then the drizzle meta files, pnpm-lock.yaml and routeTree.gen.ts with the generated tag.
  • Not checked in a running client. The UI already labels and folds the generated group, and this change only adds file names to it.

Written by an agent (Claude Code, claude-opus-5-5).

@github-actions

Copy link
Copy Markdown

Upstream divergence

Both sides are compared with upstream at the in-order tip 0ecb25a8d4. Excludes .repos/ and pnpm-lock.yaml.

Measure Base This PR Change
Upstream files the fork changes 1,505 1,504 −1
Lines changed in them 78,367 78,252 −115
Upstream files the fork removes 42 43 +1
Fork-only files 549 550 +1
Fork-only lines 101,106 101,385 +279

Upstream files that start to differ (1)

  • apps/web/src/components/pullRequest/pullRequestFileOrder.logic.test.ts removed: +0 −164 from upstream
Upstream files whose difference changes (1)
File Change Now differs by
packages/shared/src/diffFileOrder.ts +5 163 lines

@github-actions

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ The exact PR base did not have a successful artifact. Baseline uses the latest successful main measurement shown below.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 4.9 KiB −23 B (−0.5%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB −23 B (−1.9%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 20.9 KiB 20.8 KiB −41 B (−0.2%) 29.3 KiB ✅
Codex Live turn messages 2 1 −1 (−50.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅
Claude Live turn messages 2 2 0 (0.0%) 8 ✅

Baseline: 93cd1b4 · PR result: 92f7863 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@incognitojam
incognitojam merged commit 76e1fa9 into main Oct 20, 2026
30 checks passed
@incognitojam
incognitojam deleted the styal/diff-sort-generated-files branch October 20, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant