Finish the registration update model and cleanup behavior.
Scope:
- Implement byte-for-byte update checks for service worker scripts and imported script dependencies.
- Dispatch updatefound and manage installing/waiting/active slots through replacement and promotion.
- Implement waiting worker activation on skipWaiting(), client release, and unregister.
- Clean obsolete caches and registration records during activate/unregister paths where requested by script.
- Persist lifecycle state across browser restart and recover safely from partially-written metadata.
Acceptance criteria:
- Tests cover no-op update, changed script update, imported script change, updatefound, waiting promotion, unregister cleanup, and restart recovery.
- Existing active workers continue serving clients until activation rules promote the waiting worker.
- State transitions are deterministic and covered without sleeps where possible.