lex-agentic-executive 0.1.5 → 0.1.7

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: cce9c8109ea22a2e4d9ecc71403cf6578a10aa6710c5b6f2ba01e67eda9402e4
4
- data.tar.gz: 57ad258cca2492402369ad50e4530914f46814af543b415f15f8912bc7e7b124
3
+ metadata.gz: 162085450c8aaeacfd84ced17da35c78b086d34d1ee9e4a0305a46784ac8d3ea
4
+ data.tar.gz: 8a8f9a4f5ffca47bbdcecd40fdc3b4616e3fc24bf0777458e0547a12317ad7df
5
5
  SHA512:
6
- metadata.gz: 2840c7a21271f2335c9006f3eb8139da82fa36f42b50836b89443bad01b36b1b6a80fb1504021d4199df4345131c7f6f6dc8e01b152d963069bd86a0a4d329a6
7
- data.tar.gz: d5d7fd7a3dbc97ed211bd2aad9c794ae0c705a534d269740add93aeeb5cbe009b303f22e5b0f071f174f324a6c26a1c06d4461fc910c16df5be03bbdcfc5f44b
6
+ metadata.gz: f06abb9d450194b60de1e128952885bdb712ada8d8dd3cffa2a1744590c86ee91130b2c6ddb950cd7d04dfeaf5af943d781cd1061fcceddfdb9f5ef399fbc3d7
7
+ data.tar.gz: fb613003c03d2f7a571731433f2f1b08bd45645ea6ac22d70637ed2f03567487c34c0e0d3b1f3bfc7d8c465785567195d2446d08ae22c53ca82ce023a6dd3f4c
data/CHANGELOG.md CHANGED
@@ -1,6 +1,17 @@
1
1
  # Changelog
2
2
 
3
- ## [Unreleased]
3
+ ## [0.1.7] - 2026-03-31
4
+
5
+ ### Added
6
+ - Proactive outreach evaluation in Volition `form_intentions`
7
+ - 4 trigger types: insight, check_in, milestone, curiosity
8
+ - Attachment style gating (avoidant suppresses proactive)
9
+ - Priority-based trigger selection
10
+
11
+ ## [0.1.6] - 2026-03-26
12
+
13
+ ### Changed
14
+ - fix remote_invocable? to use class method for local dispatch
4
15
 
5
16
  ## [0.1.5] - 2026-03-22
6
17
 
data/Gemfile CHANGED
@@ -3,3 +3,5 @@
3
3
  source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
+
7
+ gem 'rubocop-legion'
data/LICENSE CHANGED
@@ -1,21 +1,201 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Matthew Iverson
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2021 Esity
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
data/README.md CHANGED
@@ -51,7 +51,7 @@ gem 'lex-agentic-executive'
51
51
 
52
52
  ```bash
53
53
  bundle install
54
- bundle exec rspec # 2067 examples, 0 failures
54
+ bundle exec rspec # 2081 examples, 0 failures
55
55
  bundle exec rubocop # 0 offenses
56
56
  ```
57
57
 
@@ -33,6 +33,6 @@ Gem::Specification.new do |spec|
33
33
  spec.add_dependency 'legion-transport', '>= 1.3.9'
34
34
 
35
35
  spec.add_development_dependency 'rspec', '~> 3.13'
36
- spec.add_development_dependency 'rubocop', '~> 1.60'
37
- spec.add_development_dependency 'rubocop-rspec', '~> 2.26'
36
+ spec.add_development_dependency 'rubocop'
37
+ spec.add_development_dependency 'rubocop-rspec'
38
38
  end
@@ -40,7 +40,7 @@ module Legion
40
40
  [(0.6...0.8), :reliable],
41
41
  [(0.4...0.6), :approximate],
42
42
  [(0.2...0.4), :drifting],
43
- [(..0.2), :lost]
43
+ [..0.2, :lost]
44
44
  ].freeze
45
45
 
46
46
  # Declination severity labels
@@ -49,7 +49,7 @@ module Legion
49
49
  [(0.6...0.8), :significant],
50
50
  [(0.4...0.6), :moderate],
51
51
  [(0.2...0.4), :mild],
52
- [(..0.2), :negligible]
52
+ [..0.2, :negligible]
53
53
  ].freeze
54
54
 
55
55
  def self.label_for(table, value)
@@ -4,7 +4,7 @@ module Legion
4
4
  module Extensions
5
5
  module Agentic
6
6
  module Executive
7
- VERSION = '0.1.5'
7
+ VERSION = '0.1.7'
8
8
  end
9
9
  end
10
10
  end
@@ -42,6 +42,15 @@ module Legion
42
42
 
43
43
  # Intention states
