Module osm.io.pbf.preservation_scan
Loss-aware scan of protobuf/PBF source structure before semantic rewrite.
The ordinary semantic decoders intentionally skip unknown protobuf fields. M4 additionally needs to know that such source content existed so a semantic rewrite cannot silently erase it. This module walks the complete PBF message tree with the current schema's field/wire contracts and records the first source class that is not represented by the owned semantic document.
The scan does not replace normal decoding or validation. Malformed input is still reported through the existing PBF reader status machinery.
Date
2026-11-03