You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Agentic Kit can already report which CLI/package versions are installed and which releases are available, and it already knows the configured per-activity host/model routes. It cannot yet answer the equivalent model-lifecycle questions across Claude Code, Codex, and OpenCode:
Which models are configured, effectively selected, and actually observed in use on each host?
Which models were added, removed, hidden, deprecated, or assigned a migration target since the last trustworthy catalog snapshot?
Which aliases silently resolved to a different concrete model?
Which configured routes now point at a model that is unavailable, policy-blocked, stale, or approaching retirement?
Which models are mechanically compatible swap candidates, and which are evidence-backed upgrades or cheaper equivalents?
Which Ruflo router candidates and Agentic-QE model overrides have drifted from the models the hosts can actually use?
This proposal adds Model Lifecycle Intelligence: a local-first, provenance-aware inventory and change-detection layer for host model catalogs, configured bindings, observed use, lifecycle notices, and route impact. It introduces a dedicated read-only ak models command family, adds a compact model-health row to ak status, and adds a Models view beneath the Dashboard's existing Usage area.
The central rule is that newer, discoverable, entitled, configured, observed, compatible, and better are different claims. A host or provider catalog may prove that a model exists; it does not prove that the current account can use it. A migration target may prove a supported replacement; it does not prove equal quality or lower cost. Evidence-backed quality and economic recommendations remain the responsibility of Route Intelligence in #109.
Representative output:
$ ak models status
Host Configured / effective Observed Catalog Attention
Claude sonnet → claude-sonnet-… sonnet 4 visible · fresh 3h alias target changed
Codex gpt-5.4 / high gpt-5.4 7 visible · fresh 18m upgrade → gpt-5.6-terra
OpenCode openrouter/… provider/… 126 project-eligible · 2d old refresh available
2 migration opportunities · 1 alias change · 1 stale catalog
Run `ak models diff` for changes or `ak models plan --activity coder` for route impact.
All names and counts above are illustrative. Shipped output must come from source-attributed local evidence.
Agentic Kit already has most of the facts needed to build the feature, but they are fragmented:
src/lib/routing.mjs owns the canonical activity routes and currently carries a manually verified, static known-good model catalog (MODEL_CATALOG, PROVIDER_MODEL_CATALOG, and MODEL_CATALOG_VERIFIED). The help text correctly allows any model the host accepts, but the static catalog cannot detect per-machine additions, retirement notices, aliases, entitlement, or change over time.
src/lib/adapters/registries.mjs already defines capability-driven host/provider/projection/observability registries. Provider capabilities include modelDiscovery and runtimeDiscovery, and observability supports catalog evidence. Today only Ollama advertises those capabilities; the seam exists but is not yet generalized into a host-scoped inventory.
src/commands/status.mjs already aggregates installed/latest versions, health, drift, and fixes into human and JSON rows. It is the right place for a terse, cache-only summary, not a full model matrix.
src/commands/x/host.mjs and src/lib/routing.mjs already own route mutation. A new inventory feature should not create a competing model-policy source of truth.
src/lib/providers.mjs projects routing into Agentic-QE's .agentic-qe/llm-config.json, including per-agent overrides when supported.
Transcript indexing already observes models used by Claude Code, Codex, and OpenCode, while ak run records selected routes and bounded attempts. These are usage facts, not catalog or entitlement facts.
There is also a concrete opportunity in the current host surfaces:
The local Codex model cache includes catalog freshness, client version, visibility, reasoning levels, context windows, and explicit upgrade.model migration targets for retiring entries. That proves a useful adapter input exists on this host, but its schema must be treated as host-owned and versioned rather than copied into core policy.
opencode models [provider] provides a project/provider-scoped model list, optional verbose metadata, and explicit --refresh of the Models.dev-backed cache.
Claude Code supports configured model values, aliases, model overrides, managed availableModels, and gateway model discovery, but an alias or published model list does not by itself establish current-account entitlement.
The governing ADRs are living plans:
ADR-0001 is superseded in part by ADR-0020 (2026-07-23; updated 2026-07-30). Its one-routing-policy principle remains; historical compatibility surfaces do not.
ADR-0002 is amended by ADR-0020 (2026-07-23; updated 2026-07-30). The activity vocabulary remains and is owned by the in-repository runner.
ADR-0005 is Implemented (2026-07-23; updated 2026-08-04). The Dashboard remains read-only and organized into three primary areas.
ADR-0009 is Implemented (2026-07-25; updated 2026-08-04). It owns local transcript analytics, graded evidence, and Usage presentation.
ADR-0011 is Proposed (2026-07-27; updated 2026-07-30). Its local-model claims remain unmeasured and must not be treated as accepted behavior.
ADR-0016 is Accepted, with compatibility clauses superseded by ADR-0020 (2026-07-28; updated 2026-07-30). It is the architectural basis for capability-driven discovery adapters.
ADR-0017 is Accepted, with compatibility references amended by ADR-0020 (2026-07-28; updated 2026-08-04). OpenCode remains an opt-in managed host and its provider identity must stay independent.
ADR-0020 is Implemented (2026-07-30). There must be one stable GA surface per capability.
ADR-0021 is Accepted (2026-07-31; updated 2026-08-03). Host, inference provider, provider provenance, and model remain independent facts.
No governing ADR currently defines a normalized, snapshot-based model inventory or model-lifecycle contract. This issue should add a new Proposed ADR and amend the existing ADRs only when their shipped behavior changes.
Problem statement
Package upgrades are mostly scalar: installed version X, registry version Y, upgrade available. Models are not.
A model name can be:
a mutable alias such as sonnet, default, or another host-defined label;
a concrete host model slug;
a provider-qualified id such as provider/model;
a private gateway deployment id;
a local model name plus a mutable digest;
visible in a public catalog but not entitled for the current account;
entitled but blocked by managed policy;
accepted in configuration but not currently routable;
deprecated with a first-party migration target;
mechanically compatible but behaviorally different; or
demonstrably better or cheaper only for certain operations.
Consequently, a single installed → latest column would be misleading. Agentic Kit needs a multidimensional inventory and a provenance-aware diff that can say exactly which source established each claim.
The feature must also reconcile multiple consumers. The same model reference may appear in canonical kit.json routes, escalation ladders, Claude/Codex/OpenCode host config, Agentic-QE agent overrides or fallbacks, Ruflo candidate registries, learned Route Intelligence evidence, and historical transcripts. A model change can make any of these stale without changing the package version.
Goals
Inventory configured, effective, observed, discoverable, entitled, policy-allowed, routable, and lifecycle state independently for every managed host.
Detect trustworthy additions, removals, visibility changes, alias-target changes, deprecations, and first-party migration targets over time.
Explain every model fact with source, evidence class, freshness, account/project scope, and confidence.
Identify route and projection drift caused by model-catalog changes.
Produce safe mechanical swap plans without claiming equivalent quality.
host + provider + modelId + scopeId prevents two accounts, gateways, projects, or providers that reuse a model string from being conflated. Private deployment names and local digests may require sanitized display values while retaining a local stable key.
Independent state dimensions
Dimension
Meaning
Typical evidence
Configured
A policy/config references the model or alias
kit.json, host config, AQE/Ruflo projection
Effective
Precedence and alias resolution select a concrete model
host-resolved state, invocation metadata
Observed
A transcript or structured worker actually used it
transcript/runtime record
Discoverable
A host/provider catalog lists it in this scope
host command/API/cache
Entitled
The current account/profile is allowed to invoke it
host entitlement response or successful observed use
Policy allowed
Managed/user allowlists permit selection
managed settings, availableModels, project config
Routable
The complete host/provider/auth/capability path is currently viable
validated adapter facts; optional explicit health check
Lifecycle
Active, preview, hidden, deprecated, retiring, removed, or unknown
first-party catalog/migration notice
Recommended
A source recommends migration or Route Intelligence recommends a swap
One record can legitimately be configured but not discoverable, discoverable but not entitled, observed but hidden, or entitled but policy-blocked. The UI must display these combinations rather than reducing them to red/green availability.
Lifecycle and compatibility graph
Model “upgrade” should be represented as typed edges, not guessed semver ordering:
alias ──resolves-to──▶ concrete model
old model ──first-party-migration──▶ replacement
model A ──same-family-newer──▶ model B
model A ──mechanically-compatible──▶ model B
model A ──tier-up / tier-down──▶ model B
model A ──specialized-alternative──▶ model B
model A ──evidence-backed-equivalent──▶ model B (#109 only)
Every edge carries provenance and scope. first-party-migration is strong lifecycle evidence but not a quality assertion. same-family-newer may be curated or vendor-published. mechanically-compatible means the route can be expressed and required features are present. Only Route Intelligence may create an evidence-backed quality/economics edge.
Opportunity levels:
Newly discovered — informational; no action recommendation.
Configuration drift — configured model is missing, hidden, blocked, or deprecated.
Supported migration — first-party replacement target exists and the local route can express it.
Mechanical swap candidate — capabilities and route syntax are compatible; quality remains unknown.
Urgent migration — published retirement/removal is imminent or the route has already failed for lifecycle reasons.
Evidence and confidence
Suggested evidence classes, strongest first:
observed successful invocation with concrete model/provider identity;
host-owned entitled catalog or explicit migration metadata;
host-owned discoverable catalog/cache scoped to the active profile/project;
managed policy/config after precedence resolution;
canonical Agentic Kit routing policy and generated projections;
provider-published public catalog;
locally curated catalog with verification date;
inferred family/version relationship;
unknown.
Negative evidence requires extra care. A model becomes removed only after an authoritative removal/retirement signal or repeated complete snapshots in the same scope. A source failure, auth failure, schema mismatch, account switch, or incomplete list yields unknown plus a diagnostic.
Persist sanitized snapshots in a machine-local cache; they are rebuildable operational evidence, not canonical policy.
Advance the comparison baseline only after a successful, sufficiently complete refresh.
Keep bounded history to explain when a model or alias changed.
Hash or sanitize account/project scope; never compare snapshots from different scopes as one lifecycle sequence.
Mark Route Intelligence evidence stale when its concrete model, provider binding, host version, harness fingerprint, or relevant capabilities change.
Ruflo MetaHarness and Agentic-QE overlap
Ruflo / MetaHarness
Ruflo already exposes two adjacent surfaces:
ruflo providers manages providers/models/configuration and can list provider models.
ruflo neural router exposes the cost-optimal router lifecycle, including candidate models, prices, configuration, decisions, outcomes, savings, and bandit state.
Ruflo's ADR-149 is Proposed, not shipped-contract authority. It describes a per-model candidate registry and quality-bar routing direction grounded in measured outcomes. This issue should consume runtime-proven surfaces and report their provenance; it must not present a Proposed ADR as installed behavior.
A catalog change invalidates or narrows learned recommendations; it does not retrain or silently rewrite Ruflo state.
Do not duplicate MetaHarness selection logic or label an Agentic Kit heuristic as MetaHarness.
Agentic-QE
Agentic-QE exposes aqe llm providers, aqe llm models, router config/health/cost, and routing economics/accuracy/metrics. Its separate aqe upgrade command detects optional native bindings, not model upgrades.
Boundary:
Agentic Kit inventories AQE model references in .agentic-qe/llm-config.json, providers, fallbacks, and agentOverrides as downstream bindings.
AQE may report models its own router can construct; that does not prove a Claude/Codex/OpenCode host can select them.
Model-inventory drift should identify an AQE override or fallback that is stale, unavailable, provider-ambiguous, or divergent from the canonical route projection.
This issue answers what models exist, changed, are configured, and appear mechanically usable. #109 answers which model was effective for an operation and whether a cheaper candidate delivered materially equivalent benefit.
The two features should share concrete model identity, provider provenance, harness fingerprint, and freshness semantics, but retain distinct evidence grades and UI language.
Proposed ak command surface
Add one stable plural noun: ak models. The initial family is read-only except for explicit cache refresh.
ak models status
ak models status
ak models status --host codex
ak models status --json
ak models status --all
Default output is concise and uses the most recent local snapshot plus current local config/observed evidence. --all expands hidden, unconfigured, and low-confidence entries. JSON returns the versioned snapshot/read-model contract.
Recommended columns:
host and provider;
configured value and effective concrete model;
last observed concrete model and timestamp;
discovery/entitlement/policy/routability badges;
lifecycle state and first-party migration target;
source freshness/completeness; and
affected activity count.
ak models refresh
ak models refresh
ak models refresh --host opencode
ak models refresh --online
ak models refresh --host claude --online --json
Without --online, refresh local config, caches, protocols, and transcript evidence only.
--online explicitly permits host/provider catalog network access such as OpenCode's cache refresh or a configured gateway model endpoint.
Never invoke a model or consume inference tokens.
A later --verify mode, if needed, must be separately designed and confirmed because it may spend tokens or cross provider boundaries.
Failed/partial refreshes do not replace the last complete diff baseline.
ak models diff
ak models diff
ak models diff --since <snapshot-id>
ak models diff --host claude --json
Report:
new, removed, hidden, and visibility-changed models;
alias-target changes;
lifecycle notices and first-party migration targets;
capability/reasoning/context changes;
configured or observed bindings affected; and
source/scope changes that make comparison invalid.
ak models explain
ak models explain codex:gpt-5.4
ak models explain claude:sonnet
ak models explain opencode:openrouter/provider-model --json
Show the evidence chain: where the reference is configured, precedence and alias resolution, last observed use, provider/source, catalog membership, entitlement/policy state, lifecycle edge, affected routes/escalations/AQE/Ruflo consumers, and why a candidate is eligible or ineligible.
ak models plan
ak models plan --activity coder
ak models plan --from codex:gpt-5.4 --to codex:gpt-5.6-terra
ak models plan --activity reviewer --to claude:sonnet
ak models plan --json
compatibility, entitlement, and provenance warnings;
Route Intelligence evidence that would become stale; and
an exact copyable ak host pick --route … command when the change is expressible.
Do not add ak models apply in the first implementation. Route mutation remains ak host pick, preserving ADR-0001/ADR-0020. A future guarded ak models swap is acceptable only if it becomes a single transactional plan/apply/verify/undo contract over the canonical policy rather than a second policy owner.
Adapt ak status
ak status remains the quick dashboard. Add one cache-only aggregate row:
models ⚠ 9 configured · 7 observed · 2 migrations · 1 alias change · catalog refreshed 3h ago
Behavior:
ordinary ak status never refreshes a network catalog;
ak status --deep may invoke bounded local host discovery protocols but still avoids remote refresh unless an existing status policy explicitly allows it;
stale/unavailable sources are named, not converted into “no models”; and
the fix string directs users to ak models refresh, ak models diff, or ak models plan, never auto-applies a route.
Status and Dashboard experience
Preserve the existing three primary Dashboard areas. Add a Models secondary destination under Usage, and add an Overview summary card that links to it. Because ADR-0009 currently governs Usage navigation, implementation must amend its Updated note/date when this destination ships.
Not verified for this account when discoverability exists but entitlement is unknown.
Catalog incomplete rather than removed after source failure.
The Dashboard stays read-only, loopback-only, CSP-protected, network-silent on reads, and free of raw credentials/config secrets.
User interactions and scenarios
Scenario 1 — A Codex model receives a first-party migration target
A successful local refresh observes that the configured Codex model now carries a first-party replacement target.
ak status shows one model migration requiring attention.
ak models diff shows the lifecycle notice, replacement, catalog freshness, and affected coder/tester routes.
ak models plan --from … --to … checks reasoning-effort/capability compatibility and enumerates projections and stale Route Intelligence evidence.
The user applies the copyable ak host pick --route … command explicitly.
A later refresh verifies that canonical and projected bindings converge.
Scenario 2 — A Claude alias silently resolves to a different concrete model
The configured route still says sonnet, but the effective concrete target changes. The diff reports an alias-target-changed event, marks outcome cohorts learned on the prior concrete model stale, and explains that the alias remains valid. It does not label the change an upgrade unless first-party lifecycle evidence supports that language.
Scenario 3 — OpenCode exposes new provider models
The user runs ak models refresh --host opencode --online. New provider/project-eligible models appear as newly discovered. They are not automatically inserted into routes, Agentic-QE, or Ruflo. Route Intelligence may later evaluate eligible candidates.
Scenario 4 — Configured does not mean entitled
A model is present in kit.json and a public provider catalog but absent from the active host-scoped entitled list. The UI reports configured · entitlement unknown or configured · policy blocked based on evidence. It does not claim removal and does not spend tokens to test it.
Scenario 5 — Partial discovery failure
The Claude gateway times out while Codex and OpenCode discovery succeed. The new snapshot records a partial source diagnostic. The previous complete Claude baseline remains active; no Claude model is marked removed. ak status reports stale Claude discovery with the exact refresh action.
Scenario 6 — AQE and Ruflo drift from canonical routes
A stale Agentic-QE override names a retired model and Ruflo's candidate registry still contains it. ak models explain shows both consumers. ak models plan describes the canonical route change and follow-on projection/invalidation work without editing either system.
Scenario 7 — A cheaper candidate exists but quality is unknown
The inventory knows that a lower-priced compatible model is selectable. The Dashboard labels it compatible candidate · quality not evaluated. Only after #109 produces qualified evidence may the label become cheaper equivalent for a particular activity.
Scenario 8 — Multiple account or project scopes
The user changes a Codex profile or OpenCode project. Agentic Kit creates a different scope fingerprint and refuses to call catalog differences additions/removals across scopes. It can display the inventories side by side, but lifecycle history remains scoped.
Phased technical implementation plan
Phase 0 — Specification, ADR, and DDD contract
Deliverables
Add a new Proposed ADR for Model Lifecycle Intelligence.
Define ModelIdentity, ModelBinding, CatalogSnapshot, CatalogSource, LifecycleEdge, CompatibilityEdge, ModelChange, and SwapPlan in the DDD vocabulary/context map.
model findings withheld because entitlement, lifecycle, or quality evidence is insufficient; and
operator use of diff, explain, and plan before route changes.
Withheld findings are a trust measure: a system that never says “entitlement unknown” or “quality not evaluated” is overstating what it knows.
Open product decisions
Should the command noun be permanently plural (ak models) or singular (ak model)? Plural is recommended for an inventory.
What snapshot retention window balances change history and local footprint?
Which host surfaces are stable enough to support by contract versus best-effort adapters?
What repeated-complete-snapshot threshold permits a non-authoritative removal tombstone?
Should ak status --deep ever perform remote catalog refresh, or should all network remain exclusive to ak models refresh --online? The latter is recommended.
How should private gateway deployment names be sanitized while retaining stable local identity?
Which capability fields are required before a swap is called mechanically compatible?
Should reasoning effort be part of model identity, a route binding, or both?
When an alias target changes, should Route Intelligence evidence expire immediately or remain visible as stale historical evidence? Visible-but-stale is recommended.
Should a future transactional ak models swap exist, or is plan plus ak host pick the permanent clean separation?
Should Usage → Models ship as a new secondary destination or initially as an expanded Findings disclosure? A dedicated secondary destination is recommended because inventory/change history is richer than a finding card.
Which upstream lifecycle notices may be displayed verbatim versus normalized/summarized for licensing and UX consistency?
OpenCode models — provider-qualified model selection and project/provider catalog behavior.
Local codex --help, codex app-server --help, and the versioned host-owned Codex model cache — model selection and machine-readable catalog/lifecycle evidence. Implementation should replace local research notes with a stable upstream protocol/source citation where available.
Ruflo / MetaHarness / Agentic-QE grounding
ruflo/v3/docs/adr/ADR-149-per-model-cost-optimal-routing.md — Proposed per-model candidate registry and cost-optimal routing design; useful direction, not proof of shipped behavior.
agentic-qe/src/integrations/agentic-flow/model-router/router.ts — implemented multi-model router orchestration boundary for complexity, budget, metrics, and decisions.
Runtime CLI interfaces verified during this proposal:
aqe routing exposes economics, accuracy, and per-agent metrics.
aqe upgrade is a read-only optional-native recommendation command and is not a model-upgrade command.
If a required upstream contract is unavailable or unstable, implementation must surface that limitation and keep the state unknown rather than silently replacing it with an Agentic Kit guess.
Executive brief
Agentic Kit can already report which CLI/package versions are installed and which releases are available, and it already knows the configured per-activity host/model routes. It cannot yet answer the equivalent model-lifecycle questions across Claude Code, Codex, and OpenCode:
This proposal adds Model Lifecycle Intelligence: a local-first, provenance-aware inventory and change-detection layer for host model catalogs, configured bindings, observed use, lifecycle notices, and route impact. It introduces a dedicated read-only
ak modelscommand family, adds a compact model-health row toak status, and adds a Models view beneath the Dashboard's existing Usage area.The central rule is that newer, discoverable, entitled, configured, observed, compatible, and better are different claims. A host or provider catalog may prove that a model exists; it does not prove that the current account can use it. A migration target may prove a supported replacement; it does not prove equal quality or lower cost. Evidence-backed quality and economic recommendations remain the responsibility of Route Intelligence in #109.
Representative output:
All names and counts above are illustrative. Shipped output must come from source-attributed local evidence.
Table of contents
akcommand surfaceBackground and current state
Agentic Kit already has most of the facts needed to build the feature, but they are fragmented:
src/lib/routing.mjsowns the canonical activity routes and currently carries a manually verified, static known-good model catalog (MODEL_CATALOG,PROVIDER_MODEL_CATALOG, andMODEL_CATALOG_VERIFIED). The help text correctly allows any model the host accepts, but the static catalog cannot detect per-machine additions, retirement notices, aliases, entitlement, or change over time.src/lib/adapters/registries.mjsalready defines capability-driven host/provider/projection/observability registries. Provider capabilities includemodelDiscoveryandruntimeDiscovery, and observability supportscatalogevidence. Today only Ollama advertises those capabilities; the seam exists but is not yet generalized into a host-scoped inventory.src/commands/status.mjsalready aggregates installed/latest versions, health, drift, and fixes into human and JSON rows. It is the right place for a terse, cache-only summary, not a full model matrix.src/commands/x/host.mjsandsrc/lib/routing.mjsalready own route mutation. A new inventory feature should not create a competing model-policy source of truth.src/lib/providers.mjsprojects routing into Agentic-QE's.agentic-qe/llm-config.json, including per-agent overrides when supported.ak runrecords selected routes and bounded attempts. These are usage facts, not catalog or entitlement facts.There is also a concrete opportunity in the current host surfaces:
upgrade.modelmigration targets for retiring entries. That proves a useful adapter input exists on this host, but its schema must be treated as host-owned and versioned rather than copied into core policy.opencode models [provider]provides a project/provider-scoped model list, optional verbose metadata, and explicit--refreshof the Models.dev-backed cache.availableModels, and gateway model discovery, but an alias or published model list does not by itself establish current-account entitlement.The governing ADRs are living plans:
No governing ADR currently defines a normalized, snapshot-based model inventory or model-lifecycle contract. This issue should add a new Proposed ADR and amend the existing ADRs only when their shipped behavior changes.
Problem statement
Package upgrades are mostly scalar: installed version X, registry version Y, upgrade available. Models are not.
A model name can be:
sonnet,default, or another host-defined label;provider/model;Consequently, a single
installed → latestcolumn would be misleading. Agentic Kit needs a multidimensional inventory and a provenance-aware diff that can say exactly which source established each claim.The feature must also reconcile multiple consumers. The same model reference may appear in canonical
kit.jsonroutes, escalation ladders, Claude/Codex/OpenCode host config, Agentic-QE agent overrides or fallbacks, Ruflo candidate registries, learned Route Intelligence evidence, and historical transcripts. A model change can make any of these stale without changing the package version.Goals
ak modelscommand family, a conciseak statussummary, and a local Dashboard presentation.Non-goals
kit.json, host settings, Ruflo candidates, or Agentic-QE overrides.ak host pickas the canonical route-policy mutation surface.Product principles
kit.jsonrouting stays canonical; inventory diagnoses consumers and plans changes.Core model and evidence semantics
Model identity
Use a host-scoped identity rather than a global model-name string:
host + provider + modelId + scopeIdprevents two accounts, gateways, projects, or providers that reuse a model string from being conflated. Private deployment names and local digests may require sanitized display values while retaining a local stable key.Independent state dimensions
kit.json, host config, AQE/Ruflo projectionavailableModels, project configOne record can legitimately be configured but not discoverable, discoverable but not entitled, observed but hidden, or entitled but policy-blocked. The UI must display these combinations rather than reducing them to red/green availability.
Lifecycle and compatibility graph
Model “upgrade” should be represented as typed edges, not guessed semver ordering:
Every edge carries provenance and scope.
first-party-migrationis strong lifecycle evidence but not a quality assertion.same-family-newermay be curated or vendor-published.mechanically-compatiblemeans the route can be expressed and required features are present. Only Route Intelligence may create an evidence-backed quality/economics edge.Opportunity levels:
Evidence and confidence
Suggested evidence classes, strongest first:
Negative evidence requires extra care. A model becomes
removedonly after an authoritative removal/retirement signal or repeated complete snapshots in the same scope. A source failure, auth failure, schema mismatch, account switch, or incomplete list yieldsunknownplus a diagnostic.Discovery strategy by host
model, aliases, environment overrides, model overrides, managedavailableModels, gateway config/v1/modelsonly when configured; documented lifecycle data where available~/.codex/config.toml, profiles,model,model_provider, reasoning effort, invocation overridessession_meta, turn/runtime context, structured workersopencode models [provider], verbose metadata, explicit--refresh, Models.dev/provider/config mergeAdapter requirements:
ak models.complete,partial,stale,unavailable, orunsupported, never merely an array.Proposed architecture
Suggested snapshot contract:
Storage rules:
Ruflo MetaHarness and Agentic-QE overlap
Ruflo / MetaHarness
Ruflo already exposes two adjacent surfaces:
ruflo providersmanages providers/models/configuration and can list provider models.ruflo neural routerexposes the cost-optimal router lifecycle, including candidate models, prices, configuration, decisions, outcomes, savings, and bandit state.Ruflo's ADR-149 is Proposed, not shipped-contract authority. It describes a per-model candidate registry and quality-bar routing direction grounded in measured outcomes. This issue should consume runtime-proven surfaces and report their provenance; it must not present a Proposed ADR as installed behavior.
Boundary:
Agentic-QE
Agentic-QE exposes
aqe llm providers,aqe llm models, router config/health/cost, and routing economics/accuracy/metrics. Its separateaqe upgradecommand detects optional native bindings, not model upgrades.Boundary:
.agentic-qe/llm-config.json, providers, fallbacks, andagentOverridesas downstream bindings.Relationship to Route Intelligence (#109)
This issue answers what models exist, changed, are configured, and appear mechanically usable. #109 answers which model was effective for an operation and whether a cheaper candidate delivered materially equivalent benefit.
The two features should share concrete model identity, provider provenance, harness fingerprint, and freshness semantics, but retain distinct evidence grades and UI language.
Proposed
akcommand surfaceAdd one stable plural noun:
ak models. The initial family is read-only except for explicit cache refresh.ak models statusDefault output is concise and uses the most recent local snapshot plus current local config/observed evidence.
--allexpands hidden, unconfigured, and low-confidence entries. JSON returns the versioned snapshot/read-model contract.Recommended columns:
ak models refresh--online, refresh local config, caches, protocols, and transcript evidence only.--onlineexplicitly permits host/provider catalog network access such as OpenCode's cache refresh or a configured gateway model endpoint.--verifymode, if needed, must be separately designed and confirmed because it may spend tokens or cross provider boundaries.ak models diffReport:
ak models explainShow the evidence chain: where the reference is configured, precedence and alias resolution, last observed use, provider/source, catalog membership, entitlement/policy state, lifecycle edge, affected routes/escalations/AQE/Ruflo consumers, and why a candidate is eligible or ineligible.
ak models planProduce a read-only impact plan:
kit.jsonroute/escalation bindings affected;ak host pick --route …command when the change is expressible.Do not add
ak models applyin the first implementation. Route mutation remainsak host pick, preserving ADR-0001/ADR-0020. A future guardedak models swapis acceptable only if it becomes a single transactional plan/apply/verify/undo contract over the canonical policy rather than a second policy owner.Adapt
ak statusak statusremains the quick dashboard. Add one cache-only aggregate row:Behavior:
ak statusnever refreshes a network catalog;ak status --deepmay invoke bounded local host discovery protocols but still avoids remote refresh unless an existing status policy explicitly allows it;ak models refresh,ak models diff, orak models plan, never auto-applies a route.Status and Dashboard experience
Preserve the existing three primary Dashboard areas. Add a Models secondary destination under Usage, and add an Overview summary card that links to it. Because ADR-0009 currently governs Usage navigation, implementation must amend its
Updatednote/date when this destination ships.Overview summary card
Usage → Models view
Recommended sections:
ak host pickcommand.Visual language:
Upgrade availableonly for a first-party migration/supersession edge.New model discoveredfor catalog additions, without implying superiority.Compatible candidatefor mechanically expressible swaps.Cheaper equivalentorpremium justifiedonly when feat: add evidence-backed Route Intelligence for model effectiveness and cheaper-equivalent routing #109 provides the required evidence.Not verified for this accountwhen discoverability exists but entitlement is unknown.Catalog incompleterather thanremovedafter source failure.The Dashboard stays read-only, loopback-only, CSP-protected, network-silent on reads, and free of raw credentials/config secrets.
User interactions and scenarios
Scenario 1 — A Codex model receives a first-party migration target
ak statusshows one model migration requiring attention.ak models diffshows the lifecycle notice, replacement, catalog freshness, and affected coder/tester routes.ak models plan --from … --to …checks reasoning-effort/capability compatibility and enumerates projections and stale Route Intelligence evidence.ak host pick --route …command explicitly.Scenario 2 — A Claude alias silently resolves to a different concrete model
The configured route still says
sonnet, but the effective concrete target changes. The diff reports analias-target-changedevent, marks outcome cohorts learned on the prior concrete model stale, and explains that the alias remains valid. It does not label the change an upgrade unless first-party lifecycle evidence supports that language.Scenario 3 — OpenCode exposes new provider models
The user runs
ak models refresh --host opencode --online. New provider/project-eligible models appear asnewly discovered. They are not automatically inserted into routes, Agentic-QE, or Ruflo. Route Intelligence may later evaluate eligible candidates.Scenario 4 — Configured does not mean entitled
A model is present in
kit.jsonand a public provider catalog but absent from the active host-scoped entitled list. The UI reportsconfigured · entitlement unknownorconfigured · policy blockedbased on evidence. It does not claim removal and does not spend tokens to test it.Scenario 5 — Partial discovery failure
The Claude gateway times out while Codex and OpenCode discovery succeed. The new snapshot records a partial source diagnostic. The previous complete Claude baseline remains active; no Claude model is marked removed.
ak statusreports stale Claude discovery with the exact refresh action.Scenario 6 — AQE and Ruflo drift from canonical routes
A stale Agentic-QE override names a retired model and Ruflo's candidate registry still contains it.
ak models explainshows both consumers.ak models plandescribes the canonical route change and follow-on projection/invalidation work without editing either system.Scenario 7 — A cheaper candidate exists but quality is unknown
The inventory knows that a lower-priced compatible model is selectable. The Dashboard labels it
compatible candidate · quality not evaluated. Only after #109 produces qualified evidence may the label becomecheaper equivalentfor a particular activity.Scenario 8 — Multiple account or project scopes
The user changes a Codex profile or OpenCode project. Agentic Kit creates a different scope fingerprint and refuses to call catalog differences additions/removals across scopes. It can display the inventories side by side, but lifecycle history remains scoped.
Phased technical implementation plan
Phase 0 — Specification, ADR, and DDD contract
Deliverables
ModelIdentity,ModelBinding,CatalogSnapshot,CatalogSource,LifecycleEdge,CompatibilityEdge,ModelChange, andSwapPlanin the DDD vocabulary/context map.ak models status/diff/explain/plan.Exit gate
Phase 1 — Binding and observed-use inventory
Likely files
src/lib/routing.mjssrc/lib/providers.mjssrc/lib/adapters/registries.mjssrc/lib/model-inventory/Deliverables
ak models status --jsonfrom current local evidence; no historical diff yet.Exit gate
Phase 2 — Capability-driven discovery adapters
Likely files
src/lib/adapters/registries.mjssrc/lib/adapters/index.mjsDeliverables
modelsdiscovery and explicit online refresh adapter.Exit gate
unsupported-schemadiagnostics.Phase 3 — Snapshot store and lifecycle diff
Deliverables
ak models refresh,ak models diff, and machine-readable diagnostics.Exit gate
Phase 4 — Impact graph, explain, and plan
Deliverables
ak models explainandak models plan.ak host pick --route …actions; do not mutate policy.Exit gate
Phase 5 —
ak statusand Dashboard presentationLikely files
src/commands/status.mjssrc/lib/dashboard-server.mjssrc/lib/dashboard/client.mjssrc/lib/dashboard/page.mjssrc/lib/dashboard/styles.mjsDeliverables
modelsrow toak statusand JSON output.Exit gate
Phase 6 — Ruflo/AQE synchronization diagnostics and #109 integration
Deliverables
configured,reported, andruntime-provenstates.quality unknown,evidence stale, andevidence-backedopportunity promotion rules.Exit gate
Phase 7 — Optional transactional swap workflow
This phase is deliberately deferred.
Evaluate a guarded
ak models swaponly after planning and projection convergence are proven. It must:If those guarantees cannot be met, retain
ak host pickas the only mutation path.Phase 8 — Documentation, QE, and closure proof
Deliverables
pnpm run checkplus security/privacy/network-silence proofs.Exit gate
Security privacy and network constraints
ak status,ak models status, and Dashboard reads are offline and cache-only.ak models refresh --onlineis the explicit network boundary and names which hosts/providers will be contacted.Risks and mitigations
ak models; retainak host pickas canonical mutationAcceptance criteria
Domain and evidence integrity
Host discovery
Command surface
ak models status,refresh,diff,explain, andplanhave stable human and JSON contracts.refresh --onlineclearly names and bounds external contacts.planenumerates affected canonical routes, projections, AQE/Ruflo consumers, and evidence invalidation.ak models applyand does not mutate routing.ak host pick --route …surface.Diff and lifecycle correctness
Ruflo AQE and Route Intelligence boundaries
Status Dashboard and security
ak statusadds one truthful cache-only models row with freshness and actionable diagnostics.Documentation and closure
pnpm run check, Agentic-QE gates, network-silence, privacy, and exact-head release evidence are linked before closure.Success measures
diff,explain, andplanbefore route changes.Withheld findings are a trust measure: a system that never says “entitlement unknown” or “quality not evaluated” is overstating what it knows.
Open product decisions
ak models) or singular (ak model)? Plural is recommended for an inventory.ak status --deepever perform remote catalog refresh, or should all network remain exclusive toak models refresh --online? The latter is recommended.ak models swapexist, or isplanplusak host pickthe permanent clean separation?Related work and source grounding
Agentic Kit
Host-owned model sources
codex --help,codex app-server --help, and the versioned host-owned Codex model cache — model selection and machine-readable catalog/lifecycle evidence. Implementation should replace local research notes with a stable upstream protocol/source citation where available.Ruflo / MetaHarness / Agentic-QE grounding
ruflo/v3/docs/adr/ADR-149-per-model-cost-optimal-routing.md— Proposed per-model candidate registry and cost-optimal routing design; useful direction, not proof of shipped behavior.agentic-qe/src/integrations/agentic-flow/model-router/router.ts— implemented multi-model router orchestration boundary for complexity, budget, metrics, and decisions.ruflo providersexposes provider/model management.ruflo neural routerexposes candidate models, prices, configuration, decisions, outcomes, and savings surfaces.aqe llmexposes provider/model/router management.aqe routingexposes economics, accuracy, and per-agent metrics.aqe upgradeis a read-only optional-native recommendation command and is not a model-upgrade command.If a required upstream contract is unavailable or unstable, implementation must surface that limitation and keep the state unknown rather than silently replacing it with an Agentic Kit guess.