pub struct EffectRow {
pub reads: Vec<Resource>,
pub writes: Vec<Resource>,
pub invokes: Vec<Capability>,
pub spawns: bool,
pub destructive: bool,
pub sandbox: Sandbox,
pub cost: CostEstimate,
}Expand description
The effect row of a tool — what it does to the world.
Inspired by Koka’s effect row system, this is checked at compile time via Rust trait bounds and at runtime by the Dharma governance layer.
Fields§
§reads: Vec<Resource>Resources this tool reads from
writes: Vec<Resource>Resources this tool writes to
invokes: Vec<Capability>Capabilities this tool invokes
spawns: boolWhether this tool spawns external processes
destructive: boolWhether this tool is destructive (deletes/overwrites data).
Destructive tools require explicit confirmation via confirm: true in args.
sandbox: SandboxKernel-sandbox eligibility (Landlock A→B seam, declarative in v0).
cost: CostEstimateEstimated resource cost
Implementations§
Source§impl EffectRow
impl EffectRow
Sourcepub fn is_available_in(&self, brain_wave: BrainWave) -> bool
pub fn is_available_in(&self, brain_wave: BrainWave) -> bool
Check if this effect row is compatible with a brain-wave state.
In Alpha/Theta/Delta modes, expensive or write-heavy tools are filtered out to conserve resources.
Sourcepub fn acquires_coordination_lease(&self) -> bool
pub fn acquires_coordination_lease(&self) -> bool
True when this row mutates the coordination lease ledger (claim or same-owner renewal). Strict mode refuses acquisition/renewal so system stress cannot trap new work (AHIMSA Target A, 9.1.8).
Sourcepub fn is_coordination_cleanup(&self) -> bool
pub fn is_coordination_cleanup(&self) -> bool
True when this row is exactly the coordination owner-cleanup effect:
one CoordinationRelease write, no spawns, not destructive. The strict
gate admits this shape (and only this shape) so an already-held lease
can always be released under stress.
Sourcepub fn is_no_discovery_checkpoint(&self) -> bool
pub fn is_no_discovery_checkpoint(&self) -> bool
True when this row is exactly the no-discovery checkpoint shape: one Sessions-galaxy write, no spawns, not destructive. The strict gate admits this shape so a checkpoint can be stored under stress without repository discovery, filesystem reads, or subprocesses.
Sourcepub fn conflicts_with(&self, other: &Self) -> bool
pub fn conflicts_with(&self, other: &Self) -> bool
Check if this effect row conflicts with another (for parallel execution)