Skip to content

chore(gates): drop the test-file size pin map, keep the merge-base ratchet - #2238

Merged
thymikee merged 1 commit into
mainfrom
claude/gates-size-ratchet-no-pins
Sep 2, 2026
Merged

chore(gates): drop the test-file size pin map, keep the merge-base ratchet#2238
thymikee merged 1 commit into
mainfrom
claude/gates-size-ratchet-no-pins

Conversation

@thymikee

@thymikee thymikee commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

The test-file size gate had two rules: an exact-length pin map for every test file over 1,000 lines, and a history-backed rule against the merge-base. The pin map duplicated what git already records and turned every shrink into a two-file edit. This drops the pin map and the three assertions that served only it (pin equals file, pin not above base, pin-list-empty kill criterion).

Gate behavior for test authors now:

  • A test file over the 1,000-line tripwire may be no longer than at the merge-base with origin/main.
  • A file absent at the merge-base may not cross the tripwire.
  • Shrinking an over-tripwire file needs no gate edit.

Kill criterion: no test file under the walked roots exceeds the tripwire at the merge-base; delete the gate when that holds. docs/agents/testing.md no longer mentions pins; a stale citation in eager-closure-budgets.ts naming this gate as an equality-pin example is removed. Nothing else imported PINNED_TEST_FILE_LINES.

Validation

Focused: npx vitest run --project unit-core scripts/__tests__/test-file-size-ratchet.test.ts (3 passed), pnpm check:quick, pnpm check:gate-manifest, pnpm check:fallow, all clean at 63ed6a2.

Planted red: a scratch commit appending 3 lines to src/__tests__/cli-network.test.ts, same vitest command:

× no test file over the tripwire is longer than at the merge-base, and no new file crosses it
+ "src/__tests__/cli-network.test.ts is 1095 lines, 1092 at the merge-base: a test file over the tripwire may not grow; split it along the source module it mirrors (docs/agents/testing.md)."

Planted green: a scratch commit deleting 3 lines from that file, no gate edit, passed 3/3. Both scratch commits were discarded before push.

Full affected gate: pending (serialized gate stage will append the result)

…tchet

The exact-length pin map duplicated what the merge-base already records and
made every shrink a two-file edit. The gate now has one rule: a test file over
the 1,000-line tripwire may be no longer than at the merge-base with
origin/main, and no new test file may cross the tripwire.
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 2.58 MB 2.58 MB 0 B
JS gzip 868.4 kB 868.4 kB 0 B
npm bundled raw 2.58 MB 2.58 MB 0 B
npm bundled gzip 868.4 kB 868.4 kB 0 B
npm tarball 1.02 MB 1.02 MB -2 B
npm unpacked 3.46 MB 3.46 MB 0 B
npm clean-installed 3.46 MB 3.46 MB 0 B

npm unpacked components

Component Base Current Diff
JS / dist source 2.74 MB 2.74 MB 0 B
Apple runner source/project 544.4 kB 544.4 kB 0 B
Apple snapshot presentation source 33.8 kB 33.8 kB 0 B
macOS helper source 54.8 kB 54.8 kB 0 B
Android helper artifacts 43.3 kB 43.3 kB 0 B
Other package files 46.3 kB 46.3 kB 0 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 32.1 ms 31.9 ms -0.2 ms
CLI --help 87.3 ms 82.7 ms -4.6 ms

Top changed chunks: no changes in the largest emitted chunks.

Top changed packed files

No changed packed files.

@thymikee

thymikee commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

READY — clean review at this exact head. The merge-base test-file ratchet remains fail-closed for growth, threshold crossings, renames, and new/untracked giant tests; shrink-without-pin-edit is correctly allowed. The planted red/green evidence exercises the real Git-backed gate, docs match, and all exact-head CI is green. No code findings.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 2, 2026
@thymikee
thymikee merged commit fbf6097 into main Sep 2, 2026
19 checks passed
@thymikee
thymikee deleted the claude/gates-size-ratchet-no-pins branch September 2, 2026 18:49
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-02 18:50 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant