Problem
Credentials have three different modeling approaches across layers (Issue #65, P4):
| Layer |
Type |
Representation |
| machine |
Model.credentials: Option<String> |
Resolved API key string |
| proto |
CredentialSpec { oneof { env, literal } } |
Preserves source distinction |
| RCM |
credentials_env + credentials_key (two separate Option fields) |
Two fields, compile-time mutual exclusion check |
This means:
machine::Model always stores the resolved API key — loses the original source info
- RCM syntax requires two separate fields with manual mutual exclusion
- Error messages in compile show
"mutually exclusive" instead of guiding the user
Design considerations
The proto CredentialSpec design is actually the cleanest — it preserves the source distinction via oneof. Consider aligning machine::Model and RCM syntax to match this pattern:
message CredentialSpec {
oneof source {
string env = 1;
string literal = 2;
}
}
Out of scope
- Does not change credential behavior or resolution logic
- Does not introduce credential storage or rotation
Parent: #65
Problem
Credentials have three different modeling approaches across layers (Issue #65, P4):
Model.credentials: Option<String>CredentialSpec { oneof { env, literal } }credentials_env+credentials_key(two separate Option fields)This means:
machine::Modelalways stores the resolved API key — loses the original source info"mutually exclusive"instead of guiding the userDesign considerations
The proto
CredentialSpecdesign is actually the cleanest — it preserves the source distinction viaoneof. Consider aligningmachine::Modeland RCM syntax to match this pattern:Out of scope
Parent: #65