Move the GitHubHookDoctor binder out of core/model/ #430

Open
opened 2026-08-21 13:44:23 +00:00 by mph · 0 comments
Owner

Problem

core/CLAUDE.md:24 states that model/ takes no imports from adapters/,
output/ or dashboard/
. One file still breaks it:

core/model/GitHubHookDoctor.scala:5
import iw.core.adapters.{GitHubClient, CommandRunner}

The cause is the same one fixed in TerminalWorkspaceChecks (commit 45c3b02):
a pure decision and its impure binder live in the same file, so the binder's
dependency on adapters/ is charged to model/.

Fix

Split the same way. Keep the pure verdict in core/model/, taking its process
probe and client as injected parameters. Move the binder to
commands/github.hook-doctor.scala, which is where the checks are already
assembled and which may import adapters/.

commands/github.hook-doctor.scala currently reads:

val ghCliCheck: Check = Check("gh CLI", CoreGitHubHookDoctor.checkGhInstalled)
val ghAuthCheck: Check =
  Check("gh auth", CoreGitHubHookDoctor.checkGhAuthenticated)

Both would bind explicitly, as start.hook-doctor.scala now does.

Acceptance

rg 'import iw\.core\.(adapters|output|commands)' core/model/ returns nothing.

Origin

Found while triaging LESSONS.md for IW-422. Review finding W11 flagged the same
violation in TerminalWorkspaceChecks and accepted it because this file had set
the precedent. That file is now fixed, so this is the last instance and the rule
can be enforced again.

## Problem `core/CLAUDE.md:24` states that `model/` takes **no imports from `adapters/`, `output/` or `dashboard/`**. One file still breaks it: core/model/GitHubHookDoctor.scala:5 import iw.core.adapters.{GitHubClient, CommandRunner} The cause is the same one fixed in `TerminalWorkspaceChecks` (commit 45c3b02): a pure decision and its impure binder live in the same file, so the binder's dependency on `adapters/` is charged to `model/`. ## Fix Split the same way. Keep the pure verdict in `core/model/`, taking its process probe and client as injected parameters. Move the binder to `commands/github.hook-doctor.scala`, which is where the checks are already assembled and which may import `adapters/`. `commands/github.hook-doctor.scala` currently reads: ```scala val ghCliCheck: Check = Check("gh CLI", CoreGitHubHookDoctor.checkGhInstalled) val ghAuthCheck: Check = Check("gh auth", CoreGitHubHookDoctor.checkGhAuthenticated) ``` Both would bind explicitly, as `start.hook-doctor.scala` now does. ## Acceptance `rg 'import iw\.core\.(adapters|output|commands)' core/model/` returns nothing. ## Origin Found while triaging LESSONS.md for IW-422. Review finding W11 flagged the same violation in `TerminalWorkspaceChecks` and accepted it because this file had set the precedent. That file is now fixed, so this is the last instance and the rule can be enforced again.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/iw-cli#430
No description provided.