perf(ci): cache dependencies, Jest transforms, and TSC build info + remove duplicate docs:sync#202
Conversation
Adds actions/cache for node_modules (keyed on yarn.lock) and agent/.venv (keyed on uv.lock). Includes timing instrumentation via SECONDS and ::notice annotations to measure cache-hit vs cold install performance across runs. Expected: Install step drops from ~75s (cold) to ~5s (cache hit). Refs #201 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sets cacheDirectory to <rootDir>/.jest-cache (off tmpfs, persists locally) and caches it in CI via actions/cache keyed on yarn.lock + commit SHA with restore-keys fallback for cross-branch reuse. Expected: test step drops from ~90s to ~40-50s on cache hit since ts-jest skips re-transpiling unchanged source files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
No-op commit to trigger a second CI run where caches are warm. Compare Install/Build timing annotations with the prior cold run. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previous warm run missed jest cache (cold run was still saving). Now all three caches are fully saved. This run validates full hit. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Caches cdk/tsconfig.tsbuildinfo and cli/tsconfig.tsbuildinfo keyed on source file hashes with restore-keys fallback. Enables tsc incremental compilation to skip unchanged files (~10-20s savings). - Removes redundant `//docs:sync` from root tasks.build — already runs as a dependency of `//docs:build` (~5s wasted per build). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Thanks for pushing this forward — solid incremental step on #201 (P0/P2/P3/P4). CI is meaningfully faster on warm runs without changing the mutation gate. A few notes for the thread; nothing blocking from my side. What looks good
Measured impact (expectations)
Potential gaps (low risk, worth awareness)
Suggested follow-ups (optional, post-merge)
Happy to approve once the above is acknowledged — nice work on measurable CI wins without touching the self-mutation contract. |
v4.2.3 runs on Node 20 which is deprecated and will be forced to Node 24 starting June 2, 2026. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Thanks for the thorough review — all fair points. Addressing each: Gap 1 (Install never short-circuits): Intentional. Gap 2 (Lockfile-only keys): Agreed this is the correct tradeoff. Any meaningful dep change should bump the lockfile. Manual cache bust via GitHub UI handles edge cases. Gap 3 (TSC restore-keys breadth): Valid — I'll add Gap 5 (TSC incremental without Gaps 4/6/7: All acknowledged, no action needed. Squash commits: Will squash the three empty "trigger CI" commits on merge. Node 20 deprecation: Already addressed — the latest commit upgrades P1 (parallelism) is already drafted in PR #203 — a ~20-line |
Tightens the cache key to invalidate when tsconfig.json or tsconfig.dev.json change, not just source files. Prevents stale .tsbuildinfo from surviving config changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ensures tsc generates .tsbuildinfo for incremental compilation. While `tsc --build` implies incremental, being explicit guarantees the behavior regardless of invocation mode. Verified locally: CDK compile: 16s cold → 0.16s incremental (99% faster) CLI compile: 4s cold → 0.14s incremental (97% faster) Also adds *.tsbuildinfo to .gitignore. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Updates addressing review feedback: Gap 3 resolved (commit Gap 5 resolved (commit
Also added
Ready for re-review when convenient. |
|
thanks ! |
|
Good catch on the wording — but it's already covered! The cache key includes both:
|
Summary
Implements P0–P4 from issue #201 (CI optimization plan):
node_modules(192MB, keyed onyarn.lock) andagent/.venv(125MB, keyed onuv.lock)cacheDirectory(keyed onyarn.lock+ SHA with restore-keys)tsconfig.tsbuildinfo, keyed on source hashes)//docs:sync— already runs as a dependency of//docs:buildAlso includes timing instrumentation (
SECONDS+::notice) to measure cache impact.Measured results (from CI runs on this PR)
The ~4min improvement on the warm run came primarily from node_modules cache (yarn skips install) and Jest transform cache. The third run (all 3 caches hit) is in progress.
Cache strategy
node_modulesnode-modules-{os}-{hash(yarn.lock)}agent/.venvagent-venv-{os}-{hash(agent/uv.lock)}jest-{os}-{hash(yarn.lock)}-{sha}tsc-{os}-{hash(src/**)}Other changes
cdk/package.json: adds"cacheDirectory": "<rootDir>/.jest-cache"(moves Jest cache off tmpfs — also fixes local /tmp ENOSPC).gitignore: adds.jest-cachemise.toml: removes redundant//docs:syncfromtasks.buildTest plan
Refs #201
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com