pub fn synthesize_registry_from_policy_set(
policy_set: &PolicySet,
) -> Result<ComponentRegistry, MigrationError>Expand description
Produce a populated ComponentRegistry from the legacy
PolicySetProto. Deterministic: every honest peer synthesizes
bit-identical output from the same input.
Mapping summary:
- Mutable scalar components pull insert/update from
update_metadata_policy[field_name]; a missing key defaults to admin-only (super-admin for the 0x800A protocol-version floor), mirroring the legacy enforcer. Delete is hardcoded super-admin-only. Per-fieldComponentTypecomes from [metadata_field_registry_mapping] — disappearing-message timestamps are bytes (BE-u64), the rest are utf-8 strings. ADMIN_LISTis constrained: insert/update fromadd_admin_policy, delete fromremove_admin_policy. All must be admin-or- super-admin (synthesis rejects otherwise).SUPER_ADMIN_LISTandCOMPONENT_REGISTRYare hardcoded super-admin-only and not written to the registry.GROUP_MEMBERSHIPmirrorsadd_member_policy/remove_member_policyfor insert/delete; update isAllow(anyone can advance installations).- Immutable components: super-admin insert, deny update + delete.