ci: route all 3 boot gates through shared cleanBootEnv (STARTER default)#288
Merged
Merged
Conversation
Max-effort code review of the previous PR flagged that the env-pollution fix in verify-published-package.mjs was a special case: the two sibling boot-gates that also boot the server and read tools/list — smoke-mcp.mjs (MIN_TOOLS>=100 floor) and mcp-validate.mjs — still inherited the host's full env, so on a dev box whose ~/.config/airmcp/config.json disables modules they measured a polluted surface and smoke could false-fail its floor. Extract the discipline into scripts/lib/clean-boot-env.mjs (cleanBootEnv): strip every inherited AIRMCP_* (drops AIRMCP_FULL / per-module overrides / an inherited AIRMCP_CONFIG_PATH), then re-set AIRMCP_TEST_MODE=1 and pin AIRMCP_CONFIG_PATH to a guaranteed-absent path so the server applies the STARTER preset. Route all three gates through it. CI behavior is unchanged: CI has no config.json, so all three already booted STARTER (~111) there. The win is local<->CI parity — on this repo's own dev machine (config disables 18 modules) `npm run smoke` now reports a deterministic "7 modules / 111 tools" instead of a polluted count that could trip the floor. Per-module registration stays covered by the unit suite; the broad dev-box boot was never a CI guarantee. Stale comments in all three gates updated to describe the shared deterministic behavior. Verified locally: smoke / mcp:validate / verify:package all boot STARTER and serve 111 tools; 1923 unit tests pass.
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.
Max-effort code review of the previous PR flagged that the env-pollution fix
in verify-published-package.mjs was a special case: the two sibling boot-gates
that also boot the server and read tools/list — smoke-mcp.mjs (MIN_TOOLS>=100
floor) and mcp-validate.mjs — still inherited the host's full env, so on a dev
box whose ~/.config/airmcp/config.json disables modules they measured a
polluted surface and smoke could false-fail its floor.
Extract the discipline into scripts/lib/clean-boot-env.mjs (cleanBootEnv):
strip every inherited AIRMCP_* (drops AIRMCP_FULL / per-module overrides / an
inherited AIRMCP_CONFIG_PATH), then re-set AIRMCP_TEST_MODE=1 and pin
AIRMCP_CONFIG_PATH to a guaranteed-absent path so the server applies the
STARTER preset. Route all three gates through it.
CI behavior is unchanged: CI has no config.json, so all three already booted
STARTER (~111) there. The win is local<->CI parity — on this repo's own dev
machine (config disables 18 modules)
npm run smokenow reports adeterministic "7 modules / 111 tools" instead of a polluted count that could
trip the floor. Per-module registration stays covered by the unit suite; the
broad dev-box boot was never a CI guarantee. Stale comments in all three gates
updated to describe the shared deterministic behavior.
Verified locally: smoke / mcp:validate / verify:package all boot STARTER and
serve 111 tools; 1923 unit tests pass.