chore(gates): eager-closure budgets ratchet against merge-base with per-category ceilings - #2257
Conversation
Size Report
npm unpacked components
Startup median (7 runs, lower is better):
Top changed chunks: no changes in the largest emitted chunks. Top changed packed filesNo changed packed files. |
|
BLOCKED at Implementation review is clean and CI on this exact head is green, but GitHub reports this PR as |
The eager-import-closure walker read the working tree directly through fs, so every consumer could only ask about the checkout in front of it. Closure computation now takes a SourceTreeReader; the working tree stays the default, and a committed git tree answers the same four questions for any tree-ish without checking it out -- one `git ls-tree` for the tracked set and one long-lived `git cat-file --batch` for the sources the walker can reach. Per-tree memoization of package directories and direct edges, plus a content-keyed parse cache, keep a second tree paying only for what differs.
…er-category ceilings The 202 façade and 6 hub numeric pins are gone. The six platform façades stay exact at one module, every other existing entry may evaluate no more than the same file evaluated at the merge-base with origin/main (renames followed), and an entry that did not exist there fits a per-category ceiling derived from its path, or carries an APPROVED_OVER_CEILING row naming issue, reason and owner. Shrinking now needs no gate edit, and a stale approval fails. The standing denial -- a façade closure never reaches a concrete platform implementation before discovery or binding selects an owner -- is unchanged.
…aders in sync Address review findings on the eager-closure merge-base ratchet. - docs/agents/testing.md: drop the new bullet. The file was 386 bytes over the 10,000-byte focused-doc budget, and the gate module's header already owns the invariant, so the prose was duplication the ownership rule forbids. - The closure walker's relative resolver no longer tries a .tsx suffix. The repo defines a production source as .ts (tracked-sources.ts pathspecs and isProductionSourceFile), so the committed-tree reader never loads .tsx content; resolving one produced an edge that reader could not read, crashing the ratchet instead of failing it. - The APPROVED_OVER_CEILING staleness check now looks only at entries still first-introduced. Once the merge-base carries an entry, the no-growth rule governs it and nothing reads its row again, so the row is stale for the same reason a shrunk entry's row is.
fff8946 to
3db93b7
Compare
|
Rebased onto Both hunks were in the same spot: main's #2236 bumped the old hand-pinned
|
|
READY at this exact head. The gate now reads the committed merge-base explicitly, distinguishes carried from introduced entries, applies category ceilings only to introduced growth, and invalidates stale approvals after shrink/carry/disappearance. Regression and planted-red evidence cover growth, ceilings, shrink, approval staleness, rename, and base-tree reading. Exact-head CI is green; the tooling-only diff is net negative and owes no device proof. |
|
Summary
The 202 façade and 6 hub numeric pins are gone.
packages/platform-*/src/index.tsfaçades stay EXACT at one module.origin/mainmay evaluate no more modules thanit did there, renames followed. Shrinking needs no edit; growth names the entry, both counts, and
the chain.
provisionally today's p75. Over it, one
APPROVED_OVER_CEILINGrow of issue, reason, owner, nonumber; the row goes stale once nothing reads it — entry gone, carried, or closure fits.
ls-treeplus ONEcat-file --batch, base closure cached.It resolves
.tsonly — the repo's production-source definition — so the committed-treereader reads every edge it produces.
Runtime: 4.25 s → 8.34 s.
Validation
At
fff8946481f8c1b9f58db2a953a4e622e8e976e9:vitest runover this gate and four otherwalker consumers (451 passed),
tsc --noEmit, oxlint, and the guidance-budget contract — green.Planted red there — an
APPROVED_OVER_CEILINGrow for the carriedsrc/cli.ts(closure 380,ceiling 71):
These approvals name an entry ... that the merge-base now carries ...: expected [ 'src/cli.ts' ] to deeply equal []. Growth, ceiling and shrink reds taken at8f139c7784.Full affected gate: green at fff8946 (check:affected --run;
gates run: format,lint,typecheck,layering,di-seams,fallow,mcp-metadata,build,package,integration-node,macos-coverage,vitest-related,integration-progress,replay-compat,daemon-wire-compat,affected-selector,gate-manifest,gate-manifest-model,depgraph,tmpdir-leaks,tmpdir-leaks-model,coverage-model,wire-compat-model,production-exports,bundle-owner-files,fixture-cache,fixture-fallback,command-docs,agent-guidance,xctest-selection,maestro-conformance,mutation-model).
Tradeoffs
package-boundaries.tssays "budget table"; out of scope.testing.mdhas no headroom.