Also see root AGENTS.md for cross-language standards.
- All changes must be backwards compatible. Never re-use or change field numbers of existing fields.
- Use
optionalwhen you need to distinguish "not set" from "zero value" —optionalenables presence tracking (has_*methods) and maps toOption<T>in Rust. Bare proto3 fields have no presence semantics: they always hold a value (defaulting to zero), so you cannot tell if the sender explicitly set them. - Use structured message types (e.g.,
BasePath) instead of plain scalars, and scope fields to operation-specific messages (e.g.,InsertTransaction) rather than generic top-level ones. - Don't duplicate data across messages — store each fact once and derive relationships. Prefer parallel sequences over maps when keys already exist in another field.
- Document the semantic meaning of both present and absent states for
optionalfields — explain when each case applies. - Use precise domain terminology in field descriptions — avoid ambiguous abbreviations or terms that collide with domain concepts.