Skip to content

Keep Go probe tests from enumerating process environment - #76800

Merged
pelikhan merged 2 commits into
mainfrom
copilot/aw-top-10-keep-go-tests
Nov 11, 2026
Merged

pelikhan merged 2 commits into
mainfrom
copilot/aw-top-10-keep-go-tests

Conversation

Copilot AI commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • Stream contract probe: explicitly sets terminal variables and the probe marker; adds NO_COLOR only when requested.
  • Import-input diagnostic probe: explicitly sets the probe marker and debug logging variables.
cmd.Env = []string{
    "GH_AW_TEST_IMPORT_LOG_REDACTION=1",
    "DEBUG=parser:import_processor",
    "DEBUG_COLORS=0",
}

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Go tests to avoid enumerating process environment Keep Go probe tests from enumerating process environment Nov 11, 2026
Copilot AI requested a review from gh-aw-bot November 11, 2026 08:56
@pelikhan
pelikhan marked this pull request as ready for review November 11, 2026 09:08
Copilot AI dynamic review requested due to automatic review settings November 11, 2026 09:08
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

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.

Generated from Test Quality Sentinel · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 7.2K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ 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: reported_no_action

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.

Generated from Design Decision Gate 🏗️ · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 8.5K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_no_action

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.

Generated from PR Specification Reviewer · gpt56 · ~2 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 1.6K · ◷

Generated by PR Specification Reviewer for #76800

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

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.

Generated from Ponytail Reviewer · routed: gpt61 medium · ~3 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 181 · ◷

Generated by Ponytail Reviewer for #76800

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
  • TestFormatterStreamContracts and TestImportInputParserDiagnosticsDoNotLogSource both pass locally.
  • gofmt and go vet are clean for both packages. The existing os and strings imports are still used.
  • Both probes now set an explicit env list. The console probe also stops inheriting ACCESSIBLE from the parent, which makes it more hermetic.
  • Non-blocking: the Windows CI job runs only the pkg/cli redirect tests, so these probes are not exercised there. If they ever run on Windows, the stripped env has no SYSTEMROOT, 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

@github-actions

Copy link
Copy Markdown
Contributor

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.

Generated by 🔧 PR Triage Agent · copilot · mai11 · ~5 AIC · ⌖ ~2 AIC · ⊞ 15.9K · ◷

@pelikhan
pelikhan merged commit 820a1ee into main Nov 11, 2026
142 checks passed
@pelikhan
pelikhan deleted the copilot/aw-top-10-keep-go-tests branch November 11, 2026 15:01
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AW Top 10] 01 Keep Go tests from enumerating process environment

4 participants