eden/.llms/rules/ACR_scs_thrift_compat.md
Severity: CRITICAL
required fields added to existing Thrift structsoptional field to an existing Thrift struct(deprecated))_ / unknownoptional fields to existing structs.thrift files in test/ or if_test/ directories(deprecated) annotations to existing fieldsBAD (adding required field to existing struct):
struct CommitInfo {
1: binary id,
2: string message,
3: i64 timestamp, // NEW required field — old clients won't send this
}
GOOD (adding optional field):
struct CommitInfo {
1: binary id,
2: string message,
3: optional i64 timestamp, // safe: old clients just won't send it
}
BAD (removing enum variant):
enum RepoState {
ACTIVE = 0,
// ARCHIVED = 1, // removed — old servers still send this!
DELETED = 2,
}
GOOD (deprecating):
enum RepoState {
ACTIVE = 0,
ARCHIVED = 1 (deprecated = "Use DELETED instead"),
DELETED = 2,
}
Always add new Thrift fields as optional. Never remove fields or change field IDs -- deprecate them instead. When adding new enum variants, verify that all consumers have a default/unknown handler. Consider that during rollouts, old and new server versions coexist.