Deprecate and Remove Actor.hs

t-369.15·WorkTask·
·
·
·Omni/Agent.hs
Parent:t-369·Created1 month ago·Updated1 month ago

Dependencies

Description

Edit

Evaluate whether Actor.hs is still needed and deprecate if not.

Context

Actor.hs implements file-based actor primitives (SEND/CREATE/BECOME). With the Op free monad providing Par/Race/State, much of Actor's functionality is redundant.

Analysis Questions

1. What does Actor provide that Op doesn't?

  • File-based message passing (persistence)
  • Named actors with IDs
  • Hierarchical capability attenuation
  • BECOME for state transitions

2. Can Op replicate these?

  • Persistence: Op traces + checkpoints
  • Named actors: Could add actor IDs to state
  • Capability attenuation: Op's Sandbox/Limit
  • BECOME: Op's Put state

3. Who uses Actor.hs currently?

  • Check for imports in codebase
  • Check if Ava or other systems depend on it

Deliverables

1. Usage Analysis

# Find all imports of Actor
grep -r "import.*Actor" Omni/
grep -r "Actor\." Omni/

2. Feature Mapping

Document how each Actor feature maps to Op:

| Actor Feature | Op Equivalent | |---------------|---------------| | ActorId | TraceId or state field | | Message | Function call result | | SEND | Return value from Par branch | | CREATE | Par with new branch | | BECOME | Put new state | | Mailbox | State or Event log | | Capability limits | Limit, Sandbox |

3. Migration Guide

If deprecating, document how to migrate:

-- Old Actor pattern
actor = do
  msg <- receive
  result <- process msg
  send result customer
  become newState

-- New Op pattern
program = do
  state <- get
  result <- process (stateMessage state)
  put (state { stateResult = result })
  -- Results flow via return value, not explicit send

4. Decision

Based on analysis:

  • If Actor is unused/redundant: Mark deprecated, plan removal
  • If Actor has unique value: Document when to use Actor vs Op
  • If Actor can wrap Op: Refactor Actor to use Op internally

5. If Deprecating

-- Add to Actor.hs header
{-# DEPRECATED "Use Omni.Agent.Op for new code. See migration guide." #-}

Create migration tracking task.

Notes

  • Don't rush removal - ensure no breakage
  • Actor's file-based persistence might be valuable for crash recovery
  • Op's in-memory approach might need enhancement

Files to Read First

  • Omni/Agent/Actor.hs
  • Omni/Agent/Actor.md (skill doc)
  • Omni/Agent/Op.hs
  • Any code that imports Actor

Timeline (2)

🔄[human]Open → InProgress1 month ago
🔄[human]InProgress → Done1 month ago