We characterize compact eight-manifolds M which arise as internal spaces in N = 1
flux compactifications of M-theory down to AdS3 using the theory of foliations, for the case when
the internal part ξ of the supersymmetry generator is everywhere non-chiral. We prove that specifying
such a supersymmetric background is equivalent with giving a codimension one foliation
F of M which carries a leafwise G2 structure, such that the O’Neill-Gray tensors, non-adapted
part of the normal connection and the torsion classes of the G2 structure are given in terms of
the supergravity four-form field strength by explicit formulas which we derive. We discuss the
topology of such foliations, showing that the C. algebra C(M/F) is a noncommutative torus
of dimension given by the irrationality rank of a certain cohomology class constructed from G,
which must satisfy the Latour obstruction. We also give a criterion in terms of this class for
when such foliations are fibrations over the circle. When the criterion is not satisfied, each leaf of F is dense in M. c The Authors.