Static read-through audit of plugins/sector-tyre. Two verified findings, both gaps that sibling plugins already close correctly.
1. Negative CO2e value contradicts the plugin's own schema
Location: src/lib.rs:62-67
Issue: co2ePerTyreKg is never validated (no rule in validate_input); num() only filters for finite, not sign. The plugin's own schema (crates/dpp-domain/schemas/tyre/v1.0.0.json:56-59) declares "minimum": 0. Sibling plugins sector-battery and sector-steel both validate their analogous field with require_non_negative.
Failure scenario: co2ePerTyreKg: -50.0 passes validation and is surfaced as a negative METRIC_CO2E_SCORE — internally contradicting the plugin's own schema.
2. tyreClass isn't checked against its declared enum
Location: src/lib.rs:54
Issue: tyreClass uses require_str (non-empty only), not require_enum, despite the module doc and schema both declaring it must be one of ["C1","C2","C3"]. Adjacent fields fuelEfficiencyClass/wetGripClass correctly use require_enum one line away.
Failure scenario: tyreClass: "garbage" passes validation, and generate_passport clones it verbatim into the outgoing passport — a category value that doesn't correspond to any EU tyre class.
Static read-through audit of
plugins/sector-tyre. Two verified findings, both gaps that sibling plugins already close correctly.1. Negative CO2e value contradicts the plugin's own schema
Location:
src/lib.rs:62-67Issue:
co2ePerTyreKgis never validated (no rule invalidate_input);num()only filters for finite, not sign. The plugin's own schema (crates/dpp-domain/schemas/tyre/v1.0.0.json:56-59) declares"minimum": 0. Sibling pluginssector-batteryandsector-steelboth validate their analogous field withrequire_non_negative.Failure scenario:
co2ePerTyreKg: -50.0passes validation and is surfaced as a negativeMETRIC_CO2E_SCORE— internally contradicting the plugin's own schema.2.
tyreClassisn't checked against its declared enumLocation:
src/lib.rs:54Issue:
tyreClassusesrequire_str(non-empty only), notrequire_enum, despite the module doc and schema both declaring it must be one of["C1","C2","C3"]. Adjacent fieldsfuelEfficiencyClass/wetGripClasscorrectly userequire_enumone line away.Failure scenario:
tyreClass: "garbage"passes validation, andgenerate_passportclones it verbatim into the outgoing passport — a category value that doesn't correspond to any EU tyre class.