Skip to content

feat(gritlint): add the cell-architecture pack - #701

Merged
ryanleecode merged 1 commit into
mainfrom
feat/gritlint-cell-architecture
Oct 9, 2026
Merged

ryanleecode merged 1 commit into
mainfrom
feat/gritlint-cell-architecture

Conversation

@systemfsoftware-maker

@systemfsoftware-maker systemfsoftware-maker commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A repository can now enable "cell-architecture": {} in gritlint.json and get a failing check whenever a *.service.ts module builds a Layer. That turns compound-packs/cell-architecture/ports-separate-from-layers.md from a review note into a gate: importing a port no longer risks importing its driver.

The rule, service-exports-no-layer, refuses a Layer.* call, a class field named layer or *Layer, and an export named *Live in a service module. Layer types (Layer.Layer<...>) and Layers in other modules pass.

Fixtures

Refused (bad) Passes (good)
static layer member on the tag port only
tagless exported Layer Layer in src/drivers/
*Live alias Layer.Layer type alias
Layer factory function *Live Layer in a non-service sibling module
aliased static field
Layer in one service module beside a clean port in the same directory

Design decisions

  • Multifile, so only service modules are parsed. A single-file rule parses every module of the language, and the pinned TypeScript grammar fails on two generic call signatures separated only by a newline (dual overloads). In one consumer workspace, 10 of 769 TypeScript files hit that, so a single-file rule would stop the scan on modules it never grades.
  • The cost of multifile is the finding's location. gritlint reports a multifile match against the first file of its directory batch. When several *.service.ts modules share a directory, the finding names the alphabetically first of them at line 1, not the module holding the Layer. The verdict is exact. The pack README records this and the grammar gap.

Validation

  • gritlint test packs: 58 cases pass, including the 10 above.
  • With the *.service.ts filter removed from the rule, the good cases fail, so the fixtures catch a scope regression.
  • gritlint schema matches npm/gritlint/configuration_schema.json.

CONST-E7 declaration: the author of this rule is also refactoring a consumer repository that the rule will grade. It lands here through this repository's own review, not through the consumer's.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Adds packs/cell-architecture with one rule, service-exports-no-layer: a
*.service.ts module makes no Layer.* call, declares no class field named
layer or *Layer, and exports no *Live name, as
compound-packs/cell-architecture/ports-separate-from-layers.md requires.

Six bad fixtures are refused: a static layer member, a tagless exported
Layer, a *Live alias, a Layer factory, an aliased static field, and a Layer
in one service module beside a clean port in the same directory. Four good
fixtures pass: a port alone, a Layer in a driver module, a Layer.Layer type
alias, and a *Live Layer in a non-service sibling module.

The rule is multifile so that gritlint parses only *.service.ts modules. A
multifile match is reported against the first file of its directory batch,
so the finding names the first service module in the directory; the README
records this and the TypeScript grammar gap that stops a scan on two generic
call signatures separated only by a newline.

CONST-E7 declaration: the author of this rule is also refactoring a consumer
repository that the rule will grade. It lands here through this repository's
own review, not through the consumer's.
systemfsoftware-maker added a commit to systemfsoftware/stryker-js-effect that referenced this pull request Oct 9, 2026
…cture gritlint pack

lint:conventions now fails when a *.service.ts module makes a Layer.* call, declares a layer or *Layer class field, or exports a *Live name (ADR-0002). The systemfsoftware input is locked to the head of systemfsoftware/systemfsoftware#701, which adds the pack; it moves to the merge commit on main before this lands.

@ryanleecode ryanleecode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified at b2c5078: gritlint sandboxed journey, rust gate, static checks and flake outputs green. Only red is the effect-daemon-microvm / microsandbox Docker Hub 'Not authorized' failure, identical on main cf6ab02. Diff: pack rule, 11 fixtures, changeset; no private names.

@ryanleecode
ryanleecode merged commit 6a7c247 into main Oct 9, 2026
14 of 17 checks passed
@ryanleecode
ryanleecode deleted the feat/gritlint-cell-architecture branch October 9, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants