docs(rules): fix live tool-verify procedure for Workers vitest env gap#95
Merged
Conversation
The Workers vitest pool isolate does not expose Node's process.env, so a test/_verify_*.test.js spec injecting a live PAT 401s. Switch the procedure to a standalone scripts/_verify_*.mjs run via `pnpm dlx tsx`, document the gotcha, and add an error-path approach for write tools (completed-run 409, no-trigger-workflow 422) to avoid real CI mutations. Discovered while verifying the #8 Phase-5 write tools.
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.
Corrects the project rule
.claude/rules/tool-e2e-handler-capture.md, whose live-verification procedure didn't actually work.Why
The old rule said to write a
test/_verify_*.test.jsvitest spec that injects a live PAT vianew Octokit({ auth: process.env.GITHUB_PERSONAL_ACCESS_TOKEN }). But every spec in this repo runs in the@cloudflare/vitest-pool-workersisolate, whoseprocess.envis not Node's process env — so the PAT isundefinedand live calls fail with401. Neither a shell-exported PAT,secrets.required,CLOUDFLARE_INCLUDE_PROCESS_ENV, nor a temporary.dev.varsfixes it. Discovered while verifying the #8 Phase-5 write tools.What changed
scripts/_verify_*.mjsviapnpm dlx tsx(real Nodeprocess.env), not a vitest spec. Notes thatnode --experimental-strip-typescan't resolve the.js→.tsimports.process.envgap and why the usual env routes don't fix it.409, no-trigger-workflow422) so a live binding is confirmed without a real CI mutation.Doc-only change to a rule file; no code or test changes.