@aeondave/pi-persona-mind 0.9.4 → 0.9.5
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 +6 -0
- package/README.md +2 -2
- package/docs/DESIGN.md +5 -1
- package/package.json +6 -2
- package/src/core/service.ts +2 -2
- package/src/extension/worker-memory-anchor.ts +28 -0
- package/src/index.ts +9 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.9.5](https://github.com/AeonDave/pi-persona-mind/releases/tag/v0.9.5) - 2026-11-25
|
|
4
|
+
|
|
5
|
+
- Saved Persona workers rank lean memory by the launch task and show relative ages as of the
|
|
6
|
+
launch turn. They still load current durable memory for Persona to check against the saved
|
|
7
|
+
worker contract.
|
|
8
|
+
|
|
3
9
|
## [0.9.4](https://github.com/AeonDave/pi-persona-mind/releases/tag/v0.9.4) - 2026-11-23
|
|
4
10
|
|
|
5
11
|
- A memory replacement or consolidation refused before anything was written (a full store, a lock
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<h1 align="center">pi-persona-mind</h1>
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
<img src="https://raw.githubusercontent.com/AeonDave/pi-persona-mind/v0.9.
|
|
4
|
+
<img src="https://raw.githubusercontent.com/AeonDave/pi-persona-mind/v0.9.5/assets/banner.png" alt="pi-persona-mind — durable memory for Pi">
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
[](https://github.com/AeonDave/pi-persona-mind/actions/workflows/test.yml)
|
|
@@ -28,7 +28,7 @@ knowledge reviews use the current session model and incur model usage.
|
|
|
28
28
|
|
|
29
29
|
## Quick start
|
|
30
30
|
|
|
31
|
-
Mind 0.9.
|
|
31
|
+
Mind 0.9.5 requires **Pi 1.6.0**, **Node.js 22.19.0+**, and
|
|
32
32
|
[**pi-persona 1.18.1+**](https://github.com/AeonDave/pi-persona) loaded in the same instance.
|
|
33
33
|
|
|
34
34
|
```bash
|
package/docs/DESIGN.md
CHANGED
|
@@ -17,7 +17,7 @@ patch an installed host.
|
|
|
17
17
|
Mind requires a loaded compatible pi-persona through its versioned local companion handshake.
|
|
18
18
|
Missing/incompatible presence leaves tools inactive and suppresses capture, storage/import,
|
|
19
19
|
injection and reminders. A settings file or installed npm package is not proof of an active
|
|
20
|
-
companion. Mind 0.9.
|
|
20
|
+
companion. Mind 0.9.5 requires Persona 1.18.1 or later for these paired contracts. Its optional npm
|
|
21
21
|
peer declares that requirement without auto-installing or activating another extension.
|
|
22
22
|
|
|
23
23
|
The node-only core has no Pi imports. The factory wires native Pi hooks, tools, scope, scheduling
|
|
@@ -97,6 +97,10 @@ PI_PERSONA_DISABLE alone does not designate a worker. Workers get lean objective
|
|
|
97
97
|
no project/session notes, no memory/backlog tools and no reminders. Both Persona engines freeze the
|
|
98
98
|
launching persona. In-process workers receive it through their own extension bus; child processes
|
|
99
99
|
receive a scrubbed spawn-local payload. A later parent selection cannot move a worker's memory scope.
|
|
100
|
+
For a persisted worker with one valid Persona v1 contract on the active branch, lean memory ranking
|
|
101
|
+
uses the first user turn after that contract. Labels such as `today` and `1d` in the worker's lean
|
|
102
|
+
memory refer to that launch turn's timestamp. Mind reads current durable memory for each turn, and
|
|
103
|
+
Persona checks the resulting prompt against the saved contract.
|
|
100
104
|
|
|
101
105
|
Intercom/Exocom and worker output stay foreign reference material, not automatic capture requests.
|
|
102
106
|
Only the reserved pi-persona-deferred-input custom type replays direct user input. This is a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeondave/pi-persona-mind",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Local memory for Pi with pi-persona — durable project and persona facts, session notes, bounded retrieval, and supervised automatic consolidation.",
|
|
@@ -52,13 +52,14 @@
|
|
|
52
52
|
"verify": "npm run typecheck && npm test"
|
|
53
53
|
},
|
|
54
54
|
"pi": {
|
|
55
|
-
"image": "https://raw.githubusercontent.com/AeonDave/pi-persona-mind/v0.9.
|
|
55
|
+
"image": "https://raw.githubusercontent.com/AeonDave/pi-persona-mind/v0.9.5/assets/banner.png",
|
|
56
56
|
"extensions": [
|
|
57
57
|
"./src/index.ts"
|
|
58
58
|
]
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@aeondave/pi-persona": ">=1.18.1",
|
|
62
|
+
"@earendil-works/pi-ai": "*",
|
|
62
63
|
"@earendil-works/pi-coding-agent": "*",
|
|
63
64
|
"@earendil-works/pi-tui": "*",
|
|
64
65
|
"typebox": "*"
|
|
@@ -67,6 +68,9 @@
|
|
|
67
68
|
"@aeondave/pi-persona": {
|
|
68
69
|
"optional": true
|
|
69
70
|
},
|
|
71
|
+
"@earendil-works/pi-ai": {
|
|
72
|
+
"optional": true
|
|
73
|
+
},
|
|
70
74
|
"@earendil-works/pi-coding-agent": {
|
|
71
75
|
"optional": true
|
|
72
76
|
},
|
package/src/core/service.ts
CHANGED
|
@@ -691,7 +691,7 @@ export class MindService {
|
|
|
691
691
|
* persona, so it inherits who the persona IS but not the supervisor's project state or deferred
|
|
692
692
|
* intent. (The caller also withholds the write tools + wakes from a leg — see index.ts.)
|
|
693
693
|
*/
|
|
694
|
-
async buildInjection(opts: { lean?: boolean; query?: string; fixedBlocks?: readonly string[]; cleanup?: boolean } = {}): Promise<string> {
|
|
694
|
+
async buildInjection(opts: { lean?: boolean; query?: string; fixedBlocks?: readonly string[]; cleanup?: boolean; leanReferenceTime?: number } = {}): Promise<string> {
|
|
695
695
|
// Workers inherit a read-only lean block; they must not mutate the supervisor's stores.
|
|
696
696
|
// A background import may own the profile lock while awaiting another store writer. Reads
|
|
697
697
|
// already filter expiry; defer disk hygiene until a later turn rather than joining that import.
|
|
@@ -701,7 +701,7 @@ export class MindService {
|
|
|
701
701
|
if (opts.lean || this.scope.homeWorkspace) {
|
|
702
702
|
const ltm = this.safeMemories(await this.longMemories(), "long-term");
|
|
703
703
|
if (opts.lean) {
|
|
704
|
-
return renderMind({ persona: this.scope.persona, ltm, stm: [], backlog: [], now, lean: true, ...context, ...(this.budget ? { budget: this.budget } : {}) });
|
|
704
|
+
return renderMind({ persona: this.scope.persona, ltm, stm: [], backlog: [], now: opts.leanReferenceTime ?? now, lean: true, ...context, ...(this.budget ? { budget: this.budget } : {}) });
|
|
705
705
|
}
|
|
706
706
|
return renderMind({ persona: this.scope.persona, ltm, stm: [], backlog: [], now, ...context, ...(this.budget ? { budget: this.budget } : {}) });
|
|
707
707
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { contentText } from "@earendil-works/pi-ai";
|
|
2
|
+
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
3
|
+
|
|
4
|
+
const WORKER_CONTRACT_ENTRY = "pi-persona-worker-contract";
|
|
5
|
+
|
|
6
|
+
/** The launch task and time of a Persona v1 continuation, from the current native branch. */
|
|
7
|
+
export function workerMemoryAnchor(manager: ExtensionContext["sessionManager"]): { query: string; timestamp: number } | undefined {
|
|
8
|
+
try {
|
|
9
|
+
if (!manager.getSessionFile()) return undefined;
|
|
10
|
+
const branch = manager.getBranch();
|
|
11
|
+
const contracts = branch.filter((entry) => entry.type === "custom" && entry.customType === WORKER_CONTRACT_ENTRY);
|
|
12
|
+
const contract = contracts[0];
|
|
13
|
+
if (contracts.length !== 1 || contract?.type !== "custom") return undefined;
|
|
14
|
+
const data: unknown = contract.data;
|
|
15
|
+
if (!data || typeof data !== "object" || !("version" in data) || data.version !== 1
|
|
16
|
+
|| !("sha256" in data) || typeof data.sha256 !== "string" || !/^[0-9a-f]{64}$/.test(data.sha256)) return undefined;
|
|
17
|
+
|
|
18
|
+
for (const entry of branch.slice(branch.indexOf(contract) + 1)) {
|
|
19
|
+
if (entry.type === "message" && entry.message.role === "user") {
|
|
20
|
+
const { content, timestamp } = entry.message;
|
|
21
|
+
if (!Number.isSafeInteger(timestamp) || timestamp <= 0 || timestamp > Date.now()) return undefined;
|
|
22
|
+
const query = contentText(content);
|
|
23
|
+
return query.trim() ? { query, timestamp } : undefined;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
} catch { /* Ordinary per-turn ranking still applies when the branch is unreadable. */ }
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -46,6 +46,7 @@ import { MIND_RESULT_ENTRY_TYPE, registerMindResultRenderer } from "./ui/mind-re
|
|
|
46
46
|
import { parsePersonaMemoryOwner, PERSONA_MEMORY_OWNER_CHANGED, personaGuardedTools, queryPersonaDependency, queryPersonaMemoryOwner } from "./extension/persona-dependency.ts";
|
|
47
47
|
import { createMindActivityRunner } from "./extension/activity.ts";
|
|
48
48
|
import { installAutoOptimize } from "./extension/auto-optimize-session.ts";
|
|
49
|
+
import { workerMemoryAnchor } from "./extension/worker-memory-anchor.ts";
|
|
49
50
|
|
|
50
51
|
const STATUS_KEY = "pi-persona-mind";
|
|
51
52
|
/** Display-only transcript card for a due backlog wake. Never sent to the model; never starts a turn. */
|
|
@@ -1096,7 +1097,14 @@ export function createExtension(pi: ExtensionAPI, opts: ExtensionOptions = {}):
|
|
|
1096
1097
|
const sessionBlock = isDelegatedLeg ? "" : sessionMemory.injection(ctx, { query, maxTokens: 600 });
|
|
1097
1098
|
try {
|
|
1098
1099
|
// A worker inherits the LEAN mind (north-star + identity only); the supervisor gets it all.
|
|
1099
|
-
|
|
1100
|
+
const memoryAnchor = isDelegatedLeg ? workerMemoryAnchor(ctx.sessionManager) : undefined;
|
|
1101
|
+
block = await withDeadline(getMind(ctx).buildInjection({
|
|
1102
|
+
lean: isDelegatedLeg,
|
|
1103
|
+
cleanup: !backgroundMigrationPending,
|
|
1104
|
+
query: memoryAnchor?.query ?? query,
|
|
1105
|
+
fixedBlocks: [sessionBlock, cueHint].filter(Boolean).map((text) => `${text}\n\n`),
|
|
1106
|
+
...(memoryAnchor ? { leanReferenceTime: memoryAnchor.timestamp } : {}),
|
|
1107
|
+
}), INJECT_DEADLINE_MS, "", () => {
|
|
1100
1108
|
if (ownerCurrent()) surfaceWarning(ctx, `memory injection exceeded ${INJECT_DEADLINE_MS}ms and was skipped for this turn`);
|
|
1101
1109
|
});
|
|
1102
1110
|
} catch (err) {
|