test(closure): read committed JSON modules on the merge-base side

Merged
TH
4d ago
+32-40

Problem

On current main (c137b5b4d), scripts/__tests__/eager-closure-budgets.test.ts fails at module load:

packages/platform-android/src/fixtures/android-ime-capture.raw.json is not a source the closure walker reads at c137b5b4d…

#3517 made packages/platform-android/src/ui-hierarchy.fixtures.ts, which is the ./ui-hierarchy-fixtures export, import a .json capture. The working-tree reader reads that JSON. The committed-tree reader that builds the merge-base graph only serves TypeScript sources and package manifests, so building that graph and its weights throws. #3517's own CI passed because its merge base predated the import. Any branch whose merge base includes it now fails this lane.

Change

createCommittedSourceTree also reads tracked .json files under src/ and packages/<pkg>/src/ in the same single git cat-file --batch. Both sides of the gate now read the same files. readCommittedSources, which feeds the layering ratchets, is unchanged.

Main has a second failure in the same lane. #3517 added three APPROVED_OVER_CEILING rows for its fixture entries. Main now carries those entries, so on any branch where HEAD is not the merge base, no APPROVED_OVER_CEILING row is stale flags all three. This PR removes them, as the gate requires.

Tests

  • New: a JSON module imported at the merge-base is read from the committed tree. A fixture repo commits an entry that imports ./data.json, and the committed graph contains both files.
  • eager-closure-budgets, closure-growth-rule, cli-startup-import-closure and package-closure-audit all pass (1093 tests). On this committed branch, eager-closure-budgets and test-file-size-ratchet pass (1037 tests), including the stale-row check.
  • pnpm typecheck and pnpm lint are clean.

🤖 Generated with Claude Code