44
44
  STATES = %i[active suspended completed expired].freeze
45
+
46
+ # Proactive outreach triggers
47
+ PROACTIVE_TRIGGERS = %i[insight check_in milestone curiosity].freeze
48
+
49
+ # Priority ordering for trigger selection (lower = higher priority)
50
+ PRIORITY_ORDER = { critical: 0, urgent: 1, normal: 2, low: 3, ambient: 4 }.freeze
51
+
52
+ # Intent type for proactive outreach
53
+ PROACTIVE_INTENT_TYPE = :proactive_outreach
45
54
  end
46
55
  end
47
56
  end
@@ -10,7 +10,7 @@ module Legion
10
10
  include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
11
  Legion::Extensions::Helpers.const_defined?(:Lex)
12
12
 
13
- def form_intentions(tick_results: {}, cognitive_state: {}, **)
13
+ def form_intentions(tick_results: {}, cognitive_state: {}, bond_state: {}, **)
14
14
  drives = Helpers::DriveSynthesizer.synthesize(
15
15
  tick_results: tick_results,
16
16
  cognitive_state: cognitive_state
@@ -26,17 +26,19 @@ module Legion
26
26
  expired = intention_stack.decay_all
27
27
  dominant = Helpers::DriveSynthesizer.dominant_drive(drives)
28
28
  current = intention_stack.top
29
+ proactive = evaluate_proactive_outreach(tick_results, bond_state)
29
30
 
30
- Legion::Logging.debug "[volition] drives=#{format_drives(drives)} pushed=#{pushed} expired=#{expired} " \
31
- "active=#{intention_stack.active_count} top=#{current&.dig(:goal)}"
31
+ log.debug "[volition] drives=#{format_drives(drives)} pushed=#{pushed} expired=#{expired} " \
32
+ "active=#{intention_stack.active_count} top=#{current&.dig(:goal)}"
32
33
 
33
34
  {
34
- drives: drives,
35
- dominant_drive: dominant,
36
- new_intentions: pushed,
37
- expired: expired,
38
- active_intentions: intention_stack.active_count,
39
- current_intention: format_intention(current)
35
+ drives: drives,
36
+ dominant_drive: dominant,
37
+ new_intentions: pushed,
38
+ expired: expired,
39
+ active_intentions: intention_stack.active_count,
40
+ current_intention: format_intention(current),
41
+ proactive_outreach: proactive
40
42
  }
41
43
  end
42
44
 
@@ -55,19 +57,19 @@ module Legion
55
57
 
56
58
  def complete_intention(intention_id:, **)
57
59
  result = intention_stack.complete(intention_id)
58
- Legion::Logging.info "[volition] complete intention=#{intention_id} result=#{result}"
60
+ log.info "[volition] complete intention=#{intention_id} result=#{result}"
59
61
  { status: result, intention_id: intention_id }
60
62
  end
61
63
 
62
64
  def suspend_intention(intention_id:, **)
63
65
  result = intention_stack.suspend(intention_id)
64
- Legion::Logging.info "[volition] suspend intention=#{intention_id} result=#{result}"
66
+ log.info "[volition] suspend intention=#{intention_id} result=#{result}"
65
67
  { status: result, intention_id: intention_id }
66
68
  end
67
69
 
68
70
  def resume_intention(intention_id:, **)
69
71
  result = intention_stack.resume(intention_id)
70
- Legion::Logging.info "[volition] resume intention=#{intention_id} result=#{result}"
72
+ log.info "[volition] resume intention=#{intention_id} result=#{result}"
71
73
  { status: result, intention_id: intention_id }
72
74
  end
73
75
 
@@ -95,8 +97,8 @@ module Legion
95
97
  )
96
98
 
97
99
  result = intention_stack.push(intention)
98
- Legion::Logging.info "[volition] absorption intention formed: domains=#{domains.join(',')} " \
99
- "neighbors=#{neighbors.size} salience=#{salience.round(2)} result=#{result}"
100
+ log.info "[volition] absorption intention formed: domains=#{domains.join(',')} " \
101
+ "neighbors=#{neighbors.size} salience=#{salience.round(2)} result=#{result}"
100
102
 
