@aron98/load-lock 1.0.0 → 1.2.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.
@@ -89,7 +89,12 @@ uninstall — see issue #19); not live-verified inside the real CLIs.
89
89
  override `LOAD_LOCK_STATE_DIR`).
90
90
  - Socket: `<state dir>/daemon.sock` (Windows: named pipe `\\.\pipe\load-lock`;
91
91
  override `LOAD_LOCK_SOCKET`).
92
- - **Auto-spawns** on first client connection; no service unit needed.
92
+ - **Auto-spawns** on first client connection; no service unit needed. Set
93
+ `LOAD_LOCK_NO_SPAWN` to any non-empty value except `0` to forbid
94
+ spawning (client-only mode for sandboxes — see
95
+ [Sandboxes](#sandboxes)).
96
+ - Also honored by the shared client: `LOAD_LOCK_LABEL_PREFIX` (prefix for
97
+ holder labels; see Sandboxes).
93
98
  - Files: `config.json` (settings + history), `journal.json` (held permits),
94
99
  `daemon.json` (pid), `spawn.lock` (bootstrap race guard).
95
100
 
@@ -143,13 +148,17 @@ construction: they only ever call `status` / `events` / `inspect` / `watch`.
143
148
  The one admin action they expose — force-release — sits behind an explicit
144
149
  select + confirm step and never runs automatically.
145
150
 
146
- ### `load-lock top` (portable, any terminal)
151
+ ### `load-lock dashboard` (portable, any terminal)
147
152
 
148
153
  ```sh
149
- load-lock top # full-screen live dashboard (q quit, r resync)
150
- load-lock top --once # render one frame and exit (pipes, scripts, CI logs)
154
+ load-lock dashboard # full-screen live dashboard (q quit, r resync)
155
+ load-lock dashboard --once # render one frame and exit (pipes, scripts, CI logs)
151
156
  ```
152
157
 
158
+ `top` still works as a hidden compatibility alias for `dashboard` (same
159
+ command, same flags) — existing scripts keep running; new docs and muscle
160
+ memory should use `dashboard`.
161
+
153
162
  Shows pools with capacity vs in-use, holder cards (label, reason, phase,
154
163
  pid/pgid, age, start-deadline or lease countdown), offer cards with the
155
164
  claim-window countdown, FIFO queue positions, paused requests, the recent
@@ -165,16 +174,49 @@ alternate screen, so it works anywhere the CLI works.
165
174
  The OpenCode installer also ships the package's `./tui` plugin export (a
166
175
  companion to the main plugin, which is unchanged). Inside the opencode TUI:
167
176
 
168
- - `/load-lock` (or the command palette) opens the **load-lock.dashboard**
169
- session panel full-screen: same data as `load-lock top`, themed,
170
- live-updating.
171
- - The home footer gains a small `lock 1/1·Q2` indicator.
177
+ - `/load-lock` (or the command palette) opens the
178
+ **load-lock.dashboard** session panel **in-window** as a side panel —
179
+ same data as `load-lock dashboard`, themed, live-updating, with the rest
180
+ of the TUI layout still visible beside it.
181
+ - Every session screen shows an at-a-glance widget at the bottom of the
182
+ right sidebar: `load-lock 0/3` colored by pool health (green ok, yellow
183
+ full/queued, red daemon down) plus a hint line. Clicking it opens the
184
+ dashboard; `/load-lock` is the fallback for terminals that don't deliver
185
+ mouse events. The home screen keeps its `lock 1/1·Q2` footer indicator —
186
+ the sidebar widget only renders on session screens, so the two never
187
+ double-render.
172
188
  - `r` resyncs; `x` opens force-release, which requires an explicit
173
189
  select + confirm — the panel itself is read-only.
174
-
175
- Verified live against opencode 2.0.29: the panel renders pools, holder
176
- cards, queue positions and the event feed against the real daemon, and the
177
- `x` flow refuses to release anything until the confirm dialog accepts.
190
+ - `Esc` closes the panel (the footer has always advertised this). It is
191
+ deliberately inactive while a dialog — force-release, the command
192
+ palette — is open, so Esc keeps cancelling the dialog instead of
193
+ closing the panel underneath it.
194
+
195
+ The open command deliberately ships with **no global key binding** (issue
196
+ #28). Never bind unmodified single letters or letter sequences (the old
197
+ `gl`) at global scope: while the keymap engine waits for the next key of a
198
+ sequence it swallows the prefix, so plain `g` never reached the composer.
199
+ The obvious modifier chord, `ctrl+g`, is already the host's documented
200
+ default for `session.first` ("Navigate to first message") in opencode
201
+ >= 2.0.32, so binding it would shadow a host feature; per the issue's
202
+ fallback the command is unbound instead — the sidebar click, the command
203
+ palette, and `/load-lock` are the entry points. (The panel-scoped `r` and
204
+ `x` bindings are fine: they are `enabled` only while the dashboard panel
205
+ itself is fullscreen, when the composer is suspended and no typing can be
206
+ swallowed.)
207
+
208
+ Verified live against opencode 2.0.32 (real pty session): the sidebar
209
+ widget renders with live daemon data, a mouse press on the widget opens
210
+ the dashboard in-window with the chat still visible beside it, plain `g`
211
+ types into the composer with no keymap interception, `ctrl+g` is not
212
+ intercepted by load-lock (the host's documented `session.first` default
213
+ is left untouched), and the `/load-lock` command appears in the slash
214
+ suggestions and opens the panel.
215
+ Earlier live verification (2.0.29): panel render, palette/slash entry
216
+ points, and the confirm-gated force-release flow. Click handling itself
217
+ is contract-level from opentui (mouse reporting enabled by default,
218
+ mouse-down events bubble to slot renderables) — the pty test above
219
+ exercises the full path; the `/load-lock` command works regardless.
178
220
  Plugins configured in `opencode.json` that expose `./tui` are loaded
179
221
  automatically by the CLI, so the published package needs no extra config.
180
222
  For local development against a checkout, opencode also auto-discovers
@@ -184,13 +226,14 @@ plugins laid out like a package under `<project>/.opencode/plugins/<name>/`
184
226
 
185
227
  ### Notes for other harnesses
186
228
 
187
- `load-lock top` is the dashboard for every harness (it only needs the
188
- daemon, which every integration spawns). Harnesses without an in-app UI
189
- surface get exactly that — no parity claims; see `docs/COMPATIBILITY.md`.
229
+ `load-lock dashboard` is the dashboard for every harness (it only needs
230
+ the daemon, which every integration spawns). Harnesses without an in-app
231
+ UI surface get exactly that — no parity claims; see `docs/COMPATIBILITY.md`.
190
232
 
191
233
  ## Diagnostics & recovery
192
234
 
193
235
  ```sh
236
+ load-lock help # one-screen usage of every command
194
237
  load-lock doctor # state dir, socket, daemon reachability, effective cores, pressure
195
238
  load-lock status # human view: usage, holders w/ phase+pid, offers, queue, paused
196
239
  load-lock pending # your own offers/queue entries (JSON)
@@ -295,6 +338,10 @@ Limitations observed (all inherent to containers, not load-lock bugs):
295
338
  respawns with defaults (fine for ephemeral CI containers; volume-mount
296
339
  `~/.local/state/load-lock` if you want persistence).
297
340
 
341
+ The setup above gives the container its *own* daemon. To make a container
342
+ a thin client of the **host's** daemon instead (bridged socket +
343
+ `LOAD_LOCK_NO_SPAWN`), see the [Sandboxes](#sandboxes) section below.
344
+
298
345
  Reproduce from a checkout (needs `dist/` built; tarball from `npm pack`):
299
346
 
300
347
  ```sh
@@ -359,6 +406,356 @@ Caveats to watch for (unverified expectations):
359
406
  - Keep the state dir on the Linux filesystem (`~/.local/state/load-lock`),
360
407
  not on `/mnt/c` (drvfs/9p is slow and lock semantics differ).
361
408
 
409
+ ## Sandboxes
410
+
411
+ Sandboxed agents (bubblewrap/omac, Docker, macOS seatbelt, WSL2) face one
412
+ core problem: the budget belongs on the *host*, but a sandbox that cannot
413
+ see the host's daemon will happily auto-spawn its own useless local daemon
414
+ and fragment the budget. The recipes below all use the same two mechanisms:
415
+
416
+ 1. **Bridge the host daemon's socket into the sandbox.** The daemon listens
417
+ on an AF_UNIX *path* socket. Path sockets are scoped by the **mount**
418
+ namespace, not the network namespace — so a bind mount of the state dir
419
+ survives `--unshare-net` (bubblewrap), and only needs the right
420
+ filesystem mapping/allow rules elsewhere. Point the sandboxed client at
421
+ the bridged path with `LOAD_LOCK_SOCKET`.
422
+ 2. **Run the client in client-only mode** so it can never auto-spawn a
423
+ daemon inside the sandbox (see below).
424
+
425
+ A third mechanism matters once the client is inside a PID namespace:
426
+ **lease-mode (untracked) permits**, because the host daemon cannot
427
+ `kill(pid, 0)` a sandbox pid it cannot see (lifecycle below).
428
+
429
+ ### Client-only mode: `LOAD_LOCK_NO_SPAWN`
430
+
431
+ Set `LOAD_LOCK_NO_SPAWN=1` (any non-empty value except `0`) and the shared
432
+ client will never spawn a daemon, no matter which adapter asks:
433
+ `ensureDaemon` refuses before creating anything, and `connect` fails loudly
434
+ instead of falling back to a spawn. The error is actionable and points
435
+ here:
436
+
437
+ ```
438
+ load-lock: load-lock daemon is not reachable at /run/load-lock/daemon.sock
439
+ and auto-spawn is disabled (LOAD_LOCK_NO_SPAWN is set): this client is
440
+ client-only and started no daemon. Run the daemon on the host machine
441
+ (e.g. load-lock service start) and bridge its socket into this sandbox,
442
+ then point LOAD_LOCK_SOCKET at the bridged path — see the "Sandboxes"
443
+ section of docs/OPERATIONS.md for per-sandbox recipes (bubblewrap/omac,
444
+ Docker, seatbelt, WSL2). To allow spawning a daemon here instead, unset
445
+ LOAD_LOCK_NO_SPAWN. (code: unavailable)
446
+ ```
447
+
448
+ The CLI exits with code 70 for this failure (unavailable transport). Use
449
+ this mode inside every sandbox: it turns "mysteriously isolated budget"
450
+ into a loud, documented failure, and it is what the tests in
451
+ `src/test/sandbox.test.ts` enforce (no state dir is ever created, and the
452
+ error names the docs).
453
+
454
+ ### Label prefixes: identifying sandboxed holders
455
+
456
+ Sandboxed clients can prefix their holder labels so the dashboard shows
457
+ *where* a permit came from, e.g. `omac:issue-42 build`. Three equivalent
458
+ entry points, all composing `prefix:label` (or `prefix:<agentId>` when no
459
+ label was given) daemon-side:
460
+
461
+ - `LOAD_LOCK_LABEL_PREFIX` env var — the shared client injects it into
462
+ every `acquire` request (including CLI, MCP, plugin and hook paths)
463
+ unless a request already carries an explicit prefix. This is the natural
464
+ place for a sandbox wrapper (omac profile, Docker `-e`, bwrap
465
+ `--setenv`) to tag everything an agent does inside it.
466
+ - CLI: `--label-prefix` on `acquire` and `run`.
467
+ - MCP: the `label_prefix` input on the `acquire` tool; the RPC field is
468
+ `labelPrefix` (see `docs/ADAPTERS.md`).
469
+
470
+ A present-but-empty prefix is rejected (`labelPrefix must be a non-empty
471
+ string`); prefixes are trimmed.
472
+
473
+ ### Cross-PID-namespace permits: the lease-mode lifecycle
474
+
475
+ With `--unshare-pid` (bubblewrap) or default Docker containers, the host
476
+ daemon cannot see the sandboxed client's pid — verified live below: inside
477
+ the sandbox `kill -0 <host-daemon-pid>` fails with "No such process" while
478
+ the daemon is plainly running. That makes **tracked** permits
479
+ (`start_job` / `attach_pid`, liveness via `kill(pid, 0)` +
480
+ `/proc/<pid>/stat`) meaningless across PID namespaces. Worse, calling
481
+ `attach_pid` from *inside* the sandbox passes a pid that is invisible or
482
+ reused on the host; the daemon's liveness check fails immediately and the
483
+ permit is auto-released. Only use tracked mode when the host sees the same
484
+ pid you do (host-run jobs, or containers started with `--pid=host`).
485
+
486
+ **Lease mode** is the cross-namespace lifecycle:
487
+
488
+ 1. `acquire` → permit granted (holder label visible in the dashboard).
489
+ 2. `mark_started` → permit moves to `running_untracked` with a lease
490
+ deadline of `now + untrackedLeaseMs` (default 15 minutes,
491
+ configurable — see Configuration). No host-side pid is recorded.
492
+ 3. **Heartbeats renew the lease.** Heartbeat sources: an MCP server
493
+ process heartbeats every 30s for its own agent (`agent_id` /
494
+ `defaultAgentId`); the OpenCode plugin heartbeats every 30s per known
495
+ session. The CLI has **no** automatic heartbeat — for a CLI-held
496
+ untracked permit the lease is a hard ceiling, so finish within
497
+ `untrackedLeaseMs` or release promptly.
498
+ 4. `release` → capacity freed immediately, whatever remains on the lease.
499
+ 5. **Lease expiry:** if no heartbeat arrives before the deadline, the
500
+ daemon reclaims the permit and admits queued waiters, journaling
501
+ `untracked lease expired: no heartbeat from the owning agent`. After a
502
+ daemon restart, `restore` grants surviving untracked permits a *fresh*
503
+ lease window from restore time.
504
+
505
+ The same trap catches `load-lock run` / `run_with_permit`: those helpers
506
+ use *tracked* mode (`start_job` with the spawned job's pid). Run from
507
+ inside a PID-namespace sandbox, the pid is invisible to the host daemon,
508
+ whose liveness sweep then auto-releases the permit while the job is still
509
+ running. Inside sandboxes the recipe is therefore always:
510
+ `acquire` → `mark_started` (+ heartbeats where the harness provides them)
511
+ → explicit `release` — never `run`, `attach-pid`, or `start-job` from the
512
+ sandboxed side. Save `run` for host-side invocations where the daemon sees
513
+ the job's pid.
514
+
515
+ Tradeoff (deliberate, and the `recover list` output says so): an untracked
516
+ permit whose owner is alive but silent is reclaimed after the lease, so
517
+ overlap with an unobserved survivor is possible — e.g. two builds may run
518
+ concurrently for up to `untrackedLeaseMs` after a sandbox stopped
519
+ heartbeating. That is the price of not being able to see pids across
520
+ namespaces; keep heartbeating (or release promptly) and size
521
+ `untrackedLeaseMs` accordingly.
522
+
523
+ ### bubblewrap — live-verified
524
+
525
+ Verified 2026-10-20 with bubblewrap 0.6.1 on Linux 6.8.0-138-generic,
526
+ Node v22.23.2, load-lock 1.1.0 working tree (issue-29 branch). The daemon
527
+ ran on the *host* in an isolated state dir; every client call below ran
528
+ inside `bwrap --unshare-net --unshare-pid` and reached the **host** daemon.
529
+
530
+ 1. Start the daemon on the host, in a state dir you will bind into the
531
+ sandbox (here a temp dir; for real use `~/.local/state/load-lock`):
532
+
533
+ ```sh
534
+ LOAD_LOCK_STATE_DIR=/tmp/ll-bwrap-29 node dist/cli/main.js service start
535
+ # load-lock: daemon running on pid 2259769 (default socket)
536
+ ```
537
+
538
+ The socket appears at `/tmp/ll-bwrap-29/daemon.sock` with mode
539
+ `srwxrwxr-x` (775): connecting needs *write* on the socket inode, so a
540
+ sandbox running as the same user (or group) can talk to it.
541
+
542
+ 2. Run the CLI inside the sandbox, binding the state dir and pointing
543
+ `LOAD_LOCK_SOCKET` at it. Bind the **state dir**, not the socket file —
544
+ the socket inode is replaced when the daemon restarts, so a file-only
545
+ bind goes stale, while the dir bind follows the new socket
546
+ automatically. Binding to an existing path keeps this simple (see
547
+ caveats):
548
+
549
+ ```sh
550
+ bwrap --dev-bind / / --unshare-net --unshare-pid --proc /proc \
551
+ --bind /tmp/ll-bwrap-29 /tmp/ll-bwrap-29 \
552
+ --setenv LOAD_LOCK_SOCKET /tmp/ll-bwrap-29/daemon.sock \
553
+ --setenv LOAD_LOCK_NO_SPAWN 1 \
554
+ --setenv LOAD_LOCK_LABEL_PREFIX bwrap \
555
+ node dist/cli/main.js status --json
556
+ ```
557
+
558
+ Observed: `status --json` answered by the *host* daemon — same pid as
559
+ the host's `service status` (`2259769`, protocol v1, heavy pool
560
+ capacity 1, `untrackedLeaseMs` 900000). `--unshare-net` does not
561
+ interfere: the path socket is reached through the mount namespace.
562
+
563
+ 3. PID-namespace proof: inside the same sandbox,
564
+ `kill -0 2259769` → `No such process` — the host daemon pid is
565
+ invisible to the sandbox, confirming the client crossed namespaces via
566
+ the filesystem, and that lease mode (not tracked mode) is required for
567
+ long holds (below).
568
+
569
+ 4. Full permit round trip from inside the sandbox:
570
+
571
+ ```sh
572
+ # acquire (env LOAD_LOCK_LABEL_PREFIX=bwrap was set by bwrap):
573
+ node dist/cli/main.js acquire --op-key bwrap-check \
574
+ --reason "issue-29 live verification build" --label "issue-29 build"
575
+ # → permit prm_… ; entry.agentLabel = "bwrap:issue-29 build"
576
+
577
+ node dist/cli/main.js mark-started --permit prm_…
578
+ # → running_untracked (lease 900s)
579
+
580
+ node dist/cli/main.js release --permit prm_…
581
+ # → host pool "heavy": 0/1
582
+ ```
583
+
584
+ Host-side `status` while the permit was held:
585
+
586
+ ```
587
+ pool "heavy": 1/1 in use
588
+ held: bwrap:issue-29 build — issue-29 live verification build (5s) [untracked, leased]
589
+ ```
590
+
591
+ and `recover list` reported `[running_untracked] bwrap:issue-29 build`
592
+ with `heartbeat lease 895s remaining — reclaimed when the owning agent
593
+ stops heartbeating (overlap with an unobserved survivor is possible;
594
+ see docs)`. Five durable events on the host journal: `daemon_started`,
595
+ `daemon_recovered`, `granted bwrap:issue-29 build`, `started`,
596
+ `released`.
597
+
598
+ Caveats observed (verified):
599
+
600
+ - `bwrap` creates missing bind destinations by mkdir-ing them, so
601
+ `--bind <state-dir> /run/load-lock` failed here with
602
+ `bwrap: Can't mkdir /run/load-lock: Permission denied` (`/run` is
603
+ root-owned). Either bind at an existing path (as above), pre-create the
604
+ destination, or pick a parent you can write to.
605
+ - Client-only mode matters: with `LOAD_LOCK_NO_SPAWN=1` unset, a sandbox
606
+ whose bind/env was misconfigured would silently spawn its own daemon
607
+ inside the sandbox and split the budget. The tests in
608
+ `src/test/sandbox.test.ts` pin the loud failure instead.
609
+
610
+ ### omac — contract-inspected
611
+
612
+ **omac is not installed on the verification machine**, so nothing in this
613
+ subsection was executed here; it is assembled from omac's documented
614
+ behavior (the facts below are from omac's docs, not invented) and the
615
+ bubblewrap recipe above, which omac wraps on Linux. Treat it as a
616
+ ready-to-run procedure with expected outcomes, and record what you find.
617
+
618
+ omac sandboxes agents with bubblewrap on Linux (seatbelt on macOS, WSL2
619
+ elsewhere) and **strips the harness environment** before starting the
620
+ agent, allowing through only variables listed in the sandbox profile's
621
+ `environment.allow_vars` — `~/.config/omac/sandbox-profiles/default.json`
622
+ by default. That file is the whole recipe:
623
+
624
+ 1. Make sure the load-lock state dir is visible inside omac's bubblewrap
625
+ sandbox (the `LOAD_LOCK_SOCKET` path must resolve inside it). How
626
+ omac's sandbox mounts map to bwrap `--bind`s is an omac sandbox-config
627
+ question — omac's own facade socket under `~/.local/state/omac/run/`
628
+ is the project's precedent for a sandbox process connecting to a
629
+ host-owned socket through its profile.
630
+ 2. Add the load-lock variables to the profile's `environment.allow_vars`:
631
+
632
+ ```json
633
+ {
634
+ "environment": {
635
+ "allow_vars": [
636
+ "LOAD_LOCK_SOCKET",
637
+ "LOAD_LOCK_STATE_DIR",
638
+ "LOAD_LOCK_NO_SPAWN",
639
+ "LOAD_LOCK_LABEL_PREFIX"
640
+ ]
641
+ }
642
+ }
643
+ ```
644
+
645
+ Set the values themselves in your harness env (or the profile's env
646
+ mechanism): `LOAD_LOCK_SOCKET` to the host daemon socket as seen inside
647
+ the sandbox, `LOAD_LOCK_NO_SPAWN=1`, and — recommended —
648
+ `LOAD_LOCK_LABEL_PREFIX=omac` so the dashboard shows holders as
649
+ `omac:<label>`.
650
+ 3. Watch out: **omac never rewrites a profile it has created**, so if your
651
+ `default.json` already exists, edit it by hand (adding the entries
652
+ above); and **unknown profile fields are errors**, so don't invent
653
+ other keys — `allow_vars` entries are plain variable names.
654
+
655
+ Expected outcome (unverified here): with those four variables allowed and
656
+ the state dir mounted, an agent inside omac behaves exactly like the
657
+ verified bubblewrap case above — host daemon answers, labels carry the
658
+ `omac:` prefix, and long holds need `mark_started` + heartbeats (lease
659
+ mode) because of the PID namespace.
660
+
661
+ ### Docker — contract-inspected
662
+
663
+ Docker *was* verified for in-container daemons (see the verified Docker
664
+ subsection above). What was **not** verified here is the thin-client shape
665
+ below: the verification machine has a `docker` binary but the verifying
666
+ user cannot reach `/var/run/docker.sock`, so this recipe is
667
+ contract-inspected — ready to run, expected outcomes marked, not executed
668
+ by us.
669
+
670
+ 1. Run the daemon on the host (normal install, default state dir).
671
+ 2. Run the container as a thin client of the *host* daemon:
672
+
673
+ ```sh
674
+ docker run --rm -it \
675
+ -v ~/.local/state/load-lock:/run/load-lock \
676
+ -e LOAD_LOCK_SOCKET=/run/load-lock/daemon.sock \
677
+ -e LOAD_LOCK_NO_SPAWN=1 \
678
+ -e LOAD_LOCK_LABEL_PREFIX=docker \
679
+ node:24 bash
680
+ # inside: npm install -g <load-lock tarball> && load-lock status
681
+ ```
682
+
683
+ Expected: `load-lock status` reports the *host* daemon's pid and pool
684
+ counts, and holders created inside the container appear on the host
685
+ dashboard as `docker:<label>`.
686
+
687
+ Notes and caveats (unverified expectations):
688
+
689
+ - Bind the **state dir**, not the socket file (the socket inode is
690
+ replaced on daemon restart; the dir bind follows it — same reasoning as
691
+ bubblewrap above).
692
+ - Connecting to the socket needs *write* on the socket inode (mode `775`,
693
+ user/group). Container root gets this via `CAP_DAC_OVERRIDE` when no user
694
+ namespace remapping is in play; for non-root containers run with
695
+ `--user "$(id -u):$(id -g)"` and rely on the group permission, or relax
696
+ the socket mode/group to match your setup.
697
+ - Container pids are not host pids, so — exactly as in the bubblewrap
698
+ case — use `mark_started` + heartbeat lease mode for long holds, never
699
+ `attach_pid`/`start_job` from inside, unless the container runs with
700
+ `--pid=host`.
701
+ - The verified caveats from the Docker subsection above still apply from
702
+ the client's point of view (`/proc/loadavg` and `nproc` reflect the
703
+ host; the container's own cgroup quota is what `inspect` reports).
704
+
705
+ ### macOS seatbelt — contract-inspected
706
+
707
+ **No macOS machine was available** for this verification, so this is
708
+ contract-inspected against the `sandbox-exec(5)`/seatbelt documentation,
709
+ not executed here.
710
+
711
+ On macOS the daemon listens on a Unix domain socket at
712
+ `~/.local/state/load-lock/daemon.sock`, and connecting to a UDS is
713
+ mediated by seatbelt as a *file* operation, not a network one — so a
714
+ profile needs read and write access to the socket path, e.g.:
715
+
716
+ ```lisp
717
+ (allow file-read-data
718
+ (literal "/Users/you/.local/state/load-lock/daemon.sock"))
719
+ (allow file-write*
720
+ (literal "/Users/you/.local/state/load-lock/daemon.sock"))
721
+ ```
722
+
723
+ (no `network-outbound` rules required for the path-socket transport;
724
+ `allow network*` forms are not the mechanism a UDS connect goes through
725
+ under seatbelt). Since the socket inode is recreated when the daemon
726
+ restarts, allow the containing directory too if your profile is
727
+ path-literal strict, or re-generate the profile. Expected outcome
728
+ (unverified): with those file rules plus the env vars
729
+ (`LOAD_LOCK_SOCKET`, `LOAD_LOCK_NO_SPAWN=1`,
730
+ `LOAD_LOCK_LABEL_PREFIX=…`) passed through to the agent, a seatbelt-sandboxed
731
+ client talks to the host daemon exactly as in the verified bubblewrap
732
+ case. omac's macOS sandboxing uses seatbelt under the hood with the same
733
+ `environment.allow_vars` env-stripping as on Linux, so the omac recipe
734
+ above (profile `allow_vars` + bridged socket path) applies unchanged.
735
+
736
+ ### WSL2 — honest state
737
+
738
+ There is no verified cross-boundary story for WSL2, and we won't pretend
739
+ otherwise:
740
+
741
+ - The Windows transport is a named pipe (`\\.\pipe\load-lock`); named
742
+ pipes are not reachable from inside a WSL2 distro. A WSL-side Unix
743
+ socket is likewise not reachable from Windows-native processes.
744
+ - There is deliberately no TCP transport (a non-goal), so there is no
745
+ loopback bridge to fake one.
746
+
747
+ The realistic shape: **the WSL2 Linux VM is the host.** Run the daemon
748
+ inside the distro (`~/.local/state/load-lock`, normal install — see the
749
+ WSL2 procedure subsection above for the unverified-but-expected resource
750
+ reporting), and treat Windows-native agents as out of scope for now.
751
+ Cross-distro bridging (two distros sharing one daemon via a `/mnt/wsl`
752
+ shared directory bind-mounted as the state dir) is an *unverified
753
+ expectation*: `/mnt/wsl` is shared across distros, so the same
754
+ bind-the-state-dir recipe should apply, but nobody has run it — verify
755
+ and record before relying on it. Keep the state dir on the Linux
756
+ filesystem, not `/mnt/c` (drvfs/9p is slow and lock semantics differ, as
757
+ in the WSL2 caveats above).
758
+
362
759
  ## macOS / Windows notes
363
760
 
364
761
  - macOS: no cgroup limits; process-liveness checks fall back from
@@ -401,7 +798,7 @@ What the adapter does:
401
798
  reaches the daemon over the pipe (it probes by connecting, since a pipe
402
799
  is not a filesystem entry).
403
800
 
404
- 2. Run two `load-lock acquire` in separate shells, then `load-lock top --once`.
801
+ 2. Run two `load-lock acquire` in separate shells, then `load-lock dashboard --once`.
405
802
 
406
803
  Expected: the same queue/permit behavior as on Linux — the pipe carries
407
804
  the identical NDJSON protocol.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aron98/load-lock",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "Machine-wide counting semaphore coordinating resource-intensive work across parallel coding agents (OpenCode, Codex CLI, Claude Code, ...)",
5
5
  "type": "module",
6
6
  "license": "MIT",