@dibssoftware/dibs 0.0.178 → 0.0.180

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +40 -2
  2. package/README.md +49 -196
  3. package/bin/dibs-guard.mjs +10 -1
  4. package/bin/dibs.mjs +72 -31
  5. package/docs/benchmarks.md +1 -1
  6. package/docs/files.md +1 -1
  7. package/docs/guard.md +6 -0
  8. package/docs/machines.md +1 -1
  9. package/docs/questions.md +7 -3
  10. package/docs/reference.md +157 -0
  11. package/docs/relay.md +9 -7
  12. package/docs/releasing.md +11 -8
  13. package/docs/scheduling.md +6 -6
  14. package/docs/windows.md +14 -0
  15. package/package.json +2 -1
  16. package/skills/dibs/SKILL.md +104 -83
  17. package/src/acquire.mjs +102 -34
  18. package/src/agents.mjs +7 -22
  19. package/src/alerts.mjs +157 -57
  20. package/src/answers.mjs +2 -2
  21. package/src/board.mjs +3 -4
  22. package/src/broker.mjs +26 -11
  23. package/src/commands.mjs +39 -14
  24. package/src/config.mjs +27 -6
  25. package/src/cool.mjs +104 -9
  26. package/src/diskwarn.mjs +32 -35
  27. package/src/events.mjs +13 -2
  28. package/src/files.mjs +52 -67
  29. package/src/guard.mjs +52 -6
  30. package/src/guardd.mjs +97 -0
  31. package/src/guardw.mjs +19 -0
  32. package/src/hogs.mjs +18 -5
  33. package/src/later.mjs +20 -25
  34. package/src/lock.mjs +292 -0
  35. package/src/measure.mjs +9 -4
  36. package/src/news.mjs +101 -0
  37. package/src/notes.mjs +171 -0
  38. package/src/notices.mjs +52 -13
  39. package/src/ondemand.mjs +6 -3
  40. package/src/override.mjs +60 -14
  41. package/src/plain.mjs +7 -4
  42. package/src/platform.mjs +165 -35
  43. package/src/preempt.mjs +54 -6
  44. package/src/primer.mjs +43 -15
  45. package/src/proc.mjs +39 -8
  46. package/src/progress.mjs +33 -4
  47. package/src/questions.mjs +8 -22
  48. package/src/relay.mjs +10 -22
  49. package/src/remote.mjs +12 -8
  50. package/src/schedule.mjs +182 -44
  51. package/src/serve.mjs +22 -3
  52. package/src/service.mjs +4 -3
  53. package/src/state.mjs +139 -47
  54. package/src/stats.mjs +3 -2
  55. package/src/talk.mjs +335 -73
  56. package/src/trust.mjs +7 -1
  57. package/src/util.mjs +28 -2
  58. package/src/version.mjs +1 -1
  59. package/src/web.mjs +19 -27
  60. package/src/worker.mjs +2 -1
package/docs/releasing.md CHANGED
@@ -1,25 +1,28 @@
1
1
  # Releasing
2
2
 
3
- How a version reaches people: dibs.cc, GitHub and the plugin marketplaces. The steps in AGENTS.md (suite twice, version bumps, CHANGELOG) come first; this is what happens after.
3
+ How a version reaches people: dibs.cc, npm, GitHub and the plugin marketplaces. The steps in AGENTS.md (suite twice, version bumps, CHANGELOG) come first; this is what happens after.
4
4
 
5
5
  ## Where a release goes
6
6
 
7
7
  | where | what | how people get it |
8
8
  |---|---|---|
9
9
  | `https://dibs.cc/install.sh` | install.sh with the release's sha256 written in | `curl -fsSL https://dibs.cc/install.sh \| sh` |
10
- | `https://dibs.cc/releases/` | `dibs-vX.tar.gz`, `dibs-vX.tar.gz.sha256`, `install-vX.sh` | install.sh downloads the tarball and always checks its sum |
11
- | `https://dibs.cc/mac/` | the signed, notarized `dibs-X.dmg` and `latest.json` | `/mac/` redirects to the newest DMG (a 404 until the first one is uploaded); the app checks `latest.json` daily |
10
+ | `https://dibs.cc/install.ps1` | install.ps1, the same for native Windows | `irm https://dibs.cc/install.ps1 \| iex` |
11
+ | `https://dibs.cc/releases/` | `dibs-vX.tar.gz`, `dibs-vX.tar.gz.sha256`, `install-vX.sh`, `install-vX.ps1` | install.sh and install.ps1 download the tarball and always check its sum |
12
+ | `https://dibs.cc/mac/` | the signed, notarized `dibs-X.dmg` and `latest.json` | `/mac/` redirects to the newest DMG; the app checks `latest.json` daily |
13
+ | npm | `@dibssoftware/dibs` | `npm i -g @dibssoftware/dibs` |
12
14
  | GitHub | the tag, and a release with GitHub's own tarball (`.github/workflows/release.yml`) | the repo, and the Claude Code and Codex plugin marketplaces |
13
15
 
14
- The dibs.cc files live in the R2 bucket `dibs-releases`; the `dibs-waitlist` Worker serves `/install.sh`, `/releases/*` and `/mac/*` from it.
16
+ The dibs.cc files live in the R2 bucket `dibs-releases`; the `dibs-waitlist` Worker serves `/install.sh`, `/install.ps1`, `/releases/*` and `/mac/*` from it.
15
17
 
16
18
  ## Steps
17
19
 
18
20
  From the public repo, after the AGENTS.md steps and with the version bumped everywhere (test/version.test.mjs checks):
19
21
 
20
- 1. `git tag vX && git push origin main vX`. The release workflow runs the suite on macOS and Linux and makes the GitHub release.
21
- 2. `sh release.sh` uploads the tarball, its sum and install.sh to dibs.cc, then downloads each back and compares bytes. `DIBS_DRY_RUN=1` builds and checks without uploading.
22
- 3. The Mac app: `dibs run xcode-build -m "mac release" -- app/release.sh`, then `sh release.sh --mac` to upload the DMG and, last, `latest.json`.
23
- 4. Plugin users get the new version once the `version` in `.claude-plugin/plugin.json` changes and their marketplace refreshes (`claude plugin marketplace update dibs`).
22
+ 1. Each change in the release lands in the public repo as a commit of its own, with its own message, authored and committed by `dibs maintainers <licensing@dibs.cc>`. Never one squashed commit per release, and never a rewrite of what's already public. `release.sh` refuses a tag with any other author since the last tag.
23
+ 2. `git tag vX && git push origin main vX`. The release workflow runs the suite on macOS and Linux, makes the GitHub release, and publishes `@dibssoftware/dibs` to npm through trusted publishing: no npm token anywhere, and npm shows the package's provenance as that workflow run. package.json has no dependencies and no scripts, so nothing runs on anyone's machine at install.
24
+ 3. `sh release.sh` uploads the tarball, its sum, install.sh and install.ps1 to dibs.cc, then downloads each back and compares bytes. `DIBS_DRY_RUN=1` builds and checks without uploading.
25
+ 4. The Mac app: `dibs run xcode-build -m "mac release" -- app/release.sh`, then `sh release.sh --mac` to upload the DMG and, last, `latest.json`.
26
+ 5. Plugin users get the new version once the `version` in `.claude-plugin/plugin.json` changes and their marketplace refreshes (`claude plugin marketplace update dibs`).
24
27
 
25
28
  The tarball is `git archive` of the tag through `gzip -n`, so the same tag always gives the same bytes and the same sum.
@@ -7,9 +7,9 @@ The README covers using dibs. This is the detail: who goes next, what a lease gu
7
7
  A waiter starts when all of these hold:
8
8
 
9
9
  1. **Each resource it names has a free slot**, or the machine has room for one more on top (see "Running side by side" below).
