  Calderbank-Shor-Steane (CSS) codes are a class of quantum error correction
codes that contains the toric code and fracton models. A procedure called
foliation defines a cluster state for a given CSS code. We use the CSS chain
complex and its tensor product with other chain complexes to describe the
topological structure in the foliated cluster state, and argue that it has a
symmetry-protected topological order protected by generalized global symmetries
supported on cycles in the foliated CSS chain complex. We demonstrate the
so-called anomaly inflow between CSS codes and corresponding foliated cluster
states by explicitly showing the equality of the gauge transformations of the
bulk and boundary partition functions defined as functionals of defect
world-volumes. We show that the bulk and boundary defects are related via
measurement of the bulk system. Further, we provide a procedure to obtain
statistical models associated with general CSS codes via the foliated cluster
state, and derive a generalization of the Kramers-Wannier-Wegner duality for
such statistical models with insertion of twist defects. We also study the
measurement-assisted gauging method with cluster-state entanglers for
CSS/fracton models based on recent proposals in the literature, and demonstrate
a non-invertible fusion of duality operators. Using the cluster-state
entanglers, we construct the so-called strange correlator for general
CSS/fracton models. Finally, we introduce a new family of subsystem-symmetric
quantum models each of which is self-dual under the generalized
Kramers-Wannier-Wegner duality transformation, which becomes a non-invertible
symmetry.
