
# ADR-0007: E27 API Message Layer Architecture

Status: Accepted

## Context

M1 uses message.py as a canonical codec and registry.
E27 uses JSON APIs grouped by domain.

## Decision

E27 implements an API message layer analogous to message.py,
but API-centric rather than wire-centric.

- Domain-oriented modules (control, area, zone, etc.)
- Each module defines:
  - request builders
  - response parsers
- Dispatch is by module.method.
- Operates only on decoded JSON objects.

This API message layer relies on a committed API inventory
as the authoritative definition of supported domains and commands.
See ADR-0012.

## Rationale

This provides a single authoritative definition of API behavior
while respecting E27’s architecture.

## Consequences

- No raw JSON leaks upward.
- API semantics are testable independently of protocol mechanics.

## Scope / Non-Goals

- Does not handle framing or crypto.
- Does not perform socket I/O.

## References

- HelpDealerAPI_UL documentation
- ADR-0012: Stable Inventory-Driven E27 API Surface
