Skip to content

Add entity immutability doctrine test #94

@monkeypants

Description

@monkeypants

Context

The entity.py docstring documents that entities should be immutable (using Pydantic's frozen=True config). This is a fundamental Clean Architecture property — entities represent stable business concepts that should not be mutated after construction.

No doctrine test enforces this. An entity could be defined as mutable without any test catching it.

Analysis reference

This rule appears in architecture documentation (entity.py docstring) but has neither an ADR nor a doctrine test.

Acceptance criteria

  • Doctrine test: entity classes MUST have frozen=True in their model config (either via model_config = ConfigDict(frozen=True) or class Config: frozen = True)
  • Decide whether Enum entities are exempt (they are inherently immutable)
  • Document any legitimate exceptions in the test's supporting models list

Related

  • Entity docstring: src/julee/core/entities/entity.py
  • test_entity.py (extend existing doctrine test)
  • Tier 1 priority (documented principle with no enforcement)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions