GeezerVison is showing github.com — mcpx e2e: env allowlist + registry guard + TestMain backstop (#1992 follow-up) by dezren39 · Pull Request #4804 · developing-today/code
Conversation
dezren39
commented
Nov 3, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Follow-up for #1992 (task 3284).
What changed
pkgs/mcpx/internal/testsupport/childenv.go (new): ChildEnv allowlist builder -- parent contributes PATH, TMPDIR, LANG/LC_, TERM, SYSTEMROOT and explicit runtime-cache passthroughs (DENO_DIR, BUN_INSTALL_CACHE_DIR, NPM_CONFIG_CACHE) only; XDG_CONFIG_HOME/XDG_DATA_HOME/XDG_STATE_HOME/XDG_CACHE_HOME/XDG_RUNTIME_DIR resolve under the test dir. Everything else (all MCPX_, XDG_, OPENCODE_, proxies, NODE_OPTIONS, credentials) is dropped. Unit tests are in childenv_test.go.
pkgs/mcpx/internal/e2e/e2e_test.go: newEnv builds on ChildEnv (replaces withoutMCPXVars); new TestMain backstop fails fast if MCPX_DAEMON_ENDPOINT/MCPX_SOCKET would reach a child and fails if the caller's real daemon set (info records in the parent-resolved state dir) differs at suite end.
pkgs/mcpx/internal/e2e/envguard_test.go (new): registry-derived guard -- every settings EnvName()/EnvAliases entry (231 names) is classified harness-set (52) or safe-under-inherit-nothing (179); the behavior test plants canaries for every name plus XDG/OPENCODE/proxy/NODE_OPTIONS/HOME and checks isolation; hostile-parent doctor/settings/recipes regression test.
Verification status
gofmt and git diff --check: pass. No Go build/test was run locally (task requires CI verification only).
- The PR's only GitHub check is
basic: production line limit (2500) (pass); it does not test Go.
- The
mcpx test and mcpx workflows are disabled_manually. Manual dispatch of mcpx-test.yml on this branch was rejected by GitHub (HTTP 422, workflow disabled), so the e2e and go test ./... CI evidence, and empirical guard fail-on-main/pass-on-fix evidence, are still blocked. Do not close mcpx testing: e2e inherits the caller's environment -- build it from an allowlist so tests never reach the user's daemon #1992 until an enabled Actions path runs and its result is recorded here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…in backstop (#1992)
Replace the inherit-minus-MCPX_* harness environment with a true
allowlist builder in internal/testsupport (ChildEnv): the parent
contributes PATH, TMPDIR, LANG/LC_*, TERM, SYSTEMROOT and the
runtime-cache passthroughs only; XDG_* resolve under the test dir and
everything else -- MCPX_*, XDG_*, OPENCODE_*, proxies, NODE_OPTIONS --
is dropped. newEnv builds on it.
Add the registry-derived guard: every settings EnvName()/EnvAliases
entry is classified as harness-set or safe-under-inherit-nothing, with
a behaviour half proving the drop for each one, plus the
hostile-parent doctor/settings/recipes regression test.
Add the TestMain backstop: fail fast if MCPX_DAEMON_ENDPOINT or
MCPX_SOCKET would reach a child, and fail if the caller's real daemon
set differs at suite end.
coderabbitai
Bot
commented
Nov 3, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 57 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
acd9cd68-2b95-45d4-a363-f4e00297c5b0
Commits
-
Reviewing files that changed from the base of the PR and between f0fd3dd and a20bbf7.
Files selected for processing: 5
-
pkgs/mcpx/internal/e2e/e2e_test.go
pkgs/mcpx/internal/e2e/envguard_test.go
pkgs/mcpx/internal/testsupport/build.go
pkgs/mcpx/internal/testsupport/childenv.go
pkgs/mcpx/internal/testsupport/childenv_test.go
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
⚠️ Failed 2026-11-03T08:34:27.423428Z We couldn’t complete this review. Comment @codex review to try again. |
63432a4 |
PR opened |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 3, 2026
|
🤖 Agent note · handed off
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
🤖 Agent note · state: parked
Verification done on head 181ee47a40 (worktree ~/git/fleet/13363-4804):
go build ./... in pkgs/mcpx — pass.
go test ./internal/testsupport/ -run ChildEnv — pass (both tests).
go test ./internal/e2e/ -run TestEveryRegistryVariableIsHarnessSetOrSafe — pass.
go test ./internal/e2e/ -run TestTheHarnessBuildsChildrenFromTheAllowlist — FAIL, deterministic:
envguard_test.go:395: build fakemcp: exit status 1
failed to initialize build cache at /nonexistent-mcpx-guard/XDG_CACHE_HOME/go-build: mkdir /nonexistent-mcpx-guard: permission denied
Cause: callerLeakParent() (envguard_test.go:338) plants XDG_CACHE_HOME=/nonexistent-mcpx-guard/XDG_CACHE_HOME via t.Setenv, then newEnv → testsupport.FakeMCPBinary runs go build with the ambient environment and Go derives its build cache from it. envguard_test.go is new in this PR (598 lines added).
Why this matters: mcpx-test.yml is workflow_dispatch-only since #5501 (chore/no-push-pr-triggers), so no PR-tier mcpx suite runs on this PR — the only surfaced check is basic: production line limit (2500). Local targeted runs are the verification path, and one of them fails.
Next (resume brief): make FakeMCPBinary build with a writable GOCACHE (or clear XDG_CACHE_HOME for the build step) so the guard test can plant a hostile parent without breaking its own fixture build; re-run the three targeted tests above; then merge when green.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
🤖 Agent note · handed off
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
agent-note:v1 — task 13363, lane code-k, state: handed_off. PR #4804 (batch issue #7297 part 1) verified fresh; lane assignment: opencode (session_id null, unbound). Handing off to opencode claimant per runbook 1b. Attempts 3/4.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
🤖 Agent note · handed off (task 13363, lane code-m): PR #4804 revalidated OPEN, no hard-stop labels; execution lane opencode, handed off to the opencode claimant.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
🤖 Agent note · handed off
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
agent-note:v1 | task 13363 | lane code-n | stage handed_off | Fresh 2026-11-09: PR #4804 OPEN no hard-stop labels; batch issue #7297 OPEN with user/escalated (flagged). Assignment row 4984 = opencode; handing off per runbook 1b; parking task 13363 1200s.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
state: parked
task: 13363
lane: code-w
pr: "#4804"
issue: "#7297"
Shepherd check by lane code-w (task 13363, direct per #8187), fresh 2026-11-10: PR #4804 is OPEN, MERGEABLE, mergeStateStatus CLEAN, no hard-stop labels; zero Codex inline findings; the completed checks are green (production line limit SUCCESS, CodeRabbit NEUTRAL). Diff is 4 files, +845/-17, all mcpx test infrastructure (internal/e2e, internal/testsupport) for issue #1992. Parent batch issue #7297 carries a pre-existing user/escalated label (batch-level, noted by every lane today; per-PR dispositions have proceeded under it).
Targeted verification on the laptop (worktree at PR head 181ee47):
go test ./internal/testsupport/ — PASS (0.103s): the new childenv allowlist code.
go test ./internal/e2e/ -run TestEveryRegistryVariableIsHarnessSetOrSafe — PASS.
go test ./internal/e2e/ -run TestTheHarnessBuildsChildrenFromTheAllowlist — FAIL: building fakemcp under the harness child env dies with "failed to initialize build cache at /nonexistent-mcpx-guard/XDG_CACHE_HOME/go-build: mkdir /nonexistent-mcpx-guard: permission denied". The test deliberately plants canary cache paths under /nonexistent-mcpx-guard; on this host the go build cannot create that root-level directory. Not yet determined whether this is a laptop-environment artifact or a test defect that CI would also hit — the PR's remaining checks are stuck in the fleet CI stall, so CI has not answered it either.
- Full e2e package exceeds a 300s run on the laptop (integration suite; no verdict).
Not merging with one of the PR's own new tests red in the only environment that has run it. Parking task 13363: resume when PR #4804's CI completes (green → merge; red on this test → the test's build-cache handling needs a fix, e.g. harness-set GOCACHE inside the build's child env), or when someone reproduces the failure as laptop-only with evidence.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…reak test builds
FakeMCPBinary/MCPXBinary ran go build with the ambient env. The e2e env guard test plants XDG_CACHE_HOME, proxies and HOME pointing at a nonexistent root, and the build died three ways: build cache under the planted XDG root, module downloads through the planted proxy, and a cold GOPATH/module cache under the planted HOME (which the test then could not clean up). buildEnv now pins GOCACHE/XDG_CACHE_HOME under the build temp dir, drops proxy variables (the ChildEnv reasoning), and resets HOME from the passwd entry so builds use the invoking users warm caches. TestTheHarnessBuildsChildrenFromTheAllowlist and TestEveryRegistryVariableIsHarnessSetOrSafe now pass; internal/testsupport tests and go build ./... pass.
Uh oh!
There was an error while loading. Please reload this page.
|
agent-note:v1
state: done
task: 13363
lane: code-p
outcome: fixed_merged (shepherded to merge)
Shepherded PR #4804 to merge: merge commit be9e1e8, head a20bbf7.
The blocking defect from the park record is fixed in commit a20bbf7 (pkgs/mcpx/internal/testsupport/build.go): FakeMCPBinary/MCPXBinary ran go build with the ambient env, so this PR's own guard test — which plants XDG_CACHE_HOME, proxy variables, and HOME pointing at a nonexistent root — broke the suite's builds three ways: (1) build cache initialized under the planted XDG root (permission denied, the recorded failure), (2) module downloads routed through the planted proxy (nonexistent host), (3) GOPATH/module cache derived from the planted HOME, forcing a cold download of every module into a test temp dir whose read-only module cache then failed TempDir cleanup. The new buildEnv pins GOCACHE/XDG_CACHE_HOME under the build's own temp dir, drops proxy variables (the same reasoning as this PR's ChildEnv), and resets HOME from the passwd entry so builds use the invoking user's warm caches.
Evidence (laptop, this shift): failure reproduced on head 181ee47 (13363-repro.log); after the fix, go test ./internal/e2e/ -run 'TestTheHarnessBuildsChildrenFromTheAllowlist|TestEveryRegistryVariableIsHarnessSetOrSafe' -count=1 PASS (ok, 178s — cold build cache under multi-lane contention), go test ./internal/testsupport/ -count=1 PASS, go vet ./internal/testsupport/ clean, go build ./... in pkgs/mcpx PASS (logs 13363-fix3/fix4 in the fleet worktree dir).
Codex disposition: no Codex findings exist on this PR — zero review threads at any head; the latest Codex comment is its usage-limits notice (the review failed to run). Nothing to fix or rebut; disposition recorded here.
Batch issue #7297 stays open for its remaining parts; this task covered part 1 (PR #4804) only.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 10, 2026
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
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.
|