From 1a9be0cfb18c7fa3989a496bcd514fc04e03002a Mon Sep 17 00:00:00 2001 From: Mathias Date: Sat, 5 Sep 2026 12:40:34 +0200 Subject: [PATCH] style: apply gofmt Estate-wide consolidation pass. golangci-lint v2 default set enables NO formatter, so gofmt drift accumulated silently across the estate -- 8 repos were carrying it, this one included. Same hole that let two files rot in dma-cli until they were found by hand (dma-cli#12). Mechanical and deterministic: `gofmt -w`, nothing hand-edited. Verified before commit -- gofmt -l now reports 0, go build and go vet both pass. Clears this repo to adopt the canonical .golangci.yml (infra ci-templates/golangci.yml, infra#309 pattern) in a later wave. --- ingestion/internal/audit/buffer.go | 4 ++-- ingestion/internal/audit/degrading_test.go | 8 ++++---- ingestion/internal/session/session.go | 8 ++++---- ingestion/internal/vectorstore/pg_test.go | 5 +++-- internal/auth/jwt_test.go | 10 +++++----- internal/config/routing.go | 16 ++++++++-------- internal/mcpclient/client.go | 6 +++--- internal/session/history_test.go | 4 ++-- internal/session/session.go | 8 ++++---- 9 files changed, 35 insertions(+), 34 deletions(-) diff --git a/ingestion/internal/audit/buffer.go b/ingestion/internal/audit/buffer.go index aa3846d..524011c 100644 --- a/ingestion/internal/audit/buffer.go +++ b/ingestion/internal/audit/buffer.go @@ -28,8 +28,8 @@ type FileBuffer struct { } type bufferLine struct { - ID string `json:"id"` - Entry capture.AuditEntry `json:"entry"` + ID string `json:"id"` + Entry capture.AuditEntry `json:"entry"` } // NewFileBuffer returns a buffer backed by path. The parent directory is diff --git a/ingestion/internal/audit/degrading_test.go b/ingestion/internal/audit/degrading_test.go index 09703e6..4859f80 100644 --- a/ingestion/internal/audit/degrading_test.go +++ b/ingestion/internal/audit/degrading_test.go @@ -46,10 +46,10 @@ func (f *fakeNotifier) Notify(_ context.Context, msg string) error { // unwritableBuffer always reports it cannot be written (floor condition). type unwritableBuffer struct{} -func (unwritableBuffer) Writable() error { return errors.New("disk full") } -func (unwritableBuffer) Append(capture.AuditEntry) error { return errors.New("disk full") } -func (unwritableBuffer) Pending() ([]audit.Buffered, error) { return nil, nil } -func (unwritableBuffer) Confirm(string) error { return nil } +func (unwritableBuffer) Writable() error { return errors.New("disk full") } +func (unwritableBuffer) Append(capture.AuditEntry) error { return errors.New("disk full") } +func (unwritableBuffer) Pending() ([]audit.Buffered, error) { return nil, nil } +func (unwritableBuffer) Confirm(string) error { return nil } func newFileBuffer(t *testing.T) *audit.FileBuffer { t.Helper() diff --git a/ingestion/internal/session/session.go b/ingestion/internal/session/session.go index 161e5f0..d9a7ce5 100644 --- a/ingestion/internal/session/session.go +++ b/ingestion/internal/session/session.go @@ -32,12 +32,12 @@ type Entry struct { type Attempt struct { Attempt int `json:"attempt"` Model string `json:"model"` - Tier string `json:"tier"` // local | subagent | managed + Tier string `json:"tier"` // local | subagent | managed DurationMs int64 `json:"duration_ms"` - WarmStart bool `json:"warm_start"` // model already loaded in llama-swap + WarmStart bool `json:"warm_start"` // model already loaded in llama-swap Verified bool `json:"verified"` - Verdict string `json:"verdict,omitempty"` // accept | escalate | error - Feedback string `json:"feedback,omitempty"` // verifier feedback on escalation + Verdict string `json:"verdict,omitempty"` // accept | escalate | error + Feedback string `json:"feedback,omitempty"` // verifier feedback on escalation OutputSummary string `json:"output_summary,omitempty"` RunnerOutput string `json:"runner_output,omitempty"` } diff --git a/ingestion/internal/vectorstore/pg_test.go b/ingestion/internal/vectorstore/pg_test.go index 30e3bca..61ec4d7 100644 --- a/ingestion/internal/vectorstore/pg_test.go +++ b/ingestion/internal/vectorstore/pg_test.go @@ -16,8 +16,9 @@ import ( // reachable database. // // To run: -// BRAIN_PG_TEST_DSN='postgres://brain_app:pwd@127.0.0.1:5432/brain' \ -// go test ./internal/vectorstore/... -run Integration +// +// BRAIN_PG_TEST_DSN='postgres://brain_app:pwd@127.0.0.1:5432/brain' \ +// go test ./internal/vectorstore/... -run Integration func dsn(t *testing.T) string { t.Helper() v := os.Getenv("BRAIN_PG_TEST_DSN") diff --git a/internal/auth/jwt_test.go b/internal/auth/jwt_test.go index 1fcb4ed..407bba3 100644 --- a/internal/auth/jwt_test.go +++ b/internal/auth/jwt_test.go @@ -10,10 +10,10 @@ import ( "testing" "time" + "git.d-ma.be/mathias/hyperguild/internal/auth" "github.com/lestrrat-go/jwx/v2/jwa" "github.com/lestrrat-go/jwx/v2/jwk" "github.com/lestrrat-go/jwx/v2/jwt" - "git.d-ma.be/mathias/hyperguild/internal/auth" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -89,10 +89,10 @@ func TestValidator(t *testing.T) { require.NoError(t, err) tests := []struct { - name string - token string - wantSub string - wantErr bool + name string + token string + wantSub string + wantErr bool }{ { name: "valid jwt", diff --git a/internal/config/routing.go b/internal/config/routing.go index 32426d3..147e864 100644 --- a/internal/config/routing.go +++ b/internal/config/routing.go @@ -9,14 +9,14 @@ import ( // RoutingConfig holds the runtime configuration for the routing pod. // Separate from Config because the routing pod's surface differs from the supervisor's. type RoutingConfig struct { - Port string // ROUTING_PORT, default 3210 - MCPAuthToken string // ROUTING_MCP_TOKEN, optional bearer token - LiteLLMBaseURL string // LITELLM_BASE_URL, default https://llm-api.d-ma.be - LiteLLMAPIKey string // LITELLM_API_KEY - BrainURL string // BRAIN_URL, default http://ingestion.supervisor:3300 - BrainMCPToken string // BRAIN_MCP_TOKEN, bearer for the auth-gated ingestion /mcp (session_log) - FastModel string // HYPERGUILD_FAST_MODEL, default koala/qwen35-9b-fast - ThinkingModel string // HYPERGUILD_THINKING_MODEL, default iguana/gemma4-26b + Port string // ROUTING_PORT, default 3210 + MCPAuthToken string // ROUTING_MCP_TOKEN, optional bearer token + LiteLLMBaseURL string // LITELLM_BASE_URL, default https://llm-api.d-ma.be + LiteLLMAPIKey string // LITELLM_API_KEY + BrainURL string // BRAIN_URL, default http://ingestion.supervisor:3300 + BrainMCPToken string // BRAIN_MCP_TOKEN, bearer for the auth-gated ingestion /mcp (session_log) + FastModel string // HYPERGUILD_FAST_MODEL, default koala/qwen35-9b-fast + ThinkingModel string // HYPERGUILD_THINKING_MODEL, default iguana/gemma4-26b // RouteLocalFloor and RouteLocalCeil intentionally invert the usual // floor < ceil mathematical convention: Floor (default 0.90) is the // UPPER boundary — at/above it, always route local; Ceil (default 0.70) diff --git a/internal/mcpclient/client.go b/internal/mcpclient/client.go index 1f0c7f4..5a3e3ab 100644 --- a/internal/mcpclient/client.go +++ b/internal/mcpclient/client.go @@ -16,9 +16,9 @@ import ( // Client calls an MCP server over Streamable HTTP / JSON-RPC. type Client struct { - url string - token string - http *http.Client + url string + token string + http *http.Client } // ErrTokenRequired is returned by New when token is empty. Empty token diff --git a/internal/session/history_test.go b/internal/session/history_test.go index 5d9a8d9..fc32fbd 100644 --- a/internal/session/history_test.go +++ b/internal/session/history_test.go @@ -20,8 +20,8 @@ func TestFormatHistoryFormatsEntries(t *testing.T) { entries := []session.Entry{ { Skill: "tdd", Phase: "red", FinalStatus: "pass", - FilePath: "internal/foo/foo_test.go", - Message: "wrote failing test for Foo", + FilePath: "internal/foo/foo_test.go", + Message: "wrote failing test for Foo", Timestamp: time.Now(), }, } diff --git a/internal/session/session.go b/internal/session/session.go index 1616169..b23698b 100644 --- a/internal/session/session.go +++ b/internal/session/session.go @@ -32,12 +32,12 @@ type Entry struct { type Attempt struct { Attempt int `json:"attempt"` Model string `json:"model"` - Tier string `json:"tier"` // local | subagent | managed + Tier string `json:"tier"` // local | subagent | managed DurationMs int64 `json:"duration_ms"` - WarmStart bool `json:"warm_start"` // model already loaded in llama-swap + WarmStart bool `json:"warm_start"` // model already loaded in llama-swap Verified bool `json:"verified"` - Verdict string `json:"verdict,omitempty"` // accept | escalate | error - Feedback string `json:"feedback,omitempty"` // verifier feedback on escalation + Verdict string `json:"verdict,omitempty"` // accept | escalate | error + Feedback string `json:"feedback,omitempty"` // verifier feedback on escalation OutputSummary string `json:"output_summary,omitempty"` RunnerOutput string `json:"runner_output,omitempty"` }