Dashboardopencode-loreEnforce fail-closed resource-safety inv…

Enforce fail-closed resource-safety invariants with regression tests

Category: preference
Confidence: 0.80
ID: 01a0af0d-426c-7a50-82b9-4b64efe083a6
Project ID: 6f4be9ff-ed84-4cca-a9e7-732a0b0b8677
Cross-project: No
Recalled in other projects: 0
Source session: 1JmtIdaVnn5PTPdxS
Created: 2026-09-17 09:44:06
Updated: 2026-09-17 11:07:56

Content

Treat 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.

Move to: