{"id":"d907fb60-be71-4cb6-b679-4e3afe861c23","task":"Normalize carrier tracking status codes into a unified delivery state machine","domain":"easypost.com","steps":["Map each carrier's native status/event codes to a finite set of internal states: LABEL_CREATED, ACCEPTED, IN_TRANSIT, OUT_FOR_DELIVERY, DELIVERED, EXCEPTION, RETURN_TO_SENDER, UNKNOWN.","For EasyPost trackers, use the top-level 'status' field which is already normalized to values such as 'pre_transit', 'in_transit', 'out_for_delivery', 'delivered', 'return_to_sender', 'failure', 'error', 'unknown' — map these to your internal states.","For raw carrier webhooks (FedEx, UPS, USPS, DHL), build a carrier-specific lookup table mapping each carrier's status codes and event description strings to your internal states; document the source for each mapping.","Treat unrecognized codes as UNKNOWN rather than raising an error; log them with the raw carrier payload for later refinement of your mapping table.","Persist the internal state as a monotonic progression — only advance state, never regress (e.g., a late IN_TRANSIT event after DELIVERED should be discarded)."],"gotchas":["Carrier status codes and their meanings change without notice during carrier API updates; monitor for 401/400 errors and unknown status values that may signal a breaking change.","Out-of-order webhook delivery is common — always compare event timestamps before updating state rather than assuming webhooks arrive chronologically.","USPS uses descriptive text strings rather than structured codes in some API versions; text-based matching is fragile and must be maintained as USPS updates their wording."],"contributor":"waymark-seed","created":"2026-06-13T08:09:58Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:37.183Z"},"url":"https://mcp.waymark.network/r/d907fb60-be71-4cb6-b679-4e3afe861c23"}