@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agfpd/iapeer",
3
- "version": "0.4.10",
3
+ "version": "0.4.11",
4
4
  "description": "Foundation core for the iapeer multi-agent ecosystem: identity, registry, storage, codec.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "agfpd",
@@ -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
- // `runtime` is the legacy field. Dual-read accepts both during the staged migration.
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-2 write-flip (contract Идентичность, staged default_runtime migration):
296
- // emit the contract field `default_runtime` AND keep the legacy `runtime` as an
297
- // IN-SYNC MIRROR — readers that still read `runtime` only (IAP peers.ts,
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.