@oisin-ee/pi-dogsled 0.27.0 → 0.28.1

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 (42) hide show
  1. package/README.md +122 -28
  2. package/package.json +18 -7
  3. package/pi/index.ts +9 -4
  4. package/pi/plan-mode.ts +7 -7
  5. package/pi/todo/CHANGELOG.md +133 -0
  6. package/pi/todo/README.md +133 -0
  7. package/pi/todo/src/contract-fixture.ts +103 -0
  8. package/pi/todo/src/display.ts +78 -0
  9. package/pi/todo/src/embedded.ts +105 -0
  10. package/pi/todo/src/gate.ts +89 -0
  11. package/pi/todo/src/generated/todo_core.d.ts +573 -0
  12. package/pi/todo/src/generated/todo_core.js +970 -0
  13. package/pi/todo/src/generated/todo_core_bg.wasm +0 -0
  14. package/pi/todo/src/generated/todo_core_bg.wasm.d.ts +22 -0
  15. package/pi/todo/src/guidance.ts +16 -0
  16. package/pi/todo/src/handoff.ts +91 -0
  17. package/pi/todo/src/import-fixture.ts +63 -0
  18. package/pi/todo/src/index.ts +100 -0
  19. package/pi/todo/src/lease-fixture.ts +95 -0
  20. package/pi/todo/src/lifecycle.ts +105 -0
  21. package/pi/todo/src/plan-approved.ts +78 -0
  22. package/pi/todo/src/presentation.ts +70 -0
  23. package/pi/todo/src/provider-fixture.ts +50 -0
  24. package/pi/todo/src/provider.ts +289 -0
  25. package/pi/todo/src/registration-fixture.ts +126 -0
  26. package/pi/todo/src/reminder.ts +30 -0
  27. package/pi/todo/src/repository.ts +31 -0
  28. package/pi/todo/src/runtime-fixture.ts +255 -0
  29. package/pi/todo/src/schema.ts +99 -0
  30. package/pi/todo/src/source.ts +51 -0
  31. package/pi/todo/src/state.ts +105 -0
  32. package/pi/todo/src/tool.ts +60 -0
  33. package/pi/todo/src/wasm.ts +64 -0
  34. package/pi/todo/src/widget.ts +77 -0
  35. package/pi/todo/src/work.ts +180 -0
  36. package/pi/unit-bridge.ts +12 -10
  37. package/pi/unit-protocol.ts +2 -16
  38. package/pi/unit-worker.ts +7 -11
  39. package/pi/work-panel.ts +4 -4
  40. package/pi/work-todo.ts +30 -88
  41. package/plugins/dogsled/skills/dogsled/SKILL.md +1 -1
  42. package/plugins/dogsled/skills/dogsled/references/review.md +2 -3
package/README.md CHANGED
@@ -13,13 +13,13 @@ Install the binary on each Herdr host. Use the same release tag in each command.
13
13
  Binary:
14
14
 
15
15
  ```sh
16
- mise use github:oisin-ee/dogsled@v0.27.0
16
+ mise use github:oisin-ee/dogsled@v0.28.0
17
17
  ```
18
18
 
19
- Pi (extension, tools, and skill), from npm or as part of `@oisin-ee/oisinpi`:
19
+ Pi (extension, tools, the `todo` tool, and skill), from npm:
20
20
 
21
21
  ```sh
22
- pi install npm:@oisin-ee/pi-dogsled@0.27.0
22
+ pi install npm:@oisin-ee/pi-dogsled@0.28.1
23
23
  ```
24
24
 
25
25
  At session start the extension compares its version with `dogsled --version` and warns when they differ.
@@ -27,14 +27,14 @@ At session start the extension compares its version with `dogsled --version` and
27
27
  Claude Code (hooks, tools, and skill):
28
28
 
29
29
  ```sh
30
- claude plugin marketplace add oisin-ee/dogsled#v0.27.0
30
+ claude plugin marketplace add oisin-ee/dogsled#v0.28.0
31
31
  claude plugin install dogsled@dogsled
32
32
  ```
33
33
 
34
34
  Codex (hooks, tools, and skill):
35
35
 
36
36
  ```sh
37
- codex plugin marketplace add oisin-ee/dogsled --ref v0.27.0
37
+ codex plugin marketplace add oisin-ee/dogsled --ref v0.28.0
38
38
  codex plugin add dogsled@dogsled
39
39
  ```
40
40
 
