Skip to content

Lint does not enforce index.ts boundaries for cleanup/, routing/, warm-pool/ and contract/ helpers #445

Closed

Description

@V3RON

What happens

Architecture rule 14 says pnpm lint enforces that no file outside a directory component imports past its index.ts. .oxlintrc.json has no pattern for src/core/cleanup/, src/gateway/routing/ or src/core/warm-pool/, so a new reach-in such as ./cleanup/types.js from src/core/reaper.ts passes lint.

Also, older imports reach past src/contract/index.ts to contract/os-range.js / contract/duration.js (src/core/domain.ts:1, src/core/doctor.ts:2, src/leasing/lease-acquisition-coordinator.ts:8, src/gateway/routing/request-match.ts:7, src/cli/index.ts:60), and lint does not catch them.

Expected

Lint fails a reach-in into any directory component that has an index.ts.

Found in review of PR #444 (notes, not blocking there).

Written by an agent.

Activity

  1. added
    bug:new
    and removed
    bug:new
    on Oct 10, 2026
  2. self-assigned this
    on Oct 16, 2026
  3. V3RON commented on Oct 16, 2026

    @V3RON
    ContributorAuthor

    Reproduction

    ADR 0027 already guards the four reported components. Seven contract helper reach-ins remain grandfathered. The new assertion proposes retiring those exemptions.

    pnpm exec vitest run --project unit src/lint-rules.test.ts
    70 passed; 1 failed:
    imports OS range and duration helpers through the contract index across the repo
    Expected []; received 7 past-index violations:
    CLI and HTTP -> contract/duration.ts
    core/domain, core/doctor, core/warm-pool/config,
    gateway/routing/request-match, leasing/lease-acquisition-coordinator
    -> contract/os-range.ts
    

    The same file's new cleanup/routing/warm-pool/contract fixture passes, proving the original missing-pattern defect is fixed.

    Root cause

    Gap: ADR 0027 intentionally preserved existing breaches. .dependency-cruiser-known-violations.json:38 and its six other helper entries suppress them under lint's --ignore-known. src/contract/index.ts:1–9 exports neither helper, and src/contract/AGENTS.md:5 explicitly directs callers to private files. This is remaining boundary cleanup, not a missing discovery rule.

    Simplest fix

    Export the existing OS range and duration helpers through the contract index. Route their seven consumers through that index, remove the seven corresponding exemptions, and correct the contract manual. Keep dynamic component discovery and unrelated exemptions unchanged. Include the reproduction test from bug/445-repro.

    Alternatives rejected

    • Add oxlint path patterns: duplicates the dependency-cruiser rule and restores manual enumeration.
    • Remove exemptions alone: existing imports would fail lint.
    • Clear the entire baseline: unrelated to this issue.

    Risk

    • Barrel imports can expose runtime initialization cycles; check core/domain and leasing consumers.
    • Keep exported helper behavior and wire schemas unchanged.
    • Keep only unrelated entries in the grandfathered baseline.

    Written by an agent.

  4. removed their assignment
    on Oct 16, 2026
  5. added
    bug:ready
    and removed on Oct 16, 2026
  6. assigned and unassigned on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug:ready

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions