Skip to content

chore(gates): layering baselines ratchet against merge-base - #2299

Merged
thymikee merged 2 commits into
mainfrom
claude/gates-layering-baselines-merge-base
Sep 5, 2026
Merged

chore(gates): layering baselines ratchet against merge-base#2299
thymikee merged 2 commits into
mainfrom
claude/gates-layering-baselines-merge-base

Conversation

@thymikee

@thymikee thymikee commented Sep 5, 2026

Copy link
Copy Markdown
Member

Summary

R6 (type-only spine inversions per zone pair), R9 (largest type-level cycle, whole and per zone)
and R10's R7 ownership pressure stop comparing against hand-edited constants. Each now measures
the merge-base with origin/main and compares it with the working tree, through the same
functions on both sides.

For a change author: growth still fails with the same message shape (now "baseline N at the
merge-base"), a shrink needs no edit and is banked on merge, and no PR can leave a number above
the tree to spend later. TYPE_INVERSION_BASELINE, LARGEST_TYPE_CYCLE_ZONE_CEILINGS,
TYPE_CYCLE_BASELINE and DAEMON_MODULARITY_BASELINE.sessionState are deleted;
externalDaemonTypesImporters stays, because it names files rather than counting them. R9's
per-zone overflow now names the file that joined instead of listing the whole zone, because the
reference carries membership.

The base tree is read through the committed-tree reader from #2257 (one git ls-tree, one
git cat-file --batch, no second checkout) and one memoizing parser serves both trees, so
pnpm check:layering is unchanged at ~12 s. Repo Guards now checks out full history for it.

Validation

At b7a15dd: pnpm check:layering (209 rule tests + gate), depgraph:test,
check:gate-manifest, check:fallow, check:quick, format:check, and the reader's existing
consumer scripts/__tests__/eager-closure-budgets.test.ts (418 tests).

Planted red, each via node --experimental-strip-types scripts/layering/check.ts:

  • R6, one new commands -> client type import: inversions grew to 4 (baseline 3 at the merge-base)
  • R9, one file pulled into the provider-webdriver cycle: grew to 7 files (baseline 6 at the merge-base)
  • R10, one new writer of session.snapshot: R7 ownerFileClaims grew to 23 (baseline 22 at the merge-base)
  • Shrink: deleting one mcp -> client inversion leaves the gate green (exit 0, "R6, 4 remaining")
    with no edit; the old equality pin failed that case.

Full affected gate: green at c3dca6e (pnpm check:affected --run; 32 local gates incl. format/lint/typecheck, layering, di-seams, fallow, mcp-metadata, build, package, integration-node/progress, macos-coverage, vitest-related, replay-compat, daemon-wire-compat, affected-selector, gate-manifest(-model), depgraph, tmpdir-leaks(-model), coverage-model, wire-compat-model, production-exports, bundle-owner-files, fixture-cache/fallback, command-docs, agent-guidance, xctest-selection, maestro-conformance, mutation-model; rest GitHub-authoritative)

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 2.61 MB 2.61 MB 0 B
JS gzip 879.1 kB 879.1 kB 0 B
npm bundled raw 2.61 MB 2.61 MB 0 B
npm bundled gzip 879.1 kB 879.1 kB 0 B
npm tarball 1.04 MB 1.04 MB -3 B
npm unpacked 3.52 MB 3.52 MB 0 B
npm clean-installed 3.52 MB 3.52 MB 0 B

npm unpacked components

Component Base Current Diff
JS / dist source 2.77 MB 2.77 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
Apple Simulator snapshot bridge source 30.5 kB 30.5 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.7 kB 46.7 kB 0 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.6 ms 27.0 ms +0.4 ms
CLI --help 82.1 ms 77.5 ms -4.6 ms

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

Top changed packed files

No changed packed files.

@thymikee
thymikee force-pushed the claude/gates-layering-baselines-merge-base branch from b7a15dd to c3dca6e Compare September 5, 2026 17:38
R6 type-spine inversions, R9's largest type cycle and R10's R7 ownership
pressure now compare the working tree with the same measurement taken over
the merge-base with origin/main, read through the shared committed-tree
reader (one git ls-tree, one git cat-file --batch, no second checkout).
Growth still fails with the same message shape, a shrink needs no edit, and
no change can bank headroom by leaving a number above the tree.

R9's per-zone check gains membership from the reference, so the overflow
message names the file that joined instead of listing the whole zone.
TYPE_INVERSION_BASELINE, LARGEST_TYPE_CYCLE_ZONE_CEILINGS, TYPE_CYCLE_BASELINE
and DAEMON_MODULARITY_BASELINE.sessionState were the hand-edited references
these three ratchets compared against. The merge-base measurement replaces
them, so there is no number left to leave above the tree and no entry to raise.
externalDaemonTypesImporters stays: it names files, not a count.
@thymikee
thymikee force-pushed the claude/gates-layering-baselines-merge-base branch from c3dca6e to d9db522 Compare September 5, 2026 18:15
@thymikee

