owenloop 0.5.26 → 0.5.28

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 (37) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/packages/work/src/agent/brief.d.ts +10 -0
  3. package/dist/packages/work/src/agent/brief.js +38 -0
  4. package/dist/packages/work/src/agent/loop.js +4 -0
  5. package/dist/packages/work/src/contained-path.d.ts +18 -0
  6. package/dist/packages/work/src/contained-path.js +42 -0
  7. package/dist/packages/work/src/harness/claude.js +21 -0
  8. package/dist/packages/work/src/harness/codex.js +29 -0
  9. package/dist/packages/work/src/harness/contract.d.ts +26 -0
  10. package/dist/packages/work/src/hold/mcp.d.ts +3 -40
  11. package/dist/packages/work/src/hold/mcp.js +121 -2
  12. package/dist/packages/work/src/hub/client.d.ts +10 -1
  13. package/dist/packages/work/src/hub/client.js +23 -0
  14. package/dist/packages/work/src/hub/types.d.ts +31 -0
  15. package/dist/packages/work/src/roles/shift.js +7 -1
  16. package/dist/packages/work/src/settings/settings.d.ts +12 -1
  17. package/dist/packages/work/src/settings/settings.js +7 -0
  18. package/dist/packages/work/src/shift/disk-floor.d.ts +107 -0
  19. package/dist/packages/work/src/shift/disk-floor.js +148 -0
  20. package/dist/packages/work/src/shift/host-preflight.d.ts +85 -0
  21. package/dist/packages/work/src/shift/host-preflight.js +112 -0
  22. package/dist/packages/work/src/shift/loop.d.ts +18 -0
  23. package/dist/packages/work/src/shift/loop.js +179 -7
  24. package/dist/packages/work/src/shift/protocol.d.ts +62 -1
  25. package/dist/packages/work/src/shift/runtime.d.ts +2 -0
  26. package/dist/packages/work/src/shift/runtime.js +17 -0
  27. package/dist/packages/work/src/submit-file.d.ts +3 -2
  28. package/dist/packages/work/src/submit-file.js +6 -22
  29. package/dist/src/defs.js +59 -8
  30. package/dist/src/types.d.ts +13 -0
  31. package/docs/cli.md +8 -5
  32. package/docs/shift-logs.md +64 -7
  33. package/package.json +1 -1
  34. package/plugins/claude-code/plugin/.claude-plugin/plugin.json +1 -1
  35. package/plugins/claude-code/plugin/.mcp.json +1 -1
  36. package/plugins/codex/plugins/owenloop/.codex-plugin/plugin.json +1 -1
  37. package/plugins/codex/plugins/owenloop/.mcp.json +1 -1
@@ -216,14 +216,16 @@ Two properties an uploader can rely on:
216
216
  | `bundle-miss` | `workflow`, `def` | a legacy order named a def with no cached bundle |
217
217
  | `order-dropped` | `workflow`, `run`, `step`, `reason`, `message` | the shift refused one order; capacity and expiry reasons return the claim to the hub while malformed and unsupported reasons leave it for pickup |
218
218
  | `event-queue-overflow` | `dropped` | the socket FIFO evicted events; see below |
219
+ | `low-disk` | `path`, `freeBytes`, `floorBytes` | the volume holding the work root is below the floor, so the shift declined to start new work. It keeps polling and resumes by itself when space returns; children already running are left alone. **Edge-triggered** (one record per low-disk episode) and **file-only** — see below |
219
220
  | `ended` | — | an operator ran `owenloop shift end` |
221
+ | `wedged` | `faults[]` (`kind`, `role`, `path`, `message`), `streak` | the shift stopped because the **machine** it runs on is broken, and the process exited non-zero — see below |
220
222
  | `gate` | optional `workflow`, `run`, `name`, `question` | reserved; not emitted today |
221
223
 
222
224
  `kind` is `'exec' | 'agent-run'`.
223
225
 