10
- 2. **Nobody ahead of it in line wants the same resource and could use it.** Your own session's hold on a resource covers your runs on it, and so does the `dibs run` you're nested in. "Ahead" means arrival time, shifted by: its run time (what its command has taken, the median of its last ten runs, or `--est` until dibs has seen it, or 2 minutes for one never seen: shorter than 2 minutes moves it up, longer moves it back by the difference, an hour at most, so a 30-second check goes ahead of a 20-minute suite that arrived up to about 19 minutes before it, and no job waits behind quicker work much longer than it runs), heavy use of the same resources by the same agent in the last hour (5 minutes of use costs a minute, up to 10 minutes back, for fair share: an hour of test runs doesn't cost you your turn on the simulator), and priority (`urgent` +2 hours, `high` +1 hour, `normal` 0, `low` -10 minutes, `idle` -60: a high job goes ahead of a normal one unless that has waited an hour longer. `low` and `idle` run at background priority, and `idle` starts only when nobody else is waiting) and by a deadline that's getting close (`--by`: once slack drops under 20 minutes, you move up, by at most an hour). Every shift is bounded, so nobody waits forever. **The instant lane:** a job whose command usually takes under 15 seconds (the middle of its last ten runs) starts beside anything on a resource whose slots are capacity (tests, browsers, heavy jobs, Xcode builds), past full slots, the line and the load ceiling, as long as memory, disk and swap allow. Never on an exclusive resource (the shared simulator, deploys, a lock) or a simulator pool. **Pairs that slow each other:** dibs compares each command's runs that spent most of their time beside a kind of work (a resource) with its runs that didn't. If it has taken 1.8 times as long or more beside work running now (three runs of each to go on), or makes that job take that long, it waits for that job to finish, but never longer than its own usual run time since it joined (`blocked by together`). **Backfill:** you may pass someone who can't start yet anyway, if you'll be done before they could have started.
11
- 3. **It fits the budgets.** What jobs book never adds up past the memory budget (8 GB by default), whatever the machine looks like: nothing starts past it. Memory counts what each job was handed (asked for, or raised to what its command has used), or what its whole process tree was last measured using when that's more: a job that outgrows its number still fills the machine. **Booked at what it uses:** a run measured for 3 minutes books its peak so far plus 1 GB instead of its ask, never more than its ask. Once its memory has stopped climbing for 2 minutes, it books what it uses now plus 1 GB, or only what it uses once it has been idle 5 minutes. The gap between asks and use goes to waiters, but a waiter let into it (one that wouldn't fit if every running job used its full ask) also needs the machine to show the room: memory pressure normal, swap not growing, and the job plus 3 GB (or a fifth of the machine's memory, if that's more) free by the OS's reading (`kern.memorystatus_level` on macOS, MemAvailable on Linux). So a job that spikes later can't push the machine into swap. Past the booking too: when what running jobs measure using right now, plus the job, fits the budget and the machine shows that same room, it starts; bookings keep a job's peak for minutes after it falls. Swap that's high but holding still doesn't count against that room; only growing swap and memory pressure do. Cores count what each running job was last measured using (every 10 seconds), and what it asked for until its first measurement: suites and builds ask for their peak and spend most of a run under it, and a few too many busy cores only slows everyone a little, so on a quiet machine the CPU budget steps aside. A job as big as the whole budget runs when nothing else is; your own holds and file leases don't count as something else. A run inside your own hold (or nested in your `dibs run`) uses the memory that hold reserved, so the two count once: at the larger of what the hold reserved and what the runs inside it use. Paused jobs keep their memory but take no cores.
12
- 4. **The machine can take it.** Free disk covers the job's need and stays above `minDisk` (5G): below that nothing starts, `urgent` work and runs inside your own hold included. The machine isn't short on memory right now: while the OS reports memory pressure at warning or critical, or swap is over `maxSwap` (4G), grew by more than 512 MB in the last 5 minutes and is still growing over the last minute and a half, work below `urgent` waits while anything else is running. The OS's free-memory reading counts compressed and cached memory as free and can say 60% while the Mac pages gigabytes to disk, and on macOS swap grows on the startup disk. Swap alone doesn't count: macOS keeps it allocated for hours after a crunch ends. dibs keeps a swap reading every 30 seconds in `~/.dibs/swap.json` to see the growth. With nothing else running, one job starts, since waiting can't help then. `"maxSwap": null` turns the swap check off; memory pressure still counts. Swap needs free disk to grow into, so while swap is growing or memory pressure is above normal, work below `urgent` also keeps `swapRoom` (3G) free on top of what it needs (8 GB with the stock `minDisk`), and while free disk falls more than 3 GB in 5 minutes, fast enough to be under that within 10 minutes, it waits for it to hold steady (a disk with plenty free that two builds are writing to holds nobody up); in both cases one job still starts with nothing else running. If the swap, pressure and disk-for-swap waits keep every job out for 10 minutes, counting only starts that went through them (not runs inside your own hold, not urgent work), the smallest and shortest waiter they hold back starts anyway, one at a time until its memory has held steady for 2 minutes, while free disk is over `minDisk` and pressure isn't critical. `"swapRoom": null` turns the room off, and `"minDisk": null` the floor. For jobs of 2 GB or more, the OS also reports at least 15% of memory free. If free disk can't be read, the board says `disk unknown` and `dibs run` says the disk check is off.
10
+ 2. **Nobody ahead of it in line wants the same resource and could use it.** Your own session's hold on a resource covers your runs on it, and so does the `dibs run` you're nested in. "Ahead" means arrival time, shifted by: its run time (what its command has taken, the median of its last ten runs, or `--est` until dibs has seen it, or 2 minutes for one never seen: shorter than 2 minutes moves it up, longer moves it back by the difference, an hour at most, so a 30-second check goes ahead of a 20-minute suite that arrived up to about 19 minutes before it, and no job waits behind quicker work much longer than it runs), heavy use of the same resources by the same agent in the last hour (5 minutes of use costs a minute, up to 10 minutes back, for fair share: an hour of test runs doesn't cost you your turn on the simulator), and priority (`urgent` +2 hours, `high` +1 hour, `normal` 0, `low` -10 minutes, `idle` -60: a high job goes ahead of a normal one unless that has waited an hour longer. `low` and `idle` run at background priority, and `idle` starts only when nobody else is waiting) and by a deadline that's getting close (`--by`: once slack drops under 20 minutes, you move up, by at most an hour). Every shift is bounded, so nobody waits forever. **The quick lane:** a command that takes under `quickUnder` (15 seconds unless set; the middle of its last ten runs, or `--quick` or an `--est` that short before dibs has seen it) starts at once: past the line, the slots of shared and pool resources, warning memory pressure, swap and the load ceiling. The disk floor, critical pressure, file leases and someone else's hold still stop it, and it never pauses anyone. At most 2 run at once. On an exclusive resource it goes to the front of the line instead of alongside, unless the resource says `quickAlongside: "other-repo"` (deploys do) and every job on it is another repo's. A run that goes over `quickUnder` loses the pass for its command until a run comes in under again. The board marks these `quick`. **Pairs that slow each other:** dibs compares each command's runs that spent most of their time beside a kind of work (a resource) with its runs that didn't. If it has taken 1.8 times as long or more beside work running now (three runs of each to go on), or makes that job take that long, it waits for that job to finish, but never longer than its own usual run time since it joined (`blocked by together`). **Backfill:** you may pass someone who can't start yet anyway, if you'll be done before they could have started.
11
+ 3. **It fits the budgets.** What jobs book never adds up past the memory budget (8 GB by default), whatever the machine looks like: nothing starts past it. Memory counts what each job was handed (asked for, or raised to what its command has used), or what its whole process tree was last measured using when that's more: a job that outgrows its number still fills the machine. **Booked at what it uses:** a run measured for 3 minutes books its peak so far plus 1 GB instead of its ask, never more than its ask. Once its memory has stopped climbing for 2 minutes, it books what it uses now plus 1 GB, or only what it uses once it has been idle 5 minutes. The gap between asks and use goes to waiters, but a waiter let into it (one that wouldn't fit if every running job used its full ask) also needs the machine to show the room: memory pressure normal, swap not growing, and the job plus 3 GB (or a fifth of the machine's memory, if that's more) free by the OS's reading (`kern.memorystatus_level` on macOS, MemAvailable on Linux). So a job that spikes later can't push the machine into swap. Each measured run records how far in it reached its peak, and a running job that has gone well past where its command's last 5 runs peaked (a quarter longer, plus 2 minutes, not counting time paused) is done growing: it counts at what it books, not its ask, so a waiter beside it needs only that much of the budget. A command that peaks late, or whose runs don't say when they peak, keeps its ask until then. Past the booking too: when what running jobs measure using right now, plus the job, fits the budget and the machine shows that same room, it starts; bookings keep a job's peak for minutes after it falls. Swap that's high but holding still doesn't count against that room; only growing swap and memory pressure do. Cores count what each running job was last measured using (every 10 seconds), and what it asked for until its first measurement: suites and builds ask for their peak and spend most of a run under it, and a few too many busy cores only slows everyone a little, so on a quiet machine the CPU budget steps aside. A job as big as the whole budget runs when nothing else is; your own holds and file leases don't count as something else. A run inside your own hold (or nested in your `dibs run`) uses the memory that hold reserved, so the two count once: at the larger of what the hold reserved and what the runs inside it use. Paused jobs keep their memory but take no cores.
12
+ 4. **The machine can take it.** Free disk covers the job's need and stays above `minDisk` (5G): below that nothing starts, `urgent` work included (runs inside your own hold go on what the hold got). Low disk is a wait, never a refusal at the start: the job keeps its place, free disk is read again at every poll, and it starts the moment there's room. Only a job that writes next to nothing starts below the floor, keeping 1 GB free: one whose last ten runs (at least two, none run while the watcher cleared caches) ate under 100 MB at the middle, and whose last run did too, on any resource; before that, only one whose `--disk` says so (under 100 MB, or 1 GB or less on resources that declare no disk need: tests, deploys, locks). A job the person waits on (`high`, `urgent`, or `--by` with `-m`) may go down to 3 GB free, the same hard floor the watcher pauses jobs at, and doesn't wait for the room kept for swap. Under 1 GB free the watcher pauses the dibs job writing the most, whatever its priority or resource, one each pass, says so to its session and the person, and resumes it at 2 GB. The machine isn't short on memory right now: while the OS reports memory pressure at warning or critical, or swap is over `maxSwap` (4G), grew by more than 512 MB in the last 5 minutes and is still growing over the last minute and a half, work below `urgent` waits while anything else is running. The OS's free-memory reading counts compressed and cached memory as free and can say 60% while the Mac pages gigabytes to disk, and on macOS swap grows on the startup disk. Swap alone doesn't count: macOS keeps it allocated for hours after a crunch ends. dibs keeps a swap reading every 30 seconds in `~/.dibs/swap.json` to see the growth. With nothing else running, one job starts, since waiting can't help then. `"maxSwap": null` turns the swap check off; memory pressure still counts. Swap needs free disk to grow into, so while swap is growing or memory pressure is above normal, work below `urgent` also keeps `swapRoom` (3G) free on top of what it needs (8 GB with the stock `minDisk`), and while free disk falls more than 3 GB in 5 minutes, fast enough to be under that within 10 minutes, it waits for it to hold steady (a disk with plenty free that two builds are writing to holds nobody up); in both cases one job still starts with nothing else running. If the swap, pressure and disk-for-swap waits keep every job out for 10 minutes, counting only starts that went through them (not runs inside your own hold, not urgent work), the smallest and shortest waiter they hold back starts anyway, one at a time until its memory has held steady for 2 minutes, while free disk is over `minDisk` and pressure isn't critical. `"swapRoom": null` turns the room off, and `"minDisk": null` the floor. For jobs of 2 GB or more, the OS also reports at least 15% of memory free. If free disk can't be read, the board says `disk unknown` and `dibs run` says the disk check is off.
13
13
  5. **The load is under the ceiling**, when there is one (`maxLoad`, set by `dibs pace`). `urgent` and `high` work skips this rule, and so does work that already holds a lease (below).
