02 — System Diagram

🔍 Open the Interactive Diagram Viewer — pan, zoom, per-area tabs, the full ERD and a focus mode.

Regenerate the viewer after any DSL, menu_config.yaml or diagram_config.yaml change: python scripts/build_diagram_viewer.py asset_lifecycle.

flowchart TD
  MT[UsageMetricType]
  M[UsageMeter]
  R[UsageReading]
  C[MeterCorrection]
  LM[LifeModel]
  LL[LifeModelLimit]
  RS[LifeModelRebuildStep]
  CY[ComponentLifeCycle]
  A[AssetLifeAssignment]
  SU[LifeSpanUsage]
  F[LifeForecast]
  FL[LifeForecastLimit]
  D[DeratingEvent]

  MT --> M
  M --> R
  M --> C
  LM --> LL
  LM --> RS
  LM --> CY
  CY --> A
  A --> SU
  LM --> F
  F --> FL
  LL --> FL

Meters, assignments, forecasts and deratings name their asset by network id (asset_cid, and meter_asset_cid — the asset whose meter a component's life is counted on); they are not foreign keys, because assets belong to the Asset Register.

Where it sits in the network

sequenceDiagram
  participant AR as Asset Register
  participant O as Orchestrator
  participant L as Asset Lifecycle
  participant X as Warranty (R11.3)
  AR->>O: asset.component_installed
  L->>AR: asset.group_membership (direct, read-only — the unit's maintenance group)
  O->>L: deliver — start a span in the component's life cycle
  Note over L: lifecycle.record_usage recalculates the spans and forecasts it reaches
  L->>O: lifecycle.usage_threshold_crossed / life_due / life_forecast_changed
  AR->>O: asset.component_removed
  O->>L: deliver — end the span, store the exposure
  AR->>O: asset.component_rebuilt
  O->>L: deliver — close the cycle, open the next with its life factor
  L->>O: lifecycle.exposure_revised (a correction)
  X->>L: lifecycle.component_exposure (direct, read-only)