A Protobuf Rule Word Is Not on the Wire (and the Diff Verdict Is the Decoder's Call)
Change the rule word on a field and the wire does not move. I took the same message, the same field number, the same value of five, and encoded it under all four spellings of the rule: proto2 optional, proto2 required, proto3 plain, and proto3 explicit optional. All four wrote 0805, the tag byte then the varint five, one byte for the tag and one for the value, identical down to the last bit. The rule word is not on the stream. It is a label in the schema, and the stream never reads it, so a diff tool that only compared bytes would look at a required to optional change and report no differences at all, which is the wrong answer.
The verdict has to come from somewhere else, and it comes from two places that have nothing to do with the wire. The first is the decoder. In proto2, required is the one rule the decoder actually enforces: it checks that the field was present in the bytes, and it throws, missing required age, for a message that never carried it. That check is a gate between old and new. Tightening optional to required is breaking, because old senders will happily produce a message without the field and the new decoder will refuse it. The tool prints that line for exactly this reason: now required, the decoder rejects any old message that never carried this field, binary clients on the old schema break until they update. Loosening required to optional is the safe direction, because the decoder check is gone and old data that lacked the field now decodes fine. The report lands it under safe additions, not breaking.
The second place is the JSON output, and it is where proto3 lives. Proto3 has no required, so the rule word there is the optional keyword, and it does not gate the decoder at all. It changes what an unset field prints. The decode side runs with defaults filled, and a plain proto3 field that was never written prints the type default, a zero or an empty string, while an explicitly optional field that was never written stays absent from the output, no key at all. Same unset field, same decoder, two different JSON documents. That is why both directions of the keyword flip are breaking in the report, and why the line names the JSON, not the wire: adding the keyword means an unset value becomes absent instead of the type default, so clients parsing JSON for the default value break; removing it means the default comes back, so clients checking for the absence of a key break. The bytes did not move. The document did.
The cleanest way to see the split is to stack the two together. Take a proto2 field and change it from optional int32 to required int64 in one edit. The report gives you two breaking lines for that one field: the rule line, now required, and the type line, which notes the same wire type keeps the bytes decodable but reinterprets the values and turns the 64 bit integer into a string in JSON. Each line names a different break, and neither is the other. That is the shape of the whole feature. The report does not ask which rule word you used. It asks what changed for the decoder and what changed for the JSON, and a single edit that touches both gets one line per consequence.
The library the tool runs on stores the rule in one place and it is narrower than the four spellings suggest. For proto2 it keeps required and repeated as a stored label, but proto3 plain and proto3 explicit optional both leave that label empty. The explicit optional is a separate flag, a synthetic oneof that the parser wraps the field into, and the report reads that flag to tell plain apart from optional. So the four visible spellings collapse to three internal states, and the diff logic branches on those states, not on the text of the file. A change that only rewords the file, the same rule in different letters, produces no line, which is what you want, and a change that crosses one of those states produces exactly one, with the reason attached.
The tool has carried this since the diff tab shipped, and the rule word was the last of its blind spots. Renames by field number, wire type versus same wire type swaps, reserved lines, and enum value changes all report cleanly, and now the rule transitions do too, in the report at the protobuf to JSON tool, with the two breaking lines side by side when an edit earns them. What the decoder enforces is covered in the required post, what the optional keyword does to the JSON is in the explicit optional post, the byte math underneath is the wire format, and the general rule for what counts as breaking is in the breaking changes post.