@llblab/pi-actors 0.30.0 → 0.30.2
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 +2 -0
- package/BACKLOG.md +36 -0
- package/CHANGELOG.md +10 -0
- package/dist/scripts/music-player.mjs +0 -1
- package/dist/skills/actors/SKILL.md +2 -1
- package/dist/skills/swarm/SKILL.md +1 -1
- package/docs/async-runs.md +1 -1
- package/docs/recipe-library.md +1 -1
- package/package.json +1 -1
- package/scripts/music-player.mjs +0 -1
- package/skills/actors/SKILL.md +2 -1
- package/skills/swarm/SKILL.md +1 -1
package/AGENTS.md
CHANGED
|
@@ -129,6 +129,8 @@ Pi host
|
|
|
129
129
|
- Preserve JSON envelope object shape across handoffs.
|
|
130
130
|
- Keep locker state generic and thin; orchestration strategy belongs in the coordinator.
|
|
131
131
|
- Graceful actor retirement is opt-in through recipe/run metadata and must not infer retirement for persistent services or backlog implementers.
|
|
132
|
+
- Script helpers that spawn long-lived child processes should keep those children inside the async run's owned process group unless they also provide an explicit termination bridge; `control.kill` must not leave detached playback/service descendants alive.
|
|
133
|
+
- True daemon recipes are allowed, but daemon ownership belongs to the recipe/script contract: persist a pid or service handle, verify ownership before signaling, expose status/stop semantics, and bridge `control.kill` to daemon cleanup instead of relying on the generic runner to discover detached services.
|
|
132
134
|
|
|
133
135
|
## Context And Planning Hygiene
|
|
134
136
|
|
package/BACKLOG.md
CHANGED
|
@@ -41,6 +41,13 @@ Non-goals:
|
|
|
41
41
|
|
|
42
42
|
No open hotfix items.
|
|
43
43
|
|
|
44
|
+
## Backlog Curation Rules
|
|
45
|
+
|
|
46
|
+
- Completed work belongs in `CHANGELOG.md`, not in `BACKLOG.md`.
|
|
47
|
+
- File length alone is not a domain-split trigger: ~1000-line cohesive domain files are acceptable when ownership is clear.
|
|
48
|
+
- Consider splitting only when a file crosses roughly 2000 lines, mixes real ownership zones, or hides a clearer domain boundary.
|
|
49
|
+
- Prefer semantic compression before file splitting: fewer public nouns, consistent outcomes, compact diagnostics, and domain-owned constants/helpers.
|
|
50
|
+
|
|
44
51
|
## Minor Backlog
|
|
45
52
|
|
|
46
53
|
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.
|
|
@@ -73,6 +80,20 @@ The backlog is intentionally pruned to the 20% of work most likely to deliver 80
|
|
|
73
80
|
- Stale claims are reproducible and visible in worker status.
|
|
74
81
|
- Tests cover stale-claim counting without adding scheduler/broker policy.
|
|
75
82
|
|
|
83
|
+
### M-23 Tool Boundary Type Tightening
|
|
84
|
+
|
|
85
|
+
- Priority: Low.
|
|
86
|
+
- Status: Planned.
|
|
87
|
+
- Goal: Remove avoidable `any` at the Pi/tool boundary where a narrow local type can express the real contract without broad rewiring.
|
|
88
|
+
- Why now: `index.ts` still keeps runtime tool definitions in a `Map<string, any>`; this is small but visible in the composition root.
|
|
89
|
+
- Direction:
|
|
90
|
+
- Add or reuse a narrow exported tool-definition type from the Pi adapter or tools domain.
|
|
91
|
+
- Keep SDK details behind `lib/pi.ts`.
|
|
92
|
+
- Do not introduce a broad type-modeling pass across every schema helper.
|
|
93
|
+
- Acceptance:
|
|
94
|
+
- `index.ts` no longer uses `Map<string, any>` for actor tool definitions.
|
|
95
|
+
- TypeScript validation still passes without weakening public tool schemas.
|
|
96
|
+
|
|
76
97
|
### M-17 Message Delivery Outcome Contract
|
|
77
98
|
|
|
78
99
|
- Priority: High.
|
|
@@ -108,6 +129,20 @@ The backlog is intentionally pruned to the 20% of work most likely to deliver 80
|
|
|
108
129
|
- Tests cover valid promotion, invalid candidate, name collision, and packaged-recipe shadowing.
|
|
109
130
|
- Docs explain candidate memory vs active tool memory in one compact section.
|
|
110
131
|
|
|
132
|
+
### M-24 Registry Path Naming Cleanup
|
|
133
|
+
|
|
134
|
+
- Priority: Low.
|
|
135
|
+
- Status: Planned.
|
|
136
|
+
- Goal: Reduce legacy-storage naming noise without changing the persistent file path.
|
|
137
|
+
- Why now: `legacy-tool-registry.json` is still a compatibility storage path, but helper names and tests should make clear that the stable path is retained intentionally.
|
|
138
|
+
- Direction:
|
|
139
|
+
- Prefer neutral helper/test wording such as registry path or retained registry storage path.
|
|
140
|
+
- Keep the on-disk filename unchanged unless a separate migration is justified.
|
|
141
|
+
- Do not reintroduce legacy migration code.
|
|
142
|
+
- Acceptance:
|
|
143
|
+
- Path helpers and tests no longer imply an unfinished migration.
|
|
144
|
+
- Existing registry storage compatibility remains unchanged.
|
|
145
|
+
|
|
111
146
|
### M-19 Recipe Doctor Risk Labels v2
|
|
112
147
|
|
|
113
148
|
- Priority: Medium.
|
|
@@ -193,4 +228,5 @@ These are valid ideas but not current focus. Reintroduce only with concrete evid
|
|
|
193
228
|
```text
|
|
194
229
|
Next milestone: M-14 Session Mismatch Follow-through.
|
|
195
230
|
Then: M-15 Worker Stale-Claim Dogfood → M-17 Message Delivery Outcome Contract → M-18 Candidate Recipe Promotion UX.
|
|
231
|
+
Small cleanup lane: M-23 Tool Boundary Type Tightening → M-24 Registry Path Naming Cleanup.
|
|
196
232
|
```
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.30.2: Music Player Kill Hotfix
|
|
6
|
+
|
|
7
|
+
- `[Music Player]` Kept backend player processes inside the async run process group so `control.kill` can terminate an active music-player run without leaving detached `cvlc`/player children alive.
|
|
8
|
+
- `[Docs]` Updated durable project guidance, actor skill guidance, async-run ownership docs, and recipe-library music-player notes to preserve the run-owned process-tree invariant while still allowing true daemon recipes through explicit termination bridges.
|
|
9
|
+
|
|
10
|
+
## 0.30.1: Backlog Curation Hotfix
|
|
11
|
+
|
|
12
|
+
- `[Backlog]` Added curation rules clarifying that completed work belongs only in the changelog, that cohesive ~1000-line domain files are acceptable, and that file splitting should follow real ownership boundaries rather than line count alone.
|
|
13
|
+
- `[Backlog]` Added small cleanup candidates for typed tool-boundary tightening and retained registry-path naming clarity without expanding the public actor surface.
|
|
14
|
+
|
|
5
15
|
## 0.30.0: Composition Root Compression
|
|
6
16
|
|
|
7
17
|
- `[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.
|
|
@@ -804,7 +804,6 @@ function playOne(ctx, player, volume, track, index, count) {
|
|
|
804
804
|
const [command, args] = playerCommand(ctx, player, volume, track);
|
|
805
805
|
writeStatus(ctx, "playing", index, count, track, player, "");
|
|
806
806
|
const child = spawn(command, args, {
|
|
807
|
-
detached: process.platform !== "win32",
|
|
808
807
|
stdio: ["ignore", "inherit", "inherit"],
|
|
809
808
|
});
|
|
810
809
|
ctx.child = child;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: actors
|
|
3
3
|
description: Highest-density practical guide for pi-actors. Read this skill whenever prompt and tools are not enough for spawn, message, inspect, actor runs, tools, recipes, command templates, async lifecycle, mailboxes, artifacts, and local orchestration mechanics.
|
|
4
4
|
metadata:
|
|
5
|
-
version: 0.30.
|
|
5
|
+
version: 0.30.2
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Actors (pi-actors)
|
|
@@ -87,6 +87,7 @@ Envelope fields:
|
|
|
87
87
|
- Addresses: `run:<id>`, `branch:<run>/<branch>`, `room:<run>`, `tool:<name>`, `coordinator`, `session:<id>`.
|
|
88
88
|
- Room posts require `from` from the same run (`run:<run>` or `branch:<run>/<branch>`).
|
|
89
89
|
- Runtime termination message: `control.kill` is the only documented actor message that kills a run. `control.stop` and `control.cancel` are actor-local mailbox vocabulary only when a recipe declares and handles them. Terminal retention messages: `control.archive`, `control.prune`.
|
|
90
|
+
- Long-lived child processes should remain in the run-owned process group unless the recipe implements an explicit daemon termination bridge; do not leave unowned detached services behind `control.kill`.
|
|
90
91
|
|
|
91
92
|
Check `inspect view=mailbox` before domain-specific messages.
|
|
92
93
|
|
package/docs/async-runs.md
CHANGED
|
@@ -233,7 +233,7 @@ Use coordinator/session-bound messages for completion and decision points, not f
|
|
|
233
233
|
|
|
234
234
|
An async run belongs to the current user, cwd, and launching agent session at start time. Send, cancellation, and force-kill target only the recorded runner pid when command line and cwd still match the recorded owner data. Stale pid reuse must fail closed.
|
|
235
235
|
|
|
236
|
-
On Unix-like systems, `control.kill` signals the runner process group when available, then falls back to the runner pid. On native Windows, `control.kill` uses Windows process-tree termination through the platform adapter. The runner starts command-template children in the owned process tree, so long-running descendants such as audio players should stop with the run instead of becoming orphaned background processes. After the process exits, status reflects the operator action as `killed` instead of a generic `exited`. Programmatic `cancelRun()` remains an internal lifecycle helper for retirement and tests, but it is not a documented actor-message action.
|
|
236
|
+
On Unix-like systems, `control.kill` signals the runner process group when available, then falls back to the runner pid. On native Windows, `control.kill` uses Windows process-tree termination through the platform adapter. The runner starts command-template children in the owned process tree, so long-running descendants such as audio players should stop with the run instead of becoming orphaned background processes. A recipe may manage a true detached daemon, but then daemon ownership is recipe-local: the script must persist and verify a pid or service handle, expose status/stop behavior, and bridge `control.kill` to daemon cleanup. The generic runner does not scan for or guess detached services. After the process exits, status reflects the operator action as `killed` instead of a generic `exited`. Programmatic `cancelRun()` remains an internal lifecycle helper for retirement and tests, but it is not a documented actor-message action.
|
|
237
237
|
|
|
238
238
|
State is append-only where practical. Final result writes should be atomic. Recipe-local control endpoints and actor-message logs may live in the state dir. pi-actors core owns the generic run-local message adapter and runtime attention policy; command and message vocabularies belong to the recipe/script.
|
|
239
239
|
|
package/docs/recipe-library.md
CHANGED
|
@@ -185,7 +185,7 @@ The wrapper also accepts control commands directly when a caller already has the
|
|
|
185
185
|
scripts/music-player.mjs next ~/.pi/agent/tmp/pi-actors/runs/music
|
|
186
186
|
```
|
|
187
187
|
|
|
188
|
-
Message body is queued in the recipe's run-local mailbox and reconciled by the player loop. The loop treats `wake.jsonl` and `fs.watch` as advisory signals, then verifies the durable inbox signature before taking the inbox lock so unchanged mailboxes are not reread on every tick.
|
|
188
|
+
Message body is queued in the recipe's run-local mailbox and reconciled by the player loop. The loop treats `wake.jsonl` and `fs.watch` as advisory signals, then verifies the durable inbox signature before taking the inbox lock so unchanged mailboxes are not reread on every tick. Backend players stay inside the async run process group so `control.kill` terminates active playback with the run instead of leaving detached player children alive; player-local pause/resume/next/stop controls still signal the current backend pid or process group when available. The script writes `status.txt`, `player.json`, and track-change actor messages in the same state dir. Track-change messages stay diagnostic by default; interactive recipes should define a small command vocabulary for addressed messages, emit semantic actor messages for decision points, and let the coordinator react to messages rather than sleep-polling state.
|
|
189
189
|
|
|
190
190
|
Cross-platform smoke checklist:
|
|
191
191
|
|
package/package.json
CHANGED
package/scripts/music-player.mjs
CHANGED
|
@@ -804,7 +804,6 @@ function playOne(ctx, player, volume, track, index, count) {
|
|
|
804
804
|
const [command, args] = playerCommand(ctx, player, volume, track);
|
|
805
805
|
writeStatus(ctx, "playing", index, count, track, player, "");
|
|
806
806
|
const child = spawn(command, args, {
|
|
807
|
-
detached: process.platform !== "win32",
|
|
808
807
|
stdio: ["ignore", "inherit", "inherit"],
|
|
809
808
|
});
|
|
810
809
|
ctx.child = child;
|
package/skills/actors/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: actors
|
|
3
3
|
description: Highest-density practical guide for pi-actors. Read this skill whenever prompt and tools are not enough for spawn, message, inspect, actor runs, tools, recipes, command templates, async lifecycle, mailboxes, artifacts, and local orchestration mechanics.
|
|
4
4
|
metadata:
|
|
5
|
-
version: 0.30.
|
|
5
|
+
version: 0.30.2
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Actors (pi-actors)
|
|
@@ -87,6 +87,7 @@ Envelope fields:
|
|
|
87
87
|
- Addresses: `run:<id>`, `branch:<run>/<branch>`, `room:<run>`, `tool:<name>`, `coordinator`, `session:<id>`.
|
|
88
88
|
- Room posts require `from` from the same run (`run:<run>` or `branch:<run>/<branch>`).
|
|
89
89
|
- Runtime termination message: `control.kill` is the only documented actor message that kills a run. `control.stop` and `control.cancel` are actor-local mailbox vocabulary only when a recipe declares and handles them. Terminal retention messages: `control.archive`, `control.prune`.
|
|
90
|
+
- Long-lived child processes should remain in the run-owned process group unless the recipe implements an explicit daemon termination bridge; do not leave unowned detached services behind `control.kill`.
|
|
90
91
|
|
|
91
92
|
Check `inspect view=mailbox` before domain-specific messages.
|
|
92
93
|
|
package/skills/swarm/SKILL.md
CHANGED