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

Open
opened 2026-08-21 13:44:23 +00:00 by mph · 3 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.
Member

Intake: agent-ready
Workflow: waterfall
Reason: all gates passed
Analysis: project-management/issues/IW-430/analysis.md on branch IW-430

Intake: agent-ready Workflow: waterfall Reason: all gates passed Analysis: project-management/issues/IW-430/analysis.md on branch IW-430
Member

Implement: needs-human
Reason: batch-implement exit 1 — the kanon plugin does not compile against the iw-cli core of current main. fetchPullRequestForBranch now returns Either[TrackerError, …] (#778), and ForgeCatchUp.scala in the kanon plugin still expects Either[String, …]. No phase ran, and no batch-implement.log was written. The cause is in the plugin, not in this issue: update the kanon plugin to the current core, then release this issue to agent-ready again.

[error] /home/mph/.local/share/iw/plugins/kanon/lib/batch/ForgeCatchUp.scala:143:7
[error] Found:    Either[iw.core.model.TrackerError, Option[batch.ForgeState]]
[error] Required: Either[String, Option[batch.ForgeState]]
Compilation failed
Implement: needs-human Reason: batch-implement exit 1 — the kanon plugin does not compile against the iw-cli core of current main. `fetchPullRequestForBranch` now returns `Either[TrackerError, …]` (#778), and `ForgeCatchUp.scala` in the kanon plugin still expects `Either[String, …]`. No phase ran, and no batch-implement.log was written. The cause is in the plugin, not in this issue: update the kanon plugin to the current core, then release this issue to `agent-ready` again. ``` [error] /home/mph/.local/share/iw/plugins/kanon/lib/batch/ForgeCatchUp.scala:143:7 [error] Found: Either[iw.core.model.TrackerError, Option[batch.ForgeState]] [error] Required: Either[String, Option[batch.ForgeState]] Compilation failed ```
Member

Release: the implement loop failed this issue for a reason outside it. The kanon plugin did not compile against iw-cli main, because the tracker port now returns TrackerError (iw-cli #778). The plugin fix is dev-docs #484, and iw-cli 0.22.1 carries the core change. The issue goes back to the implement loop.

Release: the implement loop failed this issue for a reason outside it. The kanon plugin did not compile against iw-cli main, because the tracker port now returns TrackerError (iw-cli #778). The plugin fix is dev-docs #484, and iw-cli 0.22.1 carries the core change. The issue goes back to the implement loop.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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.