pub struct AccountIdentity {
pub provider: String,
pub models_dev_provider_slug: Option<String>,
pub account_ref: Option<AccountRef>,
}Expand description
Shared account-identity type (commons#13, operator-ratified 2026-08-29).
provider was two namespaces wearing one name across the fleet: usage
sources, credential configs, sweep-unit names, and catalog slugs all emit
plausible provider strings, so a wrong join never fails loudly. This type
makes the namespace explicit so no consumer ever writes the alias map that
a silent join failure invites.
Absence is ordinary here, not exceptional: at ratification time 34 of 40
live wire entries carried no verified identity. Consumers must treat a
missing account_ref as the expected shape, never as an error.
Fields§
§provider: StringSource-scoped provider name, spelled in the emitting module’s own namespace (a usage source’s “claude”, a registry’s invented plan name). MANDATORY. The same string under two sources need not mean the same thing; this field never claims cross-source meaning.
models_dev_provider_slug: Option<String>The models.dev slug for this provider, when a join to the model catalog EXISTS. Named for its source deliberately: a second catalog source would get its own field rather than silently changing this one’s meaning.
None means NO JOIN EXISTS — never fall back to Self::provider.
models.dev publishes no alias metadata of any kind (measured:
no alias, renamed_from, supersedes, or deprecated_by), so
there is nothing for a fallback to fall back to; “use the other name”
fabricates a join, and a fabricated join produces plausible rows
forever instead of erroring.
account_ref: Option<AccountRef>Verified account identity, when the provider disclosed one.
PROPAGATION RULE: provenance travels with the value and is NEVER
re-derived downstream. The moment a consumer writes
if provider == "anthropic" { assume frozen } they have re-implemented
the producer’s discriminant from the outside, keyed on a provider
string — the exact namespace hazard this type exists to prevent,
recreated one level down. The producer that holds the value at its
source knows which branch produced it; nobody else does.