You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(delegation): per-test sandbox for the budget registry via instance injection #1162
From PR #1157 review (uf-divisor, review 5918987253, comment 4584957936) — LOW severity, deferred from the feedback run by severity scope.
Finding
.opencode/test/delegation-budget.test.ts:42 (and the per-task suites in unleash-delegate.test.ts / uf-workflow.test.ts) register and clear delegation budgets on the module-global globalThis registry (registerDeadline / unregisterDeadline). Tests mutate shared singleton state and rely on afterEach cleanup for isolation, so ordering or interruption can leak registry entries across tests — a parallel or interrupted run can observe a stale budget.
Suggestion
Inject a per-test registry instance (dependency injection of the registry — the same seam pattern the capture readers already use) so each test owns its registry and no cross-test ordering dependence exists.
Context
The current afterEach(() => unregisterDeadline(...)) cleanup guards the leak in practice; this is hardening of the test isolation pattern, not a correctness bug in production code.
Severity LOW per the review; not changed in the feedback run (code scope reserved for CRITICAL/HIGH).
Filed from /uf.address-feedback 1157 triage (Item 3, decision: file).
Activity