@llblab/pi-actors 0.29.2 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -15,6 +15,19 @@ Treat this extension as an experimental self-evolution membrane for the agent ha
15
15
 
16
16
  ## Topology
17
17
 
18
+ ```text
19
+ Pi host
20
+ -> index.ts composition root
21
+ -> lib/tools.ts / prompts.ts public tool + injected prompt surface
22
+ -> lib/runtime.ts / registry.ts active user recipe tools
23
+ -> lib/recipe-*.ts packaged/user/candidate recipe discovery
24
+ -> lib/async-runs.ts spawn lifecycle and run state
25
+ -> lib/actor-rooms.ts room, roster, mailbox, communication log
26
+ -> scripts/*.mjs thin process entrypoints
27
+ -> recipes/*.json packaged actor components
28
+ -> skills/* + docs/* agent guidance and transportable specs
29
+ ```
30
+
18
31
  - `/index.ts`: Minimal extension coordinator/composition root. It wires live pi ports and should avoid owning domain behavior.
19
32
 
20
33
  ## Domain Modules
@@ -55,8 +68,10 @@ Treat this extension as an experimental self-evolution membrane for the agent ha
55
68
  ## Knowledge Surfaces
56
69
 
57
70
  - Injected prompt: tiny bootstrap/reminder, never full docs.
71
+ - Skill header: routing metadata that tells agents when to load a bundled skill.
72
+ - Skill body: dense agent-facing operating manual for the matched concern.
58
73
  - README: public face of the project. Keep it current, focused, pruned, and limited to highest-signal scenarios.
59
- - `actors` skill: agent-facing manual for operating the extension and navigating bundled recipes.
74
+ - `actors` skill: runtime/tooling manual for operating the extension and navigating high-value bundled recipes.
60
75
  - `swarm` skill: multi-agent methodology, strategies, standards, and portable examples.
61
76
  - `/docs`: detailed transportable standards read on demand.
62
77
  - `AGENTS.md`: durable project protocol for agents changing this repo.
package/BACKLOG.md CHANGED
@@ -45,253 +45,134 @@ No open hotfix items.
45
45
 
46
46
  The backlog is intentionally pruned to the 20% of work most likely to deliver 80% of value for `pi-actors` as a local actor kernel. Bias toward consolidation, smaller public surface area, and reliability over new feature breadth.
47
47
 
48
- ### M-01 State Corruption Recovery
49
-
50
- - Priority: High.
51
- - Status: Done.
52
- - Goal: Keep `inspect` useful when file-backed run, room, branch, or recipe state is partially corrupted.
53
- - Why now: The extension's core promise is local, inspectable, durable actor state. Corrupt JSON/JSONL should degrade visibility, not break the operator membrane.
54
- - Direction:
55
- - Continue migrating repeated JSON/JSONL inspect paths to `lib/state-readers.ts`.
56
- - Preserve valid records and report corrupt paths/counts.
57
- - Do not silently rewrite canonical state without an explicit repair action.
58
- - Acceptance:
59
- - Malformed JSONL lines do not kill inspect paths.
60
- - Corrupt JSON files surface diagnostics with paths.
61
- - Tests cover run, branch, room, and recipe-adjacent state where practical.
62
-
63
- ### M-02 Actor Loop Helper Minimal Core
64
-
65
- - Priority: High.
66
- - Status: Done.
67
- - Goal: Provide one small reusable mailbox loop so recipe authors do not duplicate claim/handle/status logic.
68
- - Why now: Long-lived actors and worker recipes are the natural center of `pi-actors`; a minimal helper consolidates behavior without adding a broker or scheduler DSL.
69
- - Files:
70
- - `lib/mailbox-loop.ts`.
71
- - Direction:
72
- - Support run inbox claiming, branch inbox claiming, handled/failed status transitions, bounded drains, duplicate-claim protection, and graceful stop-message detection.
73
- - Defer live wake subscription and polling wrappers until the canonical worker recipe needs them.
74
- - Keep policy out: no task selection, no model choice, no project prompts.
75
- - Acceptance:
76
- - Helper supports run inbox and branch inbox.
77
- - Claim/handle/fail transitions are covered by tests.
78
- - Duplicate branch claims do not double-process one message.
79
- - Bounded drains stop on standard control messages.
80
-
81
- ### M-03 Canonical Worker Recipe Template
82
-
83
- - Priority: High.
84
- - Status: Done.
85
- - Depends on: M-02.
86
- - Goal: Add one canonical packaged worker recipe/template demonstrating the intended long-lived actor pattern.
87
- - Why now: The extension should teach one excellent mailbox loop rather than accumulate scenario-specific scripts.
88
- - Direction:
89
- - Worker joins the default room.
90
- - Worker declares typed mailbox accepts/emits.
91
- - Worker claims branch inbox work.
92
- - Worker posts `task.claim`, `task.result`, and `awaiting_assignment`.
93
- - Worker handles `control.stop`.
94
- - Acceptance:
95
- - Demonstrates correct mailbox loop semantics.
96
- - Stays a recipe-authoring reference, not a product workflow catalog.
97
- - Actor skill links it as the canonical worker pattern.
98
-
99
- ### M-04 Protocol Contract Fixtures
100
-
101
- - Priority: Medium.
102
- - Status: Done.
103
- - Goal: Freeze the current protocol behavior with compact internal fixtures before further surface growth.
104
- - Why now: `spawn`, `message`, `inspect`, mailbox contracts, artifacts, rooms, and run indexes now have enough shape to merit regression fixtures; schemas should document reality, not invent a new standard.
105
- - Direction:
106
- - Add fixtures for representative run state, actor message, run inbox/outbox, room message/roster, mailbox contract, artifact manifest, and recipe summary.
107
- - Add lightweight schema or shape validation only where it protects existing behavior.
108
- - Acceptance:
109
- - Public examples and fixtures validate in tests.
110
- - No migration is forced.
111
- - No external transport/MCP standard is introduced.
112
-
113
- ### M-05 Follow-Up Deduplication Hardening
114
-
115
- - Priority: Medium.
116
- - Status: Done.
117
- - Goal: Suppress duplicate terminal transitions and outbox follow-ups across watcher reloads, session restarts, or line-counter resets.
118
- - Why now: Operator-facing observability should be calm and trustworthy as actor count grows.
119
- - Direction:
120
- - Continue using event id and stateDir for deduplication where available.
121
- - Preserve terminal handled semantics.
122
- - Simulate watcher restart in tests.
123
- - Acceptance:
124
- - Duplicate follow-up is suppressed after reasonable watcher reset.
125
- - Terminal handled state remains effective.
126
- - Tests cover restart and line-counter reset scenarios.
127
-
128
- ### M-06 Portability Reality Pass
48
+ ### M-14 Session Mismatch Follow-through
129
49
 
130
50
  - Priority: Medium.
131
- - Status: Done.
132
- - Goal: Make current Linux/macOS/WSL/native-Windows behavior explicit without adding a new backend.
133
- - Why now: Mailbox-only paths and named-pipe support exist; operators need accurate diagnostics, not hidden platform assumptions.
51
+ - Status: Planned.
52
+ - Goal: Extend 0.27 structured session diagnostics consistently across room, branch, run, coordinator, and session workflows.
53
+ - Why now: M-12 established the shape; dogfood should now make every ownership denial equally actionable without relaxing ownership gates.
134
54
  - Direction:
135
- - Doctor flags FIFO-only recipes on native Windows.
136
- - Keep mailbox-only worker demo cross-platform.
137
- - Document a small platform matrix.
138
- - Cover named-pipe adapter with injected sender where practical.
55
+ - Audit all session mismatch errors for consistent `reason`, owner/current session fields, and inspect-session hints.
56
+ - Keep read/write ownership policy unchanged.
57
+ - Update docs with session mismatch examples and recovery inspection paths.
139
58
  - Acceptance:
140
- - Native Windows limitations are visible before launch.
141
- - Mailbox-only recipe works cross-platform.
142
- - Docs and tests cover the adapter split.
59
+ - Room, branch, run, coordinator, and session denials share the same compact/verbose shape.
60
+ - Tests cover representative inspect and message paths.
143
61
 
144
- ### M-07 Compiled Script Entrypoints
62
+ ### M-15 Worker Stale-Claim Dogfood
145
63
 
146
64
  - Priority: Medium.