thymikee commented Sep 5, 2026

Copy link
Copy Markdown
Member Author

Rebased onto current origin/main (past #2293 R12 retirement and #2294 navigation-projection retirement). Conflicts were in scripts/layering/check.ts and docs/dependency-graph-findings.md, both on the same hunk: main's rewritten R6 commentary (reflecting the retired projection) vs. this PR's replacement of that commentary with a short placeholder ahead of deleting TYPE_INVERSION_BASELINE. Resolved by keeping this PR's placeholder/rewording while carrying forward main's updated projection-retired content, since the whole block is deleted by this PR's second commit anyway. No rule id or deleted constant was resurrected.

New head: d9db522555.

Focused checks all green post-rebase: pnpm check:layering, pnpm check:quick, pnpm depgraph:test, pnpm check:fallow, pnpm format:check.

Re-verified the planted reds still fire with the same shape: R6 (commands→client grew 3→4), R9 (largest type cycle grew 6→7 via provider-webdriver), R10 (ownerFileClaims grew 22→23), each reported against the merge-base as before; reverted after confirming.

The full affected gate will be re-run on this head by the serialized gate stage.

@thymikee

thymikee commented Sep 5, 2026

Copy link
Copy Markdown
Member Author

Reviewed d9db522: no actionable findings. R6/R9/R10 use the existing committed-tree reader and shared measurements; growth fails and shrink needs no hand-edited ceiling. Full-history CI checkout supplies the merge-base, and post-rebase planted-red evidence covers each ratchet. Tooling-only, zero unpacked growth. Code-review clean; remaining CI must finish before an unconditional merge-ready claim.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 5, 2026
@thymikee
thymikee merged commit 006f2d9 into main Sep 5, 2026
18 checks passed
@thymikee
thymikee deleted the claude/gates-layering-baselines-merge-base branch September 5, 2026 18:48
@github-actions

github-actions Bot commented Sep 5, 2026

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

thymikee added a commit that referenced this pull request Sep 5, 2026
* origin/main:
  perf: bundle runtime dependencies and report full install size (#2310)
  ci: avoid unrelated Apple runner cache invalidation (#2303)
  fix(web): preserve the backend ref so snapshot refs match actionable refs (#2283)
  test(daemon): session-open-url-prewarm through the request seam (#2304)
  test(daemon): session-devices-batch-runtime through the request seam (#2305)
  chore(gates): layering baselines ratchet against merge-base (#2299)
  test(daemon): one typed conformance helper for the daemon runtime suites (#2298)
  chore(layering): derive the contracts export inventory from package.json (#2297)
  perf: bundle tar-stream to reduce install footprint (#2286)
  docs: simplify agent context and resolve conflicting guidance (#2287)
  refactor(cli): let help resolve command aliases itself and retire R12 (#2293)
thymikee added a commit that referenced this pull request Sep 5, 2026
* origin/main:
  perf: bundle runtime dependencies and report full install size (#2310)
  ci: avoid unrelated Apple runner cache invalidation (#2303)
  fix(web): preserve the backend ref so snapshot refs match actionable refs (#2283)
  test(daemon): session-open-url-prewarm through the request seam (#2304)
  test(daemon): session-devices-batch-runtime through the request seam (#2305)
  chore(gates): layering baselines ratchet against merge-base (#2299)
  test(daemon): one typed conformance helper for the daemon runtime suites (#2298)
  chore(layering): derive the contracts export inventory from package.json (#2297)
  perf: bundle tar-stream to reduce install footprint (#2286)
  docs: simplify agent context and resolve conflicting guidance (#2287)
  refactor(cli): let help resolve command aliases itself and retire R12 (#2293)
  refactor(commands): retire the navigation-only type projection (#2294)
  feat(runtime): route managed leases through contained transports (#2285)
  refactor(contracts): build unavailable runtime facts once (#2291)
  refactor(cli): derive the common flag readers from the common-field table (#2292)
  feat(daemon): add managed allocation operation journal (#2284)
thymikee added a commit that referenced this pull request Sep 5, 2026
* origin/main:
  perf: bundle runtime dependencies and report full install size (#2310)
  ci: avoid unrelated Apple runner cache invalidation (#2303)
  fix(web): preserve the backend ref so snapshot refs match actionable refs (#2283)
  test(daemon): session-open-url-prewarm through the request seam (#2304)
  test(daemon): session-devices-batch-runtime through the request seam (#2305)
  chore(gates): layering baselines ratchet against merge-base (#2299)
  test(daemon): one typed conformance helper for the daemon runtime suites (#2298)
  chore(layering): derive the contracts export inventory from package.json (#2297)
  perf: bundle tar-stream to reduce install footprint (#2286)
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