14
14
  6. **The last user's `onRelease` has finished** putting the resource back.
15
15
  7. **A quota has the tokens**, for `quota:<name>` (below).
@@ -37,7 +37,7 @@ Run times come from history (the median of the last 10 runs of the same command
37
37
  - **Something always runs.** dibs never leaves every job paused. Each pause it makes on its own (for urgent work, memory pressure or low disk) is refused if it would leave no job running, counting a run nested in a paused one as paused too. If every running job is paused anyway, because the one still going ended, the next dibs call that changes the state (and the watcher every 10 seconds) resumes the paused job closest to done, and `~/.dibs/cool.log` says so. dibs also never pauses a job about to finish: under 2 minutes left, or in the last tenth of its usual run. With nothing running at all, a small job (2 GB or less) that's urgent or known to take under 2 minutes may start past memory the paused jobs and idle holds still book, unless memory pressure is critical. Only the person's own `dibs pause` may leave every job paused. A job dibs stops and requeues for the disk (below) isn't paused: it gives back all its memory, so stopping it may leave nothing running, and that's meant.
38
38
  - **Agents know each other by name.** dibs reads the Claude session name from `~/.claude/sessions`, the same name `SendMessage` uses.
39
39
 
40
- Exit codes: the command's own, or 75 gave up waiting in line (not a failure: the command never started), 1 nothing matched (`mine`, `release`), 74 not enough disk with nothing running that would free it, 76 lost the coordinator or the other machine before a remote job started (safe to send again), 77 lost it after the job started (it may have run: check first), 127 the command didn't start, 2 bad usage (including a resource name close to a real one, an agent's high or urgent `dibs boost` without `-m`, and a `dibs run` you already have waiting or running), 70 dibs itself crashed (a bug in dibs; report it with `dibs ask`).
40
+ Exit codes: the command's own, or 75 gave up waiting in line (not a failure: the command never started), 1 nothing matched (`mine`, `release`), 74 not enough disk (the run needs more than the whole disk, or the wait limit ran out while disk held it; low disk is otherwise a wait), 76 lost the coordinator or the other machine before a remote job started (safe to send again), 77 lost it after the job started (it may have run: check first), 127 the command didn't start, 2 bad usage (including a resource name close to a real one, an agent's high or urgent `dibs boost` without `-m`, and a `dibs run` you already have waiting or running), 70 dibs itself crashed (a bug in dibs; report it with `dibs ask`).
41
41
 
42
42
  ## Measuring what jobs use
43
43
 
@@ -82,7 +82,7 @@ A profile sets `res` (one name, a comma list or an array), `ports`, `mem`, `cpu`
82
82
  Anyone may `dibs boost`, `pause`, `resume`, `stop` and `cap` any job: the person, or any agent, its own session's work or another's. Each change is kept on the job with who made it (`owner.by`, the pause's `by`, `stopBy`; none means the person), shown on the board (`[boosted by web-app: release blocked]`, `[paused by web-app]`) and logged in `dibs history` as an `override` event with `by` and `byAgent`.
83
83
 
84
84
  - An agent raising a job to `high` or `urgent` passes `-m`, as it does on `dibs run -p`, so everyone sees why.
85
- - An agent's urgent gets what the person's does: past the swap and disk-room waits (only urgent work starts during those), past paused jobs' booked memory, and pausing low runs for a slot. The hard limits hold for everyone: below `minDisk` nothing starts, the memory budget holds unless the machine really has room, critical memory pressure stops the small-job exceptions, and dibs never pauses every job on its own.
85
+ - An agent's urgent gets what the person's does: past the swap and disk-room waits (only urgent work starts during those), past paused jobs' booked memory, and pausing low runs for a slot. The hard limits hold for everyone: below `minDisk` nothing starts but jobs that write next to nothing, the memory budget holds unless the machine really has room, critical memory pressure stops the small-job exceptions, and dibs never pauses every job on its own.
86
86
  - A job that was stopped tells its agent who stopped it and to find out why before running it again.
87
87
 
88
88
  ## Pausing low-priority work
@@ -90,7 +90,7 @@ Anyone may `dibs boost`, `pause`, `resume`, `stop` and `cap` any job: the person
90
90
  - **For urgent work.** When an `urgent` or `high` waiter is stuck behind a `low` or `idle` run on a full resource, dibs stops that run's whole process tree (SIGSTOP on every process group it has) and lends the waiter its slot. It pauses only as many runs as it takes, and only if that lets the waiter start right away; if something else would still block it (normal work holding another resource it wants, the memory budget, disk), nothing is paused. The paused run resumes (SIGCONT) the moment the waiter's lease ends, whether it finished, crashed, or was killed: whatever dibs call next reads the state does it.
91
91
  - **Under memory pressure.** `dibs throttle --watch` reads the OS memory pressure every 10 seconds (`kern.memorystatus_vm_pressure_level` on macOS, `/proc/pressure/memory` on Linux). After two critical readings in a row it pauses one idle or low run (the one furthest over the memory it was handed first, then idle before low, then the most memory), and another after each further two. After a minute of normal readings it resumes one, lighter first, then waits another minute before the next. A warning reading resets both counts, so nothing flaps while the machine hovers. When the watcher stops, it resumes everything it paused; if it dies, the next dibs call does.
92
92
  - **When swap fills the disk.** Holding new starts doesn't stop jobs already running from growing. The same watcher reads free disk every 10 seconds: while it's under `minDisk` (never under 3 GB, whatever `minDisk` says) and swap is still growing (or free disk fell more than 3 GB in 5 minutes), and still is over the last minute and a half, it pauses one more run each pass, two when free disk is falling fast enough to be down to 1 GB within two minutes: a job on top first, then `idle`, `low` and `normal` work, newest first. `urgent` and `high` work and holds are never paused, and nothing is killed. Once free disk has been back over the line it pauses at and steady for a minute, it resumes one, then another a minute later. A paused job's memory stays in swap, so the disk may never come back over the line: after 3 minutes with nothing growing or falling it resumes one anyway, since waiting frees nothing then. Free some space or end a paused job yourself if it keeps happening.
93
- - **Before the disk runs out.** Under twice `minDisk`, the watcher clears caches that rebuild themselves (npm's and Homebrew's, simulators `simctl` calls unavailable, Xcode DerivedData no build has touched in a day), at most every 30 minutes and again when the disk drops under the floor, and logs what it freed in `~/.dibs/cool.log`. Then every active session (a job running or waiting, or a thread with dibs in the last hour) hears through the hook how much is free, what's growing fastest, whose folder holds the most, what dibs freed, and to free its own build output and scratch: again only once free disk has fallen another gigabyte (or something grows fast), at most every 15 minutes, and at once when it drops under the floor; under the floor, every 15 minutes. If the throttle watcher isn't running, the coordinator (`dibs serve`) sends the notes and clears the caches instead. Under the floor the note says to save work now, and names each agent's running jobs (they may fail writing) and waiting ones. A job paused for the disk tells its agent through the hook right away.
93
+ - **Before the disk runs out.** Under twice `minDisk`, the watcher clears caches that rebuild themselves (npm's and Homebrew's, simulators `simctl` calls unavailable, Xcode DerivedData no build has touched in a day), at most every 30 minutes and again when the disk drops under the floor, and logs what it freed in `~/.dibs/cool.log`. Then each session with something of its own to free (a scratch folder over 2 GB, or running jobs that wrote a gigabyte or more) hears through the hook how much is free, what's growing fastest, whose folder holds the most, what dibs freed, and to free its own build output and scratch. It hears once per band: once under twice the floor and once more under the floor, and again only after the disk has had room (over twice the floor) and falls again. Other sessions hear nothing; the person sees the whole machine in `dibs alerts`. If the throttle watcher isn't running, the coordinator (`dibs serve`) sends the notes and clears the caches instead. Under the floor the note says to save work now, and names each agent's running jobs (they may fail writing) and waiting ones. A job paused for the disk tells its agent through the hook right away.
94
94
  - **Who is filling the disk.** While free disk is under `minDisk`, or a waiter is held for its own disk need, the same watcher measures the session folders in Claude Code's temp folder (`/private/tmp/claude-<uid>/<project>/<session>`) every 10 minutes and keeps the three biggest over 2 GB in `~/.dibs/hogs.json`. Each one's agent (the one that made its biggest scratchpad folder, else the session's main thread) hears once per drop, through the hook, how big it is, what fills it (git worktrees, node_modules) and how to free it. A disk wait (`dibs why`, `dibs when`, the wait message) names the biggest folder and whose session it is, so a waiting agent knows whom to ask: only that session, or the person, may delete there. It also names what grew most since the last reading, 10 minutes before (each session folder, swap, simulators, Xcode build output, caches, and dibs's copies of other machines' jobs, read from twice the floor down): `Growing fastest: swap, up 2.5 GB in 10 min`. Under half a gigabyte isn't named. Memory pressure easing doesn't resume what the disk paused. If the watcher stops while the disk is still short, its disk pauses stay for a minute so the restarted watcher takes them over, instead of every paused job resuming at once.
95
95
  - **Never all of them.** None of these pauses the last running job, or one about to finish (see What it guarantees).
96
96
  - **When the paused jobs themselves fill the disk.** A paused job keeps its memory, and under memory pressure that memory goes to swap, which fills the disk the job is waiting for. So while free disk is under the line and swap is still growing, the watcher stops one disk-paused job each pass, the one using the most memory, instead of pausing another. The job isn't lost: its own `dibs run` puts it back at the front of its line and runs the command again from the start once there's room, in the same call, and its agent hears why through the hook. Only on resources marked `rerun` (test, playwright, xcode-build and heavy by default; never deploy or sim), never a job a person or agent paused, and never one about to finish. The same goes for a job running far past what it booked, paused or not, even the only one running: at least 4 GB over its booking and either twice it or more than all the memory dibs shares out. That job goes back at the front booked at what it really used (up to the budget), what it used goes into the history so later runs are planned at it too, and it starts again only once that much memory is really free and swap holds still. A job stopped this way once isn't stopped for it again.
@@ -0,0 +1,14 @@
1
+ # dibs on Windows
2
+
3
+ dibs works on Windows, with gaps. The full test suite runs on windows-latest in CI on every change; the tests that can't run there say why (`posixOnly` and `windowsGap` in test/helpers.mjs).
4
+
5
+ Install from PowerShell with `install.ps1`, or use WSL, where dibs is the Linux one and `install.sh` works as on any Linux machine (with a Linux Node inside WSL). Claude Code on Windows runs its commands in Git Bash, so `install.ps1` puts a `dibs` for Git Bash beside `dibs.cmd`.
6
+
7
+ ## What's missing
8
+
9
+ - **No pausing.** Windows has no SIGSTOP. dibs never pauses a job there: urgent work waits its turn instead, memory and disk pressure hold new work back but don't freeze running jobs, and `dibs pause` says so and suggests `dibs stop`.
10
+ - **No measuring.** dibs doesn't read what jobs use on Windows yet, so there's no "this job used more than it asked for", and sizes aren't learned from past runs. `--mem` and `--cpu` count as given.
11
+ - **No process groups.** dibs ends a job's whole process tree, but a process whose parent already exited can escape it, unless dibs saw it on one of its checks every 3 seconds.
12
+ - **No signals.** Windows can't deliver SIGTERM or SIGINT to a job: stopping one ends it outright, with no chance to clean up.
13
+ - **Slower, and heavy contention.** Each look at the process table is a PowerShell call. Many dibs at once (a dozen on a 4-core machine) can keep one off the state file's lock past its 45-second limit, and that one exits 75.
14
+ - **Not tested on Windows:** on-demand VMs (boat) sent from a Windows machine, and Claude Code's temp folders in low-disk notices.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dibssoftware/dibs",
3
- "version": "0.0.178",
3
+ "version": "0.0.180",
4
4
  "description": "Coding agents on one machine take turns on the simulator, Xcode builds, test suites, browser runs and deploys",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,6 +10,7 @@
10
10
  "bin/",
11
11
  "src/",
12
12
  "docs/",
13
+ "!docs/images/",
13
14
  "skills/",
14
15
  "CHANGELOG.md",
15
16
  "README.md",
@@ -1,34 +1,27 @@
1
1
  ---
2
2
  name: dibs
3
- description: How to take turns with other agents on this machine's simulators, Xcode builds, test suites, browser runs, deploys and shared files using the dibs CLI, post progress, and ask the person questions. Use before running xcodebuild, xcrun simctl, swift test, Playwright, jest, vitest, npm test, node --test or a deploy, before editing files other agents may touch, before asking the person anything, when a command, edit or subagent spawn was blocked or rewritten by dibs guard, or when dibs exits 1, 2, 70, 74, 75, 76 or 77.
3
+ description: How to take turns with other agents on this machine's simulators, Xcode builds, test suites, browser runs, deploys and shared files using the dibs CLI, post progress, and ask the person questions. Use before running xcodebuild, xcrun simctl, swift test, Playwright, jest, vitest, npm test, node --test or a deploy, before editing files other agents may touch, before asking the person anything, before ending a turn while waiting on another agent or the person, when a command, edit or subagent spawn was blocked or rewritten by dibs guard, or when dibs exits 1, 2, 3, 70, 74, 75, 76 or 77.
4
4
  ---
5
5
 
6
6
  # dibs
7
7
 
8
- Other agents share this machine. Anything that collides (the one simulator, builds that each want 4 GB, test suites that pin every core, deploys) runs through dibs, which waits for a turn, runs the command and gives the turn back when it exits. Plain reads, edits and small commands need nothing.
8
+ <!-- dibs:rules:start -->
9
+ dibs runs on this machine. Agents take turns through it on the simulator, Xcode builds, test suites, browser runs and deploys.
10
+ - Wrap those: `dibs run <resource> -m "why" -- <command>` (resources: sim, sim-own, xcode-build, test, playwright, deploy, heavy). Two at once: `dibs run sim,xcode-build -- ...`.
11
+ - No dibs for reads, edits, small commands, or long jobs that mostly wait on the network and use little CPU, memory or disk (crawlers, pollers, HTTP checks). The hook leaves those alone too.
12
+ - Start `dibs listen` with run_in_background now, and again each time it exits: it wakes you when the person or dibs has something for you.
13
+ - Waiting is normal. A call moved to the background is still waiting: don't run it again. A wait on memory, swap or disk protects the machine: keep waiting, and never lower `--mem` or raise `-p` to get past it.
14
+ - Exit 75: it gave up waiting and your command never ran; run the same command again. Exit 74: it can't fit on this disk, or its wait limit ran out; low disk just means a wait.
15
+ - Decide what you can undo yourself. Ask the person only before something you can't undo (`dibs question ... --one-way`). Lines starting "Message from the person:" are theirs: act on them.
16
+ - Post progress as you work: `dibs progress "what you did or found" --task <name> --eta 30m`, then `--done`.
17
+ - The rest (holding across tool calls, file leases, other machines, every exit code, overriding jobs, questions) is below, under "When you need it", and in `dibs help`.
18
+ <!-- dibs:rules:end -->
9
19
 
10
- ## The five you need
20
+ ## When you need it
11
21
 
12
- ```bash
13
- dibs run test -m "auth suite" -- npm test # wait for a turn, run, give it back
14
- dibs hold sim --for 20m -m "screenshot pass" # keep it across several tool calls...
15
- dibs run sim -m "shot 1" -- ./shot.sh # ...still wrap each command: under your hold it starts at once
16
- dibs release sim # ...and give it back the moment you're done
17
- dibs hold 'files:src/auth/**' -m "auth refactor" # keep other agents' edits off these paths (quote the glob)
18
- dibs progress "dry run touched 4,210 rows, 0 errors" --task billing --eta 30m # your running log; the person reads it live
19
- dibs question "Run the migration on prod now?" --options yes,no --recommend yes -m "dry run clean" \
20
- --one-way "it rewrites 4,210 rows and has no down-migration" # only a one-way door reaches the person
21
- ```
22
-
23
- Resources: `sim` (the shared booted simulator), `sim-own` (a private one), `xcode-build`, `test`, `playwright`, `deploy`, `heavy`, plus any your machine's config adds. `dibs` alone shows the board.
24
-
25
- Three habits:
26
-
27
- - Always pass `-m` with a short reason. Everyone waiting sees it.
28
- - Need two resources? Ask for both at once: `dibs run sim,xcode-build -- ...`. Never hold one while waiting for another.
29
- - If a tool call with `dibs run` or `dibs hold` times out and moves to the background, don't run it again. dibs refuses the copy (exit 2); wait for the first one's result.
22
+ Everything below is reference. Read the part you need when it comes up.
30
23
 
31
- ## Running
24
+ ### Running
32
25
 
33
26
  ```bash
34
27
  dibs run xcode-build -m "why" -- xcodebuild -scheme App build
@@ -39,24 +32,70 @@ dibs run test --after #42 -- npm run e2e # joins the
39
32
  dibs run test -- sh -c 'npm run build && npm test' # a shell line goes in sh -c
40
33
  ```
41
34
 
42
- - `$SIM` and `--port` variables are set inside the run, so put them in single-quoted `sh -c '...'`.
35
+ - `sim` is the one shared booted simulator. `sim-own` boots a private one for your command (its udid in `$SIM`) and shuts it down after.
36
+ - `$SIM` and `--port` variables are set inside the run, so put them in single-quoted `sh -c '...'`. Use `$WEB` (or whatever you named the port), never a fixed port.
37
+ - Need two resources? Ask for both in one `dibs run a,b`. Never hold one while waiting for another.
38
+ - The turn lasts exactly as long as the command: when it exits or crashes, the turn is given back and its whole process tree is killed. Don't add keepalives, `timeout` wrappers or lock files of your own.
43
39
  - Inside Claude Code, `dibs run` waits as long as it takes. Every run ends with one line on stderr, `dibs: #812 test, waited 2m10s, ran 3m04s, exit 0`; after a compaction, that line is the result.
40
+ - A command over in under 15 seconds (a deploy of a few seconds, a one-file test): add `--quick`, or `--est 10s`. It starts at once, past the line and full slots, at most 2 at a time; on the simulator, or a deploy of the same repo, it goes to the front of the line instead. dibs learns it after that. A run that goes over loses the pass until it runs under again, and you're told.
44
41
  - `--est 3m` (a duration like `30s`, `5m`, `1h`) on a job dibs hasn't seen lets short jobs move up. `--mem 6G --cpu 4` the first time you run something heavy dibs hasn't measured; after that it plans at the measured peak, and says so if a job used far more than it asked.
45
- - Priority: `-p urgent|high|normal|low|idle`. `urgent` (something's broken or a person is waiting now) and `high` (critical path) need `-m`, and everyone sees them. `--by 23:30` for a deadline.
42
+ - Priority: `-p urgent|high|normal|low|idle` (or 1-5). `urgent` (something's broken or a person is waiting now) and `high` (critical path) need `-m`, and everyone sees them. `normal` is the default. `low` (nobody waiting) and `idle` (audits, solvers, regenerating things) run at background priority on the cool cores. Pick the true level. `--by 23:30` for a deadline.
43
+ - `--notify <file>` appends a JSON line to that file when dibs exits.
44
+ - A shared API rate budget: `dibs run quota:<name> --cost N -- <cmd>` (the budgets are set in `~/.dibs/config.json` `quotas`).
45
+ - Work that runs outside dibs is moved to the slow cores when the machine runs hot (`dibs throttle`). Wrapping it lets you pick its priority.
46
46
  - A resource name close to a real one (`simulator`, `tests`) is refused with exit 2 and the right name. A new name of your own starts its own queue.
47
47
  - A suite that takes minutes: `dibs run test --shards 2 -- npx vitest run` splits it across the group's machines and merges the output and exit codes. vitest and `node --test` suites that usually take over 5 minutes split on their own; `--no-shard` keeps one piece.
48
48
 
49
- ## Holding across tool calls
49
+ ### Listening for messages
50
+
51
+ `dibs listen`, started with run_in_background, waits until something comes for you, prints all of it and exits 0, and that exit wakes you even while you sit idle. Start it at the start of your session and again each time it exits. What wakes it:
52
+
53
+ - a message for you (`dibs tell`, from the person or another agent)
54
+ - the person answering your question in their own words
55
+ - a notice from dibs about your own jobs
56
+ - dibs on this machine was updated: it prints what changed since your last version, once
57
+ - a newer dibs is out on dibs.cc ("dibs X is out (you have Y)"): the person upgrades it; don't upgrade it yourself. Asked at most every 6 hours per machine, never from a git checkout, off with `"updateCheck": false` in config.json.
58
+
59
+ Exit 0 ends with "To keep listening, start dibs listen again with run_in_background." It has no time limit: it waits until something comes, and when your session ends it exits quietly on its own. `--for 30m` sets a limit; then exit 3 means nothing came in that time, and you start it again. `--json` gives `{ messages }`, `{ updated, changes }` or `{ release }`.
60
+
61
+ One listener per agent: the main agent of a session, and each subagent, separately. A newer one replaces the older, which exits 0 saying another took over. Messages that arrive while you work come with your next tool call instead; none is lost or handed over twice. If you end a turn after your listener exited, the hook keeps you going once with "re-arm: your dibs listen has ended". The board, `dibs threads` and `dibs tell` say who is listening.
62
+
63
+ ### Holding across tool calls
50
64
 
51
65
  `dibs hold <res> --for 20m -m "why"` waits for its turn like `dibs run`, then returns. Keep wrapping each command in `dibs run <res> -- ...`: under your hold it starts without waiting. Run the hold again to extend it; an hour is the most it gets at once. `dibs release <res>` when you're done. `dibs mine` lists what you hold and wait for, and exits 1 when that's nothing, which is the clean result after a release.
52
66
 
53
67
  A script running under `dibs run deploy` that calls `dibs run xcode-build` waits only for xcode-build, ahead of waiters holding nothing.
54
68
 
55
- ## Files other agents may edit
69
+ ### When dibs holds you back
70
+
71
+ - **Memory, swap or disk** ("waiting for memory pressure to ease", "this machine to stop swapping", "free disk to stop falling"): dibs is protecting the machine. Keep waiting. Don't pass a smaller `--mem` or a higher `-p` to get past it. A memory wait names the jobs holding the most: if one is yours and finished, end it.
72
+ - **Disk at your turn:** low disk is a wait, like memory: your run or hold stays in line and starts the moment there's room (a person or another job frees it). dibs gives up on it (exit 74) only when it can't fit on this disk even empty of other jobs, or, outside Claude Code, its wait limit runs out. A command whose last runs (two or more) ate under 100 MB starts below the 5 GB floor (only 1 GB has to be free). Before it has runs, only `--disk` says it's small: under 100 MB anywhere, or 1 GB or less on test, deploy or a lock (an honest `--disk 200M` on a suite that writes nothing); its runs overrule it if they eat more. Under 1 GB free, dibs pauses whichever job is writing the most, yours included, and resumes it at 2 GB: free your own build output, don't end it. While you wait on something else, the wait message says early when disk will hold you next, so free your own build output then.
73
+ - **Paused** ("paused your job: free disk is low", or for urgent work): leave it, it resumes by itself.
74
+ - **Load** ("waiting for the machine to cool down"): ends within 20 minutes.
75
+ - **A person is waiting on the job now:** run it with `-p high -m "why"`, or send it to another machine with `--on <machine>` (`dibs machines`). That's the only reason to raise it.
76
+ - **Someone ahead of you:** agents appear by session name, the same name SendMessage uses. Message the agent ahead and ask; whoever is ahead runs `dibs yield <your name>`. If someone asks you and their work is more urgent, run `dibs yield <their name>`.
77
+ - **Lines from the dibs hook about your jobs** (stuck with no CPU for 20 minutes while others wait, over its memory, paused, a progress task overdue): they're about your own work. Act on them.
78
+
79
+ ### Exit codes
80
+
81
+ | code | meaning | what to do |
82
+ |---|---|---|
83
+ | the command's own | it ran | read it as usual |
84
+ | 75 | gave up waiting: your command never started and didn't fail (outside Claude Code, after `--max-wait`, 8m by default), or a question got no answer | rerun the same command within 2 minutes to keep your place, or add `--wait`. On a question: nothing was decided, skip that step |
85
+ | 74 | this run can't fit on this disk even when it's empty of other jobs, or (outside Claude Code) its wait limit ran out. Low disk otherwise just means you wait | the message says how much it needed. Free your own build output, or tell the person; if this run needs less, pass a smaller `--disk` on that `dibs run` (a hold's `--disk` doesn't cover the runs under it). Never delete in another session's `/private/tmp/claude-*` folder |
86
+ | 76 | lost the coordinator or the other machine before the job started | nothing ran there: send it again |
87
+ | 77 | lost the other machine after the job started | it may have run, or still be running: check before running it again, above all a deploy |
88
+ | 70 | dibs itself crashed | a bug in dibs, not your command: `dibs ask "..."` |
89
+ | 127 | the command didn't start | check the command and its path |
90
+ | 2 | bad usage: a near-miss resource name, a high or urgent boost without `-m`, a job bigger than this machine (ask for what it names, or `--anywhere`), `--on` or `dibs machines` outside a group, or a run you already have going | read the message: it names the fix |
91
+ | 1 | nothing matched (`mine` with nothing held, `release` with nothing to give back) | usually the clean result |
92
+ | 3 | `dibs listen --for <time>` heard nothing in that time (without `--for` it waits as long as your session lives) | start it again with run_in_background |
93
+
94
+ ### Files other agents may edit
56
95
 
57
96
  `dibs hold 'files:src/auth/**' -m "why"` (paths from the git root; `**` crosses folders) turns away other agents' edits and writes there, with who holds it and why. Quote the glob, or zsh expands it first and fails with "no matches found". `dibs release 'files:src/auth/**'` gives it back. If your edit is refused: wait (`dibs when files:<path>`) or message the holder. Don't write the file another way. Paths nobody leased need nothing.
58
97
 
59
- ## Progress
98
+ ### Progress
60
99
 
61
100
  Post as often as you commit. The person reads every post live on their page, the Mac app and their own Claude; other agents read them with `dibs progress`.
62
101
 
@@ -65,16 +104,39 @@ dibs progress "Starting billing-migration: script written, dry run next" --task
65
104
  dibs progress "Dry run touched 4,210 rows, 0 errors. Asking before prod" --task billing-migration --eta 30m
66
105
  dibs progress "Blocked: waiting on the person for the prod run (question #3)" --task billing-migration --blocked
67
106
  dibs progress "Done: migrated 4,210 rows on prod, checks pass" --task billing-migration --done
107
+ dibs progress list # your session's open tasks, with owner, state, ETA and last post (--all: every session's)
68
108
  ```
69
109
 
70
110
  - Post when you start (with `--eta`), when you learn something (a test fails, a cause found, a plan changed, with the numbers), when you hand off or wait (`--blocked`), and at the end (`--done`). A task of a minute or two needs just the `--done` post.
71
111
  - Keep `--task` the same short name across posts, and move `--eta` (`30m` or `17:30`) when the estimate moves.
72
- - A task still open past its `--eta` shows as overdue, and (from 0.0.173) dibs tells you once: post a new `--eta`, or `--done`. You hear once too if an open task goes 45 minutes without a post. Ending a task without finishing it: `--done` with a post that says what isn't done.
112
+ - A task still open past its `--eta` shows as overdue, and dibs tells you once: post a new `--eta`, or `--done`. You hear once too if an open task goes 45 minutes without a post. Ending a task without finishing it: `--done` with a post that says what isn't done.
73
113
  - Posts are for the record. Questions go through `dibs question`; a note the person should see now goes through `dibs say`.
74
114
 
75
- ## The person: questions, notes and messages
115
+ ### The guard
116
+
117
+ When dibs's hook sees a heavy command outside `dibs run`, it rewrites it into the `dibs run ...` line (in bypass-permissions sessions) or blocks it and prints that line. Run the line. If the command really builds, boots, tests and deploys nothing, put `DIBS_GUARD=off` in front of it. If the person set a subagent limit (config `agents.slots`), a denied spawn started nothing and isn't a failure: wait for one of yours to report back, then spawn again.
118
+
119
+ ### Looking without joining the line
120
+
121
+ `dibs` (the board, whose `Limits` line has memory, disk and swap), `dibs when sim`, `dibs who sim`, `dibs why`, `dibs mine`, `dibs history` (the last 7 days). Every command and flag: `dibs help all`. Something wrong with dibs, or a question about it: `dibs ask "..."`, or SendMessage the maintainer its answer names. When dibs says it was updated, read what changed with `dibs changes` and follow it.
76
122
 
77
- The person's rule: walk through two-way doors (anything you can undo) yourself and show them after. Bring them only one-way doors (things that can't be undone), one at a time, with your recommendation.
123
+ ### Overriding jobs and settings
124
+
125
+ You may do anything the person can, on any job: boost, lower, pause, resume, stop, cap. Use the `#` id from `dibs --detail`. On a job that isn't yours, add `--owner <its session>` as the board names it left of the `#`; without it nothing changes (exit 2) and dibs prints the command to rerun.
126
+
127
+ ```bash
128
+ dibs boost 4221 urgent -m "person waiting on the fix" # high or urgent needs -m, which everyone sees
129
+ dibs pause 4219 # dibs resume 4219 continues it
130
+ dibs stop 4219 # end it and kill its processes
131
+ dibs cap pushy low # that agent's work waits and runs at low or below until dibs cap pushy off
132
+ dibs yield web-app # let another agent go first
133
+ ```
134
+
135
+ The same goes for `answer`, `cap`, `hours`, `pace`, `tell`, `join`, `invite`, `kick`, `limit`, `connect`, `service install` and `guard install`. dibs records who did each, on the board and in `dibs history`, so act the way you'd defend to the person. Raise a job to high or urgent only when a person is waiting on it now or something is broken. Prefer a message and `dibs yield` over stopping someone else's work. If your own job was **stopped by** someone, it was ended on purpose: find out why (`dibs history`, or ask them) before running it again.
136
+
137
+ ### The person: questions, notes and messages
138
+
139
+ The person's rule: walk through two-way doors (anything you can undo) yourself and show them after. Bring them only one-way doors (ship, spend, delete, rename something public: things that can't be undone), one at a time, with your recommendation.
78
140
 
79
141
  - **A two-way door:** decide. If it's worth a record, `dibs question "..." --recommend X -m "why"` without `--one-way` logs it as decided by you, prints X on stdout at once (exit 0) and asks nobody. dibs reminds you that's what happened; that's not a refusal.
80
142
  - **A one-way door:** add `--one-way "what can't be undone"`. It prints the question's id and returns. Keep working on what doesn't need the answer. When you reach the step that does, run the same command again with `--wait`: it prints only the answer, so `answer=$(dibs question ... --wait)` works. `--timeout 1m` (or `30s`, `2h`) caps the wait.
@@ -83,17 +145,9 @@ The person's rule: walk through two-way doors (anything you can undo) yourself a
83
145
  - The person may answer in their own words. Those words are the answer, and they also reach you as `Message from the person: (answering your question #N) ...`.
84
146
  - Another agent may answer your question with `dibs answer`; then dibs says `answered by <agent>, an agent, not the person` on stderr. That isn't the person's yes: for a ship, spend or delete, ask the person or skip the step.
85
147
 
86
- `dibs say "migration done, tests pass"` leaves the person an FYI in your thread without asking anything. A line starting `Message from the person:` really is the person's, whether it sits beside a tool result or comes as the reason you were kept from stopping: act on it, and reply with `dibs say "..."` if they asked something. `Message from <agent> (another agent, not the person):` is a peer's request. `dibs tell <agent> "..."` messages an agent. If config names you the desk, reply with `dibs say --to person "..."`. Details: docs/questions.md.
87
-
88
- ## When dibs holds you back
89
-
90
- - **Memory, swap or disk** ("waiting for memory pressure to ease", "this machine to stop swapping", "free disk to stop falling"): dibs is protecting the machine. Keep waiting. Don't pass a smaller `--mem` or a higher `-p` to get past it. A memory wait names the jobs holding the most: if one is yours and finished, end it.
91
- - **Disk at your turn:** a resource that declares a disk need (the simulator asks 8 GB) is refused with exit 74 when that much isn't free and nothing running will free it. If your job needs less, pass `--disk 1G` on the hold and on each `dibs run`. From 0.0.173, a job whose own past runs ate more disk than is free waits for disk too, even alone. While you wait on something else, the wait message says early when disk will hold you next, so free your own build output then.
92
- - **Paused** ("paused your job: free disk is low", or for urgent work): leave it, it resumes by itself.
93
- - **Load** ("waiting for the machine to cool down"): ends within 20 minutes.
94
- - **Lines from the dibs hook about your jobs** (stuck with no CPU for 20 minutes while others wait, over its memory, paused, a progress task overdue): they're about your own work. Act on them.
148
+ `dibs say "migration done, tests pass"` leaves the person an FYI in your thread without asking anything. A line starting `Message from the person:` really is the person's, whether it sits beside a tool result or comes as the reason you were kept from stopping: act on it, and reply with `dibs say "..."` if they asked something. `Message from <agent> (another agent, not the person):` is a peer's request. `dibs tell <agent> "..."` (or `dibs say --to <agent> "..."`, the same thing) messages an agent. If config names you the desk, reply with `dibs say --to person "..."`. Details: docs/questions.md.
95
149
 
96
- ## Other machines
150
+ ### Other machines
97
151
 
98
152
  ```bash
99
153
  dibs run test --anywhere -m "why" -- npm test # whichever machine would start it soonest, maybe this one
@@ -103,9 +157,9 @@ dibs machines # the group, its load and lines
103
157
 
104
158
  The job takes the git working copy (tracked files plus new ones git doesn't ignore). `.env` files, keys and certificates never leave this machine, and a project's `.dibs.json` `stayOn` limits where its code may go. `--bring <path>` copies a file or folder back when the job ends.
105
159
 
106
- On a machine that isn't in a group, `--anywhere` runs here and says so, `--on` exits 2 with the setup line, and `dibs machines` says it isn't in a group (exit 0). `dibs leave` takes a machine out of its group; only run it when the person asks. To start a group, one machine is the coordinator: `dibs service install serve worker` there (or `dibs serve` in a terminal). To add a machine: on the coordinator, `dibs invite <name>` prints the join line to run on the new machine, then `dibs service install worker` there keeps it taking jobs. From 0.0.173, `dibs pair --machine` on the coordinator prints a one-time code instead, and `dibs join <code>` on the new machine finds the coordinator (same network, Tailscale, or `--at <address>`). Details: docs/machines.md.
160
+ On a machine that isn't in a group, `--anywhere` runs here and says so, `--on` exits 2 with the setup line, and `dibs machines` says it isn't in a group (exit 0). `dibs leave` takes a machine out of its group; only run it when the person asks. To start a group, one machine is the coordinator: `dibs service install serve worker` there (or `dibs serve` in a terminal). To add a machine: `dibs connect --machine` on the coordinator prints a one-time code, `dibs join <code>` on the new machine finds the coordinator (same network, Tailscale, or `--at <address>`), and `dibs service install worker` there keeps it taking jobs. `dibs invite <name>` and its join line still work. Details: docs/machines.md.
107
161
 
108
- ## Run it later
162
+ ### Run it later
109
163
 
110
164
  ```bash
111
165
  dibs later sim --at 02:00 -m "snapshot suite" -- ./snapshots.sh # prints its id (l3) and returns
@@ -116,47 +170,14 @@ dibs later list # state, exit c
116
170
 
117
171
  When it's due it runs as `dibs run --wait` in this folder, with PATH, HOME and LANG (more with `--env NAME`). At most 7 days out. Details: docs/later.md.
118
172
 
119
- ## Overriding jobs and settings
120
-
121
- You may do anything the person can, on any job: boost, lower, pause, resume, stop, cap. Use the `#` id from `dibs --detail`. On a job that isn't yours, add `--owner <its session>` as the board names it left of the `#`; without it nothing changes (exit 2) and dibs prints the command to rerun.
173
+ ### Connecting things to dibs
122
174
 
123
- ```bash
124
- dibs boost 4221 urgent -m "person waiting on the fix" # high or urgent needs -m, which everyone sees
125
- dibs pause 4219 # dibs resume 4219 continues it
126
- dibs stop 4219 # end it and kill its processes
127
- dibs cap pushy low # that agent's work waits and runs at low or below until dibs cap pushy off
128
- dibs yield web-app # let another agent go first
129
- ```
130
-
131
- The same goes for `answer`, `hours`, `pace`, `tell`, `invite`, `pair --machine`, `service install` and `guard install`. dibs records who did each, on the board and in `dibs history`, so act the way you'd defend to the person. Raise a job to high or urgent only when a person is waiting on it now or something is broken. Prefer a message and `dibs yield` over stopping someone else's work. If your own job was **stopped by** someone, it was ended on purpose: find out why (`dibs history`, or ask them) before running it again.
132
-
133
- ## The person's page and MCP
134
-
135
- If the person asks you to connect something to dibs:
136
-
137
- - From a phone or any browser: `dibs pair --remote` prints a one-time link to https://app.dibs.cc, end-to-end encrypted through the relay; it can only look unless paired with `--allow-actions`.
138
- - The page and MCP server: `dibs web` (or `dibs service install web`) at `http://127.0.0.1:7421`, MCP at `/mcp`. Another machine on Tailscale reaches it with `dibs web --bind <tailscale address>`. A claude.ai connector on another account uses `https://mcp.dibs.cc/mcp` after the person runs `dibs relay mcp on`.
139
- - Sign-in is a one-time code from `dibs pair` (10 minutes, one use), which gives read-only tools. From 0.0.173, a code from `dibs pair --allow-actions` adds tools that act (post progress, answer questions, message agents, hold, boost, pause, stop); the client acts as an agent named `mcp-<name>`, never as the person. A code from `dibs pair --allow-commands` also lets a client signed in at this Mac's own address queue commands, never through mcp.dibs.cc.
140
- - `dibs pair --list` shows what's signed in and what each may do; `dibs pair --revoke <id|all>` signs it out. Details: README.md and docs/relay.md.
141
-
142
- ## Exit codes
143
-
144
- | code | meaning | what to do |
145
- |---|---|---|
146
- | the command's own | it ran | read it as usual |
147
- | 75 | gave up waiting: your command never started and didn't fail (outside Claude Code, after `--max-wait`, 8m by default), or a question got no answer | rerun the same command within 2 minutes to keep your place, or add `--wait`. On a question: nothing was decided, skip that step |
148
- | 74 | not enough free disk | the message says how much it needed. Free your own build output, or tell the person; if this run needs less, pass a smaller `--disk` on that `dibs run` (a hold's `--disk` doesn't cover the runs under it). Never delete in another session's `/private/tmp/claude-*` folder |
149
- | 76 | lost the coordinator or the other machine before the job started | nothing ran there: send it again |
150
- | 77 | lost the other machine after the job started | it may have run, or still be running: check before running it again, above all a deploy |
151
- | 70 | dibs itself crashed | a bug in dibs, not your command: `dibs ask "..."` |
152
- | 127 | the command didn't start | check the command and its path |
153
- | 2 | bad usage: a near-miss resource name, a high or urgent boost without `-m`, a job bigger than this machine (ask for what it names, or `--anywhere`), `--on` or `dibs machines` outside a group, or a run you already have going | read the message: it names the fix |
154
- | 1 | nothing matched (`mine` with nothing held, `release` with nothing to give back) | usually the clean result |
155
-
156
- ## The guard
157
-
158
- When dibs's hook sees a heavy command outside `dibs run`, it rewrites it into the `dibs run ...` line (in bypass-permissions sessions) or blocks it and prints that line. Run the line. If the command really builds, boots, tests and deploys nothing, put `DIBS_GUARD=off` in front of it. If the person set a subagent limit (config `agents.slots`), a denied spawn started nothing and isn't a failure: wait for one of yours to report back, then spawn again.
175
+ If the person asks you to connect something to dibs, `dibs connect` is the one way in. On its own it explains each choice and, in a terminal, asks which:
159
176
 
160
- ## Looking without joining the line
177
+ - `dibs connect --browser`: a one-time code for the page at `http://127.0.0.1:7421` (10 minutes, one use).
178
+ - `dibs connect --phone`: a link and QR code for a phone or any browser at https://app.dibs.cc, end-to-end encrypted through the relay.
179
+ - `dibs connect --account`: every browser the person signs in with at app.dibs.cc opens this Mac.
180
+ - `dibs connect --mcp`: another Claude account's connector reads dibs over MCP at `https://mcp.dibs.cc/mcp`.
181
+ - `dibs connect --machine`: another machine joins the group (above).
161
182
 
162
- `dibs` (the board, whose `Limits` line has memory, disk and swap), `dibs when sim`, `dibs who sim`, `dibs why`, `dibs mine`, `dibs history` (the last 7 days). Every command and flag: `dibs help all`. Something wrong with dibs, or a question about it: `dibs ask "..."`.
183
+ A browser, phone, account or MCP client can only look unless connected with `--allow-actions`. An MCP client that acts does so as an agent named `mcp-<name>`, never as the person. `dibs pair --allow-commands` also lets a client signed in at this Mac's own address queue commands; never through mcp.dibs.cc. `dibs connect --list` shows everything connected and what each may do; `dibs connect --remove <id>` disconnects one. Details: README.md and docs/relay.md.