A child builds a game in Scratch: a character appears and then immediately moves. Nobody sees that first step, so you could safely remove that command. But how do you know this without risk? Today there are tens of millions of such projects, and the tiniest optimizer mistake can break the creator's intent.
The solution resembles a customs inspection. First, an untrusted optimizer scans the project, builds a graph (network) of all connections, and proposes deleting invisible or useless parts. Each proposal comes with a certificate — a description of the change with safety conditions. The trusted checker doesn’t take it on faith: it re-compares the original and modified programs. The guiding principle is the 'observation lens': only what the player sees. If an action is overwritten by another before it can be noticed, it's redundant. This principle rests on a theorem proved in the Lean proof assistant.
An experiment on 300 online projects showed that 94.3% got at least one safe improvement. Usually they cleaned up unused pictures, but occasionally they removed truly dead commands. A deliberate attack of 4278 malicious edits failed completely — the checker didn't let a single dangerous one through. This is thanks to control theory and information theory: the system guarantees no unnoticed side channels. Crucially, the method provides exact guarantees without relying on probabilities or Bayesian inference. Here, a program is viewed as a dynamical system, and its verification as a rigorous deterministic analysis, not a stochastic process.
Code customs is already working. In the future, it could check edits from artificial intelligence. But right now, a child can hit 'run'—their design will stay untouched.
During auditing, they found eight false accepts: a sprite was spying on another via a costume number. Now that observation channel is closed with tests.