147
- - Status: Done.
148
- - Goal: Bring packaged script entrypoints under the build so installed npm recipes run against compiled runtime code.
149
- - Why now: Recipes increasingly depend on helper scripts that import extension internals; compiling script logic closes the gap between source-tree development and installed package behavior.
65
+ - Status: Planned.
66
+ - Goal: Validate and harden actor-worker v2 stale-claim visibility under intentionally stale claimed branch messages.
67
+ - Why now: M-09 exposed `stale_claims`; real dogfood should verify the operator can diagnose stuck claimed work before adding recovery policy.
150
68
  - Direction:
151
- - Keep stable executable recipe paths through thin `scripts/*.mjs` shims.
152
- - Keep substantive reusable script logic in compiled `lib/*.ts` modules so scripts stay lightweight runners and `dist/lib` is the JS-only runtime surface; allow self-contained application scripts to remain standalone `.mjs` when no reuse is expected.
153
- - Keep `npm run build` checking packaged script entrypoint syntax while compiled module migration proceeds.
154
- - Make installed scripts prefer `dist` runtime modules and avoid importing `.ts` from `node_modules`.
155
- - Preserve source-tree developer ergonomics without requiring global install.
156
- - Expose compiled JS as the default Node-compatible extension entrypoint and source TS/skill paths as optional metadata for TypeScript-native runtimes.
157
- - Treat `dist/` as the JS-only distributive tree: mirror runtime assets (`scripts/`, `recipes/`, `fixtures/`, and `skills/`) there during build and point default package metadata at those dist assets.
158
- - Track each converted script with a compiled module existence regression so shim drift is caught before packaging.
69
+ - Create deterministic stale claimed branch inbox fixtures or smoke tests.
70
+ - Verify `worker-status.json`, room events, and inspect surfaces make stale claims visible.
71
+ - Defer auto-recovery unless workflow evidence proves it is safe.
159
72
  - Acceptance:
160
- - `npm run build` covers packaged script logic, not only extension library code.
161
- - Installed-script tests prove packaged recipes do not import TypeScript from `node_modules`.
162
- - `npm run pack:dry` includes expected compiled/script files.
163
- - Recipe paths remain stable or migrations are explicitly documented.
73
+ - Stale claims are reproducible and visible in worker status.
74
+ - Tests cover stale-claim counting without adding scheduler/broker policy.
164
75
 
165
- ### M-08 Recipe Doctor Remediation UX
76
+ ### M-17 Message Delivery Outcome Contract
166
77
 
167
78
  - Priority: High.
168
- - Status: Done.
169
- - Goal: Turn recipe doctor output into an operator action surface, not just a diagnostic listing.
170
- - Why now: Recipe registry warnings are intentionally actionable; the next value is helping operators decide whether to fix, disable, delete, or inspect a recipe without hiding the warning.
79
+ - Status: Planned.
80
+ - Goal: Normalize `message` results so operators can distinguish delivered, queued, persisted, forwarded, unsupported, and ownership-denied outcomes.
81
+ - Why now: Branch message UX already treats durable branch mailbox persistence as a successful queued outcome when a parent endpoint is unavailable; that local fix should become a consistent message-result membrane.
171
82
  - Direction:
172
- - Summarize invalid, blocking, shadowed, disabled, and risky shell-boundary entries with compact recommended actions.
173
- - Keep remediation advisory by default; no automatic mutation of user recipes.
174
- - Preserve detailed diagnostics through verbose inspection.
83
+ - Define compact delivery fields: `queued`, `delivered`, `persisted`, `forwarded`, `consumer`, `reason`, and `hint`.
84
+ - Apply the shape to `run:<id>`, `branch:<run>/<branch>`, `room:<run>`, `coordinator`, `session:`, and `tool:<name>` where meaningful.
85
+ - Reuse M-14 session mismatch shape for ownership-denied outcomes.
86
+ - Do not claim guaranteed live consumption unless a known consumer exists.
87
+ - Do not add a broker, distributed delivery semantics, or a new public noun.
175
88
  - Acceptance:
