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.
This commit is contained in:
@@ -28,8 +28,8 @@ type FileBuffer struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type bufferLine struct {
|
type bufferLine struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Entry capture.AuditEntry `json:"entry"`
|
Entry capture.AuditEntry `json:"entry"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewFileBuffer returns a buffer backed by path. The parent directory is
|
// NewFileBuffer returns a buffer backed by path. The parent directory is
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ func (f *fakeNotifier) Notify(_ context.Context, msg string) error {
|
|||||||
// unwritableBuffer always reports it cannot be written (floor condition).
|
// unwritableBuffer always reports it cannot be written (floor condition).
|
||||||
type unwritableBuffer struct{}
|
type unwritableBuffer struct{}
|
||||||
|
|
||||||
func (unwritableBuffer) Writable() error { return errors.New("disk full") }
|
func (unwritableBuffer) Writable() error { return errors.New("disk full") }
|
||||||
func (unwritableBuffer) Append(capture.AuditEntry) 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) Pending() ([]audit.Buffered, error) { return nil, nil }
|
||||||
func (unwritableBuffer) Confirm(string) error { return nil }
|
func (unwritableBuffer) Confirm(string) error { return nil }
|
||||||
|
|
||||||
func newFileBuffer(t *testing.T) *audit.FileBuffer {
|
func newFileBuffer(t *testing.T) *audit.FileBuffer {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
|
|||||||
@@ -32,12 +32,12 @@ type Entry struct {
|
|||||||
type Attempt struct {
|
type Attempt struct {
|
||||||
Attempt int `json:"attempt"`
|
Attempt int `json:"attempt"`
|
||||||
Model string `json:"model"`
|
Model string `json:"model"`
|
||||||
Tier string `json:"tier"` // local | subagent | managed
|
Tier string `json:"tier"` // local | subagent | managed
|
||||||
DurationMs int64 `json:"duration_ms"`
|
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"`
|
Verified bool `json:"verified"`
|
||||||
Verdict string `json:"verdict,omitempty"` // accept | escalate | error
|
Verdict string `json:"verdict,omitempty"` // accept | escalate | error
|
||||||
Feedback string `json:"feedback,omitempty"` // verifier feedback on escalation
|
Feedback string `json:"feedback,omitempty"` // verifier feedback on escalation
|
||||||
OutputSummary string `json:"output_summary,omitempty"`
|
OutputSummary string `json:"output_summary,omitempty"`
|
||||||
RunnerOutput string `json:"runner_output,omitempty"`
|
RunnerOutput string `json:"runner_output,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,9 @@ import (
|
|||||||
// reachable database.
|
// reachable database.
|
||||||
//
|
//
|
||||||
// To run:
|
// 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 {
|
func dsn(t *testing.T) string {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
v := os.Getenv("BRAIN_PG_TEST_DSN")
|
v := os.Getenv("BRAIN_PG_TEST_DSN")
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"git.d-ma.be/mathias/hyperguild/internal/auth"
|
||||||
"github.com/lestrrat-go/jwx/v2/jwa"
|
"github.com/lestrrat-go/jwx/v2/jwa"
|
||||||
"github.com/lestrrat-go/jwx/v2/jwk"
|
"github.com/lestrrat-go/jwx/v2/jwk"
|
||||||
"github.com/lestrrat-go/jwx/v2/jwt"
|
"github.com/lestrrat-go/jwx/v2/jwt"
|
||||||
"git.d-ma.be/mathias/hyperguild/internal/auth"
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
@@ -89,10 +89,10 @@ func TestValidator(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
token string
|
token string
|
||||||
wantSub string
|
wantSub string
|
||||||
wantErr bool
|
wantErr bool
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "valid jwt",
|
name: "valid jwt",
|
||||||
|
|||||||
@@ -9,14 +9,14 @@ import (
|
|||||||
// RoutingConfig holds the runtime configuration for the routing pod.
|
// RoutingConfig holds the runtime configuration for the routing pod.
|
||||||
// Separate from Config because the routing pod's surface differs from the supervisor's.
|
// Separate from Config because the routing pod's surface differs from the supervisor's.
|
||||||
type RoutingConfig struct {
|
type RoutingConfig struct {
|
||||||
Port string // ROUTING_PORT, default 3210
|
Port string // ROUTING_PORT, default 3210
|
||||||
MCPAuthToken string // ROUTING_MCP_TOKEN, optional bearer token
|
MCPAuthToken string // ROUTING_MCP_TOKEN, optional bearer token
|
||||||
LiteLLMBaseURL string // LITELLM_BASE_URL, default https://llm-api.d-ma.be
|
LiteLLMBaseURL string // LITELLM_BASE_URL, default https://llm-api.d-ma.be
|
||||||
LiteLLMAPIKey string // LITELLM_API_KEY
|
LiteLLMAPIKey string // LITELLM_API_KEY
|
||||||
BrainURL string // BRAIN_URL, default http://ingestion.supervisor:3300
|
BrainURL string // BRAIN_URL, default http://ingestion.supervisor:3300
|
||||||
BrainMCPToken string // BRAIN_MCP_TOKEN, bearer for the auth-gated ingestion /mcp (session_log)
|
BrainMCPToken string // BRAIN_MCP_TOKEN, bearer for the auth-gated ingestion /mcp (session_log)
|
||||||
FastModel string // HYPERGUILD_FAST_MODEL, default koala/qwen35-9b-fast
|
FastModel string // HYPERGUILD_FAST_MODEL, default koala/qwen35-9b-fast
|
||||||
ThinkingModel string // HYPERGUILD_THINKING_MODEL, default iguana/gemma4-26b
|
ThinkingModel string // HYPERGUILD_THINKING_MODEL, default iguana/gemma4-26b
|
||||||
// RouteLocalFloor and RouteLocalCeil intentionally invert the usual
|
// RouteLocalFloor and RouteLocalCeil intentionally invert the usual
|
||||||
// floor < ceil mathematical convention: Floor (default 0.90) is the
|
// floor < ceil mathematical convention: Floor (default 0.90) is the
|
||||||
// UPPER boundary — at/above it, always route local; Ceil (default 0.70)
|
// UPPER boundary — at/above it, always route local; Ceil (default 0.70)
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ import (
|
|||||||
|
|
||||||
// Client calls an MCP server over Streamable HTTP / JSON-RPC.
|
// Client calls an MCP server over Streamable HTTP / JSON-RPC.
|
||||||
type Client struct {
|
type Client struct {
|
||||||
url string
|
url string
|
||||||
token string
|
token string
|
||||||
http *http.Client
|
http *http.Client
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErrTokenRequired is returned by New when token is empty. Empty token
|
// ErrTokenRequired is returned by New when token is empty. Empty token
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ func TestFormatHistoryFormatsEntries(t *testing.T) {
|
|||||||
entries := []session.Entry{
|
entries := []session.Entry{
|
||||||
{
|
{
|
||||||
Skill: "tdd", Phase: "red", FinalStatus: "pass",
|
Skill: "tdd", Phase: "red", FinalStatus: "pass",
|
||||||
FilePath: "internal/foo/foo_test.go",
|
FilePath: "internal/foo/foo_test.go",
|
||||||
Message: "wrote failing test for Foo",
|
Message: "wrote failing test for Foo",
|
||||||
Timestamp: time.Now(),
|
Timestamp: time.Now(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,12 +32,12 @@ type Entry struct {
|
|||||||
type Attempt struct {
|
type Attempt struct {
|
||||||
Attempt int `json:"attempt"`
|
Attempt int `json:"attempt"`
|
||||||
Model string `json:"model"`
|
Model string `json:"model"`
|
||||||
Tier string `json:"tier"` // local | subagent | managed
|
Tier string `json:"tier"` // local | subagent | managed
|
||||||
DurationMs int64 `json:"duration_ms"`
|
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"`
|
Verified bool `json:"verified"`
|
||||||
Verdict string `json:"verdict,omitempty"` // accept | escalate | error
|
Verdict string `json:"verdict,omitempty"` // accept | escalate | error
|
||||||
Feedback string `json:"feedback,omitempty"` // verifier feedback on escalation
|
Feedback string `json:"feedback,omitempty"` // verifier feedback on escalation
|
||||||
OutputSummary string `json:"output_summary,omitempty"`
|
OutputSummary string `json:"output_summary,omitempty"`
|
||||||
RunnerOutput string `json:"runner_output,omitempty"`
|
RunnerOutput string `json:"runner_output,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user