Repository navigation
fix(mcp): extend env drift guard to examples and scripts directories (#413) - #563
Open
sparkysolutions10-pixel wants to merge 1 commit into
Open
sparkysolutions10-pixel wants to merge 1 commit into
sparkysolutions10-pixel wants to merge 1 commit into
Conversation
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.
Summary
Closes #413
Extends the repository environment drift guard to scan
examples/andscripts/directories in addition tosrc/, ensuring all environment variables (including dangerous mainnet secret keys) are documented in.env.examplewith clear operational warnings.Changes
src/__tests__/envDrift.test.tsto scan source files acrosssrc/,examples/, andscripts/..env.example:MCP_AGENT_SECRET_KEY_MAINNETstating plainly that it signs transactions on the public network and can spend real funds.ORACLE_RELAY_RPC_URLandORACLE_RELAY_NETWORK_PASSPHRASEused inexamples/oracle-relay/relay.ts.src/__tests__/envDrift.test.tsverifying that any un-documentedprocess.envread inexamples/fails the drift guard as expected.Tests
npx vitest run src/__tests__/envDrift.test.ts:asserts each process.env read in source appears in .env.example or the allow-list: PASSfails when a new un-documented process.env read is encountered in src/: PASSfails when an un-documented process.env read is encountered in examples/ (#413): PASSrequires every allow-list entry to have an explicit rationale: PASS