rayhpeng 210fe8c12c docs(hexagonal): establish the layering spec and its enforcement
Introduces the ports-and-adapters standard new backend modules are
expected to follow, plus the two pieces that make it more than prose:
`deerflow/domain/` as the inner-ring namespace, and an AST test that
fails when anything under it imports infrastructure.

The spec is normative rather than descriptive -- the existing modules
predate it, so the test guards the namespace, not the whole backend.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 11:16:30 +08:00

10 lines
470 B
Python

"""Hexagonal inner ring: domain models, ports, and application services.
Every package under this namespace is one bounded context laid out as
`{model,ports,service}.py`. Code here has zero infrastructure
dependencies -- no sqlalchemy/fastapi/pydantic, no `app.*`, and no
harness infrastructure modules (enforced in CI by
`tests/test_harness_domain_purity.py`). Adapters implementing the ports
live in `app/adapters/`; wiring happens only in `app/gateway/deps.py`.
"""