Skip to content

feat(positron): ModelCatalog → ForgeViewState projection (brick 1) - #1761

Merged
joelteply merged 2 commits into
canaryfrom
feat/foundry-catalog-projection
Jul 4, 2026
Merged

joelteply merged 2 commits into
canaryfrom
feat/foundry-catalog-projection

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The projection half of foundry: a pure fold from the live CatalogSnapshot (#78) to the neutral ForgeViewState — the foundry room's right-hand model Listing. Each entry → ForgeModelView (id, name→id fallback, provider as source, parameter_count→billions with 0→None honest-unknown). REPLACE-on-change, deterministic BTreeMap order.

Pure (snapshot in → view out, no I/O) so it unit-tests without a running catalogue; the live watch-subscribe + per-room publish lands with structured room-purpose (#6). 3 tests: empty→empty, rows→Listing (name fallback + params), unknown params→None.

🤖 Generated with Claude Code

The projection half of foundry: a pure fold from the live catalogue's
`CatalogSnapshot` (#78's watch-published model state) to the neutral
`ForgeViewState` — the foundry room's right-hand model `Listing`. Each catalogue
entry becomes a `ForgeModelView` (id, name→id fallback, provider as source,
parameter_count→billions with 0→None honest-unknown, never a fabricated 0.0).
REPLACE-on-change like chat/wall; models come out in the snapshot's deterministic
BTreeMap order.

Pure by design (snapshot in → view out, no I/O) so it unit-tests without a running
catalogue — the live wiring that subscribes to the catalogue watch and publishes
per foundry room lands with structured room-purpose tagging (#6), which is what
gives a foundry room to project *for*. 3 tests: empty catalogue → empty view,
rows → model Listing (name fallback + params), unknown param count → None.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ojection (review #1761)

Compression fix from the #1761 review: the 0-is-unknown → None param logic was a
byte-for-byte duplicate of the canonical Model::parameter_count_billions() helper.
Read the one source of truth instead of restating the sentinel — if it ever
changes, these can't drift.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit b209f6e into canary Jul 4, 2026
4 checks passed
@joelteply
joelteply deleted the feat/foundry-catalog-projection branch July 4, 2026 03:35
@joelteply
joelteply restored the feat/foundry-catalog-projection branch August 21, 2026 12:40
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