this is very much married to my own interpretation of lily (@vivaciousandcharming) and what i'm doing over there, this is a conjoined headcan. but most of the world did not know harry's sex for weeks after his birth. nor neville's.
dumbledore advised lily and james and frank and alice to keep it a secret, the better to protect both families. the birth dates were also kept a secret.
on the potter side of things, sirius was the only one of their friends who knew for a good bit, he was harry's godfather. lily and james go into hiding officially a little bit after harry's birth, but it's not deep hiding. they are protected by layer after layer of enchantments, but it's not the fidelius charm yet.
voldemort turns peter in september of 1980. shortly after, after meeting harry for the first time and attending order meetings, he drops his first bit of of information for voldemort: the sexes of the potter and longbottom babies, their names, and birthdates.
but voldemort is prudent, and frankly, two fuckass babies can wait a bit on his quest for dominance. the other war efforts demand his attention now. he only wants to murder one family if i can help it, and somehow turn the other family to his side.
so peter watches, reporting what he can on both kids/parents. mostly he has access to harry, but he learns things about neville too. even better, he has access to other order members. that period of several months where order members are dropping like flies? yeah that came about based off of intel peter gave.
all the while the babies are growing, and voldemort is coming closer to a decision. or rather, he's becoming more confident in the choice he made from the beginning. because it was always going to be harry, the half-blood, he marked as an equal. his parents were more exceptional than neville's after all. and he was born quite literally as the seventh month died too.
once he makes his final decision, peter has one last bit of information to give. the location of the potter house once their under the protection of the fidelius charm. peter gives it three days before he spills the beans. four days later, voldemort makes his move.