224
- **Four of these are file-only.** `parked`, `capacity`, `hub-error`, and
225
- `event-queue-overflow` are written to `shift.log` and are never delivered over
226
- the daemon's Unix socket to `owenloop shift next`. Every other type goes to
226
+ **Five of these are file-only.** `parked`, `capacity`, `hub-error`,
227
+ `event-queue-overflow`, and `low-disk` are written to `shift.log` and are never
228
+ delivered over the daemon's Unix socket to `owenloop shift next`. Every other type goes to
227
229
  both. The routing rule is `FILE_ONLY_EVENTS` in
228
230
  `packages/work/src/shift/runtime.ts`, applied at the one point where an event
229
231
  fans out to its two sinks.
@@ -232,7 +234,9 @@ The split is not importance. It is what each consumer is:
232
234
 
233
235
  - A record about a **unit of work that moved** — `dispatched`, `reaped`,
234
236
  `failed`, `order-dropped`, `bundle-miss`, `ended` — tells a socket client
235
- something it cannot otherwise learn. Both sinks get it.
237
+ something it cannot otherwise learn. Both sinks get it. `wedged` joins them
238
+ for the same reason `ended` does: a client parked on a shift that is about to
239
+ exit is waiting for work that will never arrive.
236
240
  - A record about the **shift's own condition** is redundant or harmful on the
237
241
  socket, and load-bearing in the file.
238
242
 
@@ -274,12 +278,35 @@ queue that just overflowed would evict another event, overflow again, and
274
278
  recurse under exactly the load that produced it. It is handed straight to the
275
279
  log sink and never enters the fan-out at all.
276
280
 
281
+ `low-disk` is the shift reporting that it *could* have taken work and chose not
282
+ to, because the volume holding its work root is below the configured floor. A
283
+ shift's children are the heaviest writers on the machine — a clone, a dependency
284
+ install, a build tree, a transcript per agent turn — and a full disk kills them
285
+ mid-step with a bare non-zero exit that names nothing, which the shift then
286
+ re-offers onto the same full disk. Declining is the safe move because a full
287
+ disk **self-heals**: a file is deleted, a cache is pruned, another process
288
+ finishes, and the shift starts dispatching again on its own without an operator
289
+ restarting anything. Work already in flight is deliberately left running, since
290
+ killing a nearly-finished child frees little and destroys everything it had
291
+ done.
292
+
293
+ It is **edge-triggered**, like `capacity`: one record per low-disk episode, not
294
+ one per tick, so an hour spent on a full disk costs one line rather than 720.
295
+ Both `freeBytes` and `floorBytes` are carried so the record stands alone — a
296
+ reader can tell an operator who set an unreachable floor from a genuinely full
297
+ disk without knowing how the shift was configured. It is file-only for the
298
+ `parked`/`capacity` reason: a parked `shift next` must not be woken by news that
299
+ nothing happened. The floor is `--disk-floor <bytes>`, then
300
+ `settings.diskFloorBytes`, then 1 GiB; `0` switches the check off, and a disk
301
+ that cannot be measured at all is treated as permission to dispatch rather than
302
+ as a refusal.
303
+
277
304
  Nothing is lost, because the file is the consumer with no envelope and no
278
305
  context. `shift.log` has no per-response `cap`/`free`/`running`, so without
279
- these four records a reader cannot tell an **idle** shift (no orders offered)
306
+ these five records a reader cannot tell an **idle** shift (no orders offered)
280
307
  from a **saturated** one (orders offered, no slots) from a **stranded** one (hub
281
- unreachable, so nothing was ever offered), nor tell a quiet log from a lossy
282
- one.
308
+ unreachable, so nothing was ever offered) from one **refusing work on a full
309
+ disk**, nor tell a quiet log from a lossy one.
283
310
 
284
311
  `order-dropped.reason` is the stable machine discriminator and is one of
285
312
  `malformed-digest`, `malformed-worker`, `unsupported-worker`,
@@ -359,6 +386,35 @@ shift that is still running, or one that stopped some other way. Those are two
359
386
  different questions and the file answers both; do not treat a missing `ended` as
360
387
  corruption.
361
388
 