176
- - `inspect target=recipes view=doctor` identifies the highest-priority actionable maintenance item.
177
- - Blocking invalid recipes include the blocked lower-priority candidate when available.
178
- - Tests cover at least invalid/blocking, disabled, shadowed, and risky shell diagnostics.
89
+ - Branch messages clearly report queued/persisted state and known worker-consumer state where available.
90
+ - Room messages distinguish timeline append success from forwarded branch-targeted copies.
91
+ - Tests cover at least run, branch, room, coordinator, and ownership-denied outcomes.
179
92
 
180
- ### M-09 Actor Worker v2
93
+ ### M-18 Candidate Recipe Promotion UX
181
94
 
182
95
  - Priority: High.
183
- - Status: Done.
184
- - Goal: Promote `actor-worker` from a minimal demo into the canonical standard-worker reference pattern.
185
- - Why now: Mailbox-loop semantics are now stable enough to show artifact production, compact status, and stale-claim recovery without adding a scheduler or broker.
96
+ - Status: Planned.
97
+ - Goal: Make successful ad hoc actor patterns easy to promote manually from candidate memory into active user recipe memory.
98
+ - Why now: Candidate recipes under `~/.pi/agent/recipes/candidates` are replayable but intentionally not active tools; the two-stage memory model now needs an explicit operator-gated promotion path.
186
99
  - Direction:
187
- - Add optional task result artifact writing.
188
- - Expose compact worker status for `inspect` and room events.
189
- - Add stale-claim recovery or timeout semantics where they fit the mailbox-loop helper.
190
- - Preserve policy-light behavior: no model choice, prompt design, or project task selection.
100
+ - List candidate recipes with source run, timestamp, fingerprint, description/template preview, and validation status.
101
+ - Promote a selected candidate to `~/.pi/agent/recipes/<name>.json` only through an explicit action or explicit tool argument.
102
+ - Run recipe validation/doctor before writing and expose collision/shadowing diagnostics.
103
+ - Preserve candidate files unless deletion is explicitly requested.
104
+ - Prefer extending existing registry/tool surfaces over adding a new public noun.
191
105
  - Acceptance:
192
- - Worker can produce a durable artifact path for handled work.
193
- - Stale claimed work can be surfaced or recovered deterministically.
194
- - The actors skill documents the v2 worker pattern.
106
+ - Candidate recipes remain non-tools until promotion.
107
+ - Promotion writes atomically and never auto-promotes.
108
+ - Tests cover valid promotion, invalid candidate, name collision, and packaged-recipe shadowing.
109
+ - Docs explain candidate memory vs active tool memory in one compact section.
195
110
 
196
- ### M-10 Dist Package Contract Hardening
111
+ ### M-19 Recipe Doctor Risk Labels v2
197
112
 
198
113
  - Priority: Medium.
199
- - Status: Done.
200
- - Goal: Make the dist-first package contract difficult to regress after the 0.24 packaging shift.
201
- - Why now: `dist/` is now the default JS-only runtime surface and carries mirrored scripts, recipes, fixtures, and skills.
114
+ - Status: Planned.
115
+ - Goal: Evolve recipe doctor into a compact capability-risk membrane without pretending to sandbox trusted local execution.
116
+ - Why now: Recipe doctor already has remediation UX; the next useful slice is deterministic advisory risk classification for local capabilities.
202
117
  - Direction:
203
- - Add package-layout checks for default metadata, source metadata, mirrored assets, and compiled script-domain modules.
204
- - Add negative checks for stale renamed dist files and source-only runtime imports from installed packages.
205
- - Keep source files packaged for TypeScript-native runtimes unless a future package-size decision changes that explicitly.
118
+ - Add advisory labels such as `risk.shell`, `risk.eval`, `risk.broad_fs_write`, `risk.destructive_fs`, `risk.network`, `risk.external_side_effect`, `risk.long_running`, `risk.platform_specific`, and `risk.secret_touching`.
119
+ - Keep labels advisory and deterministic; do not block execution unless existing validation already blocks it.
120
+ - Expose compact risk summaries in `inspect target=recipes view=doctor` and verbose per-recipe labels.
121
+ - Keep launch-time warnings quiet except for already-failing or clearly dangerous cases.
122
+ - Preserve honest wording: trusted local execution, not isolation.
206
123
  - Acceptance:
