Skip to content

ci(provider): run the standalone gate offline — cover anthropic, no credential - #384

Merged
JAORMX merged 3 commits into
mainfrom
ci/provider-standalone-auth
Aug 5, 2026
Merged

JAORMX merged 3 commits into
mainfrom
ci/provider-standalone-auth

Conversation

@JAORMX

@JAORMX JAORMX commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

What

Widens the provider-standalone (GOWORK=off) hygiene gate to cover anthropic alongside ssefilter, and fixes the staticcheck SA5011 lint flake that was failing CI.

Addresses the anthropic half of #379; openai/openaichat remain blocked on the first provider/ssefilter tag.

1. Provider standalone gate (ADR 0093)

Because mecatl is a private/INTERNAL repo, a module that requires another mecatl module (anthropic → engine; openai/openaichat → engine + provider/ssefilter) can only be fetched from the origin with auth — proxy.golang.org cannot serve a private module. So the job:

  1. Warms the module cache with the workflow's read-only GITHUB_TOKEN (an insteadOf rewrite scoped to the warm step, dropped immediately after) — a networked go build + go test (GOFLAGS=-mod=mod) resolves the full incl. test-only graph. go mod download alone is NOT sufficient.
  2. Runs the gate fully offline (GOWORK=off GOPROXY=off go build/go test) — the self-contained proof never touches the network and carries no credential.
  • test:provider-standalone (Taskfile) gains a GOPROXY var (default empty = networked locally; task test:provider-standalone GOPROXY=off replicates CI).
  • openai + openaichat stay excluded — they require provider/ssefilter v0.0.0, unresolvable until the first provider/ssefilter/vX.Y.Z tag (Cut provider/ssefilter tag to unblock the openai/openaichat standalone gate #379). Once mecatl is open-sourced the warm needs no token.

2. The SA5011 lint flake

CI's staticcheck (golangci-lint v2.12.2) false-positives SA5011 "possible nil pointer dereference" on the idiomatic test guard if x == nil { t.Fatal(...) }; use(x). staticcheck computes t.Fatal's no-return facts over the whole program, and on the 2-core CI runner they come back incomplete — flagging a rolling subset of the ~117 test files using the idiom (authfile, models, cliconfig, mcpserver, …) while golangci-lint reports 0 issues locally with the identical version + config.

This is a checker-environment divergence, not a real bug. Per-site edits across 117 files, GOGC/--concurrency/GOMEMLIMIT tuning, and a bigger runner (not provisioned — the job queued forever) all failed to make it deterministic. The fix: exclude SA5011 in *_test.go in .golangci.yml (production code keeps the check at full strength), matching the repo's existing test-file relaxation block.

Verification

  • provider-standalone (GOWORK=off, offline) — ssefilter ✓, anthropic ✓
  • task test:provider-standalone GOPROXY=off ✓ (offline, after cache warm); cold-cache negative test confirms the warm is load-bearing
  • task lint — 0 issues across all modules; golangci-lint config verify ✓
  • go test ./docs/lint/ ✓

Commits

  • ci(provider): run the standalone gate offline — cover anthropic, no credential (superseded warm approach)
  • ci(provider): warm the standalone cache with read-only auth, gate offline
  • ci(lint): exclude staticcheck SA5011 in test files — deterministic false positive

JAORMX and others added 2 commits August 5, 2026 08:52
…redential

The previous job was scoped to ssefilter only, on the theory that anthropic
needs git credentials to fetch engine v0.8.0 (mecatl is private, so
proxy.golang.org 404s it and a networked GOWORK=off fetch 401s). But the gate
doesn't need the network at all: run it GOPROXY=off over a module cache warmed
from the committed go.sum, and every dependency must already be local — no
credential, no private-fetch surface, and a STRONGER guarantee (offline, not
just off-workspace).

anthropic now qualifies (engine v0.8.0 is cache-resolvable once warmed), so the
gate covers ssefilter + anthropic. openai + openaichat stay excluded only
because they require provider/ssefilter v0.0.0, which no cache can resolve
until the first provider/ssefilter tag — tracked in #379. Adds a GOPROXY var to
task test:provider-standalone (default networked locally, GOPROXY=off in CI) so
the offline form reproduces with ok  	github.com/stacklok/mecatl/provider/ssefilter	(cached)
ok  	github.com/stacklok/mecatl/provider/anthropic	(cached).
ADR 0093 updated.

Co-Authored-By: Juan Antonio Osorio <[email protected]>
…line

The offline-only warm was unsound: engine v0.8.0 must be fetched from the
private origin, which needs auth (proxy.golang.org can't serve a private
module), and 'go mod download' doesn't resolve the full build/test graph anyway.
Warm the module cache with the workflow's read-only GITHUB_TOKEN (an insteadOf
rewrite scoped to the warm step, dropped right after), then run the gate fully
offline (GOPROXY=off) so the self-contained proof never touches the network and
carries no credential. ADR 0093 updated to record that the warm needs auth on a
private repo.

Co-Authored-By: Juan Antonio Osorio <[email protected]>
@JAORMX
JAORMX force-pushed the ci/provider-standalone-auth branch 4 times, most recently from abf59ec to 7947a6e Compare August 5, 2026 07:24
…lse positive

The SA5011 'possible nil pointer dereference' findings failing CI are false
positives on the idiomatic test guard 'if x == nil { t.Fatal(...) }; use(x)'.
staticcheck computes t.Fatal's no-return facts over the whole program, and on
the 2-core CI runner they come back incomplete — flagging a rolling subset of
the ~117 test files using the idiom (authfile, models, cliconfig, mcpserver,
…) while golangci-lint reports 0 issues locally with the identical v2.12.2 +
config. GOGC/concurrency/GOMEMLIMIT tuning and a bigger runner (not
provisioned) could not make it deterministic, and per-site edits across 117
files are the wrong answer to a checker-environment divergence. Exclude SA5011
in *_test.go (production code keeps the check at full strength), matching the
repo's existing test-file relaxation block. Config verified; task lint green
across all modules.

Co-Authored-By: Juan Antonio Osorio <[email protected]>
@JAORMX
JAORMX force-pushed the ci/provider-standalone-auth branch from f781179 to 833bb81 Compare August 5, 2026 07:39
@JAORMX
JAORMX merged commit d17cd07 into main Aug 5, 2026
16 checks passed
@JAORMX
JAORMX deleted the ci/provider-standalone-auth branch August 5, 2026 07:56
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