Add buffer compression helpers, an envelope codec, and a legacy package-cache decoder. Hoist package
cache reads into the base backend so file, Redis, and SQLite share format detection, legacy
fallback, and corrupt-entry handling while preserving existing write formats.