@llblab/pi-actors 0.24.1 → 0.24.3

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/BACKLOG.md CHANGED
@@ -208,6 +208,25 @@ The backlog is intentionally pruned to the 20% of work most likely to deliver 80
208
208
  - Installed-package tests cover every script shim that imports compiled domain logic.
209
209
  - Pack dry assertions cover `dist/scripts`, `dist/recipes`, `dist/fixtures`, and `dist/skills`.
210
210
 
211
+ ### M-11 Actor Termination Semantics
212
+
213
+ - Priority: Medium.
214
+ - Status: Open.
215
+ - Goal: Make `control.kill` the canonical parent-to-actor termination action while keeping `control.stop` and `control.cancel` as actor-domain messages whose meaning depends on the actor protocol.
216
+ - Why now: Mailbox workers need a clearer lifecycle boundary before v2 patterns harden. Treating `stop`, `cancel`, and `kill` as equivalent stop messages blurs actor termination with domain-specific task or playback control.
217
+ - Direction:
218
+ - Document `control.kill` as the universal lifecycle action for a parent/supervisor terminating an actor or run.
219
+ - Reframe `control.stop` as actor-defined domain control, such as stopping music playback or ending an actor-specific loop when that actor declares it.
220
+ - Reframe `control.cancel` as actor-defined domain control, such as cancelling the current subagent task while keeping the worker actor alive for later assignments.
221
+ - Split mailbox-loop helper semantics so lifecycle termination detection is distinct from general control-message detection.
222
+ - While the package is pre-1.0, allow a small intentional minor-version contract break: remove legacy treatment that aliases `control.stop` or `control.cancel` to actor termination.
223
+ - Do not preserve compatibility shims for the old stop/cancel-as-termination behavior before the first 1.0 major release unless a concrete safety issue appears during implementation.
224
+ - Acceptance:
225
+ - Docs and actors skill advertise `control.kill` as canonical parent-to-actor termination.
226
+ - Mailbox-loop helpers/tests distinguish actor termination from actor-domain `stop`/`cancel` handling.
227
+ - Packaged recipes declare `stop`/`cancel` only when the actor-specific behavior is meaningful.
228
+ - Tests assert that generic mailbox-loop termination is not triggered by `control.stop` or `control.cancel`.
229
+
211
230
  ## Explicitly Deferred
212
231
 
213
232
  These are valid ideas but not current focus. Reintroduce only with concrete evidence from real actor workflows.
@@ -226,6 +245,6 @@ These are valid ideas but not current focus. Reintroduce only with concrete evid
226
245
  0.25 — Operator remediation and worker maturity:
227
246
  M-08, M-09
228
247
 