207
- - `npm run validate` fails if default Pi metadata points outside `dist` unexpectedly.
208
- - Installed-package tests cover every script shim that imports compiled domain logic.
209
- - Pack dry assertions cover `dist/scripts`, `dist/recipes`, `dist/fixtures`, and `dist/skills`.
124
+ - Risk labels are deterministic and tested.
125
+ - Existing risky shell-boundary diagnostics remain intact.
126
+ - Doctor output stays compact by default.
127
+ - README/docs do not introduce sandbox or security-boundary claims.
210
128
 
211
- ### M-11 Actor Termination Semantics
129
+ ### M-20 Runtime Triage Surface
212
130
 
213
131
  - Priority: Medium.
214
- - Status: Done.
215
- - Goal: Make `control.kill` the canonical parent-to-actor termination action while keeping `control.stop` and `control.cancel` as actor-domain messages whose meaning depends on the actor protocol.
216
- - Why now: Mailbox workers need a clearer lifecycle boundary before v2 patterns harden. Treating `stop`, `cancel`, and `kill` as equivalent stop messages blurs actor termination with domain-specific task or playback control.
217
- - Remaining direction:
218
- - Audit packaged recipe `mailbox.accepts` declarations so `control.stop` and `control.cancel` appear only when actor-specific behavior is meaningful.
219
- - Preserve `control.kill` as the universal lifecycle action for a parent/supervisor terminating an actor or run.
220
- - Reframe any remaining docs that imply `control.stop` or `control.cancel` are generic runtime termination aliases.
221
- - Do not preserve compatibility shims for the old stop/cancel-as-termination behavior before the first 1.0 major release unless a concrete safety issue appears during implementation.
222
- - Acceptance:
223
- - Docs and actors skill advertise `control.kill` as canonical parent-to-actor termination.
224
- - Mailbox-loop helpers/tests distinguish actor termination from actor-domain `stop`/`cancel` handling.
225
- - Packaged recipes declare `stop`/`cancel` only when the actor-specific behavior is meaningful.
226
- - Tests assert that generic mailbox-loop termination is not triggered by `control.stop` or `control.cancel`.
227
-
228
- ### M-12 Runtime and Session Observability UX
229
-
230
- - Priority: High.
231
- - Status: Done.
232
- - Goal: Make reload/session/runtime mismatches visible without changing ownership or lifecycle policy.
233
- - Why now: 0.26 dogfood showed that actors, mailbox workers, and hotfixes work after a full Pi restart, but ordinary reloads can leave operators unsure which extension code is live. Session ownership mismatches also surface as terse strings instead of structured diagnostics or navigation hints.
234
- - Direction:
235
- - Add an intentional runtime/version inspection surface that reports loaded package version, entrypoint path, source/dist mode, package root, recipe roots, and git commit when available.
236
- - Make session ownership denials structured in tool details with compact `reason=session_mismatch owner_session=... current_session=...` text and hints to inspect the owning session.
237
- - Make coordinator/session status show when other sessions or other-session runs exist so `runs=0` is not misleading after reload or resume.
238
- - Document reload vs full restart verification in the actors/swarm guidance.
239
- - Opportunistically improve invalid shadowing recipe launch hints only if it stays diagnostic-only.
240
- - Non-goals:
241
- - No cross-session force kill.
242
- - No session attach/adopt/reparent policy.
243
- - No relaxation of current ownership gates.
244
- - Acceptance:
245
- - Operators can verify the loaded pi-actors version/path from an inspect/tool surface after reload.
246
- - Session mismatch responses carry structured details and a compact human hint.
247
- - Coordinator/session status exposes other-session counts without leaking unrelated run details by default.
248
- - Tests cover version inspection, session mismatch shape, and other-session count summaries.
249
-
250
- ### M-13 Shadowed Recipe Launch Diagnostics
251
-
252
- - Priority: High.
253
- - Status: Done.
254
- - Goal: Make broken user recipes that shadow packaged/ad hoc candidates obvious only at the moment a launch already fails.
255
- - Why now: 0.26 dogfood found a broken `~/.pi/agent/recipes/actor-worker.json` shadowing the packaged `actor-worker`; Recipe Doctor exposed the evidence, but the launch path did not provide a direct hint.
132
+ - Status: Planned.
133
+ - Goal: Add one compact operator triage view that answers what needs attention right now without performing repairs.
134
+ - Why now: Runtime status, recipe doctor, candidates, stale claims, session mismatches, failed runs, and other-session counts are currently separate bounded surfaces.
256
135
  - Direction:
