Try the classifier
NAME
try - run the drift classifier in your browser, on a schema you can edit
Below is a committed lock and an observed shape, both written as one path: type per line. The page applies the exact classification rules from internals and prints the report driftpipe would print. Nothing is sent anywhere - the comparison runs entirely in this page.
THE COMMITTED LOCK
Fixed for this demo, the baseline a check compares against. A type is one of null bool int float string object array or a |-union such as string|null.
meta.received_at: string order.id: string order.customer_id: string order.total: int order.currency: string order.legacy_ref: string order.items[].sku: string order.items[].qty: int order.items[].unit_price: int order.shipping.method: string order.shipping.cost: int
OBSERVED SHAPE
Lines are path: type. Blank lines and # comments are ignored. An unknown type word is flagged, as the real parser would reject it.
REPORT
driftpipe 0.9.4 12 paths observed 11 in lock + order.coupon_code string additive + order.items[].discount int additive ~ order.total int -> float widening ! order.customer_id string -> string|null nullability ! order.shipping.cost int -> string narrowing - order.legacy_ref string removed 6 differences: 2 additive, 1 widening, 3 breaking fail-on=breaking, 3 of 6 cross the threshold, exit status 3
The report above is the worked example for the shape as shipped. With scripting enabled it becomes live. Delete the - and ! lines, then switch the threshold, to watch the exit status flip between 3 and 0.
HOW A LINE IS CLASSIFIED
| Sym | When | Class | breaking | any |
|---|---|---|---|---|
| + | path only in the observed shape | new_fields | warn | fail |
| - | path only in the lock | removed_fields | fail | fail |
| ~ | exactly int becomes float | type_widening | warn | fail |
| ! | null joins a union that lacked it | nullability | fail | fail |
| ! | any other type change or union | type_narrowing | fail | fail |
One path produces one line, and nullability outranks widening when both would apply. The depth_exceeded class only arises from real nesting below --max-depth and so does not appear in this flat demo.