Repository is archived
No release in over 3 years
Strategic withdrawal engine based on Wrosch et al. goal disengagement theory — detects sunk cost bias, assesses opportunity cost, and recommends disengagement from low-progress goals
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-disengagement

Goal disengagement and sunk cost detection for LegionIO cognitive agents.

What It Does

Strategic withdrawal based on Wrosch et al. goal disengagement theory. When a goal stops making progress, cognitive resources are better spent elsewhere — but the sunk cost fallacy makes it hard to let go. This extension tracks goal progress, detects stalls, computes disengagement scores (balancing sunk cost, opportunity cost, and progress), and recommends when to disengage.

Six disengagement reasons are modeled: sunk cost, low progress, opportunity cost, goal conflict, resource exhaustion, and external block.

Usage

client = Legion::Extensions::CognitiveDisengagement::Client.new

goal = client.create_disengagement_goal(
  label: 'optimize inference latency to under 100ms',
  domain: :performance
)

client.check_goal_progress(goal_id: goal[:goal][:id], new_progress: 0.1, effort: 0.3)
client.check_goal_progress(goal_id: goal[:goal][:id], new_progress: 0.11, effort: 0.3)

assessment = client.assess_goal_disengagement(goal_id: goal[:goal][:id])
# => { should_disengage: true, score: 0.72, reason: :low_progress }

client.disengage_from_goal(goal_id: goal[:goal][:id], reason: :low_progress)

Development

bundle install
bundle exec rspec
bundle exec rubocop

License

MIT