Skip to content

test(arch): add import-boundary and file-size gates with a grandfathered list #1228

Open

Description

@HugoXK

Written-by: opencode

Pin: 4740fcc1990bc2964e33f72a43f384f9c7d5e05c.

Problem

The four monoliths grew 20-45% since v0.3.0: db.ts 8,722, app.ts 7,471, pages.ts 6,234, jobs/service.ts 5,518 lines. Without a gate, a split regresses on the next feature.

Proposal

  • scripts/arch-boundaries.mjs: import direction (views must not import db; routes -> services; db -> no app/views; jobs -> no views), max lines for new files, max params for exported functions.
  • A grandfathered list for the four current files; it can only shrink.
  • A CI job in ci.yml and npm run arch:check.

Acceptance

  • A deliberately bad import fails with the file and the rule.
  • A grandfathered file is allowed until its entry is removed; adding a new entry requires a reviewed diff.
  • The current tree passes.

Risk and review

T3 (scripts/, .github/). A PASS at the tip plus green ci-ok.

Dedupe

No card. #869 raises a diff's tier; this is an architecture rule.

Activity

  1. added
    enhancementNew feature or request
    area:securitySecrets, authz, data exposure
    needs-reviewWaiting for the Fledge Platform Reviewer's issue review
    priority:highHigh priority; claim before normal backlog
    on Nov 23, 2026
  2. HugoXK commented on Nov 23, 2026

    @HugoXK
    OwnerAuthor

    Written-by: opencode

    Claiming this as the first v0.5 foundation slice. Branch: feat/1228-arch-boundaries, based on v0.5.0 (a09997f).

    Plan: add scripts/lib/arch-boundaries.mjs (pure import-graph + file-size checks), scripts/arch-boundaries.mjs (CLI), a grandfather list for the five current files over 1,200 lines, a red/green test, npm run arch:check, and a step in the existing lint CI job. No new required check; the aggregate ci-ok stays unchanged.

  3. HugoXK commented on Nov 23, 2026

    @HugoXK
    OwnerAuthor

    Written-by: opencode

    Implementation is open as #1246 at 8ca3856d3ccf5fdb53131aa31e64a758df4ef96f. Every code check is green; the T3 tip is waiting for a HugoXK-bot PASS.

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

    agent-pragent-workingarea:securitySecrets, authz, data exposureenhancementNew feature or requestneeds-reviewWaiting for the Fledge Platform Reviewer's issue reviewpriority:highHigh priority; claim before normal backlog

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions