Dashboard › opencode-lore › Enforce fail-closed resource-safety inv…
01a0af0d-426c-7a50-82b9-4b64efe083a6Treat embedding memory, worker lifecycle, and recovery behavior as correctness-critical. Encode requirements as explicit “never” invariants: never exceed live container/runtime headroom, retry a known-bad cap, let stale worker events affect replacements, lose pending requests, or allow telemetry and cleanup failures to disrupt normal embedding paths. Cover OOM backoff, terminal floor behavior, respawn failures, restart persistence, constrained-memory precedence, and async rejection handling with deterministic fake workers and injectable seams. Write regression tests first, verify they fail without the guard and pass with it, snapshot mutable payloads, attach rejection handlers immediately, and fully restore environment variables, provider state, memory overrides, worker factories, and database state after each test.