/** * Live Hyperdrive / core length hints for `/proc/bare_os/replication` and * `metrics_live.replicationLive` (non-secret progress; not full per-peer throughput). * * @param {{ drive?: unknown, personalDrive?: unknown } | null | undefined} disk * @param {number} peerCount */ export function buildBareOsReplicationLiveSketch(disk, peerCount) { let systemCoreLength = null let personalCoreLength = null try { const c = disk && disk.drive && /** @type {{ core?: { length?: number } }} */ (disk.drive).core if (c && typeof c.length === 'number') systemCoreLength = c.length } catch { systemCoreLength = null } try { const c = disk && disk.personalDrive && /** @type {{ core?: { length?: number } }} */ (disk.personalDrive).core if (c && typeof c.length === 'number') personalCoreLength = c.length } catch { personalCoreLength = null } let auxiliaryDriveCount = 0 try { if (disk && Array.isArray(disk.auxiliaryDrives)) auxiliaryDriveCount = disk.auxiliaryDrives.length } catch { auxiliaryDriveCount = 0 } const stallHint = peerCount === 0 ? 'no_peers' : systemCoreLength == null ? 'length_unavailable' : 'ok' return { schema: 3, systemCoreLength, personalCoreLength, auxiliaryDriveCount, stallHint, corestoreSnapshotSurface: { schema: 1, operatorWorkflow: 'Pause or quiesce writers → replicate cores → export snapshot (corestore-snapshot style). Guest **`guestSuspendResume`** remains **ENOTSUP** unless the host registers Corestore suspend/resume hooks.', readOnly: true }, note: 'Schema 3 keeps schema 2 fields and adds corestoreSnapshotSurface (operator hints only). Append-only core lengths are non-secret progress hints — not a full telemetry plane.' } }