Create Labels Field Definition
Turn the company's label metadata into a multi_select definition on routines and write
each routine's value from its labels references. Superadmin only; works while the company
flag is off (the values stay invisible until it is on).
One option per label: the key is a slug of the title (English first, else the first language
with text; label_<id> when no letters or digits remain; _2, _3 on collision), the label
the title (its own translations kept, the missing company languages filled),
source_reference_id the metadata id. A repeat run appends options for new labels and plans
every routine's value as the sorted distinct keys of its live label references, archived
options left out. By default a run only creates a value or adds keys to it (set_count);
a routine whose stored value holds a key the plan drops (overwrite_count, an API edit or
an archived option) or whose references are all gone (unset_count) is rewritten or unset
only with overwrite: true. The label references stay. dry_run: true answers the counts
without writing.
422 types: group_unsupported (a group outside the routine sections), no_labels. 409
types: field_id_collision (a global row has the id), field_archived_exists (restore
first), field_type_mismatch (the id holds another type), definition_unreadable.