@llblab/pi-actors 0.42.3 → 0.43.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 +121 -175
- package/CHANGELOG.md +12 -0
- package/README.md +113 -276
- package/dist/fixtures/protocol/control-endpoint.json +6 -0
- package/dist/fixtures/protocol/control-record.json +9 -0
- package/dist/fixtures/protocol/recipe-summary.json +4 -12
- package/dist/fixtures/protocol/trace-event.json +9 -0
- package/dist/lib/async-runs.d.ts +14 -38
- package/dist/lib/async-runs.js +158 -108
- package/dist/lib/control.d.ts +12 -0
- package/dist/lib/control.js +84 -0
- package/dist/lib/execution-sessions.d.ts +17 -0
- package/dist/lib/execution-sessions.js +85 -0
- package/dist/lib/file-state.d.ts +1 -0
- package/dist/lib/file-state.js +17 -5
- package/dist/lib/inspector-actions.d.ts +2 -2
- package/dist/lib/inspector-actions.js +2 -2
- package/dist/lib/inspector-command.js +3 -3
- package/dist/lib/inspector-overlay.d.ts +52 -70
- package/dist/lib/inspector-overlay.js +532 -905
- package/dist/lib/inspector.d.ts +3 -71
- package/dist/lib/inspector.js +19 -665
- package/dist/lib/limits.d.ts +4 -2
- package/dist/lib/limits.js +4 -2
- package/dist/lib/observability.d.ts +16 -16
- package/dist/lib/observability.js +43 -82
- package/dist/lib/prompts.d.ts +1 -1
- package/dist/lib/prompts.js +2 -2
- package/dist/lib/recipe-control.d.ts +7 -0
- package/dist/lib/recipe-control.js +39 -0
- package/dist/lib/recipes-discovery.js +2 -0
- package/dist/lib/recipes-references.d.ts +1 -14
- package/dist/lib/recipes-references.js +6 -21
- package/dist/lib/review-projection.js +1 -5
- package/dist/lib/run-ui-runtime.js +2 -2
- package/dist/lib/runs-control-delivery.d.ts +21 -0
- package/dist/lib/runs-control-delivery.js +127 -0
- package/dist/lib/runs-controls.d.ts +35 -0
- package/dist/lib/runs-controls.js +144 -0
- package/dist/lib/runs-retention.d.ts +7 -0
- package/dist/lib/runs-retention.js +27 -3
- package/dist/lib/runs-start.js +4 -2
- package/dist/lib/runs-status.js +11 -6
- package/dist/lib/runs-trace.d.ts +24 -0
- package/dist/lib/runs-trace.js +98 -0
- package/dist/lib/runtime-notifier.d.ts +1 -1
- package/dist/lib/runtime-notifier.js +1 -1
- package/dist/lib/tools-inspect.d.ts +3 -3
- package/dist/lib/tools-inspect.js +203 -708
- package/dist/lib/tools-local.js +2 -10
- package/dist/lib/tools-message.d.ts +7 -7
- package/dist/lib/tools-message.js +95 -396
- package/dist/lib/tools-response.d.ts +1 -4
- package/dist/lib/tools-response.js +5 -39
- package/dist/lib/tools-spawn.js +16 -28
- package/dist/lib/tools.js +1 -2
- package/dist/lib/trace-projection.d.ts +22 -0
- package/dist/lib/trace-projection.js +165 -0
- package/dist/recipes/draft-review.json +0 -10
- package/dist/recipes/lens-swarm.json +0 -14
- package/dist/recipes/music-player.json +10 -19
- package/dist/recipes/pipeline-architect-coordinator.json +0 -11
- package/dist/recipes/pipeline-artifact-bundle.json +1 -22
- package/dist/recipes/pipeline-artifact-report.json +1 -18
- package/dist/recipes/pipeline-artifact-write.json +1 -18
- package/dist/recipes/pipeline-async-run-ops.json +0 -12
- package/dist/recipes/pipeline-checkpoint-continuation.json +0 -14
- package/dist/recipes/pipeline-development-tasking.json +0 -12
- package/dist/recipes/pipeline-docs-maintenance.json +0 -12
- package/dist/recipes/pipeline-media-library.json +0 -12
- package/dist/recipes/pipeline-quorum-review.json +0 -12
- package/dist/recipes/pipeline-release-readiness.json +0 -12
- package/dist/recipes/pipeline-release-summary.json +0 -12
- package/dist/recipes/pipeline-repo-health.json +0 -12
- package/dist/recipes/pipeline-research-synthesis.json +0 -11
- package/dist/recipes/pipeline-review-readiness.json +0 -12
- package/dist/recipes/resource-locker.json +27 -0
- package/dist/recipes/subagent-artifact.json +0 -9
- package/dist/recipes/subagent-checkpoint.json +0 -10
- package/dist/recipes/subagent-conflict-report.json +0 -11
- package/dist/recipes/subagent-contradiction-map.json +0 -11
- package/dist/recipes/subagent-critic.json +0 -11
- package/dist/recipes/subagent-evidence-map.json +0 -11
- package/dist/recipes/subagent-followup.json +0 -10
- package/dist/recipes/subagent-judge.json +0 -11
- package/dist/recipes/subagent-merge.json +0 -11
- package/dist/recipes/subagent-normalize.json +0 -11
- package/dist/recipes/subagent-plan.json +0 -11
- package/dist/recipes/subagent-preflight.json +0 -11
- package/dist/recipes/subagent-prompt.json +0 -10
- package/dist/recipes/subagent-quorum.json +0 -10
- package/dist/recipes/subagent-review-coordinator.json +0 -14
- package/dist/recipes/subagent-review.json +0 -11
- package/dist/recipes/subagent-task-card.json +0 -11
- package/dist/recipes/subagent-tools.json +0 -10
- package/dist/recipes/subagent-verify.json +0 -11
- package/dist/recipes/subagents-prompts.json +0 -10
- package/dist/recipes/tool-review.json +0 -10
- package/dist/scripts/async-runner.mjs +25 -25
- package/dist/scripts/conformance.mjs +4 -2
- package/dist/scripts/locker.mjs +200 -66
- package/dist/scripts/music-player.mjs +159 -150
- package/dist/scripts/recipe-utils.mjs +6 -96
- package/dist/scripts/release-gates.mjs +60 -0
- package/dist/scripts/validate-recipe.mjs +3 -53
- package/dist/skills/actors/SKILL.md +53 -266
- package/dist/skills/swarm/SKILL.md +11 -33
- package/docs/0.43-baseline.md +44 -0
- package/docs/README.md +3 -3
- package/docs/actor-inspector.md +26 -64
- package/docs/actors-deep-reference.md +92 -50
- package/docs/async-runs.md +81 -328
- package/docs/command-templates.md +2 -2
- package/docs/component-recipes.md +30 -133
- package/docs/recipe-library.md +57 -182
- package/docs/task-first-recipes.md +10 -12
- package/docs/template-recipes.md +76 -289
- package/docs/tool-registry.md +41 -161
- package/fixtures/protocol/control-endpoint.json +6 -0
- package/fixtures/protocol/control-record.json +9 -0
- package/fixtures/protocol/recipe-summary.json +4 -12
- package/fixtures/protocol/trace-event.json +9 -0
- package/lib/async-runs.ts +202 -201
- package/lib/control.ts +102 -0
- package/lib/execution-sessions.ts +111 -0
- package/lib/file-state.ts +17 -4
- package/lib/inspector-actions.ts +2 -2
- package/lib/inspector-command.ts +3 -3
- package/lib/inspector-overlay.ts +577 -1121
- package/lib/inspector.ts +46 -979
- package/lib/limits.ts +4 -2
- package/lib/observability.ts +60 -101
- package/lib/prompts.ts +2 -2
- package/lib/recipe-control.ts +45 -0
- package/lib/recipes-discovery.ts +2 -0
- package/lib/recipes-references.ts +9 -45
- package/lib/review-projection.ts +1 -5
- package/lib/run-ui-runtime.ts +2 -2
- package/lib/runs-control-delivery.ts +181 -0
- package/lib/runs-controls.ts +204 -0
- package/lib/runs-retention.ts +38 -3
- package/lib/runs-start.ts +4 -2
- package/lib/runs-status.ts +11 -6
- package/lib/runs-trace.ts +132 -0
- package/lib/runtime-notifier.ts +1 -1
- package/lib/tools-inspect.ts +240 -901
- package/lib/tools-local.ts +2 -12
- package/lib/tools-message.ts +112 -519
- package/lib/tools-response.ts +5 -52
- package/lib/tools-spawn.ts +16 -32
- package/lib/tools.ts +1 -2
- package/lib/trace-projection.ts +221 -0
- package/package.json +2 -1
- package/recipes/draft-review.json +0 -10
- package/recipes/lens-swarm.json +0 -14
- package/recipes/music-player.json +10 -19
- package/recipes/pipeline-architect-coordinator.json +0 -11
- package/recipes/pipeline-artifact-bundle.json +1 -22
- package/recipes/pipeline-artifact-report.json +1 -18
- package/recipes/pipeline-artifact-write.json +1 -18
- package/recipes/pipeline-async-run-ops.json +0 -12
- package/recipes/pipeline-checkpoint-continuation.json +0 -14
- package/recipes/pipeline-development-tasking.json +0 -12
- package/recipes/pipeline-docs-maintenance.json +0 -12
- package/recipes/pipeline-media-library.json +0 -12
- package/recipes/pipeline-quorum-review.json +0 -12
- package/recipes/pipeline-release-readiness.json +0 -12
- package/recipes/pipeline-release-summary.json +0 -12
- package/recipes/pipeline-repo-health.json +0 -12
- package/recipes/pipeline-research-synthesis.json +0 -11
- package/recipes/pipeline-review-readiness.json +0 -12
- package/recipes/resource-locker.json +27 -0
- package/recipes/subagent-artifact.json +0 -9
- package/recipes/subagent-checkpoint.json +0 -10
- package/recipes/subagent-conflict-report.json +0 -11
- package/recipes/subagent-contradiction-map.json +0 -11
- package/recipes/subagent-critic.json +0 -11
- package/recipes/subagent-evidence-map.json +0 -11
- package/recipes/subagent-followup.json +0 -10
- package/recipes/subagent-judge.json +0 -11
- package/recipes/subagent-merge.json +0 -11
- package/recipes/subagent-normalize.json +0 -11
- package/recipes/subagent-plan.json +0 -11
- package/recipes/subagent-preflight.json +0 -11
- package/recipes/subagent-prompt.json +0 -10
- package/recipes/subagent-quorum.json +0 -10
- package/recipes/subagent-review-coordinator.json +0 -14
- package/recipes/subagent-review.json +0 -11
- package/recipes/subagent-task-card.json +0 -11
- package/recipes/subagent-tools.json +0 -10
- package/recipes/subagent-verify.json +0 -11
- package/recipes/subagents-prompts.json +0 -10
- package/recipes/tool-review.json +0 -10
- package/scripts/async-runner.mjs +25 -25
- package/scripts/conformance.mjs +4 -2
- package/scripts/locker.mjs +200 -66
- package/scripts/music-player.mjs +159 -150
- package/scripts/recipe-utils.mjs +6 -96
- package/scripts/release-gates.mjs +60 -0
- package/scripts/validate-recipe.mjs +3 -53
- package/skills/actors/SKILL.md +53 -266
- package/skills/swarm/SKILL.md +11 -33
- package/dist/fixtures/protocol/actor-message-branch.json +0 -13
- package/dist/fixtures/protocol/mailbox-contract.json +0 -15
- package/dist/fixtures/protocol/room-message.json +0 -11
- package/dist/fixtures/protocol/room-roster.json +0 -11
- package/dist/fixtures/protocol/run-inbox-message.json +0 -9
- package/dist/fixtures/protocol/run-outbox-event.json +0 -9
- package/dist/lib/mailbox-loop.d.ts +0 -41
- package/dist/lib/mailbox-loop.js +0 -60
- package/dist/lib/messages.d.ts +0 -25
- package/dist/lib/messages.js +0 -122
- package/dist/lib/rooms.d.ts +0 -104
- package/dist/lib/rooms.js +0 -647
- package/dist/lib/runs-mailbox.d.ts +0 -25
- package/dist/lib/runs-mailbox.js +0 -146
- package/dist/lib/runs-messages.d.ts +0 -15
- package/dist/lib/runs-messages.js +0 -179
- package/dist/lib/runs-outbox.d.ts +0 -41
- package/dist/lib/runs-outbox.js +0 -87
- package/dist/lib/tools-mailbox.d.ts +0 -8
- package/dist/lib/tools-mailbox.js +0 -48
- package/dist/recipes/actor-worker.json +0 -39
- package/dist/recipes/coordinator-locker.json +0 -45
- package/dist/recipes/locker.json +0 -45
- package/dist/recipes/pipeline-room-swarm.json +0 -50
- package/dist/recipes/subagent-message.json +0 -32
- package/dist/recipes/utility-actor-message.json +0 -23
- package/dist/scripts/actor-worker.mjs +0 -214
- package/dist/scripts/coordinator.mjs +0 -799
- package/docs/actor-messages.md +0 -225
- package/fixtures/protocol/actor-message-branch.json +0 -13
- package/fixtures/protocol/mailbox-contract.json +0 -15
- package/fixtures/protocol/room-message.json +0 -11
- package/fixtures/protocol/room-roster.json +0 -11
- package/fixtures/protocol/run-inbox-message.json +0 -9
- package/fixtures/protocol/run-outbox-event.json +0 -9
- package/lib/mailbox-loop.ts +0 -144
- package/lib/messages.ts +0 -151
- package/lib/rooms.ts +0 -939
- package/lib/runs-mailbox.ts +0 -208
- package/lib/runs-messages.ts +0 -252
- package/lib/runs-outbox.ts +0 -144
- package/lib/tools-mailbox.ts +0 -56
- package/recipes/actor-worker.json +0 -39
- package/recipes/coordinator-locker.json +0 -45
- package/recipes/locker.json +0 -45
- package/recipes/pipeline-room-swarm.json +0 -50
- package/recipes/subagent-message.json +0 -32
- package/recipes/utility-actor-message.json +0 -23
- package/scripts/actor-worker.mjs +0 -214
- package/scripts/coordinator.mjs +0 -799
package/AGENTS.md
CHANGED
|
@@ -2,191 +2,137 @@
|
|
|
2
2
|
|
|
3
3
|
## Meta-Protocol Principles
|
|
4
4
|
|
|
5
|
-
- `
|
|
6
|
-
- `
|
|
7
|
-
- `
|
|
8
|
-
- `
|
|
5
|
+
- `README.md`: human product entrypoint.
|
|
6
|
+
- `AGENTS.md`: durable implementation protocol.
|
|
7
|
+
- `BACKLOG.md`: canonical future-only work.
|
|
8
|
+
- `CHANGELOG.md`: completed delivery history.
|
|
9
|
+
- `docs/README.md`: documentation index.
|
|
10
|
+
|
|
11
|
+
Keep these surfaces distinct and reconcile them after meaningful changes.
|
|
9
12
|
|
|
10
13
|
## Concept
|
|
11
14
|
|
|
12
|
-
`pi-actors` is a local
|
|
15
|
+
`pi-actors` is a local Run kernel and persistent capability registry for Pi:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
Recipe --spawn--> Run
|
|
19
|
+
Run = Recipe + Trace + Control
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
An actor is any runnable local capability, including a script, tool, service, pipeline, or subagent. Recipes define actors' reusable execution. Runs are concrete actor instances and own one generation of execution and evidence. Trace owns observations. Control owns actor-local inputs for services that actually consume them. `register_tool` persists capabilities separately.
|
|
13
23
|
|
|
14
|
-
|
|
24
|
+
Public Run verbs remain `spawn`, `message`, and `inspect`.
|
|
15
25
|
|
|
16
|
-
##
|
|
26
|
+
## Core Structure
|
|
17
27
|
|
|
18
28
|
```text
|
|
19
29
|
Pi host
|
|
20
|
-
-> index.ts
|
|
21
|
-
-> lib/tools*.ts
|
|
22
|
-
-> lib/runtime.ts / registry.ts
|
|
23
|
-
-> lib/recipes-*.ts
|
|
24
|
-
-> lib/async-runs.ts
|
|
25
|
-
-> lib/
|
|
26
|
-
->
|
|
27
|
-
->
|
|
28
|
-
->
|
|
30
|
+
-> index.ts composition root
|
|
31
|
+
-> lib/tools*.ts public tool adapters
|
|
32
|
+
-> lib/runtime.ts / registry.ts active user Recipe tools
|
|
33
|
+
-> lib/recipes-*.ts Recipe resolution/evolution
|
|
34
|
+
-> lib/async-runs.ts Run lifecycle facade
|
|
35
|
+
-> lib/runs-*.ts focused lifecycle/evidence domains
|
|
36
|
+
-> lib/observability.ts terminal + Trace-attention observation
|
|
37
|
+
-> lib/inspector*.ts owner-filtered actor-instance inspection
|
|
38
|
+
-> scripts/*.mjs process/service entrypoints
|
|
39
|
+
-> recipes/*.json packaged Recipe library
|
|
40
|
+
-> skills/* + docs/* agent and human guidance
|
|
29
41
|
```
|
|
30
42
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
##
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
- `automatic-review-runtime.ts`, `run-ui-runtime.ts`, `inspector-command.ts`: session-bound review composition, ambient run-observability lifecycle, and Inspector host-command adapters kept outside the entrypoint.
|
|
49
|
-
- `tools.ts`: public tool family composition and reserved tool names.
|
|
50
|
-
- `tools-message.ts`: public `message` tool behavior, including run controls, branch/room routing, tool actor invocation, and delivery feedback.
|
|
51
|
-
- `tools-inspect.ts`: public `inspect` tool behavior, including recipe registry, room/session/tool/run views, and observation formatting.
|
|
52
|
-
- `tools-spawn.ts`: public `spawn` tool behavior, including actor launch, draft recipe capture, and launch diagnostics.
|
|
53
|
-
- `tools-local.ts`: saved local capability execution, generated schemas, value normalization, and async recipe launch.
|
|
54
|
-
- `tools-register.ts`: public `register_tool` behavior and schema for persisted local capability registration.
|
|
55
|
-
- `tools-response.ts`: compact model-facing responses and next-action rendering shared by public tool execution paths.
|
|
56
|
-
|
|
57
|
-
## Repo Surfaces
|
|
58
|
-
|
|
59
|
-
- `/scripts/*.mjs`: Stable executables for detached/helper processes. Prefer self-contained script ownership; do not preemptively move script logic into `lib/` just to make scripts thin.
|
|
60
|
-
- `/lib/*.ts`: Compiled reusable domains for the extension/runtime. Move script behavior into `lib/` only when it has real non-script consumers or belongs to an existing reusable domain. Packaged JS-only execution, tests, or shim neatness alone do not justify a new `lib/` domain.
|
|
61
|
-
- `/recipes/*.json`: Packaged standard recipe library. Keep recipes optional, composable, policy-light, and caller-configurable.
|
|
62
|
-
- `/skills/actors/SKILL.md`: Dense practical reference for operating pi-actors itself.
|
|
63
|
-
- `/skills/swarm/SKILL.md`: Bundled methodology skill for multi-agent standards, strategies, and portable examples.
|
|
64
|
-
- `/tests/*.test.ts`: Focused regression tests for pure domains.
|
|
65
|
-
- `/README.md`: Human-facing install, usage, and runtime semantics. Keep it as a product/onboarding entrypoint rather than an implementation dump: identity → why it exists → core verbs → install → first run → address/message model → feature showcase → golden path → recipe memory → platform/safety/docs. Preserve both layers: strong local-actor-kernel positioning plus compact practical capability catalog.
|
|
66
|
-
- `/BACKLOG.md`: Canonical open work; only completable future work.
|
|
67
|
-
- `/CHANGELOG.md`: Completed delivery history.
|
|
68
|
-
- `/docs/README.md`: Documentation index.
|
|
43
|
+
`index.ts` wires Pi ports and must not own domain behavior. Keep the local TypeScript import graph acyclic.
|
|
44
|
+
|
|
45
|
+
## Key Domains
|
|
46
|
+
|
|
47
|
+
- `command-templates.ts`: portable synchronous execution graph.
|
|
48
|
+
- `recipes-references.ts`, `recipes-discovery.ts`, `recipe-control.ts`: Recipe resolution, imports, shadowing, and Control declarations.
|
|
49
|
+
- `async-runs.ts`: lifecycle facade.
|
|
50
|
+
- `runs-start.ts`, `runs-status.ts`, `runs-control.ts`, `runs-control-delivery.ts`, `runs-controls.ts`, `runs-trace.ts`, `runs-process.ts`, `runs-retention.ts`, `runs-parent-teardown.ts`: focused Run internals.
|
|
51
|
+
- `execution-sessions.ts`, `trace-projection.ts`, `session-evidence.ts`: bounded/redacted execution and inspection evidence.
|
|
52
|
+
- `tools-message.ts`: exact Control facade.
|
|
53
|
+
- `tools-inspect.ts`: exact `run:<id>`, `runtime`, `recipes`, and `tool:<name>` inspection.
|
|
54
|
+
- `tools-spawn.ts`, `tools-register.ts`, `tools-local.ts`, `tools-response.ts`: Run creation, persistent capabilities, Recipe-backed tools, and compact results.
|
|
55
|
+
- `inspector.ts`, `inspector-overlay.ts`, `inspector-command.ts`, `inspector-actions.ts`: actor-instance Recipe/Trace/Control projection, navigation, command wiring, and fenced actions. **Actor Inspector** remains the product and command name, not a separate domain.
|
|
56
|
+
- `observability.ts`, `runtime-notifier.ts`, `run-ui-runtime.ts`: Trace attention, terminal reconciliation, and Pi follow-up delivery.
|
|
57
|
+
- automatic draft/tool review domains: structurally redacted model review, journaled mutation, lineage, recovery, and explicit retry/reset safety.
|
|
58
|
+
|
|
59
|
+
Scripts remain self-contained when no non-script consumer justifies a TypeScript domain. Recipes stay optional, composable, policy-light, and caller-configurable.
|
|
69
60
|
|
|
70
61
|
## Operating Principles
|
|
71
62
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
- Runner lifecycle and destructive process controls require the persisted cross-platform process identity proof (start time, command, and cwd where available), revalidated at authorization and immediately before signaling; dead, mismatched, or unsupported proofs stay distinct and fail closed rather than degrading to pid liveness. On Unix, only process-group `ESRCH` followed by another matching identity proof permits exact-pid fallback. Keep the residual post-read OS PID/PGID reuse window explicit because Node lacks one portable identity-stable group handle.
|
|
149
|
-
- Automatic draft review may schedule one silent review after ordinary `agent_end` only when twelve drafts exist and no actor is running; it must snapshot an exact batch, leave newer drafts for later, suppress routine terminal/outbox delivery, and never mutate recipes from the reviewer process.
|
|
150
|
-
- Automatic tool review seeds zero-call lineage without fabricating launches, admits only current non-sensitive revisions lacking a review fingerprint, captures exactly thirty-six oldest eligible active user tools, and uses the same silent post-turn/active-actor boundary. Completed output becomes a size-bounded immutable approval only after result validation plus source and target CAS; approval must not mutate the live registry. Approved filesystem mutation uses intent-before-mutation journaling and source quarantine, composition invokes it only during `session_start` before runtime tool loading, persists `lineage_pending`, and must finalize lineage before quarantine cleanup. Failed cycles persist bounded stage/error/remediation evidence; explicit `review.retry`/`review.reset` messages to `tool:pi-actors` may reset counters or disposable state, but reset must reject approved/transaction/lineage evidence that requires roll-forward recovery. Draft retry must preserve the original reviewer run once a transaction journal exists and derive lineage/evidence from that authenticated journal plan, never from later reviewer output.
|
|
151
|
-
- Parent-session teardown runs on every Pi `session_shutdown`, never ordinary `agent_end`: select discovered readable persisted `running` runs with the exact retiring session `ownerId`, carry immutable `run_instance_id` through canonical `control.kill`, serialize control against same-directory restart, fence teardown evidence to that generation, continue across partial failures, and leave terminal, ambiguous, changed-generation, or other-session runs untouched. Use unbounded teardown discovery, count unreadable/corrupt state as failures, and persist one bounded shutdown summary outside individual runs. Descendant Pi sessions remain separate exact owners and rely on their own shutdown hooks; hard termination keeps OS/manual orphan recovery as an honest boundary.
|
|
152
|
-
- Room/branch provenance checks should validate that accepted `from` addresses belong to the addressed run.
|
|
153
|
-
|
|
154
|
-
## Coordination And Lifecycle
|
|
155
|
-
|
|
156
|
-
- Persistent implementer workflows are recipe composition, not one-off scripts.
|
|
157
|
-
- Compose cells such as `coordinator-locker`, subagent launchers, actor-message utilities, and mailbox-loop helpers.
|
|
158
|
-
- Preserve JSON envelope object shape across handoffs.
|
|
159
|
-
- Keep locker state generic and thin; orchestration strategy belongs in the coordinator.
|
|
160
|
-
- Graceful actor retirement is opt-in through recipe/run metadata and must not infer retirement for persistent services or backlog implementers.
|
|
161
|
-
- 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.
|
|
162
|
-
- 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.
|
|
163
|
-
|
|
164
|
-
## Context And Planning Hygiene
|
|
165
|
-
|
|
166
|
-
- `BACKLOG.md` is planning, not history: only completable future work with current scope and exit criteria.
|
|
167
|
-
- Completed delivery belongs in `CHANGELOG.md`.
|
|
168
|
-
- Durable/evergreen behavior belongs in `AGENTS.md`, README, docs, or skills.
|
|
169
|
-
- Changelog bullets describe meaningful user/operator/developer changes, not release bookkeeping.
|
|
170
|
-
- PR/release summaries are temporary artifacts; keep durable release evidence in `CHANGELOG.md` and gates in `BACKLOG.md`.
|
|
171
|
-
- Meaningful implementation or docs changes must reconcile `BACKLOG.md`, `CHANGELOG.md`, README, and docs navigation.
|
|
172
|
-
|
|
173
|
-
## Validation
|
|
174
|
-
|
|
175
|
-
- `npm run check`: Lightweight extension-load sanity check.
|
|
176
|
-
- `npm test`: Focused regression tests for extracted pure domains.
|
|
177
|
-
- `npm run pack:dry`: Verify package contents and npm metadata.
|
|
178
|
-
- `npm run conformance`: Compact protocol conformance runner for actor/recipe behavior.
|
|
179
|
-
|
|
180
|
-
## Pre-Task Preparation
|
|
181
|
-
|
|
182
|
-
1. Read this file, `BACKLOG.md`, and `README.md`.
|
|
183
|
-
2. Inspect `index.ts` around the touched tool/runtime path.
|
|
184
|
-
3. Prefer targeted edits over broad rewrites.
|
|
185
|
-
4. Run the smallest validation set that covers the touched scope.
|
|
186
|
-
|
|
187
|
-
## Task Completion Protocol
|
|
188
|
-
|
|
189
|
-
1. Reconcile backlog state with reality: close, narrow, split, defer, or gate items explicitly.
|
|
190
|
-
2. Update README/docs when public behavior, setup, package contents, or navigation changes.
|
|
191
|
-
3. Record meaningful delivered slices in `CHANGELOG.md`.
|
|
192
|
-
4. Run relevant validation and report exact commands.
|
|
63
|
+
### Recipe
|
|
64
|
+
|
|
65
|
+
- Recipe files may define args/defaults, imports, artifacts, command-template flags, and `control`.
|
|
66
|
+
- Declare actor-local actions only when a long-lived process implements them.
|
|
67
|
+
- Actions are lowercase, unique, and cannot use runtime-reserved lifecycle names.
|
|
68
|
+
- Removed communication-plane metadata fails explicitly; never translate it.
|
|
69
|
+
- User Recipes shadow packaged definitions; invalid shadowing blocks fallback.
|
|
70
|
+
- Files over 1 MiB, import depth over 32, and import cycles fail closed.
|
|
71
|
+
|
|
72
|
+
### Trace
|
|
73
|
+
|
|
74
|
+
Canonical event:
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{"id":"…","ts":"…","kind":"…","summary":"…","data":{},"level":"info","attention":"notify"}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Keep events bounded and free of addressing/routing fields. Use artifacts or execution captures for large evidence. `attention: "followup"` must remain rare and semantically justified.
|
|
81
|
+
|
|
82
|
+
### Control
|
|
83
|
+
|
|
84
|
+
Public shape:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{"target":"run:<id>","action":"…","input":{},"verbose":false}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Persist Control before transport. Fence every record and endpoint with immutable `run_instance_id`; controlled services capture that generation at startup. Serialize atomic journal replacement through token-owned dead-process-reclaiming locks, and keep status transitions expected-state-fenced and monotonic when consumers complete before producer delivery evidence. FIFO and named pipe are transport details, not public concepts; constrain FIFO documents to the portable atomic-write bound, reject partial writes, and keep FIFO readers gap-free across writers. Revalidate owner, generation, state, and process identity under the lifecycle lock immediately before delivery.
|
|
91
|
+
|
|
92
|
+
Runtime lifecycle and review actions remain runtime-owned.
|
|
93
|
+
|
|
94
|
+
### Inspect
|
|
95
|
+
|
|
96
|
+
Run views are exactly `recipe`, `trace`, and `control`. Non-Run management targets are `runtime`, `recipes`, and `tool:<name>`. Apply owner filtering and redaction before projecting evidence.
|
|
97
|
+
|
|
98
|
+
## Retained Safety Invariants
|
|
99
|
+
|
|
100
|
+
Never weaken:
|
|
101
|
+
|
|
102
|
+
- owner filtering;
|
|
103
|
+
- immutable generation fencing;
|
|
104
|
+
- cross-platform process identity checks;
|
|
105
|
+
- canonical lifecycle locks and same-directory restart serialization;
|
|
106
|
+
- shutdown and parent-teardown kill;
|
|
107
|
+
- terminal notification reconciliation and handled/failure evidence;
|
|
108
|
+
- bounded logs, complete captures, and tool output;
|
|
109
|
+
- owned Pi session provenance;
|
|
110
|
+
- path containment, canonical ownership markers, and symlink rejection;
|
|
111
|
+
- redaction of secrets and machine-local paths;
|
|
112
|
+
- automatic review admission, CAS, journaling, quarantine, lineage, retry, and reset safety.
|
|
113
|
+
|
|
114
|
+
Lifecycle operations fail closed when identity, ownership, or generation cannot be proven. Do not directly signal processes from UI code or edit active Run state to force outcomes.
|
|
115
|
+
|
|
116
|
+
## Registry and Evolution
|
|
117
|
+
|
|
118
|
+
`~/.pi/agent/recipes/*.json` is executable capability memory. Preserve filename identity, atomic writes, canonical per-path locks, explicit operator-gated changes, and transportability.
|
|
119
|
+
|
|
120
|
+
Automatic review receives value-free structural projections, not executable content, paths, prose, canonical names, or secrets. Deterministic executors derive unchanged Recipes from trusted captures. Approved mutation must journal intent before mutation and roll forward safely after crashes.
|
|
121
|
+
|
|
122
|
+
`PI_ACTORS_AUTOMATIC_REVIEW=off` disables scheduling and safe-boundary activation while remaining visible in runtime status.
|
|
123
|
+
|
|
124
|
+
## Output and Observability
|
|
125
|
+
|
|
126
|
+
Tool result/error text contributes exactly one leading line break. Keep model-facing responses compact and state-backed. Preserve complete byte-exact command streams in bounded spill files while returning bounded tails; never feed truncated tails into pipeline stdin.
|
|
127
|
+
|
|
128
|
+
File watchers accelerate reconciliation; a bounded terminal-only interval recovers missed events. Terminal follow-ups contain only Run id, status, one base path, and relative artifact names in visible content; semantic details remain structured. Delivery remains honestly at-least-once across the send/handled-marker crash window.
|
|
129
|
+
|
|
130
|
+
When a deferred Run result gates the next step, wait for its terminal follow-up. Inspect early only for operator request, meaningful attention, or diagnosis of an overdue Run.
|
|
131
|
+
|
|
132
|
+
## Documentation and Release Discipline
|
|
133
|
+
|
|
134
|
+
- Keep published text portable: use `~`, `<repo>`, or relative paths.
|
|
135
|
+
- Update `skills/actors/SKILL.md` when durable operating mechanics change.
|
|
136
|
+
- Keep `skills/swarm/SKILL.md` focused on multi-agent methodology rather than kernel internals.
|
|
137
|
+
- Before release run build, full tests, preservation tests, Recipe QA, Domain DAG validation, ABCd context validation, line-count gates, and release gates.
|
|
138
|
+
- Until a stable version beyond `1.x`, prefer clean breaking simplification over compatibility aliases or renamed legacy abstractions.
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.43.0
|
|
6
|
+
|
|
7
|
+
- `[Actor Inspector]` Restored `/actor-inspector` and the established Inspector presentation/interaction system around exactly Recipe, Trace, and Control: focused Run selection, cached Trace and Run projections during cursor navigation, compact hierarchy-aware documents, terminal-relative viewport, dark neutral focus/striping, contextual key rail, and generation-fenced confirmed kill. Impact: operators retain the fast, compact Actor Inspector workflow without restoring rooms, peer routing, or communication topology.
|
|
8
|
+
- `[Release Safety]` Added the frozen 35,077-line compression baseline, exact removed-surface/residue gates, focused preservation coverage, strict Domain DAG and ABCd checks, current protocol fixtures, installed-package checks, and cross-platform release validation. Rewrote current README, project context, skills, and docs around the Run kernel. Impact: communication-plane regrowth, safety-invariant loss, stale package contents, and shipped code-size regression block release.
|
|
9
|
+
- `[Run Kernel Migration]` Replaced addressed actors, rooms, rosters, messages, mailboxes, generic mailbox loops, actor-worker/coordinator utilities, and communication Recipes with `Recipe --spawn--> Run` and `Run = Recipe + Trace + Control`. New Runs carry `run-kernel-v1`; `spawn`, `message`, and `inspect` remain the public Run verbs, while `register_tool` remains separate. Removed fields and routes fail explicitly rather than converting. Impact: actors remain any runnable capability, but each concrete instance now has one local executable/evidence/control boundary instead of a social communication plane.
|
|
10
|
+
- `[Controlled Services]` Migrated music-player and the consolidated optional `resource-locker` to immutable startup-generation endpoint readiness, durable monotonic Control outcomes, and canonical Trace. FIFO payloads must fit the portable atomic-write bound, all transports verify exact write counts, the locker keeps one gap-free FIFO reader across successive writers, and fast consumers cannot have claimed/terminal state overwritten by sender delivery evidence. Impact: publicly delivered service actions execute with inspectable handled/failed outcomes across supported platforms.
|
|
11
|
+
- `[Run State and Operations]` New Runs inject only `run_id`, runtime-owned `state_dir`, and `trace_file`; same-directory restart clears generation-local Control, Trace, execution, and terminal state. Runtime triage now reports failed Runs, stale Controls, and attention-bearing Trace. Archive/prune share the canonical lifecycle lock, revalidate owner/generation, and persist external retention evidence. Impact: replacement generations and destructive retention cannot inherit, race, or erase the evidence needed to attribute outcomes.
|
|
12
|
+
- `[Inspect and Trace]` Rebuilt `inspect` as an exact dispatcher for `run:<id>`, `runtime`, `recipes`, and `tool:<name>`; Runs expose only Recipe, Trace, and Control. Unified newest-first Trace combines bounded lifecycle/runtime events, Controls, process tails/results, artifact metadata, and canonically contained/redacted agent-session turns with source filtering and attention. `execution.json` now owns command/session provenance. Impact: process and agent Runs share one causal evidence model without addressed output or route-specific inspection APIs.
|
|
13
|
+
- `[Control Contract]` Rebuilt `message` around exact `{target, action, input?, verbose?}` requests. Recipe `control` declarations are unique lowercase actor-local actions captured immutably and kept separate from mutable generation-fenced endpoint readiness; runtime kill/archive/prune and review retry/reset remain runtime-owned. Controls persist before delivery, claim queued or delivered records under token-owned dead-process-reclaiming locks, atomically replace journal snapshots, advance through expected-status-fenced monotonic outcomes, compact bounded terminal history, and retain failed attempts. Impact: owner, generation, running-state, and process identity checks remain authoritative while services gain reliable actor-local input without recreating message envelopes.
|
|
14
|
+
- `[Trace Contract]` Added strict bounded `trace.jsonl` events with generated identity/time, semantic kinds, optional summary/data/level/attention, resilient reads, and rejection of routing fields. Runner/lifecycle/controlled-service outputs now emit Trace; ambient notification uses attention with only allowlisted read-only pre-kernel fallbacks. Impact: observations cannot silently regrow sender/recipient topology.
|
|
15
|
+
- `[Preserved Safety]` Retained owner filtering, immutable generation fencing, cross-platform process identity, canonical lifecycle locking, shutdown and parent teardown, terminal reconciliation, bounded complete captures, owned Pi sessions, path containment/redaction, and automatic-review retry/reset/transaction/lineage safety. Impact: the breaking simplification removes communication behavior without weakening the trusted execution boundary.
|
|
16
|
+
|
|
5
17
|
## 0.42.3: Follow-up Display Hotfix
|
|
6
18
|
|
|
7
19
|
- `[Follow-up Display]` Made actor terminal and outbox follow-up messages invisible as injected LLM context while retaining queued delivery and idle-turn wakeups. Impact: the transcript no longer shows both the coordinator response and a duplicate custom-message card with the same follow-up text.
|