Page actions
instrument implementation / implementation-contract
Unit Price / Best-Value Comparator implementation
A source-bound implementation contract for Unit Price / Best-Value Comparator; deployment and executable qualification remain separate.
Binding contract
This record describes what an executable surface must bind and validate. It does not claim that a public calculator, package, or production route is deployed.
- Record owner
- Guth Instruments
- Lifecycle
- verified-clean
- Evidence ID
- t5-082
- Effect
- Computation or source lookup only
Input and validation requirements
A zero quantity produces an undefined division, and mixed units require an explicitly defined normalization branch. Without validation and unit conversion, the comparator can produce undefined results or an incorrect ranking.
Required corrections
No binding erratum is attached to this unique-name record. Implementers must still preserve the declared units, domain, and failure behavior.
Inspectable interface fixture
The sample below is evidence for interface and validation tests, not a production implementation.
{
"inputs": {
"options": [
{
"id": "A",
"price": 5.98,
"quantity": 2,
"unit": "L"
},
{
"id": "B",
"price": 3.29,
"quantity": 1,
"unit": "L"
}
],
"target_unit": "L",
"currency": "USD"
},
"expected_outputs": {
"unit_prices": [
{
"id": "A",
"price_per_unit": 2.99,
"unit": "USD/L"
},
{
"id": "B",
"price_per_unit": 3.29,
"unit": "USD/L"
}
],
"ranked_best_value": [
"A",
"B"
]
},
"working": "A: 5.98 USD / 2 L = 2.99 USD/L. B: 3.29 USD / 1 L = 3.29 USD/L. Since 2.99 < 3.29, ranking is A first, then B."
}Other records
Sources and evidence
These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.
VERIFIED_LEDGER.jsonevidence-tranche5/tranche5-results.json