Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# CODEOWNERS for eyrie (code-generation engine)
* @GrayCodeAI/maintainers

# Engine core
/codeagent/ @GrayCodeAI/core-team
/router/ @GrayCodeAI/core-team
/conversation/ @GrayCodeAI/core-team
/internal/ @GrayCodeAI/core-team

# Client / API surface
/client/ @GrayCodeAI/core-team
/api/ @GrayCodeAI/core-team

# CI / release / build tooling
/.github/ @GrayCodeAI/devops-team
/Makefile @GrayCodeAI/devops-team
/lefthook.yml @GrayCodeAI/devops-team
/scripts/ @GrayCodeAI/devops-team

# Documentation
*.md @GrayCodeAI/docs-team
/docs/ @GrayCodeAI/docs-team
14 changes: 14 additions & 0 deletions catalog/catalog_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
// --- ownerFromLiveMetadata tests ---

func TestOwnerFromLiveMetadata(t *testing.T) {
t.Parallel()
tests := []struct {
name string
raw json.RawMessage
Expand All @@ -33,6 +34,7 @@ func TestOwnerFromLiveMetadata(t *testing.T) {
// --- ownerFromModelID tests ---

func TestOwnerFromModelID(t *testing.T) {
t.Parallel()
tests := []struct {
input string
want string
Expand All @@ -57,6 +59,7 @@ func TestOwnerFromModelID(t *testing.T) {
// --- descriptionFromLiveMetadata tests ---

func TestDescriptionFromLiveMetadata(t *testing.T) {
t.Parallel()
tests := []struct {
name string
raw json.RawMessage
Expand All @@ -83,6 +86,7 @@ func TestDescriptionFromLiveMetadata(t *testing.T) {
// --- serverToolsFromOffering tests ---

func TestServerToolsFromOffering(t *testing.T) {
t.Parallel()
tests := []struct {
name string
offering ModelOfferingV1
Expand Down Expand Up @@ -155,6 +159,7 @@ func TestServerToolsFromOffering(t *testing.T) {
// --- modelEntryFromOffering tests ---

func TestModelEntryFromOffering(t *testing.T) {
t.Parallel()
tests := []struct {
name string
model ModelV1
Expand Down Expand Up @@ -218,13 +223,15 @@ func TestModelEntryFromOffering(t *testing.T) {
// --- ModelEntriesForProvider additional tests ---

func TestModelEntriesForProvider_NilCompiled(t *testing.T) {
t.Parallel()
entries := ModelEntriesForProvider(nil, "anthropic")
if entries != nil {
t.Fatalf("expected nil, got %v", entries)
}
}

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

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

func TestDiscoveryEnvKeysFromCatalog(t *testing.T) {
t.Parallel()
tests := []struct {
name string
compiled *CompiledCatalogV1
Expand Down Expand Up @@ -283,6 +292,7 @@ func TestDiscoveryEnvKeysFromCatalog(t *testing.T) {
}

func TestDiscoveryEnvKeysFromCatalog_ReturnsUniqueKeys(t *testing.T) {
t.Parallel()
c := testLegacyCatalogV1()
compiled, err := CompileCatalogV1(&c)
if err != nil {
Expand All @@ -307,6 +317,7 @@ func TestDiscoveryEnvKeysFromCatalog_ReturnsUniqueKeys(t *testing.T) {
// --- APIKeyEnvsForProvider tests ---

func TestAPIKeyEnvsForProvider(t *testing.T) {
t.Parallel()
c := testLegacyCatalogV1()
compiled, err := CompileCatalogV1(&c)
if err != nil {
Expand All @@ -333,6 +344,7 @@ func TestAPIKeyEnvsForProvider(t *testing.T) {
}

func TestAPIKeyEnvsForProvider_NilCompiled(t *testing.T) {
t.Parallel()
got := APIKeyEnvsForProvider(nil, "anthropic")
if got != nil {
t.Fatalf("expected nil, got %v", got)
Expand All @@ -342,6 +354,7 @@ func TestAPIKeyEnvsForProvider_NilCompiled(t *testing.T) {
// --- PrimaryAPIKeyEnvForDeployment tests ---

func TestPrimaryAPIKeyEnvForDeployment(t *testing.T) {
t.Parallel()
tests := []struct {
deploymentID string
wantEmpty bool
Expand All @@ -364,6 +377,7 @@ func TestPrimaryAPIKeyEnvForDeployment(t *testing.T) {
}

func TestPrimaryAPIKeyEnvForDeployment_WithCompiled(t *testing.T) {
t.Parallel()
c := testLegacyCatalogV1()
compiled, err := CompileCatalogV1(&c)
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions catalog/catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package catalog
import "testing"

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

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

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

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

func TestModelsForProvider(t *testing.T) {
t.Parallel()
cat := testLegacyModelCatalog()
models := cat.Providers["anthropic"]
if len(models) == 0 {
Expand Down
5 changes: 5 additions & 0 deletions catalog/compiled_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package catalog
import "testing"

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

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

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

func TestCanonicalModelForProviderNative_PrefersDeploymentOverGlobalAlias(t *testing.T) {
t.Parallel()
compiled := &CompiledCatalogV1{
Catalog: &CatalogV1{
Aliases: map[string]string{
Expand All @@ -96,6 +100,7 @@ func TestCanonicalModelForProviderNative_PrefersDeploymentOverGlobalAlias(t *tes
}

func TestModelEntriesForProvider_AnthropicUsesDirectDeploymentOfferings(t *testing.T) {
t.Parallel()
compiled := &CompiledCatalogV1{
ModelsByID: map[string]ModelV1{
"anthropic/claude-sonnet-4-6": {ID: "anthropic/claude-sonnet-4-6", Name: "Sonnet", ProviderID: "anthropic"},
Expand Down
7 changes: 7 additions & 0 deletions catalog/credentials_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
)

func TestCredentials_Env_FiltersEmpty(t *testing.T) {
t.Parallel()
c := Credentials{
APIKeys: map[string]string{
"OPENAI_API_KEY": "sk-test",
Expand Down Expand Up @@ -32,6 +33,7 @@ func TestCredentials_Env_FiltersEmpty(t *testing.T) {
}

func TestCredentials_Env_ReturnsCopy(t *testing.T) {
t.Parallel()
c := Credentials{
APIKeys: map[string]string{"KEY": "val"},
}
Expand All @@ -43,6 +45,7 @@ func TestCredentials_Env_ReturnsCopy(t *testing.T) {
}

func TestCredentials_Env_NilMap(t *testing.T) {
t.Parallel()
var c Credentials
env := c.Env()
if len(env) != 0 {
Expand All @@ -51,6 +54,7 @@ func TestCredentials_Env_NilMap(t *testing.T) {
}

func TestCredentials_Merge_AddsKeys(t *testing.T) {
t.Parallel()
c := Credentials{
APIKeys: map[string]string{"A": "1"},
}
Expand All @@ -63,6 +67,7 @@ func TestCredentials_Merge_AddsKeys(t *testing.T) {
}

func TestCredentials_Merge_OverwritesExisting(t *testing.T) {
t.Parallel()
c := Credentials{
APIKeys: map[string]string{"KEY": "old"},
}
Expand All @@ -75,6 +80,7 @@ func TestCredentials_Merge_OverwritesExisting(t *testing.T) {
}

func TestCredentials_Merge_InitializesNilMap(t *testing.T) {
t.Parallel()
var c Credentials
c.Merge(Credentials{
APIKeys: map[string]string{"KEY": "val"},
Expand All @@ -88,6 +94,7 @@ func TestCredentials_Merge_InitializesNilMap(t *testing.T) {
}

func TestCredentials_Merge_SkipsEmptyKeys(t *testing.T) {
t.Parallel()
c := Credentials{}
c.Merge(Credentials{
APIKeys: map[string]string{
Expand Down
11 changes: 11 additions & 0 deletions catalog/default_catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
)

func TestDefaultCatalogV1_ReturnsBootstrap(t *testing.T) {
t.Parallel()
c := DefaultCatalogV1()
if c.SchemaVersion != CatalogV1SchemaVersion {
t.Fatalf("schema_version = %q", c.SchemaVersion)
Expand All @@ -15,6 +16,7 @@ func TestDefaultCatalogV1_ReturnsBootstrap(t *testing.T) {
}

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

func TestDefaultCatalogV1_HasDeployments(t *testing.T) {
t.Parallel()
c := DefaultCatalogV1()
expected := []string{
"anthropic-direct", "openai-direct", "gemini-direct",
Expand All @@ -38,6 +41,7 @@ func TestDefaultCatalogV1_HasDeployments(t *testing.T) {
}

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

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

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

func TestDefaultCatalogV1_Validates(t *testing.T) {
t.Parallel()
c := DefaultCatalogV1()
if err := ValidateCatalogV1(&c); err != nil {
t.Fatalf("default catalog should validate: %v", err)
}
}

func TestDefaultCatalogV1_Compiles(t *testing.T) {
t.Parallel()
c := DefaultCatalogV1()
compiled, err := CompileCatalogV1(&c)
if err != nil {
Expand All @@ -88,6 +96,7 @@ func TestDefaultCatalogV1_Compiles(t *testing.T) {
}

func TestIsBootstrapCatalog(t *testing.T) {
t.Parallel()
bootstrap := BootstrapCatalogV1()
if !IsBootstrapCatalog(&bootstrap) {
t.Error("BootstrapCatalogV1 should be identified as bootstrap")
Expand All @@ -104,6 +113,7 @@ func TestIsBootstrapCatalog(t *testing.T) {
}

func TestBootstrapCatalogV1_HasEnvFallbacks(t *testing.T) {
t.Parallel()
c := BootstrapCatalogV1()
anthDep, ok := c.Deployments["anthropic-direct"]
if !ok {
Expand All @@ -115,6 +125,7 @@ func TestBootstrapCatalogV1_HasEnvFallbacks(t *testing.T) {
}

func TestBootstrapCatalogV1_HasCredentialProviders(t *testing.T) {
t.Parallel()
c := BootstrapCatalogV1()
// Ollama is local, should not require key
ollamaDep, ok := c.Deployments["ollama-local"]
Expand Down
Loading
Loading