Repository navigation
Keep Go probe tests from enumerating process environment - #76800
Conversation
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ PR Specification Reviewer completed successfully! PR Specification ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
There was a problem hiding this comment.
Reviewed the two subprocess environment changes and found no actionable correctness or maintainability issues in the changed lines. The explicit environments match the variables consumed by each probe and avoid enumerating the parent process environment.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain, and the changes are limited to explicitly controlling subprocess environments while preserving the existing probe behavior and assertions.
No open issues 🎉
What changed in this PR
This PR prevents two Go subprocess probes from enumerating the parent process environment, allowing them to run under sandbox policies that block environment enumeration.
Changes:
- Uses explicit environment variables for the import-input diagnostic probe.
- Restricts the stream contract probe to required terminal settings, its marker, and optional
NO_COLOR. - Preserves existing probe behavior and assertions.
| File | Description |
|---|---|
| pkg/parser/import_input_substitution_test.go | Restricts the diagnostic subprocess environment to its probe marker and debug logging variables. |
| pkg/console/stream_contract_test.go | Restricts the formatter subprocess environment to terminal settings, its probe marker, and optional NO_COLOR. |
Review effort: Lite (auto)
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs (root cause: subprocesses inherited the full parent environment, which the sandbox blocks) and /tdd (existing regression tests cover both probes). Approving.
📋 Verification and notes
TestFormatterStreamContractsandTestImportInputParserDiagnosticsDoNotLogSourceboth pass locally.gofmtandgo vetare clean for both packages. The existingosandstringsimports are still used.- Both probes now set an explicit env list. The console probe also stops inheriting
ACCESSIBLEfrom the parent, which makes it more hermetic. - Non-blocking: the Windows CI job runs only the
pkg/cliredirect tests, so these probes are not exercised there. If they ever run on Windows, the stripped env has noSYSTEMROOT, which can matter for some Windows processes. Worth a note, not a blocker.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~3 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
|
Category: bug | Risk: low | Score: 62/100 (impact 26 + urgency 21 + quality 15). Recommended action: batch_review. Batch: pr-batch:copilot-platform. Reason: small security-hardening fix in probe behavior that is low-risk but relevant to sandbox boundaries.
|
|
🎉 This pull request is included in a new release. Release: |
Two Go test probes enumerate the full process environment, which is blocked by the agent sandbox. Give each subprocess only the variables its probe needs.
NO_COLORonly when requested.