101
103
  {
102
104
  success: %i[pushed duplicate].include?(result),
@@ -152,6 +154,40 @@ module Legion
152
154
  def format_drives(drives)
153
155
  drives.map { |k, v| "#{k}=#{v.round(2)}" }.join(' ')
154
156
  end
157
+
158
+ def evaluate_proactive_outreach(tick_results, bond_state)
159
+ return nil unless bond_state.is_a?(Hash) && bond_state[:partner_bond]
160
+
161
+ partner = bond_state[:partner_bond]
162
+ return nil if partner[:style] == :avoidant
163
+
164
+ triggers = collect_proactive_triggers(tick_results, partner)
165
+ return nil if triggers.empty?
166
+
167
+ best = triggers.min_by { |t| Helpers::Constants::PRIORITY_ORDER.fetch(t[:priority], 99) }
168
+ { type: Helpers::Constants::PROACTIVE_INTENT_TYPE, trigger: best, all_triggers: triggers }
169
+ end
170
+
171
+ def collect_proactive_triggers(tick_results, partner)
172
+ triggers = []
173
+
174
+ insight = tick_results.dig(:dream_reflection, :insight)
175
+ triggers << { reason: :insight, content: insight, priority: :low } if insight.is_a?(String) && insight.length > 50
176
+
177
+ triggers << { reason: :check_in, content: nil, priority: :normal } if partner[:absence_exceeds_pattern]
178
+
179
+ (partner[:milestones_today] || []).each do |ms|
180
+ desc = ms.is_a?(Hash) ? (ms[:description] || ms['description']) : ms.to_s
181
+ triggers << { reason: :milestone, content: desc, priority: :low }
182
+ end
183
+
184
+ agenda = tick_results.dig(:agenda_formation, :agenda) || []
185
+ agenda.select { |a| a[:domain] == :partner }.each do |item|
186
+ triggers << { reason: :curiosity, content: item[:question], priority: :low }
187
+ end
188
+
189
+ triggers
190
+ end
155
191
  end
156
192
  end
157
193
  end
@@ -31,7 +31,7 @@ module Legion
31
31
  module Executive
32
32
  extend Legion::Extensions::Core if Legion::Extensions.const_defined? :Core
33
33
 
34
- def remote_invocable?
34
+ def self.remote_invocable?
35
35
  false
36
36
  end
37
37
  end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe Legion::Extensions::Agentic::Executive::Volition::Helpers::Constants do
6
+ describe 'proactive constants' do
7
+ it 'defines PROACTIVE_TRIGGERS' do
8
+ expect(described_class::PROACTIVE_TRIGGERS).to include(:insight, :check_in, :milestone, :curiosity)
9
+ end
10
+
11
+ it 'defines PRIORITY_ORDER' do
12
+ expect(described_class::PRIORITY_ORDER).to be_a(Hash)
13
+ expect(described_class::PRIORITY_ORDER[:normal]).to be < described_class::PRIORITY_ORDER[:low]
14
+ end
15
+
16
+ it 'defines PROACTIVE_INTENT_TYPE' do
17
+ expect(described_class::PROACTIVE_INTENT_TYPE).to eq(:proactive_outreach)
18
+ end
19
+ end
20
+ end
@@ -133,6 +133,107 @@ RSpec.describe Legion::Extensions::Agentic::Executive::Volition::Runners::Voliti
133
133
  end
134
134
  end
135
135
 
136
+ describe '#form_intentions with proactive evaluation' do
137
+ let(:bond_state) do
138
+ {
139
+ partner_bond: {
140
+ stage: :established,
141
+ strength: 0.72,
142
+ style: :secure,
143
+ health: 0.85,
144
+ milestones_today: [],
145
+ narrative: nil
146
+ }
147
+ }
148
+ end
149
+
150
+ context 'when bond_state has partner bond' do
151
+ it 'includes proactive_outreach in result' do
152
+ result = client.form_intentions(tick_results: {}, bond_state: bond_state)
153
+ expect(result).to have_key(:proactive_outreach)
154
+ end
155
+
156
+ it 'returns nil proactive when no triggers fire' do
157
+ result = client.form_intentions(tick_results: {}, bond_state: bond_state)
158
+ expect(result[:proactive_outreach]).to be_nil
159
+ end
160
+ end
161
+
162
+ context 'when dream reflection has an insight' do
163
+ let(:tick_results) do
164
+ { dream_reflection: { insight: 'Discovered an interesting pattern in partner interaction frequency that suggests weekly review cycles.' } }
165
+ end
166
+
167
+ it 'generates insight trigger' do
168
+ result = client.form_intentions(tick_results: tick_results, bond_state: bond_state)
169
+ outreach = result[:proactive_outreach]
170
+ expect(outreach).not_to be_nil
171
+ expect(outreach[:trigger][:reason]).to eq(:insight)
172
+ end
173
+ end
174
+
175
+ context 'when partner absence exceeds pattern' do
176
+ let(:bond_state_absent) do
177
+ bond_state.merge(partner_bond: bond_state[:partner_bond].merge(absence_exceeds_pattern: true))
178
+ end
179
+
180
+ it 'generates check_in trigger' do
181
+ result = client.form_intentions(tick_results: {}, bond_state: bond_state_absent)
182
+ outreach = result[:proactive_outreach]
183
+ expect(outreach).not_to be_nil
184
+ expect(outreach[:trigger][:reason]).to eq(:check_in)
185
+ end
186
+ end
187
+
188
+ context 'when milestones exist today' do
189
+ let(:bond_state_milestone) do
190
+ ms = { description: 'Bond stage reached established', type: :stage_transition }
191
+ bond_state.merge(partner_bond: bond_state[:partner_bond].merge(milestones_today: [ms]))
192
+ end
193
+
194
+ it 'generates milestone trigger' do
195
+ result = client.form_intentions(tick_results: {}, bond_state: bond_state_milestone)
196
+ outreach = result[:proactive_outreach]
197
+ expect(outreach).not_to be_nil
198
+ expect(outreach[:trigger][:reason]).to eq(:milestone)
199
+ end
200
+ end
201
+
202
+ context 'when agenda has partner items' do
203
+ let(:tick_results) do
204
+ { agenda_formation: { agenda: [{ domain: :partner, question: 'How is the project going?' }] } }
205
+ end
206
+
207
+ it 'generates curiosity trigger' do
208
+ result = client.form_intentions(tick_results: tick_results, bond_state: bond_state)
209
+ outreach = result[:proactive_outreach]
210
+ expect(outreach).not_to be_nil
211
+ expect(outreach[:trigger][:reason]).to eq(:curiosity)
212
+ end
213
+ end
214
+
215
+ context 'when bond_state is empty' do
216
+ it 'returns nil proactive' do
217
+ result = client.form_intentions(tick_results: {}, bond_state: {})
218
+ expect(result[:proactive_outreach]).to be_nil
219
+ end
220
+ end
221
+
222
+ context 'when attachment style is avoidant' do
223
+ let(:bond_state_avoidant) do
224
+ bond_state.merge(partner_bond: bond_state[:partner_bond].merge(
225
+ style: :avoidant,
226
+ absence_exceeds_pattern: true
227
+ ))
228
+ end
229
+
230
+ it 'suppresses proactive outreach' do
231
+ result = client.form_intentions(tick_results: {}, bond_state: bond_state_avoidant)
232
+ expect(result[:proactive_outreach]).to be_nil
233
+ end
234
+ end
235
+ end
236
+
136
237
  describe '#form_absorption_intention' do
137
238
  it 'returns success false when no domains provided' do
138
239
  result = client.form_absorption_intention(domains_at_risk: [])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-agentic-executive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity
@@ -125,30 +125,30 @@ dependencies:
125
125
  name: rubocop
126
126
  requirement: !ruby/object:Gem::Requirement
127
127
  requirements:
128
- - - "~>"
128
+ - - ">="
129
129
  - !ruby/object:Gem::Version
130
- version: '1.60'
130
+ version: '0'
131
131
  type: :development
132
132
  prerelease: false
133
133
  version_requirements: !ruby/object:Gem::Requirement
134
134
  requirements:
135
- - - "~>"
135
+ - - ">="
136
136
  - !ruby/object:Gem::Version
137
- version: '1.60'
137
+ version: '0'
138
138
  - !ruby/object:Gem::Dependency
139
139
  name: rubocop-rspec
140
140
  requirement: !ruby/object:Gem::Requirement
141
141
  requirements:
142
- - - "~>"
142
+ - - ">="
143
143
  - !ruby/object:Gem::Version
144
- version: '2.26'
144
+ version: '0'
145
145
  type: :development
146
146
  prerelease: false
147
147
  version_requirements: !ruby/object:Gem::Requirement
148
148
  requirements:
149
- - - "~>"
149
+ - - ">="
150
150
  - !ruby/object:Gem::Version
151
- version: '2.26'
151
+ version: '0'
152
152
  description: 'LEX agentic executive domain: planning, working memory, cognitive control'
153
153
  email:
154
154
  - matthewdiverson@gmail.com
@@ -440,6 +440,7 @@ files:
440
440
  - spec/legion/extensions/agentic/executive/triage/helpers/triage_engine_spec.rb
441
441
  - spec/legion/extensions/agentic/executive/triage/runners_spec.rb
442
442
  - spec/legion/extensions/agentic/executive/volition/client_spec.rb
443
+ - spec/legion/extensions/agentic/executive/volition/helpers/constants_spec.rb
443
444
  - spec/legion/extensions/agentic/executive/volition/helpers/drive_synthesizer_spec.rb
444
445
  - spec/legion/extensions/agentic/executive/volition/helpers/intention_spec.rb
445
446
  - spec/legion/extensions/agentic/executive/volition/helpers/intention_stack_spec.rb