PR #97's auditStorage enumerated reachable cores per group via base
state, but peer writer cores have no namespace alias and only appear in
base.activeWriters while the base is open. Migrated source bases (left
dormant during the grace period) and any not-yet-loaded base meant a
sweep could misclassify those cores as orphans and delete them — leading
to autobase apply crashing with null view.ref on next launch (SIGABRT).
Fixes:
- Durable knownWriter:{groupId}:{writerHex} index. Populated from
base.activeWriters at joinGroup and from every writer-announce we
receive (regardless of role). Audit and purgeMigratedGroup consult it
to recover discovery keys for cores that aren't currently reachable
via an open base.
- At startup, skip joining migrated source groups whose target group
exists locally. Re-opening their base is unnecessary post-adopt and
can crash apply when their writer cores were already swept.
- Patch autobase 7.25.1 to guard null view.ref / view.core in
_signUserViewCores, _startTrace, _endTrace, and the view download
loop. Generated via patch-package; reapplied automatically on
npm install.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>