@agfpd/iapeer-memory 0.1.4 → 0.1.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/package.json +2 -2
- package/src/templates/index.ts +23 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agfpd/iapeer-memory",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "iapeer-memory — peer memory for the iapeer ecosystem: vault, memoryd (index/search/MCP-http), layer-5 context fragments, role doctrines. The package IS the system; the claude/codex plugins are thin session sockets (docs/10-distribution.md, ADR-009).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@agfpd/iapeer-memory-core": "0.1.
|
|
30
|
+
"@agfpd/iapeer-memory-core": "0.1.5"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/bun": "^1.2.0",
|
package/src/templates/index.ts
CHANGED
|
@@ -44,22 +44,36 @@ export function rolePersonality(role: RoleName): string {
|
|
|
44
44
|
return role;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
/** The distinctive phrase of the CORE's create-scaffold placeholder (fact:
|
|
48
|
+
* iapeer src/init/index.ts — `iapeer create` writes a 6-line IAPEER.md
|
|
49
|
+
* that literally says to replace it). Live-caught at the B-init 10.06:
|
|
50
|
+
* the guard's first form read the scaffold as «foreign» and false-failed
|
|
51
|
+
* on freshly created role peers. */
|
|
52
|
+
const CORE_SCAFFOLD_PHRASE = "An empty doctrine launches a bare peer";
|
|
53
|
+
|
|
47
54
|
/**
|
|
48
55
|
* Who owns a peer's rendered doctrine — the init COLLISION GUARD's eye.
|
|
49
|
-
* "ours" = carries the ADR-010 marker
|
|
50
|
-
*
|
|
51
|
-
*
|
|
56
|
+
* "ours" = carries the ADR-010 marker (re-init/update path);
|
|
57
|
+
* "scaffold" = the core's create-placeholder or an empty file — REPLACEABLE
|
|
58
|
+
* by design (the scaffold itself says «Replace this»);
|
|
59
|
+
* "foreign" = somebody else's LIVE doctrine (rendering over it would hijack
|
|
60
|
+
* the peer — FAIL loud; the MergeMind-Index precedent is sacred);
|
|
61
|
+
* "none" = no doctrine file, ours to render.
|
|
52
62
|
*/
|
|
53
|
-
export function doctrineOwnership(
|
|
63
|
+
export function doctrineOwnership(
|
|
64
|
+
peerCwd: string,
|
|
65
|
+
): "ours" | "foreign" | "scaffold" | "none" {
|
|
66
|
+
let current: string;
|
|
54
67
|
try {
|
|
55
|
-
|
|
56
|
-
path.join(peerCwd, ".iapeer", "IAPEER.md"),
|
|
57
|
-
"utf-8",
|
|
58
|
-
);
|
|
59
|
-
return current.includes("<!-- iapeer-memory doctrine") ? "ours" : "foreign";
|
|
68
|
+
current = fs.readFileSync(path.join(peerCwd, ".iapeer", "IAPEER.md"), "utf-8");
|
|
60
69
|
} catch {
|
|
61
70
|
return "none";
|
|
62
71
|
}
|
|
72
|
+
if (current.includes("<!-- iapeer-memory doctrine")) return "ours";
|
|
73
|
+
if (current.includes(CORE_SCAFFOLD_PHRASE) || current.trim() === "") {
|
|
74
|
+
return "scaffold";
|
|
75
|
+
}
|
|
76
|
+
return "foreign";
|
|
63
77
|
}
|
|
64
78
|
|
|
65
79
|
const ROLES: Record<LocaleId, Record<RoleName, string>> = {
|