WST-DIV
Waste Diversion Rate Calculator
1. Identity
Depends on module:
Purpose
Computes waste diversion rate (share of generated waste diverted from disposal through recycling and/or recovery), producing disclosure-ready KPIs aligned with ESRS E5 reporting patterns.
This engine governs:
- what counts as “diverted”
- how “unknown treatment” is handled
- caps and completeness metadata
It does not reclassify waste; it consumes treatment-tagged flows.
Typical usage
- Diversion rate (%)
- Recycled / recovered / disposed totals (tonnes)
- Data quality flags (unknown treatment share)
2. Contract References (ZAR)
2.1 Input Schema
ZAR Address: schema.compute.waste.diversion.inputs.v1_0_0
Required conceptual fields:
generated_total: scalar or time-series (total waste generated)treatment_flows: list or map of treatment-tagged waste quantitiesalignment:BY_YEAR|BY_INDEX(defaultBY_YEAR)
Treatment flow categories (v1 canonical):
recycledrecovered(energy recovery / other recovery)disposed(landfill, incineration without recovery, etc.)unknown
Each treatment flow conceptually includes:
periodvalueunittreatment: one of the canonical categories above- optional:
hazard_class(HAZ/NON_HAZ) for future splitssite_idwaste_category(EWC/internal)evidence_ref(ticket/manifest id)
Inputs are commonly produced upstream from waste contractor reports and manifests, and may require normalization/tagging before reaching this engine.
2.2 Options Schema
ZAR Address: schema.compute.waste.diversion.options.v1_0_0
Common options:
unit_output: defaulttonnediversion_definition:RECYCLED_ONLY|RECYCLED_PLUS_RECOVERED(defaultRECYCLED_PLUS_RECOVERED)unknown_treatment_policy:ERROR|EXCLUDE_FROM_NUMERATOR|TREAT_AS_DISPOSED|ALLOW_WITH_FLAG(defaultEXCLUDE_FROM_NUMERATOR)mass_balance_policy:CAP_AT_GENERATED|ERROR_IF_EXCEEDS(defaultCAP_AT_GENERATED)denominator_floor: default1e-9rounding: optional digits
2.3 Output Schema
ZAR Address: schema.compute.waste.diversion.output.v1_0_0
Outputs include:
diversion_rate(ratio or percent per schema)metadata(unknown handling, caps applied, mass-balance checks)
3. Accepted Input Shapes
A. Treatment flow list (preferred)
{
"generated_total": [[2025, 1285], [2026, 1250]],
"treatment_flows": [
{ "treatment": "recycled", "period": 2025, "value": 600, "unit": "tonne" },
{ "treatment": "recovered", "period": 2025, "value": 150, "unit": "tonne" },
{ "treatment": "disposed", "period": 2025, "value": 400, "unit": "tonne" },
{ "treatment": "unknown", "period": 2025, "value": 135, "unit": "tonne" }
],
"alignment": "BY_YEAR"
}
B. Treatment map (compact)
{
"generated_total": [[2025, 1285]],
"treatment_flows_map": {
"recycled": [[2025, 600]],
"recovered": [[2025, 150]],
"disposed": [[2025, 400]],
"unknown": [[2025, 135]]
}
}
All supported shapes MUST be normalized internally to:
Map<period, { generated, recycled, recovered, disposed, unknown }>
4. Diversion Governance Rules (Normative)
4.1. What counts as “diverted”
If diversion_definition = RECYCLED_ONLY:
- diverted = recycled only
If RECYCLED_PLUS_RECOVERED (default):
- diverted = recycled + recovered
4.2. Unknown treatment handling
If unknown_treatment_policy is:
ERROR: fail if any unknown existsEXCLUDE_FROM_NUMERATOR(default): exclude unknown from diverted, but include in mass balance checksTREAT_AS_DISPOSED: add unknown to disposed for conservative reportingALLOW_WITH_FLAG: allow unknown but flag in metadata
5. Compute Semantics (Normative)
For each aligned period :
Let:
- = generated total
- = recycled
- = recovered
- = disposed
- = unknown
All values are assumed normalized to unit_output.
5.1. Diverted amount
If RECYCLED_ONLY:
If RECYCLED_PLUS_RECOVERED:
5.2. Apply unknown policy (if conservative)
If unknown_treatment_policy = TREAT_AS_DISPOSED:
If EXCLUDE_FROM_NUMERATOR, remains separate and does not affect .
5.3. Mass-balance check
Total treated:
If :
- if
mass_balance_policy = ERROR_IF_EXCEEDS: fail - if
CAP_AT_GENERATED(default): scale down treated totals proportionally or cap diversion numerator only
v1 recommended cap strategy (simple + safe):
and record the cap event.
5.4. Diversion rate
Let be denominator_floor.
If output is ratio:
If output is percent:
6. Validation & Error Model
Invariants
- Values must be finite
- Units convertible to unit_output
- Treatments must be canonical categories
- Generated total must be provided for each period
- Diversion rate MUST be capped to [0,1] or [0,100] unless schema allows otherwise
Error codes (suggested)
WASTE_DIV_MISSING_GENERATED_TOTALWASTE_DIV_INVALID_TREATMENT_CATEGORYWASTE_DIV_UNIT_CONVERSION_FAILEDWASTE_DIV_UNKNOWN_TREATMENT_ERRORWASTE_DIV_MASS_BALANCE_EXCEEDEDWASTE_DIV_NON_FINITE_VALUE
Errors MUST include:
- engine
cmi_short_code - period context and (if applicable) affected treatment category
7. Dependencies
MEID_CALC_WASTE_DIV depends on:
- schema resolver (ZAR)
- unit conversion capability (delegated)
- canonical treatment category list (recycled/recovered/disposed/unknown)
Declared via ZAR dependencies.
8. Federation & Audit Requirements
To reproduce diversion KPIs externally, the export MUST include:
- engine identity (
cmiorzar_code) - engine build proof (
execution_ref+build_hash) - input/options/output schemas used
- generated total series
- treatment flow totals (by category)
- unknown policy + mass-balance policy applied
- evidence references (if present)
Provenance chain MUST show:
… → MEID_CALC_WASTE_AGGR → MEID_CALC_WASTE_DIV → …
with cmi_short_code recorded in USO tail arrays.
9. Performance Notes
- Complexity: over periods (or if list-based)
- Memory:
- Suitable for batch reporting and KPI analytics
10. Methods Served (v1)
Waste.diversion_rateWaste.recycled.absWaste.recovered.absWaste.disposed.absWaste.treatment.unknown.abs