← Back to Pull requests

feat(model): add tagged Deployment model references #584

Closed
unknown closed this pull request without merging on Jul 20, 2026 13:20 UTC
View on GitHub
unknown unknown commented on Jul 16, 2026 19:52 UTC
Author

Description

Adds optional Deployment.spec.modelRef plumbing and aligns Model with the tagged catalog semantics already used by Agent.

  • Converts Model storage from mutable (namespace, name) identity to tagged (namespace, name, tag) identity through migration 012; existing rows become the literal latest tag.

  • Adds optional tag to ModelRef; an omitted namespace inherits the Deployment namespace and an omitted tag resolves to latest.

  • Structurally validates and resolves Model references, and requeues Deployments when Model control-plane events arrive.

  • Exposes tagged Model get, list-tags, and exact-delete routes plus matching CLI behavior.

  • Regenerates OpenAPI and TypeScript clients and adds API, store, validation, scheme, CLI, and controller coverage.
  • This PR keeps modelRef optional for every Deployment, including harness Deployments. It does not yet remove legacy Agent model fields, require model selection for harnesses, translate Model configuration into runtimes, resolve secrets, or change deployment fingerprints.

    Change Type

    /kind feature
    /kind breaking_change

    Changelog

    ``release-note
    Make Models tagged catalog artifacts and allow Deployments to select an optional Model tag.
    `

    Additional Notes

    Validation completed locally:

  • go test ./pkg/api/v1alpha1 ./internal/cli/declarative ./pkg/registry/v1alpha1store ./pkg/registry/resource ./internal/registry/controller

  • make test-unit — 1,227 tests

  • make lint — 0 issues

  • make lint-ui — passed with one pre-existing useEffect dependency warning in ui/app/page.tsx

  • make build-ui

  • make verify`
  • The PostgreSQL-backed tagged store and CRUD tests could not run locally because neither PostgreSQL nor Docker is available on this machine; CI provides those integration environments.

    Diff: 225 lines (+168 / -57) across 2 files Reviewer: lcopi Review duration: 5368m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.60) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.60 · 225 lines diff across 2 files
    0.60
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.324
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.060
    Real PR Conversation Timeline
    1 comments
    "Review active on #584"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 60.1% (MEDIUM) · Higher = larger blast radius
    60.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 23.7% · Safe to merge
    23.7%