lex-cognitive-telescope
A LegionIO cognitive architecture extension that models cognitive attention as a telescope. Telescopes zoom in for detailed focus or out for wide situational awareness, with aperture and magnification controlling clarity and field of view.
What It Does
Manages an observatory of cognitive attention instruments (telescopes), each with:
- A lens type (
:refractor,:reflector,:catadioptric,:radio,:adaptive) - Aperture (0.1 to 1.0) — higher = clearer
- Magnification (1.0 to 100.0) — higher = more detailed, narrower field of view
Observations are recorded and scored by detail level. High-magnification telescopes near their target produce significant observations; low-magnification or distant targets produce faint ones.
Usage
require 'lex-cognitive-telescope'
client = Legion::Extensions::CognitiveTelescope::Client.new
# Create a telescope for scanning attention
scope = client.create_telescope(lens_type: :refractor, aperture: 0.8, magnification: 5.0)
# => { success: true, telescope: { id: "uuid...", clarity: 0.79, clarity_label: :clear, field_of_view: 0.16, wide_field: true, ... } }
telescope_id = scope[:telescope][:id]
# Observe a target
obs = client.observe(telescope_id: telescope_id, target: 'ethical_conflict_signal', distance: 0.3)
# => { success: true, observation: { detail_level: 0.035, significant: false, faint: true, distance_label: :near, ... } }
# Zoom in for more detail
client.zoom_in(telescope_id: telescope_id, factor: 10.0)
# => { success: true, telescope: { magnification: 50.0, deep_field: true, field_of_view: 0.016, clarity: 0.79, ... } }
# Now observe with higher detail
client.observe(telescope_id: telescope_id, target: 'ethical_conflict_signal', distance: 0.3)
# => { success: true, observation: { detail_level: 0.35, significant: false, faint: false, ... } }
# Switch to survey mode (wide field scan)
client.survey_mode(telescope_id: telescope_id)
# => { success: true, telescope: { magnification: 1.0, wide_field: true, ... } }
# Or go to maximum focus
client.deep_focus(telescope_id: telescope_id)
# => { success: true, telescope: { magnification: 100.0, deep_field: true, sharp: true, ... } }
# List significant observations
client.list_observations(significant_only: true)
# => { success: true, observations: [...], count: 0 }
# Observatory report
client.observatory_status
# => { success: true, report: { total_telescopes: 1, total_observations: 2, significant_count: 0, avg_detail: 0.19, ... } }Development
bundle install
bundle exec rspec
bundle exec rubocopLicense
MIT