ask-sandbox-providers 0.1.3 → 0.1.4
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 +21 -0
- data/README.md +1 -1
- data/lib/ask/sandbox/local.rb +4 -10
- data/lib/ask/sandbox/version.rb +1 -1
- 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: 3a0d6fd353895bba424a5a181ccf55e6c0da0273dc9a411f65db972830c99516
|
|
4
|
+
data.tar.gz: 84eb48ca0657db9cf00232559e4ab977fe31c1bb7c530881f59e1f9b0ef70bd1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c7145f2991c6989fbdd58c70fe301a66a05d2848fe0244059c6d082c7cb75e36089271f1ef02b8d903c538945f6db813b8efbe498513b778663ba5c07623f154
|
|
7
|
+
data.tar.gz: bd310ad9bb7a8f5ff51e03911856d96348fc4091b824f09e53eca3b3eb32ec0c062e3a1850c0d810caa4399c324771be057ee1d8cfceb9f98d70b965bae8ef2c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [0.1.4] — 2026-08-03
|
|
2
|
+
|
|
3
|
+
### Changed
|
|
4
|
+
|
|
5
|
+
- **Commands run in the caller's working directory by default** (was: a
|
|
6
|
+
fresh temp dir). The shell tools (Write, Edit, ...) operate relative to
|
|
7
|
+
the process CWD, so a sandboxed command that couldn't see a file the file
|
|
8
|
+
tools had just created — `ruby hello.rb` after writing it with Write
|
|
9
|
+
failed with `LoadError` — now works like a real terminal. Pass `workdir:`
|
|
10
|
+
to pin a specific directory (e.g. an empty temp dir for hermetic runs).
|
|
11
|
+
|
|
12
|
+
## [0.1.3] — 2026-08-03
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- **`rlimit_nproc` default raised from 200 to 1024.** nproc limits the
|
|
17
|
+
*user's* total process count, not the sandbox's — 200 is easily exceeded
|
|
18
|
+
on a busy dev machine, which made every fork inside a sandboxed command
|
|
19
|
+
fail with `Resource temporarily unavailable` (EAGAIN). 1024 still guards
|
|
20
|
+
against fork bombs without breaking normal use.
|
|
21
|
+
|
|
1
22
|
## [0.1.2] - 2026-06-25
|
|
2
23
|
|
|
3
24
|
### Changed
|
data/README.md
CHANGED
|
@@ -33,7 +33,7 @@ Ask::Sandbox.provider = Ask::Sandbox::Docker.new(image: "ruby:3.4-alpine", memor
|
|
|
33
33
|
|
|
34
34
|
| Provider | Isolation | Requirement |
|
|
35
35
|
|---|---|---|
|
|
36
|
-
| `Ask::Sandbox::Local` (default) | Subprocess with rlimits (CPU, memory, processes, file size),
|
|
36
|
+
| `Ask::Sandbox::Local` (default) | Subprocess with rlimits (CPU, memory, processes, file size), caller's working directory (or `workdir:`), sanitized environment | None, stdlib only |
|
|
37
37
|
| `Ask::Sandbox::Docker` | Container with read-only rootfs, no capabilities, no network | Docker daemon |
|
|
38
38
|
| `Ask::Sandbox::Daytona` | Remote sandbox via the Daytona API | `daytona` gem, API key |
|
|
39
39
|
| `Ask::Sandbox::Cloudflare` | Cloudflare Workers sandbox via a proxy Worker | Deployed proxy Worker URL |
|
data/lib/ask/sandbox/local.rb
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "tmpdir"
|
|
4
|
-
require "fileutils"
|
|
5
|
-
|
|
6
3
|
module Ask
|
|
7
4
|
module Sandbox
|
|
8
5
|
# Executes commands in a local subprocess with resource limits.
|
|
@@ -41,13 +38,10 @@ module Ask
|
|
|
41
38
|
argv = build_argv(command)
|
|
42
39
|
child_env = build_environment(env)
|
|
43
40
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
execute_in_dir(argv, child_env, dir, timeout, stdin)
|
|
49
|
-
end
|
|
50
|
-
end
|
|
41
|
+
# Default to the caller's working directory so shell commands see the
|
|
42
|
+
# files the file tools (Write, Edit, ...) just created — like a real
|
|
43
|
+
# terminal. Pass workdir: to pin a specific directory instead.
|
|
44
|
+
execute_in_dir(argv, child_env, workdir || Dir.pwd, timeout, stdin)
|
|
51
45
|
end
|
|
52
46
|
|
|
53
47
|
private
|
data/lib/ask/sandbox/version.rb
CHANGED