Implement compile_filter(spec), returning a callable predicate(record). Support these exact specification shapes:
- {"op": "eq", "field": string, "value": scalar}
- {"op": "all", "rules": [spec, ...]}
- {"op": "any", "rules": [spec, ...]}
- {"op": "not", "rule": spec}
Scalars are str, int, bool, or None. Equality is type-sensitive: True is not 1. A missing field never matches, even if expected value is None. Empty all is True and empty any is False. Reject malformed/unknown operators, extra or missing keys, wrong field/rules types, and unsupported values with ValueError at compilation time—even in a branch evaluation might short-circuit. Specs are finite acyclic trees and records are dictionaries.
Compilation must capture the rules: later mutation of the input spec must not change the predicate. Do not mutate specs or records. The same predicate must work on multiple records.