Binary catalog install/update paths (installBinary/replaceBinary) saved raw
plugin binaries into plugin_archives.archive_bytes, but startup preload opens
that column with zip.NewReader expecting a package containing manifest.json
and the plugin binary. Affected installs failed preload after restart with
"zip: not a valid zip file".
- Package manifest.json + binary into a validated zip before SaveArchive on
both binary install paths.
- Self-repair legacy rows in ArchiveCache.Ensure: when stored bytes are not a
zip but hash-match both the stored checksum and the stored manifest's
checksum, repackage and persist the repaired archive. A persist failure is
logged, not fatal — the in-memory archive is already valid and recovery
retries on the next preload.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>