Skip to content

ADR-006: Semantic Layer & Metrics Framework (DRY)

Status: Proposed
Date: 2026-01-24

Context

Manufacturing costing involves 50+ inter-dependent metrics. Without a centralized semantic layer, logic becomes fragmented across reports, dashboards, and APIs, leading to inconsistent quotes.

Decision

Implement a Metadata-Driven Semantic Layer to enforce the DRY (Don't Repeat Yourself) principle.

  1. Centralized Definitions: All formulas (e.g., Material Cost) are defined in a YAML catalog.
  2. Logic Separation: The calculation engine consumes these definitions dynamically.

View Implementation Details: Semantic Layer Specification →

Rationale

  • Consistency: Eliminates "Excel Hell" where different sheets use different versions of the same formula.
  • Agility: A 1-line update in the YAML catalog propagates to all quotes and dashboards.
  • Auditability: Dependency graphs allow clear "Why this number?" drill-downs for auditors.

Consequences

  • Positive: Single source of truth; 0% logic drift across the platform.
  • Negative: Initial overhead of defining the 50+ metric catalog.

← ADR Index