@@ -44,7 +44,7 @@ The [Codex CLI reference](https://developers.openai.com/codex/cli/reference#code
44
44
  Herdr (left-docked work board):
45
45
 
46
46
  ```sh
47
- herdr plugin install oisin-ee/dogsled --ref v0.27.0 --yes
47
+ herdr plugin install oisin-ee/dogsled --ref v0.28.0 --yes
48
48
  ```
49
49
 
50
50
  The Claude and Codex plugins use the binary on `PATH`. The Herdr plugin's build step (`plugin/fetch.sh`) installs its own binary at `bin/dogsled`: the release archive for the manifest version, checked against its published SHA-256. When that release has no archive for the platform, it runs `cargo build --release --locked` instead, which needs Rust at the crate's `rust-version` or newer. A checksum mismatch stops the install. `DOGSLED_RELEASES` replaces the download base, such as a mirror. `herdr plugin link` skips build steps, so run `sh plugin/fetch.sh` in a linked checkout. No plugin starts host services.
@@ -79,6 +79,7 @@ dogsled status --watch # refresh until interrupted
79
79
  dogsled place --json # reserve the host with the most headroom
80
80
  dogsled place --host netcup --json # pin by host id or label
81
81
  dogsled place --branch feat/unit-a --base main --repo /path/to/repo --json
82
+ dogsled place --resume REQUEST_ID --json # replay the original placement request
82
83
  ```
83
84
 
84
85
  Exit codes: 0 success, 1 queued without waiting, 2 error. Job waits return the job's exit code.
@@ -132,7 +133,9 @@ Setup includes worktree creation and removal, `setup` and `teardown` commands, r
132
133
  A non-waiting action reports the operation that exceeded its deadline.
133
134
  `logs --follow` can continue indefinitely, but each remote read has a 30-second limit.
134
135
  Run long waits through the harness's background-task facility.
135
- A wait deadline does not cancel its job or ticket. `cancel` only cancels pending tickets.
136
+ A wait deadline does not cancel its job or ticket.
137
+ `cancel` records intent under the admission lock. After admission, it returns `too_late` with the saved result.
138
+ Cancellation never stops a process. An unreachable host leaves preparation release pending.
136
139
 
137
140
  ### Agents and profiles
138
141
 
@@ -145,7 +148,14 @@ Herdr refuses a start before it types into the pane, for example `agent_pane_bus
145
148
  `--profile NAME` (Pi only) reads `~/.config/dogsled/profiles/NAME/profile.json` on the host that runs the child:
146
149
 
147
150
  ```json
148
- {"description": "Ordinary units", "model": "alias/sol", "thinking": "medium", "prompt": "prompt.md", "role": "writer", "pi_args": []}
151
+ {
152
+ "description": "Ordinary units",
153
+ "model": "alias/sol",
154
+ "thinking": "medium",
155
+ "prompt": "prompt.md",
156
+ "role": "writer",
157
+ "pi_args": []
158
+ }
149
159
  ```
150
160
 
151
161
  The child gets `--model`, `--thinking`, `--append-system-prompt <prompt>`, then `pi_args`. Unknown keys are ignored, so Shepherdr profiles load as they are.
@@ -168,18 +178,40 @@ Marks in `done.json` use the launch/item id, pane, and `agent_session.value`, no
168
178
 
169
179
  New inbox work accepted during that same working turn cancels its mark. After that turn ends, the mark is terminal. Senders receive `<name> finished; start a new child for more work`.
170
180
 
171
- A child without its own `done` stays open, including a child that asks a question or orchestrates other children. Automatic closure never closes the caller or a busy pane. Shared worktrees remain, and only the finished child pane closes. A last primary pane stays while closing it would close linked workspaces.
172
-
173
- Closed children retain TO LAND rows: `<child>: branch <b> +N to land`. These rows come from durable items and branch observations, not live panes. Integration or branch deletion removes the row.
174
-
175
- `dogsled board` groups an owner's children, jobs, and queued tickets by what the owner must do: TO LAND, ATTENTION, RUNNING, and WAITING. Each agent row names the harness and model; each job row names its command. `--json` is what the Pi widget draws.
181
+ End each turn with native `done`, `ask`, or `blocked`, or wait for owned child work.
182
+ `ask` sends a question to the owner. `blocked` records an external blocker. Neither completes the task.
183
+ Dogsled derives `waiting` from open items and pending or admitting child tickets. There is no `waiting` command.
184
+ Identical same-turn signals replay successfully. Conflicting signals refuse without a change.
185
+ The next positively identified turn clears a visible question or blocker, but not its pending delivery.
186
+
187
+ Dogsled derives one agent state: `queued`, `starting`, `working`, `waiting`, `asking`, `blocked`, `finishing`, `done`, `stopped`, `lost`, or `unknown`.
188
+ Herdr `done` means that a turn ended, not that the task completed.
189
+ An accepted native `done` remains `finishing` until the required final handoff evidence exists.
190
+
191
+ A stopped child receives a recorded prompt to signal or wait for its children.
192
+ With a live owner, it remains under NEEDS YOU.
193
+ If its custodian is gone, the sweep records the last reply and can close a positively identified stopped orphan.
194
+ A unit-bound orphan receives resource-only closure. Its task binding remains unresolved.
195
+ Owner close and stopped-orphan close save supported uncommitted work in pinned recovery snapshots before checkout removal.
196
+ Unsupported content or an incomplete preservation keeps the checkout.
197
+ Automatic closure never closes the caller or a busy pane. Shared checkouts remain while other work uses them.
198
+
199
+ Closed children with retained branches appear under READY TO MERGE.
200
+ These rows describe results, not agent states. A missing branch does not prove a merge.
201
+
202
+ `dogsled board` groups work under NEEDS YOU, READY TO MERGE, WORKING, and QUEUED.
203
+ Each agent row names the harness and model. Each job row names its command.
204
+ `--json` supplies the Pi widget.
205
+ See [Agent lifecycle and recovery](docs/lifecycle.md) for the state signals and safety rules.
176
206
  `dogsled read TARGET [--host H]` shows a child's or job's newest output and the captured final reply.
177
207
 
178
208
  ```sh
179
209
  dogsled close w2:p1
180
210
  dogsled close w9:p1 --host netcup --json
181
211
  dogsled drop <item-id> --host netcup
182
- dogsled done # as a child: my whole task is complete
212
+ dogsled done # CLI completion signal; managed agents use the native tool
213
+ dogsled ask "Which API owns this operation?"
214
+ dogsled blocked "The required host is unavailable."
183
215
  ```
184
216
 
185
217
  `drop` deletes a closed child's retained local and origin branches, including unmerged commits. Only the item's owner can use it, except on an orphan: when the origin's evidence proves the owner pane is gone or its session ended, any session can drop it. It refuses a branch checked out in a worktree. Already absent branches count as success. The item and its done mark stay settled and leave the board.
@@ -204,22 +236,71 @@ Both commands support `--json`. MCP exposes `claim` and `accept`, named `mcp__do
204
236
  For an interrupted launch with no final receipt, explicit `close` can retire its exact idle shell under the request and pane locks. This closes **only the pane**, retaining the checkout, preparation holds, and unknown launch evidence. It does not report that the task never started. Competing launch records, a changed terminal, any agent, or incomplete foreground evidence refuse recovery. Automatic cleanup never uses this recovery path; normal cleanup can assess the retained checkout after its holds are resolved.
205
237
  In an agent worktree (locked `agent:worktree`, as dogsled makes them), it runs the repository's `teardown` commands in the worktree (see [Repository configuration](#repository-configuration)).
206
238
  Then it closes every pane that uses the worktree and the Herdr workspace that shows it, unlocks the worktree, and runs `git worktree remove` without force.
207
- Close uses the same loss rule as cleanup: no unique checkout content and every commit held by the default branch or freshly fetched remote refs. It deletes the branch under that same rule. Local-only work refuses close, including an explicit owner close.
239
+ Normal handoff and cleanup require no unique checkout content and every commit held by the default branch or freshly fetched remote refs.
240
+ Explicit owner close and stopped-orphan close can save supported dirty content and local-only commits in pinned recovery snapshots.
241
+ They report `saved (recovery <id>)` and retain unmerged branches for integration or explicit drop.
242
+ These resource results do not settle the original task.
208
243
  When `place` opened the main checkout's workspace as the anchor and no linked worktree is open in Herdr any more, close closes that anchor too. It does so only while the anchor is unfocused, is not the caller's, and has one pane with no agent.
209
244
  A pane outside a worktree, or in an unlocked worktree (someone's own checkout), is closed alone; the checkout stays.
210
245
  A pane in a checkout that another agent, an open item, or a busy pane still uses is closed alone too, even by an explicit close: close never closes agents it was not asked to close, and never removes a checkout they use. The last pane in the checkout takes the checkout with it.
211
- A child tab in the caller's own workspace is closed. Close refuses a missing pane, the caller's own pane, a worktree the caller works in or whose workspace is the caller's, a worktree outside the repository's worktree directory, a dirty or detached worktree, and any other lock.
246
+ A child tab in the caller's own workspace closes.
247
+ Close refuses the caller's pane, checkout, or workspace, a checkout outside the configured worktree directory, unsaved content, and foreign locks.
248
+ A clean detached checkout can close when the default branch or freshly fetched remote refs protect its HEAD.
249
+ Dogsled does not create a branch implicitly for a detached checkout.
250
+ The repository lifecycle lock protects the final identity decision through record reconciliation.
251
+ A replacement checkout at the same path stays. Verified prior removal permits record reconciliation.
212
252
  It also refuses a busy target or a busy pane that uses the worktree: an agent that is not `idle` or `done`, or a shell with a foreground command.
213
- Each refusal happens before a change. If a `teardown` command fails, the worktree, its panes, its lock, and the item stay, and the error shows the command's last lines of output.
253
+ Preservation saves initial content before teardown and saves changed content again after successful teardown.
254
+ It verifies the pinned snapshot before normalization and unforced removal.
255
+ A failed or unknown teardown keeps the checkout, its panes, its lock, and the item.
256
+ Dogsled does not automatically repeat an entered teardown with an unknown outcome.
257
+ An interrupted normalization also keeps the checkout for inspection.
214
258
  After removal, close drops the worktree's registration, as prune does.
215
- The JSON result is `{pane,worktree:{path,branch,workspace,branch_deleted,anchor_closed?}|null,pane_closed}`. A remote host runs the same steps over SSH.
259
+ The JSON result includes `pane`, `worktree`, and `pane_closed`, with optional `retained_branch` and `recovery` metadata.
260
+ A remote host uses the same operations over SSH.
216
261
 
217
262
  The service admits tickets in FIFO order using the same placement policy.
218
263
  The order holds per host. A ticket waits only behind earlier tickets that could take one of its hosts. A full host does not hold back a ticket that is pinned to another host with room.
219
264
  It records an admission error rather than silently choosing another host after a clone, prepare, or launch failure.
220
265
  A service interruption during admission leaves an explicit failed ticket for inspection, not an automatic duplicate launch.
221
266
  For non-waiting callers, admission tells the owner through its inbox. An owner without an inbox reader hears once it has one; nothing is typed into its terminal.
222
- `status` lists open items per owner and pending tickets. `--brief` includes their counts. Prompt context adds the caller's own `To land:` line.
267
+ `status` lists open items per owner and pending tickets. `--brief` includes their counts.
268
+ Prompt context includes the caller's retained branches under `Ready to merge:`.
269
+
270
+ ### Recovery and preparation holds
271
+
272
+ ```sh
273
+ dogsled recovery list --repo /path/to/repo
274
+ dogsled recovery show RECOVERY_ID --repo /path/to/repo
275
+ dogsled recovery restore RECOVERY_ID --repo /path/to/repo --to /path/to/new-checkout --branch recovered/work
276
+ dogsled retire-preparation REQUEST_ID --host HOST --reason "Historical claim no longer has an owner."
277
+ ```
278
+
279
+ Recovery refs stay local and do not expire.
280
+ Restore creates an independent checkout. It does not resume the original task, preparation, grant, or pane.
281
+ There is no separate snapshot-creation command.
282
+ Owner close and stopped-orphan close create snapshots through durable preservation operations.
283
+ Failed or unsupported preservation keeps the live checkout and reports its blocker.
284
+
285
+ Preparation dispositions validate the exact claim, persist a startup fence, then release only that claim.
286
+ Placement retains its host grant and saves its result before release.
287
+ `place --resume REQUEST_ID` replays the original journal without another grant, completed setup, or pane.
288
+
289
+ `retire-preparation` prohibits future dispatch for one historical request claim. It does not remove a checkout or settle a task.
290
+ After acknowledgement, it reports unknown execution outcome and released ownership. Claims without request IDs are unsupported.
291
+ The separately authorized `--cleanup` override is CLI-only. MCP does not expose it.
292
+
293
+ Preparation, placement, agent dispatch, and jobs retain one immutable request creation time.
294
+ Missing, changed, unsupported, expired, or excessive future-dated validity refuses new execution.
295
+ A refusal does not release an unresolved preparation claim.
296
+ Owner-local completion times are write-once and require terminal evidence, not startup confirmation.
297
+
298
+ `status`, the board, and MCP show each retained resource, its owner, its reason, and an exact next command.
299
+ JSON also supplies `command_host` and `command_argv`.
300
+ Validity refusals, completion-time gaps, preservation blockers, and undelivered child events remain visible.
301
+ These reports do not change release decisions.
302
+
303
+ See [Agent lifecycle and recovery](docs/lifecycle.md) for command limits, custody, origin release certificates, and migration.
223
304
 
224
305
  ## Inbox
225
306
 
@@ -364,7 +445,9 @@ A local branch with no worktree is removable when it is integrated or every comm
364
445
  Prune and the sweep share the same holds: active panes or processes, the caller, an unreadable process table, and pending preparations or launches.
365
446
  An unfinished launch holds its checkout before pane allocation completes, or while its attempted start has the matching agent. An empty shell from a final launch holds nothing.
366
447
  An open agent item holds its checkout in prune and the sweep; `close` ends it and keeps the reply. Within `close`, a live owner holds the checkout until the default branch holds its work.
367
- An idle or done agent that has not called `dogsled done` holds its checkout in prune, the sweep, and an automatic close; only an explicit `dogsled close` takes it. An idle shell, a done agent without an open item, and a workspace alone are not holds. The processes of an idle agent pane are not holds, but a background job that a shell started is. Foreign locks still prevent removal.
448
+ An agent without native `done` normally holds its checkout.
449
+ The sweep can close a clean stopped orphan after it proves that the custodian is gone.
450
+ Explicit `dogsled close` still requires the safety and loss checks. An idle shell, a done agent without an open item, and a workspace alone are not holds. The processes of an idle agent pane are not holds, but a background job that a shell started is. Foreign locks still prevent removal.
368
451
  A dirty checkout whose commits are in the default branch gets a `landed_dirty` finding when no hold applies.
369
452
  The finding includes the repository, checkout, branch or HEAD, dirty-path count, and up to ten paths. It is never removable.
370
453
  Before it reads checkout changes, the loss rule requires the checkout's own `.git` and a matching Git top-level path.
@@ -381,7 +464,15 @@ A shell without a Dogsled record closes after 15 minutes continuously at an empt
381
464
  A pane is an empty prompt only when its root process is a shell that waits there. A shell that runs a command, such as `sh -c "..."`, a shell that runs a script, and a shell with an unknown option all keep the pane. A report names the program of a running command, never its arguments.
382
465
  An agent pane still needs more than 24 hours continuously idle or done and a `done` mark. An agent with open children stays open.
383
466
  A workspace whose every pane is idle is one `workspaces` entry, and prune closes it whole. The caller's workspace stays, and so does a workspace that a worktree removal closes.
384
- Ended jobs expire after 24 hours, together with their logs. Disk usage above 90% lists the largest known dogsled-owned paths.
467
+ The service timer removes job output after more than 24 hours from `ended_ms`. The remaining log marker says `output expired`.
468
+ It removes conclusively terminal Job records and the remaining log marker after more than 30 days.
469
+ A stale owner item or unread result does not extend retention. Running, pending, and uncertain jobs stay.
470
+ Current readers report `output expired` for expired output, including deleted records with a retained job item.
471
+ Explicit `prune jobs` currently removes conclusively terminal records and output after more than 24 hours.
472
+ Alignment with the service record window remains pending.
473
+ The planned `result unavailable: expired or unknown` message is not yet released.
474
+ See [Retention](docs/lifecycle.md#retention) for the current rules and pending record expiry.
475
+ Disk usage above 90% lists the largest known Dogsled-owned paths.
385
476
  A `targets` entry is build output: a directory with a `CACHEDIR.TAG` that starts with the cache-directory signature, directly under a main checkout or a linked worktree, such as Rust's `target/`.
386
477
  It is removable when no Herdr workspace shows the checkout and no pane or process works in it. Work in a linked worktree inside the main checkout uses that worktree, not the main checkout.
387
478
  Prune removes it after it checks the tag again. A worktree that the same plan removes takes its build output with it, so that output is not listed.
@@ -400,6 +491,7 @@ Placement records repositories in `repositories.json`, independently of `worktre
400
491
  Doctor also discovers repositories from the caller, live pane directories, Herdr workspaces, and `cleanup.repositories`. It never scans the whole home directory.
401
492
  An absent remembered repository produces a removable `repositories` entry. Prune and the sweep recheck absence under the registry locks, then remove only stale records.
402
493
  Existing worktree records stay. Configured paths, discovered paths, unreadable paths, and dangling symlinks remain report-only. Doctor changes no registrations.
494
+
403
495
  ### The sweep in `serve`
404
496
 
405
497
  The sweep closes finished children (see [Items and closing](#items-and-closing)), and a job closes its own tab. That closed loop ends most work.
@@ -591,14 +683,14 @@ The removed lead ledger and event log are not read or migrated.
591
683
  ## Prompt context and integrations
592
684
 
593
685
  `dogsled hook context --harness claude|codex|pi` leads with your own children and jobs, then shows the fleet totals from `status --brief`.
594
- The owner summary separates work to land, attention, idle, done, running, and queued work.
595
- The `To land:` line names finished children with unmerged commits or uncommitted changes.
686
+ The owner summary separates retained results, attention, active work, and queued work.
687
+ The `Ready to merge:` line names retained branches that await integration.
596
688
  Claude Code and Codex register `SessionStart` and `UserPromptSubmit` context hooks, and `UserPromptSubmit` and `Stop` inbox hooks (see [Inbox](#inbox)), in `plugins/dogsled`.
597
689
  Each registration supplies `--event`. The default context event is `UserPromptSubmit`.
598
690
  The CLI never reads stdin. Claude Code and Codex receive `hookSpecificOutput` JSON with `hookEventName` and `additionalContext`.
599
691
  Pi receives plain text through its `before_agent_start` extension. All three use the same snapshot reader and formatter.
600
692
 
601
- Before an orchestrator stops, the stop gate checks its own TO LAND children.
693
+ Before an orchestrator stops, the stop gate checks its own children with retained results or unfinished work.
602
694
  Pi calls `dogsled hook gate` from `agent_before_settle` on every completed stop, which also requests a cleanup pass. A reminder is added as a visible message that continues the run.
603
695
  Claude Code and Codex include the reminder in their existing `Stop` inbox response.
604
696
  The reminder requests a review, a commit from dirty children, integration, or an explicit blocker or deferral.
@@ -625,7 +717,7 @@ Plugin commands end with `|| true`. Pi also leaves the prompt unchanged if the b
625
717
 
626
718
  ### Tools
627
719
 
628
- `dogsled mcp` serves the dogsled commands as MCP tools over stdio: `status`, `spawn`, `run`, `send`, `inbox`, `read`, `close`, `drop`, `done`, `stop`, `cancel`, and `place`.
720
+ `dogsled mcp` serves the dogsled commands as MCP tools over stdio: `status`, `spawn`, `run`, `send`, `inbox`, `read`, `close`, `drop`, `done`, `ask`, `blocked`, `stop`, `cancel`, and `place`.
629
721
  Tools share the CLI action code. `spawn` returns a durable queued ticket, even when a host has room.
630
722
  The service owns startup confirmation outside the MCP call budget. `dogsled agent` still starts synchronously under `--max`.
631
723
  Startup errors include recent pane output in the launch record and ticket when the pane read succeeds.
@@ -674,11 +766,13 @@ All three harness packages share `plugins/dogsled/skills/dogsled/SKILL.md`. It d
674
766
 
675
767
  ## Build and development
676
768
 
769
+ The shell does not activate Proto, so a bare `moon`, `pnpm`, or `node` does not use the version that `.prototools` pins. Run a pinned tool with `proto run <tool> -- <arguments>`. Every `moon run` and `moon ci` in this README means `proto run moon -- run` and `proto run moon -- ci`. Run any other command that needs the pinned tools with `proto exec --tools-from-config -- <command>`.
770
+
677
771
  Build this branch with the repository's pinned Rust toolchain:
678
772
 
679
773
  ```sh
680
774
  cargo build --release
681
- npm ci
775
+ proto run pnpm -- install --frozen-lockfile
682
776
  ```
683
777
 
684
778
  The server embeds the Dioxus portal UI, so the web bundle must exist before the binary builds.
@@ -686,7 +780,7 @@ The server embeds the Dioxus portal UI, so the web bundle must exist before the
686
780
  Run it before a plain `cargo build`:
687
781
 
688
782
  ```sh
689
- moon run :web-build
783
+ proto run moon -- run :web-build
690
784
  cargo build --release
691
785
  ```
692
786
 
@@ -694,7 +788,7 @@ Proto and moon own the development tooling. `proto install` installs the version
694
788
 
695
789
  ```sh
696
790
  proto install
697
- moon run :fmt-check :lint :test :typecheck :test-shim
791
+ proto run moon -- run :fmt-check :lint :test :typecheck :test-shim
698
792
  ```
699
793
 
700
794
  The `lint` and `test` tasks build the web bundle first, so they work in a fresh checkout.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oisin-ee/pi-dogsled",
3
- "version": "0.27.0",
3
+ "version": "0.28.1",
4
4
  "description": "Pi extension for dogsled: the board, the /dogsled panel, the inbox reader, and the dogsled tools. Needs the dogsled binary of the same version.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -12,6 +12,9 @@
12
12
  "files": [
13
13
  "pi/",
14
14
  "!pi/**/*.test.ts",
15
+ "!pi/todo/moon.yml",
16
+ "!pi/todo/tsconfig.json",
17
+ "!pi/todo/node_modules/",
15
18
  "plugins/dogsled/skills/",
16
19
  "README.md",
17
20
  "LICENSE"
@@ -31,10 +34,6 @@
31
34
  "engines": {
32
35
  "node": ">=22.19.0"
33
36
  },
34
- "scripts": {
35
- "typecheck": "tsc --noEmit -p tsconfig.json",
36
- "test": "node --test \"pi/**/*.test.ts\""
37
- },
38
37
  "pi": {
39
38
  "extensions": [
40
39
  "./pi/index.ts"
@@ -44,13 +43,25 @@
44
43
  ]
45
44
  },
46
45
  "peerDependencies": {
46
+ "@earendil-works/pi-ai": "*",
47
+ "typebox": "*",
47
48
  "@earendil-works/pi-coding-agent": "^1.3.0",
48
49
  "@earendil-works/pi-tui": "^1.3.0"
49
50
  },
50
51
  "devDependencies": {
52
+ "oxfmt": "^0.65.0",
53
+ "oxlint": "1.82.0",
54
+ "oxlint-tsgolint": "7.0.2001",
55
+ "vitest": "^5.0.1",
56
+ "@earendil-works/pi-ai": "1.3.0",
51
57
  "@earendil-works/pi-coding-agent": "1.3.0",
52
58
  "@earendil-works/pi-tui": "1.3.0",
53
59
  "@types/node": "26.6.4",
54
- "typescript": "7.0.2"
60
+ "typescript": "7.0.2",
61
+ "typebox": "1.3.27"
62
+ },
63
+ "scripts": {
64
+ "typecheck": "tsc --noEmit -p tsconfig.json",
65
+ "test": "node --test \"pi/*.test.ts\""
55
66
  }
56
- }
67
+ }
package/pi/index.ts CHANGED
@@ -12,6 +12,7 @@ import { WorkPanel, WorkDetail, runWorkAction, type WorkAction, type WorkCursor,
12
12
  import { registerInterview } from "./interview.ts";
13
13
  import { registerPlanMode } from "./plan-mode.ts";
14
14
  import { PortalClient } from "./portal-client.ts";
15
+ import { createTodo } from "./todo/src/index.ts";
15
16
 
16
17
  const REFRESH_MS = 10_000;
17
18
 
@@ -26,6 +27,10 @@ export function versionMismatch(output: string): string | undefined {
26
27
  }
27
28
 
28
29
  export default function dogsled(pi: ExtensionAPI) {
30
+ const todo = createTodo(pi, { seedPath: () => {
31
+ const value = pi.getFlag("todo-unit-file");
32
+ return typeof value === "string" ? value : undefined;
33
+ } });
29
34
  const binary = process.env["DOGSLED_BIN"] ?? "dogsled";
30
35
  const owner = process.env["HERDR_PANE_ID"];
31
36
  let timer: ReturnType<typeof setInterval> | undefined;
@@ -40,7 +45,7 @@ export default function dogsled(pi: ExtensionAPI) {
40
45
  command: binary,
41
46
  args: ["mcp"],
42
47
  exposure: "direct",
43
- description: "Spawn Pi, Claude, and Codex children and jobs on Herdr hosts, and message any agent through its inbox.",
48
+ description: "Use the native done, ask, and blocked tools for turn signals. End every turn with exactly one of: done (whole task complete), ask (you need an answer from your owner), blocked (you cannot continue), or waiting for your own open children. Spawn Pi, Claude, and Codex children and jobs on Herdr hosts, and message any agent through its inbox.",
44
49
  });
45
50
 
46
51
  async function exec(args: string[]) {
@@ -50,10 +55,10 @@ export default function dogsled(pi: ExtensionAPI) {
50
55
  }
51
56
 
52
57
  const inbox = new InboxReader(pi, exec);
53
- const units = new UnitBridge(pi, binary);
58
+ const units = new UnitBridge(pi, binary, todo.tasks);
54
59
  // The portal owns the interactive parts of Pi: the interview form and the plan review.
55
60
  const portal = new PortalClient();
56
- const planMode = registerPlanMode(pi, portal);
61
+ const planMode = registerPlanMode(pi, todo.approve, portal);
57
62
  const interviews = registerInterview(pi, portal);
58
63
  // One handler owns the tool call: the unit bridge first, then the plan-mode gate.
59
64
  pi.on("tool_call", async (event, ctx) => {
@@ -111,7 +116,7 @@ export default function dogsled(pi: ExtensionAPI) {
111
116
  let sideDisplay = false;
112
117
  let publicationFailure: string | undefined;
113
118
  const publisher = new TodoPublisher(owner ?? "", error => context?.ui.notify(`Todo publication failed: ${String(error)}`, "error"));
114
- const todos = new WorkTodo(pi.events, () => {
119
+ const todos = new WorkTodo(todo.work, () => {
115
120
  if (context) { publishTodos(context); draw(context); }
116
121
  }, () => {
117
122
  if (context) void openWork(context, "todos").catch(error => context?.ui.notify(String(error), "error"));
package/pi/plan-mode.ts CHANGED
@@ -36,7 +36,7 @@ export interface Decision {
36
36
  plan_content: string;
37
37
  }
38
38
 
39
- /** The payload the plan-approved event carries, as pi-todo consumes it. */
39
+ /** The approved document and reviewer feedback passed to pi-todo. */
40
40
  export interface PlanApproved {
41
41
  cwd: string;
42
42
  planFilePath: string;
@@ -46,7 +46,6 @@ export interface PlanApproved {
46
46
 
47
47
  /** The parts of the extension API that plan mode uses. */
48
48
  export interface PlanHost {
49
- events: ExtensionAPI["events"];
50
49
  sendUserMessage(content: string, options?: { deliverAs?: "steer" | "followUp" }): void;
51
50
  sendMessage(message: { customType: string; content: string; display: boolean }, options?: { triggerTurn?: boolean; deliverAs?: "steer" | "followUp" }): void;
52
51
  getActiveTools(): string[];
@@ -118,6 +117,7 @@ export class PlanMode {
118
117
  private readonly pi: PlanHost;
119
118
  private readonly client: PortalClient;
120
119
  private readonly open: (url: string) => void;
120
+ private readonly approved: (plan: PlanApproved, ctx: ExtensionContext) => void;
121
121
  private planning = false;
122
122
  private framed = false;
123
123
  private watching: AbortController | undefined;
@@ -127,8 +127,9 @@ export class PlanMode {
127
127
  /** The reviews the portal acknowledged. A review that was delivered but not acked is acked again, not delivered again. */
128
128
  private readonly acked = new Set<string>();
129
129
 
130
- constructor(pi: PlanHost, client: PortalClient = new PortalClient(), open: (url: string) => void = openInBrowser) {
130
+ constructor(pi: PlanHost, approved: (plan: PlanApproved, ctx: ExtensionContext) => void, client: PortalClient = new PortalClient(), open: (url: string) => void = openInBrowser) {
131
131
  this.pi = pi;
132
+ this.approved = approved;
132
133
  this.client = client;
133
134
  this.open = open;
134
135
  }
@@ -279,7 +280,7 @@ export class PlanMode {
279
280
  planContent: typeof decision.plan_content === "string" ? decision.plan_content : "",
280
281
  ...(message ? { feedback: message } : {}),
281
282
  };
282
- this.pi.events.emit("dogsled:plan-approved", approved);
283
+ this.approved(approved, ctx);
283
284
  this.stop();
284
285
  }
285
286
  }
@@ -303,15 +304,14 @@ export class PlanMode {
303
304
  }
304
305
 
305
306
  /** Register the plan mode: the submit tool, the command, and the shortcut. */
306
- export function registerPlanMode(pi: ExtensionAPI, client: PortalClient = new PortalClient(), open: (url: string) => void = openInBrowser): PlanMode {
307
+ export function registerPlanMode(pi: ExtensionAPI, approved: (plan: PlanApproved, ctx: ExtensionContext) => void, client: PortalClient = new PortalClient(), open: (url: string) => void = openInBrowser): PlanMode {
307
308
  const host: PlanHost = {
308
- events: pi.events,
309
309
  sendUserMessage: (content, options) => { pi.sendUserMessage(content, options); },
310
310
  sendMessage: (message, options) => { pi.sendMessage(message, options); },
311
311
  getActiveTools: () => pi.getActiveTools(),
312
312
  setActiveTools: names => { pi.setActiveTools(names); },
313
313
  };
314
- const mode = new PlanMode(host, client, open);
314
+ const mode = new PlanMode(host, approved, client, open);
315
315
  pi.registerTool({
316
316
  name: SUBMIT_PLAN,
317
317
  label: "Submit plan",
@@ -0,0 +1,133 @@
1
+ # @oisin-ee/pi-todo
2
+
3
+ ## 0.12.1
4
+
5
+ No changes in this release.
6
+
7
+ ## 0.12.0
8
+
9
+ ### Minor Changes
10
+
11
+ - [#40](https://github.com/oisin-ee/oisinpi/pull/40) [`7fcdc45`](https://github.com/oisin-ee/oisinpi/commit/7fcdc45f08c065faf38c3841c0b2d2133ad9322f) Thanks [@momo-momokaya](https://github.com/apps/momo-momokaya)! - Continue plans approved in Dogsled plan mode through the existing todo tool in the same session. Receive plan approvals without additional configuration.
12
+
13
+ Document Dogsled plan mode as the owner of planning restrictions.
14
+
15
+ ## 0.11.1
16
+
17
+ No changes in this release.
18
+
19
+ ## 0.11.0
20
+
21
+ ### Patch Changes
22
+
23
+ - [`0e37d82`](https://github.com/oisin-ee/oisinpi/commit/0e37d8259d4a7cb4cffbeccfce2a36caa0274b6e) Thanks [@momo-momokaya[bot]](https://github.com/momo-momokaya%5Bbot%5D)! - Skip the todo activation check for the planning selections `tier/plan-claude` and `tier/plan-gpt`. Every other selection still needs an active local unit.
24
+
25
+ ## 0.10.2
26
+
27
+ ### Patch Changes
28
+
29
+ - [#35](https://github.com/oisin-ee/oisinpi/pull/35) [`a4554dc`](https://github.com/oisin-ee/oisinpi/commit/a4554dc2e64ba6e82fe5731992ba26c0c31c59b2) Thanks [@momo-momokaya](https://github.com/apps/momo-momokaya)! - A worker can call `dogsled done` after it closes its seeded todo leaf. Before, the todo gate blocked `mcp__dogsled__done`, so a finished worker could not report done.
30
+
31
+ ## 0.10.1
32
+
33
+ ### Patch Changes
34
+
35
+ - [#33](https://github.com/oisin-ee/oisinpi/pull/33) [`ac2e931`](https://github.com/oisin-ee/oisinpi/commit/ac2e931bf8d907eced3d075ebae2e9707713ea6f) Thanks [@momo-momokaya](https://github.com/apps/momo-momokaya)! - The owning lead can close any open leaf with `done` and a short note, or with `drop`. Closing a leaf that a worker holds clears the binding, records the execution as released, and frees its paths. A late settlement for a released execution is a no-op.
36
+
37
+ ## 0.10.0
38
+
39
+ ### Minor Changes
40
+
41
+ - [#30](https://github.com/oisin-ee/oisinpi/pull/30) [`5ab2bcc`](https://github.com/oisin-ee/oisinpi/commit/5ab2bcc44215d4f22e319d93dc57e8af12499b28) Thanks [@momo-momokaya](https://github.com/apps/momo-momokaya)! - Publish todo status groups as typed data. The work protocol is now version 3: the version 2 snapshot plus `display.sections`, four sections (`in_progress`, `pending`, `completed`, `abandoned`) that each carry a count and items with text, review flag, contract summary, and subtasks. Pi-todo no longer answers version 2 requests, so an older presenter falls back to standalone todos. Todos also gain an optional `description` on outcomes and subtasks: `content` is now a short headline and the description holds the detail. `update` sets or clears it, `view` prints it under the headline, and `display.sections` carries it for presenters; the Pi widget still shows headlines only.
42
+
43
+ ## 0.9.3
44
+
45
+ No changes in this release.
46
+
47
+ ## 0.9.2
48
+
49
+ No changes in this release.
50
+
51
+ ## 0.9.1
52
+
53
+ No changes in this release.
54
+
55
+ ## 0.9.0
56
+
57
+ No changes in this release.
58
+
59
+ ## 0.8.0
60
+
61
+ ### Minor Changes
62
+
63
+ - [`50877ec`](https://github.com/oisin-ee/oisinpi/commit/50877ec0f9bba71b7f70d8bf8d3754191ac73364) Thanks [@oisincoveney](https://github.com/oisincoveney)! - Add executable task contracts, local activation gates, and profile-assigned worker handoff. Import exact worker contracts before their first task request. Attach returned evidence without accepting the lead task automatically.
64
+
65
+ Use the executor-owned seed path capability with compatible Dogsled tooling. Require Pi 1.3.0 for the loaded startup guard. Prewalk recognizes validated activation and preserves its post-edit model switch.
66
+
67
+ ## 0.7.2
68
+
69
+ No changes in this release.
70
+
71
+ ## 0.7.1
72
+
73
+ ### Patch Changes
74
+
75
+ - [`b2ebd5a`](https://github.com/oisin-ee/oisinpi/commit/b2ebd5aefa0a52d84e7685c014fef5203e30e3a3) Thanks [@momo-momokaya[bot]](https://github.com/momo-momokaya%5Bbot%5D)! - Show completion reminders in the conversation. Reminder limits and continuation behavior remain unchanged.
76
+
77
+ ## 0.7.0
78
+
79
+ No changes in this release.
80
+
81
+ ## 0.6.0
82
+
83
+ ### Minor Changes
84
+
85
+ - [`eb67440`](https://github.com/oisin-ee/oisinpi/commit/eb674408bf1dfbdfec7fd319c3863ad05b3d730d) Thanks [@momo-momokaya[bot]](https://github.com/momo-momokaya%5Bbot%5D)! - Add two-level outcomes and bounded subtasks with exact parent-scoped targets. Creation stays pending, and explicit starts preserve parallel active work. Automatic activation is removed.
86
+
87
+ Keep parents open for explicit integration review after children close. Reject premature completion atomically. Preserve completed children when dropping a parent.
88
+
89
+ Show hierarchy and separate progress in shared rendering, model output, and reminders. Add work-unit guidance to tool results and approved-plan continuation. Old flat snapshots remain readable.
90
+
91
+ Pi-todo now supplies the renderer hosted by Wrangle's inline widget through display protocol version 2. Shared presentation requires a matching Wrangle release. Older integrations retain standalone todos instead of flattening subtasks.
92
+
93
+ ## 0.5.1
94
+
95
+ No changes in this release.
96
+
97
+ ## 0.5.0
98
+
99
+ No changes in this release.
100
+
101
+ ## 0.4.0
102
+
103
+ ### Minor Changes
104
+
105
+ - [`0a1434e`](https://github.com/oisin-ee/oisinpi/commit/0a1434eedb156c21abd36ae611a124b06f0ad1d8) Thanks [@momo-momokaya[bot]](https://github.com/momo-momokaya%5Bbot%5D)! - Continue approved Plannotator plans with the existing todo tool when external execution is enabled. Keep one branch-backed task list instead of a separate Plannotator checklist.
106
+
107
+ - [`74a563f`](https://github.com/oisin-ee/oisinpi/commit/74a563f9fa806902d9c0cf7d1d2e01edea255dec) Thanks [@momo-momokaya[bot]](https://github.com/momo-momokaya%5Bbot%5D)! - Publish validated todo snapshots for Wrangle's shared work display. Keep task state on the Pi session branch and restore the standalone widget when shared presentation ends.
108
+
109
+ ## 0.3.0
110
+
111
+ ### Minor Changes
112
+
113
+ - [`7f33497`](https://github.com/oisin-ee/oisinpi/commit/7f3349706861ab943f0be931ab3cff49e74d5f37) Thanks [@momo-momokaya[bot]](https://github.com/momo-momokaya%5Bbot%5D)! - Show only in-progress tasks in a themed, width-aware widget by default. Alt+T and /todos toggle grouped upcoming, done, and dropped tasks inline. Use /todos list for the full text summary.
114
+
115
+ ## 0.2.0
116
+
117
+ ### Minor Changes
118
+
119
+ - [#10](https://github.com/oisin-ee/oisinpi/pull/10) [`1c8612b`](https://github.com/oisin-ee/oisinpi/commit/1c8612b7dd1ce00e948d6fd6d3a421f956629e1a) Thanks [@momo-momokaya](https://github.com/apps/momo-momokaya)! - `@oisin-ee/oisinpi` replaces `@oisin-ee/pi-prewalk-kit`. It bundles pi-prewalk, pi-todo, pi-guardrails, and
120
+ pi-wrangle 0.11.0. `@oisin-ee/pi-guardrails` is new: the agent hook policies for pi, Claude Code (`agent-hook`), and
121
+ Codex, ported from the dotfiles hooks runtime.
122
+
123
+ ## 0.1.1
124
+
125
+ ### Patch Changes
126
+
127
+ - [#8](https://github.com/oisin-ee/pi-prewalk/pull/8) [`785734f`](https://github.com/oisin-ee/pi-prewalk/commit/785734ff387908f263c9031d8b16392ece7198f5) Thanks [@momo-momokaya](https://github.com/apps/momo-momokaya)! - `/prewalk on` arms a handoff, the same as `/prewalk`. The todo widget is hidden while the list has no tasks.
128
+
129
+ ## 0.1.0
130
+
131
+ ### Minor Changes
132
+
133
+ - [#7](https://github.com/oisin-ee/pi-prewalk/pull/7) [`f528eab`](https://github.com/oisin-ee/pi-prewalk/commit/f528eab26e4d2de300e1fdb9a3d5ec52e06ca9b6) Thanks [@momo-momokaya](https://github.com/apps/momo-momokaya)! - First release: the `todo` tool, the prewalk planner-to-executor handoff, and the kit that installs both.