229
- 0.26 — Package contract hardening:
230
- M-10
248
+ 0.26 — Package contract hardening and lifecycle semantics:
249
+ M-10, M-11
231
250
  ```
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.24.3: Actor Inspector Body Field Hotfix
6
+
7
+ - `[Inspector]` Removed the selected-item key-label shim by projecting actor-message detail rows with a real `body` field instead of rendering `body_preview` under an alias.
8
+
9
+ ## 0.24.2: Actor Inspector Item View Hotfix
10
+
11
+ - `[Inspector]` Removed the roster panel from selected actor-message item inspection, kept the compact route header styling, added the same left/right gutter used by inspector rows, and renamed the selected-item `body_preview` label to `body`.
12
+
5
13
  ## 0.24.1: Build Script Package Hygiene Hotfix
6
14
 
7
15
  - `[Backlog]` Added the next focused backlog set for recipe doctor remediation UX, actor worker v2, and dist package contract hardening.
package/dist/index.js CHANGED
@@ -94,7 +94,7 @@ export default function toolRegistryExtension(pi) {
94
94
  ? ActorInspectorTui.renderInspectorItemView(previews, width, style, { sequence: selectedInspectorSequence })
95
95
  : ActorInspectorTui.renderInspectorWidget(previews, width, style)) ?? [];
96
96
  const run = previews[0]?.run;
97
- const roster = run
97
+ const roster = selectedInspectorSequence === undefined && run
98
98
  ? ActorInspectorTui.renderInspectorRosterPanel(ActorInspectorTui.readActorInspectorRoster(RUN_STATE_ROOT, run), width, style)
99
99
  : undefined;
100
100
  return roster ? [...roster, ...rows] : rows;
@@ -499,43 +499,46 @@ export function renderInspectorItemView(previews, width = 80, styles = {}, optio
499
499
  if (!preview)
500
500
  return undefined;
501
501
  const safeWidth = Math.max(1, width);
502
- const orderedKeys = [
503
- "channel",
504
- "run",
505
- "event_id",
506
- "from",
507
- "from_display",
508
- "to",
509
- "type",
510
- "summary",
511
- "body_preview",
512
- "message_id",
513
- "needs_response",
514
- "timestamp",
515
- "stripe",
502
+ const prefix = " ";
503
+ const suffix = " ";
504
+ const contentWidth = Math.max(8, safeWidth - prefix.length - suffix.length);
505
+ const rawEntries = [
506
+ ["channel", preview.channel],
507
+ ["run", preview.run],
508
+ ["event_id", preview.event_id],
509
+ ["from", preview.from],
510
+ ["from_display", preview.from_display],
511
+ ["to", preview.to],
512
+ ["type", preview.type],
513
+ ["summary", preview.summary],
514
+ ["body", preview.body_preview],
515
+ ["message_id", preview.message_id],
516
+ ["needs_response", preview.needs_response],
517
+ ["timestamp", preview.timestamp],
518
+ ["stripe", preview.stripe],
516
519
  ];
517
- const entries = orderedKeys
518
- .filter((key) => preview[key] !== undefined)
519
- .map((key) => [key, propertyValue(preview[key])]);
520
+ const entries = rawEntries
521
+ .filter((entry) => entry[1] !== undefined)
522
+ .map(([key, value]) => [key, propertyValue(value)]);
520
523
  const keyWidth = Math.max(1, ...entries.map(([key]) => displayWidth(key)));
521
524
  const sequenceText = String(preview.sequence ?? options.sequence);
522
525
  const sequencePadding = " ".repeat(Math.max(0, keyWidth - displayWidth(sequenceText)));
523
526
  const headerSeparator = " ";
524
527
  const route = routeText(preview);
525
- const visibleRoute = boundedLine(route, Math.max(0, safeWidth - keyWidth - headerSeparator.length));
528
+ const visibleRoute = boundedLine(route, Math.max(0, contentWidth - keyWidth - headerSeparator.length));
526
529
  const headerPlain = `${sequenceText}${sequencePadding}${headerSeparator}${visibleRoute}`;
527
530
  const header = `${style(styles.muted, sequenceText)}${sequencePadding}${headerSeparator}${style(styles.target, visibleRoute)}`;
528
- const headerPadding = Math.max(0, safeWidth - visibleWidth(headerPlain));
529
- const lines = [`${header}${" ".repeat(headerPadding)}`, ""];
531
+ const headerPadding = Math.max(0, contentWidth - visibleWidth(headerPlain));
532
+ const lines = [`${prefix}${header}${" ".repeat(headerPadding)}${suffix}`, ""];
530
533
  for (const [key, value] of entries) {
531
534
  const keyPadding = " ".repeat(Math.max(0, keyWidth - displayWidth(key)));
532
535
  const separator = " ";
533
- const valueWidth = Math.max(0, safeWidth - keyWidth - separator.length);
536
+ const valueWidth = Math.max(0, contentWidth - keyWidth - separator.length);
534
537
  const visibleValue = boundedLine(value, valueWidth);
535
538
  const plain = `${key}${keyPadding}${separator}${visibleValue}`;
536
539
  const rendered = `${style(styles.muted, key)}${keyPadding}${separator}${style(styles.preview, visibleValue)}`;
537
- const padding = Math.max(0, safeWidth - visibleWidth(plain));
538
- lines.push(`${rendered}${" ".repeat(padding)}`);
540
+ const padding = Math.max(0, contentWidth - visibleWidth(plain));
541
+ lines.push(`${prefix}${rendered}${" ".repeat(padding)}${suffix}`);
539
542
  }
540
543
  return lines;
541
544
  }
@@ -2,7 +2,7 @@
2
2
  name: actors
3
3
  description: Highest-density practical guide for pi-actors. Read this skill whenever prompt and tools are not enough for spawn, message, inspect, actor runs, tools, recipes, command templates, async lifecycle, mailboxes, artifacts, and local orchestration mechanics.
4
4
  metadata:
5
- version: 0.24.1
5
+ version: 0.24.3
6
6
  ---
7
7
 
8
8
  # Actors (pi-actors)
@@ -2,7 +2,7 @@
2
2
  name: swarm
3
3
  description: Subagent orchestration with scoped locks and quorum consensus. Use for multi-model review, parallel scoped work, delegated audit, and coordinated subagent execution.
4
4
  metadata:
5
- version: 0.24.1
5
+ version: 0.24.3
6
6
  ---
7
7
 
8
8
  # Swarm
package/index.ts CHANGED
@@ -129,16 +129,17 @@ export default function toolRegistryExtension(pi: ExtensionAPI) {
129
129
  style,
130
130
  )) ?? [];
131
131
  const run = previews[0]?.run;
132
- const roster = run
133
- ? ActorInspectorTui.renderInspectorRosterPanel(
134
- ActorInspectorTui.readActorInspectorRoster(
135
- RUN_STATE_ROOT,
136
- run,
137
- ),
138
- width,
139
- style,
140
- )
141
- : undefined;
132
+ const roster =
133
+ selectedInspectorSequence === undefined && run
134
+ ? ActorInspectorTui.renderInspectorRosterPanel(
135
+ ActorInspectorTui.readActorInspectorRoster(
136
+ RUN_STATE_ROOT,
137
+ run,
138
+ ),
139
+ width,
140
+ style,
141
+ )
142
+ : undefined;
142
143
  return roster ? [...roster, ...rows] : rows;
143
144
  },
144
145
  };
@@ -727,24 +727,27 @@ export function renderInspectorItemView(
727
727
  const preview = previews.find((item) => item.sequence === options.sequence);
728
728
  if (!preview) return undefined;
729
729
  const safeWidth = Math.max(1, width);
730
- const orderedKeys = [
731
- "channel",
732
- "run",
733
- "event_id",
734
- "from",
735
- "from_display",
736
- "to",
737
- "type",
738
- "summary",
739
- "body_preview",
740
- "message_id",
741
- "needs_response",
742
- "timestamp",
743
- "stripe",
744
- ] as const;
745
- const entries = orderedKeys
746
- .filter((key) => preview[key] !== undefined)
747
- .map((key) => [key, propertyValue(preview[key])] as const);
730
+ const prefix = " ";
731
+ const suffix = " ";
732
+ const contentWidth = Math.max(8, safeWidth - prefix.length - suffix.length);
733
+ const rawEntries: Array<readonly [string, unknown]> = [
734
+ ["channel", preview.channel],
735
+ ["run", preview.run],
736
+ ["event_id", preview.event_id],
737
+ ["from", preview.from],
738
+ ["from_display", preview.from_display],
739
+ ["to", preview.to],
740
+ ["type", preview.type],
741
+ ["summary", preview.summary],
742
+ ["body", preview.body_preview],
743
+ ["message_id", preview.message_id],
744
+ ["needs_response", preview.needs_response],
745
+ ["timestamp", preview.timestamp],
746
+ ["stripe", preview.stripe],
747
+ ];
748
+ const entries = rawEntries
749
+ .filter((entry) => entry[1] !== undefined)
750
+ .map(([key, value]) => [key, propertyValue(value)] as const);
748
751
  const keyWidth = Math.max(1, ...entries.map(([key]) => displayWidth(key)));
749
752
  const sequenceText = String(preview.sequence ?? options.sequence);
750
753
  const sequencePadding = " ".repeat(
@@ -754,21 +757,21 @@ export function renderInspectorItemView(
754
757
  const route = routeText(preview);
755
758
  const visibleRoute = boundedLine(
756
759
  route,
757
- Math.max(0, safeWidth - keyWidth - headerSeparator.length),
760
+ Math.max(0, contentWidth - keyWidth - headerSeparator.length),
758
761
  );
759
762
  const headerPlain = `${sequenceText}${sequencePadding}${headerSeparator}${visibleRoute}`;
760
763
  const header = `${style(styles.muted, sequenceText)}${sequencePadding}${headerSeparator}${style(styles.target, visibleRoute)}`;
761
- const headerPadding = Math.max(0, safeWidth - visibleWidth(headerPlain));
762
- const lines = [`${header}${" ".repeat(headerPadding)}`, ""];
764
+ const headerPadding = Math.max(0, contentWidth - visibleWidth(headerPlain));
765
+ const lines = [`${prefix}${header}${" ".repeat(headerPadding)}${suffix}`, ""];
763
766
  for (const [key, value] of entries) {
764
767
  const keyPadding = " ".repeat(Math.max(0, keyWidth - displayWidth(key)));
765
768
  const separator = " ";
766
- const valueWidth = Math.max(0, safeWidth - keyWidth - separator.length);
769
+ const valueWidth = Math.max(0, contentWidth - keyWidth - separator.length);
767
770
  const visibleValue = boundedLine(value, valueWidth);
768
771
  const plain = `${key}${keyPadding}${separator}${visibleValue}`;
769
772
  const rendered = `${style(styles.muted, key)}${keyPadding}${separator}${style(styles.preview, visibleValue)}`;
770
- const padding = Math.max(0, safeWidth - visibleWidth(plain));
771
- lines.push(`${rendered}${" ".repeat(padding)}`);
773
+ const padding = Math.max(0, contentWidth - visibleWidth(plain));
774
+ lines.push(`${prefix}${rendered}${" ".repeat(padding)}${suffix}`);
772
775
  }
773
776
  return lines;
774
777
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llblab/pi-actors",
3
- "version": "0.24.1",
3
+ "version": "0.24.3",
4
4
  "private": false,
5
5
  "description": "Local Actor Kernel for Pi",
6
6
  "keywords": [
@@ -2,7 +2,7 @@
2
2
  name: actors
3
3
  description: Highest-density practical guide for pi-actors. Read this skill whenever prompt and tools are not enough for spawn, message, inspect, actor runs, tools, recipes, command templates, async lifecycle, mailboxes, artifacts, and local orchestration mechanics.
4
4
  metadata:
5
- version: 0.24.1
5
+ version: 0.24.3
6
6
  ---
7
7
 
8
8
  # Actors (pi-actors)
@@ -2,7 +2,7 @@
2
2
  name: swarm
3
3
  description: Subagent orchestration with scoped locks and quorum consensus. Use for multi-model review, parallel scoped work, delegated audit, and coordinated subagent execution.
4
4
  metadata:
5
- version: 0.24.1
5
+ version: 0.24.3
6
6
  ---
7
7
 
8
8
  # Swarm