feat(models): manifest-driven model capabilities and curated labels - #3603
Open
wpfleger96 wants to merge 1 commit into
Open
feat(models): manifest-driven model capabilities and curated labels#3603wpfleger96 wants to merge 1 commit into
wpfleger96 wants to merge 1 commit into
Conversation
wpfleger96
force-pushed
the
duncan/databricks-model-label-registry
branch
from
August 3, 2026 20:04
cc00060 to
4d47f48
Compare
wpfleger96
added a commit
that referenced
this pull request
Aug 3, 2026
…t apparatus (#4589) ## Summary Retires the old hand-table authorities and transitional verification scaffolding from the model-capability manifest arc. All production routes now run exclusively through the generated interpreters introduced in Phase 1 ([#3821](#3821)) and wired in Phase 2 ([#3958](#3958)). Stack: [#3821](#3821) → [#3958](#3958) → this PR Base: [#3603](#3603) ## What the manifest system is now **Source of truth:** `scripts/model-capabilities.json` **Generator:** `scripts/generate-model-capabilities.mjs` — emits Rust and TS interpreters only (coverage JSON output removed) **Generated interpreters:** `crates/buzz-agent/src/generated_model_capabilities.rs` (+ normative tests), `desktop/src/features/agents/ui/modelCapabilities.ts` **Label registry:** `generate-databricks-model-names.py` → `databricks_model_names.rs` / `databricksModelNames.ts` **Permanent gates:** `scripts/normative-corpus.json` + `scripts/run-corpus.mjs` (both-interpreter equivalence, 51 vectors), `scripts/test-manifest-validator.mjs` (schema, 24 cases), regen-diff job inside `ci.yml` **One doc:** `scripts/MODEL_CAPABILITIES.md` ## Deleted **Old hand-table authorities (production):** - `getProviderEffortConfig_oldHandTable()` and all supporting helpers from `desktop/src/features/agents/ui/buzzAgentConfig.ts` - `normalize_effort_for_openai_route()`, `_old_anthropic_thinking_config_for_databricks_v2()`, test-only re-export wrappers from `crates/buzz-agent/src/config.rs` - `strip_catalog_prefix()`, `anthropic_thinking_config()`, `anthropic_model_supports_xhigh()`, `clamp_adaptive_effort()`, `anthropic_efforts_for_model()`, `is_manual_budget_model()`, `is_adaptive_thinking_model()`, `gpt5_token_matches()`, `gpt5_base_matches()`, `openai_efforts_for_model()` from `crates/buzz-agent/src/config.rs` — all superseded by generated interpreter - Old DBv2 body-level tests, `_OLD_DATABRICKS_V2_*` constants, `model_name_segments()`, `_old_databricks_v2_route_for_model()`, all Phase-2 behavioral differential test functions from `crates/buzz-agent/src/llm.rs` **Transitional scaffolding:** - `scripts/run-differential.mjs` — old-vs-new JS differential harness - `scripts/run-mutation-evidence.mjs` — one-time mutation evidence runner - `desktop/src/features/agents/ui/effortTable.fixture.json` — Phase-2 TS/Rust sync fixture - `desktop/src/features/agents/ui/effortTable.fixture.test.mjs` — fixture sync guard - `.github/workflows/model-capability-regen-diff.yml` — standalone workflow (steps folded into `ci.yml`) **One-time evidence and generated snapshots:** - `scripts/MUTATION_EVIDENCE.md`, `scripts/MODEL_CAPABILITIES_SCHEMA.md`, `scripts/MODELS_DEV_RECONCILIATION.md` — consolidated into `scripts/MODEL_CAPABILITIES.md` - `scripts/generated-model-capabilities-coverage.json` — full-table snapshot (generator no longer emits it) - `scripts/catalog-sample-fixture.json` — models.dev snapshot used only by the deleted differential harness ## Verification - `cargo test -p buzz-agent --lib` with `RUSTFLAGS="-D warnings"`: **337/337** (clean — no dead_code warnings) - `node --experimental-strip-types scripts/run-corpus.mjs`: **51/51** - `node scripts/generate-model-capabilities.mjs` + regen diff: **clean (exit 0)** - `node --test scripts/test-manifest-validator.mjs`: **24/24** - `just clippy`: zero warnings, zero errors --------- Signed-off-by: Will Pfleger <pfleger.will@gmail.com> Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz>
wpfleger96
force-pushed
the
duncan/databricks-model-label-registry
branch
2 times, most recently
from
August 4, 2026 21:16
0189510 to
15aa135
Compare
wpfleger96
added a commit
that referenced
this pull request
Aug 4, 2026
…t apparatus (#4589) ## Summary Retires the old hand-table authorities and transitional verification scaffolding from the model-capability manifest arc. All production routes now run exclusively through the generated interpreters introduced in Phase 1 ([#3821](#3821)) and wired in Phase 2 ([#3958](#3958)). Stack: [#3821](#3821) → [#3958](#3958) → this PR Base: [#3603](#3603) ## What the manifest system is now **Source of truth:** `scripts/model-capabilities.json` **Generator:** `scripts/generate-model-capabilities.mjs` — emits Rust and TS interpreters only (coverage JSON output removed) **Generated interpreters:** `crates/buzz-agent/src/generated_model_capabilities.rs` (+ normative tests), `desktop/src/features/agents/ui/modelCapabilities.ts` **Label registry:** `generate-databricks-model-names.py` → `databricks_model_names.rs` / `databricksModelNames.ts` **Permanent gates:** `scripts/normative-corpus.json` + `scripts/run-corpus.mjs` (both-interpreter equivalence, 51 vectors), `scripts/test-manifest-validator.mjs` (schema, 24 cases), regen-diff job inside `ci.yml` **One doc:** `scripts/MODEL_CAPABILITIES.md` ## Deleted **Old hand-table authorities (production):** - `getProviderEffortConfig_oldHandTable()` and all supporting helpers from `desktop/src/features/agents/ui/buzzAgentConfig.ts` - `normalize_effort_for_openai_route()`, `_old_anthropic_thinking_config_for_databricks_v2()`, test-only re-export wrappers from `crates/buzz-agent/src/config.rs` - `strip_catalog_prefix()`, `anthropic_thinking_config()`, `anthropic_model_supports_xhigh()`, `clamp_adaptive_effort()`, `anthropic_efforts_for_model()`, `is_manual_budget_model()`, `is_adaptive_thinking_model()`, `gpt5_token_matches()`, `gpt5_base_matches()`, `openai_efforts_for_model()` from `crates/buzz-agent/src/config.rs` — all superseded by generated interpreter - Old DBv2 body-level tests, `_OLD_DATABRICKS_V2_*` constants, `model_name_segments()`, `_old_databricks_v2_route_for_model()`, all Phase-2 behavioral differential test functions from `crates/buzz-agent/src/llm.rs` **Transitional scaffolding:** - `scripts/run-differential.mjs` — old-vs-new JS differential harness - `scripts/run-mutation-evidence.mjs` — one-time mutation evidence runner - `desktop/src/features/agents/ui/effortTable.fixture.json` — Phase-2 TS/Rust sync fixture - `desktop/src/features/agents/ui/effortTable.fixture.test.mjs` — fixture sync guard - `.github/workflows/model-capability-regen-diff.yml` — standalone workflow (steps folded into `ci.yml`) **One-time evidence and generated snapshots:** - `scripts/MUTATION_EVIDENCE.md`, `scripts/MODEL_CAPABILITIES_SCHEMA.md`, `scripts/MODELS_DEV_RECONCILIATION.md` — consolidated into `scripts/MODEL_CAPABILITIES.md` - `scripts/generated-model-capabilities-coverage.json` — full-table snapshot (generator no longer emits it) - `scripts/catalog-sample-fixture.json` — models.dev snapshot used only by the deleted differential harness ## Verification - `cargo test -p buzz-agent --lib` with `RUSTFLAGS="-D warnings"`: **337/337** (clean — no dead_code warnings) - `node --experimental-strip-types scripts/run-corpus.mjs`: **51/51** - `node scripts/generate-model-capabilities.mjs` + regen diff: **clean (exit 0)** - `node --test scripts/test-manifest-validator.mjs`: **24/24** - `just clippy`: zero warnings, zero errors --------- Signed-off-by: Will Pfleger <pfleger.will@gmail.com> Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz>
kalvinnchau
previously approved these changes
Aug 5, 2026
kalvinnchau
left a comment
Contributor
There was a problem hiding this comment.
Verified the doubled-separator parity fix at exact head 62ebc94. The generated Rust matcher now collapses empty segments consistently with the TypeScript matcher, and the new six-axis corpus vector pins the previously divergent openai-responses route. Generator check and both corpus runners pass. No findings.
…r efforts, routes, labels Rebased onto origin/main (6ca9641). Conflict resolved in crates/buzz-agent/src/llm.rs: combined origin/main's .and_then() refactor (error stamp coverage for Anthropic/OpenRouter) with our branch's anthropic_body provider argument. 62ebc94 fix(model-capabilities): collapse empty segments in Rust gpt-version-segment matcher 817b887 test(file-size): fix fileOverrides integration test under GITHUB_ACTIONS 1e9df55 fix(manifest): enforce registry_label exclusion on family rules; test fileOverrides boundary 0e6aacf fix(buzz-agent): curate display name in configured_model_fallback 77c24ef chore(manifest): remove dead registry_labels key Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
wpfleger96
force-pushed
the
duncan/databricks-model-label-registry
branch
from
August 6, 2026 15:31
62ebc94 to
1b57e84
Compare
| - name: Regenerate artifacts | ||
| run: node scripts/generate-model-capabilities.mjs | ||
|
|
||
| - name: Diff check — fail if generated files are stale |
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
This PR establishes a single hand-curated model-capability manifest (
scripts/model-capabilities.json) as the source of truth for model metadata — display labels, supported reasoning-effort sets, default efforts, thinking modes, and Databricks v2 wire routes. A generator emits equivalent Rust and TypeScript interpreters from it, production resolution in both languages runs on the generated interpreters, and the superseded hand-maintained tables are deleted. It also ships the curated Databricks label registry and the frontendresolveModelLabel()contract.Closes #3586. Landed as three sub-PRs into this branch: #3821 (manifest + generator), #3958 (production integration), #4589 (hand-table retirement).
Where the capability data comes from
scripts/model-capabilities.jsonis hand-curated in this repo — nothing is fetched at build time. Every fact in it is reconciled against a cited external authority, and the citations live in the manifest itself (the top-level_sourcesblock plus a per-record_reconciliation_docfield with retrieval date):DATABRICKS_V2_KNOWN_MODELS(revision6789d4af)--check-goose)When a provider ships a new model or effort level, the workflow is: edit the manifest record with a fresh citation, regenerate, commit. The CI gates make artifact drift impossible; keeping the manifest current with provider reality is deliberately a curation step — auditable, cited, and reviewed like any other change.
Capability manifest and generated interpreters
scripts/generate-model-capabilities.mjsreads the manifest and emits two committed artifacts from one source of truth:crates/buzz-agent/src/generated_model_capabilities.rsdesktop/src/features/agents/ui/modelCapabilities.tsThe generator validates every interpolated manifest string through a shared
requireSafeString()boundary (rejects quotes, backslashes, control chars), enforces the manifest schema (42 negative tests inscripts/test-manifest-validator.mjs, covering effort canonicality, post-inheritance record consistency, integer match priorities, and normalized duplicate keys), and supports--checkfor byte-clean verification.Production integration
Rust (
buzz-agent): reasoning-effort normalization for OpenAI and legacy Databricks flows throughnormalize_effort_for_provider(), backed by the generated interpreter;anthropic_body()is provider-aware and Adaptive thinking clamps against the generatedsupported_efforts; Databricks v2 request routing reads the manifest'sdatabricks_v2_wire_routeinstead of a hand-maintained segment classifier. The superseded effort/thinking hand tables and model-family classifiers inconfig.rsandllm.rsare deleted — the generated interpreter is the only authority.Desktop:
getProviderEffortConfig()resolves through the generatedmodelCapabilities.ts;canonicalizeProvider()(trim/lowercase plus thedatabricks-v2andopenai-compataliases) is applied before every provider-scoped lookup, and the provider is threaded through all label/effort surfaces so a supplied provider can never fall through to unscoped registry lookups. The old hand-table effort path and its fixture are deleted.Drift protection
The
model-capabilitiesjob in.github/workflows/ci.ymlgates every PR:scripts/normative-corpus.json) against both interpreters —scripts/run-corpus.mjsfor TS, generated Rust tests for Rust — every vector pins all six capability axes (label, thinking mode, effort set, default effort, wire route, normalization policy), and both runners reject sparse vectors;cargo test -p buzz-agent --lib(the only CI gate exercising thebuzz-agentunit suite;just test-unitexcludes that crate).Model display labels
The manifest's
databricks_v2exact records carry aregistry_labelaxis with models.dev-verbatim display names for the ~30 managed Databricks endpoints. The generator derives a flatDATABRICKS_MODEL_NAMESregistry from those records and emits it into both artifacts (Rust static slice, TSMap), so the two languages cannot drift.Display rule: a model's display name comes from an exact/curated record only — family rules carry no labels, so a family-matched ID with no curated record resolves
registryLabel: nulland displays its raw ID (or its upstream discovery name). Endpoint IDs likedatabricks-gpt-5-5resolve to human-readable labels (GPT-5.5); unknown or custom workspace endpoints pass through as their raw ID unchanged, so a custom endpoint likedatabricks-team-2025-01can never be given an invented name.Rust label resolution
databricks_model_name(id)incrates/buzz-agent/src/catalog.rsreads the generated registry and is applied at everyModelEntryconstruction path — v1 and v2 discovery parsing, the authenticated-empty-catalog slate, and the configured-model fallback — soAgentModelInfo.namereaches the frontend already curated. Mirrors the existingopenai_model_display_nameprecedent; no new IPC.DATABRICKS_V2_KNOWN_MODELSis likewise a re-export of the generated constant.Frontend label resolution
resolveModelLabel(id, discoveredName?, provider?)indesktop/src/features/agents/lib/formatAgentModelLabel.tsowns the label contract with three-tier precedence: nonblank discovered/API name, then registry lookup by ID (provider-qualified exact record when a provider is supplied; unscoped registry only on the providerless path), then raw ID. Every model-label surface routes through it —ModelPicker,usePersonaModelDiscovery,agentCardModelLabel,AgentConfigFields,ManagedAgentRow,UserProfilePopover.formatAgentModelLabel()wraps the resolver so a null or empty ID rendersAuto.Tests
cargo test -p buzz-agent --libcovers the corpus harness and generated-interpreter tests as a CI merge gate.Config::validate(), Anthropic-route effort normalization (none/minimalomitted from the wire), and the unsupported-effort clamp throughanthropic_body()(a no-xhighmodel record clampsxhightohigh).databricks-gpt-5-mini→GPT-5 Mini), and a family-matched ID with no curated record pinsregistry_label: null; provider-alias tests pinopenai-compat/databricks-v2canonicalization in the desktop surfaces.usePersonaModelDiscovery.test.mjspins discovery-row label precedence; Rust unit tests incatalog.rscover known IDs, custom endpoints, and the known-models fallback slate.Docs and build infra
desktop/src/features/agents/AGENTS.mddocuments label precedence and the regeneration workflow (editscripts/model-capabilities.json, runnode scripts/generate-model-capabilities.mjs); the generator and CI job emit the regeneration command on any stale-artifact failure.desktop/scripts/check-file-sizes.mjsgains afileOverridesmechanism because the generatedmodelCapabilities.tsexceeds the 1000-line ceiling intended for hand-authored files.