@llblab/pi-state-flow 0.26.3 → 0.26.4
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 +4 -0
- package/dist/lib/context.js +2 -1
- package/dist/package.json +1 -1
- package/docs/architecture.md +1 -1
- package/docs/usage.md +1 -1
- package/lib/context.ts +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
> Each release keeps at most 8 outcome records of at most 512 characters.
|
|
4
4
|
|
|
5
|
+
## 0.26.4: Passive Compaction Continuity
|
|
6
|
+
|
|
7
|
+
- `Passive continuation`: After idle Stop, native compaction can replace the later user anchor with a summary. Passive now retains that summary, the available tool calls/results and later refinements instead of reducing requests to a frozen handoff. Reload/resume preserve the same continuation; discarded raw history is not reconstructed. Native compaction, memory scopes and stored state are unchanged; no migration or configuration change is required.
|
|
8
|
+
|
|
5
9
|
## 0.26.3: Passive Response Isolation
|
|
6
10
|
|
|
7
11
|
- `Passive context`: Automatic Passive memory heads, Stop handoffs and state-update receipts omit the `response` plane, including after reload and mode changes. Active still sees the previous accepted answer. Canonical response storage, explicit reads and native/user/tool history are unchanged; no migration or configuration change is required.
|
package/dist/lib/context.js
CHANGED
|
@@ -345,7 +345,8 @@ export function passiveContinuationMessages(messages, continuation) {
|
|
|
345
345
|
const trajectory = currentRunTrajectory(messages, "", continuation.activeRunStartedAt);
|
|
346
346
|
return [continuation.handoff, ...trajectory.messages];
|
|
347
347
|
}
|
|
348
|
-
|
|
348
|
+
// A post-stop native summary replaces its compacted user anchor, including the retained tool suffix.
|
|
349
|
+
const start = messages.findIndex((message) => (message.role === "user" || message.role === "compactionSummary")
|
|
349
350
|
&& typeof message.timestamp === "number"
|
|
350
351
|
&& message.timestamp >= continuation.startedAt);
|
|
351
352
|
return [continuation.handoff, ...messages.filter((message, index) => message.role === "custom" || (start >= 0 && index >= start))];
|
package/dist/package.json
CHANGED
package/docs/architecture.md
CHANGED
|
@@ -290,7 +290,7 @@ Which boundary Stop keeps:
|
|
|
290
290
|
|
|
291
291
|
- A recorded active anchor uses the same conservative selector as active inference. If native compaction removed it, or matching is ambiguous or nonfinite, the available native summary and tool trajectory are kept, without guessing a post-stop boundary or rereading discarded raw entries.
|
|
292
292
|
- An interrupted run keeps its captured anchor even after Pi becomes idle. If capture is unavailable, Stop preserves all available context.
|
|
293
|
-
- Completed idle runs, and markers without an active anchor or preservation flag, keep only post-stop conversation plus foreign custom context.
|
|
293
|
+
- Completed idle runs, and markers without an active anchor or preservation flag, keep only post-stop conversation plus foreign custom context. A native `compactionSummary` timestamped at or after Stop is also a continuation boundary: its entire available suffix remains visible through later tool turns and user refinements. Pre-stop summaries do not reopen completed history; no discarded raw request is reconstructed.
|
|
294
294
|
|
|
295
295
|
The initial system prompt is composed at `before_agent_start`. Stop does not rewrite an already-issued request; the next provider request receives the current owned protocol section, as described below.
|
|
296
296
|
|
package/docs/usage.md
CHANGED
|
@@ -85,7 +85,7 @@ How each lifecycle event behaves:
|
|
|
85
85
|
- If native split-turn compaction removed the original request anchor, Stop keeps the available summary and tools instead, without reconstructing discarded raw input.
|
|
86
86
|
- An unfinished bootstrap keeps all available native context, or the earlier passive boundary it received. Repeated Start/Stop cannot move that boundary past uncompiled conversation.
|
|
87
87
|
- An interrupted run keeps its captured anchor even after Pi becomes idle, and falls back to all available context when that anchor is unknown.
|
|
88
|
-
- Only Stop after a completed idle run keeps just the later conversation plus foreign custom context. Other extensions' custom context survives in every case.
|
|
88
|
+
- Only Stop after a completed idle run keeps just the later conversation plus foreign custom context. A native compaction summary created after Stop keeps its complete available tool suffix and later refinements, even when the original user anchor is no longer present. Earlier summaries do not reopen completed history. Other extensions' custom context survives in every case.
|
|
89
89
|
- Mid-tool Start and repeated Start/Stop keep the first user event already observed while disabled, so a later Stop does not mistake that busy run for idle.
|
|
90
90
|
- Reload/resume/tree preserve this projection; new or forked physical sessions do not inherit it.
|
|
91
91
|
- Active restart uses the retained projection for one bootstrap run. Off keeps this boundary for a later Passive/Active selection but never projects it.
|
package/lib/context.ts
CHANGED
|
@@ -329,7 +329,8 @@ export function passiveContinuationMessages(messages: AgentMessage[], continuati
|
|
|
329
329
|
const trajectory = currentRunTrajectory(messages, "", continuation.activeRunStartedAt);
|
|
330
330
|
return [continuation.handoff, ...trajectory.messages];
|
|
331
331
|
}
|
|
332
|
-
|
|
332
|
+
// A post-stop native summary replaces its compacted user anchor, including the retained tool suffix.
|
|
333
|
+
const start = messages.findIndex((message) => (message.role === "user" || message.role === "compactionSummary")
|
|
333
334
|
&& typeof message.timestamp === "number"
|
|
334
335
|
&& message.timestamp >= continuation.startedAt);
|
|
335
336
|
return [continuation.handoff, ...messages.filter((message, index) =>
|