ruth is created from a ruth archetype that runs sonnet
This commit is contained in:
parent
aff8cf629d
commit
5233259b3b
1 changed files with 236 additions and 115 deletions
|
|
@ -491,6 +491,33 @@ mod tests {
|
|||
assert_eq!(by_name("with")["icon"], "<svg/>");
|
||||
assert!(by_name("plain").get("icon").is_none());
|
||||
}
|
||||
|
||||
/// `ruth`'s `meta` as `nix/archetypes/default.nix` evaluates it: the check
|
||||
/// stores it, and it keeps `manage_root_agent` and the model.
|
||||
#[test]
|
||||
fn the_ruth_archetype_passes_the_check_with_manage_root_agent_and_sonnet() {
|
||||
let r = evaluated(json!({
|
||||
"ruth": {
|
||||
"description": "manager",
|
||||
"inference": { "model": "sonnet" },
|
||||
"permissions": [
|
||||
"messaging", "meta", "inbox", "execution",
|
||||
"manage_root_agent", "logs", "metrics"
|
||||
]
|
||||
}
|
||||
}));
|
||||
assert!(r.refused.is_empty(), "{:?}", r.refused);
|
||||
let meta = &r.archetypes["ruth"];
|
||||
let perms = meta.permissions.as_deref().expect("permissions");
|
||||
assert!(perms.contains(&"manage_root_agent".to_owned()));
|
||||
assert!(perms.contains(&"logs".to_owned()));
|
||||
assert!(perms.contains(&"metrics".to_owned()));
|
||||
assert_eq!(
|
||||
meta.inference.as_ref().and_then(|i| i.model.as_deref()),
|
||||
Some("sonnet")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_bad_archetype_is_refused_by_name_and_the_rest_stay() {
|
||||
let r = evaluated(json!({
|
||||
|
|
|
|||
Loading…
Reference in a new issue