Skip to main content

kernel_assessment

Function kernel_assessment 

Source
pub fn kernel_assessment(
    definition: &AgentDefinition,
    origin: &AgentOrigin,
    drivers: &[(String, Vec<EffectClass>)],
) -> AgentAssessment
Expand description

What the kernel itself knows of definition’s risk (spec 3.3 §5.7’s risk table), the floor under any factory’s assessment: its mode, files, shell, web and money packs; each of its drivers by the effect classes of its tools (drivers: id and classes; a driver with no class listed counts as undescribed); and a suggestion from work the person did not start at a screen, which is high (decision 20). Abilities name only the drivers; the factory words the rest.

§Example

use adk_core::ApprovalRisk;
use adk_kernel::agents::{AgentDefinition, AgentOrigin, AgentUses, kernel_assessment};
use adk_kernel::drivers::EffectClass;
use adk_kernel::PartitionMode;

let calendar = AgentDefinition::new("Planner", "work")
    .with_mode(PartitionMode::Plan)
    .with_uses(AgentUses::default().with_driver("calendar"));
let low = kernel_assessment(&calendar, &AgentOrigin::ByHand, &[("calendar".into(), vec![EffectClass::Read])]);
assert_eq!(low.risk, ApprovalRisk::Low);
let money = kernel_assessment(&calendar, &AgentOrigin::ByHand, &[("calendar".into(), vec![EffectClass::Financial])]);
assert_eq!((money.risk, money.money), (ApprovalRisk::High, true));