\captionsetup, \numberwithin and \DeclareCaption were unsupported and could
leak into the body. The page-geometry pass now consumes those declaration lines
(the caption styling and equation-number scoping are not modelled), in the
preamble and in the body alike.
A preview test declares \captionsetup (plain and with [figure]) and
\numberwithin before and inside the document, then checks "Text." renders with
no warnings and no leaked declarations.