rubik 0.8.0 → 0.8.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/ATTRIBUTION.md +1 -1
- data/CHANGELOG.md +65 -1
- data/lib/rubik/kernel/dispatcher.rb +19 -23
- data/lib/rubik/kernel/init.rb +22 -18
- data/lib/rubik/orchestrator/goal_ledger/ledger.rb +3 -9
- data/lib/rubik/orchestrator/goal_ledger/observation_projection.rb +3 -9
- data/lib/rubik/orchestrator/subagent/deferred_spec.rb +51 -2
- data/lib/rubik/orchestrator/subagent/dependency.rb +20 -20
- data/lib/rubik/orchestrator/subagent/execution_reads.rb +1 -1
- data/lib/rubik/orchestrator/subagent/journal.rb +3 -9
- data/lib/rubik/orchestrator/subagent/lifecycle.rb +10 -1
- data/lib/rubik/orchestrator/subagent/paging.rb +49 -0
- data/lib/rubik/orchestrator/subagent/reaper.rb +1 -3
- data/lib/rubik/orchestrator/subagent/redeploy_transaction.rb +99 -0
- data/lib/rubik/orchestrator/subagent/result_archive.rb +12 -22
- data/lib/rubik/orchestrator/subagent/reuse.rb +37 -31
- data/lib/rubik/orchestrator/subagent/spawn_transaction.rb +1 -1
- data/lib/rubik/orchestrator/subagent/supervisor.rb +6 -2
- data/lib/rubik/orchestrator/subagent/task_ownership.rb +2 -2
- data/lib/rubik/orchestrator/subagent/transcript_reader.rb +14 -13
- data/lib/rubik/repl/commands/subagents.rb +3 -2
- data/lib/rubik/repl/pruner/service.rb +4 -9
- data/lib/rubik/runtime/context.rb +6 -1
- data/lib/rubik/runtime/fiber.rb +17 -5
- data/lib/rubik/runtime/manager.rb +19 -12
- data/lib/rubik/storage/layout.rb +14 -3
- data/lib/rubik/tools/base.rb +31 -0
- data/lib/rubik/tools/builtins/dmesg.rb +1 -1
- data/lib/rubik/tools/builtins/exec.rb +1 -2
- data/lib/rubik/tools/builtins/files.rb +1 -1
- data/lib/rubik/tools/builtins/goal_ledger.rb +1 -1
- data/lib/rubik/tools/builtins/grep.rb +2 -2
- data/lib/rubik/tools/builtins/interactive.rb +1 -3
- data/lib/rubik/tools/builtins/lsp.rb +2 -2
- data/lib/rubik/tools/builtins/pruner.rb +1 -1
- data/lib/rubik/tools/builtins/runtime.rb +1 -1
- data/lib/rubik/tools/builtins/send_message.rb +14 -3
- data/lib/rubik/tools/builtins/skill.rb +1 -1
- data/lib/rubik/tools/builtins/storage.rb +1 -1
- data/lib/rubik/tools/builtins/subagent.rb +2 -1
- data/lib/rubik/tools/builtins/subagent_lifecycle.rb +5 -3
- data/lib/rubik/tools/builtins/symbols.rb +4 -4
- data/lib/rubik/tools/builtins/task.rb +1 -1
- data/lib/rubik/tools/builtins/vakanuvis.rb +1 -1
- data/lib/rubik/version.rb +1 -1
- metadata +3 -1
|
@@ -88,9 +88,7 @@ module Rubik
|
|
|
88
88
|
# a subagent child context (ScopedRegistry rebind); the root-context
|
|
89
89
|
# instance stays nil here and keeps the human-dialog behavior.
|
|
90
90
|
def init0_asker
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
Rubik::Coeffects.get(@runtime_context, Rubik::Coeffects::SUBAGENT_QUESTION_ASKER)
|
|
91
|
+
service(:subagent_question_asker)
|
|
94
92
|
end
|
|
95
93
|
|
|
96
94
|
# One blocking round-trip for the whole batch: the maestro answers once and
|
|
@@ -20,11 +20,11 @@ module Rubik
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def effective_lsp_manager
|
|
23
|
-
|
|
23
|
+
service(:lsp_manager, @lsp_manager)
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def effective_buffer_manager
|
|
27
|
-
|
|
27
|
+
service(:buffer_manager, @buffer_manager)
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
private
|
|
@@ -49,7 +49,7 @@ module Rubik
|
|
|
49
49
|
|
|
50
50
|
def execute(args = {})
|
|
51
51
|
action = (args["action"] || args[:action] || "status").to_s
|
|
52
|
-
harness =
|
|
52
|
+
harness = service(:pruner, @harness)
|
|
53
53
|
unless harness
|
|
54
54
|
return ToolOutput.error("Context pruner is not available: disabled by config " \
|
|
55
55
|
"(subagents.pruner.enabled=false) or the harness is not wired " \
|
|
@@ -63,7 +63,7 @@ module Rubik
|
|
|
63
63
|
cmds.sort.each { |name, meta| lines << " !#{name.ljust(16)} : #{meta[:description]}" }
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
-
task_mgr = (
|
|
66
|
+
task_mgr = service(:task_manager)
|
|
67
67
|
task_mgr ||= @shell.task_manager if @shell.respond_to?(:task_manager)
|
|
68
68
|
|
|
69
69
|
if ["all", "tasks"].include?(target) && task_mgr
|
|
@@ -72,6 +72,19 @@ module Rubik
|
|
|
72
72
|
return delivery_text(recipient) if delivered == true
|
|
73
73
|
return queued_text(recipient, steps) if delivered == :queued
|
|
74
74
|
|
|
75
|
+
# A dependency-queued (or launching) spec exists but has never run:
|
|
76
|
+
# "not found" is false, and the redeploy suggestion below would
|
|
77
|
+
# refuse the same id — the model needs the truthful next action.
|
|
78
|
+
if sup.respond_to?(:get) && (spec = sup.get(recipient)) && spec.respond_to?(:queued?) &&
|
|
79
|
+
(spec.queued? || spec.spawning?)
|
|
80
|
+
return ToolOutput.error(
|
|
81
|
+
"Subagent '#{recipient}' is dependency-queued (deps: #{spec.depends_on.join(', ')}) and will " \
|
|
82
|
+
"launch automatically when its predecessors settle. Messages cannot be buffered on an unborn " \
|
|
83
|
+
"spec — re-send after it launches, or kill it with manage_subagents(action: 'kill', " \
|
|
84
|
+
"conversation_id: '#{recipient}') if the wait is no longer worth it."
|
|
85
|
+
)
|
|
86
|
+
end
|
|
87
|
+
|
|
75
88
|
ToolOutput.error(
|
|
76
89
|
"Subagent '#{recipient}' not found or no longer active. If it recently finished, redeploy it with its " \
|
|
77
90
|
"context intact: manage_subagents(action: 'redeploy', conversation_id: '#{recipient}', prompt: '<task>') " \
|
|
@@ -84,9 +97,7 @@ module Rubik
|
|
|
84
97
|
# Subagent düzlemi (rebound araç): gönderen coeffect'i GERÇEK subagent
|
|
85
98
|
# id'sidir. Kök düzleminde sağlanmaz → Supervisor default'u kalır.
|
|
86
99
|
def subagent_sender_id
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
Rubik::Coeffects.get(@runtime_context, Rubik::Coeffects::SUBAGENT_SENDER_ID)
|
|
100
|
+
service(:subagent_sender_id)
|
|
90
101
|
end
|
|
91
102
|
|
|
92
103
|
# Kök alias'ına giden mesajın yanıtı kök kişisiyle konuşur ("the
|
|
@@ -45,7 +45,7 @@ module Rubik
|
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
def execute(args = {})
|
|
48
|
-
manager =
|
|
48
|
+
manager = service(:skill_manager, @manager)
|
|
49
49
|
return ToolOutput.error("Error: skills manager is not available.") unless manager
|
|
50
50
|
return ToolOutput.error("Error: skills are disabled (skills.enabled = false).") unless manager.enabled?
|
|
51
51
|
|
|
@@ -102,7 +102,7 @@ module Rubik
|
|
|
102
102
|
# STORAGE_STORE coeffect'i (parent chain — subagent'lar buradan çözer)
|
|
103
103
|
# → config'e dayalı tembel fresh default (storage kapalıysa nil).
|
|
104
104
|
def resolve_store
|
|
105
|
-
resolved =
|
|
105
|
+
resolved = service(:storage_store, @store)
|
|
106
106
|
return resolved if resolved
|
|
107
107
|
|
|
108
108
|
@resolve_store ||= Rubik::Storage::Service.build(config: @config, root_dir: @root_dir)
|
|
@@ -16,6 +16,7 @@ module Rubik
|
|
|
16
16
|
module SubagentToolHelpers
|
|
17
17
|
def resolve_supervisor(supervisor, runtime_context)
|
|
18
18
|
return supervisor if supervisor
|
|
19
|
+
return service(:subagent_supervisor, ctx: runtime_context) if respond_to?(:service)
|
|
19
20
|
return nil unless runtime_context.respond_to?(:get)
|
|
20
21
|
|
|
21
22
|
Rubik::Coeffects.get(runtime_context, Rubik::Coeffects::SUBAGENT_SUPERVISOR)
|
|
@@ -99,7 +100,7 @@ module Rubik
|
|
|
99
100
|
# Task ownership (issue #125): the spawning context's token owns the new
|
|
100
101
|
# work (detached specs opt out per spec). Resolved at call time, so a
|
|
101
102
|
# nested subagent inherits its ancestor's task through its child ctx.
|
|
102
|
-
owner =
|
|
103
|
+
owner = service(:task_cancellation)
|
|
103
104
|
|
|
104
105
|
begin
|
|
105
106
|
results = sup.spawn_batch(specs, owner: owner)
|
|
@@ -113,8 +113,10 @@ module Rubik
|
|
|
113
113
|
|
|
114
114
|
# Blocked states that need maestro action before their chain proceeds
|
|
115
115
|
# (bug-llm-timeout-observability ④): a bare JSON list made a stalled
|
|
116
|
-
# subagent indistinguishable from a healthy one at a glance.
|
|
117
|
-
|
|
116
|
+
# subagent indistinguishable from a healthy one at a glance. The set
|
|
117
|
+
# itself is owned by Lifecycle (ATTENTION_STATES beside TRANSITIONS) —
|
|
118
|
+
# this file used to hand-copy it.
|
|
119
|
+
def attention_states = Rubik::Orchestrator::Subagent::Lifecycle::ATTENTION_STATES
|
|
118
120
|
|
|
119
121
|
# List with a prominent attention block: any blocked subagent is called
|
|
120
122
|
# out ABOVE the JSON with its state, last error, and the exact recovery
|
|
@@ -124,7 +126,7 @@ module Rubik
|
|
|
124
126
|
return "No active or tracked subagents." if instances.empty?
|
|
125
127
|
|
|
126
128
|
lines = []
|
|
127
|
-
attention = instances.select { |i|
|
|
129
|
+
attention = instances.select { |i| attention_states.include?(i.state.to_sym) }
|
|
128
130
|
if attention.any?
|
|
129
131
|
lines << "⚠ #{attention.size} subagent(s) need attention:"
|
|
130
132
|
attention.each do |i|
|
|
@@ -30,7 +30,7 @@ module Rubik
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
def ast_graph
|
|
33
|
-
|
|
33
|
+
service(:ast_graph, @ast_graph)
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
def execute(args = {})
|
|
@@ -96,7 +96,7 @@ module Rubik
|
|
|
96
96
|
end
|
|
97
97
|
|
|
98
98
|
def ast_graph
|
|
99
|
-
|
|
99
|
+
service(:ast_graph, @ast_graph)
|
|
100
100
|
end
|
|
101
101
|
|
|
102
102
|
def execute(args = {})
|
|
@@ -146,7 +146,7 @@ module Rubik
|
|
|
146
146
|
end
|
|
147
147
|
|
|
148
148
|
def ast_graph
|
|
149
|
-
|
|
149
|
+
service(:ast_graph, @ast_graph)
|
|
150
150
|
end
|
|
151
151
|
|
|
152
152
|
def execute(args = {})
|
|
@@ -201,7 +201,7 @@ module Rubik
|
|
|
201
201
|
end
|
|
202
202
|
|
|
203
203
|
def ast_graph
|
|
204
|
-
|
|
204
|
+
service(:ast_graph, @ast_graph)
|
|
205
205
|
end
|
|
206
206
|
|
|
207
207
|
def execute(args = {})
|
|
@@ -75,7 +75,7 @@ module Rubik
|
|
|
75
75
|
|
|
76
76
|
def execute(args = {})
|
|
77
77
|
action = (args["action"] || args[:action] || "recall").to_s
|
|
78
|
-
harness =
|
|
78
|
+
harness = service(:vakanuvis, @harness)
|
|
79
79
|
unless harness
|
|
80
80
|
return ToolOutput.error("Vakanüvis chronicler is not available: disabled by config " \
|
|
81
81
|
"(subagents.vakanuvis.enabled=false) or no store wired.")
|
data/lib/rubik/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubik
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Özgür Ulukır
|
|
@@ -382,10 +382,12 @@ files:
|
|
|
382
382
|
- lib/rubik/orchestrator/subagent/narration.rb
|
|
383
383
|
- lib/rubik/orchestrator/subagent/notices.rb
|
|
384
384
|
- lib/rubik/orchestrator/subagent/operation_tracker.rb
|
|
385
|
+
- lib/rubik/orchestrator/subagent/paging.rb
|
|
385
386
|
- lib/rubik/orchestrator/subagent/profile_contract.rb
|
|
386
387
|
- lib/rubik/orchestrator/subagent/profile_snapshot.rb
|
|
387
388
|
- lib/rubik/orchestrator/subagent/questioner.rb
|
|
388
389
|
- lib/rubik/orchestrator/subagent/reaper.rb
|
|
390
|
+
- lib/rubik/orchestrator/subagent/redeploy_transaction.rb
|
|
389
391
|
- lib/rubik/orchestrator/subagent/resilience.rb
|
|
390
392
|
- lib/rubik/orchestrator/subagent/result_archive.rb
|
|
391
393
|
- lib/rubik/orchestrator/subagent/reuse.rb
|