257
- - Treat shadowing as a normal, intentional override mechanism; do not warn on healthy shadowing.
258
- - When recipe resolution or launch fails because the active user recipe is invalid/disabled and a lower-priority candidate exists, surface `reason=shadowed_invalid` or `reason=shadowed_disabled` where practical.
259
- - Treat disabled template recipes as non-launchable so disabled shadowing fails consistently instead of silently executing.
260
- - Include minimal compact tokens: active path, blocked candidate path, and `hint=inspect_recipes_doctor`.
261
- - Keep remediation advisory only; do not auto-disable, delete, rewrite, or nag about user recipes.
136
+ - Add `inspect target=tool:pi-actors view=triage` or an equivalent existing inspect surface.
137
+ - Summarize runtime version/mode, active runs, other-session runs, invalid or blocking recipes, high-risk recipes, candidate recipes, stale worker claims, recent failed runs, attention messages, and suggested next inspect actions.
138
+ - Keep every warning tied to a next inspect/action hint.
139
+ - Do not auto-repair, auto-prune, relax ownership, or hide detailed source-of-truth views.
262
140
  - Acceptance:
263
- - Healthy user overrides remain silent.
264
- - Launch failures caused by invalid/disabled shadowing include a compact actionable hint.
265
- - Verbose details expose the active broken recipe and blocked fallback candidate.
266
- - Tests cover invalid and disabled user recipes shadowing a packaged candidate.
141
+ - Triage output is compact enough for agent context.
142
+ - Healthy and degraded states are covered by tests.
143
+ - Detailed inspect/doctor/status views remain source of truth.
267
144
 
268
- ### M-14 Session Mismatch Follow-through
145
+ ### M-21 Packaged Recipe QA Matrix
269
146
 
270
147
  - Priority: Medium.
271
148
  - Status: Planned.
272
- - Goal: Extend 0.27 structured session diagnostics consistently across room, branch, run, coordinator, and session workflows.
273
- - Why now: M-12 established the shape; dogfood should now make every ownership denial equally actionable without relaxing ownership gates.
149
+ - Goal: Prevent packaged recipes from drifting into inconsistent mailbox, artifact, platform, or package-root behavior.
150
+ - Why now: Packaged recipes are standard-library components; they should be boringly consistent before operators copy or register them as durable local capabilities.
274
151
  - Direction:
275
- - Audit all session mismatch errors for consistent `reason`, owner/current session fields, and inspect-session hints.
276
- - Keep read/write ownership policy unchanged.
277
- - Update docs with session mismatch examples and recovery inspection paths.
152
+ - Add an internal QA check over `recipes/*.json` for descriptions, async mailbox contracts, termination vocabulary, artifact declarations, platform notes, installed-package-safe helper paths, and compiled shim coverage.
153
+ - Keep `control.kill` as generic runtime termination and allow `control.stop` / `control.cancel` only as actor-domain vocabulary.
154
+ - Fail with exact recipe/path/key diagnostics.
155
+ - Avoid a broad recipe-library rewrite beyond violations discovered by the check.
278
156
  - Acceptance:
279
- - Room, branch, run, coordinator, and session denials share the same compact/verbose shape.
280
- - Tests cover representative inspect and message paths.
157
+ - QA runs under an existing validation command or a clearly named subcheck used by `npm run validate`.
158
+ - Tests/fixtures cover at least one positive and one negative case.
159
+ - Packaged recipes remain optional components, not policy workflows.
281
160
 
282
- ### M-15 Worker Stale-Claim Dogfood
161
+ ### M-22 Wake and Watcher Chaos Fixtures
283
162
 
284
163
  - Priority: Medium.
285
164
  - Status: Planned.
286
- - Goal: Validate and harden actor-worker v2 stale-claim visibility under intentionally stale claimed branch messages.
287
- - Why now: M-09 exposed `stale_claims`; real dogfood should verify the operator can diagnose stuck claimed work before adding recovery policy.
165
+ - Goal: Harden the invariant that durable files are canonical and wake notifications are advisory acceleration.
166
+ - Why now: Wake, watcher, line-counter, and JSONL resilience are central to operator trust as actor counts grow.
288
167
  - Direction:
