@signalridge/pi-goal 1.4.5 → 1.4.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @signalridge/pi-goal
2
2
 
3
+ ## 1.4.7
4
+ ### Patch Changes
5
+
6
+ - 4d37546: Point package documentation to the maintained compatibility guide instead of removed historical review snapshots.
7
+ - 4d37546: Detach serialized Goal state from mutable runtime objects before appending native session metadata. Goal accounting, status, safety counters, queued objectives, wait records, and pending queue actions must not retroactively modify earlier session entries through shared references. This prevents false ancestry and ownership failures in observers such as Todo without relaxing their integrity checks, changing persisted shapes, resetting budgets, or automatically resuming stopped work. Already affected in-memory sessions should be safely closed and resumed from persisted history after updating; reloading extension code alone does not reconstruct old native entries.
8
+
9
+ ## 1.4.6
10
+ ### Patch Changes
11
+
12
+ - c2fd867: Treat unknown continuation-shaped user comments as ordinary input while retaining owned stale-delivery rejection and provenance guards.
13
+ - Updated dependencies [c2fd867]
14
+ - @signalridge/pi-ui@1.4.0
15
+
3
16
  ## 1.4.5
4
17
  ### Patch Changes
5
18
 
package/README.md CHANGED
@@ -38,7 +38,7 @@ Goal mode uses Codex-like persistence instructions and sends guarded continuatio
38
38
 
39
39
  ## Install
40
40
 
41
- The current tested host is Pi `1.0.4`. Host-provided dependencies use `"*"` peers to identify module ownership, not to guarantee compatibility with every Pi version. See the [compatibility review](https://github.com/signalridge/pi-extensions/blob/main/docs/pi-1.0-compatibility.md) for verification details. The `agent_settled` lifecycle event this extension depends on landed in `0.80.6`.
41
+ The current tested host is Pi `1.0.4`. Host-provided dependencies use `"*"` peers to identify module ownership, not to guarantee compatibility with every Pi version. See the [compatibility guide](https://github.com/signalridge/pi-extensions/blob/main/docs/compatibility.md) for verification details. The `agent_settled` lifecycle event this extension depends on landed in `0.80.6`.
42
42
 
43
43
  ```bash
44
44
  pi install npm:@signalridge/pi-goal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalridge/pi-goal",
3
- "version": "1.4.5",
3
+ "version": "1.4.7",
4
4
  "description": "Pi extension for autonomous /goal completion with opt-in experimental ordered queues.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@narumitw/pi-tui-kit": "^0.54.0",
54
- "@signalridge/pi-ui": "^1.3.3"
54
+ "@signalridge/pi-ui": "^1.4.0"
55
55
  },
56
56
  "repository": {
57
57
  "type": "git",
@@ -82,11 +82,13 @@ export function serializeGoalState(
82
82
  queue: readonly ActiveGoal[],
83
83
  pendingAction: PendingQueueAction | undefined,
84
84
  ): GoalStateEntryData {
85
- return {
85
+ // Native session entries retain data references; later runtime updates must
86
+ // not rewrite historical metadata or invalidate another extension's ancestry.
87
+ return structuredClone({
86
88
  goal: goal ?? null,
87
89
  ...(queue.length > 0 ? { queue: [...queue] } : {}),
88
90
  ...(pendingAction ? { pendingAction } : {}),
89
- };
91
+ });
90
92
  }
91
93
 
92
94
  export function loadGoalStateFromSession(ctx: SessionContext): LoadedGoalState {
package/src/runtime.ts CHANGED
@@ -1088,7 +1088,14 @@ export class GoalRuntime {
1088
1088
 
1089
1089
  markContinuationStarted(prompt: string) {
1090
1090
  const marker = extractContinuationMarker(prompt);
1091
- if (!marker) {
1091
+ const owned = Boolean(
1092
+ marker &&
1093
+ (this.continuationDelivery?.marker === marker ||
1094
+ this.claimedContinuationMarkers.has(marker) ||
1095
+ this.cancelledContinuationMarkers.has(marker)),
1096
+ );
1097
+ if (!owned) {
1098
+ // Marker-shaped user text is ordinary input, not proof of ownership.
1092
1099
  // A paused wait is not continuation work. An unrelated prompt can fail
1093
1100
  // before agent_settled, so its deadline must remain armed.
1094
1101
  if (this.activeGoal?.status === "paused" && this.activeGoal.wait) return undefined;
@@ -1098,6 +1105,7 @@ export class GoalRuntime {
1098
1105
  this.cancelContinuationWork();
1099
1106
  return undefined;
1100
1107
  }
1108
+ if (!marker) return undefined;
1101
1109
  if (this.continuationDelivery?.marker === marker) {
1102
1110
  this.continuationDelivery = undefined;
1103
1111
  this.rememberClaimedContinuationMarker(marker);