1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//! `Catalog` canonicalization pipeline.
//!
//! Every IR-value normalization rule that must apply to both the
//! source-built `Catalog` and the catalog-reader-built `Catalog` lives
//! here, behind a single entry point. The pipeline runs in a fixed
//! documented order; new rules go into the appropriate file in this
//! module (or get a new file if they're a new kind of rule).
//!
//! Today's order:
//!
//! 1. [`filter_pg_defaults`] — values that equal PG's documented
//! defaults become `None` (sequence min/max, function cost/rows,
//! column collation `pg_catalog.default`).
//! 2. [`sentinel_view_columns`] — view/MV column types collapse to the
//! `view_column` sentinel.
//! 3. [`renumber_enum_sort_orders`] — every enum's `sort_order` values
//! are re-indexed to `1.0, 2.0, 3.0, …` in current order.
//! 4. [`reloptions`] — canonicalize reloption fields (currently a no-op;
//! `extra` is `BTreeMap` so keys are already ordered).
//! 5. [`sort_and_dedupe`] — every collection is sorted by its canonical
//! key and duplicates raise [`IrError`]. Runs last so duplicate
//! detection sees post-normalization values.
//!
//! See `docs/superpowers/specs/2026-05-19-canon-consolidation-design.md`.
use crateIrError;
use crateCatalog;
/// Run every canonicalization pass on `cat` in order.
///
/// [`publications`] and [`sort_and_dedupe`] are fallible; the other
/// passes mutate in place and cannot fail.