@agfpd/iapeer 0.4.10 → 0.4.11
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 +1 -1
- package/src/identity/index.ts +13 -8
package/package.json
CHANGED
package/src/identity/index.ts
CHANGED
|
@@ -213,8 +213,11 @@ export function readPeerProfile(cwd: string = process.cwd()): PeerProfile | null
|
|
|
213
213
|
// the `iapeer init --personality` override (a deliberately-named peer in a folder
|
|
214
214
|
// whose basename differs), so the heal stays a flagged drift, not a silent rewrite.
|
|
215
215
|
const personality = validatePersonality(obj.personality, 'peer-profile personality')
|
|
216
|
-
// default_runtime is the contract field name (the routing/wake/first-launch default)
|
|
217
|
-
//
|
|
216
|
+
// default_runtime is the contract field name (the routing/wake/first-launch default). Phase-3:
|
|
217
|
+
// foundation no longer WRITES the legacy `runtime` mirror (see writePeerProfileAtomic), but the
|
|
218
|
+
// read-fallback is KEPT as a dormant defensive net — it tolerates a legacy-shaped profile (restored
|
|
219
|
+
// backup / hand-edit) at a 1-token cost. All real writers emit default_runtime (foundation +
|
|
220
|
+
// telegram-runtime 0.19.4). Consistent with the registry read-fallback (§3 defensive keep).
|
|
218
221
|
const runtime = validateRuntime(obj.default_runtime ?? obj.runtime, 'peer-profile default_runtime')
|
|
219
222
|
const interfaces = normalizeInterfaces(obj.interfaces, `${IAPEER_DIR}/${PEER_PROFILE_FILE}`)
|
|
220
223
|
const intelligence = normalizeIntelligence(obj.intelligence, runtime)
|
|
@@ -292,18 +295,20 @@ export function writePeerProfileAtomic(cwd: string, profile: PeerProfileWrite):
|
|
|
292
295
|
const merged: Record<string, unknown> = {
|
|
293
296
|
...existing,
|
|
294
297
|
personality: profile.personality,
|
|
295
|
-
// Phase-
|
|
296
|
-
//
|
|
297
|
-
//
|
|
298
|
-
// Spawned-Peer, external scripts) stay alive with zero blast radius. Phase 3
|
|
299
|
-
// (gated on every reader shipping dual-read) removes the mirror.
|
|
298
|
+
// Phase-3 (default_runtime migration complete): emit ONLY the contract field `default_runtime` —
|
|
299
|
+
// the legacy `runtime` mirror is removed. All readers switched: telegram-runtime 0.19.4 reads
|
|
300
|
+
// default_runtime and no longer re-seeds the mirror on mutation; foundation reads default_runtime.
|
|
300
301
|
default_runtime: profile.runtime,
|
|
301
|
-
runtime: profile.runtime,
|
|
302
302
|
runtimes: profile.runtimes,
|
|
303
303
|
description,
|
|
304
304
|
intelligence,
|
|
305
305
|
...(profile.interfaces ? { interfaces: profile.interfaces } : {}),
|
|
306
306
|
}
|
|
307
|
+
// Phase-3: actively STRIP the legacy `runtime` mirror — it is a CONTRACT field superseded by
|
|
308
|
+
// default_runtime (not an owner field to preserve via `...existing`). This removes a lingering mirror
|
|
309
|
+
// on the next write of any already-migrated profile AND heals a diverged `runtime` (default_runtime
|
|
310
|
+
// governs). Owner sections (initial_prompt, wake_policy, expansion, notifier, …) stay preserved.
|
|
311
|
+
delete merged.runtime
|
|
307
312
|
// C2 — initial_prompt: an explicit value in the write wins; otherwise the existing
|
|
308
313
|
// on-disk value is preserved verbatim by `...existing` (a caller that doesn't own
|
|
309
314
|
// it never wipes it). Only a non-empty string sets it.
|