@llblab/pi-actors 0.43.1 → 0.44.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 +6 -6
- package/BACKLOG.md +1 -189
- package/CHANGELOG.md +412 -402
- package/README.md +5 -5
- package/dist/lib/async-runs.js +8 -30
- package/dist/lib/file-state.d.ts +3 -1
- package/dist/lib/file-state.js +25 -7
- package/dist/lib/inspector-overlay.js +46 -30
- package/dist/lib/limits.d.ts +10 -0
- package/dist/lib/limits.js +10 -0
- package/dist/lib/observability.d.ts +4 -2
- package/dist/lib/observability.js +43 -36
- package/dist/lib/run-evidence-policy.d.ts +95 -0
- package/dist/lib/run-evidence-policy.js +177 -0
- package/dist/lib/run-ui-runtime.js +2 -0
- package/dist/lib/runs-controls.d.ts +7 -5
- package/dist/lib/runs-controls.js +186 -49
- package/dist/lib/runs-retention.js +27 -14
- package/dist/lib/runs-trace.d.ts +25 -1
- package/dist/lib/runs-trace.js +410 -21
- package/dist/lib/runtime-triage.js +6 -22
- package/dist/lib/tools-inspect.js +48 -14
- package/dist/lib/trace-projection.js +90 -44
- package/dist/scripts/conformance.mjs +5 -0
- package/dist/scripts/locker.mjs +31 -74
- package/dist/scripts/music-player.mjs +41 -129
- package/dist/scripts/release-gates.mjs +26 -4
- package/dist/skills/actors/SKILL.md +7 -6
- package/dist/skills/swarm/SKILL.md +2 -2
- package/docs/README.md +0 -1
- package/docs/actor-inspector.md +3 -2
- package/docs/async-runs.md +10 -8
- package/docs/recipe-library.md +2 -2
- package/lib/async-runs.ts +8 -45
- package/lib/file-state.ts +28 -7
- package/lib/inspector-overlay.ts +29 -17
- package/lib/limits.ts +10 -0
- package/lib/observability.ts +55 -57
- package/lib/run-evidence-policy.ts +242 -0
- package/lib/run-ui-runtime.ts +2 -0
- package/lib/runs-controls.ts +177 -108
- package/lib/runs-retention.ts +28 -20
- package/lib/runs-trace.ts +496 -21
- package/lib/runtime-triage.ts +11 -25
- package/lib/tools-inspect.ts +45 -15
- package/lib/trace-projection.ts +137 -75
- package/package.json +1 -1
- package/scripts/conformance.mjs +5 -0
- package/scripts/locker.mjs +31 -74
- package/scripts/music-player.mjs +41 -129
- package/scripts/release-gates.mjs +26 -4
- package/skills/actors/SKILL.md +7 -6
- package/skills/swarm/SKILL.md +2 -2
- package/dist/lib/runtime-notifier.d.ts +0 -48
- package/dist/lib/runtime-notifier.js +0 -138
- package/docs/0.43-baseline.md +0 -39
- package/lib/runtime-notifier.ts +0 -211
package/AGENTS.md
CHANGED
|
@@ -54,7 +54,7 @@ Pi host
|
|
|
54
54
|
- `runtime-identity.ts`, `runtime-triage.ts`: immutable package/schema identity and pure pending/stale Control classification.
|
|
55
55
|
- `tools-spawn.ts`, `tools-register.ts`, `tools-local.ts`, `tools-response.ts`: Run creation, persistent capabilities, Recipe-backed tools, and compact results.
|
|
56
56
|
- `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.
|
|
57
|
-
- `observability.ts`, `
|
|
57
|
+
- `observability.ts`, `run-ui-runtime.ts`: Trace attention, terminal reconciliation, and Pi follow-up delivery.
|
|
58
58
|
- automatic draft/tool review domains: structurally redacted model review, journaled mutation, lineage, recovery, and explicit retry/reset safety.
|
|
59
59
|
|
|
60
60
|
Scripts remain self-contained when no non-script consumer justifies a TypeScript domain. Command-template script leaves infer `.js`/`.mjs` in order through Node, Bun, or `deno run` and `.sh` through Bash without shell evaluation. Helper-backed packaged Recipes self-locate their installed package root while explicit caller values remain authoritative. Recipes stay optional, composable, policy-light, and caller-configurable.
|
|
@@ -78,7 +78,7 @@ Canonical event:
|
|
|
78
78
|
{"id":"…","ts":"…","kind":"…","summary":"…","data":{},"level":"info","attention":"notify"}
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
Trace is a bounded retained suffix, not an audit archive. Every first-party writer must call `appendRunTraceEvent`; under the canonical token-owned lock it appends within both fixed bounds or atomically retains the newest suffix plus one cumulative warning-only `runtime.trace_compacted` marker. The marker means older history was discarded; terminal/result/execution/artifact files remain authoritative independently. Reads are newline-safe and order equal timestamps by same-source ordinal, fixed source rank, then stable id without exposing ordering metadata. Never write `trace.jsonl` directly. Persist durable state or an artifact before attention; `attention: "followup"` remains rare.
|
|
82
82
|
|
|
83
83
|
### Control
|
|
84
84
|
|
|
@@ -88,15 +88,15 @@ Public shape:
|
|
|
88
88
|
{"target":"run:<id>","action":"…","input":{},"verbose":false}
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
Admit only lowercase ASCII actions of at most 64 characters, serialized JSON input of at most 380 bytes, and complete newline-terminated wire records of at most 512 bytes on both FIFO and named pipe. Invalid envelopes remain outside the journal; persist every admitted Control before transport. Put larger data in a declared artifact/path and send only a bounded reference or instruction through Control. 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
|
|
91
|
+
Admit only lowercase ASCII actions of at most 64 characters, serialized JSON input of at most 380 bytes, and complete newline-terminated wire records of at most 512 bytes on both FIFO and named pipe. Invalid envelopes remain outside the journal; persist every admitted Control before transport. Put larger data in a declared artifact/path and send only a bounded reference or instruction through Control. Fence every record and endpoint with immutable `run_instance_id`; controlled services capture that generation at startup. Serialize admission and every compacted atomic journal replacement through token-owned dead-process-reclaiming locks. Reject malformed, oversized, stale-generation, or 64-pending journals before admission with bounded backpressure/integrity details; bound persisted errors to 4 KiB inside the string and retain at most 128 terminal records. First-party services must exact-id claim and finalize through `runs-controls.ts`; admitted nonterminal Controls never expire automatically. Keep transitions expected-state-fenced and monotonic when consumers complete before producer delivery evidence. FIFO and named pipe are transport details, not public concepts; 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.
|
|
92
92
|
|
|
93
93
|
Keep `controls.jsonl` raw and local for execution fidelity. Every model-facing and Actor Inspector Control surface must use the shared bounded `control-projection.ts` redaction before exposure; never attach a second raw copy in tool details.
|
|
94
94
|
|
|
95
|
-
Runtime lifecycle and review actions remain runtime-owned.
|
|
95
|
+
Runtime lifecycle and review actions remain runtime-owned. Runtime kill is the recovery path for a stuck saturated Run; it never consumes actor-local Control capacity or appends a synthetic Control record. Trace/Control quotas do not constrain user-declared artifacts, repositories, media sources, complete captures, or actor-owned workload state.
|
|
96
96
|
|
|
97
97
|
### Inspect
|
|
98
98
|
|
|
99
|
-
Run views are exactly `recipe`, `trace`, and `control`. Non-Run management targets
|
|
99
|
+
Run views are exactly `recipe`, `trace`, and `control`. Trace reports retained-history completeness; Control reports capacity, saturation, stale pending work, journal bytes, and bounded diagnostics. Runtime triage aggregates backpressured Runs and incomplete Trace. Non-Run management targets remain `runtime`, `recipes`, and `tool:<name>`. Apply owner filtering and redaction before projecting evidence.
|
|
100
100
|
|
|
101
101
|
## Retained Safety Invariants
|
|
102
102
|
|
|
@@ -128,7 +128,7 @@ Automatic review receives value-free structural projections, not executable cont
|
|
|
128
128
|
|
|
129
129
|
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.
|
|
130
130
|
|
|
131
|
-
File watchers accelerate reconciliation; a bounded
|
|
131
|
+
File watchers accelerate reconciliation; a bounded interval recovers missed terminal and retained-attention events. Canonical attention observation uses stable retained ids, primes them at startup without replay, and bounds seen memory to the current suffix across compaction; only allowlisted legacy outbox fallback uses line offsets. Attention is a wake hint, so persist durable recovery state before emitting it. 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.
|
|
132
132
|
|
|
133
133
|
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.
|
|
134
134
|
|
package/BACKLOG.md
CHANGED
|
@@ -1,191 +1,3 @@
|
|
|
1
1
|
# Project Backlog
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
**Base:** `0.43.0` at `0d6db30cd2e070c1d03ed1e60bef70538a3083c1`
|
|
6
|
-
**Release type:** patch-level assurance and distribution closure
|
|
7
|
-
**Release sentence:** the Run kernel is published, portable, redacted, and mechanically self-consistent.
|
|
8
|
-
|
|
9
|
-
## Mission
|
|
10
|
-
|
|
11
|
-
Close the concrete gaps exposed after the `0.43.0` Run-kernel migration without adding another orchestration layer or expanding the public model.
|
|
12
|
-
|
|
13
|
-
The canonical model remains unchanged:
|
|
14
|
-
|
|
15
|
-
```text
|
|
16
|
-
Recipe --spawn--> Run
|
|
17
|
-
Run = Recipe + Trace + Control
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
The public lifecycle remains:
|
|
21
|
-
|
|
22
|
-
```text
|
|
23
|
-
spawn create a Run
|
|
24
|
-
message apply Control
|
|
25
|
-
inspect read Recipe, Trace, or Control
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
`register_tool` remains the separate capability-memory surface.
|
|
29
|
-
|
|
30
|
-
`0.43.1` succeeds when the same contract is true in source mode, installed-package mode, documentation, diagnostics, first-party controlled services, CI, GitHub Release, and npm distribution.
|
|
31
|
-
|
|
32
|
-
## Hard Boundaries
|
|
33
|
-
|
|
34
|
-
The release must preserve:
|
|
35
|
-
|
|
36
|
-
- exactly the existing public Run nouns: `Recipe`, `Run`, `Trace`, and `Control`;
|
|
37
|
-
- exactly the existing Run views: `recipe`, `trace`, and `control`;
|
|
38
|
-
- exactly the existing management targets: `runtime`, `recipes`, and `tool:<name>`;
|
|
39
|
-
- the stable public tool names `spawn`, `message`, `inspect`, and `register_tool`;
|
|
40
|
-
- owner filtering, immutable `run_instance_id` fencing, canonical lifecycle locking, and process-identity verification;
|
|
41
|
-
- shutdown and parent-teardown behavior;
|
|
42
|
-
- terminal reconciliation and bounded follow-up context;
|
|
43
|
-
- complete command captures, owned Pi-session evidence, redaction, path containment, and symlink rejection;
|
|
44
|
-
- automatic Recipe review, immutable capture, CAS, journaled mutation, lineage, retry, reset, and recovery safety;
|
|
45
|
-
- shell-free command-template execution;
|
|
46
|
-
- the strict Domain DAG and removed-communication-surface gates.
|
|
47
|
-
|
|
48
|
-
The release must not add:
|
|
49
|
-
|
|
50
|
-
- actor chat, rooms, branches, peers, routing, mailboxes, inboxes, outboxes, or addressed envelopes under any name;
|
|
51
|
-
- a task tree, planner hierarchy, decision registry, swarm scheduler, model router, or model-economics subsystem to the kernel;
|
|
52
|
-
- new public targets, views, request fields, Trace fields, Control states, or Recipe keys;
|
|
53
|
-
- a remote protocol, broker, workflow DSL, or general event bus;
|
|
54
|
-
- compatibility aliases for removed `0.42` surfaces;
|
|
55
|
-
- a long-lived npm token or third-party publish action;
|
|
56
|
-
- new runtime dependencies unless an existing retained invariant cannot be closed otherwise.
|
|
57
|
-
|
|
58
|
-
## Deferred Beyond This Release
|
|
59
|
-
|
|
60
|
-
Do not absorb these future lines into `0.43.1`:
|
|
61
|
-
|
|
62
|
-
- total Trace retention, rotation, or semantic compaction;
|
|
63
|
-
- pending-Control admission backpressure and queue quotas;
|
|
64
|
-
- outcome/cost aggregation for Recipe fitness;
|
|
65
|
-
- automatic model selection or planner/worker economics;
|
|
66
|
-
- task-tree or decision-ownership orchestration;
|
|
67
|
-
- a generalized acknowledgement protocol for arbitrary controlled services.
|
|
68
|
-
|
|
69
|
-
Those require separate evidence and belong to later releases.
|
|
70
|
-
|
|
71
|
-
## Known Closure Gaps
|
|
72
|
-
|
|
73
|
-
The executor must verify this observation against the current checkout before changing code:
|
|
74
|
-
|
|
75
|
-
1. The repository-side Trusted Publisher path is prepared, but npm account binding and tagged publication proof remain external release preconditions.
|
|
76
|
-
|
|
77
|
-
If the observation no longer holds, preserve the already-closed behavior and remove only the corresponding obsolete task. Do not reimplement solved work.
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## P0 — Release and Contract Closure
|
|
82
|
-
|
|
83
|
-
### CCL-02 — Activate npm Trusted Publisher and prove registry convergence
|
|
84
|
-
|
|
85
|
-
**Goal:** make `pi install npm:@llblab/pi-actors` install the released Run kernel through the prepared tokenless, provenance-bearing path.
|
|
86
|
-
|
|
87
|
-
**Status:** repository preparation is complete; npm account configuration and one tagged release proof remain externally gated.
|
|
88
|
-
|
|
89
|
-
**External operator precondition:**
|
|
90
|
-
|
|
91
|
-
- Configure the npm Trusted Publisher for package `@llblab/pi-actors` with owner `llblab`, repository `pi-actors`, workflow filename `release.yml`, and no environment unless both sides adopt the same reviewed environment name.
|
|
92
|
-
- Do not add `NPM_TOKEN`, `NODE_AUTH_TOKEN`, or another long-lived token fallback.
|
|
93
|
-
- Remove any obsolete account-level automation tokens only after one Trusted Publisher release succeeds.
|
|
94
|
-
|
|
95
|
-
**Release-time closure:**
|
|
96
|
-
|
|
97
|
-
- The tagged workflow passes reusable validation, publishes or safely recognizes the exact npm version, verifies matching `gitHead` and packed Pi runtime manifests, then converges the GitHub Release.
|
|
98
|
-
- `npm view @llblab/pi-actors@0.43.1 version` and npm `latest` resolve to `0.43.1`.
|
|
99
|
-
- The GitHub Release and npm package identify the same tag commit.
|
|
100
|
-
- The Pi package index may update asynchronously; observe it without unbounded polling or repository mutation.
|
|
101
|
-
- If Trusted Publisher remains unconfigured or mismatched, report that exact external blocker and keep publication failed closed.
|
|
102
|
-
|
|
103
|
-
**Dependencies:** npm account configuration and the final tagged release.
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
## P1 — Signal, Compression, and Integration Closure
|
|
108
|
-
|
|
109
|
-
### CCL-12 — Close release evidence and publish `0.43.1`
|
|
110
|
-
|
|
111
|
-
**Goal:** leave one internally consistent source tree, package, release, and empty future-work file.
|
|
112
|
-
|
|
113
|
-
**Work:**
|
|
114
|
-
|
|
115
|
-
- Reconcile implementation comments, README, `AGENTS.md`, `docs/`, Actors skill, fixtures, schemas, tests, and release notes.
|
|
116
|
-
- Keep Swarm skill changes limited to kernel-interface corrections; do not expand orchestration methodology in this release.
|
|
117
|
-
- Update package version and packaged skill metadata to `0.43.1` only after all implementation tasks close.
|
|
118
|
-
- Move completed work into one concise `CHANGELOG.md` section with externally meaningful behavior and impact.
|
|
119
|
-
- Reset `BACKLOG.md` to:
|
|
120
|
-
|
|
121
|
-
```text
|
|
122
|
-
# Project Backlog
|
|
123
|
-
|
|
124
|
-
No open items.
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
- Run the final local boundary:
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
npm ci
|
|
131
|
-
npm run test:preservation
|
|
132
|
-
npm run release:validate
|
|
133
|
-
npm run audit:dependencies
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
- Create tag `v0.43.1` only from the validated release commit.
|
|
137
|
-
- Observe the gated workflow through successful validation, npm publication, npm verification, and GitHub Release publication.
|
|
138
|
-
- Verify the final public package through npm, not only `npm pack --dry-run`.
|
|
139
|
-
|
|
140
|
-
**Release closure:**
|
|
141
|
-
|
|
142
|
-
- Ubuntu, macOS, Windows, and dependency-audit jobs succeed.
|
|
143
|
-
- GitHub Release is published only after validation and npm verification.
|
|
144
|
-
- npm exact version and `latest` both resolve to `0.43.1`.
|
|
145
|
-
- The installed package reports `0.43.1`, exposes the same schemas as source, and contains no removed communication surface.
|
|
146
|
-
- Recipe QA has zero diagnostics and zero baseline warnings.
|
|
147
|
-
- Shipped lines remain below `28,853`.
|
|
148
|
-
- No unresolved P0/P1 finding remains.
|
|
149
|
-
- `BACKLOG.md` contains no completed work.
|
|
150
|
-
|
|
151
|
-
**Dependencies:** all prior tasks and the npm Trusted Publisher external precondition.
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
## Dependency Order
|
|
156
|
-
|
|
157
|
-
```text
|
|
158
|
-
Released 0.43.0 baseline
|
|
159
|
-
└── CCL-02 → CCL-12
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
`CCL-02` may proceed in parallel with kernel fixes after the frozen released baseline, but no tag may be created until the complete graph closes.
|
|
163
|
-
|
|
164
|
-
## Required Test Matrix
|
|
165
|
-
|
|
166
|
-
At minimum, retain or add direct evidence for:
|
|
167
|
-
|
|
168
|
-
| Boundary | Required evidence |
|
|
169
|
-
| ---------------------- | ----------------------------------------------------------------------------------------- |
|
|
170
|
-
| Public Control request | exact fields, action length, serialized-input bound, removed-field rejection |
|
|
171
|
-
| Recipe Control | same action grammar/length, duplicate and runtime-reserved rejection |
|
|
172
|
-
| Control journal | generation fencing, monotonic transitions, compaction, stale-lock recovery |
|
|
173
|
-
| Control projection | recursive redaction in tool content/details, triage, and Actor Inspector |
|
|
174
|
-
| Control transport | exact complete-wire bound, FIFO atomicity, named-pipe parity, partial-write failure |
|
|
175
|
-
| Runtime status | exact version in source and packed/dist modes |
|
|
176
|
-
| Runtime triage | pending/stale distinction, delivered inclusion, age boundaries, owner/lifecycle filtering |
|
|
177
|
-
| Trace append | canonical validation, cross-process serialization, no malformed/lost/duplicate records |
|
|
178
|
-
| First-party services | canonical Trace only, canonical Control claim/finalization, endpoint generation |
|
|
179
|
-
| Documentation | canonical examples accepted by current schemas/dispatchers |
|
|
180
|
-
| Recipe QA | zero diagnostics and zero normalized warnings |
|
|
181
|
-
| Release | validation-before-publication, OIDC-only npm publishing, rerun convergence |
|
|
182
|
-
| Compression | strict shipped-line ratchet from `0.43.0` |
|
|
183
|
-
| Installed package | compiled entrypoint, skills, version, schemas, no stale files/source imports |
|
|
184
|
-
|
|
185
|
-
## Final Decision Rule
|
|
186
|
-
|
|
187
|
-
Do not release because the code compiles or because the new abstractions look cleaner.
|
|
188
|
-
|
|
189
|
-
Release only when this statement is supported end to end:
|
|
190
|
-
|
|
191
|
-
> A user installing `@llblab/pi-actors@0.43.1` receives the same validated Run kernel described by the repository: every Run exposes one captured Recipe, one redacted causal Trace, and one portable generation-fenced Control boundary—without a communication plane and without distribution ambiguity.
|
|
3
|
+
No open items.
|