ADR 0014: Carton discrepancies: CartonOverLimit, mixed-carton audit count, label data
Status
Proposed (2026-10-24). Extends ADR 0012
and ADR 0013; nothing
in them changes meaning. Source: .hermes/plans/mastercase-briefs/contracts.md section 9 (R9, R10,
R11) of the warehouse-systems workspace.
Context
ADR 0012 left three things open: the CartonOverLimit kind (this service holds no site handling
limits), what a scan of a MIXED carton does when the dock worker counts it, and what happens to a case
that arrives with no readable SSCC. Section 9 of the contracts decided all three.
Decisions
CartonOverLimitis checked at acceptance (R9). Limits come from the envCARTON_MAX_GROSS_WEIGHT_GandCARTON_MAX_LONGEST_SIDE_MM(chartconfig.cartonMaxGrossWeightG/config.cartonMaxLongestSideMm);0or unset means unchecked, a negative or unparsable value logs a warning and is unchecked, and the chart refuses a negative value. They are compared with the carton's DECLAREDgrossWeightGand the longest side of its declareddims(the ASN is read only when a limit is configured). Node-topology limits arrive in Phase 4, so there is no cross-context call. An over-limit carton is still accepted: it is physically on the dock, and goods on the dock are never silently rejected. The service raises oneCartonDiscrepancyRaisedof kindCartonOverLimitper carton, withexpectedthe breached limits andactualthe declared values, written asgrossWeightG:<n>andlongestSideMm:<n>pairs joined by a comma (one finding per carton because the exception case is keyed by(receiptId, sscc, kind)). A carton that declared nothing is never over a limit.- A MIXED carton can be audited by count (R10). A mixed carton has no pack GTIN, so its SSCC scan
accepts the manifest per SKU, each line in eaches. The scan may carry
countedContents[{sku, qty}]. When it does, the quantity RECEIVED is the counted one, never the label's, and every SKU whose count differs from the manifest raises the new kindMixedCartonContentMismatchwithexpectedandactualwritten assku:qty. A manifest SKU missing from the count counts as zero; a SKU the manifest does not list is booked on its ASN line (it needs an each GTIN in the PackagingView, otherwise 422counted-sku-unknown).countedContentson a homogeneous carton is 422counted-contents-not-mixed, on a non-SSCC scan 400invalid-scan; a repeated SKU or a negative count is 400invalid-counted-contents. A case GTIN scan can never resolve to a MIXED carton. - An unlabelled carton gets an internal LPN and label data (R11). A case received without a
readable SSCC against a carton ASN raises
UnlabelledCarton(already so) and is given the internal plateLPN-<ulid>(idgen.NewLPN); SSCC-labelled cartons keep their SSCC as LPN. NewGET /receipts/{receiptId}/cartons/{lpn}/labelreturns label DATA only (lpn,symbologyCODE128,humanReadable,skuwhen the carton holds one SKU,unitsin eaches,receivedAt); the service has no ZPL or printer driver and the floor client prints through the browser. A carton the receipt has not accepted is 404carton-not-found. - Carton findings still travel only on
CartonDiscrepancyRaised.ReceiptClosedkeeps its three v1 kinds (Short,Over,Damaged). The API response of an accepted scan lists the findings it raised. - The API and event contracts are documented.
apis/openapi.yamlnow describesPOST /receipts/{receiptId}/scans,GET /asns/{asnNumber}/cartons, the optionalownerRefandcartonsofPOST /asns, and the label endpoint;apis/asyncapi.yamldescribesReceiptCartonReceivedandCartonDiscrepancyRaised(integration and analytics topics) and the optional fields added toASNRegisteredandReceiptLineReceived. There is no endpoint that adds a carton to an existing ASN.
Consequences
- exception-management (R12) consumes
CartonDiscrepancyRaisedfor the two new kinds;CartonOverLimitandUnlabelledCartonare informational for the receiving lead, the rest block in problem-solve. - Every new env var is rendered by the chart (ConfigMap, Deployment, helpers validation, values, render test) and documented in the configuration reference.
- Mixed-carton audit changes the booked quantity of a scan; a retry is still protected by the
Idempotency-KeythatPOST /receipts/{id}/scansrequires.