robot_lab-cyborg 0.2.7 → 0.2.8
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/.envrc +6 -0
- data/CHANGELOG.md +4 -0
- data/Rakefile +0 -1
- data/_typos.toml +7 -0
- data/lib/robot_lab/cyborg/channel.rb +2 -0
- data/lib/robot_lab/cyborg/conversation.rb +2 -0
- data/lib/robot_lab/cyborg/interviewer.rb +2 -0
- data/lib/robot_lab/cyborg/version.rb +1 -1
- data/lib/robot_lab/cyborg.rb +22 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 19b6539c5fe90feaed90c3e1d06f0124f6f6c29d053d67f4bb04e217d04420d1
|
|
4
|
+
data.tar.gz: b6d43f26ccd0d8b8a210f17c5236caaf60b136c1a192d24c8338f5c769e74761
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3be112aedc248e8c29b68926013e69cc3841512a3ecd43bc22a132a4cdd8d84a8a1a593f702c052c6ff26978a97d64b5626406e11b46677422768cfb708dabe2
|
|
7
|
+
data.tar.gz: 941f2990dcaa5ca1df929448b937fb545f543cbd0879cfe8b019c3fac2154490dd14e2deaa540db907eea4f8d77623aae1b2dda2931c317915165282396c70f0
|
data/.envrc
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.8] - 2026-09-09
|
|
11
|
+
|
|
12
|
+
Released in lockstep with `robot_lab` core v0.2.8: this gem now resolves the released core gem from RubyGems instead of the local sibling checkout (local-path development remains available via `BUNDLE_GEMFILE=Gemfile.local`). Also in this release: 17 reek false positives annotated inline, reek added to the development bundle, gem lifecycle tasks moved to asgard, and the release `Gemfile` no longer overrides `robot_lab` with the local checkout.
|
|
13
|
+
|
|
10
14
|
### Fixed (from the design/architecture review)
|
|
11
15
|
- **Consumer no longer wedges on a handler error.** An exception in an
|
|
12
16
|
`on_initiative`/channel path used to kill the Interviewer's consumer thread and
|
data/Rakefile
CHANGED
data/_typos.toml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# False-positive suppressions for the typos quality gate (asgard).
|
|
2
|
+
# Everything here was reviewed by hand — see git history for context.
|
|
3
|
+
|
|
4
|
+
[default.extend-identifiers]
|
|
5
|
+
# Docs and comments hyphenate "mis-attributed"/"mis-attribution"; typos
|
|
6
|
+
# tokenizes the prefix alone and flags it.
|
|
7
|
+
mis = "mis"
|
|
@@ -19,6 +19,8 @@ module RobotLab
|
|
|
19
19
|
# @!attribute kind [Symbol] :question | :answer | :message | :notice
|
|
20
20
|
# @!attribute at [Time] when the message was created
|
|
21
21
|
ChannelMessage = Data.define(:id, :content, :in_reply_to, :sender, :kind, :at) do
|
|
22
|
+
# :reek:ControlParameter -- nil at means "stamp with Time.now"; a default,
|
|
23
|
+
# not a behavior switch.
|
|
22
24
|
def initialize(content:, id: nil, in_reply_to: nil, sender: nil, kind: :message, at: nil)
|
|
23
25
|
super(id:, content: content.to_s, in_reply_to:, sender:, kind:, at: at || Time.now)
|
|
24
26
|
end
|
|
@@ -62,6 +62,8 @@ module RobotLab
|
|
|
62
62
|
#
|
|
63
63
|
# @param line [String]
|
|
64
64
|
# @return [Array<String>] the peers the message was sent to
|
|
65
|
+
# :reek:FeatureEnvy -- parsing the human's raw line (strip/scan for
|
|
66
|
+
# mentions) is this router's whole job; the String has no better home.
|
|
65
67
|
def route(line)
|
|
66
68
|
line = line.to_s.strip
|
|
67
69
|
return [] if line.empty?
|
|
@@ -155,6 +155,8 @@ module RobotLab
|
|
|
155
155
|
end
|
|
156
156
|
|
|
157
157
|
# If +id+ was the active question, clear it and deliver the next queued one.
|
|
158
|
+
# :reek:ControlParameter -- id is correlation data compared against
|
|
159
|
+
# @active_id to decide whether this question held the wire; not a mode flag.
|
|
158
160
|
def release_active(id)
|
|
159
161
|
advanced = @mutex.synchronize do
|
|
160
162
|
next false unless @active_id == id
|
data/lib/robot_lab/cyborg.rb
CHANGED
|
@@ -36,6 +36,11 @@ module RobotLab
|
|
|
36
36
|
# analyst.send_message(to: :dewayne, content: "Approve deploy? (yes/no)")
|
|
37
37
|
# # dewayne's human is prompted; the answer is sent back as a reply
|
|
38
38
|
#
|
|
39
|
+
# :reek:TooManyInstanceVariables :reek:TooManyMethods -- a Cyborg is a full
|
|
40
|
+
# network peer: it must carry the ivars the BusMessaging mixin expects plus
|
|
41
|
+
# its own channel/interviewer/presence state, and mirror Robot's member
|
|
42
|
+
# surface (run/call/delegate/remember/recall) so humans and robots are
|
|
43
|
+
# interchangeable.
|
|
39
44
|
class Cyborg
|
|
40
45
|
include RobotLab::Robot::BusMessaging
|
|
41
46
|
|
|
@@ -72,6 +77,10 @@ module RobotLab
|
|
|
72
77
|
# @param memory [RobotLab::Memory, nil] standalone memory (default: fresh)
|
|
73
78
|
# @param ask_timeout [Numeric, nil] seconds to wait for the human before
|
|
74
79
|
# giving up on an answer (nil = wait indefinitely)
|
|
80
|
+
# :reek:BooleanParameter -- auto_reply is a stored config flag, read later
|
|
81
|
+
# by the bus handlers, not a mode switch inside this method.
|
|
82
|
+
# :reek:ControlParameter -- nil memory/channel/interviewer mean "build the
|
|
83
|
+
# default"; each `||` is a fallback, not a behavior switch.
|
|
75
84
|
def initialize(name:, bus: nil, channel: nil, interviewer: nil,
|
|
76
85
|
auto_reply: true, memory: nil, ask_timeout: nil)
|
|
77
86
|
@name = name.to_s
|
|
@@ -136,6 +145,8 @@ module RobotLab
|
|
|
136
145
|
# @param network_memory [RobotLab::Memory, nil] shared memory when in a network
|
|
137
146
|
# @param memory [RobotLab::Memory, nil] explicit memory override
|
|
138
147
|
# @return [RobotResult]
|
|
148
|
+
# :reek:ControlParameter -- nil memory/network_memory fall back to this
|
|
149
|
+
# peer's own memory; defaults, not behavior switches.
|
|
139
150
|
def run(message = nil, network_memory: nil, memory: nil, **_kwargs)
|
|
140
151
|
active = memory || network_memory || @memory
|
|
141
152
|
attach_memory(network_memory) if network_memory
|
|
@@ -159,6 +170,10 @@ module RobotLab
|
|
|
159
170
|
# answer is acceptable, or nil to reject and re-ask
|
|
160
171
|
# @param retries [Integer] extra attempts allowed when validation rejects
|
|
161
172
|
# @return [Object, nil] the human's answer (coerced when validated)
|
|
173
|
+
# :reek:LongParameterList { max_params: 6 } -- one keyword per aspect of a
|
|
174
|
+
# question (choices/default/timeout/validation/retries).
|
|
175
|
+
# :reek:TooManyStatements -- the ask/validate/re-ask retry loop, one step
|
|
176
|
+
# per line; flog gates its real complexity.
|
|
162
177
|
def ask(question, choices: nil, default: nil, timeout: @ask_timeout, validate: nil, retries: 2)
|
|
163
178
|
attempt = 0
|
|
164
179
|
loop do
|
|
@@ -315,6 +330,9 @@ module RobotLab
|
|
|
315
330
|
# @param task [String] the task message
|
|
316
331
|
# @param async [Boolean] when true, returns a DelegationFuture immediately
|
|
317
332
|
# @return [RobotResult, DelegationFuture]
|
|
333
|
+
# :reek:BooleanParameter :reek:ControlParameter :reek:TooManyStatements --
|
|
334
|
+
# mirrors Robot#delegate's API and shape exactly: async picks the
|
|
335
|
+
# future-vs-sync return, and the two branches are the whole method.
|
|
318
336
|
def delegate(to:, task:, async: false, **)
|
|
319
337
|
if async
|
|
320
338
|
future = DelegationFuture.new(robot_name: to.name, delegated_by: @name)
|
|
@@ -353,6 +371,8 @@ module RobotLab
|
|
|
353
371
|
# @param key [Object]
|
|
354
372
|
# @param wait [Boolean, Numeric] false, true, or seconds to wait
|
|
355
373
|
# @return [Object, nil]
|
|
374
|
+
# :reek:BooleanParameter -- wait is forwarded verbatim to Memory#get, whose
|
|
375
|
+
# API it belongs to.
|
|
356
376
|
def recall(key, wait: false)
|
|
357
377
|
current_memory.get(key, wait: wait)
|
|
358
378
|
end
|
|
@@ -407,6 +427,8 @@ module RobotLab
|
|
|
407
427
|
|
|
408
428
|
# Run the block with +memory+'s current writer set to this peer, restoring it
|
|
409
429
|
# afterward. A no-op for memories that don't track a writer.
|
|
430
|
+
# :reek:FeatureEnvy -- save/set/restore of the writer on whichever memory is
|
|
431
|
+
# active for this run; the bookkeeping is the wrapper's job, not Memory's.
|
|
410
432
|
def with_writer(memory)
|
|
411
433
|
return yield unless memory.respond_to?(:current_writer=)
|
|
412
434
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: robot_lab-cyborg
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dewayne VanHoozer
|
|
@@ -45,6 +45,7 @@ files:
|
|
|
45
45
|
- LICENSE.txt
|
|
46
46
|
- README.md
|
|
47
47
|
- Rakefile
|
|
48
|
+
- _typos.toml
|
|
48
49
|
- docs/api_reference.md
|
|
49
50
|
- docs/custom_channels.md
|
|
50
51
|
- docs/getting_started.md
|
|
@@ -84,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
84
85
|
- !ruby/object:Gem::Version
|
|
85
86
|
version: '0'
|
|
86
87
|
requirements: []
|
|
87
|
-
rubygems_version: 4.0.
|
|
88
|
+
rubygems_version: 4.0.20
|
|
88
89
|
specification_version: 4
|
|
89
90
|
summary: Cyborg extension for the RobotLab multi-robot LLM orchestration framework.
|
|
90
91
|
test_files: []
|