Drift is a set, not a diff
A text diff is the first thing anyone reaches for when asked to watch a website, and it takes about a week to find out it is the wrong thing.
Watch a merchant’s site for that week and count what moves. A banner rotates for a sale; a tagline is rewritten; a product blurb gets polished by whichever tool the shop owner is fond of this month. Each of these is a change, and a diff reports every one with complete confidence. Almost none of them alters what the business is. A shop that sells watches is still a shop that sells watches after its hero line goes from one clever phrase to another.
The question a risk team is asking is narrower than “did the page change”; it is “did this business become something else”. The gap between those two questions is where alert fatigue lives. A monitor that fires on both gets muted, and a muted monitor is worse than having none, because everyone still believes it is on.
So in Beetle the unit of comparison is not text. Each read produces the three category codes that best describe the business, with a confidence on each. Drift, the only thing a client is alerted to, is a change in that set of three, or a change in which policy pages were identified. Order within the set is not drift. A small movement in confidence is not drift either; it shows on the page as a delta so nobody has to diff two JSON files by hand, but it never goes out as an alert.
Why the set, and not simply the top pick? Because the final call on which code applies sits with the client and the heuristics around it. The top pick can flip on a hair’s difference between the first two candidates; the set holds still unless something real has entered or left it. And when a code that was fourth best moves into the top three, that counts, since the read is deterministic: same page in, same answer out, so if the set moved, the page moved. I would apply the same logic to a set of a hundred.
A blocked page deserves its own line. A site that turns us away on a given day has told us nothing about the business; a failed read is a failed read, and it should never be allowed to pass for a pivot. That is a rule about what counts as a change, and it matters more than any threshold.
There is an older reason I care about this. At Cashfree I worked with RBI audit teams, and audits run on samples; a sample is only as good as the record behind it. A record stuffed with cosmetic alerts is a record nobody reads, and an auditor who cannot find the one real change in forty noisy ones will, reasonably, trust none of them.
None of this is clever; it is a decision about what to call a change, made before any code existed, and the code followed from it. That ordering has served me well, in Deployment Driven Development and elsewhere: settle the definition, then the pipeline, then the features.
Next up, how each alert ties back to the exact page read that produced it.