Skip to content

refactor(model-registry): fold src/models/ (discovery layer) into model_registry/ - #1430

Merged
joelteply merged 1 commit into
canaryfrom
refactor/move-models-discovery-into-model-registry
May 18, 2026
Merged

joelteply merged 1 commit into
canaryfrom
refactor/move-models-discovery-into-model-registry

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Closes the parallel-dir smell codex flagged

"models/ AND model_registry/ separate dirs. models/mod.rs is the only file in models/ but it's still actively imported ... Old source-of-truth ghost that should be deleted but persists."

Per Joel's "zero users, FULLBLOWN rust driven dev" calibration: no transition period, no deprecation shim. Move the file, fix the one import site, delete the empty dir.

What changed (4 files, +2/-2)

  • `src/models/mod.rs` (352 LOC, model-discovery HTTP layer) → `src/model_registry/discovery.rs` (git rename detected, single move, zero content change)
  • `src/lib.rs`: drop `pub mod models;`
  • `src/model_registry/mod.rs`: add `pub mod discovery;`
  • `src/modules/models.rs`: `use crate::models::{ProviderConfig, discover_all}` → `use crate::model_registry::discovery::{discover_all, ProviderConfig}`

Why this is conceptually right

`models/` was the live-discovery layer (queries OpenAI / Groq / Together / Anthropic API endpoints for available models). `model_registry/` is the curated static catalog (Rust code post-#1424).

Both are model-metadata responsibilities; both belong under ONE umbrella. The names diverged historically — `models/` predates `model_registry/`. Lane A's #1424 made `model_registry/` the canonical Rust-truth home; this PR closes the loop by pulling discovery into the same module tree.

The discovery vs catalog distinction is preserved (it's two sub-modules now, not two top-level dirs), so callers that need "live API discovery" still get the explicit `discovery::` namespace.

Validation

```
cd src/workers/continuum-core
cargo build --features metal,accelerate --lib # clean
cargo test --features metal,accelerate --lib model_registry # 16 pass
```

Precommit chat-roundtrip PASSED.

🤖 Generated with Claude Code

…el_registry/

Closes the audit smell codex flagged in #1414 / earlier scan:
'models/ AND model_registry/ separate dirs. models/mod.rs is the
only file in models/ but it's still actively imported ... Old
source-of-truth ghost that should be deleted but persists.'

Per Joel's "we are not in some maintenance mode — zero users,
FULLBLOWN rust driven dev" calibration: no transition period, no
deprecation shim. Move the file to its new home, fix the one
import site, delete the empty dir.

## What changed

- `src/models/mod.rs` (352 LOC, model-discovery HTTP layer) →
  `src/model_registry/discovery.rs` (single move, no content
  change — git rename detected)
- `src/lib.rs`: remove `pub mod models;` (one line)
- `src/model_registry/mod.rs`: add `pub mod discovery;`
- `src/modules/models.rs`:
  `use crate::models::{ProviderConfig, discover_all};` →
  `use crate::model_registry::discovery::{discover_all, ProviderConfig};`

## Why this is conceptually right

`models/` was the live-discovery layer (queries OpenAI / Groq /
Together API endpoints for available models). `model_registry/`
is the curated static catalog (Rust code post-#1424).

Both are model-metadata responsibilities; both belong under
ONE umbrella. The names diverged historically — `models/` predates
`model_registry/`. Lane A's #1424 made `model_registry/` the
canonical Rust-truth home; this PR closes the loop by pulling
discovery into the same module tree.

The discovery vs catalog distinction is preserved (it's two
sub-modules now, not two top-level dirs), so callers that need
"live API discovery" still get the explicit `discovery::`
namespace.

## Validation

  - `cargo build --features metal,accelerate --lib` clean (no
    errors, no new warnings)
  - `cargo test --features metal,accelerate --lib model_registry`
    16 tests pass

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@joelteply
joelteply merged commit 192189d into canary May 18, 2026
3 checks passed
@joelteply
joelteply deleted the refactor/move-models-discovery-into-model-registry branch May 18, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant