Repository navigation
feat(tools)!: catalog tools on stock routes; model policy in tenant config (CL-8170) - #773
Merged
Merged
Conversation
TheGreatAxios
force-pushed
the
cl-8170-catalog-tools
branch
from
September 17, 2026 18:22
714b852 to
06a15a2
Compare
Deletes the bench_model_policy table and pg-store: bench model policy now lives under the tenant's own config blob at corbits.modelPolicy, read with the stock GET /api/tenants/:tenantId. Adds catalog.ts, a pure flattening of the stock GET /api/tenants/:tenantId/models discovery response into the offering/pricing rows resolveModelChain ranks, so chain resolution has no database and no Workbench-only route anywhere near it.
list_model_concepts, pick_models and estimate_run_cost no longer call a Workbench-only hub route. They read the run's bench catalog and model policy directly off the stock GET /api/tenants/:tenantId/models and GET /api/tenants/:tenantId (client.ts), and resolve the chain themselves (chain.ts) with @corbits/inference-catalog's pure resolver — the hub does no chain computation for this bundle at all.
Removes the dedicated /api/workflow-inference-catalog route, its migrations, and the bench_model_policy pg-store now that @corbits/catalog-tools resolves its own chains off stock tenant routes. Bumps the catalog-tools pin in the assistant workflow to match the package's new minor version.
TheGreatAxios
force-pushed
the
cl-8170-catalog-tools
branch
from
September 17, 2026 18:24
06a15a2 to
415a72d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@corbits/catalog-tools(list_model_concepts,pick_models,estimate_run_cost) no longer talks to a Workbench-only hub route. It nowreads two stock Interchange tenant routes with the run's own bearer, and
resolves the model chain itself:
GET /api/tenants/:tenantId/models— the bench's resolved model catalog(offerings + active price per currency), flattened by the new
@corbits/inference-catalogcatalog.tsinto the plain rowsresolveModelChainranks.GET /api/tenants/:tenantId— the bench itself, for its model policy atconfig.corbits.modelPolicy(schema and reader in@corbits/inference-catalog/policy.ts).Deleted:
packages/inference-catalog/src/workflow-catalog-routes.ts, itspg-store/migrations/schema (
bench_model_policytable), and the hub's/api/workflow-inference-catalogmount. There is no hub-side chainresolution left for this bundle — it all runs in the workflow child
(
packages/catalog-tools/src/chain.ts).corbits.modelPolicyconfig shape{ "corbits": { "modelPolicy": { "allow": ["string selectors"], // canonical name | "provider:<name>" | "<provider>/<name>" "deny": ["string selectors"], "maxInputUsdPerMTok": 3.0, // or null "maxOutputUsdPerMTok": 15.0, // or null "ceilingIsHard": false, // soft (demote) vs hard (exclude) "conceptCeilings": { "<conceptId>": { "maxInputUsdPerMTok": 50, "maxOutputUsdPerMTok": 100 } }, "providerPreference": { "mode": "pin" | "prefer", "order": ["providerName"] } // or null } } }Every key is optional; a missing or malformed blob reads as
EMPTY_POLICY(unconstrained), never an error.Notes for reviewers
My work here was: rewriting the stale
resolve-chain.test.ts,price.test.ts,client.test.ts,tool.test.tsandtest/fixtures.tsagainst the new pureCatalogOffering/CatalogPricingRowshapes (no moreasOf/connectivity/provenanceconcerns, since those are the platform's own job now); bumping
@corbits/catalog-toolsto 0.1.0 and its pin inworkflows/assistant/src/prompt.ts; regenerating tsconfig referencesand the changeset ignore list; and rebasing onto
origin/main(whichhad, unrelated to this PR, deleted
@corbits/benchand itsbench-settings mount — cleaned up a stray reintroduction of that dead
code from the rebase's own conflict resolution).
bun run typecheck,bun test(workspace-widecheck:structuralsuite included), and
bun run lintare all green locally.Test plan
bun run typecheckbun test packages/catalog-tools packages/inference-catalogbun run lintbun run check:structural