Skip to content

Commit be8b54b

Browse files
authored
chore: quality hardening — t.Parallel(), CODEOWNERS, dependabot (#52)
* chore: add CODEOWNERS and dependabot.yml Add CODEOWNERS for PR review routing and dependabot.yml for automated dependency updates (gomod + github-actions, weekly, grouped). * test: add t.Parallel() to unit tests for concurrent execution * chore: remove dependabot.yml
1 parent 5e8a3b3 commit be8b54b

153 files changed

Lines changed: 1323 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# CODEOWNERS for eyrie (code-generation engine)
2+
* @GrayCodeAI/maintainers
3+
4+
# Engine core
5+
/codeagent/ @GrayCodeAI/core-team
6+
/router/ @GrayCodeAI/core-team
7+
/conversation/ @GrayCodeAI/core-team
8+
/internal/ @GrayCodeAI/core-team
9+
10+
# Client / API surface
11+
/client/ @GrayCodeAI/core-team
12+
/api/ @GrayCodeAI/core-team
13+
14+
# CI / release / build tooling
15+
/.github/ @GrayCodeAI/devops-team
16+
/Makefile @GrayCodeAI/devops-team
17+
/lefthook.yml @GrayCodeAI/devops-team
18+
/scripts/ @GrayCodeAI/devops-team
19+
20+
# Documentation
21+
*.md @GrayCodeAI/docs-team
22+
/docs/ @GrayCodeAI/docs-team

catalog/catalog_list_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
// --- ownerFromLiveMetadata tests ---
99

1010
func TestOwnerFromLiveMetadata(t *testing.T) {
11+
t.Parallel()
1112
tests := []struct {
1213
name string
1314
raw json.RawMessage
@@ -33,6 +34,7 @@ func TestOwnerFromLiveMetadata(t *testing.T) {
3334
// --- ownerFromModelID tests ---
3435

3536
func TestOwnerFromModelID(t *testing.T) {
37+
t.Parallel()
3638
tests := []struct {
3739
input string
3840
want string
@@ -57,6 +59,7 @@ func TestOwnerFromModelID(t *testing.T) {
5759
// --- descriptionFromLiveMetadata tests ---
5860

5961
func TestDescriptionFromLiveMetadata(t *testing.T) {
62+
t.Parallel()
6063
tests := []struct {
6164
name string
6265
raw json.RawMessage
@@ -83,6 +86,7 @@ func TestDescriptionFromLiveMetadata(t *testing.T) {
8386
// --- serverToolsFromOffering tests ---
8487

8588
func TestServerToolsFromOffering(t *testing.T) {
89+
t.Parallel()
8690
tests := []struct {
8791
name string
8892
offering ModelOfferingV1
@@ -155,6 +159,7 @@ func TestServerToolsFromOffering(t *testing.T) {
155159
// --- modelEntryFromOffering tests ---
156160

157161
func TestModelEntryFromOffering(t *testing.T) {
162+
t.Parallel()
158163
tests := []struct {
159164
name string
160165
model ModelV1
@@ -218,13 +223,15 @@ func TestModelEntryFromOffering(t *testing.T) {
218223
// --- ModelEntriesForProvider additional tests ---
219224

220225
func TestModelEntriesForProvider_NilCompiled(t *testing.T) {
226+
t.Parallel()
221227
entries := ModelEntriesForProvider(nil, "anthropic")
222228
if entries != nil {
223229
t.Fatalf("expected nil, got %v", entries)
224230
}
225231
}
226232

227233
func TestModelEntriesForProvider_EmptyProvider(t *testing.T) {
234+
t.Parallel()
228235
compiled := &CompiledCatalogV1{
229236
ModelsByID: map[string]ModelV1{
230237
"anthropic/claude-sonnet-4-6": {ID: "anthropic/claude-sonnet-4-6", Name: "Sonnet", ProviderID: "anthropic"},
@@ -237,6 +244,7 @@ func TestModelEntriesForProvider_EmptyProvider(t *testing.T) {
237244
}
238245

239246
func TestModelEntriesForProvider_DeduplicatesByNativeID(t *testing.T) {
247+
t.Parallel()
240248
compiled := &CompiledCatalogV1{
241249
ModelsByID: map[string]ModelV1{
242250
"anthropic/claude-sonnet-4-6": {ID: "anthropic/claude-sonnet-4-6", Name: "Sonnet", ProviderID: "anthropic"},
@@ -256,6 +264,7 @@ func TestModelEntriesForProvider_DeduplicatesByNativeID(t *testing.T) {
256264
// --- DiscoveryEnvKeysFromCatalog tests ---
257265

258266
func TestDiscoveryEnvKeysFromCatalog(t *testing.T) {
267+
t.Parallel()
259268
tests := []struct {
260269
name string
261270
compiled *CompiledCatalogV1
@@ -283,6 +292,7 @@ func TestDiscoveryEnvKeysFromCatalog(t *testing.T) {
283292
}
284293

285294
func TestDiscoveryEnvKeysFromCatalog_ReturnsUniqueKeys(t *testing.T) {
295+
t.Parallel()
286296
c := testLegacyCatalogV1()
287297
compiled, err := CompileCatalogV1(&c)
288298
if err != nil {
@@ -307,6 +317,7 @@ func TestDiscoveryEnvKeysFromCatalog_ReturnsUniqueKeys(t *testing.T) {
307317
// --- APIKeyEnvsForProvider tests ---
308318

309319
func TestAPIKeyEnvsForProvider(t *testing.T) {
320+
t.Parallel()
310321
c := testLegacyCatalogV1()
311322
compiled, err := CompileCatalogV1(&c)
312323
if err != nil {
@@ -333,6 +344,7 @@ func TestAPIKeyEnvsForProvider(t *testing.T) {
333344
}
334345

335346
func TestAPIKeyEnvsForProvider_NilCompiled(t *testing.T) {
347+
t.Parallel()
336348
got := APIKeyEnvsForProvider(nil, "anthropic")
337349
if got != nil {
338350
t.Fatalf("expected nil, got %v", got)
@@ -342,6 +354,7 @@ func TestAPIKeyEnvsForProvider_NilCompiled(t *testing.T) {
342354
// --- PrimaryAPIKeyEnvForDeployment tests ---
343355

344356
func TestPrimaryAPIKeyEnvForDeployment(t *testing.T) {
357+
t.Parallel()
345358
tests := []struct {
346359
deploymentID string
347360
wantEmpty bool
@@ -364,6 +377,7 @@ func TestPrimaryAPIKeyEnvForDeployment(t *testing.T) {
364377
}
365378

366379
func TestPrimaryAPIKeyEnvForDeployment_WithCompiled(t *testing.T) {
380+
t.Parallel()
367381
c := testLegacyCatalogV1()
368382
compiled, err := CompileCatalogV1(&c)
369383
if err != nil {

catalog/catalog_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package catalog
33
import "testing"
44

55
func TestAnthropicNameToCanonical(t *testing.T) {
6+
t.Parallel()
67
tests := []struct{ input, want string }{
78
{"claude-sonnet-4-6-20250814", "claude-sonnet-4-6"},
89
{"us.graycode.claude-opus-4-6-v1:0", "claude-opus-4-6"},
@@ -20,6 +21,7 @@ func TestAnthropicNameToCanonical(t *testing.T) {
2021
}
2122

2223
func TestGetModelMarketingName(t *testing.T) {
24+
t.Parallel()
2325
tests := []struct{ input, want string }{
2426
{"claude-opus-4-6", "Opus 4.6"},
2527
{"claude-sonnet-4-6[1m]", "Sonnet 4.6 (1M context)"},
@@ -36,6 +38,7 @@ func TestGetModelMarketingName(t *testing.T) {
3638
}
3739

3840
func TestGetProviderDefaultModel_AllProvidersEmptyWithoutCatalog(t *testing.T) {
41+
t.Parallel()
3942
// All providers return empty without a catalog (fully dynamic)
4043
allProviders := []string{
4144
"anthropic", "openai", "gemini", "grok", "bedrock", "kimi",
@@ -48,6 +51,7 @@ func TestGetProviderDefaultModel_AllProvidersEmptyWithoutCatalog(t *testing.T) {
4851
}
4952

5053
func TestGetModelDeprecationWarning(t *testing.T) {
54+
t.Parallel()
5155
warning := GetModelDeprecationWarning("claude-3-7-sonnet-20250219", "anthropic")
5256
if warning == "" {
5357
t.Error("expected deprecation warning for claude-3-7-sonnet on anthropic")
@@ -59,6 +63,7 @@ func TestGetModelDeprecationWarning(t *testing.T) {
5963
}
6064

6165
func TestModelsForProvider(t *testing.T) {
66+
t.Parallel()
6267
cat := testLegacyModelCatalog()
6368
models := cat.Providers["anthropic"]
6469
if len(models) == 0 {

catalog/compiled_list_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package catalog
33
import "testing"
44

55
func TestModelEntriesForProvider_OpenRouterUsesOfferings(t *testing.T) {
6+
t.Parallel()
67
raw := []byte(`{"id":"anthropic/claude-sonnet-4-6","architecture":{"modality":"text"}}`)
78
compiled := &CompiledCatalogV1{
89
ModelsByID: map[string]ModelV1{
@@ -27,6 +28,7 @@ func TestModelEntriesForProvider_OpenRouterUsesOfferings(t *testing.T) {
2728
}
2829

2930
func TestModelEntriesForProvider_CanopyWaveUsesDeploymentOfferings(t *testing.T) {
31+
t.Parallel()
3032
raw := []byte(`{"id":"moonshotai/kimi-k2.6","name":"Kimi K2.6","owned_by":"moonshotai"}`)
3133
compiled := &CompiledCatalogV1{
3234
ModelsByID: map[string]ModelV1{
@@ -51,6 +53,7 @@ func TestModelEntriesForProvider_CanopyWaveUsesDeploymentOfferings(t *testing.T)
5153
}
5254

5355
func TestModelEntriesForProvider_GeminiUsesDirectDeploymentOfferings(t *testing.T) {
56+
t.Parallel()
5457
compiled := &CompiledCatalogV1{
5558
ModelsByID: map[string]ModelV1{
5659
"gemini-flash": {ID: "gemini-flash", Name: "Flash", ProviderID: "google"},
@@ -71,6 +74,7 @@ func TestModelEntriesForProvider_GeminiUsesDirectDeploymentOfferings(t *testing.
7174
}
7275

7376
func TestCanonicalModelForProviderNative_PrefersDeploymentOverGlobalAlias(t *testing.T) {
77+
t.Parallel()
7478
compiled := &CompiledCatalogV1{
7579
Catalog: &CatalogV1{
7680
Aliases: map[string]string{
@@ -96,6 +100,7 @@ func TestCanonicalModelForProviderNative_PrefersDeploymentOverGlobalAlias(t *tes
96100
}
97101

98102
func TestModelEntriesForProvider_AnthropicUsesDirectDeploymentOfferings(t *testing.T) {
103+
t.Parallel()
99104
compiled := &CompiledCatalogV1{
100105
ModelsByID: map[string]ModelV1{
101106
"anthropic/claude-sonnet-4-6": {ID: "anthropic/claude-sonnet-4-6", Name: "Sonnet", ProviderID: "anthropic"},

catalog/credentials_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
)
66

77
func TestCredentials_Env_FiltersEmpty(t *testing.T) {
8+
t.Parallel()
89
c := Credentials{
910
APIKeys: map[string]string{
1011
"OPENAI_API_KEY": "sk-test",
@@ -32,6 +33,7 @@ func TestCredentials_Env_FiltersEmpty(t *testing.T) {
3233
}
3334

3435
func TestCredentials_Env_ReturnsCopy(t *testing.T) {
36+
t.Parallel()
3537
c := Credentials{
3638
APIKeys: map[string]string{"KEY": "val"},
3739
}
@@ -43,6 +45,7 @@ func TestCredentials_Env_ReturnsCopy(t *testing.T) {
4345
}
4446

4547
func TestCredentials_Env_NilMap(t *testing.T) {
48+
t.Parallel()
4649
var c Credentials
4750
env := c.Env()
4851
if len(env) != 0 {
@@ -51,6 +54,7 @@ func TestCredentials_Env_NilMap(t *testing.T) {
5154
}
5255

5356
func TestCredentials_Merge_AddsKeys(t *testing.T) {
57+
t.Parallel()
5458
c := Credentials{
5559
APIKeys: map[string]string{"A": "1"},
5660
}
@@ -63,6 +67,7 @@ func TestCredentials_Merge_AddsKeys(t *testing.T) {
6367
}
6468

6569
func TestCredentials_Merge_OverwritesExisting(t *testing.T) {
70+
t.Parallel()
6671
c := Credentials{
6772
APIKeys: map[string]string{"KEY": "old"},
6873
}
@@ -75,6 +80,7 @@ func TestCredentials_Merge_OverwritesExisting(t *testing.T) {
7580
}
7681

7782
func TestCredentials_Merge_InitializesNilMap(t *testing.T) {
83+
t.Parallel()
7884
var c Credentials
7985
c.Merge(Credentials{
8086
APIKeys: map[string]string{"KEY": "val"},
@@ -88,6 +94,7 @@ func TestCredentials_Merge_InitializesNilMap(t *testing.T) {
8894
}
8995

9096
func TestCredentials_Merge_SkipsEmptyKeys(t *testing.T) {
97+
t.Parallel()
9198
c := Credentials{}
9299
c.Merge(Credentials{
93100
APIKeys: map[string]string{

catalog/default_catalog_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
)
66

77
func TestDefaultCatalogV1_ReturnsBootstrap(t *testing.T) {
8+
t.Parallel()
89
c := DefaultCatalogV1()
910
if c.SchemaVersion != CatalogV1SchemaVersion {
1011
t.Fatalf("schema_version = %q", c.SchemaVersion)
@@ -15,6 +16,7 @@ func TestDefaultCatalogV1_ReturnsBootstrap(t *testing.T) {
1516
}
1617

1718
func TestDefaultCatalogV1_HasProviders(t *testing.T) {
19+
t.Parallel()
1820
c := DefaultCatalogV1()
1921
expected := []string{"anthropic", "openai", "google", "xai", "openrouter", "ollama"}
2022
for _, id := range expected {
@@ -25,6 +27,7 @@ func TestDefaultCatalogV1_HasProviders(t *testing.T) {
2527
}
2628

2729
func TestDefaultCatalogV1_HasDeployments(t *testing.T) {
30+
t.Parallel()
2831
c := DefaultCatalogV1()
2932
expected := []string{
3033
"anthropic-direct", "openai-direct", "gemini-direct",
@@ -38,6 +41,7 @@ func TestDefaultCatalogV1_HasDeployments(t *testing.T) {
3841
}
3942

4043
func TestDefaultCatalogV1_HasAPIProtocols(t *testing.T) {
44+
t.Parallel()
4145
c := DefaultCatalogV1()
4246
expected := []string{"anthropic-messages", "openai-chat-completions", "gemini-generate-content"}
4347
for _, id := range expected {
@@ -48,6 +52,7 @@ func TestDefaultCatalogV1_HasAPIProtocols(t *testing.T) {
4852
}
4953

5054
func TestDefaultCatalogV1_NoModels(t *testing.T) {
55+
t.Parallel()
5156
c := DefaultCatalogV1()
5257
if len(c.Models) != 0 {
5358
t.Fatalf("bootstrap catalog should have no models, got %d", len(c.Models))
@@ -58,6 +63,7 @@ func TestDefaultCatalogV1_NoModels(t *testing.T) {
5863
}
5964

6065
func TestDefaultCatalogV1_DeploymentsReferenceProviders(t *testing.T) {
66+
t.Parallel()
6167
c := DefaultCatalogV1()
6268
for id, dep := range c.Deployments {
6369
if c.Providers[dep.ProviderID].ID == "" {
@@ -70,13 +76,15 @@ func TestDefaultCatalogV1_DeploymentsReferenceProviders(t *testing.T) {
7076
}
7177

7278
func TestDefaultCatalogV1_Validates(t *testing.T) {
79+
t.Parallel()
7380
c := DefaultCatalogV1()
7481
if err := ValidateCatalogV1(&c); err != nil {
7582
t.Fatalf("default catalog should validate: %v", err)
7683
}
7784
}
7885

7986
func TestDefaultCatalogV1_Compiles(t *testing.T) {
87+
t.Parallel()
8088
c := DefaultCatalogV1()
8189
compiled, err := CompileCatalogV1(&c)
8290
if err != nil {
@@ -88,6 +96,7 @@ func TestDefaultCatalogV1_Compiles(t *testing.T) {
8896
}
8997

9098
func TestIsBootstrapCatalog(t *testing.T) {
99+
t.Parallel()
91100
bootstrap := BootstrapCatalogV1()
92101
if !IsBootstrapCatalog(&bootstrap) {
93102
t.Error("BootstrapCatalogV1 should be identified as bootstrap")
@@ -104,6 +113,7 @@ func TestIsBootstrapCatalog(t *testing.T) {
104113
}
105114

106115
func TestBootstrapCatalogV1_HasEnvFallbacks(t *testing.T) {
116+
t.Parallel()
107117
c := BootstrapCatalogV1()
108118
anthDep, ok := c.Deployments["anthropic-direct"]
109119
if !ok {
@@ -115,6 +125,7 @@ func TestBootstrapCatalogV1_HasEnvFallbacks(t *testing.T) {
115125
}
116126

117127
func TestBootstrapCatalogV1_HasCredentialProviders(t *testing.T) {
128+
t.Parallel()
118129
c := BootstrapCatalogV1()
119130
// Ollama is local, should not require key
120131
ollamaDep, ok := c.Deployments["ollama-local"]

0 commit comments

Comments
 (0)