Skip to content

Commit ce9fe2c

Browse files
author
Mateusz
committed
fix: apply gofmt to formatting commit (blank-line placement)
1 parent f31a8d2 commit ce9fe2c

42 files changed

Lines changed: 5293 additions & 5293 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
1-
package archtest
2-
3-
import "testing"
4-
5-
// TestCoreModelCatalogImportClosure enforces that core model catalog logic stays free of
6-
// models.dev adapters, plugin packages, and vendor SDKs (spec model-capabilities-catalog 7.2).
7-
func TestCoreModelCatalogImportClosure(t *testing.T) {
8-
t.Parallel()
9-
assertDepsExcludeForbidden(t, []string{"./internal/core/modelcatalog/..."}, []forbiddenDep{
10-
{
11-
Substr: "/internal/infra/modelcatalog",
12-
ErrMsg: "internal/core/modelcatalog must not import internal/infra/modelcatalog (use core ports; adapters live in infra)",
13-
},
14-
{
15-
Substr: "/internal/plugins/",
16-
ErrMsg: "internal/core/modelcatalog must not import protocol plugins",
17-
},
18-
{
19-
Substr: "github.com/openai/openai-go",
20-
ErrMsg: "internal/core/modelcatalog must not depend on OpenAI SDK",
21-
},
22-
{
23-
Substr: "github.com/anthropics/anthropic-sdk-go",
24-
ErrMsg: "internal/core/modelcatalog must not depend on Anthropic SDK",
25-
},
26-
{
27-
Substr: "google.golang.org/genai",
28-
ErrMsg: "internal/core/modelcatalog must not depend on Google GenAI SDK",
29-
},
30-
})
31-
}
32-
33-
// TestInfraModelCatalogImportClosure keeps the models.dev adapter layer plugin- and SDK-free at the repository seam.
34-
func TestInfraModelCatalogImportClosure(t *testing.T) {
35-
t.Parallel()
36-
assertDepsExcludeForbidden(t, []string{"./internal/infra/modelcatalog/..."}, []forbiddenDep{
37-
{
38-
Substr: "/internal/plugins/",
39-
ErrMsg: "internal/infra/modelcatalog must not import protocol plugins",
40-
},
41-
{
42-
Substr: "github.com/openai/openai-go",
43-
ErrMsg: "internal/infra/modelcatalog must not depend on OpenAI SDK",
44-
},
45-
})
46-
}
47-
48-
// TestPkgLipapiDoesNotImportModelCatalogInfra documents that canonical contracts never pull models.dev wire packages.
49-
func TestPkgLipapiDoesNotImportModelCatalogInfra(t *testing.T) {
50-
t.Parallel()
51-
assertDepsExcludeForbidden(t, []string{"./pkg/lipapi/..."}, []forbiddenDep{
52-
{
53-
Substr: "/internal/infra/modelcatalog",
54-
ErrMsg: "pkg/lipapi must not import model catalog infra (models.dev schema is non-contract)",
55-
},
56-
})
57-
}
1+
package archtest
2+
3+
import "testing"
4+
5+
// TestCoreModelCatalogImportClosure enforces that core model catalog logic stays free of
6+
// models.dev adapters, plugin packages, and vendor SDKs (spec model-capabilities-catalog 7.2).
7+
func TestCoreModelCatalogImportClosure(t *testing.T) {
8+
t.Parallel()
9+
assertDepsExcludeForbidden(t, []string{"./internal/core/modelcatalog/..."}, []forbiddenDep{
10+
{
11+
Substr: "/internal/infra/modelcatalog",
12+
ErrMsg: "internal/core/modelcatalog must not import internal/infra/modelcatalog (use core ports; adapters live in infra)",
13+
},
14+
{
15+
Substr: "/internal/plugins/",
16+
ErrMsg: "internal/core/modelcatalog must not import protocol plugins",
17+
},
18+
{
19+
Substr: "github.com/openai/openai-go",
20+
ErrMsg: "internal/core/modelcatalog must not depend on OpenAI SDK",
21+
},
22+
{
23+
Substr: "github.com/anthropics/anthropic-sdk-go",
24+
ErrMsg: "internal/core/modelcatalog must not depend on Anthropic SDK",
25+
},
26+
{
27+
Substr: "google.golang.org/genai",
28+
ErrMsg: "internal/core/modelcatalog must not depend on Google GenAI SDK",
29+
},
30+
})
31+
}
32+
33+
// TestInfraModelCatalogImportClosure keeps the models.dev adapter layer plugin- and SDK-free at the repository seam.
34+
func TestInfraModelCatalogImportClosure(t *testing.T) {
35+
t.Parallel()
36+
assertDepsExcludeForbidden(t, []string{"./internal/infra/modelcatalog/..."}, []forbiddenDep{
37+
{
38+
Substr: "/internal/plugins/",
39+
ErrMsg: "internal/infra/modelcatalog must not import protocol plugins",
40+
},
41+
{
42+
Substr: "github.com/openai/openai-go",
43+
ErrMsg: "internal/infra/modelcatalog must not depend on OpenAI SDK",
44+
},
45+
})
46+
}
47+
48+
// TestPkgLipapiDoesNotImportModelCatalogInfra documents that canonical contracts never pull models.dev wire packages.
49+
func TestPkgLipapiDoesNotImportModelCatalogInfra(t *testing.T) {
50+
t.Parallel()
51+
assertDepsExcludeForbidden(t, []string{"./pkg/lipapi/..."}, []forbiddenDep{
52+
{
53+
Substr: "/internal/infra/modelcatalog",
54+
ErrMsg: "pkg/lipapi must not import model catalog infra (models.dev schema is non-contract)",
55+
},
56+
})
57+
}
Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
1-
package config
2-
3-
// ModelCatalogConfig controls models.dev catalog usage, local cache, optional external refresh, and operator overrides.
4-
// Concrete fetch/cache adapters live outside core config; this struct is the typed operator surface (see design: ModelCatalogConfig).
5-
type ModelCatalogConfig struct {
6-
// Enabled when true uses the latest valid local catalog snapshot for request-time decisions (when present).
7-
Enabled bool `yaml:"enabled"`
8-
// ExternalUpdatesEnabled when true allows periodic background fetches of the catalog source (independent of Enabled).
9-
ExternalUpdatesEnabled bool `yaml:"external_updates_enabled"`
10-
// UpdateInterval is a Go duration string (e.g. "1h") for automatic refresh when ExternalUpdatesEnabled is true.
11-
UpdateInterval string `yaml:"update_interval"`
12-
// FetchTimeout is an optional Go duration string applied to catalog HTTP GET when the request context has no
13-
// deadline (0 or empty = rely on transport/client timeouts only).
14-
FetchTimeout string `yaml:"fetch_timeout"`
15-
// SourceURL is the HTTPS (or HTTP) URL for the catalog snapshot when ExternalUpdatesEnabled is true.
16-
SourceURL string `yaml:"source_url"`
17-
// CachePath is the local filesystem path for the persisted snapshot file used when Enabled or ExternalUpdatesEnabled.
18-
CachePath string `yaml:"cache_path"`
19-
// DiagnosticsPath when non-empty registers catalog status JSON under this absolute URL path (must not overlap other diagnostics paths).
20-
DiagnosticsPath string `yaml:"diagnostics_path"`
21-
// ModelOverrides are operator facts keyed by route/catalog model name (see spec requirement 5.1).
22-
ModelOverrides []ModelCatalogModelOverrideEntry `yaml:"model_overrides"`
23-
// BackendModelOverrides take precedence over ModelOverrides for matching backend/model pairs (requirement 5.2).
24-
BackendModelOverrides []ModelCatalogBackendModelOverrideEntry `yaml:"backend_model_overrides"`
25-
}
26-
27-
// ModelCatalogModelOverrideEntry is one model-scoped override row from configuration.
28-
// Optional capability and limit fields use YAML omission for "unknown"; for booleans, true means
29-
// explicitly supported and false means explicitly unsupported (runtimebundle maps into modelcatalog).
30-
type ModelCatalogModelOverrideEntry struct {
31-
Model string `yaml:"model"`
32-
33-
Tools *bool `yaml:"tools,omitempty"`
34-
StructuredOutputs *bool `yaml:"structured_outputs,omitempty"`
35-
Reasoning *bool `yaml:"reasoning,omitempty"`
36-
Vision *bool `yaml:"vision,omitempty"`
37-
Documents *bool `yaml:"documents,omitempty"`
38-
39-
ContextLimitTokens *int64 `yaml:"context_limit_tokens,omitempty"`
40-
InputLimitTokens *int64 `yaml:"input_limit_tokens,omitempty"`
41-
OutputLimitTokens *int64 `yaml:"output_limit_tokens,omitempty"`
42-
}
43-
44-
// ModelCatalogBackendModelOverrideEntry is one backend+model pair override row from configuration.
45-
type ModelCatalogBackendModelOverrideEntry struct {
46-
Backend string `yaml:"backend"`
47-
Model string `yaml:"model"`
48-
49-
Tools *bool `yaml:"tools,omitempty"`
50-
StructuredOutputs *bool `yaml:"structured_outputs,omitempty"`
51-
Reasoning *bool `yaml:"reasoning,omitempty"`
52-
Vision *bool `yaml:"vision,omitempty"`
53-
Documents *bool `yaml:"documents,omitempty"`
54-
55-
ContextLimitTokens *int64 `yaml:"context_limit_tokens,omitempty"`
56-
InputLimitTokens *int64 `yaml:"input_limit_tokens,omitempty"`
57-
OutputLimitTokens *int64 `yaml:"output_limit_tokens,omitempty"`
58-
}
1+
package config
2+
3+
// ModelCatalogConfig controls models.dev catalog usage, local cache, optional external refresh, and operator overrides.
4+
// Concrete fetch/cache adapters live outside core config; this struct is the typed operator surface (see design: ModelCatalogConfig).
5+
type ModelCatalogConfig struct {
6+
// Enabled when true uses the latest valid local catalog snapshot for request-time decisions (when present).
7+
Enabled bool `yaml:"enabled"`
8+
// ExternalUpdatesEnabled when true allows periodic background fetches of the catalog source (independent of Enabled).
9+
ExternalUpdatesEnabled bool `yaml:"external_updates_enabled"`
10+
// UpdateInterval is a Go duration string (e.g. "1h") for automatic refresh when ExternalUpdatesEnabled is true.
11+
UpdateInterval string `yaml:"update_interval"`
12+
// FetchTimeout is an optional Go duration string applied to catalog HTTP GET when the request context has no
13+
// deadline (0 or empty = rely on transport/client timeouts only).
14+
FetchTimeout string `yaml:"fetch_timeout"`
15+
// SourceURL is the HTTPS (or HTTP) URL for the catalog snapshot when ExternalUpdatesEnabled is true.
16+
SourceURL string `yaml:"source_url"`
17+
// CachePath is the local filesystem path for the persisted snapshot file used when Enabled or ExternalUpdatesEnabled.
18+
CachePath string `yaml:"cache_path"`
19+
// DiagnosticsPath when non-empty registers catalog status JSON under this absolute URL path (must not overlap other diagnostics paths).
20+
DiagnosticsPath string `yaml:"diagnostics_path"`
21+
// ModelOverrides are operator facts keyed by route/catalog model name (see spec requirement 5.1).
22+
ModelOverrides []ModelCatalogModelOverrideEntry `yaml:"model_overrides"`
23+
// BackendModelOverrides take precedence over ModelOverrides for matching backend/model pairs (requirement 5.2).
24+
BackendModelOverrides []ModelCatalogBackendModelOverrideEntry `yaml:"backend_model_overrides"`
25+
}
26+
27+
// ModelCatalogModelOverrideEntry is one model-scoped override row from configuration.
28+
// Optional capability and limit fields use YAML omission for "unknown"; for booleans, true means
29+
// explicitly supported and false means explicitly unsupported (runtimebundle maps into modelcatalog).
30+
type ModelCatalogModelOverrideEntry struct {
31+
Model string `yaml:"model"`
32+
33+
Tools *bool `yaml:"tools,omitempty"`
34+
StructuredOutputs *bool `yaml:"structured_outputs,omitempty"`
35+
Reasoning *bool `yaml:"reasoning,omitempty"`
36+
Vision *bool `yaml:"vision,omitempty"`
37+
Documents *bool `yaml:"documents,omitempty"`
38+
39+
ContextLimitTokens *int64 `yaml:"context_limit_tokens,omitempty"`
40+
InputLimitTokens *int64 `yaml:"input_limit_tokens,omitempty"`
41+
OutputLimitTokens *int64 `yaml:"output_limit_tokens,omitempty"`
42+
}
43+
44+
// ModelCatalogBackendModelOverrideEntry is one backend+model pair override row from configuration.
45+
type ModelCatalogBackendModelOverrideEntry struct {
46+
Backend string `yaml:"backend"`
47+
Model string `yaml:"model"`
48+
49+
Tools *bool `yaml:"tools,omitempty"`
50+
StructuredOutputs *bool `yaml:"structured_outputs,omitempty"`
51+
Reasoning *bool `yaml:"reasoning,omitempty"`
52+
Vision *bool `yaml:"vision,omitempty"`
53+
Documents *bool `yaml:"documents,omitempty"`
54+
55+
ContextLimitTokens *int64 `yaml:"context_limit_tokens,omitempty"`
56+
InputLimitTokens *int64 `yaml:"input_limit_tokens,omitempty"`
57+
OutputLimitTokens *int64 `yaml:"output_limit_tokens,omitempty"`
58+
}

0 commit comments

Comments
 (0)