lex-synapse 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c62483ced1238be0da450c077108fa58541aa5964b27f3c6977ad11203202115
4
- data.tar.gz: c8c8a52ff8eb60ebd971a4eeae4ae0a53709629548a58c4409bbdd7c5d3cfebe
3
+ metadata.gz: 4a9d8a3b5e13c6470c2170ca639e04e1fc8aedc0d596ff709ec9324334374e51
4
+ data.tar.gz: ecc92ce72c7ec61129495e1b290dbfb1e5df7353c6ce8b9a9ef974f146fbfa9f
5
5
  SHA512:
6
- metadata.gz: 50c4b74beca7a56c91953d34dd8179cd7f1c42af111ef05be4c9ec62f154135e93fac708c0270ed9c47ee73be987dd8386c5c47b638988982ff454980a4f2e0e
7
- data.tar.gz: 3b6683e9c804a465f47d5fde8471768896ea7c4554e597a8a26c03313fb32e3d30c97cfa9e071726997455a3a5d4ea4392e1d9d94a20ce9ccc03c74de6318a2a
6
+ metadata.gz: bf1e6f5ffe926a283d8e5278cc12546e57e3183b8893604c7b20ca81a57e2b5b571b28ce6448370e4e24576ff62dc55916a5080fd864e67e3814951f93b5ed69
7
+ data.tar.gz: 7995dee982eda776e8f847ba73202131a5c5fb01f0198193ef9dd5f3bed7d45677be196a76a65b19d4518bd3f41265ddb5622c587cced160cd94164d59771793
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.1] - 2026-03-22
4
+
5
+ ### Fixed
6
+ - Challenge and Propose actors now include their runner modules and override `runner_class` to return `self.class`, fixing `NoMethodError: undefined method 'run_challenge_cycle'` at runtime
7
+
3
8
  ## [0.4.0] - 2026-03-22
4
9
 
5
10
  ### Added
data/CLAUDE.md CHANGED
@@ -10,7 +10,7 @@ Cognitive routing layer that wraps task chain relationships with observation, le
10
10
 
11
11
  **GitHub**: https://github.com/LegionIO/lex-synapse
12
12
  **License**: MIT
13
- **Version**: 0.3.2
13
+ **Version**: 0.4.0
14
14
 
15
15
  ## Architecture
16
16
 
@@ -22,7 +22,8 @@ Legion::Extensions::Synapse
22
22
  │ ├── Crystallize # Every 300s — emergent synapse detection
23
23
  │ ├── Homeostasis # Every 30s — spike/drought monitoring
24
24
  │ ├── Decay # Every 3600s — idle confidence decay
25
- └── Propose # Every 300s — proactive proposal analysis for AUTONOMOUS synapses
25
+ ├── Propose # Every 300s — proactive proposal analysis for AUTONOMOUS synapses
26
+ │ └── Challenge # Every 60s — adversarial challenge pipeline for pending proposals
26
27
  ├── Runners/
27
28
  │ ├── Evaluate # attention -> transform -> route -> record
28
29
  │ ├── Pain # failure recording, confidence hit, auto-revert
@@ -34,14 +35,16 @@ Legion::Extensions::Synapse
34
35
  │ ├── GaiaReport # GAIA tick hook: report confidence and health per synapse
35
36
  │ ├── Promote # Apollo integration: promote high-confidence synapse patterns to shared knowledge
36
37
  │ ├── Retrieve # Apollo integration: retrieve relevant synapse patterns from shared knowledge
37
- └── Propose # reactive (signal-driven) + proactive (periodic) proposal generation
38
+ ├── Propose # reactive (signal-driven) + proactive (periodic) proposal generation
39
+ │ └── Challenge # conflict detection, LLM challenge, weighted aggregation, outcome resolution
38
40
  ├── Helpers/
39
41
  │ ├── Confidence # scoring, adjustments, autonomy ranges, decay
40
42
  │ ├── Homeostasis # spike/drought detection, baseline tracking
41
- └── RelationshipWrapper # Layer 1 -> Layer 2 wrapping
43
+ ├── RelationshipWrapper # Layer 1 -> Layer 2 wrapping
44
+ │ └── Challenge # settings, constants, impact threshold helpers
42
45
  ├── Data/
43
- │ ├── Migrations/ # 001 synapses, 002 mutations, 003 signals
44
- │ └── Models/ # Synapse, SynapseMutation, SynapseSignal
46
+ │ ├── Migrations/ # 001 synapses, 002 mutations, 003 signals, 004 proposals, 005 challenges
47
+ │ └── Models/ # Synapse, SynapseMutation, SynapseSignal, SynapseProposal, SynapseChallenge
45
48
  ├── Transport/
