Skip to content

chore(gates): eager-closure budgets ratchet against merge-base with per-category ceilings - #2257

Merged
thymikee merged 3 commits into
mainfrom
claude/gates-eager-closure-merge-base
Sep 3, 2026
Merged

chore(gates): eager-closure budgets ratchet against merge-base with per-category ceilings#2257
thymikee merged 3 commits into
mainfrom
claude/gates-eager-closure-merge-base

Conversation

@thymikee

@thymikee thymikee commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary

The 202 façade and 6 hub numeric pins are gone.

  • The six packages/platform-*/src/index.ts façades stay EXACT at one module.
  • Every other entry present at the merge-base with origin/main may evaluate no more modules than
    it did there, renames followed. Shrinking needs no edit; growth names the entry, both counts, and
    the chain.
  • An entry absent at the merge-base fits a per-category ceiling derived from its path,
    provisionally today's p75. Over it, one APPROVED_OVER_CEILING row of issue, reason, owner, no
    number; the row goes stale once nothing reads it — entry gone, carried, or closure fits.
  • The walker takes a reader seam: one ls-tree plus ONE cat-file --batch, base closure cached.
    It resolves .ts only — the repo's production-source definition — so the committed-tree
    reader reads every edge it produces.
  • The platform-implementation denial is unchanged.

Runtime: 4.25 s → 8.34 s.

Validation

At fff8946481f8c1b9f58db2a953a4e622e8e976e9: vitest run over this gate and four other
walker consumers (451 passed), tsc --noEmit, oxlint, and the guidance-budget contract — green.

Planted red there — an APPROVED_OVER_CEILING row for the carried src/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 at 8f139c7784.

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.ts says "budget table"; out of scope.
  • No docs bullet: the gate header owns the invariant; testing.md has no headroom.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 2.59 MB 2.59 MB 0 B
JS gzip 871.3 kB 871.3 kB 0 B
npm bundled raw 2.59 MB 2.59 MB 0 B
npm bundled gzip 871.3 kB 871.3 kB 0 B
npm tarball 1.02 MB 1.02 MB +4 B
npm unpacked 3.47 MB 3.47 MB 0 B
npm clean-installed 3.47 MB 3.47 MB 0 B

npm unpacked components

Component Base Current Diff
JS / dist source 2.75 MB 2.75 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 20.3 ms 23.5 ms +3.1 ms
CLI --help 55.6 ms 52.0 ms -3.5 ms

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

Top changed packed files

No changed packed files.

@thymikee

thymikee commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

BLOCKED at fff8946481f8c1b9f58db2a953a4e622e8e976e9.

Implementation review is clean and CI on this exact head is green, but GitHub reports this PR as CONFLICTING / DIRTY. Resolve or rebase the conflict, then rerun the affected gates on the new head; the existing CI cannot establish readiness for a resolved head.

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.
@thymikee
thymikee force-pushed the claude/gates-eager-closure-merge-base branch from fff8946 to 3db93b7 Compare September 3, 2026 14:15
@thymikee

thymikee commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

Rebased onto main at 3726f027ce to resolve the conflict at 3db93b7bef7.

Both hunks were in the same spot: main's #2236 bumped the old hand-pinned HUB_BUDGETS['src/cli.ts'] from 380→382 while this PR deletes the whole pinned-budget table in favor of the merge-base ratchet, so the PR's side wins outright — no manual number to carry forward; the walker will measure src/cli.ts's new merge-base closure directly. docs/agents/testing.md had a second conflict from the same deletion (this PR's own third commit already drops the new doc bullet per the PR body's "no docs bullet" tradeoff); resolved to the doc's current main wording with no bullet added.

pnpm check:affected --run at 3db93b7bef7: all runnable checks green (57 selected, local-runnable ones passed, including agent-guidance, xctest-selection, maestro-conformance, mutation-model). CI re-triggered on the new head.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 3, 2026
@thymikee

thymikee commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

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.

@thymikee
thymikee merged commit e2ce985 into main Sep 3, 2026
18 checks passed
@thymikee
thymikee deleted the claude/gates-eager-closure-merge-base branch September 3, 2026 16:01
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-03 16:01 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