Finding
Two lower-frequency resource/error-boundary gaps were found while tracing Effect beta.100:
- The isolated query Worker is created and initialized before its close finalizer is registered. Interruption during initialization can leave an unowned Worker in a long-lived embedding runtime.
- Broad catchCause handlers translate typed failures, defects, and interruption into ordinary availability errors, hiding cancellation and programmer defects.
Normal CLI signal handling exits the process, so this is lower priority than the SQLite failure-channel issue. It still weakens the documented scoped-ownership model.
Analysis chain
- Architecture docs say Scopes own workers, listeners, SQLite clients, and signals.
- I traced acquisition/finalizer ordering for query workers.
- Query initialization can create a Worker before Scope cleanup is registered.
- Effect beta.100 tryPromise gives cancellation signaling only when its callback accepts a signal; this zero-argument initializer does not.
- Interruption in that window can abandon transport ownership.
- I traced broad catchCause boundaries and confirmed they include failure, defect, and interruption.
- Those categories are collapsed into generic availability failures, reducing diagnostic fidelity.
Evidence
Version-matched Effect 4.0.0-beta.100:
- effect/src/internal/effect.ts:1043-1118 creates an AbortController only when tryPromise accepts a signal.
- effect/src/Effect.ts:3212-3228 defines catchCause across typed failure, defect, and interruption.
Practical scope:
- Ordinary CLI shutdown exits the process and kills the Worker.
- Programmatic cancellation, tests, or future long-lived embedding can retain it.
- Broad cause translation already weakens ordinary startup diagnostics.
Fix suggestion
- Acquire query transport with acquireRelease or register close immediately before initialization.
- Make initialize explicitly cancellable and dispose partial Worker state on abort.
- Translate expected errors with typed handlers.
- Preserve interruption identity.
- Preserve/log original Causes for recognized environmental defects.
- Re-defect on unexpected invariants rather than reporting ordinary unavailability.
- Keep user messages concise while retaining internal diagnostic causes.
Acceptance criteria
Blocked by
None — can start immediately.
Audit context
This intentionally groups the two lower-priority scoped ownership/cause-translation observations; the higher-impact SQLite defect channel is tracked separately.
Finding
Two lower-frequency resource/error-boundary gaps were found while tracing Effect beta.100:
Normal CLI signal handling exits the process, so this is lower priority than the SQLite failure-channel issue. It still weakens the documented scoped-ownership model.
Analysis chain
Evidence
Version-matched Effect 4.0.0-beta.100:
Practical scope:
Fix suggestion
Acceptance criteria
Blocked by
None — can start immediately.
Audit context
This intentionally groups the two lower-priority scoped ownership/cause-translation observations; the higher-impact SQLite defect channel is tracked separately.