Skip to content

Boundary lint: packages import only each other's public entry points #5

Done

Description

@kaiserarg
  • An ESLint rule (no-restricted-imports or a small custom rule) fails on @inspa/<pkg>/src/... and relative imports that cross a package folder.
  • Fix or list (on this ticket) the existing violations; existing ones may be allow-listed with a comment, new ones fail.

Touches: eslint.config.js.

Depends on #3

Refs: docs/architecture.md, docs/polish.md, CLAUDE.md.


Generated by Claude Code

Activity

  1. kaiserarg commented on Nov 28, 2026

    @kaiserarg
    ContributorAuthor

    Claimed by platform-20261128T0857-eng-1.


    Generated by Claude Code

  2. kaiserarg commented on Nov 28, 2026

    @kaiserarg
    ContributorAuthor

    Claimed by platform-20261128T0857-eng-2.


    Generated by Claude Code

  3. kaiserarg commented on Nov 28, 2026

    @kaiserarg
    ContributorAuthor

    PR #38 opened on agent/5-boundary-lint.


    Generated by Claude Code

  4. kaiserarg commented on Nov 28, 2026

    @kaiserarg
    ContributorAuthor

    Boundary rule in PR #38 (inspa/package-boundaries, scripts/eslint-boundaries.mjs). Here are the 16 existing violations. Each one is allow-listed as an exact { file, import } pair in BOUNDARY_ALLOW in eslint.config.js. Owners: delete the entry in the same PR that fixes the import. A test fails on any entry whose import is gone.

    e2e specs (feature lanes): they import CLI internals that inspa doesn't export.

    • e2e/proxy-hmr.spec.ts, e2e/proxy-webpack-hmr.spec.ts, e2e/runtime-source.spec.ts import ../packages/cli/src/proxy/index
    • e2e/selection-agent-loop.spec.ts, e2e/selection-stale-page.spec.ts, e2e/selection-sync.spec.ts import ../packages/cli/src/mcp/tools/selection

    examples (engine)

    • examples/invoices/vitest.config.ts imports ../../packages/vite-plugin/src/transform.js. It reads source so that tests run without a build. The public @inspa/vite-plugin/transform resolves to dist/.

    engine tests that cross between cli, vite-plugin and core

    • packages/cli/src/mcp/server.test.ts: ../../../vite-plugin/src/transform.js
    • packages/cli/src/proxy/react19/react19.test.ts: vite-plugin/src/overlay/runtime-source/react19/capture.js
    • packages/cli/src/proxy/webpack-runtime.test.ts: vite-plugin/src/overlay/runtime-source/bundled.js and .../react19/capture.js
    • packages/cli/test/components-api.integration.test.ts: ../../vite-plugin/src/transform.js
    • packages/core/src/source-resolve.test.ts: ../../vite-plugin/src/overlay/runtime-source/hash.js
    • packages/vite-plugin/src/overlay/runtime-source/react19/arguments.test.ts and engines.test.ts: cli/src/proxy/react19/runtime-uses.js
    • packages/vite-plugin/test/token-themes-parity.test.ts: ../../core/src/token-themes.js

    Most of these should disappear when @inspa/overlay, @inspa/daemon and @inspa/engine are split out (or when the shared pieces get a public export). No production code crosses a boundary: every violation is a test, a test config or an e2e spec.

    Note for the platform lane: when the Biome migration happens, this rule needs a replacement. Biome has no custom-rule API with this behaviour, so a small script check is one option.


    Generated by Claude Code

  5. kaiserarg commented on Nov 28, 2026

    @kaiserarg
    ContributorAuthor

    QA notes on PR #38 (platform-20261128T0857-qa-38):

    • Master doc check (ARCH-Today rule 3, ARCH-Target Choices): the master doc says no package imports another package's internals, which is what this rule enforces. It agrees with docs/architecture.md rule 3. The master doc's Choices table picks Biome over ESLint. docs/architecture.md says ESLint until the platform lane migrates, so this ESLint rule is the right call for now. When Biome lands, this check must be ported (the engineer already flagged that above).
    • Follow-up for the owners (not a blocker): packages/ui/protocolAlias.ts maps public subpaths (@inspa/core/naming, @inspa/vite-plugin/protocol, ...) onto other packages' src/ through new URL('../core/src/...') build aliases. That is not an import, so the rule doesn't see it. The aliases keep the public names, but they couple the ui build to core's and vite-plugin's source layout.
    • I couldn't spawn the architect agent: this QA session has no subagent tool. I did its checklist myself. Not a port PR. It adds no deep imports. Every path it touches is in platform paths (eslint.config.js, scripts/). It matches the doc.

    Generated by Claude Code

  6. kaiserarg commented on Nov 28, 2026

    @kaiserarg
    ContributorAuthor

    PR #38 merged.


    Generated by Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions