Model/packages/domain
Khalim Conn-Kowlessar 62bbf863ff Cohort residual slice 7: PCDB override routes separate_dhw_tests∈{2,3} through Table 3c
Renames `_pcdb_table_3b_combi_loss_override` → `pcdb_combi_loss_override`
(drop the underscore now that it has a unit-testable contract; helper
is now a public boundary of cert_to_inputs). The gate routes on PCDF
Spec Rev 6b field 48:

    = 1 → Table 3b row 1 (profile M only)         — existing
    = 2 → Table 3c row 1 with DVF branch "M+L"    — new (schedules 2+3)
    = 3 → Table 3c row 1 with DVF branch "M+S"    — new (schedules 2+1)
    other / missing factors → None (Table 3a)

Storage-FGHRS (subsidiary_type ∈ {1, 2, 3}) and storage-combi
(store_type ∈ {1, 2, 3}) configurations stay rejected — they gate
Rows 2-5 of both Tables 3b and 3c, deferred until a fixture exercises
them.

Tests (4 new):
  - PCDB 18118 (Vaillant ecoTEC sustain 24, sep_dhw=2) routes through
    Table 3c with M+L. Element-wise match at abs=1e-12 against direct
    Table 3c invocation with the same inputs.
  - PCDB 16952 (Fondital Itaca KC 24, sep_dhw=3 — the M+S branch) routes
    through Table 3c with M+S. No Elmhurst fixture lodges this record;
    borrow 000477's monthly inputs as the deterministic vehicle.
  - PCDB 16839 (sep_dhw=1) preserves the existing Table 3b row 1 path —
    regression guard.
  - Synthetic skeleton record exercises None-returning branches:
    null record, sep_dhw=0, integral FGHRS subsidiary_type=1, primary
    store store_type=1, missing F2.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 13:51:27 +00:00
..
src/domain Cohort residual slice 7: PCDB override routes separate_dhw_tests∈{2,3} through Table 3c 2026-05-22 13:51:27 +00:00
pyproject.toml slice 13: to_rows(properties) returns pd.DataFrame 2026-05-16 16:43:28 +00:00
README.md added potential file scaffolding: 2026-05-15 10:56:53 +00:00

domna-domain

Shared domain types — Property, Properties, BaselinePerformance, Plan, PlanPhase, Scenario, ScenarioPhase, ScenarioSnapshot, Recommendation, OptimisedPackage, EpcPropertyData, etc.

Boundary: types only. No persistence, no IO, no business logic. Other packages and services depend on domna-domain; this package depends on nothing internal.

Domain definitions live in ../../CONTEXT.md. New types added here must match the glossary terms.

Layout

src/domain/
├── __init__.py
├── property.py             # Property, Properties, PropertyIdentity
├── site_notes.py
├── landlord_overrides.py
├── baseline_performance.py # lodged + effective pair (ADR-0004)
├── plan.py                 # Plan, PlanPhase, OptimisedPackage
├── scenario.py             # Scenario, ScenarioPhase, ScenarioSnapshot (ADR-0005)
├── recommendation.py
├── geospatial.py
├── solar.py
├── anomaly_flags.py
└── ml/
    ├── __init__.py
    ├── transform.py        # EpcMlTransform (versioned per §8.3)
    └── schema.py

When datatypes/epc/domain/ folds in, the EPC schema types move under src/domain/epc/.