Repository navigation
fix(grpc): zone-signer-glue resolves @getknext/grpc/runtime outside the repo (#2583) - #2584
Merged
AhmedElBanna80 merged 2 commits intoOct 22, 2026
Merged
Conversation
… an outside-repo tmpdir (#2583) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0198oVxWkEEDJJnVhES6ULnx
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…add guard (#2583) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0198oVxWkEEDJJnVhES6ULnx
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.
Closes #2583
Root cause
zone-signer-glue.test.tsgenerated the zone glue into an OS temp dir (outside the repo) and only symlinkedpackages/grpc/node_modulesinto it. The generated glue imports@getknext/grpc/runtime, which that node_modules does not contain (workspace packages are not linked there), and nothing up the tree from /tmp can resolve it. The test leaned onmock.modulealone to rescue the unresolvable specifier, whose behaviour depends on whetherpackages/grpc/distexists (see Round 2).Fix
The scratch dir now gets a real
node_modules: per-entry symlinks to the package's own dependencies plus a small@getknext/grpcstub whose./runtimeexport re-exports the source runtime. The specifier now resolves for real everywhere (verified it passes with themock.moduleline removed), and the scratch dir stays in the existingemptyDirregistry drained byremoveScratchDirs()inafterAll.Proof
GITHUB_REF_NAME=main PROVER_LANE_REF=integration/v2(GITHUB_BASE_REF unset), prover with private outside-repo TMPDIR:{"declared":18,"run":18}, exit 0.Other tests with the same tmp-outside-repo pattern (not changed here)
gateway-transport.test.tsanduse-cache-two-user.test.tsalso create dirs undertmpdir()and import generated code; both pass in the lane today, but they rely on their own wiring rather than this one.No user-visible surface changed. Test-only change; no supply-chain path touched.
Round 2 (corrected root cause)
The cause is NOT the platform: it is whether
packages/grpc/distexists.mock.module('@getknext/grpc/runtime')resolves through the packageexportsmap (./runtime->./dist/runtime.js). With no dist, Bun keys the mock under the bare name and the import from /tmp hits it; with dist present, the mock is keyed to the dist path and the bare import misses it. In the lane an earlier prover leg (deploy-function-bin-e2e) builds dist, so the result depended on test order.linkWorkspaceRuntimemoved to the sharedhelpers.ts; used byzone-signer-glue.test.tsand byglue-action-refresh.test.ts(same latent defect).glue-runtime-link-guard.test.ts: scans specs; one that mocks the runtime and uses a scratch dir without the link fails. Mutation-proved (link removed from glue-action-refresh -> guard exit 1; restored -> exit 0).packages/grpc/distbuilt and with it absent: the 3 specs 24 pass/0 fail (exit 0);mutation-prove-2510-zone-token.mjs18/18 (exit 0);mutation-prove-2050-zone-glue.mjs33/33 (exit 0, core built as in the lane).🤖 Generated with Claude Code
https://claude.ai/code/session_0198oVxWkEEDJJnVhES6ULnx