feat(proto): enforce id-naming law and return full config from AddAccount #353

Merged
KofTwentyTwo merged 1 commits from story/ws-a4-id-conventions into dev 2026-07-31 22:04:11 +00:00
KofTwentyTwo commented 2026-07-31 22:02:49 +00:00 (Migrated from github.com)

Summary

  • Audited every message in nuncio.proto against the id-naming law: an entity's own identifier field is id; a reference to another entity is <noun>_id. Fixed the outliers:
    • RemoveAccountRequest.id -> account_id
    • TestAccountConnectionRequest.id -> account_id
    • DeleteRuleRequest.id -> rule_id
    • UpdateRuleRequest.id -> rule_id
    • MessageSearchHit.id -> message_id
  • Documented Message.id (and AccountConfig.id/FilterRule.id/CalendarEvent.id/Contact.id) as OPAQUE, server-assigned tokens clients must never parse or construct, reflecting the surrogate id WS-B1 introduced.
  • AddAccountResponse now returns the full persisted AccountConfig (never the password) instead of a bare id, mirroring how CreateRule/CreateContact return their created object. Updated nunciod's add_account impl and nuncio-cli's handle_add_account to use the richer response.
  • Regenerated the nuncio.v1 descriptor golden (contract_stability test) for all field renames/changes above. All renames are pre-freeze and additive-where-possible; no field number was reused.

Test plan

  • cargo fmt --all -- --check
  • cargo check-all (clippy --all-targets --workspace -D warnings) -- 0 warnings
  • cargo test-all -- 527 passed, 0 failed, 0 ignored
  • cargo test -p nuncio-proto contract_stability -- golden matches regenerated descriptor
  • Pre-commit hook ran the full gate on commit and passed

Refs #276

## Summary - Audited every message in `nuncio.proto` against the id-naming law: an entity's own identifier field is `id`; a reference to another entity is `<noun>_id`. Fixed the outliers: - `RemoveAccountRequest.id` -> `account_id` - `TestAccountConnectionRequest.id` -> `account_id` - `DeleteRuleRequest.id` -> `rule_id` - `UpdateRuleRequest.id` -> `rule_id` - `MessageSearchHit.id` -> `message_id` - Documented `Message.id` (and `AccountConfig.id`/`FilterRule.id`/`CalendarEvent.id`/`Contact.id`) as OPAQUE, server-assigned tokens clients must never parse or construct, reflecting the surrogate id WS-B1 introduced. - `AddAccountResponse` now returns the full persisted `AccountConfig` (never the password) instead of a bare `id`, mirroring how `CreateRule`/`CreateContact` return their created object. Updated `nunciod`'s `add_account` impl and `nuncio-cli`'s `handle_add_account` to use the richer response. - Regenerated the `nuncio.v1` descriptor golden (`contract_stability` test) for all field renames/changes above. All renames are pre-freeze and additive-where-possible; no field number was reused. ## Test plan - [x] `cargo fmt --all -- --check` - [x] `cargo check-all` (clippy --all-targets --workspace -D warnings) -- 0 warnings - [x] `cargo test-all` -- 527 passed, 0 failed, 0 ignored - [x] `cargo test -p nuncio-proto contract_stability` -- golden matches regenerated descriptor - [x] Pre-commit hook ran the full gate on commit and passed Refs #276
Sign in to join this conversation.