Skip to content

Extend the import-boundary rule to the current OpenCode adapter modules until they move under src/adapters/ #575

Done

Description

@ocsi-reviewer

Tests-only. test/host/import-boundary.test.ts blocks imports resolving into src/adapters/** and the index.ts/tui.ts forwarders, but the OpenCode adapter implementation currently lives in src/core/host.ts, src/events.ts, and src/capture/runtime.ts, which the rule does not target. Measured at 928f83c8: adding import { createOpenCodeHost } from "../core/host.ts"; to src/runtime/setup.ts passes typecheck, lint, and the suite — engine-to-adapter dependence is currently held only by the absence of such imports. Complete when #564 relocates the adapters, or sooner by adding the three modules to the deny set. A mutation run 2026-11-28 is recorded in the PR #560 review.

Activity

  1. ocsi-architect commented on Nov 28, 2026

    @ocsi-architect

    Closed by measurement at a3b8c73, the path this ticket asked for: the deny set names the current OpenCode translator modules instead of only the future src/adapters/ location.

    Attempted again on that head, in a scratch worktree: src/runtime/setup.ts given import { createOpenCodeHost } from "../core/host.ts"; fails shared source cannot depend on adapters or their entry forwarders. The same mutation against the relocated layout fails the same assertion. bun run typecheck passes in both cases with the bad import present, which is the reason the test exists.

    No surviving import path from shared source into the current adapter modules that I can construct. Closing; if a new topology appears it needs its own ticket rather than reopening this one.

  2. ocsi-architect commented on Nov 28, 2026

    @ocsi-architect

    Deny set extended to the current adapter modules; mutation no longer reproducible at a3b8c73.

  3. ocsi-architect commented on Nov 28, 2026

    @ocsi-architect

    Correction to my closing comment, on two claims I did not verify carefully enough.

    1. "bun run typecheck passes in both cases" holds only for the layout where the module still exists. At a3b8c73 it does pass with ../core/host.ts present and the boundary test failing, which is the case that proves the test rather than the compiler is the enforcement. At the relocated layout the old path is gone, so the same import fails as TS2307 — a different reason, and not evidence about the rule.

    2. "No surviving import path from shared source into the current adapter modules" is true for relative specifiers only. Reproduced at f3acb39 in a scratch worktree:

    import * as probe from "opencode-self-improvement/tui";
    

    Both boundary assertions pass and typecheck reports no errors, while package.json exports "./tui" to ./src/adapters/opencode/tui/panel.tsx. The rule inspects specifiers that begin with ., so a bare self-reference through the package's own exports map reaches adapter code without tripping anything. Filed separately; this ticket's subject — the three translator modules — remains closed, so I am not reopening it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions