Skip to content

v2: wire arch:check (safer-architecture-lsp) for the six v2 packages before Phase 3 #898

Description

@chughtapan

Deferred from #891 / PR #893 (Phase 2 scaffolding).

Problem

Every v1 package exposes an arch:check nx target running
safer-architecture-lsp check .. The six v2 packages expose only build and
lint, because scripts/gen-architecture-configs.mjs writes
safer-architecture.config.json only for packages/*, and
package.json → arch:config:check diffs only packages/*.

Consequence: the deep-module rules in docs/architecture/components.md
("Deep-module design rules" — public interfaces expose capabilities not
mechanisms, one canonical owner per cross-package flow, no pass-through
accessors) have zero mechanical enforcement on v2. Those are precisely the
constraints safer-architecture-lsp checks (maxPublicExports, facadeFiles,
folder child counts, layers).

This was correct to skip while the packages are empty skeletons — an empty
package passes trivially and the config would encode nothing. It stops being
correct the moment real code lands.

Fix recipe

  1. Extend scripts/gen-architecture-configs.mjs to emit
    v2/*/safer-architecture.config.json.
  2. Widen arch:config:check to diff v2/* as well as packages/*.
  3. Add the arch:check nx target to each v2 package.json, matching the v1
    shape.

Timing

Blocking before Phase 3 lands ported simulator code. Cheapest to do while the
packages are still empty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    v2Aligned input to the v2 track

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions