ai-agents-metrics

ARCH-002: Split domain.py into layers

Priority: high Complexity: medium Status: done

Problem

domain.py is a monolith that contains all of the following at once:

Any change to any of these layers touches the same file.

Desired state

Split into submodules:

src/ai_agents_metrics/domain/
    __init__.py        # re-exports the public API (backward compatibility)
    models.py          # dataclasses only
    serde.py           # from_dict / to_dict
    validation.py      # validate_* functions
    aggregation.py     # aggregate_*, compute_summary_block, build_effective_goals
    ids.py             # next_goal_id, next_entry_id
    time_utils.py      # now_utc_iso, parse_iso_datetime, ...

domain/__init__.py re-exports everything — the external API does not break.

Acceptance criteria

Notes