Skip to main content

TaskAgent

Struct TaskAgent 

Source
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

Source

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.

Source

pub fn identity(&self) -> &Identity

Get agent identity.

Source

pub fn is_alive(&self) -> bool

Check if agent is alive.

Source

pub fn energy(&self) -> u64

Get current energy level.

Source

pub fn damage_score(&self) -> u32

Get accumulated damage score.

Source

pub fn tasks_completed(&self) -> usize

Get count of completed tasks.

Source

pub fn tasks_failed(&self) -> usize

Get count of failed tasks.

Source

pub fn current_capacity(&self) -> u32

Calculate current task capacity.

DEGRADATION: Capacity decreases with accumulated damage. Base capacity = 100, reduced by damage score.

Source

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
Source

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.

Source

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

Source

pub fn status_summary(&self) -> String

Get agent status summary.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more