389
+ `wedged` is the other deliberate ending, and it says something `ended` does not:
390
+ the shift stopped **itself** because this machine can no longer host it. A shift
391
+ resolves its temp directory once, at start, and that path is not stable for the
392
+ life of a long-running process — macOS gives each boot a fresh per-user temp
393
+ directory, so a shift that survives a reboot holds a path that no longer exists.
394
+
395
+ Only the temp directory is checked. A shift also holds a state directory, a
396
+ bundle cache and a work root, and it creates all three on demand, so their
397
+ absence is a fresh install rather than a fault — checking them would refuse to
398
+ start every clean shift.
399
+
400
+ Without this record that fault is invisible and misattributed. Every hub call
401
+ fails with Node's generic `fetch failed`, `pgrep` still shows the process, and
402
+ `shift end` still answers, so the log fills with `hub-error` records blaming the
403
+ network for a local fault. One shift was measured in that state for 42 minutes.
404
+
405
+ The distinction the record encodes is **local and non-self-healing** versus
406
+ **remote**. A hub outage, a rate-limit ban, an expired credential and a flaky
407
+ network all end without anyone doing anything, so the shift keeps polling and
408
+ emits no `wedged` at all — `faults` is never empty, and its presence means a
409
+ human must change something on the host. Each `message` names the path and the
410
+ fix; for a vanished temp directory the fix is to stop the shift and start a new
411
+ one from a fresh shell, so it inherits the current `TMPDIR`.
412
+
413
+ `streak` is how many consecutive non-rate-limited hub calls failed before the
414
+ check ran, and is `0` for the check every shift makes at start, before its first
415
+ hub call. It is evidence of what prompted the check, not the reason the shift
416
+ stopped; the `faults` are that.
417
+
362
418
  ### Line size
363
419
 
364
420
  Each line is bounded at **512 KiB** (`MAX_RESPONSE_LINE_BYTES`) — the same
@@ -698,4 +754,5 @@ friends) carry their built-in default into that listing.
698
754
  | line-size bounding | `packages/work/src/shift/truncate.ts` |
699
755
  | worker stdio wiring | `packages/work/src/shift/spawn.ts` |
700
756
  | where the emitters are wired together | `packages/work/src/shift/runtime.ts` |
757
+ | free-space measurement and the floor | `packages/work/src/shift/disk-floor.ts` |
701
758
  | the socket FIFO and its overflow | `packages/work/src/shift/server.ts` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owenloop",
3
- "version": "0.5.26",
3
+ "version": "0.5.28",
4
4
  "description": "Deterministic rails for agentic workflows. Declare steps and dependencies; the engine guarantees order, redoes what changes invalidate, and stops what keeps failing — instead of hoping the agent follows through.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "typicalday",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owenloop",
3
- "version": "0.5.26",
3
+ "version": "0.5.28",
4
4
  "description": "Claude Code driver for owenloop — cross-harness shift and conduct skills driven by the owenloop CLI, plus one hub control-plane MCP server backing an author skill and a fallback worker, for conducting and authoring workflows against your hosted owenloop server.",
5
5
  "author": {
6
6
  "name": "Typical Day"
@@ -7,7 +7,7 @@
7
7
  "mcp"
8
8
  ],
9
9
  "env": {
10
- "OWENLOOP_PLUGIN_VERSION": "0.5.26"
10
+ "OWENLOOP_PLUGIN_VERSION": "0.5.28"
11
11
  }
12
12
  }
13
13
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owenloop",
3
- "version": "0.5.26",
3
+ "version": "0.5.28",
4
4
  "description": "Codex plugin for the owenloop workflow engine.",
5
5
  "skills": "./skills/",
6
6
  "mcpServers": "./.mcp.json"
@@ -6,7 +6,7 @@
6
6
  "mcp"
7
7
  ],
8
8
  "env": {
9
- "OWENLOOP_PLUGIN_VERSION": "0.5.26"
9
+ "OWENLOOP_PLUGIN_VERSION": "0.5.28"
10
10
  },
11
11
  "env_vars": [
12
12
  "HOME",