Surface codes are grids of qubits whose topological geometry protects a logical qubit from errors affecting the physical ones. Major efforts are underway to infer whether physical errors have combined to flip the encoded logical qubit. In this regard, neural-network decoders, which learn this from data, are an active field of investigation. We show that the logical signal can be read as an exact topological pairing, computed in closed form from the graph Laplacian: a discrete Poisson solve with two grounded boundaries yields a harmonic reference, whose pairing with the syndrome returns the logical class as a homological invariant. We embed this readout as a hard architectural constraint in a physics-informed graph neural network, trained on simulated data, and demonstrate it on surface codes at distances 5 and 7.