Function validate_whatsapp_semantics
pub fn validate_whatsapp_semantics(
alias: &str,
wa: &WhatsAppConfig,
) -> Vec<ValidationWarning>Expand description
Surface WhatsApp chat-policy keys that are accepted but never consulted.
self_chat_mode is read only by the Web transport inside its
mode == Personal block, so under mode = "business" it validates cleanly
and has no effect. mode selects ZeroClaw’s policy posture, not a WhatsApp
account type: both modes drive the same linked-device session, and the
self-chat affordance is scoped to the personal branch by design.
dm_policy and group_policy are consulted under BOTH modes, so they are
not reported here.
allowed_groups is separate. It is the group-identity gate and is consulted
under both modes, so it is never inert. is_group_chat_allowed returns true
for an empty list only under group_policy = "all"; under every other policy
an empty list admits no group. That closure is reported below by its own
warning rather than as an inert key.
Warnings only, no behaviour change to the validator itself. But be precise
about WHICH reliance is reported, because this sentence used to promise more
than the function delivers: under mode = "business" the inert-key warning
covers self_chat_mode ONLY. dm_policy and group_policy are now live in
business mode, so an operator who was relying on the old permissive business
behaviour gets NO warning here and can start silently dropping DMs or groups
under the default allowlist. That upgrade note belongs in the channel book
and the release notes; config validate will not surface it for them.
Called from Config::collect_warnings, so this reaches the CLI and the
gateway dashboard on the same path as the other warnings.