From 4535aa3abfe75a2ea42f40c06b0ed896035da45b Mon Sep 17 00:00:00 2001 From: bgagent <345885+scottschreckengaust@users.noreply.github.com> Date: Wed, 27 May 2026 05:18:40 +0000 Subject: [PATCH 1/8] perf(ci): cache node_modules and agent .venv in build workflow 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) --- .github/workflows/build.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a7b8b8..797a3d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -158,10 +158,35 @@ jobs: uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: 22.x + - name: Cache node_modules + id: cache-node-modules + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + with: + path: node_modules + key: node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} + - name: Cache agent venv + id: cache-agent-venv + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + with: + path: agent/.venv + key: agent-venv-${{ runner.os }}-${{ hashFiles('agent/uv.lock') }} - name: Install dependencies - run: mise run install + env: + CACHE_NODE: ${{ steps.cache-node-modules.outputs.cache-hit }} + CACHE_VENV: ${{ steps.cache-agent-venv.outputs.cache-hit }} + run: | + echo "::group::Cache status" + echo "node_modules cache: ${CACHE_NODE:-MISS}" + echo "agent .venv cache: ${CACHE_VENV:-MISS}" + echo "::endgroup::" + SECONDS=0 + mise run install + echo "::notice::Install completed in ${SECONDS}s (node_modules=${CACHE_NODE:-miss}, venv=${CACHE_VENV:-miss})" - name: build - run: mise run build + run: | + SECONDS=0 + mise run build + echo "::notice::Build completed in ${SECONDS}s" - name: Upload CDK artifact (${{ matrix.compute_type }}) uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: From eb3f43ebf4aa0a4e3c6c1bb8003cf335ce19d19c Mon Sep 17 00:00:00 2001 From: bgagent <345885+scottschreckengaust@users.noreply.github.com> Date: Wed, 27 May 2026 05:34:40 +0000 Subject: [PATCH 2/8] perf(ci): add Jest transform cache with stable cacheDirectory Sets cacheDirectory to /.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) --- .github/workflows/build.yml | 16 +++++++++++++--- .gitignore | 1 + cdk/package.json | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 797a3d0..6c28f44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -170,18 +170,28 @@ jobs: with: path: agent/.venv key: agent-venv-${{ runner.os }}-${{ hashFiles('agent/uv.lock') }} + - name: Cache Jest transforms + id: cache-jest + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + with: + path: cdk/.jest-cache + key: jest-${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ github.sha }} + restore-keys: | + jest-${{ runner.os }}-${{ hashFiles('yarn.lock') }}- - name: Install dependencies env: CACHE_NODE: ${{ steps.cache-node-modules.outputs.cache-hit }} CACHE_VENV: ${{ steps.cache-agent-venv.outputs.cache-hit }} + CACHE_JEST: ${{ steps.cache-jest.outputs.cache-hit }} run: | echo "::group::Cache status" - echo "node_modules cache: ${CACHE_NODE:-MISS}" - echo "agent .venv cache: ${CACHE_VENV:-MISS}" + echo "node_modules: ${CACHE_NODE:-MISS}" + echo "agent .venv: ${CACHE_VENV:-MISS}" + echo "jest transforms: ${CACHE_JEST:-MISS}" echo "::endgroup::" SECONDS=0 mise run install - echo "::notice::Install completed in ${SECONDS}s (node_modules=${CACHE_NODE:-miss}, venv=${CACHE_VENV:-miss})" + echo "::notice::Install completed in ${SECONDS}s (node_modules=${CACHE_NODE:-miss}, venv=${CACHE_VENV:-miss}, jest=${CACHE_JEST:-miss})" - name: build run: | SECONDS=0 diff --git a/.gitignore b/.gitignore index ff85180..6f56332 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ pids coverage *.lcov .nyc_output +.jest-cache lib-cov report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json /test-reports/ diff --git a/cdk/package.json b/cdk/package.json index b76339a..fecad53 100644 --- a/cdk/package.json +++ b/cdk/package.json @@ -65,6 +65,7 @@ "node": ">= 20.x <= 24.x" }, "jest": { + "cacheDirectory": "/.jest-cache", "coverageProvider": "v8", "testMatch": [ "/@(src|test)/**/*(*.)@(spec|test).ts?(x)", From 5cc7e9e05c64875e24e20ce415be4069b4607574 Mon Sep 17 00:00:00 2001 From: bgagent <345885+scottschreckengaust@users.noreply.github.com> Date: Wed, 27 May 2026 05:37:10 +0000 Subject: [PATCH 3/8] ci: trigger cache-warm run (empty commit) 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) From ad11f0e07ff2b03bd2b1397eae0e01a88760f2c0 Mon Sep 17 00:00:00 2001 From: bgagent <345885+scottschreckengaust@users.noreply.github.com> Date: Wed, 27 May 2026 14:04:40 +0000 Subject: [PATCH 4/8] =?UTF-8?q?ci:=20trigger=20third=20run=20=E2=80=94=20a?= =?UTF-8?q?ll=20caches=20should=20be=20warm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) From ecfe55fac02e41d05a5f064fd4e39d1459ac9521 Mon Sep 17 00:00:00 2001 From: bgagent <345885+scottschreckengaust@users.noreply.github.com> Date: Wed, 27 May 2026 14:50:04 +0000 Subject: [PATCH 5/8] perf(ci): cache TypeScript build info and remove duplicate docs:sync MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- .github/workflows/build.yml | 10 ++++++++++ mise.toml | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c28f44..67b98f0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -178,6 +178,16 @@ jobs: key: jest-${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ github.sha }} restore-keys: | jest-${{ runner.os }}-${{ hashFiles('yarn.lock') }}- + - name: Cache TypeScript build info + id: cache-tsc + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + with: + path: | + cdk/tsconfig.tsbuildinfo + cli/tsconfig.tsbuildinfo + key: tsc-${{ runner.os }}-${{ hashFiles('cdk/src/**', 'cli/src/**') }} + restore-keys: | + tsc-${{ runner.os }}- - name: Install dependencies env: CACHE_NODE: ${{ steps.cache-node-modules.outputs.cache-hit }} diff --git a/mise.toml b/mise.toml index acafafc..274342f 100644 --- a/mise.toml +++ b/mise.toml @@ -160,7 +160,6 @@ run = [ "MISE_EXPERIMENTAL=1 mise //cdk:build", "MISE_EXPERIMENTAL=1 mise //cli:build", "MISE_EXPERIMENTAL=1 mise //docs:build", - "MISE_EXPERIMENTAL=1 mise //docs:sync", ] [tasks.default] From 8792f8e84fa1b331ad1fad012d9b5a2e21188e5e Mon Sep 17 00:00:00 2001 From: bgagent <345885+scottschreckengaust@users.noreply.github.com> Date: Wed, 27 May 2026 16:20:29 +0000 Subject: [PATCH 6/8] =?UTF-8?q?fix(ci):=20upgrade=20actions/cache=20v4.2.3?= =?UTF-8?q?=20=E2=86=92=20v5.0.5=20(Node=2024=20compatible)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67b98f0..e04fa51 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -160,19 +160,19 @@ jobs: node-version: 22.x - name: Cache node_modules id: cache-node-modules - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: node_modules key: node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - name: Cache agent venv id: cache-agent-venv - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: agent/.venv key: agent-venv-${{ runner.os }}-${{ hashFiles('agent/uv.lock') }} - name: Cache Jest transforms id: cache-jest - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: cdk/.jest-cache key: jest-${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ github.sha }} @@ -180,7 +180,7 @@ jobs: jest-${{ runner.os }}-${{ hashFiles('yarn.lock') }}- - name: Cache TypeScript build info id: cache-tsc - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: | cdk/tsconfig.tsbuildinfo From aae68201c0bb35f98fbefbe4125ff75a87a5f835 Mon Sep 17 00:00:00 2001 From: bgagent <345885+scottschreckengaust@users.noreply.github.com> Date: Wed, 27 May 2026 16:29:21 +0000 Subject: [PATCH 7/8] fix(ci): include tsconfig files in TSC cache key 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) --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e04fa51..1cb1fda 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -185,7 +185,7 @@ jobs: path: | cdk/tsconfig.tsbuildinfo cli/tsconfig.tsbuildinfo - key: tsc-${{ runner.os }}-${{ hashFiles('cdk/src/**', 'cli/src/**') }} + key: tsc-${{ runner.os }}-${{ hashFiles('cdk/src/**', 'cdk/tsconfig.json', 'cdk/tsconfig.dev.json', 'cli/src/**', 'cli/tsconfig.json') }} restore-keys: | tsc-${{ runner.os }}- - name: Install dependencies From 137abd78021b5241146b64457aad7d540f884c89 Mon Sep 17 00:00:00 2001 From: bgagent <345885+scottschreckengaust@users.noreply.github.com> Date: Wed, 27 May 2026 16:45:03 +0000 Subject: [PATCH 8/8] perf(ci): add explicit incremental: true to CDK and CLI tsconfigs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .gitignore | 1 + cdk/tsconfig.json | 1 + cli/tsconfig.json | 1 + 3 files changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 6f56332..5c67d39 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ coverage *.lcov .nyc_output .jest-cache +*.tsbuildinfo lib-cov report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json /test-reports/ diff --git a/cdk/tsconfig.json b/cdk/tsconfig.json index 0d414c0..eca6683 100644 --- a/cdk/tsconfig.json +++ b/cdk/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "incremental": true, "rootDir": "src", "outDir": "lib", "alwaysStrict": true, diff --git a/cli/tsconfig.json b/cli/tsconfig.json index 28bd075..b6f7394 100644 --- a/cli/tsconfig.json +++ b/cli/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "incremental": true, "rootDir": "src", "outDir": "lib", "alwaysStrict": true,