lex-agentic-inference 0.1.0 → 0.1.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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +56 -3
- data/lib/legion/extensions/agentic/inference/momentum/helpers/momentum_engine.rb +2 -0
- data/lib/legion/extensions/agentic/inference/momentum/version.rb +1 -1
- data/lib/legion/extensions/agentic/inference/version.rb +1 -1
- data/spec/legion/extensions/agentic/inference/momentum/helpers/momentum_engine_spec.rb +12 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5f2289fe802a7e5c9389f186070ac7cc29e78f32be14f75377d63efaf7cd5fbe
|
|
4
|
+
data.tar.gz: df18916164427f2aedf35357431b720c49d24f0519f3c949e816e81ba1f1406f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b8b3b82eaf31d7fbdd78a7d7ee8e3b8e90160efaef782c9bc03b0a9eed215b2b65d25442093f7def1f10461ad129b9d50817ae86aef16367d266cb9d88f27d96
|
|
7
|
+
data.tar.gz: ad9678b737411b4fdddc7cec8c1df6bded639a0a0eb1ad6dae14460af85353e31b02ef8da06b30f2a04a462a52c16a4234b65a4d961e75443ed6b5925c421366
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -1,13 +1,66 @@
|
|
|
1
1
|
# lex-agentic-inference
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Domain consolidation gem for reasoning, inference, and belief management. Bundles 27 source extensions into one loadable unit under `Legion::Extensions::Agentic::Inference`.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Overview
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**Gem**: `lex-agentic-inference`
|
|
8
|
+
**Version**: 0.1.1
|
|
9
|
+
**Namespace**: `Legion::Extensions::Agentic::Inference`
|
|
10
|
+
|
|
11
|
+
## Sub-Modules
|
|
12
|
+
|
|
13
|
+
| Sub-Module | Source Gem | Purpose |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| `Inference::Abductive` | `lex-abductive-reasoning` | Best-explanation inference — hypothesis generation and ranking |
|
|
16
|
+
| `Inference::Analogical` | `lex-analogical-reasoning` | Structural analogy mapping between domains |
|
|
17
|
+
| `Inference::ArgumentMapping` | `lex-argument-mapping` | Argument tree — premises, conclusions, objections, rebuttals |
|
|
18
|
+
| `Inference::Bayesian` | `lex-bayesian-belief` | Bayesian belief updating with likelihood ratios |
|
|
19
|
+
| `Inference::BeliefRevision` | `lex-belief-revision` | AGM-model contraction, expansion, and revision |
|
|
20
|
+
| `Inference::CausalAttribution` | `lex-causal-attribution` | Weiner's attribution model — internal/external, stable/unstable |
|
|
21
|
+
| `Inference::CausalReasoning` | `lex-causal-reasoning` | Causal graph inference, do-calculus |
|
|
22
|
+
| `Inference::Counterfactual` | `lex-counterfactual` | Nearest-world counterfactual simulation |
|
|
23
|
+
| `Inference::HypothesisTesting` | `lex-hypothesis-testing` | Scientific reasoning loop — generate, predict, test, evaluate |
|
|
24
|
+
| `Inference::Prediction` | `lex-prediction` | Forward-model prediction — four modes, rolling accuracy tracking |
|
|
25
|
+
| `Inference::PredictiveCoding` | `lex-predictive-coding` | Hierarchical predictive coding with precision-weighted error |
|
|
26
|
+
| `Inference::PredictiveProcessing` | `lex-predictive-processing` | Unified perception/action loop |
|
|
27
|
+
| `Inference::FreeEnergy` | `lex-free-energy` | Friston Free Energy Principle — minimize prediction error |
|
|
28
|
+
| `Inference::Intuition` | `lex-intuition` | Fast heuristic-based inference |
|
|
29
|
+
| `Inference::Schema` | `lex-schema` | Organized knowledge structures — schema activation |
|
|
30
|
+
| `Inference::ExpectationViolation` | `lex-expectation-violation` | Surprise from violated predictions |
|
|
31
|
+
| `Inference::UncertaintyTolerance` | `lex-uncertainty-tolerance` | Tolerance for ambiguity and incomplete information |
|
|
32
|
+
| `Inference::RealityTesting` | `lex-reality-testing` | Tests whether beliefs match available evidence |
|
|
33
|
+
| `Inference::Affordance` | `lex-affordance` | Gibson affordance theory — action possibilities from environment |
|
|
34
|
+
| `Inference::EnactiveCognition` | `lex-enactive-cognition` | Varela/Maturana enactivism — sensorimotor loops as meaning |
|
|
35
|
+
| `Inference::PerceptualInference` | `lex-perceptual-inference` | Bayesian perception — sensory likelihoods + priors |
|
|
36
|
+
| `Inference::Coherence` | `lex-cognitive-coherence` | Belief coherence assessment and maintenance |
|
|
37
|
+
| `Inference::Debugging` | `lex-cognitive-debugging` | Systematic diagnosis of cognitive errors |
|
|
38
|
+
| `Inference::Horizon` | `lex-cognitive-horizon` | Reasoning boundary and scope management |
|
|
39
|
+
| `Inference::Gravity` | `lex-cognitive-gravity` | Attractor patterns in belief space |
|
|
40
|
+
| `Inference::Momentum` | `lex-cognitive-momentum` | Inference momentum — continuation bias in reasoning chains |
|
|
41
|
+
| `Inference::Magnet` | `lex-cognitive-magnet` | Magnetic pull of salient attractors |
|
|
42
|
+
|
|
43
|
+
## Actors
|
|
44
|
+
|
|
45
|
+
- `Inference::Affordance::Actors::Scan` — interval actor, scans for available affordances
|
|
46
|
+
- `Inference::Horizon::Actors::Adjust` — interval actor, adjusts reasoning horizon bounds
|
|
47
|
+
- `Inference::Prediction::Actors::ExpirePredictions` — runs every 300s, expires stale predictions
|
|
48
|
+
- `Inference::PredictiveCoding::Actors::Decay` — interval actor, decays precision weights
|
|
8
49
|
|
|
9
50
|
## Installation
|
|
10
51
|
|
|
11
52
|
```ruby
|
|
12
53
|
gem 'lex-agentic-inference'
|
|
13
54
|
```
|
|
55
|
+
|
|
56
|
+
## Development
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
bundle install
|
|
60
|
+
bundle exec rspec # 2286 examples, 0 failures
|
|
61
|
+
bundle exec rubocop # 0 offenses
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
MIT
|
|
@@ -17,6 +17,8 @@ module Legion
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def create_idea(content:, idea_type:, domain:, mass: DEFAULT_MASS)
|
|
20
|
+
return nil unless IDEA_TYPES.include?(idea_type)
|
|
21
|
+
|
|
20
22
|
evict_oldest if @ideas.size >= MAX_IDEAS
|
|
21
23
|
|
|
22
24
|
idea = Idea.new(content: content, idea_type: idea_type, domain: domain, mass: mass)
|
|
@@ -23,6 +23,18 @@ RSpec.describe Legion::Extensions::Agentic::Inference::Momentum::Helpers::Moment
|
|
|
23
23
|
engine.create_idea(content: 'overflow', idea_type: :belief, domain: :d)
|
|
24
24
|
expect(engine.to_h[:total_ideas]).to eq(max)
|
|
25
25
|
end
|
|
26
|
+
|
|
27
|
+
it 'rejects invalid idea_type' do
|
|
28
|
+
expect(engine.create_idea(content: 'bad', idea_type: :daydream, domain: :d)).to be_nil
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
it 'accepts all valid IDEA_TYPES' do
|
|
32
|
+
constants = Legion::Extensions::Agentic::Inference::Momentum::Helpers::Constants
|
|
33
|
+
constants::IDEA_TYPES.each do |itype|
|
|
34
|
+
result = engine.create_idea(content: "idea_#{itype}", idea_type: itype, domain: :d)
|
|
35
|
+
expect(result).not_to be_nil
|
|
36
|
+
end
|
|
37
|
+
end
|
|
26
38
|
end
|
|
27
39
|
|
|
28
40
|
describe '#reinforce_idea' do
|