46
49
  │ ├── Exchanges/Synapse
47
50
  │ ├── Queues/Evaluate, Pain
@@ -80,6 +83,8 @@ Legion::Extensions::Synapse
80
83
  - **synapses**: Core routing definition with confidence, status, version, baseline_throughput
81
84
  - **synapse_mutations**: Versioned change history with before/after JSON snapshots
82
85
  - **synapse_signals**: Per-signal outcome records (attention pass, transform success, latency, downstream outcome)
86
+ - **synapse_proposals**: Proposed changes with status lifecycle, challenge_state, challenge_score, impact_score
87
+ - **synapse_challenges**: Per-challenge verdicts (conflict/LLM), confidence tracking, outcome resolution
83
88
 
84
89
  ## Autonomous Observation Mode (v0.3.0)
85
90
 
@@ -91,6 +96,18 @@ Legion::Extensions::Synapse
91
96
  - **Data**: `synapse_proposals` table with status lifecycle (pending -> approved/rejected/applied/expired)
92
97
  - **Client methods**: `proposals(synapse_id:, status:)`, `review_proposal(proposal_id:, status:)`
93
98
 
99
+ ## Adversarial Challenge Phase (v0.4.0)
100
+
101
+ - **Challenge pipeline**: pending proposals go through conflict detection (mechanical) -> impact scoring -> LLM challenge (gated) -> weighted aggregation -> auto-accept/reject/await-review
102
+ - **Conflict detection**: queries sibling pending proposals on same synapse; conflicting types produce 'challenge' verdict
103
+ - **LLM challenge**: gated by `impact_score >= 0.3`; calls lex-transformer LLM engine; parses SUPPORT/CHALLENGE/ABSTAIN
104
+ - **Aggregation**: `support_weight / (support_weight + challenge_weight)`, abstains excluded; >= 0.85 auto-accepts, <= 0.15 auto-rejects
105
+ - **Challenger confidence**: starting 0.5, correct +0.05, incorrect -0.08, decay *0.998/hr; tracks via outcome resolution after observation window (50 signals post-application)
106
+ - **Settings**: `lex-synapse.challenge.*` — enabled, impact_threshold, auto_accept_threshold, auto_reject_threshold, llm_engine_options, outcome_observation_window, max_per_cycle
107
+ - **Data**: `synapse_challenges` table; `synapse_proposals` gains challenge_state, challenge_score, impact_score columns
108
+ - **Statuses**: `auto_accepted`, `auto_rejected` added to proposal lifecycle
109
+ - **Client methods**: `challenge_proposal(proposal_id:)`, `challenges(proposal_id:)`, `challenger_stats`
110
+
94
111
  ## GAIA / Apollo Integration (v0.2.2)
95
112
 
96
113
  - **GaiaReport runner**: Called during the GAIA tick cycle to report per-synapse confidence and health metrics.
@@ -110,11 +127,11 @@ Legion::Extensions::Synapse
110
127
 
111
128
  ```bash
112
129
  bundle install
113
- bundle exec rspec # 353 specs, 0 failures
130
+ bundle exec rspec # 412 specs, 0 failures
114
131
  bundle exec rubocop # 0 offenses
115
132
  ```
116
133
 
117
- 353 specs, 95%+ coverage. Uses in-memory SQLite for model/runner tests.
134
+ 412 specs, 94%+ coverage. Uses in-memory SQLite for model/runner tests.
118
135
 
119
136
  ---
120
137
 
@@ -1,10 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative '../runners/challenge'
4
+
3
5
  module Legion
4
6
  module Extensions
5
7
  module Synapse
6
8
  module Actor
7
9
  class Challenge < Legion::Extensions::Actors::Every
10
+ include Legion::Extensions::Synapse::Runners::Challenge
11
+
12
+ def runner_class = self.class
13
+
8
14
  def runner_function
9
15
  'run_challenge_cycle'
10
16
  end
@@ -1,10 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative '../runners/propose'
4
+
3
5
  module Legion
4
6
  module Extensions
5
7
  module Synapse
6
8
  module Actor
7
9
  class Propose < Legion::Extensions::Actors::Every
10
+ include Legion::Extensions::Synapse::Runners::Propose
11
+
12
+ def runner_class = self.class
13
+
8
14
  def runner_function
9
15
  'propose_proactive'
10
16
  end
@@ -3,7 +3,7 @@
3
3
  module Legion
4
4
  module Extensions
5
5
  module Synapse
6
- VERSION = '0.4.0'
6
+ VERSION = '0.4.1'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-synapse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity