It is kind of awkward to answer my own question: It seems the answer is related to partition function of certain quadratic functional under gauge invariance. The relevant literature is:
The Partition Function of a Degenerate Functional
and
The partition function of degenerate quadratic functional and Ray-Singer invariants
by A. S. Schwarz. I found pointer to this reference via reading John Lott's lecture notes and personal communication with Pavel Mnev. The paper is not hard to read but skipped a lot detail in the proofs. There has also been some recent important work by Phillip Andreae.