pub enum FoundationError {
UnsupportedSchemaVersion(u32),
InvalidShape(String),
SecretFieldPresent(String),
DuplicateProfileId(String),
UnknownRole(String),
DuplicateRole(ProfileRole),
EmptyField(&'static str),
EmptyRoles,
IoError(String),
SecretUnavailable {
service: String,
account: String,
reason: String,
},
CapabilityUnsatisfied {
profile_id: String,
mechanism: ExtractMechanism,
},
RoleDenied {
profile_id: String,
requested: ProfileRole,
},
}Expand description
Why a profiles.json was rejected at the parse boundary. The host must
report one of these — never silently fall through to a different provider.
Variants§
UnsupportedSchemaVersion(u32)
schema_version is not 1.
InvalidShape(String)
The JSON document is not a valid FoundationProfiles shape.
SecretFieldPresent(String)
profiles.json carries a field that smells like a secret (§2.5).
DuplicateProfileId(String)
A profile ID appears twice.
UnknownRole(String)
A role string is not one of the four legal values.
Cross-host surface: the strict parser does not currently produce
this (serde rejects unknown ProfileRole enum variants before the
value reaches us), but the variant is part of the public error
contract so external hosts can map their own role validation to it.
DuplicateRole(ProfileRole)
A role appears twice within the same profile.
EmptyField(&'static str)
A profile field is the empty string (id, provider, model, credential).
EmptyRoles
roles is empty.
IoError(String)
The on-disk document could not be read.
The OS Keychain refused or did not contain the locator’s secret. The caller logs this verbatim and falls through to the next step in the resolution ladder (§3 — explicit override wins, profile for role wins, ANTHROPIC_/OPENAI_ env, then local). It never silently sends extraction to a different remote provider.
CapabilityUnsatisfied
A Foundation profile was selected, but its declared capabilities do not satisfy the configured extraction mechanism. The host must reject the profile before contacting the Keychain.
Cross-host surface: constructed by
ResolvedProfiles::pick_for_role; the oxibrain-cli binary does not
exercise that path directly today, but the integration tests in
tests/foundation_profiles.rs do.
RoleDenied
A profile was selected but its role membership does not include the role the caller asked for.
Cross-host surface: same reason as
FoundationError::CapabilityUnsatisfied.
Trait Implementations§
Source§impl Clone for FoundationError
impl Clone for FoundationError
Source§fn clone(&self) -> FoundationError
fn clone(&self) -> FoundationError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FoundationError
impl Debug for FoundationError
Source§impl Display for FoundationError
impl Display for FoundationError
impl Eq for FoundationError
Source§impl Error for FoundationError
impl Error for FoundationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for FoundationError
impl PartialEq for FoundationError
impl StructuralPartialEq for FoundationError
Auto Trait Implementations§
impl Freeze for FoundationError
impl RefUnwindSafe for FoundationError
impl Send for FoundationError
impl Sync for FoundationError
impl Unpin for FoundationError
impl UnsafeUnpin for FoundationError
impl UnwindSafe for FoundationError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.