sort_data_models reads BASES before sort_base_classes_for_mro writes it (the model order reads the bases as parsed; the MRO order of bases follows it)
delete_duplicate_models reads CLASS_NAMES, NULLABLE before replace_duplicate_name_in_module writes it (renames the duplicates that deletion keeps)
replace_duplicate_name_in_module reads CLASS_NAMES before apply_forced_invalid_dotted_stdout_repair writes it (flattens invalid roots under the names deduplication gave)
apply_forced_invalid_dotted_stdout_repair reads MODULE_MEMBERSHIP before reuse_model_tree_scope writes it (shares the duplicates of the repaired module layout)
reuse_model_tree_scope reads MODULE_MEMBERSHIP before resolve_circular_imports writes it (breaks the cycles of the modules tree-scope reuse leaves, its shared module included)
flatten_conflicting_base_layouts reads FIELD_TYPES before unconstrain_union_members writes it (layouts are flattened with the union members as parsed)
override_required_field reads DEFAULTS before replace_unique_list_to_set writes it (converts the defaults that inherited required fields bring)
alias_shadowed_imports reads MODULE_IMPORTS before change_from_import writes it (imports referenced models after shadowed imports took their aliases)
replace_unique_list_to_set reads DEFAULTS before set_reference_default_value_to_field writes it (turns defaults into references after unique lists became sets)
set_reference_default_value_to_field reads FIELD_TYPES before reuse_model writes it (compares models with their final defaults)
extract_inherited_enum reads BASES, FIELD_SET before reuse_model writes it (compares models after inherited enums became models of their own)
reuse_model reads CONSTRAINTS, DEFAULTS, DISCRIMINATOR_TAGS, FIELD_TYPES, METADATA, MODELS_EXIST, NULLABLE, REQUIRED before collapse_root_models writes it (inlines the root models that reuse keeps)
record_decimal_alias_models reads FIELD_NAMES before change_field_name writes it (the Decimal check reads the field names as parsed)
change_field_name reads FIELD_NAMES before restore_inherited_field_names_for_unique_aliases writes it (restores the inherited names that renaming changed)
sort_models reads FIELD_TYPES before apply_discriminator_type writes it (models are ordered by their types before tags rewrite the variant types)
set_default_enum_member reads DEFAULTS, FIELD_TYPES before apply_discriminator_type writes it (enum defaults read the types before tags rewrite them)
apply_discriminator_type reads FIELD_TYPES before type_const_narrowed_values writes it (narrows the types that tags wrote)
refresh_field_config reads FIELD_ALIASES before rename_fields_hiding_types writes it (the field config is refreshed with the aliases before renaming)
remove_overridden_models reads TYPE_OVERRIDES before apply_field_type_overrides writes it (overrides apply to the models kept after model-level overrides (#4958))
type_dict_keys_by_root_types reads FIELD_TYPES before settle_kept_parent_roots writes it (the holders it redirects name object models, which no dict key names)
fix_constructor_field_ordering_early reads FIELD_TYPES before settle_kept_parent_roots writes it (a redirected holder keeps its name, default and requiredness; only its type names the same-named inner model)
type_dict_keys_by_root_types reads MODEL_KIND before write_rule_aliases_as_classes writes it (the aliases written as classes are object maps, which no dict key names)
fix_constructor_field_ordering_early reads FIELD_TYPES before name_inner_models_in_rules writes it (the types of rules are no constructor fields)
tag_fields_of_tagged_bases reads MODULE_IMPORTS before import_removed_reuse_canonicals writes it (repairs the imports of every module once the fields reused structs copy from their bases import theirs)
tag_fields_of_tagged_bases reads MODULE_IMPORTS before import_renamed_types writes it (imports renamed types once the fields reused structs copy from their bases import theirs)
import_removed_reuse_canonicals reads MODULE_IMPORTS before import_renamed_types writes it (imports renamed types next to the canonicals of removed reuse duplicates)
import_renamed_types reads MODULE_IMPORTS before import_enum_member_literal_classes writes it (imports literal classes next to the renamed types)
warn_enums_admitting_other_values reads FIELD_TYPES before import_enum_member_literal_classes writes it (the warning reads the enum types before literal classes replace them)
assign_forward_reference_fields reads FIELD_ORDER before fix_constructor_field_ordering writes it (a field written by assignment is a dataclass default, which ordering reads from the bases of every module)
fix_constructor_field_ordering reads FIELD_TYPES, NULLABLE before update_type_aliases writes it (ordering reads the field types before aliases quote them)
assign_forward_reference_fields reads FIELD_TYPES before update_type_aliases writes it (the forward-reference assignment reads the field types unquoted)
assign_forward_reference_fields reads DEFAULTS before set_validate_default_on_fields writes it (the forward-reference assignment reads which fields have a default, which deserializing it keeps)
warn_required_assignments_after_defaults reads KEYWORD_ONLY before fix_tag_opt_out_field_ordering writes it (the pydantic warning and this msgspec repair never read or write the same models)
snapshot_model_imports reads MODELS_EXIST before remove_unused_models writes it (the snapshot holds the imports of unused models, which leave with them)
remove_unused_imports reads MODULE_IMPORTS before resolve_module_import_conflicts writes it (resolves the conflicts of the imports that are used)
resolve_module_import_conflicts reads MODULE_IMPORTS before alias_builtin_shadowing_module_imports writes it (aliases the module imports once their names are final)
alias_builtin_shadowing_module_imports reads IMPORT_ALIASES before bind_module_field_names writes it (binds field names against the aliases of module imports)
change_imported_model_name reads MODULE_IMPORTS before replan_schema_validators_after_renames writes it (plans the validator helpers again for the renamed models)
bind_module_field_names reads MODULE_IMPORTS before replan_schema_validators_after_renames writes it (binding reads the module imports before the helpers are planned again)
