Repository is archived
No release in over 3 years
Phantom limb model for AI: ghost signals from removed capabilities fade over time as the agent adapts
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

 Project Readme

lex-cognitive-phantom

Phantom limb model for removed cognitive capabilities in LegionIO agents. When a capability is removed, a phantom is registered with high initial intensity. Intensity decays over time; matching stimuli trigger the phantom; acknowledging it accelerates adaptation.

What It Does

  • Register removed capabilities (tool, permission, memory, context, skill, etc.) as phantoms
  • Initial intensity: 0.8 (acute state)
  • Four states: acute (>= 0.6) → adapting (>= 0.3) → residual (> 0.01) → resolved
  • Incoming stimuli trigger the phantom (small intensity boost + signal record)
  • acknowledge_phantom applies 2.5× decay for accelerated adaptation
  • Standard decay (INTENSITY_DECAY = 0.05/cycle) runs via decay_all
  • Resolved phantoms are pruned from memory automatically

Usage

# Register a removed capability
result = runner.register_removal(
  capability_type: :tool_access, domain: :operations,
  content: 'database write permission removed by governance'
)
phantom_id = result[:phantom][:id]

# Process a stimulus that touches the removed capability
runner.process_stimulus(phantom_id: phantom_id,
                         stimulus: 'attempted to write to DB')
# => { success: true, triggered: true, intensity: 0.81, trigger_type: :stimulus_match, state: :acute }

# Acknowledge to accelerate adaptation
runner.acknowledge_phantom(phantom_id: phantom_id)
# => { success: true, phantom: { intensity: 0.68, state: :adapting } }

# Apply standard decay each tick
runner.decay_all
# => { success: true, decayed: 1, resolved: 0 }

# Overall status
runner.phantom_status
# => { success: true, total: 1, acute: 0, adapting: 1, residual: 0, resolved: 0 }

Development

bundle install
bundle exec rspec
bundle exec rubocop

License

MIT