refactor(cli): convert debug subcommands to effectCmd#25479
Merged
kitlangton merged 1 commit intodevfrom May 2, 2026
Merged
Conversation
Convert 6 debug commands (and 17 of their subcommands) from cmd() + bootstrap() to effectCmd + Effect.ensuring(store.dispose(ctx)). Files: - debug/config.ts - debug/skill.ts - debug/snapshot.ts (3 subcommands) - debug/lsp.ts (3 subcommands) - debug/ripgrep.ts (3 subcommands) - debug/file.ts (5 subcommands) The parent group commands (snapshot/lsp/rg/file) stay on cmd() since they just dispatch to subcommands and don't run any handler logic. Service calls with typed errors (Ripgrep.tree/files/search) now use Effect.orDie to satisfy effectCmd's E=CliError handler signature. Instance.directory references switched to ctx.directory from InstanceRef.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Batch-convert 6 debug commands (17 subcommands total) from `cmd()` + `bootstrap()` to `effectCmd` + `Effect.ensuring(store.dispose(ctx))`.
Files:
The parent group commands (snapshot/lsp/rg/file) stay on `cmd()` since they only dispatch to subcommands and don't run handler logic.
Behavioral notes (two parallel subagent purity audits)
Both reviews verdict: BEHAVIORALLY EQUIVALENT for success and ordinary failure paths; STRICTLY SAFER under interruption (Effect.ensuring covers it; legacy try/finally didn't).
Real semantic deltas (consistent with established `models.ts` precedent):
Followup (not in this PR)
Both agents flagged the 14× repeated `const ctx = yield* InstanceRef; if (!ctx) return; const store = yield* InstanceStore.Service; return yield* body.pipe(Effect.ensuring(store.dispose(ctx)))` boilerplate. Strong suggestion: fold `Effect.ensuring(store.dispose(ctx))` into `effectCmd` itself so per-command disposal is automatic. Worth a separate PR before this pattern spreads further.
Test plan