Skip to content

ci: route all 3 boot gates through shared cleanBootEnv (STARTER default)#288

Merged
heznpc merged 1 commit into
mainfrom
refactor/shared-clean-boot-env-2026-06-10
Jun 9, 2026
Merged

ci: route all 3 boot gates through shared cleanBootEnv (STARTER default)#288
heznpc merged 1 commit into
mainfrom
refactor/shared-clean-boot-env-2026-06-10

Conversation

@heznpc

@heznpc heznpc commented Jun 9, 2026

Copy link
Copy Markdown
Owner

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.

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.
@heznpc heznpc enabled auto-merge (squash) June 9, 2026 19:59
@heznpc heznpc merged commit 997b993 into main Jun 9, 2026
4 checks passed
@heznpc heznpc deleted the refactor/shared-clean-boot-env-2026-06-10 branch June 9, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant