From 3595f80c975c67f7d66e6f7323bb167b5195ac56 Mon Sep 17 00:00:00 2001 From: Lakshman Patel Date: Sat, 5 Sep 2026 12:18:37 +0530 Subject: [PATCH 1/2] docs: document the four-package host contract surface AGENTS.md claimed engine-only while all three enforcement layers deliberately allow engine, llm, graph and tools, and eight production files in graycode-cli depend on that allowance. Claude-Session: https://claude.ai/code/session_01MTUKadN91fcmuhxGWYVe2k --- AGENTS.md | 8 ++++++-- README.md | 27 ++++++++++++++++++++------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 90d88da..fad3cbb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -49,8 +49,12 @@ make ci # Full CI suite ## Common Pitfalls -- `engine` is Hawk's product boundary; Hawk must not assemble lower-level - `client`, `catalog`, `config`, `credentials`, `router`, or `runtime` packages +- `engine`, `llm`, `graph` and `tools` are the host contract surface. Graycode + must not assemble `client`, `catalog`, `config`, `credentials`, `router` or + `runtime`. Six symbols Graycode needs (`ChatOptions`, `ContinuationConfig`, + `StreamResult`, `ResponseFormat`, `ImageURLPart`, `InputAudioPart`) live in + `llm` with no `engine` alias; widening the facade to cover them is a + deliberate API change, not an incidental one. - `client.Provider` remains the lower-level compatibility boundary for other consumers; preserve its method set and the facade's type identity - Streaming tests need careful goroutine management diff --git a/README.md b/README.md index 7ee64ce..e98926d 100644 --- a/README.md +++ b/README.md @@ -45,13 +45,26 @@ provider packages. ## Ecosystem Boundaries -graycode-router is a Hawk support engine. Keep the dependency edge one-way: - -- host-facing DTOs and the `Provider` port live in `eagle/llm`; `engine/` re-exports them as aliases (`*Engine` implements `llm.Provider`) -- internal provider/transport types stay graycode-router-scoped (not shared contracts) -- do not import `hawk/internal/*` -- do not import removed legacy path `hawk/shared/types` -- do not import other engines (`harrier`, `shrike`, `swift`, `kestrel`, `merlin`) — engines are peers, not dependencies +graycode-router is a Graycode support engine. Keep the dependency edge one-way. + +Hosts may import exactly four packages: + +| Package | Carries | +|---|---| +| `engine` | the stable host-facing facade | +| `llm` | host-facing DTOs and the `Provider` port that `engine` re-exports as aliases | +| `graph` | the portable execution-graph vocabulary | +| `tools` | tool-call and tool-result contracts | + +Everything else is engine-internal: `client`, `catalog`, `config`, +`credentials`, `router`, `runtime`, and their subpackages are not shared +contracts. Enforced by `graycode-cli/scripts/check-graycode-router-engine-boundary.sh` +and two Go AST tests in `graycode-cli/internal/testaudit/`. + +- do not import `graycode-cli/internal/*` +- do not import the removed legacy path `graycode/shared/types` +- do not import other engines (`harrier`, `shrike`, `swift`, `kestrel`, + `merlin`) — engines are peers, not dependencies ## Quick Start From f9bd10941e917c786975100701cbb6bfb5493abd Mon Sep 17 00:00:00 2001 From: Lakshman Patel Date: Sat, 5 Sep 2026 12:26:10 +0530 Subject: [PATCH 2/2] docs: rename the host from hawk to graycode across docs and comments Also fixes four user-facing strings that told users to run 'hawk models refresh', corrects dead VERSIONING.md links, repoints a removed cmd/chat_config_xiaomi.go reference to the file that actually exists, removes a hard-coded personal path from test-config-flow.sh, and extends the ecosystem guard to the current host module name. Keeps HAWK_CONFIG_DIR, ~/.hawk migration paths and hawk_build tool namespaces: those are compatibility values, not prose. Claude-Session: https://claude.ai/code/session_01MTUKadN91fcmuhxGWYVe2k --- AGENTS.md | 10 ++-- CONTRIBUTING.md | 6 +-- README.md | 12 ++--- SECURITY.md | 2 +- catalog/credentials.go | 2 +- catalog/errors.go | 2 +- catalog/live/fetchers_providers.go | 2 +- catalog/provider_credentials.go | 2 +- catalog/refresh.go | 2 +- catalog/registry/protocol_matrix_test.go | 6 +-- catalog/registry/provider_spec_test.go | 2 +- catalog/testdata_test.go | 2 +- catalog/v1.go | 4 +- catalog/zai/endpoints.go | 2 +- client/adapters/poolside.go | 2 +- client/continuation.go | 4 +- client/core/image.go | 2 +- client/media.go | 2 +- config/category.go | 2 +- config/discovery_env.go | 2 +- config/provider_env.go | 2 +- config/routing_build.go | 4 +- docs/ARCHITECTURE.md | 4 +- docs/architecture/HOST-ENGINE-BOUNDARY.md | 42 ++++++++--------- docs/design/GRAYCODE-ROUTER-ENTERPRISE.md | 6 +-- docs/guides/CREDENTIAL-SETUP-FLOW.md | 12 ++--- docs/guides/DYNAMIC-MODEL-DISCOVERY.md | 48 ++++++++++---------- engine/control_plane_test.go | 2 +- engine/engine.go | 8 ++-- engine/host_control.go | 2 +- engine/migration_test.go | 2 +- graph/graph.go | 2 +- internal/observability/genai_semconv.go | 2 +- internal/observability/genai_semconv_test.go | 2 +- internal/probehttp/probehttp.go | 2 +- llm/provider.go | 6 +-- llm/types.go | 6 +-- operationsgraph/projection.go | 2 +- runtime/preflight.go | 4 +- runtime/runtime.go | 4 +- scripts/check-ecosystem-boundaries.sh | 12 ++--- scripts/test-config-flow.sh | 2 +- setup/apply_credentials.go | 2 +- setup/catalog.go | 2 +- setup/deployment.go | 2 +- setup/naming_test.go | 32 +++++++++++++ setup/setup_ui.go | 2 +- setup/status.go | 2 +- tools/versioning.go | 12 ++--- verify/cases.go | 2 +- 50 files changed, 167 insertions(+), 135 deletions(-) create mode 100644 setup/naming_test.go diff --git a/AGENTS.md b/AGENTS.md index fad3cbb..63e81ed 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -15,7 +15,7 @@ When starting any new work (feature, fix, refactor, chore), always create a feat ## Observability -See [hawk/docs/OTEL-CONVENTIONS.md](https://github.com/GrayCodeAI/hawk/blob/main/docs/OTEL-CONVENTIONS.md) for the shared OpenTelemetry attribute vocabulary (`gen_ai.*`, `cost.usd`, etc.) used across all GrayCodeAI repos. +See [graycode/docs/OTEL-CONVENTIONS.md](https://github.com/GrayCodeAI/graycode-cli/blob/main/docs/OTEL-CONVENTIONS.md) for the shared OpenTelemetry attribute vocabulary (`gen_ai.*`, `cost.usd`, etc.) used across all GrayCodeAI repos. ## Build & Test @@ -59,7 +59,7 @@ make ci # Full CI suite consumers; preserve its method set and the facade's type identity - Streaming tests need careful goroutine management - `go.work` here should stay minimal; the parent `graycode-eco/go.work` - connects this independent `graycode-router` checkout beside Hawk for local development. + connects this independent `graycode-router` checkout beside Graycode for local development. Do not add extra local `replace` directives here without coordinating with the parent workspace. @@ -145,7 +145,7 @@ make ci # Full CI suite | Main test file | `client/client_test.go` (httptest servers, provider detection) | | Linter config | `.golangci.yml` (govet, ineffassign, misspell — minimal) | -This is an independent repository consumed by Hawk. In the local -`graycode-eco` parent workspace it is checked out beside `hawk` as `../graycode-router` +This is an independent repository consumed by Graycode. In the local +`graycode-eco` parent workspace it is checked out beside `graycode` as `../graycode-router` and connected through the parent `go.work`; publish changes here, then update -Hawk's module pin through a separate PR. +Graycode's module pin through a separate PR. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fc30e2d..0e80e15 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,8 +1,8 @@ # Contributing to graycode-router Thanks for your interest! This guide covers the conventions used across the -hawk-eco. The eco-wide standards (versioning, release tooling, repo layout) -are defined in . +graycode-eco. The eco-wide standards (versioning, release tooling, repo layout) +are defined in . ## Quick start @@ -20,7 +20,7 @@ are defined in . ## Build & test -This repo uses the standardised hawk-eco Makefile targets. Run `make help` +This repo uses the standardised graycode-eco Makefile targets. Run `make help` for the full list. The most common targets: | Target | What it does | diff --git a/README.md b/README.md index e98926d..6953832 100644 --- a/README.md +++ b/README.md @@ -30,16 +30,16 @@ ## What is graycode-router -graycode-router is the LLM provider runtime that powers the [hawk](https://github.com/GrayCodeAI/hawk) coding agent. It handles everything between your application and LLM APIs — authentication, model resolution, streaming, retries, rate limiting, and caching. +graycode-router is the LLM provider runtime that powers the [graycode](https://github.com/GrayCodeAI/graycode-cli) coding agent. It handles everything between your application and LLM APIs — authentication, model resolution, streaming, retries, rate limiting, and caching. When your app calls a model, graycode-router figures out which provider to use, how to talk to it, and how to stream the response back. Switch from Anthropic to Ollama? graycode-router handles the translation. API returns 529? graycode-router retries with backoff. Response hits `max_tokens`? graycode-router continues automatically. **Your app never talks to an LLM API directly. graycode-router does.** -Hawk is the product face: it owns UX, agent orchestration, tools, permissions, +Graycode is the product face: it owns UX, agent orchestration, tools, permissions, sessions, and product semantics. GraycodeRouter is the provider engine: it owns credentials, catalog and route resolution, provider transports, normalized -streams, retry/fallback, usage, and provider telemetry. Hawk integrates through +streams, retry/fallback, usage, and provider telemetry. Graycode integrates through the stable [`engine`](engine/) facade rather than assembling GraycodeRouter's internal provider packages. @@ -187,7 +187,7 @@ ANTHROPIC_API_KEY=sk-... go run ./examples/basic/ ## Supported Providers -22 provider gateways in `catalog/registry/providers.go` (hawk `/config` uses the same list), listed in registry `SortOrder`: +22 provider gateways in `catalog/registry/providers.go` (graycode `/config` uses the same list), listed in registry `SortOrder`: | Provider | ID | Env variable | |---|---|---| @@ -315,11 +315,11 @@ tool-call count, and deployment-routing state remain queryable. ## Ecosystem -graycode-router is part of the hawk-eco: +graycode-router is part of the graycode-eco: | Component | Repository | Purpose | |---|---|---| -| **hawk** | [GrayCodeAI/hawk](https://github.com/GrayCodeAI/hawk) | AI coding agent | +| **graycode** | [GrayCodeAI/graycode-cli](https://github.com/GrayCodeAI/graycode-cli) | AI coding agent | | **graycode-router** | This repo | LLM provider runtime | | **shrike** | [GrayCodeAI/shrike](https://github.com/GrayCodeAI/shrike) | Tokenizer & compression | | **harrier** | [GrayCodeAI/harrier](https://github.com/GrayCodeAI/harrier) | Graph-based memory | diff --git a/SECURITY.md b/SECURITY.md index 53587a4..eb405b5 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -7,7 +7,7 @@ minor versions once `1.x` ships. Older versions receive critical-severity fixes only on a best-effort basis. The current canonical version is the contents of the [`VERSION`](./VERSION) -file at the repo root. See [`VERSIONING.md`](https://github.com/GrayCodeAI/hawk/blob/main/VERSIONING.md) +file at the repo root. See [`VERSIONING.md`](https://github.com/GrayCodeAI/graycode-cli/blob/main/VERSIONING.md) for the eco-wide versioning scheme. ## Reporting a vulnerability diff --git a/catalog/credentials.go b/catalog/credentials.go index b81f04a..9cbfb06 100644 --- a/catalog/credentials.go +++ b/catalog/credentials.go @@ -2,7 +2,7 @@ package catalog // Credentials carries API keys and related env (base URLs) for provider-backed catalog discovery. // Keys use standard env var names (e.g. OPENROUTER_API_KEY). Populate via config.DiscoveryCredentials. -// or pass an explicit map from hawk — do not hardcode provider lists in hawk. +// or pass an explicit map from graycode — do not hardcode provider lists in graycode. type Credentials struct { APIKeys map[string]string } diff --git a/catalog/errors.go b/catalog/errors.go index 5db192c..3565419 100644 --- a/catalog/errors.go +++ b/catalog/errors.go @@ -3,5 +3,5 @@ package catalog import "errors" // ErrCatalogCacheRequired is returned when no valid ~/.graycode-router/model_catalog.json exists. -// Run catalog discovery (hawk models refresh / graycode-router catalog discover) to populate the cache. +// Run catalog discovery (graycode models refresh / graycode-router catalog discover) to populate the cache. var ErrCatalogCacheRequired = errors.New("model catalog cache required") diff --git a/catalog/live/fetchers_providers.go b/catalog/live/fetchers_providers.go index 7dfdadb..25c226f 100644 --- a/catalog/live/fetchers_providers.go +++ b/catalog/live/fetchers_providers.go @@ -977,7 +977,7 @@ func FetchConcentrate(env map[string]string) ([]Entry, error) { // capabilities but omits the provider-level supports.tools field. // The Responses API and model-details endpoint advertise function // calling for these routed models, so preserve that capability for - // Hawk's tool-enabled coding loop. + // Graycode's tool-enabled coding loop. entry.Features = append(entry.Features, "function_calling") entries = append(entries, entry) } diff --git a/catalog/provider_credentials.go b/catalog/provider_credentials.go index d876a17..0058dc9 100644 --- a/catalog/provider_credentials.go +++ b/catalog/provider_credentials.go @@ -59,7 +59,7 @@ func apiKeyEnvFromDeployment(dep Deployment) string { } // CredentialStatusForProvider reports whether a provider needs an API key (local vs required). -// For set/empty status use hawk config.EnvKeyStatus or credentials.HasSecret — catalog does not read env. +// For set/empty status use graycode config.EnvKeyStatus or credentials.HasSecret — catalog does not read env. func CredentialStatusForProvider(compiled *CompiledCatalog, providerID string) string { providerID = canonicalProviderID(providerID) if providerID == "" { diff --git a/catalog/refresh.go b/catalog/refresh.go index 0b5c01a..f2920f4 100644 --- a/catalog/refresh.go +++ b/catalog/refresh.go @@ -96,7 +96,7 @@ func (r *RefreshResult) Summary() string { ) } -// DiscoverReport returns a multi-line report for `hawk models refresh` / `graycode-router catalog discover`. +// DiscoverReport returns a multi-line report for `graycode models refresh` / `graycode-router catalog discover`. func (r *RefreshResult) DiscoverReport() string { if r == nil || r.Compiled == nil { return "Catalog discovery: no data" diff --git a/catalog/registry/protocol_matrix_test.go b/catalog/registry/protocol_matrix_test.go index 21a6807..f21c1a4 100644 --- a/catalog/registry/protocol_matrix_test.go +++ b/catalog/registry/protocol_matrix_test.go @@ -12,7 +12,7 @@ import ( // agnes, kimi, openai, grok, openrouter, groq, canopywave, poolside, // clinepass, ollama, azure, gemini (native/Gemini protocol), concentrate (Responses) // -// Vendors documenting both OpenAI + Anthropic (hawk uses exactly one — OpenAI): +// Vendors documenting both OpenAI + Anthropic (graycode uses exactly one — OpenAI): // deepseek, zai_*, xiaomi_mimo_*, minimax_*, longcat // opencodego keeps both clients only for per-model routing (one protocol per call; // never cross-protocol fallback on the same request) @@ -21,7 +21,7 @@ import ( // anthropic, bedrock // // Rule: if a vendor is OpenAI-compatible only, do not invent an Anthropic client. -// If a vendor documents both, hawk uses OpenAI only — never both protocols for the +// If a vendor documents both, graycode uses OpenAI only — never both protocols for the // same provider request (no OpenAI→Anthropic error fallback). func TestProviderProtocolMatrix_OpenAIOnlyHaveNoAnthropicTransport(t *testing.T) { @@ -50,7 +50,7 @@ func TestProviderProtocolMatrix_OpenAIOnlyHaveNoAnthropicTransport(t *testing.T) func TestProviderProtocolMatrix_DualOfficialStayOpenAIPrimary(t *testing.T) { t.Parallel() - // Catalog primary protocol is OpenAI chat completions. Hawk clients for these + // Catalog primary protocol is OpenAI chat completions. Graycode clients for these // providers use OpenAI only (OpenCode Go is the exception: per-model single // protocol, still no cross-protocol fallback). dualPrimaryOpenAI := []string{ diff --git a/catalog/registry/provider_spec_test.go b/catalog/registry/provider_spec_test.go index 348b05c..1d7b793 100644 --- a/catalog/registry/provider_spec_test.go +++ b/catalog/registry/provider_spec_test.go @@ -26,7 +26,7 @@ func TestProviderSpecs_AgnesOpenAIOnlyLongCatOpenAIPrimary(t *testing.T) { } // LongCat: official docs expose BOTH OpenAI (/openai) and Anthropic (/anthropic). - // Hawk uses the OpenAI primary only — Anthropic is not required when OpenAI works. + // Graycode uses the OpenAI primary only — Anthropic is not required when OpenAI works. longcat, ok := registry.SpecByProviderID("longcat") if !ok { t.Fatal("missing longcat") diff --git a/catalog/testdata_test.go b/catalog/testdata_test.go index 85c6329..d4f69b9 100644 --- a/catalog/testdata_test.go +++ b/catalog/testdata_test.go @@ -7,7 +7,7 @@ import ( "testing" ) -// Run with EXPORT_HAWK_FIXTURE=1 to refresh hawk/internal/catalogtest/testdata/minimal_v1.json +// Run with EXPORT_HAWK_FIXTURE=1 to refresh graycode/internal/catalogtest/testdata/minimal_v1.json func TestExportHawkCatalogFixture(t *testing.T) { t.Parallel() if os.Getenv("EXPORT_HAWK_FIXTURE") != "1" { diff --git a/catalog/v1.go b/catalog/v1.go index 00195cc..f7ae2cc 100644 --- a/catalog/v1.go +++ b/catalog/v1.go @@ -630,7 +630,7 @@ func LoadCatalog(ctx context.Context, opts LoadCatalogOptions) (*CompiledCatalog return compiled, nil } if opts.RequireCache { - return nil, fmt.Errorf("%w (%s missing or invalid; run: hawk models refresh)", ErrCatalogCacheRequired, opts.CachePath) + return nil, fmt.Errorf("%w (%s missing or invalid; run: graycode models refresh)", ErrCatalogCacheRequired, opts.CachePath) } bootstrap := BootstrapCatalog() compiled, err := CompileCatalog(&bootstrap) @@ -639,7 +639,7 @@ func LoadCatalog(ctx context.Context, opts LoadCatalogOptions) (*CompiledCatalog } compiled.Diagnostics = append(compiled.Diagnostics, CatalogDiagnostic{ Code: "bootstrap_only", - Message: "no model catalog cache; run hawk models refresh or graycode-router catalog discover", + Message: "no model catalog cache; run graycode models refresh or graycode-router catalog discover", }) return compiled, nil } diff --git a/catalog/zai/endpoints.go b/catalog/zai/endpoints.go index 67040ba..8aa81b5 100644 --- a/catalog/zai/endpoints.go +++ b/catalog/zai/endpoints.go @@ -1,6 +1,6 @@ // Package zai resolves Z.AI (Zhipu GLM) API base URLs for General (pay-as-you-go) // and Coding Plan subscriptions across International vs China regions. -// Hawk uses the OpenAI-compatible surface only. +// Graycode uses the OpenAI-compatible surface only. package zai import ( diff --git a/client/adapters/poolside.go b/client/adapters/poolside.go index fd417b2..2634e4f 100644 --- a/client/adapters/poolside.go +++ b/client/adapters/poolside.go @@ -42,7 +42,7 @@ func (c *PoolsideClient) StreamChat(ctx context.Context, messages []core.Graycod } func (c *PoolsideClient) reasoningOnlyFallbackChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error) { - // A Laguna stream can exhaust itself in reasoning when Hawk's large tool + // A Laguna stream can exhaust itself in reasoning when Graycode's large tool // catalog is attached. Preserve tools on the primary request, but make the // one-shot recovery text-only so the model emits its final answer. opts.Tools = nil diff --git a/client/continuation.go b/client/continuation.go index ef8c6e0..d1a1f52 100644 --- a/client/continuation.go +++ b/client/continuation.go @@ -89,7 +89,7 @@ func ChatWithContinuation(ctx context.Context, p Provider, messages []GraycodeRo // It returns a StreamResult whose Events channel transparently continues across // multiple LLM calls, emitting a "continuation" event at each boundary. // -// DEPRECATION NOTE: hawk's Session loop has its own max_tokens recovery +// DEPRECATION NOTE: graycode's Session loop has its own max_tokens recovery // (internal/engine/stream.go around the `recoveryCount` loop) that doesn't // add a synthetic "Continue." user message, and the graycode-router conversation // engine (graycode-router/conversation.Engine) has its own OutputGroupID-based @@ -97,7 +97,7 @@ func ChatWithContinuation(ctx context.Context, p Provider, messages []GraycodeRo // conversation shapes (no synthetic user turns) and are the recommended // pattern for new code. This client-level helper remains for // backwards-compatibility with the embedded graycode-router HTTP server and -// non-hawk consumers; new code should implement continuation at the +// non-graycode consumers; new code should implement continuation at the // engine or call-site level instead. // // Will be removed in graycode-router v0.3.0. See graycode-router/CHANGELOG.md for the diff --git a/client/core/image.go b/client/core/image.go index 20c6aa2..ab6e956 100644 --- a/client/core/image.go +++ b/client/core/image.go @@ -37,7 +37,7 @@ var extToMediaType = map[string]string{ // encoded → (mediaType, data, true) // // It is the single entry point for image handling so the provider clients and -// hawk no longer each carry their own divergent encoder. Local files and +// graycode no longer each carry their own divergent encoder. Local files and // data-URLs are validated against supportedImageMediaTypes; HTTP URLs are left // for the provider to fetch (avoiding an SSRF surface inside graycode-router). func NormalizeImageSource(src string) (mediaType, data string, isBase64 bool, err error) { diff --git a/client/media.go b/client/media.go index 1b3c6b2..34891bd 100644 --- a/client/media.go +++ b/client/media.go @@ -17,7 +17,7 @@ import ( // // These are provider-agnostic backends for the two well-defined, broadly // supported public APIs (OpenAI Images: POST /v1/images/generations; OpenAI -// Audio: POST /v1/audio/transcriptions). They give hawk's pluggable +// Audio: POST /v1/audio/transcriptions). They give graycode's pluggable // MediaEngine / Transcriber seams a concrete default backend while staying // testable against an httptest server. A future provider (xAI image-gen, // etc.) can replace the endpoint/credentials without touching callers. diff --git a/config/category.go b/config/category.go index 5c1d3ae..d16f67e 100644 --- a/config/category.go +++ b/config/category.go @@ -99,7 +99,7 @@ func DefaultCategories() map[ModelCategory]CategoryConfig { } // GetCategoryRegistry returns the global category registry. -// It loads overrides from Hawk user config if present. +// It loads overrides from Graycode user config if present. func GetCategoryRegistry() *CategoryRegistry { registryOnce.Do(func() { globalRegistry = &CategoryRegistry{ diff --git a/config/discovery_env.go b/config/discovery_env.go index 991b480..8fd8fd7 100644 --- a/config/discovery_env.go +++ b/config/discovery_env.go @@ -11,7 +11,7 @@ import ( ) // DiscoveryCredentials loads API keys from the OS secret store (not process env or .env files), -// merged with non-secret routing from ~/.hawk/provider.json (e.g. MiMo Token Plan region/base URL). +// merged with non-secret routing from ~/.graycode/provider.json (e.g. MiMo Token Plan region/base URL). func DiscoveryCredentials(ctx context.Context) catalog.Credentials { if ctx == nil { ctx = context.Background() diff --git a/config/provider_env.go b/config/provider_env.go index 13579b6..02481a1 100644 --- a/config/provider_env.go +++ b/config/provider_env.go @@ -13,7 +13,7 @@ import ( "github.com/GrayCodeAI/graycode-router/catalog/registry" ) -// ProviderConfig mirrors the Hawk provider.json file. +// ProviderConfig mirrors the Graycode provider.json file. type ProviderConfig struct { ConfigVersion int `json:"config_version,omitempty"` Version string `json:"_version,omitempty"` diff --git a/config/routing_build.go b/config/routing_build.go index e929c8f..ea9f6dd 100644 --- a/config/routing_build.go +++ b/config/routing_build.go @@ -5,7 +5,7 @@ import ( ) // BuildRoutingPolicyFromDeployments builds deployment routing from configured deployments. -// Hawk should not author routing rules — consume this JSON from graycode-router only. +// Graycode should not author routing rules — consume this JSON from graycode-router only. func BuildRoutingPolicyFromDeployments(deployments map[string]DeploymentConfig) *RoutingPolicy { if len(deployments) == 0 { return &RoutingPolicy{} @@ -109,7 +109,7 @@ func longcatProviderStages(deployments map[string]DeploymentConfig) []RoutingSta return nil } // Single OpenAI-compatible endpoint only (longcat-direct). - // Official LongCat also documents /anthropic; hawk does not require it when OpenAI works. + // Official LongCat also documents /anthropic; graycode does not require it when OpenAI works. return singleDeploymentStages("longcat-direct", 1) } diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index f0c903e..ca2066f 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -14,9 +14,9 @@ ## target Overview -graycode-router is the LLM provider runtime for the hawk ecosystem. It sits between the application and LLM APIs, handling **authentication**, **model resolution**, **streaming**, **retries**, **rate limiting**, and **caching**. +graycode-router is the LLM provider runtime for the graycode ecosystem. It sits between the application and LLM APIs, handling **authentication**, **model resolution**, **streaming**, **retries**, **rate limiting**, and **caching**. -> lightbulb No hawk ecosystem component talks to an LLM API directly — all communication goes through graycode-router. +> lightbulb No graycode ecosystem component talks to an LLM API directly — all communication goes through graycode-router. --- diff --git a/docs/architecture/HOST-ENGINE-BOUNDARY.md b/docs/architecture/HOST-ENGINE-BOUNDARY.md index 6fee69d..262d030 100644 --- a/docs/architecture/HOST-ENGINE-BOUNDARY.md +++ b/docs/architecture/HOST-ENGINE-BOUNDARY.md @@ -5,7 +5,7 @@ Status: accepted. The host-facing compatibility contract is ## Decision -Hawk is the product face. It owns the terminal UI, agent loop, tool execution, +Graycode is the product face. It owns the terminal UI, agent loop, tool execution, permissions, conversation history, checkpoints, and product semantics. GraycodeRouter is the engine. It owns credentials, provider/deployment metadata, model discovery, catalog compilation, selection, transport construction, provider request and @@ -15,7 +15,7 @@ stream normalization, resilience, normalized usage, and provider telemetry. User | v -Hawk (face: UX, session, tools, permissions) +Graycode (face: UX, session, tools, permissions) | | stable DTOs and methods v @@ -30,14 +30,14 @@ github.com/GrayCodeAI/graycode-router/engine [contract v2] Provider model APIs ``` -The dependency is one-way: GraycodeRouter must not import Hawk. Hawk's integration layer -may import `graycode-router/engine`; Hawk command, conversation, and UI packages must not +The dependency is one-way: GraycodeRouter must not import Graycode. Graycode's integration layer +may import `graycode-router/engine`; Graycode command, conversation, and UI packages must not assemble GraycodeRouter's `catalog`, `client`, `config`, `credentials`, `router`, `runtime`, or `setup` packages. ## Composition root -Hawk constructs one `engine.Engine` from host-owned dependencies: +Graycode constructs one `engine.Engine` from host-owned dependencies: ```go e, err := engine.New(engine.Options{ @@ -53,7 +53,7 @@ e, err := engine.New(engine.Options{ `StateDir` derives `model_catalog.json` and `provider.json` when explicit paths are absent. Explicit paths win. The store, paths, remote catalog URL, and custom gateways belong to the Engine instance; production behavior does not depend on -ambient Hawk paths or a process-global custom-gateway registry. The global +ambient Graycode paths or a process-global custom-gateway registry. The global registry remains an opt-in compatibility path through `UseRegisteredCustomGateways`. @@ -77,7 +77,7 @@ MigrateProviderSecretsContext Provider-specific wire types, authentication headers, retry behavior, and raw stream events do not cross this boundary. `Model` keeps distinct `Owner`, `ProviderID`, `GatewayID`, `CanonicalID`, `Source`, and `LiveMetadata` fields so -Hawk does not reconstruct catalog meaning. +Graycode does not reconstruct catalog meaning. ## Credential-to-conversation flow @@ -98,10 +98,10 @@ Engine.ApplyCredentials / ListLiveModels +--> pass a provider-scoped environment to its live fetcher +--> merge/compile catalog and atomically update model_catalog.json v -Engine.ListModels --> Hawk picker --> Engine.SetSelection +Engine.ListModels --> Graycode picker --> Engine.SetSelection | v -Hawk builds provider-neutral GenerateRequest from its conversation +Graycode builds provider-neutral GenerateRequest from its conversation | +--> Engine.Generate `--> Engine.Stream --> normalized route/content/thinking/tool/usage events @@ -125,7 +125,7 @@ Legacy provider files may contain credential-shaped fields. The explicit `MigrateProviderSecretsContext` flow maps every recognized secret to the injected store before writing a sanitized provider file. An unmapped secret or store failure aborts the migration and restores the original state; no -plaintext backup is created. Hawk should run security status/migration before +plaintext backup is created. Graycode should run security status/migration before normal provider-state writes. ## Selection and generation @@ -136,10 +136,10 @@ explicit model is a hard constraint unless the host enables fallback. GraycodeRo owns canonicalization, gateway ownership, deployment routing, and capability matching. -GraycodeRouter generation is stateless from Hawk's point of view: +GraycodeRouter generation is stateless from Graycode's point of view: ```text -Hawk owns GraycodeRouter owns +Graycode owns GraycodeRouter owns ---------- ----------- conversation history route decision tool permission and execution provider transport @@ -151,7 +151,7 @@ session lifecycle normalized usage/telemetry `Stream` is pull-based, cancellable, and must be closed. It emits the selected route before provider events and normalizes content, thinking, tool calls, usage, retry/continuation, TTFT, and completion. Unknown future event types are -additive and must be ignored safely. GraycodeRouter emits tool requests; Hawk authorizes +additive and must be ignored safely. GraycodeRouter emits tool requests; Graycode authorizes and executes tools, appends results to its history, and begins the next model turn. @@ -176,20 +176,20 @@ The boundary is delivered GraycodeRouter-first: ```text 1. Change and verify standalone GraycodeRouter 2. Commit GraycodeRouter and publish a resolvable release/commit -3. Update Hawk's GraycodeRouter module version when required -4. Update Hawk's GraycodeRouter module pin to that exact published commit -5. Verify Hawk integration, boundary checks, and clean-clone/module builds -6. Commit the Hawk module-pin update in Hawk's repository +3. Update Graycode's GraycodeRouter module version when required +4. Update Graycode's GraycodeRouter module pin to that exact published commit +5. Verify Graycode integration, boundary checks, and clean-clone/module builds +6. Commit the Graycode module-pin update in Graycode's repository ``` -Hawk must never depend on an uncommitted GraycodeRouter worktree. The parent workspace +Graycode must never depend on an uncommitted GraycodeRouter worktree. The parent workspace uses a sibling checkout for source identity during local development; a resolvable published module version is also required for workflows that build -Hawk with `GOWORK=off`. +Graycode with `GOWORK=off`. ## Compatibility policy -Lower-level GraycodeRouter packages remain public for non-Hawk consumers and staged -migration, but they are not part of Hawk's product boundary. Additive fields +Lower-level GraycodeRouter packages remain public for non-Graycode consumers and staged +migration, but they are not part of Graycode's product boundary. Additive fields and stream events are allowed within contract v2. Removing or changing stable DTO semantics requires a contract-version and semantic-version boundary. diff --git a/docs/design/GRAYCODE-ROUTER-ENTERPRISE.md b/docs/design/GRAYCODE-ROUTER-ENTERPRISE.md index 8494ca3..363d91a 100644 --- a/docs/design/GRAYCODE-ROUTER-ENTERPRISE.md +++ b/docs/design/GRAYCODE-ROUTER-ENTERPRISE.md @@ -58,7 +58,7 @@ it is treated here as a multi-month effort. ("run prompt vX against models A/B/C"). 5. **Canary / blue-green model testing** promoted from the existing weighted/preview routing primitives into a named, observable production-traffic flow. -6. **A2A protocol** so hawk agents can call external agents (LangGraph, Vertex Agent Engine, +6. **A2A protocol** so graycode agents can call external agents (LangGraph, Vertex Agent Engine, Azure AI Foundry, Bedrock AgentCore) as tool calls through the graycode-router proxy. 7. **Fine-tuning workflow client** that submits training data, polls jobs, and registers the resulting model in graycode-router's catalog. @@ -75,7 +75,7 @@ it is treated here as a multi-month effort. (the existing `internal/grpc/README.md` policy of not adding `google.golang.org/grpc` speculatively is preserved). - **No model training** — only orchestration of provider-side fine-tuning APIs. -- The browser/IDE/cloud-execution gaps belong to hawk, not this doc. +- The browser/IDE/cloud-execution gaps belong to graycode, not this doc. --- @@ -372,7 +372,7 @@ Exit: full enterprise parity with LiteLLM/Portkey gateway feature set per the co | Redis (distributed state, priority across instances) | **Adopt opt-in** `redis/go-redis` (BSD-2) | Behind interface; not default. | | gRPC | **Defer** — keep skeleton, do not add `google.golang.org/grpc` until demanded | Per `internal/grpc/README.md` policy. | -**Licensing:** graycode-router is MIT (`LICENSE`, "Copyright (c) 2026 Hawk Contributors"). All proposed +**Licensing:** graycode-router is MIT (`LICENSE`, "Copyright (c) 2026 Graycode Contributors"). All proposed default deps (SQLite, go-keyring, OTel, uuid) are already MIT/BSD/Apache-2.0 (`go.mod`). Any opt-in adds (go-oidc Apache-2.0, pgx MIT, go-redis BSD) are MIT-compatible. **No GPL/AGPL.** A UI build toolchain (Vite/esbuild, MIT) is a dev-time dependency only — it does not ship in the diff --git a/docs/guides/CREDENTIAL-SETUP-FLOW.md b/docs/guides/CREDENTIAL-SETUP-FLOW.md index ed0f025..a0b3b4e 100644 --- a/docs/guides/CREDENTIAL-SETUP-FLOW.md +++ b/docs/guides/CREDENTIAL-SETUP-FLOW.md @@ -1,6 +1,6 @@ -# Credential setup: hawk (face) + graycode-router (brain) +# Credential setup: graycode (face) + graycode-router (brain) -**Principle:** Hawk renders UI only. GraycodeRouter owns providers, keys, validation, catalog, models. +**Principle:** Graycode renders UI only. GraycodeRouter owns providers, keys, validation, catalog, models. See also: [DYNAMIC-MODEL-DISCOVERY.md](./DYNAMIC-MODEL-DISCOVERY.md) @@ -35,7 +35,7 @@ MiMo exposes **OpenAI-compatible** and **Anthropic-compatible** APIs on the same | Pay-as-you-go | `xiaomi_mimo_payg` | `XIAOMI_MIMO_PAYG_API_KEY` | `sk-*` | `https://api.xiaomimimo.com/v1` | `https://api.xiaomimimo.com/anthropic` | | Token Plan | `xiaomi_mimo_token_plan` | `XIAOMI_MIMO_TOKEN_PLAN_API_KEY` | `tp-*` | `https://token-plan-{cn,sgp,ams}.xiaomimimo.com/v1` | `https://token-plan-{cn,sgp,ams}.xiaomimimo.com/anthropic` | -Token Plan region (`cn`, `sgp`, `ams`) is stored in `~/.hawk/provider.json` as `xiaomi_mimo_token_plan_region`. Hawk `/config` prompts for region before key paste on the Token Plan row. +Token Plan region (`cn`, `sgp`, `ams`) is stored in `~/.graycode/provider.json` as `xiaomi_mimo_token_plan_region`. Graycode `/config` prompts for region before key paste on the Token Plan row. **Auth:** `api-key` header on probe, live fetch, and chat; OpenAI paths also retry once with `Authorization: Bearer` on HTTP 401 (per [OpenAI API](https://platform.xiaomimimo.com/docs/en-US/api/chat/openai-api)). @@ -50,7 +50,7 @@ GraycodeRouter stores Anthropic **base** as `…/anthropic` (no `/v1`); `Anthrop **Legacy:** `xiaomi_mimo` / `XIAOMI_MIMO_API_KEY` / keychain account `xiaomi_mimo_api_key` migrate to pay-as-you-go (`XIAOMI_MIMO_PAYG_API_KEY` / `xiaomi_mimo_payg_api_key`) on load and startup. -**Code:** `graycode-router/catalog/xiaomi/` (URLs), `graycode-router/client/mimo.go` (dual-protocol client), `hawk/cmd/chat_config_xiaomi.go` (region UI). +**Code:** `graycode-router/catalog/xiaomi/` (URLs), `graycode-router/client/mimo.go` (dual-protocol client), `graycode-cli/cmd/chat_config_region.go` (region UI). **Not implemented (out of scope):** ASR/TTS ([Speech Recognition](https://platform.xiaomimimo.com/docs/en-US/api/audio/Speech-Recognition), speech synthesis guides), web-search billing plugins, user toggle for Anthropic-primary routing. @@ -69,7 +69,7 @@ Setup is **gateway-first**: pick the gateway on the Gateways tab, paste any non- → Pick model → ListModels (auto) when credentials exist ``` -## Host API (hawk uses `internal/graycode-routerclient` only) +## Host API (graycode uses `internal/graycode-routerclient` only) - `ResolveCredentialForHost` / `SaveCredentialForHost` - `ApplyGraycodeRouterCredentials` @@ -82,4 +82,4 @@ Setup is **gateway-first**: pick the gateway on the Gateways tab, paste any non- 1. Add one `ProviderSpec` row in `catalog/registry/providers.go` 2. Implement fetcher in `catalog/live/fetchers.go` and register in `Registry` 3. Add deployment row to remote catalog JSON (metadata only; picker uses live list) -4. No hawk changes (registry-driven `/config`) +4. No graycode changes (registry-driven `/config`) diff --git a/docs/guides/DYNAMIC-MODEL-DISCOVERY.md b/docs/guides/DYNAMIC-MODEL-DISCOVERY.md index 03b7d8e..369e975 100644 --- a/docs/guides/DYNAMIC-MODEL-DISCOVERY.md +++ b/docs/guides/DYNAMIC-MODEL-DISCOVERY.md @@ -2,13 +2,13 @@ Status: implemented through the `graycode-router/engine` contract v2. -This guide describes the host-facing path used by Hawk. Hawk is the face; GraycodeRouter +This guide describes the host-facing path used by Graycode. Graycode is the face; GraycodeRouter is the engine and source of truth for provider metadata, credentials, live model discovery, catalog compilation, selection, and provider transport. ## Ownership -| Hawk owns | GraycodeRouter owns | +| Graycode owns | GraycodeRouter owns | |---|---| | credential and model-picker UX | safe credential resolution and persistence | | conversation/session state | provider registry and deployment metadata | @@ -17,17 +17,17 @@ model discovery, catalog compilation, selection, and provider transport. | product settings and lifecycle | model ownership, aliases, selection, and routing | | normalized request construction | provider adapters, streams, usage, and errors | -Hawk calls its integration wrapper, which delegates to `graycode-router/engine`. Hawk UI, +Graycode calls its integration wrapper, which delegates to `graycode-router/engine`. Graycode UI, command, and conversation packages do not call GraycodeRouter's lower-level runtime or client packages. ## End-to-end path ```text -User enters API key or custom-gateway settings in Hawk +User enters API key or custom-gateway settings in Graycode | v -Hawk integration --> Engine.ResolveCredential +Graycode integration --> Engine.ResolveCredential | v Engine.SaveCredential @@ -47,10 +47,10 @@ Engine.ApplyCredentials / Engine.ListLiveModels `--> atomically compile the injected catalog path | v -Engine.ListModels --> Hawk picker --> Engine.SetSelection +Engine.ListModels --> Graycode picker --> Engine.SetSelection | v -Hawk conversation --> Engine.Generate or Engine.Stream --> provider API +Graycode conversation --> Engine.Generate or Engine.Stream --> provider API | `--> normalized route, content, thinking, tool-call, usage, and done events ``` @@ -61,7 +61,7 @@ exist in the same store. ## Engine construction and isolation -Create the Engine once at Hawk's composition root and inject all host-owned +Create the Engine once at Graycode's composition root and inject all host-owned state: ```go @@ -116,7 +116,7 @@ The stable model DTO intentionally distinguishes: - `GatewayID`: selected/listed gateway or deployment identity. - `Source` and `LiveMetadata`: origin and provider-native metadata. -Hawk should render these fields; it should not infer ownership from model-name +Graycode should render these fields; it should not infer ownership from model-name prefixes or parse raw provider responses. ## Provider registry @@ -134,7 +134,7 @@ ProviderSpec Provider-specific HTTP parsing remains inside registered fetchers/adapters. Adding a built-in provider should normally require registry data, its adapter -or live fetcher, and tests—not new branches in Hawk UI code. +or live fetcher, and tests—not new branches in Graycode UI code. Custom OpenAI-compatible gateways are invocation-scoped Engine options rather than registry mutations. Their URLs must be HTTP(S) with a host and must not @@ -181,14 +181,14 @@ failed live response is not silently represented as successful live readiness. ## Selection and conversation handoff -Hawk persists a choice through `Engine.SetSelection(provider, model)`. GraycodeRouter +Graycode persists a choice through `Engine.SetSelection(provider, model)`. GraycodeRouter validates provider/model ownership, preserves custom model IDs, canonicalizes built-in aliases, and stores routing metadata at the injected provider path. -At generation time Hawk passes provider-neutral messages, tools, +At generation time Graycode passes provider-neutral messages, tools, requirements, preferences, limits, and metadata. `Resolve`, `Generate`, and `Stream` use the same Engine-owned catalog, provider state, credentials, and -custom-gateway snapshot. Hawk neither constructs a provider client nor exports +custom-gateway snapshot. Graycode neither constructs a provider client nor exports credentials into the process environment. ## Local and live preflight @@ -211,7 +211,7 @@ Live (VerifyLive=true) Local preflight is safe for normal startup and offline diagnostics. Live preflight is an explicit network check and should be labeled accordingly in -Hawk. +Graycode. ## State and secret safety @@ -230,7 +230,7 @@ Engine provider-state mutations: `MigrateProviderSecretsContext` is the explicit legacy migration. If mapping or store persistence fails, it aborts and restores the original provider state. -Hawk diagnostics can use `ProviderStateSecurityStatus`, `CatalogHealth`, and +Graycode diagnostics can use `ProviderStateSecurityStatus`, `CatalogHealth`, and the safe credential/gateway reports without reading either file directly. ## Failure handling @@ -246,26 +246,26 @@ the safe credential/gateway reports without reading either file directly. | custom gateway URL contains embedded data | reject configuration | | stream caller exits | close/cancel the Engine stream | -Provider-specific friendly error formatting remains GraycodeRouter-owned; Hawk decides +Provider-specific friendly error formatting remains GraycodeRouter-owned; Graycode decides where and how to display it. -## Release order for Hawk +## Release order for Graycode -GraycodeRouter is changed and released before Hawk advances its dependency: +GraycodeRouter is changed and released before Graycode advances its dependency: ```text standalone GraycodeRouter change --> GraycodeRouter tests (two passes) --> signed GraycodeRouter commit --> publish a resolvable GraycodeRouter module release/commit - --> update Hawk module dependency when needed - --> update Hawk's GraycodeRouter module pin to the same published commit - --> Hawk integration + boundary + clean-clone verification (two passes) - --> commit Hawk code and gitlink together + --> update Graycode module dependency when needed + --> update Graycode's GraycodeRouter module pin to the same published commit + --> Graycode integration + boundary + clean-clone verification (two passes) + --> commit Graycode code and gitlink together ``` The parent workspace must use a committed GraycodeRouter checkout, never working-tree- -only code, and Hawk's module pin must resolve to that same published commit. +only code, and Graycode's module pin must resolve to that same published commit. Both workspace builds and `GOWORK=off` builds must expose the same Engine contract. @@ -274,4 +274,4 @@ contract. - `docs/architecture/HOST-ENGINE-BOUNDARY.md` — ownership and compatibility policy. - `CREDENTIAL-SETUP-FLOW.md` — product setup flow. -- Hawk's dynamic-model and architecture docs — host integration and UI behavior. +- Graycode's dynamic-model and architecture docs — host integration and UI behavior. diff --git a/engine/control_plane_test.go b/engine/control_plane_test.go index 1f91def..54c07aa 100644 --- a/engine/control_plane_test.go +++ b/engine/control_plane_test.go @@ -50,7 +50,7 @@ func TestControlPlaneUsesInjectedCredentialStore(t *testing.T) { if eng.catalogPath != filepath.Join(filepath.Dir(eng.providerConfigPath), "model_catalog.json") { // Both paths must derive from the injected StateDir. The exact assertion - // catches accidental fallback to process-global Hawk paths. + // catches accidental fallback to process-global Graycode paths. t.Fatalf("control-plane paths escaped injected state dir: catalog=%q provider=%q", eng.catalogPath, eng.providerConfigPath) } } diff --git a/engine/engine.go b/engine/engine.go index a4b00bf..cb298b4 100644 --- a/engine/engine.go +++ b/engine/engine.go @@ -123,10 +123,10 @@ func New(opts Options) (*Engine, error) { } // migrateProviderConfigDir copies a provider.json left in the old -// product-specific "hawk" config dir into the new host-neutral "graycode-router" dir the +// product-specific "graycode" config dir into the new host-neutral "graycode-router" dir the // first time an engine starts after the rename. Without this, upgrading users // silently lose their active provider/model selection, deployments, and routing -// (hawk starts as if unconfigured and they must re-run /config). +// (graycode starts as if unconfigured and they must re-run /config). // // The copy only happens when the graycode-router-dir provider.json does not yet exist, so // it is a one-time, idempotent migration that never overwrites newer state. @@ -144,8 +144,8 @@ func migrateProviderConfigDir() { if err != nil || userDir == "" { return } - // The old "hawk" subdir lived in the user-config root. If a custom - // GRAYCODE_ROUTER_CONFIG_DIR is in use, there is no old "hawk" subdir to migrate + // The old "graycode" subdir lived in the user-config root. If a custom + // GRAYCODE_ROUTER_CONFIG_DIR is in use, there is no old "graycode" subdir to migrate // from; skip. oldDir := filepath.Join(userDir, "hawk") // Copy old // the first time an diff --git a/engine/host_control.go b/engine/host_control.go index f707a1e..ce1270d 100644 --- a/engine/host_control.go +++ b/engine/host_control.go @@ -24,7 +24,7 @@ func SecretStoreName() string { return credentials.PlatformSecretStoreName() } // SetSecretStoreServiceName overrides the OS secret-store service name (default // "graycode-router"). Hosts call this once at startup so existing credentials filed under -// their product name (e.g. "hawk") stay readable. +// their product name (e.g. "graycode") stay readable. func SetSecretStoreServiceName(name string) { credentials.SetServiceName(name) } // -- Test-fixture re‑exports ------------------------------------------------- diff --git a/engine/migration_test.go b/engine/migration_test.go index 3199967..c4d3893 100644 --- a/engine/migration_test.go +++ b/engine/migration_test.go @@ -11,7 +11,7 @@ import ( // TestMigrateConfigDirHonorsGRAYCODE_ROUTER_CONFIG_DIR verifies H1 fix: when // GRAYCODE_ROUTER_CONFIG_DIR is set, the migration copies from -// /hawk/ → /, not the default path. +// /graycode/ → /, not the default path. func TestMigrateConfigDirHonorsGRAYCODE_ROUTER_CONFIG_DIR(t *testing.T) { // Fresh state for this test. migrateProviderConfigDirOnce = sync.Once{} diff --git a/graph/graph.go b/graph/graph.go index 39dfed8..b307d69 100644 --- a/graph/graph.go +++ b/graph/graph.go @@ -1,4 +1,4 @@ -// Package graph defines the portable graph vocabulary shared across hawk-eco. +// Package graph defines the portable graph vocabulary shared across graycode-eco. // // The package contains data contracts only. Individual repositories retain // ownership of their graph storage, projections, and runtime behavior. diff --git a/internal/observability/genai_semconv.go b/internal/observability/genai_semconv.go index 96cd83e..716020d 100644 --- a/internal/observability/genai_semconv.go +++ b/internal/observability/genai_semconv.go @@ -3,7 +3,7 @@ // These exported constants are the canonical, ecosystem-wide attribute keys for // describing LLM / AI agent operations. They follow the OpenTelemetry GenAI // semantic conventions (gen_ai.*) and are shared as the reference set that the -// other hawk-eco repos (hawk, harrier, shrike, swift) should mirror when emitting +// other graycode-eco repos (graycode, harrier, shrike, swift) should mirror when emitting // spans, so dashboards and exporters can correlate cost/usage/identity across // the whole ecosystem. // diff --git a/internal/observability/genai_semconv_test.go b/internal/observability/genai_semconv_test.go index 0626fb3..3ec721e 100644 --- a/internal/observability/genai_semconv_test.go +++ b/internal/observability/genai_semconv_test.go @@ -4,7 +4,7 @@ import "testing" // TestGenAISemConvKeys pins the canonical gen_ai.* attribute keys so that the // ecosystem-wide convention documented in docs/OTEL-CONVENTIONS.md cannot drift -// silently. Other hawk-eco repos mirror these exact strings. +// silently. Other graycode-eco repos mirror these exact strings. func TestGenAISemConvKeys(t *testing.T) { t.Parallel() cases := []struct { diff --git a/internal/probehttp/probehttp.go b/internal/probehttp/probehttp.go index 3091296..9ae1b7d 100644 --- a/internal/probehttp/probehttp.go +++ b/internal/probehttp/probehttp.go @@ -26,7 +26,7 @@ const DefaultRequestTimeout = 15 * time.Second var DefaultClient = &http.Client{Timeout: DefaultRequestTimeout} // ProbeError builds a credential-probe error message for a non-2xx response. -// The wording is part of the public surface that hawk surfaces to users when +// The wording is part of the public surface that graycode surfaces to users when // /config probe fails, so the strings here are stable. // // status is the HTTP status code returned by the provider. The function diff --git a/llm/provider.go b/llm/provider.go index d21ccec..7558300 100644 --- a/llm/provider.go +++ b/llm/provider.go @@ -6,9 +6,9 @@ import ( "time" ) -// Provider is hawk's hawk-owned view of the provider engine: a composition of -// the role interfaces below. It is the single integration surface — hawk never -// holds an *graycoderouterengine.Engine, and graycode-router never imports hawk/internal. +// Provider is graycode's graycode-owned view of the provider engine: a composition of +// the role interfaces below. It is the single integration surface — graycode never +// holds an *graycoderouterengine.Engine, and graycode-router never imports graycode/internal. // // Callers that need only a subset depend on the relevant role interface // directly (e.g. session_factory depends only on Generator), keeping the diff --git a/llm/types.go b/llm/types.go index 3554960..4c91d46 100644 --- a/llm/types.go +++ b/llm/types.go @@ -1,11 +1,11 @@ -// Package llm is the canonical provider port contract for the hawk ecosystem. +// Package llm is the canonical provider port contract for the graycode ecosystem. // // It is the single source of truth for the conversation DTOs and the Provider -// interface that hawk (product face) and graycode-router (provider engine) speak across +// interface that graycode (product face) and graycode-router (provider engine) speak across // their boundary. Both sides alias to these types, so there is exactly one // definition of each DTO and no per-call conversion. // -// hawk owns the product vocabulary (hence names like GraycodeRouterMessage); graycode-router +// graycode owns the product vocabulary (hence names like GraycodeRouterMessage); graycode-router // implements the port. graycode-router's internal transport types stay graycode-router-scoped and // never appear here. package llm diff --git a/operationsgraph/projection.go b/operationsgraph/projection.go index 1801194..45f1a67 100644 --- a/operationsgraph/projection.go +++ b/operationsgraph/projection.go @@ -1,5 +1,5 @@ // Package operationsgraph projects GraycodeRouter routing and normalized generation -// telemetry into the portable hawk-eco graph contract. +// telemetry into the portable graycode-eco graph contract. package operationsgraph import ( diff --git a/runtime/preflight.go b/runtime/preflight.go index 4e48c21..5e66cdf 100644 --- a/runtime/preflight.go +++ b/runtime/preflight.go @@ -26,7 +26,7 @@ type PreflightCheck struct { Detail string `json:"detail"` } -// PreflightReport summarizes whether hawk can chat. +// PreflightReport summarizes whether graycode can chat. type PreflightReport struct { Ready bool `json:"ready"` Checks []PreflightCheck `json:"checks"` @@ -45,7 +45,7 @@ func Preflight(ctx context.Context) PreflightReport { if !exists || size == 0 { checks = append(checks, PreflightCheck{ Name: "catalog", Status: PreflightWarn, - Detail: "model catalog cache missing — hawk will discover on /config or refresh automatically", + Detail: "model catalog cache missing — graycode will discover on /config or refresh automatically", }) } else { compiled, err := catalog.LoadCatalog(ctx, catalog.LoadCatalogOptions{ diff --git a/runtime/runtime.go b/runtime/runtime.go index ff7906a..afecd00 100644 --- a/runtime/runtime.go +++ b/runtime/runtime.go @@ -1,10 +1,10 @@ // Package runtime is the **recommended entry point** for host applications -// (e.g. hawk). Start by calling runtime.Load to get a *Runtime, then +// (e.g. graycode). Start by calling runtime.Load to get a *Runtime, then // rt.ChatProvider to obtain a client.Provider that you can hand to your // agent loop. // // Note: the "stable" surface of graycode-router is actually a set of cooperating -// subpackages, not just this one. The full list hawk (and other host +// subpackages, not just this one. The full list graycode (and other host // applications) actually import is: // // github.com/GrayCodeAI/graycode-router/runtime (this package — bootstrap facade) diff --git a/scripts/check-ecosystem-boundaries.sh b/scripts/check-ecosystem-boundaries.sh index dc42a9c..c5ef8ba 100755 --- a/scripts/check-ecosystem-boundaries.sh +++ b/scripts/check-ecosystem-boundaries.sh @@ -4,10 +4,10 @@ set -euo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" cd "$ROOT_DIR" -# GraycodeRouter is host-neutral: it must not depend on any Hawk package. Shared -# ecosystem vocabulary belongs in eagle, whose module path does -# not match this expression. -FORBIDDEN_HAWK='github\.com/GrayCodeAI/hawk(/|")' +# GraycodeRouter is host-neutral: it must not depend on any Graycode package. +# Shared ecosystem vocabulary lives in graycode-cli/internal/contracts, which +# hosts vendor rather than import from here. +FORBIDDEN_HAWK='github\.com/GrayCodeAI/(hawk|graycode-cli)(/|")' FORBIDDEN_ENGINES='github\.com/GrayCodeAI/(harrier|shrike|swift|kestrel|merlin)(/|")' exit_code=0 @@ -21,10 +21,10 @@ else fi if [[ -n "${violations}" ]]; then - echo "forbidden Hawk imports found:" + echo "forbidden Graycode host imports found:" echo "${violations}" echo - echo "graycode-router must use eagle or local contracts, never the Hawk product module" + echo "graycode-router must use local contracts, never the Graycode product module" exit_code=1 fi diff --git a/scripts/test-config-flow.sh b/scripts/test-config-flow.sh index 288b806..787aa39 100755 --- a/scripts/test-config-flow.sh +++ b/scripts/test-config-flow.sh @@ -41,7 +41,7 @@ fi # 4. Verify all providers have live fetchers echo "--- live fetchers ---" -cd /Users/lakshmanpatel/Desktop/OSS2026/RealWork/hawk-eco/graycode-router +cd "$(dirname "$0")/.." fetchers=$(grep -c '".*":\s*Fetch' catalog/live/fetchers.go 2>/dev/null || echo 0) if [ "$fetchers" -ge 11 ]; then pass "all 11 providers have live fetchers" diff --git a/setup/apply_credentials.go b/setup/apply_credentials.go index 929040b..73813d8 100644 --- a/setup/apply_credentials.go +++ b/setup/apply_credentials.go @@ -56,7 +56,7 @@ func ApplyCredentialsForProvider(ctx context.Context, providerID string, creds c } // ApplyCredentials discovers the model catalog from env API keys, then writes -// ~/.hawk/provider.json deployments and routing derived from the catalog. +// ~/.graycode/provider.json deployments and routing derived from the catalog. func ApplyCredentials(ctx context.Context, creds catalog.Credentials) (*ApplyCredentialsResult, error) { catResult, err := DiscoverModelCatalog(ctx, creds) if err != nil { diff --git a/setup/catalog.go b/setup/catalog.go index 3063b38..05941e3 100644 --- a/setup/catalog.go +++ b/setup/catalog.go @@ -20,7 +20,7 @@ func DiscoverModelCatalog(ctx context.Context, creds catalog.Credentials) (*cata return DiscoverModelCatalogWithOptions(ctx, creds, DiscoverModelCatalogOptions{}) } -// DiscoverModelCatalogWithOptions runs discover with optional force refresh (manual hawk models refresh). +// DiscoverModelCatalogWithOptions runs discover with optional force refresh (manual graycode models refresh). func DiscoverModelCatalogWithOptions(ctx context.Context, creds catalog.Credentials, opts DiscoverModelCatalogOptions) (*catalog.RefreshResult, error) { cachePath := catalog.DefaultCachePath() refreshRemote := opts.ForceRefresh diff --git a/setup/deployment.go b/setup/deployment.go index 3a72958..fa7bcc7 100644 --- a/setup/deployment.go +++ b/setup/deployment.go @@ -1,4 +1,4 @@ -// Package setup wires catalog-backed deployment routing for hawk and graycode-router CLIs. +// Package setup wires catalog-backed deployment routing for graycode and graycode-router CLIs. package setup import ( diff --git a/setup/naming_test.go b/setup/naming_test.go new file mode 100644 index 0000000..c63f967 --- /dev/null +++ b/setup/naming_test.go @@ -0,0 +1,32 @@ +package setup + +import ( + "os" + "path/filepath" + "strings" + "testing" +) + +// TestNoLegacyHostNameInUserFacingStrings guards the three call sites that +// print a command for the user to run. They named the old product. +func TestNoLegacyHostNameInUserFacingStrings(t *testing.T) { + files := []string{ + filepath.Join("..", "catalog", "v1.go"), + filepath.Join("..", "setup", "status.go"), + filepath.Join("..", "runtime", "preflight.go"), + } + for _, f := range files { + data, err := os.ReadFile(f) // #nosec G304 -- fixed test fixture paths + if err != nil { + t.Fatalf("read %s: %v", f, err) + } + for i, line := range strings.Split(string(data), "\n") { + if !strings.Contains(line, `"`) { + continue + } + if strings.Contains(line, "hawk models refresh") || strings.Contains(line, "hawk will discover") || strings.Contains(line, "hawk refreshes") { + t.Errorf("%s:%d prints the legacy host name to the user: %s", f, i+1, strings.TrimSpace(line)) + } + } + } +} diff --git a/setup/setup_ui.go b/setup/setup_ui.go index 4e7ba6e..918e001 100644 --- a/setup/setup_ui.go +++ b/setup/setup_ui.go @@ -22,7 +22,7 @@ type ProviderUI struct { Models []ModelUI `json:"models"` } -// SetupUI is JSON-safe metadata returned to hawk (no secrets). +// SetupUI is JSON-safe metadata returned to graycode (no secrets). type SetupUI struct { Providers []ProviderUI `json:"providers"` } diff --git a/setup/status.go b/setup/status.go index 75db1a0..67d0764 100644 --- a/setup/status.go +++ b/setup/status.go @@ -132,7 +132,7 @@ func FormatStatus(report StatusReport) string { fmt.Fprintf(&b, " cached: no (using embedded catalog: %d models)\n", report.CatalogModels) } if report.CatalogStale { - b.WriteString(" stale: yes — hawk refreshes automatically; use `hawk models refresh` or `/refresh-model-catalog` for a manual run\n") + b.WriteString(" stale: yes — graycode refreshes automatically; use `graycode models refresh` or `/refresh-model-catalog` for a manual run\n") } if report.ActiveModel != "" { fmt.Fprintf(&b, "Active canonical model: %s\n", report.ActiveModel) diff --git a/tools/versioning.go b/tools/versioning.go index 9d4f3ce..ec0b8d6 100644 --- a/tools/versioning.go +++ b/tools/versioning.go @@ -33,7 +33,7 @@ func BehaviorPresetFrom(s string) (BehaviorPreset, error) { } // FinalizeErrorCode classifies a finalize warning or violation, mirroring the -// FINALIZE_ERROR_CODE enum in proto/hawk/contracts/v1/tool.proto. +// FINALIZE_ERROR_CODE enum in proto/graycode/contracts/v1/tool.proto. type FinalizeErrorCode int const ( @@ -90,7 +90,7 @@ func (r FinalizeResult) Ok() bool { } // ToolMeta is the canonical identity envelope attached to tool-call events, -// mirroring the ToolMeta message in proto/hawk/contracts/v1/tool.proto. +// mirroring the ToolMeta message in proto/graycode/contracts/v1/tool.proto. // version is an additive-only bump: new additive fields do NOT change it. type ToolMeta struct { Version string `json:"version"` @@ -102,21 +102,21 @@ type ToolMeta struct { } // ToolNamespace is a CLOSED enum identifying the harness that owns a tool, -// mirroring the ToolNamespace enum in proto/hawk/contracts/v1/tool.proto. A new +// mirroring the ToolNamespace enum in proto/graycode/contracts/v1/tool.proto. A new // unknown namespace is a wire-breaking change that intentionally fails // ToolNamespaceFrom (forward-safety): a deploy that rolls the contract forward // before the consumer code cannot silently mis-route a tool it doesn't -// understand. ToolNamespaceAcp is reserved for the forthcoming hawk-acp repo. +// understand. ToolNamespaceAcp is reserved for the forthcoming graycode-acp repo. type ToolNamespace string const ( ToolNamespaceUnspecified ToolNamespace = "" // unspecified - ToolNamespaceHawkBuild ToolNamespace = "hawk_build" // hawk + ToolNamespaceHawkBuild ToolNamespace = "hawk_build" // graycode ToolNamespaceHawkBuildConcise ToolNamespace = "hawk_build_concise" ToolNamespaceCodex ToolNamespace = "codex" // codex harness ToolNamespaceOpencode ToolNamespace = "opencode" // opencode harness ToolNamespaceMcp ToolNamespace = "mcp" // MCP servers (falcon) - ToolNamespaceAcp ToolNamespace = "acp" // reserved: hawk-acp + ToolNamespaceAcp ToolNamespace = "acp" // reserved: graycode-acp ) // ToolNamespaceFrom parses a namespace string into a ToolNamespace. The set is diff --git a/verify/cases.go b/verify/cases.go index 8fe75ee..4051ab0 100644 --- a/verify/cases.go +++ b/verify/cases.go @@ -2,7 +2,7 @@ package verify import "github.com/GrayCodeAI/graycode-router/client" -// CanonicalCases is a small, provider-neutral suite covering the behaviors hawk +// CanonicalCases is a small, provider-neutral suite covering the behaviors graycode // depends on: basic chat, deterministic content, and tool calling with valid // arguments. It is intentionally minimal so it is cheap to run against a live // endpoint; extend it per provider as needed.