perf(gate): incremental TS gate — tsc --incremental + eslint --cache (closes #213)#214
Open
yuyu04 wants to merge 1 commit into
Open
perf(gate): incremental TS gate — tsc --incremental + eslint --cache (closes #213)#214yuyu04 wants to merge 1 commit into
yuyu04 wants to merge 1 commit into
Conversation
…(F-bfe14aac) The TypeScript type and lint gates re-ran from scratch every gate. They now reuse a build cache: `tsc --noEmit --incremental` (build-info file) and `eslint --cache`, both under `.cladding/cache/` (already gitignored, so a managed project's tree stays clean). Measured on cladding's own repo (unchanged re-run — the local pre-commit/ pre-push loop): tsc 2.7s → 1.1s, eslint 2.5s → 0.6s (~3.4s saved). SOUND, not a shortcut: with a stale build-info present, a newly-introduced type error in an included file is STILL caught (verified — tsc rebuilds the affected program slice; eslint --cache keys on file+config hash). Cold runs (fresh CI checkout) just rebuild the cache — no regression. Test execution is deliberately NOT scoped: a gate must certify the whole tree, so changed-files / test-selection (unsound for a gate) was avoided. The dominant test cost (~20s) and the unit+coverage double-run (~9.5s) are noted as separate follow-ups. Existing toolchain arg-pins updated; blind-authored test (incremental-gate.test.ts, 5). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
799126f to
147e83f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The TypeScript type & lint gates re-ran from scratch every gate. They now reuse a build cache —
tsc --noEmit --incremental+eslint --cache— written under.cladding/cache/. Closes #213.Why (measured, cladding's own repo)
clad checkrunstsc --noEmitandeslint .over the whole tree every time, with no incremental/cache flags.The win lands on the local dev loop (pre-commit/pre-push hooks, where the cache persists). Cold CI checkouts just rebuild the cache — no regression.
Soundness (the critical property)
A gate must never pass a broken tree. Verified by injecting a type error into an existing included file with a STALE build-info present:
tsc --noEmittsc --incremental(stale build-info)tsc --incrementalrebuilds the affected program slice;eslint --cachekeys the cache on file + config hash. The cache only skips proven-unchanged work.Explicitly NOT scoped (would be unsound)
Test execution (~20s — the dominant gate cost) is not scoped to changed files: a gate certifies the whole tree, and
vitest --changed/test-selection could let a regression in an "unrelated" file slip through. Left as a full run.What's in the box
src/stages/toolchain/detect.ts— TStype/lintgate args gain--incremental --tsBuildInfoFile .cladding/cache/tsc.tsbuildinfoand--cache --cache-location .cladding/cache/eslint. Caches under.cladding/(gitignored) — zero pollution of the managed project. test/coverage gates unchanged.tests/stages/incremental-gate.test.ts— blind-authored (5): the flags + cache paths are present, paths stay under.cladding/, test/coverage unchanged, non-TS languages unaffected.tests/stages/toolchain.test.ts— existing arg-pins updated to the new commands.Feature cycle
spec/features/incremental-ts-gate-bfe14aac.yaml(F-bfe14aac, 4 ACs) → implement → blind tests →clad doneGREEN. Single clean commit ondevelop.🤖 Generated with Claude Code