@agfpd/iapeer 0.4.12 → 0.4.13
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/cli/index.ts +10 -8
package/package.json
CHANGED
package/src/cli/index.ts
CHANGED
|
@@ -1545,10 +1545,13 @@ export async function runCli(argv: string[], env: NodeJS.ProcessEnv = process.en
|
|
|
1545
1545
|
} else if (warns.length > 0 && flags.json !== true) {
|
|
1546
1546
|
lines.push(`⚠ ${peer.personality}: ${warns.map(i => i.field).join(', ')}`)
|
|
1547
1547
|
}
|
|
1548
|
-
// Migration candidate: conformant
|
|
1549
|
-
//
|
|
1548
|
+
// Migration candidate (Phase-3): conformant AND still carrying the legacy `runtime` field —
|
|
1549
|
+
// a warn-fired legacy-only/diverged shape OR an in-sync mirror. In Phase-3 ANY `runtime`
|
|
1550
|
+
// field is stripped, so the candidate set is "has a runtime field", not just "warn fired"
|
|
1551
|
+
// (an in-sync mirror does not warn, but must still be cleaned). Errored profiles are NEVER
|
|
1550
1552
|
// rewritten — migration heals shape, it does not guess at broken data.
|
|
1551
|
-
|
|
1553
|
+
const hasLegacyRuntime = !!raw && typeof raw === 'object' && (raw as Record<string, unknown>).runtime !== undefined
|
|
1554
|
+
if (errs.length === 0 && (warns.some(i => i.field === 'default_runtime') || hasLegacyRuntime)) {
|
|
1552
1555
|
legacyRuntimeProfiles.push({ personality: peer.personality, cwd: peer.cwd })
|
|
1553
1556
|
}
|
|
1554
1557
|
}
|
|
@@ -1568,16 +1571,15 @@ export async function runCli(argv: string[], env: NodeJS.ProcessEnv = process.en
|
|
|
1568
1571
|
out(`\n${index.peers.length} peers · ${errors} error(s) · ${driftCount} index↔local drift(s)\n`)
|
|
1569
1572
|
}
|
|
1570
1573
|
if (flags.fix === true) {
|
|
1571
|
-
// Phase-
|
|
1572
|
-
//
|
|
1573
|
-
//
|
|
1574
|
-
// reindex so the healed index is projected from migrated locals.
|
|
1574
|
+
// Phase-3 data migration (default_runtime story complete): rewrite conformant local profiles
|
|
1575
|
+
// still carrying the legacy `runtime` field — the writer now emits ONLY `default_runtime` and
|
|
1576
|
+
// STRIPS the mirror. Runs BEFORE the reindex so the healed index is projected from clean locals.
|
|
1575
1577
|
const migrated: string[] = []
|
|
1576
1578
|
for (const p of legacyRuntimeProfiles) {
|
|
1577
1579
|
if (migrateProfileRuntimeField(p.cwd)) migrated.push(p.personality)
|
|
1578
1580
|
}
|
|
1579
1581
|
if (migrated.length > 0) {
|
|
1580
|
-
out(`
|
|
1582
|
+
out(`stripped legacy \`runtime\` mirror (default_runtime only): ${migrated.join(', ')}\n`)
|
|
1581
1583
|
}
|
|
1582
1584
|
if (driftCount > 0 || errors === 0) {
|
|
1583
1585
|
const { healed, missing } = await reindexFromLocals({ env })
|