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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d59c62e5b37a338b1da8b57db74bfb670bb735ca4fa90059d6b874a18ffd25e
4
- data.tar.gz: 2c33e35cec6ad395fc539a4bc5ef3813a2e73fdcdb17464a247dbfdf1111ec0d
3
+ metadata.gz: df94fb01940bd1e9d53fbd46bd33d023ef9584eebafcf018a11c71fcc2edf4e9
4
+ data.tar.gz: 063fcde6929e5a1476ec12db56bcc65dff75dc1d9f3867208b4a8e91fa865335
5
5
  SHA512:
6
- metadata.gz: 1fe86c50be42049d5dedef7e561c6e042469d7686828bc7932931d63cece3f6fcb54e516e08c2fef48792d5fd86aa4e16932d7e5d3e7e7ae72dd1bc9f6a0f72b
7
- data.tar.gz: 19f1244d7243c253c6f1852fd1376028e25c9e67d0bd249cb0e3fc44f25dd88b7b293ab466eb670d5040faec8e48c87fe00a8cb1a1cc02a81677a0eff37f9742
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.mode == "off"
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
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Maf
4
- VERSION = "0.5.0"
4
+ VERSION = "0.6.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Alberski