Skip to content

guard: fix the perpetually-failing go list guards at the source - #6

Merged
timothyerwin merged 1 commit into
mainfrom
fix/stale-design-doc-links
Aug 30, 2026
Merged

guard: fix the perpetually-failing go list guards at the source#6
timothyerwin merged 1 commit into
mainfrom
fix/stale-design-doc-links

Conversation

@timothyerwin

Copy link
Copy Markdown
Contributor

The failure

TestVendorSDKsOnlyInTheirAdapters and TestNoGatewayInternalsOutsideGateway have been failing on every branch, generally blamed on desktop/node_modules. That was the trigger, not the cause.

go list exits 0 and returns a complete, correct package list — the symlink lines are advisory warnings on stderr. The guard helpers used CombinedOutput(), which folded those warning lines into the package list. Each one was then handed back to go list as a package path, and .../node_modules@electron/... contains an @, which in module-aware mode reads as path@version and is only valid for go get/go install. That invocation exited 1.

The bug was the helper laundering stderr into data.

The fix

One goListLines helper reading stdout only, used by deps, directImports, and modulePackages. Any go list warning is now inert whatever its cause — an untracked node_modules tree from another branch (desktop/ isn't tracked on main at all), a stray symlink, anything future.

Genuine failures still fail: non-zero exit is fatal, and an empty package list is now explicitly fatal too — that would otherwise let every guard below pass vacuously, which is the failure mode this class of test is least able to notice.

Verified

  • Full go test ./... green with desktop/node_modules still in place.
  • Guards still have teeth: injecting an anthropic-sdk-go import into internal/wire correctly fails TestWireIsStdlibOnly.

Also repairs two comments still pointing at docs/design/personal-agents.md, renamed to autonomous-agents.md during the consolidation.

… failures

TestVendorSDKsOnlyInTheirAdapters and TestNoGatewayInternalsOutsideGateway have
been failing on every branch, blamed on desktop/node_modules. That was the
trigger, not the cause.

`go list` EXITS 0 and returns a complete, correct package list; the symlink
lines are advisory warnings on stderr. The guard helpers used CombinedOutput(),
which folded those warning lines into the package list — and each one was then
handed back to `go list` as if it were a package path. `.../node_modules@electron/...`
contains an `@`, which in module-aware mode reads as path@version and is only
valid for `go get`/`go install`, so THAT invocation exited 1. The failure was
the helper laundering stderr into data.

Fixed at the source: one goListLines helper reading stdout only, used by deps,
directImports, and modulePackages. Any `go list` warning is now inert, whatever
its cause — an untracked node_modules tree from another branch (desktop/ is not
tracked on main at all), a stray symlink, anything future.

Genuine failures still fail: non-zero exit is fatal, and an empty package list
is now explicitly fatal too, since that would let every guard below pass
vacuously — the failure mode this class of test is least able to notice.

Verified: full `go test ./...` is green with desktop/node_modules still in
place, and the guards still catch a real violation (injecting an anthropic-sdk
import into internal/wire fails TestWireIsStdlibOnly as it should).

Also fixes two comments still pointing at docs/design/personal-agents.md, which
was renamed to autonomous-agents.md in the consolidation.
@timothyerwin
timothyerwin merged commit e473ed8 into main Aug 30, 2026
2 checks passed
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