From 27af4548817dc94b00a310d70a7d6bbcdb1eec7c Mon Sep 17 00:00:00 2001 From: Jack Zhuang <50353452+hotlong@users.noreply.github.com> Date: Thu, 1 Oct 2026 23:05:30 +0800 Subject: [PATCH 1/2] ci(turbo): sign remote-cache artifacts (remoteCache.signature) Turbo now tags every remote-cache upload with an HMAC of the artifact keyed by TURBO_REMOTE_CACHE_SIGNATURE_KEY and verifies the tag on every download, so an entry that was not produced by a holder of the key is a miss rather than a replay. The setting is inert while remote caching is off, which it is until CI is given a token and team; it is not a task hash input. Claude-Session: https://claude.ai/code/session_57c17198-e47f-48f8-9242-3fc94c651c85 Co-authored-by: Claude --- turbo.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/turbo.json b/turbo.json index efbae540277..45d71bab751 100644 --- a/turbo.json +++ b/turbo.json @@ -4,6 +4,9 @@ "globalEnv": ["OS_SKIP_DTS"], "globalPassThroughEnv": ["VITEST_MAX_WORKERS"], "agentGuidance": false, + "remoteCache": { + "signature": true + }, "tasks": { "build": { "dependsOn": ["^build"], From bf9afd2a037d3e977d4bae5a81efa2291b66c128 Mon Sep 17 00:00:00 2001 From: Jack Zhuang <50353452+hotlong@users.noreply.github.com> Date: Thu, 1 Oct 2026 23:10:07 +0800 Subject: [PATCH 2/2] ci: wire the turbo remote cache into Build Core's build step, inert until configured Build Core's `pnpm build` step gets the remote-cache policy and credentials: TURBO_CACHE is local:rw,remote:rw on merge_group and on push / workflow_dispatch against main, and local:rw,remote:r for every other event. TURBO_TOKEN is passed only when the signing key is set, TURBO_TEAM is read from a repository variable, and the signing key from a secret. Neither the variable nor the key exists yet, so remote caching stays off and the build runs exactly as before. Only build tasks are wired; test, test:repo and the forced docs build stay off the remote cache. Claude-Session: https://claude.ai/code/session_57c17198-e47f-48f8-9242-3fc94c651c85 Co-authored-by: Claude --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 111d48cfa35..64846c01503 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2047,7 +2047,41 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile + # ── Turbo remote cache (#21186) ───────────────────────────────────── + # Vercel's managed Turborepo remote cache. objectstack-ai/cloud's + # test.yml builds this repo at its pinned SHA with the same command and + # reads/writes the same Vercel team, and the task hashes are identical + # in both places (72 of 72 build tasks, read from both CI logs at one + # SHA), so a pin bump there can replay what this step built on `main`. + # + # Scope: THIS step only, i.e. `build` tasks. `test` / `test:repo` stay + # off the remote: their cross-package inputs are hand-declared, and a + # wrong hash replayed from a remote reaches every run and cloud too. + # Build Docs forces execution and carries no credentials. + # + # TURBO_CACHE is the env form of `--cache`. Writes happen on + # `merge_group` and on `push` / `workflow_dispatch` against main; every + # other event, `pull_request` and `schedule` included, only reads, + # because read-only is the default branch of the expression. This is + # turbo configuration, not a property of the credential: a same-repo PR + # receives the secrets and runs its own copy of this file; fork PRs + # receive none. ⚠️ Never let it evaluate to '': turbo then disables the + # LOCAL cache too (`no caches are enabled`) and re-executes everything. + # + # Credentials: TURBO_TOKEN (secret) is passed only when the signing key + # is non-empty, because an empty key still "signs" with a zero-length + # HMAC key; TURBO_TEAM is a repo VARIABLE so the slug is not masked out + # of the log; TURBO_REMOTE_CACHE_SIGNATURE_KEY (secret) must equal + # cloud's. turbo.json's `remoteCache.signature` makes turbo tag every + # upload and verify every download with that key. Any of the three + # unset: remote caching is off and the build is unchanged; the summary + # then reads `Remote caching disabled (remote cache requested — …)`. - name: Build packages (excluding docs) + env: + TURBO_CACHE: ${{ (github.event_name == 'merge_group' || ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main')) && 'local:rw,remote:rw' || 'local:rw,remote:r' }} + TURBO_TOKEN: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY != '' && secrets.TURBO_TOKEN || '' }} + TURBO_TEAM: ${{ vars.TURBO_TEAM }} + TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} run: pnpm build # [#15042] The closure-wide declaration re-check. `check-dts-emitted` runs