Skip to content

refactor(process): inject YNHCommandRunner into EditorRegistry + TerminalSessionManager (#273)#290

Merged
eyelock merged 1 commit into
developfrom
refactor/process-runner-273
May 5, 2026
Merged

refactor(process): inject YNHCommandRunner into EditorRegistry + TerminalSessionManager (#273)#290
eyelock merged 1 commit into
developfrom
refactor/process-runner-273

Conversation

@eyelock
Copy link
Copy Markdown
Owner

@eyelock eyelock commented May 5, 2026

Summary

Tests

  • `EditorRegistryTests` (5 tests): bundle-id short-circuit, success/empty/failure paths, exact args on captured invocations.
  • `TerminalSessionManagerTests`: smoke-test `sendTmuxCommand` no-ops with no session.

Closes #273.

Test plan

  • `make check` clean on a clean build
  • All new tests pass

🤖 Generated with Claude Code

…inalSessionManager (#273)

Two of the three direct `Process()` sites flagged in #273 fit the
existing `YNHCommandRunner` shape — single-shot fire-and-forget
subprocesses with no streaming, lifecycle, or pipe semantics:

- `EditorRegistry.which(_:)` — `/usr/bin/which <bin>`. `start()` and
  `detect()` become async; `start()` schedules the work on a Task so
  the AppDelegate caller stays sync.
- `TerminalSessionManager.sendTmuxCommand(_:to:)` — fire-and-forget
  `tmux <command> -t <session>`.

Both sites now take `commandRunner: any YNHCommandRunner` at init,
defaulting to `LiveYNHCommandRunner`. The protocol is mildly
misnamed for non-YNH callers but reusing it avoids cosmetic churn
across six existing files; renaming can come later if it grates.

The third site, `TmuxControlModeSession.connect()` (line 96), is
explicitly out of scope here — it needs the full Process lifecycle
plus Pipe/FileHandle streaming abstraction that #273 itself flagged
as a separate follow-on. Filed as #289.

Tests:
- New `EditorRegistryTests` (5 tests): bundle-id hit short-circuits
  `which`, success/empty/failure paths for the runner, exact args
  asserted on the captured invocations.
- `TerminalSessionManagerTests`: smoke-test that
  `sendTmuxCommand` no-ops cleanly when no session exists for the
  card. End-to-end happy-path for the runner is hard to drive
  without real session state and is left for #289's follow-up.

Closes #273

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@eyelock eyelock merged commit 4a956a7 into develop May 5, 2026
7 checks passed
@eyelock eyelock deleted the refactor/process-runner-273 branch May 5, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Testability: introduce ProcessRunner protocol for direct Process() instantiation

1 participant