289
- - Create deterministic stale claimed branch inbox fixtures or smoke tests.
290
- - Verify `worker-status.json`, room events, and inspect surfaces make stale claims visible.
291
- - Defer auto-recovery unless workflow evidence proves it is safe.
168
+ - Add deterministic fixtures for watcher restart, line-counter reset, duplicate terminal events, missing wake with present inbox record, wake before file catch-up, corrupt JSONL with later valid records, and killed run with stale progress phase.
169
+ - Preserve event-driven observability without reintroducing polling-first coordination examples.
170
+ - Keep tests fast and local.
292
171
  - Acceptance:
293
- - Stale claims are reproducible and visible in worker status.
294
- - Tests cover stale-claim counting without adding scheduler/broker policy.
172
+ - Duplicate follow-ups do not reappear.
173
+ - Missing wake does not lose durable messages.
174
+ - Corrupt records degrade inspect but do not kill it.
175
+ - Killed/stale progress states remain diagnosable.
295
176
 
296
177
  ## Explicitly Deferred
297
178
 
@@ -301,6 +182,7 @@ These are valid ideas but not current focus. Reintroduce only with concrete evid
301
182
  - Run restart/reattach policy: risky for isolation; defer until corruption recovery and protocol fixtures are stronger.
302
183
  - Cross-session force kill or attach/adopt/reparent: useful later, but ownership policy should not change until observability makes current boundaries clear.
303
184
  - Actor address helper CLI: keep diagnostics improving opportunistically inside existing parser/tests.
185
+ - Golden flow docs and flow conformance runner: useful after M-14, M-15, M-17, and M-18 make the diagnostic and promotion surfaces stable.
304
186
  - Documentation refactor: defer until the canonical mailbox loop and worker recipe exist; avoid rewriting docs twice.
305
187
  - Host-level tool unregistration: blocked on host API support.
306
188
  - Branch-local checkpoint semantics: wait for real collaborative branch-runner experiments.
@@ -310,4 +192,5 @@ These are valid ideas but not current focus. Reintroduce only with concrete evid
310
192
 
311
193
  ```text
312
194
  Next milestone: M-14 Session Mismatch Follow-through.
195
+ Then: M-15 Worker Stale-Claim Dogfood → M-17 Message Delivery Outcome Contract → M-18 Candidate Recipe Promotion UX.
313
196
  ```
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.30.0: Composition Root Compression
6
+
7
+ - `[Entrypoint]` Added a narrow Pi SDK adapter domain, moved recipe live-reload mechanics into the runtime domain, moved run-state watcher, run UI observation state, and run notification formatting into observability, moved runtime path constants and co-located skill path discovery to the paths domain, grouped core actor tool definitions in the tools domain, and shifted actor-inspector command state/parsing/render selection into the actor-inspector domain so `index.ts` keeps only live Pi wiring.
8
+ - `[Backlog]` Added focused next-minor candidates for message delivery outcomes, candidate recipe promotion, recipe risk labels, runtime triage, packaged recipe QA, and wake/watcher chaos fixtures while deferring broader golden-flow documentation until the core diagnostic surfaces settle.
9
+
10
+ ## 0.29.3: Actor Skill Context Hotfix
11
+
12
+ - `[Skills]` Reconciled knowledge-surface layering across project and actor guidance, added a project topology map, moved multi-agent methodology from the actors runtime skill into the swarm skill, and split actor quick-start guidance from a deeper recipe/operating-pattern reference.
13
+
5
14
  ## 0.29.2: Legacy Migration Removal Hotfix
6
15
 
7
16
  - `[Registry]` Removed the old legacy tool-registry migration path now that recipe-file storage is the only maintained persistence surface.
package/dist/index.d.ts CHANGED
@@ -4,5 +4,5 @@
4
4
  *
5
5
  * Wraps command templates as callable pi tools, stores durable user tools as recipe files, and exposes actor orchestration across reloads and sessions.
6
6
  */
7
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
8
- export default function toolRegistryExtension(pi: ExtensionAPI): void;
7
+ import * as Pi from "./lib/pi.ts";
8
+ export default function toolRegistryExtension(pi: Pi.ExtensionAPI): void;