Document generated struct evolution policy#244
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
Per maintainer review on anthropics#244: the policy is a library-level contract, so it belongs on the runtime trait docs (alongside the existing serialization model / thread safety / manual-impl sections) rather than repeated on every generated struct. The per-struct note also became the rustdoc summary line for any proto message without a leading comment, which polluted module indexes and search. - Add a '# Struct evolution policy' section to the buffa::Message trait doc, with the full text including an explicit blessing of Foo { x, ..Default::default() } and the deliberate-not-non_exhaustive rationale. - Add one-line cross-references from MessageView and LazyMessageView. - Revert the per-struct codegen note and the checked-in regen. - Keep the docs/guide.md bullet (now linking to the trait section). - Merge origin/main for the changie infra and add a Changed fragment. Refs anthropics#202.
|
[claude code] Thanks for the PR — this is exactly the Option-2 direction from #202 and the guide bullet is spot on. After reviewing, we decided the policy reads better as a library-level statement than as text repeated on every generated struct, so I've pushed a maintainer commit that reshapes the change:
Verified locally: If we later want point-of-use discoverability on individual structs, a one-line per-struct intra-doc link to this trait section is the natural follow-up — but that can wait for actual usage feedback, same as the Option-3 builders. |
Summary
Refs #202.
#[non_exhaustive]and no new builder API.buffa-typesandbuffa-descriptoroutputs so the new rustdoc note appears in committed generated code.Testing
cargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warningscargo check --workspace --all-featurescargo test -p buffa-codegen commentscargo test --workspace -- --skip timestamp_ext::tests::systemtime_roundtrip_post_epochNotes
cargo test --workspacehas one Windows-onlySystemTimeprecision failure locally; the workspace test pass succeeds when that single test is skipped.