pub struct TaskAgent { /* private fields */ }Expand description
Autonomous task-executing agent with finite lifespan.
ONTOLOGICAL CONSTRAINTS:
- Born with fixed energy budget
- Tasks consume energy irreversibly
- Errors inflict permanent scars
- Scars increase future task costs
- Death is permanent
FORBIDDEN OPERATIONS:
- Retry without cost
- Energy restoration
- Scar removal
- Death resurrection
- Learning from errors
Implementations§
Source§impl TaskAgent
impl TaskAgent
Sourcepub fn create(initial_energy: u64) -> Self
pub fn create(initial_energy: u64) -> Self
Create new agent with initial energy budget.
FINITE LIFETIME: This is all the energy the agent will ever have.
LAZARUS CHECK: Verifies that no agent with this identity has died before. If an agent identity is found in the graveyard, this function panics.
Sourcepub fn damage_score(&self) -> u32
pub fn damage_score(&self) -> u32
Get accumulated damage score.
Sourcepub fn tasks_completed(&self) -> usize
pub fn tasks_completed(&self) -> usize
Get count of completed tasks.
Sourcepub fn tasks_failed(&self) -> usize
pub fn tasks_failed(&self) -> usize
Get count of failed tasks.
Sourcepub fn current_capacity(&self) -> u32
pub fn current_capacity(&self) -> u32
Calculate current task capacity.
DEGRADATION: Capacity decreases with accumulated damage. Base capacity = 100, reduced by damage score.
Sourcepub fn execute_task(&mut self, task: Task, outcome: TaskOutcome) -> TaskResult
pub fn execute_task(&mut self, task: Task, outcome: TaskOutcome) -> TaskResult
Execute task with given outcome.
CONSEQUENCES:
- Energy consumed irreversibly (even on failure)
- Failures inflict permanent scars
- Scars increase future task costs
- Fatal failures terminate agent
- No retry mechanism exists
HARSH REALITY:
- Failure consumes energy without completing task
- Agent cannot learn from errors
- Accumulated damage leads to death spiral
Sourcepub fn bury(&self) -> Result<(), GraveyardError>
pub fn bury(&self) -> Result<(), GraveyardError>
Bury this agent in the Graveyard (requires agent to be dead).
Creates a cryptographically sealed tombstone with:
- Complete identity and metabolic information
- All scars and cause of death
- Causal chain for tamper detection
CONSEQUENCE: Once buried, this agent’s identity cannot be reused. CONSEQUENCE: Tombstone is immutable after creation.
Sourcepub fn spawn(
&mut self,
initial_energy_for_child: u64,
) -> Result<TaskAgent, String>
pub fn spawn( &mut self, initial_energy_for_child: u64, ) -> Result<TaskAgent, String>
Spawn a descendant agent from this “healthy” parent agent.
REQUIREMENTS FOR SPAWNING:
- Parent must be ALIVE (not dead)
- Parent must have high enough Legacy Score (at least 0.5)
- Parent must have capacity to transfer (remaining energy >= 100)
- Parent must have completed at least 5 tasks successfully
TRANSFER MECHANICS:
- Portion of parent’s energy passes to child (scaled by parent’s efficiency)
- Parent loses transferred energy permanently
- Child inherits knowledge from parent’s success ratio
- Child gains genetic advantage from parent’s efficiency
- Creates a causal tree across generations
CONSEQUENCE: Energy transfer is IRREVERSIBLE. CONSEQUENCE: Parent becomes weaker after spawning. CONSEQUENCE: Child starts with advantage but at higher risk.
Returns: New child TaskAgent with genealogical lineage
Sourcepub fn status_summary(&self) -> String
pub fn status_summary(&self) -> String
Get agent status summary.