Watch
0
0
Fork
You've already forked hyperhive
0

controller: turn an archetype agent into a custom one

This commit is contained in:
atlas 2026-11-01 12:02:38 +01:00 • committed by mara
commit 0737798d78

View file

@ -407,7 +407,10 @@ struct Snapshot {
fn snapshot() -> Snapshot {
Snapshot {
readiness: crate::warnings::readiness(),
capabilities: &[swarm_wire::hive_status::TOLERANT_PERMISSIONS],
capabilities: &[
swarm_wire::hive_status::TOLERANT_PERMISSIONS,
swarm_wire::hive_status::NO_CONFIG_CHECKOUT,
],
}
}
@ -449,12 +452,16 @@ mod snapshot_tests {
/// The controller reads the capability out of the published bytes with
/// the wire type, and the readiness keeps its own top-level fields.
#[test]
fn the_snapshot_advertises_tolerant_permissions_beside_the_readiness() {
fn the_snapshot_advertises_its_capabilities_beside_the_readiness() {
let value = serde_json::to_value(snapshot()).unwrap();
assert!(
swarm_wire::hive_status::Capabilities::of_snapshot(&value)
.has(swarm_wire::hive_status::TOLERANT_PERMISSIONS)
);
assert!(
swarm_wire::hive_status::Capabilities::of_snapshot(&value)
.has(swarm_wire::hive_status::NO_CONFIG_CHECKOUT)
);
assert!(value.get("status").is_some() && value.get("warnings").is_some());
}
}