rubik 0.9.1 → 0.11.0
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 +203 -1
- data/lib/rubik/adapter/base.rb +2 -1
- data/lib/rubik/adapter/process.rb +28 -67
- data/lib/rubik/ast/extractor.rb +2 -1
- data/lib/rubik/ast/treesitter_extractor.rb +2 -1
- data/lib/rubik/benchmark/vakanuvis_adoption.rb +12 -4
- data/lib/rubik/buffer/apply_contract.rb +3 -3
- data/lib/rubik/buffer/apply_transaction.rb +165 -0
- data/lib/rubik/buffer/manager.rb +26 -120
- data/lib/rubik/config/deep_ops.rb +4 -1
- data/lib/rubik/config/defaults.rb +6 -3
- data/lib/rubik/config/schema.rb +8 -0
- data/lib/rubik/config/secret_policy.rb +198 -0
- data/lib/rubik/config/store.rb +2 -1
- data/lib/rubik/config.rb +13 -2
- data/lib/rubik/context/ignore_rules.rb +193 -0
- data/lib/rubik/context/scanner.rb +46 -161
- data/lib/rubik/diagnostics/collector.rb +0 -9
- data/lib/rubik/errors.rb +15 -0
- data/lib/rubik/event_bus.rb +2 -1
- data/lib/rubik/kernel/dispatcher.rb +12 -7
- data/lib/rubik/kernel/unit.rb +4 -1
- data/lib/rubik/llm/client.rb +6 -200
- data/lib/rubik/llm/connection_pool.rb +104 -0
- data/lib/rubik/llm/registry.rb +13 -9
- data/lib/rubik/llm/router.rb +2 -5
- data/lib/rubik/llm/sse_parser.rb +110 -0
- data/lib/rubik/log.rb +21 -0
- data/lib/rubik/lsp/circuit_breaker.rb +98 -0
- data/lib/rubik/lsp/client.rb +77 -273
- data/lib/rubik/lsp/client_provisioner.rb +49 -0
- data/lib/rubik/lsp/manager.rb +67 -96
- data/lib/rubik/lsp/transport.rb +365 -0
- data/lib/rubik/mcp/boot_lifecycle.rb +6 -2
- data/lib/rubik/mcp/boot_run.rb +190 -0
- data/lib/rubik/mcp/manager.rb +55 -166
- data/lib/rubik/mcp/transport/stdio.rb +4 -1
- data/lib/rubik/orchestrator/auto_apply.rb +8 -6
- data/lib/rubik/orchestrator/continuation_manager.rb +3 -22
- data/lib/rubik/orchestrator/goal_ledger/ledger.rb +12 -1
- data/lib/rubik/orchestrator/goal_ledger/schema_vocabulary.rb +38 -0
- data/lib/rubik/orchestrator/goal_ledger/xml_render.rb +6 -1
- data/lib/rubik/orchestrator/goal_ledger.rb +1 -0
- data/lib/rubik/orchestrator/goal_session.rb +53 -39
- data/lib/rubik/orchestrator/loop.rb +28 -47
- data/lib/rubik/orchestrator/lsp_feedback.rb +1 -1
- data/lib/rubik/orchestrator/maestro_gate.rb +5 -7
- data/lib/rubik/orchestrator/provider_recovery.rb +4 -2
- data/lib/rubik/orchestrator/provider_resolver.rb +4 -2
- data/lib/rubik/orchestrator/resume_window.rb +96 -0
- data/lib/rubik/orchestrator/shell_deps.rb +16 -0
- data/lib/rubik/orchestrator/step_executor.rb +2 -1
- data/lib/rubik/orchestrator/stream_manager.rb +2 -1
- data/lib/rubik/orchestrator/subagent/deferred_spec.rb +4 -1
- data/lib/rubik/orchestrator/subagent/instance.rb +7 -12
- data/lib/rubik/orchestrator/subagent/lifecycle.rb +3 -1
- data/lib/rubik/orchestrator/subagent/notices.rb +2 -2
- data/lib/rubik/orchestrator/subagent/questioner.rb +3 -1
- data/lib/rubik/orchestrator/subagent/reaper.rb +3 -5
- data/lib/rubik/orchestrator/subagent/resilience.rb +4 -2
- data/lib/rubik/orchestrator/subagent/result_archive.rb +0 -4
- data/lib/rubik/orchestrator/subagent/run_cycle.rb +2 -7
- data/lib/rubik/orchestrator/subagent/spawn_transaction.rb +11 -2
- data/lib/rubik/orchestrator/subagent/step_runner.rb +10 -2
- data/lib/rubik/orchestrator/subagent/transcript_formatter.rb +2 -1
- data/lib/rubik/orchestrator/subagent/type_definition.rb +0 -4
- data/lib/rubik/orchestrator/tool_timeout.rb +121 -1
- data/lib/rubik/platform/io_drain.rb +5 -2
- data/lib/rubik/platform/process.rb +144 -54
- data/lib/rubik/platform.rb +2 -1
- data/lib/rubik/plugin/manager.rb +2 -1
- data/lib/rubik/plugin/storage.rb +8 -8
- data/lib/rubik/repl/commands/agent_context.rb +8 -7
- data/lib/rubik/repl/commands/agent_execution.rb +13 -32
- data/lib/rubik/repl/commands/agent_models.rb +4 -3
- data/lib/rubik/repl/commands/agent_providers.rb +43 -2
- data/lib/rubik/repl/commands/base.rb +47 -2
- data/lib/rubik/repl/commands/buffer.rb +5 -4
- data/lib/rubik/repl/commands/lsp.rb +2 -1
- data/lib/rubik/repl/commands/pruner.rb +2 -1
- data/lib/rubik/repl/commands/secrets.rb +151 -0
- data/lib/rubik/repl/commands/workspace.rb +60 -150
- data/lib/rubik/repl/commands/workspace_approval.rb +209 -0
- data/lib/rubik/repl/config_wiring.rb +8 -6
- data/lib/rubik/repl/hooks.rb +2 -1
- data/lib/rubik/repl/input_execution.rb +162 -79
- data/lib/rubik/repl/input_loop.rb +2 -1
- data/lib/rubik/repl/lifecycle.rb +60 -210
- data/lib/rubik/repl/notice_router.rb +319 -0
- data/lib/rubik/repl/paste_support.rb +3 -1
- data/lib/rubik/repl/presentation.rb +5 -3
- data/lib/rubik/repl/pruner/gate.rb +3 -1
- data/lib/rubik/repl/pruner/harness.rb +2 -1
- data/lib/rubik/repl/shell.rb +4 -3
- data/lib/rubik/repl/tee_io.rb +2 -1
- data/lib/rubik/repl/turn_recorder.rb +6 -5
- data/lib/rubik/runtime/ast_service.rb +2 -1
- data/lib/rubik/runtime/discovery.rb +3 -2
- data/lib/rubik/runtime/loop_service.rb +4 -3
- data/lib/rubik/runtime/manifest_store.rb +9 -1
- data/lib/rubik/runtime/overlay_guard.rb +127 -0
- data/lib/rubik/runtime/overlay_storage.rb +109 -163
- data/lib/rubik/runtime/task_manager.rb +64 -25
- data/lib/rubik/sandbox/driver/docker.rb +5 -1
- data/lib/rubik/sandbox/runner.rb +21 -19
- data/lib/rubik/security/audit_log.rb +2 -1
- data/lib/rubik/security/command_gate.rb +126 -243
- data/lib/rubik/security/guard.rb +7 -3
- data/lib/rubik/security/secret_store.rb +492 -0
- data/lib/rubik/security/segment_report.rb +161 -0
- data/lib/rubik/security/synthesis_gate.rb +8 -11
- data/lib/rubik/session/manager.rb +7 -1
- data/lib/rubik/session/recorder.rb +2 -1
- data/lib/rubik/skills/manager.rb +4 -4
- data/lib/rubik/storage/search.rb +49 -0
- data/lib/rubik/storage/store.rb +13 -20
- data/lib/rubik/storage/transcript_indexer.rb +3 -2
- data/lib/rubik/storage/vakanuvis/harness.rb +2 -3
- data/lib/rubik/storage/vakanuvis.rb +2 -1
- data/lib/rubik/tools/base.rb +22 -0
- data/lib/rubik/tools/builtins/files.rb +3 -15
- data/lib/rubik/tools/builtins/goal_ledger.rb +12 -1
- data/lib/rubik/tools/builtins/grep.rb +1 -6
- data/lib/rubik/tools/builtins/lifecycle.rb +6 -5
- data/lib/rubik/tools/builtins/synthesis.rb +3 -3
- data/lib/rubik/tools/lifecycle_rollbacks.rb +14 -1
- data/lib/rubik/tools/preflight_runner.rb +2 -1
- data/lib/rubik/tools/truncator.rb +48 -36
- data/lib/rubik/tools/uri_resolver.rb +3 -2
- data/lib/rubik/ui/banner.rb +4 -3
- data/lib/rubik/ui/capability.rb +1 -0
- data/lib/rubik/ui/spinner.rb +3 -1
- data/lib/rubik/ui/statusline.rb +6 -5
- data/lib/rubik/version.rb +1 -1
- data/lib/rubik.rb +4 -5
- metadata +20 -1
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
require "open3"
|
|
4
4
|
require "monitor"
|
|
5
5
|
require "time"
|
|
6
|
+
require_relative "../log"
|
|
6
7
|
require_relative "../platform"
|
|
7
8
|
require_relative "../security/guard" unless defined?(Rubik::Security::Guard)
|
|
8
9
|
|
|
@@ -91,7 +92,13 @@ module Rubik
|
|
|
91
92
|
|
|
92
93
|
@at_exit_installed = true
|
|
93
94
|
at_exit do
|
|
94
|
-
|
|
95
|
+
# Error-isolated sweep: one manager's kill_all raising must not
|
|
96
|
+
# leave the remaining managers uncleaned at shutdown.
|
|
97
|
+
@instances.each do |mgr|
|
|
98
|
+
mgr.kill_all
|
|
99
|
+
rescue StandardError => e
|
|
100
|
+
Rubik::Log.warn(:runtime, "[TaskManager] at_exit kill_all failed: #{e.class}: #{e.message}")
|
|
101
|
+
end
|
|
95
102
|
end
|
|
96
103
|
end
|
|
97
104
|
|
|
@@ -140,28 +147,49 @@ module Rubik
|
|
|
140
147
|
end
|
|
141
148
|
|
|
142
149
|
ring_buf = RingBuffer.new(@max_buffer_lines)
|
|
150
|
+
# Deliberately not single-homed on Platform.popen_capture (issue
|
|
151
|
+
# #444): that core is the synchronous drain-to-string capture shape
|
|
152
|
+
# (Timeout-wrapped, stdin closed immediately, whole-output strings).
|
|
153
|
+
# This spawn is the async/interactive shape — stdin stays open for
|
|
154
|
+
# send_input, the readers stream chomped lines into the per-task
|
|
155
|
+
# RingBuffer, and completion is watched by a dedicated thread with
|
|
156
|
+
# no Timeout — so parameterizing the sink alone cannot unify them.
|
|
143
157
|
begin
|
|
144
158
|
stdin, stdout, stderr, wait_thr = Open3.popen3(cmd_str, chdir: chdir)
|
|
145
159
|
rescue StandardError => e
|
|
146
160
|
rollback_failed_start(target_ctx, nil, e)
|
|
147
161
|
raise e
|
|
148
162
|
end
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
# The spawn succeeded but the task is NOT yet registered, so nothing
|
|
164
|
+
# (kill, kill_all, at_exit) can reach the child yet. Any failure in
|
|
165
|
+
# this window must kill the spawned process directly before rolling
|
|
166
|
+
# back the context, or the child leaks as an unmanaged orphan.
|
|
167
|
+
begin
|
|
168
|
+
stdin.binmode if stdin.respond_to?(:binmode)
|
|
169
|
+
stdin.sync = true if stdin.respond_to?(:sync=)
|
|
170
|
+
|
|
171
|
+
task = Task.new(
|
|
172
|
+
id: task_id,
|
|
173
|
+
command: cmd_str,
|
|
174
|
+
pid: wait_thr.pid,
|
|
175
|
+
started_at: Time.now,
|
|
176
|
+
ended_at: nil,
|
|
177
|
+
status: :running,
|
|
178
|
+
exit_code: nil,
|
|
179
|
+
ring_buffer: ring_buf,
|
|
180
|
+
stdin_io: stdin,
|
|
181
|
+
wait_thread: wait_thr,
|
|
182
|
+
collector_threads: []
|
|
183
|
+
)
|
|
184
|
+
rescue StandardError => e
|
|
185
|
+
begin
|
|
186
|
+
Process.kill("KILL", wait_thr.pid)
|
|
187
|
+
rescue StandardError
|
|
188
|
+
nil
|
|
189
|
+
end
|
|
190
|
+
rollback_failed_start(target_ctx, nil, e)
|
|
191
|
+
raise e
|
|
192
|
+
end
|
|
165
193
|
|
|
166
194
|
task.collector_threads = []
|
|
167
195
|
|
|
@@ -241,19 +269,30 @@ module Rubik
|
|
|
241
269
|
task&.ring_buffer&.tail(tail)
|
|
242
270
|
end
|
|
243
271
|
|
|
272
|
+
# Resolve the stdin pipe under the monitor, but write OUTSIDE it: a
|
|
273
|
+
# pipe write blocks once the OS pipe buffer fills, and blocking while
|
|
274
|
+
# holding @monitor would deadlock kill/status/logs/kill_all and the
|
|
275
|
+
# at_exit sweep for the whole manager. The deadline-bounded write
|
|
276
|
+
# (Rubik::Platform.write_until, single-homed with the other process
|
|
277
|
+
# IO plumbing) converts a never-reading child into a false return
|
|
278
|
+
# instead of a hang.
|
|
279
|
+
SEND_INPUT_TIMEOUT = 5.0
|
|
280
|
+
|
|
244
281
|
def send_input(task_id, input)
|
|
245
|
-
@monitor.synchronize do
|
|
282
|
+
io = @monitor.synchronize do
|
|
246
283
|
task = @tasks[task_id.to_s]
|
|
247
284
|
return false unless task && task.status == :running && task.stdin_io && !task.stdin_io.closed?
|
|
248
285
|
|
|
249
|
-
|
|
250
|
-
text += "\n" unless text.end_with?("\n")
|
|
251
|
-
task.stdin_io.write(text)
|
|
252
|
-
task.stdin_io.flush
|
|
253
|
-
true
|
|
254
|
-
rescue IOError, Errno::EPIPE
|
|
255
|
-
false
|
|
286
|
+
task.stdin_io
|
|
256
287
|
end
|
|
288
|
+
|
|
289
|
+
text = input.to_s
|
|
290
|
+
text += "\n" unless text.end_with?("\n")
|
|
291
|
+
Rubik::Platform.write_until(io, text, timeout: SEND_INPUT_TIMEOUT)
|
|
292
|
+
io.flush
|
|
293
|
+
true
|
|
294
|
+
rescue IOError, Errno::EPIPE, Errno::EINTR
|
|
295
|
+
false
|
|
257
296
|
end
|
|
258
297
|
|
|
259
298
|
def kill(task_id)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require_relative "base"
|
|
4
4
|
require_relative "../../platform"
|
|
5
|
+
require_relative "../../log"
|
|
5
6
|
require "open3"
|
|
6
7
|
require "timeout"
|
|
7
8
|
|
|
@@ -48,7 +49,10 @@ module Rubik
|
|
|
48
49
|
error_message: "Docker sandbox error"
|
|
49
50
|
)
|
|
50
51
|
ensure
|
|
51
|
-
|
|
52
|
+
# Best-effort cleanup, but a failed `docker rm -f` leaves an
|
|
53
|
+
# orphaned container — check the result and leave a trace.
|
|
54
|
+
removed = system("docker", "rm", "-f", container_name, out: File::NULL, err: File::NULL)
|
|
55
|
+
Rubik::Log.warn(:sandbox, "docker container '#{container_name}' could not be removed") unless removed
|
|
52
56
|
end
|
|
53
57
|
|
|
54
58
|
{
|
data/lib/rubik/sandbox/runner.rb
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require_relative "../log"
|
|
3
4
|
require_relative "driver"
|
|
4
5
|
require_relative "driver/process"
|
|
5
6
|
require_relative "../security/errors"
|
|
6
7
|
require_relative "../platform"
|
|
8
|
+
require_relative "../storage/layout"
|
|
7
9
|
|
|
8
10
|
module Rubik
|
|
9
11
|
module Sandbox
|
|
@@ -21,10 +23,10 @@ module Rubik
|
|
|
21
23
|
# re-verification, where an empty-allowlist guard would silently
|
|
22
24
|
# re-block commands the operator allowlisted.
|
|
23
25
|
@guard = guard
|
|
24
|
-
@allow_network = allow_network || @config
|
|
26
|
+
@allow_network = allow_network || Rubik::Storage::Layout.config_get(@config, "sandbox.allow_network", false) || false
|
|
25
27
|
@allowed_external_dirs = (
|
|
26
28
|
Array(allowed_external_dirs) +
|
|
27
|
-
Array(@config
|
|
29
|
+
Array(Rubik::Storage::Layout.config_get(@config, "workspace.allowed_external_dirs", []))
|
|
28
30
|
).map { |d| File.expand_path(d.to_s, @root_dir) }.uniq
|
|
29
31
|
# Baseline captured BEFORE the first reconfigure: entries from
|
|
30
32
|
# construction arguments plus the config's current value. Dirs added
|
|
@@ -56,22 +58,22 @@ module Rubik
|
|
|
56
58
|
begin
|
|
57
59
|
cleanup.call
|
|
58
60
|
rescue StandardError => e
|
|
59
|
-
warn "[WARN] Sandbox::Runner cleanup failed: #{e.message}"
|
|
61
|
+
Rubik::Log.warn(:sandbox, "[WARN] Sandbox::Runner cleanup failed: #{e.message}")
|
|
60
62
|
end
|
|
61
63
|
end
|
|
62
64
|
end
|
|
63
65
|
|
|
64
66
|
def sandbox_enabled?
|
|
65
67
|
return true if @preferred_driver && !@preferred_driver.is_a?(String) && !@preferred_driver.is_a?(Symbol)
|
|
66
|
-
return false if @config
|
|
68
|
+
return false if Rubik::Storage::Layout.config_get(@config, "sandbox.driver", nil).to_s.downcase.then { |d| ["process", "none"].include?(d) }
|
|
67
69
|
return false if @preferred_driver.to_s.downcase.then { |d| ["process", "none"].include?(d) }
|
|
68
70
|
|
|
69
|
-
val = @config
|
|
71
|
+
val = Rubik::Storage::Layout.config_get(@config, "sandbox.enabled", false)
|
|
70
72
|
val == true || val.to_s.downcase == "true"
|
|
71
73
|
end
|
|
72
74
|
|
|
73
75
|
def reconfigure!
|
|
74
|
-
@allow_network = @config
|
|
76
|
+
@allow_network = Rubik::Storage::Layout.config_get(@config, "sandbox.allow_network", @allow_network)
|
|
75
77
|
if @config && @allowed_dirs_config_touched
|
|
76
78
|
# Config authoritative (user has edited the key at some scope):
|
|
77
79
|
# recompute config-sourced entries from scratch so REMOVING a dir
|
|
@@ -83,10 +85,10 @@ module Rubik
|
|
|
83
85
|
# A malformed (non-Array) value must fail CLOSED: treating it as an
|
|
84
86
|
# empty config list and warning, rather than silently keeping the
|
|
85
87
|
# previously-merged union (which would leave stale dirs allowed).
|
|
86
|
-
raw_allowed = @config
|
|
88
|
+
raw_allowed = Rubik::Storage::Layout.config_get(@config, "workspace.allowed_external_dirs", [])
|
|
87
89
|
unless raw_allowed.is_a?(Array)
|
|
88
|
-
warn "[SANDBOX] workspace.allowed_external_dirs must be an Array (got #{raw_allowed.class}); " \
|
|
89
|
-
|
|
90
|
+
Rubik::Log.warn(:sandbox, "[SANDBOX] workspace.allowed_external_dirs must be an Array (got #{raw_allowed.class}); " \
|
|
91
|
+
"treating as empty — the config is authoritative, so stale dirs are revoked.")
|
|
90
92
|
raw_allowed = []
|
|
91
93
|
end
|
|
92
94
|
baseline = @baseline_allowed_dirs || []
|
|
@@ -101,7 +103,7 @@ module Rubik
|
|
|
101
103
|
|
|
102
104
|
driver_opts = {
|
|
103
105
|
image: @config&.fetch("sandbox.image", "rubik-sandbox:latest"),
|
|
104
|
-
shell: @config
|
|
106
|
+
shell: Rubik::Storage::Layout.config_get(@config, "sandbox.shell", "auto"),
|
|
105
107
|
allowed_dirs: allowed_paths,
|
|
106
108
|
guard: @guard
|
|
107
109
|
}
|
|
@@ -111,7 +113,7 @@ module Rubik
|
|
|
111
113
|
@driver = if @preferred_driver && !@preferred_driver.is_a?(String) && !@preferred_driver.is_a?(Symbol)
|
|
112
114
|
@preferred_driver
|
|
113
115
|
elsif @sandbox_enabled
|
|
114
|
-
driver_to_use = @preferred_driver || @config
|
|
116
|
+
driver_to_use = @preferred_driver || Rubik::Storage::Layout.config_get(@config, "sandbox.driver", nil) || "auto"
|
|
115
117
|
Driver.best_available(driver_to_use, driver_opts)
|
|
116
118
|
end
|
|
117
119
|
end
|
|
@@ -119,7 +121,7 @@ module Rubik
|
|
|
119
121
|
def allowed_paths
|
|
120
122
|
roots = [@root_dir]
|
|
121
123
|
if @config
|
|
122
|
-
extra_roots = Array(@config
|
|
124
|
+
extra_roots = Array(Rubik::Storage::Layout.config_get(@config, "workspace.additional_roots", [])).map { |r| File.expand_path(r.to_s, @root_dir) }
|
|
123
125
|
roots.concat(extra_roots)
|
|
124
126
|
end
|
|
125
127
|
roots.concat(@allowed_external_dirs)
|
|
@@ -157,12 +159,12 @@ module Rubik
|
|
|
157
159
|
|
|
158
160
|
def allow_network?
|
|
159
161
|
if @config
|
|
160
|
-
cfg_val = @config
|
|
162
|
+
cfg_val = Rubik::Storage::Layout.config_get(@config, "sandbox.allow_network", nil)
|
|
161
163
|
return true if cfg_val == true || cfg_val.to_s.downcase == "true"
|
|
162
164
|
return false if cfg_val == false || cfg_val.to_s.downcase == "false"
|
|
163
165
|
|
|
164
166
|
unless cfg_val.nil?
|
|
165
|
-
warn "[SANDBOX] Unparseable sandbox.allow_network value '#{cfg_val}'; defaulting to fail-closed (false)"
|
|
167
|
+
Rubik::Log.warn(:sandbox, "[SANDBOX] Unparseable sandbox.allow_network value '#{cfg_val}'; defaulting to fail-closed (false)")
|
|
166
168
|
return false
|
|
167
169
|
end
|
|
168
170
|
end
|
|
@@ -179,15 +181,15 @@ module Rubik
|
|
|
179
181
|
|
|
180
182
|
parsed_timeout = timeout&.to_i
|
|
181
183
|
effective_timeout = (parsed_timeout&.positive? ? parsed_timeout : nil) ||
|
|
182
|
-
(@config
|
|
184
|
+
Rubik::Storage::Layout.config_get(@config, "sandbox.timeout_seconds", 15).to_i
|
|
183
185
|
effective_timeout = 15 if effective_timeout <= 0
|
|
184
|
-
mem_limit = @config
|
|
185
|
-
cpus = @config
|
|
186
|
+
mem_limit = Rubik::Storage::Layout.config_get(@config, "sandbox.memory_limit_mb", 512)
|
|
187
|
+
cpus = Rubik::Storage::Layout.config_get(@config, "sandbox.cpus", "1.0")
|
|
186
188
|
|
|
187
189
|
active_driver = if sandbox_enabled? && @driver
|
|
188
190
|
@driver
|
|
189
191
|
else
|
|
190
|
-
@host_driver || Driver::ProcessDriver.new(shell: @config
|
|
192
|
+
@host_driver || Driver::ProcessDriver.new(shell: Rubik::Storage::Layout.config_get(@config, "sandbox.shell", "auto"),
|
|
191
193
|
guard: @guard)
|
|
192
194
|
end
|
|
193
195
|
|
|
@@ -211,7 +213,7 @@ module Rubik
|
|
|
211
213
|
end
|
|
212
214
|
|
|
213
215
|
def disclose_isolation?
|
|
214
|
-
|
|
216
|
+
Rubik::Storage::Layout.config_get(@config, "sandbox.isolation_note", true) != false
|
|
215
217
|
end
|
|
216
218
|
|
|
217
219
|
def isolation_disclosure
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
require "json"
|
|
4
4
|
require "time"
|
|
5
5
|
require "fileutils"
|
|
6
|
+
require_relative "../log"
|
|
6
7
|
require_relative "../platform"
|
|
7
8
|
require_relative "redactor"
|
|
8
9
|
|
|
@@ -65,7 +66,7 @@ module Rubik
|
|
|
65
66
|
# Unconditional: an audit trail failing silently is indistinguishable
|
|
66
67
|
# from an operator's intentional disable — the one warn in the guard
|
|
67
68
|
# that must not hide behind RUBIK_DEBUG.
|
|
68
|
-
warn "[WARN] Failed to write audit log #{@audit_log_path}: #{e.message}"
|
|
69
|
+
Rubik::Log.warn(:security, "[WARN] Failed to write audit log #{@audit_log_path}: #{e.message}")
|
|
69
70
|
end
|
|
70
71
|
end
|
|
71
72
|
end
|