@llblab/pi-actors 0.23.0 → 0.24.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.
- package/AGENTS.md +125 -60
- package/BACKLOG.md +133 -176
- package/CHANGELOG.md +27 -0
- package/README.md +13 -0
- package/dist/fixtures/protocol/actor-message-branch.json +13 -0
- package/dist/fixtures/protocol/artifact-manifest.json +9 -0
- package/dist/fixtures/protocol/mailbox-contract.json +15 -0
- package/dist/fixtures/protocol/recipe-summary.json +16 -0
- package/dist/fixtures/protocol/room-message.json +11 -0
- package/dist/fixtures/protocol/room-roster.json +11 -0
- package/dist/fixtures/protocol/run-inbox-message.json +9 -0
- package/dist/fixtures/protocol/run-outbox-event.json +9 -0
- package/dist/fixtures/protocol/run-state.json +10 -0
- package/dist/index.js +3 -2
- package/dist/lib/actor-inspector-tui.js +5 -32
- package/dist/lib/actor-rooms.d.ts +8 -0
- package/dist/lib/actor-rooms.js +64 -20
- package/dist/lib/actor-worker.d.ts +13 -0
- package/dist/lib/actor-worker.js +86 -0
- package/dist/lib/async-runner.d.ts +5 -0
- package/dist/lib/async-runner.js +134 -0
- package/dist/lib/async-runs.js +9 -28
- package/dist/lib/conformance.d.ts +12 -0
- package/dist/lib/conformance.js +28 -0
- package/dist/lib/coordinator.d.ts +5 -0
- package/dist/lib/coordinator.js +574 -0
- package/dist/lib/locker.d.ts +5 -0
- package/dist/lib/locker.js +310 -0
- package/dist/lib/mailbox-loop.d.ts +41 -0
- package/dist/lib/mailbox-loop.js +62 -0
- package/dist/lib/observability.d.ts +2 -2
- package/dist/lib/observability.js +51 -53
- package/dist/lib/prompts.d.ts +1 -1
- package/dist/lib/prompts.js +1 -1
- package/dist/lib/recipe-references.js +25 -2
- package/dist/lib/recipe-utils.d.ts +5 -0
- package/dist/lib/recipe-utils.js +385 -0
- package/dist/lib/runtime-notifier.js +3 -7
- package/dist/lib/state-readers.d.ts +21 -0
- package/dist/lib/state-readers.js +74 -0
- package/dist/lib/tools.js +1 -1
- package/dist/lib/validate-recipe.d.ts +6 -0
- package/dist/lib/validate-recipe.js +104 -0
- package/dist/recipes/actor-worker.json +35 -0
- package/dist/recipes/coordinator-locker.json +45 -0
- package/dist/recipes/lens-swarm.json +66 -0
- package/dist/recipes/locker.json +45 -0
- package/dist/recipes/music-player.json +38 -0
- package/dist/recipes/pipeline-architect-coordinator.json +95 -0
- package/dist/recipes/pipeline-artifact-bundle.json +100 -0
- package/dist/recipes/pipeline-artifact-report.json +58 -0
- package/dist/recipes/pipeline-artifact-write.json +72 -0
- package/dist/recipes/pipeline-async-run-ops.json +70 -0
- package/dist/recipes/pipeline-checkpoint-continuation.json +67 -0
- package/dist/recipes/pipeline-development-tasking.json +81 -0
- package/dist/recipes/pipeline-docs-maintenance.json +80 -0
- package/dist/recipes/pipeline-media-library.json +59 -0
- package/dist/recipes/pipeline-quorum-review.json +79 -0
- package/dist/recipes/pipeline-release-readiness.json +110 -0
- package/dist/recipes/pipeline-release-summary.json +88 -0
- package/dist/recipes/pipeline-repo-health.json +89 -0
- package/dist/recipes/pipeline-research-synthesis.json +94 -0
- package/dist/recipes/pipeline-review-readiness.json +54 -0
- package/dist/recipes/pipeline-room-swarm.json +50 -0
- package/dist/recipes/subagent-artifact.json +32 -0
- package/dist/recipes/subagent-checkpoint.json +33 -0
- package/dist/recipes/subagent-conflict-report.json +32 -0
- package/dist/recipes/subagent-contradiction-map.json +33 -0
- package/dist/recipes/subagent-critic.json +35 -0
- package/dist/recipes/subagent-evidence-map.json +33 -0
- package/dist/recipes/subagent-followup.json +33 -0
- package/dist/recipes/subagent-judge.json +33 -0
- package/dist/recipes/subagent-merge.json +33 -0
- package/dist/recipes/subagent-message.json +34 -0
- package/dist/recipes/subagent-normalize.json +31 -0
- package/dist/recipes/subagent-plan.json +33 -0
- package/dist/recipes/subagent-prompt.json +28 -0
- package/dist/recipes/subagent-quorum.json +43 -0
- package/dist/recipes/subagent-review-coordinator.json +114 -0
- package/dist/recipes/subagent-review.json +37 -0
- package/dist/recipes/subagent-task-card.json +35 -0
- package/dist/recipes/subagent-tools.json +27 -0
- package/dist/recipes/subagent-verify.json +34 -0
- package/dist/recipes/subagents-prompts.json +51 -0
- package/dist/recipes/utility-actor-message.json +23 -0
- package/dist/recipes/utility-artifact-manifest.json +16 -0
- package/dist/recipes/utility-artifact-write.json +16 -0
- package/dist/recipes/utility-changelog-head.json +11 -0
- package/dist/recipes/utility-changelog-section.json +13 -0
- package/dist/recipes/utility-coordinator-lock-snapshot.json +13 -0
- package/dist/recipes/utility-git-log.json +11 -0
- package/dist/recipes/utility-git-status.json +9 -0
- package/dist/recipes/utility-jsonl-tail.json +10 -0
- package/dist/recipes/utility-markdown-index.json +14 -0
- package/dist/recipes/utility-package-summary.json +11 -0
- package/dist/recipes/utility-playlist-build.json +17 -0
- package/dist/recipes/utility-playlist-scan.json +11 -0
- package/dist/recipes/utility-run-ops-snapshot.json +17 -0
- package/dist/recipes/utility-run-state-files.json +13 -0
- package/dist/recipes/utility-run-summary.json +11 -0
- package/dist/recipes/utility-skill-summary.json +13 -0
- package/dist/recipes/utility-validate-recipe.json +13 -0
- package/dist/recipes/utility-validation-wrapper.json +13 -0
- package/dist/scripts/actor-worker.mjs +31 -0
- package/dist/scripts/async-runner.mjs +31 -0
- package/dist/scripts/build-dist.mjs +33 -0
- package/dist/scripts/conformance.mjs +33 -0
- package/dist/scripts/coordinator.mjs +31 -0
- package/dist/scripts/locker.mjs +33 -0
- package/dist/scripts/music-player.mjs +964 -0
- package/dist/scripts/recipe-utils.mjs +31 -0
- package/dist/scripts/validate-recipe.mjs +34 -0
- package/dist/skills/actors/SKILL.md +377 -0
- package/dist/skills/swarm/SKILL.md +467 -0
- package/dist/skills/swarm/references/development-swarm.md +596 -0
- package/docs/actor-messages.md +2 -2
- package/docs/async-runs.md +11 -0
- package/docs/template-recipes.md +1 -1
- package/fixtures/protocol/actor-message-branch.json +13 -0
- package/fixtures/protocol/artifact-manifest.json +9 -0
- package/fixtures/protocol/mailbox-contract.json +15 -0
- package/fixtures/protocol/recipe-summary.json +16 -0
- package/fixtures/protocol/room-message.json +11 -0
- package/fixtures/protocol/room-roster.json +11 -0
- package/fixtures/protocol/run-inbox-message.json +9 -0
- package/fixtures/protocol/run-outbox-event.json +9 -0
- package/fixtures/protocol/run-state.json +10 -0
- package/index.ts +3 -0
- package/lib/actor-inspector-tui.ts +11 -34
- package/lib/actor-rooms.ts +88 -18
- package/lib/actor-worker.ts +118 -0
- package/lib/async-runner.ts +173 -0
- package/lib/async-runs.ts +12 -22
- package/lib/conformance.ts +46 -0
- package/lib/coordinator.ts +664 -0
- package/lib/locker.ts +340 -0
- package/lib/mailbox-loop.ts +148 -0
- package/lib/observability.ts +24 -19
- package/lib/prompts.ts +1 -1
- package/lib/recipe-references.ts +37 -2
- package/lib/recipe-utils.ts +486 -0
- package/lib/runtime-notifier.ts +4 -6
- package/lib/state-readers.ts +93 -0
- package/lib/tools.ts +1 -1
- package/lib/validate-recipe.ts +110 -0
- package/package.json +10 -2
- package/recipes/actor-worker.json +35 -0
- package/recipes/pipeline-quorum-review.json +12 -7
- package/scripts/actor-worker.mjs +31 -0
- package/scripts/async-runner.mjs +11 -201
- package/scripts/build-dist.mjs +33 -0
- package/scripts/conformance.mjs +21 -35
- package/scripts/coordinator.mjs +15 -625
- package/scripts/locker.mjs +20 -332
- package/scripts/recipe-utils.mjs +17 -477
- package/scripts/validate-recipe.mjs +18 -121
- package/skills/actors/SKILL.md +8 -3
- package/skills/swarm/SKILL.md +3 -1
package/AGENTS.md
CHANGED
|
@@ -2,81 +2,146 @@
|
|
|
2
2
|
|
|
3
3
|
## Meta-Protocol Principles
|
|
4
4
|
|
|
5
|
-
- `Constraint-Driven Evolution`: Add structure when real project constraints justify it
|
|
6
|
-
- `Single Source of Truth`: Keep durable protocol, open work, completed delivery, and docs in separate files
|
|
7
|
-
- `Context Hygiene`: Compress stale context before it becomes coordination drag
|
|
8
|
-
- `Boundary Clarity`: README is the human entrypoint, `AGENTS.md` is durable protocol, `BACKLOG.md` is open work, and `CHANGELOG.md` is delivery history
|
|
5
|
+
- `Constraint-Driven Evolution`: Add structure when real project constraints justify it.
|
|
6
|
+
- `Single Source of Truth`: Keep durable protocol, open work, completed delivery, and docs in separate files.
|
|
7
|
+
- `Context Hygiene`: Compress stale context before it becomes coordination drag.
|
|
8
|
+
- `Boundary Clarity`: README is the human entrypoint, `AGENTS.md` is durable protocol, `BACKLOG.md` is open work, and `CHANGELOG.md` is delivery history.
|
|
9
9
|
|
|
10
10
|
## Concept
|
|
11
11
|
|
|
12
|
-
`pi-actors` is a local-first actor runtime and orchestrator for
|
|
12
|
+
`pi-actors` is a local-first actor runtime and orchestrator for Pi. It wraps trusted local programs, scripts, services, pipelines, and recipes as addressable actors that agents can `spawn`, control with typed `message` envelopes, and observe with `inspect`. It also persists user/agent-registered actor-control tools as recipe files under `~/.pi/agent/recipes`, giving agents durable operational muscle memory for launching and managing the local actor zoo.
|
|
13
|
+
|
|
14
|
+
Treat this extension as an experimental self-evolution membrane for the agent harness: a way for agents that are not pretrained on local workflows to acquire, preserve, inspect, and refine operational capabilities through explicit local actors, recipes, fixtures, skills, and state rather than hidden assumptions. Keep that potential grounded in small, testable, operator-visible protocol slices.
|
|
13
15
|
|
|
14
16
|
## Topology
|
|
15
17
|
|
|
16
|
-
- `/index.ts`: Minimal extension coordinator/composition root
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- `/
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
18
|
+
- `/index.ts`: Minimal extension coordinator/composition root. It wires live pi ports and should avoid owning domain behavior.
|
|
19
|
+
|
|
20
|
+
## Domain Modules
|
|
21
|
+
|
|
22
|
+
- `/lib/*.ts`: Flat Domain DAG modules for cohesive reusable behavior.
|
|
23
|
+
- `command-templates.ts`: portable command-template execution graph.
|
|
24
|
+
- `schema.ts`: tool arg declarations and placeholder-derived schemas.
|
|
25
|
+
- `identity.ts`, `paths.ts`, `config.ts`: names, paths, and persistence.
|
|
26
|
+
- `registry.ts`, `runtime.ts`: register/update/delete, load/conflict/registration coordination.
|
|
27
|
+
- `execution.ts`, `output.ts`, `limits.ts`: registered-tool execution and bounded output.
|
|
28
|
+
- `recipe-references.ts`, `recipe-discovery.ts`, `recipe-usage.ts`: recipe graph, discovery, and usage metadata.
|
|
29
|
+
- `async-runs.ts`, `runtime-notifier.ts`, `mailbox-loop.ts`: detached run state, wake notifications, and mailbox worker helpers.
|
|
30
|
+
- `actor-rooms.ts`, `actor-inspector-tui.ts`, `observability.ts`: rooms, communication previews, and ambient run status.
|
|
31
|
+
- `prompts.ts`, `tools.ts`, `temp.ts`: LLM-facing copy, pi-facing tool definitions, and temp cleanup.
|
|
32
|
+
|
|
33
|
+
## Repo Surfaces
|
|
34
|
+
|
|
35
|
+
- `/scripts/*.mjs`: Stable executable shims for detached/helper processes.
|
|
36
|
+
- `/lib/*.ts`: Compiled domain and script-entrypoint logic. Keep `scripts/*.mjs` lightweight and move substantive behavior into named domain modules so `dist/lib` is the JS-only runtime surface. This intentionally grows a standard library: script-born behavior should gain a clear domain name when reuse is plausible. Exception: self-contained application/build scripts with no expected second consumer, such as `music-player.mjs` or `build-dist.mjs`, may remain standalone `.mjs` files.
|
|
37
|
+
- `/recipes/*.json`: Packaged standard recipe library. Keep recipes optional, composable, policy-light, and caller-configurable.
|
|
38
|
+
- `/skills/actors/SKILL.md`: Dense practical reference for operating pi-actors itself.
|
|
39
|
+
- `/skills/swarm/SKILL.md`: Bundled methodology skill for multi-agent standards, strategies, and portable examples.
|
|
40
|
+
- `/tests/*.test.ts`: Focused regression tests for pure domains.
|
|
41
|
+
- `/README.md`: Human-facing install, usage, and runtime semantics.
|
|
42
|
+
- `/BACKLOG.md`: Canonical open work; only completable future work.
|
|
43
|
+
- `/CHANGELOG.md`: Completed delivery history.
|
|
44
|
+
- `/docs/README.md`: Documentation index.
|
|
29
45
|
|
|
30
46
|
## Operating Principles
|
|
31
47
|
|
|
32
|
-
- Prefer explicit migration boundaries over silent user-config rewrites
|
|
33
|
-
- Keep published documentation portable: use `~`, `<repo>`, or relative paths instead of machine-local absolute paths
|
|
34
|
-
- Preserve runtime output discipline because tool output flows directly into agent context
|
|
35
|
-
- Keep the project lens local-first and cybernetic: agents wrap durable local capabilities as actors, then use semantic tools and messages instead of repeatedly reconstructing shell commands
|
|
36
|
-
- Design recipes as agent-callable tools: make prompts, scopes, paths, models, and policy knobs public args/defaults when the caller should decide them at invocation time
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
- `
|
|
44
|
-
- `
|
|
45
|
-
-
|
|
46
|
-
- `
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
48
|
+
- Prefer explicit migration boundaries over silent user-config rewrites.
|
|
49
|
+
- Keep published documentation portable: use `~`, `<repo>`, or relative paths instead of machine-local absolute paths.
|
|
50
|
+
- Preserve runtime output discipline because tool output flows directly into agent context.
|
|
51
|
+
- Keep the project lens local-first and cybernetic: agents wrap durable local capabilities as actors, then use semantic tools and messages instead of repeatedly reconstructing shell commands.
|
|
52
|
+
- Design recipes as agent-callable tools: make prompts, scopes, paths, models, and policy knobs public args/defaults when the caller should decide them at invocation time.
|
|
53
|
+
- Decompose oversized bullets into sublists or hierarchy; long flat list items are a context-smell.
|
|
54
|
+
|
|
55
|
+
## Knowledge Surfaces
|
|
56
|
+
|
|
57
|
+
- Injected prompt: tiny bootstrap/reminder, never full docs.
|
|
58
|
+
- 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.
|
|
60
|
+
- `swarm` skill: multi-agent methodology, strategies, standards, and portable examples.
|
|
61
|
+
- `/docs`: detailed transportable standards read on demand.
|
|
62
|
+
- `AGENTS.md`: durable project protocol for agents changing this repo.
|
|
63
|
+
- Skill evolution is passive-active: when implementation yields durable mechanics, invariants, warnings, or orchestration lessons, update `skills/actors/SKILL.md` or `skills/swarm/SKILL.md` immediately instead of carrying evergreen skill-upkeep items in `BACKLOG.md`.
|
|
64
|
+
|
|
65
|
+
## Public Actor Model
|
|
66
|
+
|
|
67
|
+
- Preserve the public verbs: `spawn`, `message`, `inspect`.
|
|
68
|
+
- Prefer one typed actor-message envelope for upward, downward, lateral, parent/branch, and branch/parent messages.
|
|
69
|
+
- Prefer actor addresses and inspect views over exposing FIFO, outbox, or status mechanics as public concepts.
|
|
70
|
+
- Keep route and semantic type separate: delivery behavior comes from `to`, while `type` describes intent.
|
|
71
|
+
- Treat dotted message types as the minimal action surface: `channel.action` should often be enough for script-backed actors, with `body` reserved for extra context or free-form prompts to LLM-backed actors.
|
|
72
|
+
|
|
73
|
+
## Runtime Contract
|
|
74
|
+
|
|
75
|
+
- Register trusted command templates with placeholder-derived args, progressive typed arg declarations, inline/default/`??`/ternary fallback, and split-first command argv construction.
|
|
76
|
+
- Keep command templates synchronous and portable; `async: true` is the detached run switch.
|
|
77
|
+
- Preserve node controls: `when`, positive `timeout`, `delay`, bounded `retry`, `failure`, and `recover` cleanup.
|
|
78
|
+
- Keep async run state under `~/.pi/agent/tmp/pi-actors/runs` with injected `{run_id}` and `{state_dir}` values.
|
|
79
|
+
- Preserve event-driven observability: terminal follow-ups, coordinator-bound outbox messages, branch-aware triangles, process-tree expansion, and bounded body previews.
|
|
80
|
+
- Do not restore busy-polling examples, duplicate terminal follow-ups, or duplicate follow-ups for handled `cancel`, `kill`, or control-stop actions.
|
|
81
|
+
|
|
82
|
+
## Recipes And Registry
|
|
83
|
+
|
|
84
|
+
- `~/.pi/agent/recipes/*.json` is executable muscle memory: recipes there become persistent tools by location.
|
|
85
|
+
- Preserve filename identity, atomic writes, explicit operator-gated migration paths, and local transportability.
|
|
86
|
+
- Packaged/ad hoc recipes outside the agent root are components, not user tools.
|
|
87
|
+
- Tool definitions use `template`, not `script`, and built-in/core tool names must not be shadowed.
|
|
88
|
+
- Packaged recipe growth is demand-driven: prefer reusable components over speculative scenario catalogs.
|
|
89
|
+
- Recipe templates may point directly at executable helper scripts; keep script executable bits and avoid unnecessary `node` prefixes.
|
|
90
|
+
|
|
91
|
+
## Command And Recipe Layers
|
|
92
|
+
|
|
93
|
+
- Keep command-template semantics in `docs/command-templates.md`.
|
|
94
|
+
- Keep recipe storage/import/default/reference behavior in `docs/template-recipes.md`.
|
|
95
|
+
- Keep detached lifecycle/state/IPC behavior in `docs/async-runs.md`.
|
|
96
|
+
- Imported recipes are command-template-shaped definitions, not async-run instances.
|
|
97
|
+
- Valid chain: `tool → template → recipe → run → template`; reject cyclic shortcuts.
|
|
98
|
+
- Typed args support `string`, `path`, `int`, `number`, `bool`, `array`, and `enum(...)`.
|
|
99
|
+
- Preserve both metadata-first args and inline-first placeholder style.
|
|
100
|
+
|
|
101
|
+
## State, IO, And Safety
|
|
102
|
+
|
|
103
|
+
- Tool stdout and temp state must stay bounded and local.
|
|
104
|
+
- Keep tail truncation, full-output temp files, failure formatting, and centralized limits intact.
|
|
105
|
+
- Published docs must not include machine-local absolute paths.
|
|
106
|
+
- Any view scanning run directories must apply coordinator/session ownership filters before exposing summaries or previews.
|
|
107
|
+
- Direct branch messages are active inbox queues; guard branch-local append/status rewrites with the branch inbox lock and keep claim/handled/failed transitions tested.
|
|
108
|
+
- Room/branch provenance checks should validate that accepted `from` addresses belong to the addressed run.
|
|
109
|
+
|
|
110
|
+
## Coordination And Lifecycle
|
|
111
|
+
|
|
112
|
+
- Persistent implementer workflows are recipe composition, not one-off scripts.
|
|
113
|
+
- Compose cells such as `coordinator-locker`, subagent launchers, actor-message utilities, and mailbox-loop helpers.
|
|
114
|
+
- Preserve JSON envelope object shape across handoffs.
|
|
115
|
+
- Keep locker state generic and thin; orchestration strategy belongs in the coordinator.
|
|
116
|
+
- Graceful actor retirement is opt-in through recipe/run metadata and must not infer retirement for persistent services or backlog implementers.
|
|
117
|
+
|
|
118
|
+
## Context And Planning Hygiene
|
|
119
|
+
|
|
120
|
+
- `BACKLOG.md` is planning, not history: only completable future work with current scope and exit criteria.
|
|
121
|
+
- Completed delivery belongs in `CHANGELOG.md`.
|
|
122
|
+
- Durable/evergreen behavior belongs in `AGENTS.md`, README, docs, or skills.
|
|
123
|
+
- Changelog bullets describe meaningful user/operator/developer changes, not release bookkeeping.
|
|
124
|
+
- PR/release summaries are temporary artifacts; keep durable release evidence in `CHANGELOG.md` and gates in `BACKLOG.md`.
|
|
125
|
+
- Meaningful implementation or docs changes must reconcile `BACKLOG.md`, `CHANGELOG.md`, README, and docs navigation.
|
|
61
126
|
|
|
62
127
|
## Validation
|
|
63
128
|
|
|
64
|
-
- `npm run check`: Lightweight extension-load sanity check
|
|
65
|
-
- `npm test`: Focused regression tests for extracted pure domains
|
|
66
|
-
- `npm run pack:dry`: Verify package contents and npm metadata
|
|
67
|
-
- `npm run conformance`: Compact protocol conformance runner for actor/recipe behavior
|
|
68
|
-
- `bash ~/.pi/agent/skills/abcd-context/scripts/validate-context.sh`: Validate context split, links, and README/docs reachability
|
|
129
|
+
- `npm run check`: Lightweight extension-load sanity check.
|
|
130
|
+
- `npm test`: Focused regression tests for extracted pure domains.
|
|
131
|
+
- `npm run pack:dry`: Verify package contents and npm metadata.
|
|
132
|
+
- `npm run conformance`: Compact protocol conformance runner for actor/recipe behavior.
|
|
133
|
+
- `bash ~/.pi/agent/skills/abcd-context/scripts/validate-context.sh`: Validate context split, links, and README/docs reachability.
|
|
69
134
|
|
|
70
135
|
## Pre-Task Preparation
|
|
71
136
|
|
|
72
|
-
1. Read this file, `BACKLOG.md`, and `README.md
|
|
73
|
-
2. Inspect `index.ts` around the touched tool/runtime path
|
|
74
|
-
3. Prefer targeted edits over broad rewrites
|
|
75
|
-
4. Run the smallest validation set that covers the touched scope
|
|
137
|
+
1. Read this file, `BACKLOG.md`, and `README.md`.
|
|
138
|
+
2. Inspect `index.ts` around the touched tool/runtime path.
|
|
139
|
+
3. Prefer targeted edits over broad rewrites.
|
|
140
|
+
4. Run the smallest validation set that covers the touched scope.
|
|
76
141
|
|
|
77
142
|
## Task Completion Protocol
|
|
78
143
|
|
|
79
|
-
1. Reconcile backlog state with reality: close, narrow, split, defer, or gate items explicitly
|
|
80
|
-
2. Update README/docs when public behavior, setup, package contents, or navigation changes
|
|
81
|
-
3. Record meaningful delivered slices in `CHANGELOG.md
|
|
82
|
-
4. Run relevant validation and report exact commands
|
|
144
|
+
1. Reconcile backlog state with reality: close, narrow, split, defer, or gate items explicitly.
|
|
145
|
+
2. Update README/docs when public behavior, setup, package contents, or navigation changes.
|
|
146
|
+
3. Record meaningful delivered slices in `CHANGELOG.md`.
|
|
147
|
+
4. Run relevant validation and report exact commands.
|
package/BACKLOG.md
CHANGED
|
@@ -43,232 +43,189 @@ No open hotfix items.
|
|
|
43
43
|
|
|
44
44
|
## Minor Backlog
|
|
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
|
-
-
|
|
49
|
-
- Goal: Add machine-readable internal schemas and fixtures for implementation, docs, tests, and inspector consistency.
|
|
50
|
-
- Files:
|
|
51
|
-
- `schemas/actor-message.schema.json`.
|
|
52
|
-
- `schemas/actor-address.schema.json`.
|
|
53
|
-
- `schemas/run-state.schema.json`.
|
|
54
|
-
- `schemas/run-inbox-message.schema.json`.
|
|
55
|
-
- `schemas/run-outbox-event.schema.json`.
|
|
56
|
-
- `schemas/room-message.schema.json`.
|
|
57
|
-
- `schemas/room-roster.schema.json`.
|
|
58
|
-
- `schemas/communication-snapshot.schema.json`.
|
|
59
|
-
- `schemas/recipe.schema.json`.
|
|
60
|
-
- `fixtures/protocol/run-minimal.json`.
|
|
61
|
-
- `fixtures/protocol/message-branch.json`.
|
|
62
|
-
- `fixtures/protocol/message-room-join.json`.
|
|
63
|
-
- `fixtures/protocol/mailbox-contract.json`.
|
|
64
|
-
- Acceptance:
|
|
65
|
-
- Normalization outputs validate.
|
|
66
|
-
- Docs examples validate.
|
|
67
|
-
- Fixtures are usable by tests.
|
|
68
|
-
- Schemas are versioned with package version.
|
|
69
|
-
|
|
70
|
-
### M-02 Unified Actor Event Base
|
|
48
|
+
### M-01 State Corruption Recovery
|
|
71
49
|
|
|
72
|
-
- Priority:
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
- `
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
- `branch`.
|
|
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.
|
|
81
58
|
- Acceptance:
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
- No migration is forced.
|
|
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.
|
|
86
62
|
|
|
87
|
-
### M-
|
|
63
|
+
### M-02 Actor Loop Helper Minimal Core
|
|
88
64
|
|
|
89
|
-
- Priority:
|
|
90
|
-
-
|
|
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.
|
|
91
69
|
- Files:
|
|
92
|
-
- `lib/
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
- Polling fallback.
|
|
98
|
-
- Run and branch inbox claiming.
|
|
99
|
-
- Handled and failed status transitions.
|
|
100
|
-
- Outbox emission.
|
|
101
|
-
- Progress updates.
|
|
102
|
-
- Graceful stop handling.
|
|
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.
|
|
103
75
|
- Acceptance:
|
|
104
|
-
- A packaged demo recipe uses a mailbox-only control endpoint.
|
|
105
|
-
- Concurrent wake and poll paths do not double-process messages.
|
|
106
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.
|
|
107
80
|
|
|
108
|
-
### M-
|
|
81
|
+
### M-03 Canonical Worker Recipe Template
|
|
109
82
|
|
|
110
|
-
- Priority:
|
|
111
|
-
-
|
|
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.
|
|
112
88
|
- Direction:
|
|
113
|
-
- Worker joins room.
|
|
114
|
-
- Worker declares mailbox accepts
|
|
115
|
-
- Worker claims branch inbox
|
|
89
|
+
- Worker joins the default room.
|
|
90
|
+
- Worker declares typed mailbox accepts/emits.
|
|
91
|
+
- Worker claims branch inbox work.
|
|
116
92
|
- Worker posts `task.claim`, `task.result`, and `awaiting_assignment`.
|
|
117
93
|
- Worker handles `control.stop`.
|
|
118
94
|
- Acceptance:
|
|
119
|
-
-
|
|
120
|
-
-
|
|
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.
|
|
121
98
|
|
|
122
|
-
### M-
|
|
99
|
+
### M-04 Protocol Contract Fixtures
|
|
123
100
|
|
|
124
101
|
- Priority: Medium.
|
|
125
|
-
-
|
|
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.
|
|
126
105
|
- Direction:
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
-
- Document platform matrix.
|
|
130
|
-
- Cover named-pipe adapter with injected sender where practical.
|
|
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.
|
|
131
108
|
- Acceptance:
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
109
|
+
- Public examples and fixtures validate in tests.
|
|
110
|
+
- No migration is forced.
|
|
111
|
+
- No external transport/MCP standard is introduced.
|
|
135
112
|
|
|
136
|
-
### M-
|
|
113
|
+
### M-05 Follow-Up Deduplication Hardening
|
|
137
114
|
|
|
138
115
|
- Priority: Medium.
|
|
139
|
-
-
|
|
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.
|
|
140
119
|
- Direction:
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
120
|
+
- Continue using event id and stateDir for deduplication where available.
|
|
121
|
+
- Preserve terminal handled semantics.
|
|
122
|
+
- Simulate watcher restart in tests.
|
|
144
123
|
- Acceptance:
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
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.
|
|
148
127
|
|
|
149
|
-
### M-
|
|
128
|
+
### M-06 Portability Reality Pass
|
|
150
129
|
|
|
151
130
|
- Priority: Medium.
|
|
152
|
-
-
|
|
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.
|
|
153
134
|
- Direction:
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
-
|
|
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.
|
|
157
139
|
- Acceptance:
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
140
|
+
- Native Windows limitations are visible before launch.
|
|
141
|
+
- Mailbox-only recipe works cross-platform.
|
|
142
|
+
- Docs and tests cover the adapter split.
|
|
161
143
|
|
|
162
|
-
### M-
|
|
144
|
+
### M-07 Compiled Script Entrypoints
|
|
163
145
|
|
|
164
146
|
- Priority: Medium.
|
|
165
|
-
-
|
|
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.
|
|
166
150
|
- Direction:
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
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.
|
|
171
159
|
- Acceptance:
|
|
172
|
-
-
|
|
173
|
-
-
|
|
174
|
-
-
|
|
175
|
-
-
|
|
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.
|
|
176
164
|
|
|
177
|
-
### M-
|
|
165
|
+
### M-08 Recipe Doctor Remediation UX
|
|
178
166
|
|
|
179
|
-
- Priority:
|
|
180
|
-
-
|
|
167
|
+
- Priority: High.
|
|
168
|
+
- Status: Open.
|
|
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.
|
|
181
171
|
- Direction:
|
|
182
|
-
-
|
|
183
|
-
-
|
|
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.
|
|
184
175
|
- Acceptance:
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
-
|
|
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.
|
|
188
179
|
|
|
189
|
-
### M-
|
|
180
|
+
### M-09 Actor Worker v2
|
|
190
181
|
|
|
191
|
-
- Priority:
|
|
192
|
-
-
|
|
182
|
+
- Priority: High.
|
|
183
|
+
- Status: Open.
|
|
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.
|
|
193
186
|
- Direction:
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
-
|
|
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.
|
|
197
191
|
- Acceptance:
|
|
198
|
-
-
|
|
199
|
-
-
|
|
200
|
-
-
|
|
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.
|
|
201
195
|
|
|
202
|
-
### M-
|
|
196
|
+
### M-10 Dist Package Contract Hardening
|
|
203
197
|
|
|
204
198
|
- Priority: Medium.
|
|
205
|
-
-
|
|
206
|
-
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
-
|
|
210
|
-
-
|
|
211
|
-
-
|
|
212
|
-
- `docs/command-templates.md`.
|
|
213
|
-
- `docs/recipe-authoring.md`.
|
|
214
|
-
- `docs/troubleshooting.md`.
|
|
199
|
+
- Status: Open.
|
|
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.
|
|
202
|
+
- 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.
|
|
215
206
|
- Acceptance:
|
|
216
|
-
-
|
|
217
|
-
-
|
|
218
|
-
-
|
|
219
|
-
- No external standard or MCP work is introduced.
|
|
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`.
|
|
220
210
|
|
|
221
|
-
##
|
|
211
|
+
## Explicitly Deferred
|
|
222
212
|
|
|
223
|
-
|
|
224
|
-
Patch release:
|
|
225
|
-
H-01..H-12
|
|
213
|
+
These are valid ideas but not current focus. Reintroduce only with concrete evidence from real actor workflows.
|
|
226
214
|
|
|
227
|
-
|
|
228
|
-
|
|
215
|
+
- Spawn preflight mode: useful later, but lower value than resilient inspect and mailbox-loop consolidation.
|
|
216
|
+
- Run restart/reattach policy: risky for isolation; defer until corruption recovery and protocol fixtures are stronger.
|
|
217
|
+
- Actor address helper CLI: keep diagnostics improving opportunistically inside existing parser/tests.
|
|
218
|
+
- Documentation refactor: defer until the canonical mailbox loop and worker recipe exist; avoid rewriting docs twice.
|
|
219
|
+
- Host-level tool unregistration: blocked on host API support.
|
|
220
|
+
- Branch-local checkpoint semantics: wait for real collaborative branch-runner experiments.
|
|
221
|
+
- Actor recipe feedback loop: keep advisory and operator-gated after real runs produce evidence.
|
|
229
222
|
|
|
230
|
-
|
|
231
|
-
M-04, M-05, M-06, M-13, M-24
|
|
232
|
-
|
|
233
|
-
Minor 0.25 — Operator hygiene:
|
|
234
|
-
M-07, M-08, M-09, M-14, M-15, M-16
|
|
223
|
+
## Suggested Milestone Order
|
|
235
224
|
|
|
236
|
-
|
|
237
|
-
|
|
225
|
+
```text
|
|
226
|
+
0.25 — Operator remediation and worker maturity:
|
|
227
|
+
M-08, M-09
|
|
238
228
|
|
|
239
|
-
|
|
240
|
-
M-
|
|
229
|
+
0.26 — Package contract hardening:
|
|
230
|
+
M-10
|
|
241
231
|
```
|
|
242
|
-
|
|
243
|
-
## Blocked Or Opportunistic Carry-Over
|
|
244
|
-
|
|
245
|
-
### Branch-Local Checkpoint Semantics
|
|
246
|
-
|
|
247
|
-
- Priority: Low.
|
|
248
|
-
- Blocked by: At least one real collaborative branch-runner async-run experiment.
|
|
249
|
-
- Goal: Validate whether `failure: "branch"`, node-level `retry`, and `recover` cleanup are enough for branch-local validation and bounded reattempts.
|
|
250
|
-
- Exit:
|
|
251
|
-
- Record one decision: sufficient, documentation-only refinement needed, or propose one minimal command-template extension with tests.
|
|
252
|
-
|
|
253
|
-
### Host-Level Tool Unregistration
|
|
254
|
-
|
|
255
|
-
- Priority: Low.
|
|
256
|
-
- Blocked by: Host API support for custom tool unregistration.
|
|
257
|
-
- Goal: Remove stale dynamically registered tool definitions completely when the host API supports it.
|
|
258
|
-
- Direction:
|
|
259
|
-
- Track pi extension API support for custom tool unregistration.
|
|
260
|
-
- Replace active-tool deactivation fallback with real unregister when available.
|
|
261
|
-
- Preserve current safe behavior: deleted tools should not remain active after reload.
|
|
262
|
-
- Exit:
|
|
263
|
-
- Deleting a recipe file removes the corresponding runtime tool definition and active-tool entry without session restart.
|
|
264
|
-
|
|
265
|
-
### Actor Recipe Feedback Loop
|
|
266
|
-
|
|
267
|
-
- Priority: Low.
|
|
268
|
-
- Goal: Turn actor recipe-context awareness into a practical improvement loop for packaged recipes and operator-owned recipe memory.
|
|
269
|
-
- Direction:
|
|
270
|
-
- After real multi-agent runs, capture whether child actors report that recipe/import/mailbox/role boundaries fit the task.
|
|
271
|
-
- Keep the loop advisory and operator-gated.
|
|
272
|
-
- Prefer small recipe, README, and skill refinements over scenario catalogs.
|
|
273
|
-
- Exit:
|
|
274
|
-
- At least one real run produces recipe-boundary feedback that is applied or explicitly rejected with rationale.
|