Skip to content

Keep a user's proxy exemptions, warn when loopback would reach a proxy, and stop everything before a rerun - #279

Merged
rocklambros merged 2 commits into
integrationfrom
refimpl/274-prehandoff-fixes
Oct 15, 2026
Merged

rocklambros merged 2 commits into
integrationfrom
refimpl/274-prehandoff-fixes

Conversation

@rocklambros

Copy link
Copy Markdown
Collaborator

What changed

This fixes the two problems Bar found in her review of PR #277 and marked as needed before the lab handoff. Both are in the trace walkthrough and the Guardian's trace exporter.

The first is that "Run it again" told readers to delete .acs without stopping anything first. A collector or Guardian that is still running keeps writing into the deleted file, so every later span disappears without an error. The paragraph now says to stop both first, and the Docker command names its container (acs-otelcol) so docker stop acs-otelcol works.

The second is that keepLoopbackOffProxy could switch off a user's existing proxy exemptions. It created whichever of NO_PROXY and no_proxy was missing, and Bun 1.3.14 reads a non-empty no_proxy before NO_PROXY. So a user with only NO_PROXY=corp.internal lost that exemption. It now appends only to the variables the user set, using Bun's own rule for "set", and writes IPv6 loopback in the bracketed form Bun matches.

Checking that fix turned up something bigger. Bun 1.3.11, which CI runs, reads the proxy variables only when the process starts, so the runtime edit does nothing there. The Guardian therefore also prints a warning at startup when a proxy is set and loopback isn't exempt, and the walkthrough's step 1 now exports both variables, keeping the reader's own entries. Those startup variables are what protect loopback on every Bun version.

Which issue does this implement

Refs #274

How it was checked

The spec and plan went through an adversarial premortem before any code was written. It ran two perspectives, and every finding was reproduced by running it.

  • The tests were written first and failed for the right reasons. The routing test runs in a fresh child process with its environment set at spawn, because Bun latches proxy variables across edits in one process. It failed on the old code and on a do-nothing mutant, and it passes on the fix. It is gated to Bun 1.3.14 and later, so CI on 1.3.11 skips it. The warning tests run everywhere.
  • bun test: 1230 pass on Bun 1.3.14, and 1229 pass with 2 skips on Bun 1.3.11. bun run typecheck is clean, bun run conformance exits 0, and uv run pytest gives 918 passed.
  • The step 1 export lines behave the same in bash and zsh, with the variables unset, set, set to different lists, empty, and under set -u.
  • End to end from a clone of this branch, with a counting proxy in HTTP_PROXY and NO_PROXY=corp.internal set beforehand:
    • steps 1 to 7 and the rerun made zero proxy connections;
    • step 1 kept corp.internal;
    • the rerun after stopping everything produced the same spans;
    • a Guardian started with a proxy and no exemption printed the warning.

Separately, the Claude Code shim has the same proxy exposure on its way to the Guardian. That predates this work, so the "Connect Claude Code" section now tells readers to start Claude Code with loopback exempt. The code fix belongs with the other issue #274 work.

Base branch

  • integration, because this touches the specification, schemas, a reference
    implementation, an adapter, tests, or CI

Type of change

  • Reference implementation or adapter
  • Documentation

I tested this

  • I synced my branch with the base branch before opening this
  • uv run pytest -v passes on my machine

Checklist

  • Commits are signed off with git commit -s (required by the DCO)
  • Prose follows STYLE.md
  • No secrets, tokens, or internal URLs in the diff

Security

This narrows exposure. Spans to a loopback collector no longer lose a user's other proxy exemptions, a misconfigured proxy now produces a visible warning instead of a silent leak, and the walkthrough no longer loses spans on a rerun.

… the Guardian cannot

Signed-off-by: rocklambros <rock@rockcyber.com>
… proxy exemptions

Signed-off-by: rocklambros <rock@rockcyber.com>
@rocklambros

Copy link
Copy Markdown
Collaborator Author

Admin-merged on the project lead's call to land Bar's two pre-handoff fixes from issue #274 before the 0.1.4 release. Every check is green, and the PR description has the test and end-to-end evidence. @afogel @bar-capsule, a look after the fact is still welcome, and anything you find goes in a follow-up.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant