{"content":"fix: cross-device chain restore survives a device that already has a Twin (6ff3f633)\n\nAudit finding, P0. Every restore-capable device already holds a Twin before a mnemonic import is possible (welcome flow creates one; with none, the skeleton restore's ensureTwinExists promotes the first restored bot), so promoting the backup's Twin threw TWIN_ALREADY_EXISTS, escaped runChainBackupRestore, and aborted the entire restore before the import phase — the standard new-device flow was dead on arrival, and the existing restore test never caught it because its target store had no pre-existing Twin.\n\nFix: the backup's Twin (real persona + memories) wins. Twin finalization catches TWIN_ALREADY_EXISTS, demotes the local placeholder Twin(s) via the now-public demoteOtherTwins, and retries; unexpected failures land in result.error instead of escaping. A name-conflict pre-pass also runs before skeleton restore: the welcome pool draws from 60 placeholder names so same-name collisions are realistic, and a collision used to fail the bot's whole skeleton with NAME_DUPLICATE — the incoming on-chain name wins, the local bot gets a ' (local)' suffix (backup-set bots matched by globalmetaid are never renamed).\n\nNew test: placeholder Twin + name collision restore successfully; exactly one Twin remains (the backup's); placeholder demoted to worker and renamed; Twin memories land on the promoted Twin. chainBackupRestore suite 6/6 green.","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}