maf 0.5.0 → 0.6.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/CHANGELOG.md +11 -0
- data/lib/maf/setup_agent/launcher.rb +2 -1
- data/lib/maf/shared/sandbox/seatbelt.rb +3 -0
- data/lib/maf/shared/sandbox.rb +14 -0
- data/lib/maf/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: df94fb01940bd1e9d53fbd46bd33d023ef9584eebafcf018a11c71fcc2edf4e9
|
|
4
|
+
data.tar.gz: 063fcde6929e5a1476ec12db56bcc65dff75dc1d9f3867208b4a8e91fa865335
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f60c0cbcb6a60b2a079e09e3ccf9587c3501c1420f33cbfb6424c80211440d2831b1ddce1894d4adc171299ac7a25bd2cdebc84b2b8d565c54ff88623cbe44da
|
|
7
|
+
data.tar.gz: 8a86dbb9aa864b37426c7db5f3d2e4d26ebd145086cc0f766053468f79d5863598ef9aadd645bce991879ac86acd2efbe962690ca8e660efa38fe2bda58ed12a
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.6.0] - 2026-10-22
|
|
6
|
+
|
|
7
|
+
- New: `.maf/sandbox.json` key `scope`. `dispatch` (the default) runs only the dispatched runs
|
|
8
|
+
and the analyst in the sandbox. `all` also runs the interactive sessions in it, as before.
|
|
9
|
+
An interactive session has approvals, so it now runs on the host by default. Set
|
|
10
|
+
`"scope": "all"` to keep the old behavior. A project manager in an interactive session with
|
|
11
|
+
`dispatch` can start a dispatcher on macOS.
|
|
12
|
+
- Fix: in the macOS sandbox, a copy did not paste. `pbcopy` could not reach
|
|
13
|
+
`com.apple.lsd.mapdb`, so it wrote the text with a type that no app reads. The sandbox now
|
|
14
|
+
allows this service. It only reads type names; `open` and Apple Events stay blocked.
|
|
15
|
+
|
|
5
16
|
## [0.5.0] - 2026-10-22
|
|
6
17
|
|
|
7
18
|
- Fix: in the macOS sandbox, headless Chrome aborted at start, and macOS showed a crash dialog
|
|
@@ -7,10 +7,11 @@ module Maf
|
|
|
7
7
|
module SetupAgent
|
|
8
8
|
# Launcher replaces this process with the interactive session of a harness.
|
|
9
9
|
# The harness file builds the command (Maf::Shared::Harnesses).
|
|
10
|
+
# The session runs in the sandbox only when .maf/sandbox.json sets "scope": "all".
|
|
10
11
|
module Launcher
|
|
11
12
|
def self.launch(harness, role, model, effort = nil)
|
|
12
13
|
ENV.update(harness.launch_env)
|
|
13
|
-
return exec_or_die(harness.launch(role, model, effort)) if Maf::Shared::Sandbox.
|
|
14
|
+
return exec_or_die(harness.launch(role, model, effort)) if Maf::Shared::Sandbox.interactive_mode == "off"
|
|
14
15
|
|
|
15
16
|
warn "maf: sandbox: #{Maf::Shared::Sandbox.describe(harness)}"
|
|
16
17
|
exit Maf::Shared::Sandbox.keeping_links(harness) { relay_or_die(sandboxed(harness, role, model, effort)) }
|
|
@@ -16,7 +16,10 @@ module Maf
|
|
|
16
16
|
'(regex #"^/dev/tty") (regex #"^/dev/fd/") (regex #"^/dev/ptmx")'
|
|
17
17
|
DNS = '(path-literal "/private/var/run/mDNSResponder")'
|
|
18
18
|
TMP_PREFIX = "maf-sandbox-"
|
|
19
|
+
# The map database of LaunchServices only reads: it turns a type name into a type.
|
|
20
|
+
# Without it, pbcopy writes the text with a type that no app reads.
|
|
19
21
|
SERVICES = "(deny mach-lookup (global-name-regex #\"^com\\.apple\\.(coreservices|lsd)\\.\"))\n" \
|
|
22
|
+
"(allow mach-lookup (global-name \"com.apple.lsd.mapdb\"))\n" \
|
|
20
23
|
"(deny appleevent-send)\n"
|
|
21
24
|
LAUNCH_SERVICES = "com.apple.coreservices.launchservicesd"
|
|
22
25
|
|
data/lib/maf/shared/sandbox.rb
CHANGED
|
@@ -17,6 +17,8 @@ module Maf
|
|
|
17
17
|
module Sandbox
|
|
18
18
|
BACKENDS = { "seatbelt" => Seatbelt, "bwrap" => Bwrap }.freeze
|
|
19
19
|
MODES = ["off", "auto", *BACKENDS.keys].freeze
|
|
20
|
+
# dispatch: only the runs of a dispatcher and the analyst. all: also the interactive sessions.
|
|
21
|
+
SCOPES = %w[dispatch all].freeze
|
|
20
22
|
POLICY = File.join(".maf", "sandbox.json")
|
|
21
23
|
NESTED = "maf: this process runs in the macOS sandbox, and macOS cannot start a second sandbox in it. " \
|
|
22
24
|
"Start the worker from your terminal: cd <worktree> && maf start"
|
|
@@ -39,6 +41,18 @@ module Maf
|
|
|
39
41
|
|
|
40
42
|
def self.native = RUBY_PLATFORM.include?("darwin") ? "seatbelt" : "bwrap"
|
|
41
43
|
|
|
44
|
+
def self.scope(policy = self.policy)
|
|
45
|
+
scope = policy["scope"] || "dispatch"
|
|
46
|
+
abort "maf: unknown sandbox scope '#{scope}' (use #{SCOPES.join(", ")})" unless SCOPES.include?(scope)
|
|
47
|
+
scope
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# An interactive session runs in the sandbox only with scope "all".
|
|
51
|
+
def self.interactive_mode
|
|
52
|
+
policy = self.policy
|
|
53
|
+
scope(policy) == "all" ? mode(policy) : "off"
|
|
54
|
+
end
|
|
55
|
+
|
|
42
56
|
def self.wrap(cmd, harness, coord_dir: ENV.fetch("COORD_DIR", nil))
|
|
43
57
|
policy = self.policy
|
|
44
58
|
mode = mode(policy)
|
data/lib/maf/version.rb
CHANGED