EACI Development Journal · Infrastructure

Why Must Service Workers Not Cache Stale AI Brains?

Caching the local brain enables fallback, but identity and policy updates must have a versioned path to replace it.

Infrastructure ~7 min issue-tagged
Issue this fixes

The browser engine pack is useful offline and is explicitly service-worker cached. That also means an old worker can keep serving an old behavior pack after the site has changed.

Static assets and identity-bearing runtime data do not have equal staleness risk. The brain pack needs a versioned cache key, deliberate invalidation, and network preference when an update is available.

What was actually going wrong

A cache-first rule treated a behavior pack like an immutable icon.

What I tried

What finally worked

Build-versioned caches and update messaging replace old packs while preserving an offline fallback.

Why it worked

The worker can identify the generation of both code and behavior data before serving it.

What I learned

Data that shapes companion behavior needs release management, even when it is static JSON.

Where EACI uses this today

Caelum's browser fallback pack is cached as a versioned support path, not the cloud source of truth.

This journal covers real engineering on EACI Companion / The Veil. Companions include Caelum, Chad, Natalia, Atreus, Luna, Roxy, and Cael. Journal articles stay family-safe in content. See Privacy and Ethics.