Skip to content

fix: Accept read models as bounded-context content. - #74

Merged
goloroden merged 1 commit into
mainfrom
bounded-context-without-content
Sep 21, 2026
Merged

goloroden merged 1 commit into
mainfrom
bounded-context-without-content

Conversation

@goloroden

Copy link
Copy Markdown
Member

What changed

The rule esdm/modeling/bounded-context-without-consistency-unit demanded an Aggregate or a Dynamic Consistency Boundary in every Bounded Context. That misjudges the projection-only context: it derives every view from events owned by other contexts and deliberately has no write side. The rule reported it as a defect and pushed modelers towards adding a placeholder aggregate just to silence the warning.

Read models now count as content alongside the two consistency units. Supporting elements (Entities, Value Objects, Actors, Queries) still do not, because they only carry meaning around one of the three.

Since the rule no longer checks for a consistency unit, it is renamed to match what it now verifies:

Rule ID esdm/modeling/bounded-context-without-content
Severity warning (unchanged)
Diagnostic bounded-context "reporting" has no aggregates, dynamic-consistency-boundaries or read-models
Doc anchor #modeling-bounded-context-without-content

The rename is a breaking change for anyone referring to the old ID. At 0.x that is acceptable, and it was a deliberate call: the name follows the <subject>-without-<thing> pattern that 34 of the 42 modeling rules use, so the ID stays recognizable where it matters most, in the diagnostic itself.

Why not a lint-ignore annotation

The alternative on the table was a suppression mechanism (esdm.io/lint-ignore plus a reason in metadata.annotations). It was rejected:

  • metadata is documented in schema/core/v1.yaml as non-semantic, with nothing else in the schema reading it. Making the linter read it would break that contract, and a typo in the key would fail silently.
  • It collides with two architectural negatives: no end-user configurability for rules, and no project-level configuration.
  • A false positive is a reason to sharpen the rule, not to hand modelers a way to mute it. An ESDM model is never executed, so the linter is the only feedback it gets.

Testing

make qa passes. The rule's tests now cover all three accepted kinds, the projection-only context, and a context holding only supporting elements.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NcvwY9jPvVp8vLjugRpKnB

A projection-only bounded context derives every view from events owned
by other contexts and deliberately has no write side. The rule treated
that as a defect and demanded an aggregate or a dynamic-consistency-
boundary, pushing modelers towards a placeholder aggregate.

Read models now count alongside the two consistency units. Supporting
elements such as entities, value objects and actors still do not, since
they only carry meaning around one of the three.

The rule no longer checks for a consistency unit, so it moves from
esdm/modeling/bounded-context-without-consistency-unit to
esdm/modeling/bounded-context-without-content.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NcvwY9jPvVp8vLjugRpKnB
@goloroden
goloroden requested a review from a team as a code owner September 21, 2026 10:19
@goloroden
goloroden merged commit 4044cdd into main Sep 21, 2026
7 checks passed
@goloroden
goloroden deleted the bounded-context-without-content branch September 21, 2026 10:21
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.

1 participant