/** * .what = converges a file to the given content, and writes only when it differs * .why = for a file WE author and a consumer never edits — a doc we ship into * their temp root. its content changes whenever we change it, so drift is * expected rather than a conflict * * .the hazard this exists to end = findsertFile THROWS on content drift. that is * right for a file whose content is a contract, and catastrophic for a doc: * every readme edit would break the next genTempDir call of every consumer * whose temp root predates the upgrade, deep inside their own test * * .note = 🔴 it does NOT stage-and-rename, and the absence is the design. a staged * `..staged` lands in the temp ROOT — the shared namespace the * run reclaim, both age-gate passes, the arrears check, and the consumer's * own clamp all iterate — and it matches NONE of their filters. a process * killed between the write and the rename would leave a file no mechanism * can ever reclaim: permanent residue, planted by the very behavior whose * wish is that no entry survive the run that made it * * .note = the content check is what makes atomicity unnecessary rather than merely * unaffordable. this runs on EVERY genTempDir call, in every worker — but * after the first write the content already matches, so the common path * performs NO WRITE AT ALL. concurrent writers are not made safe here; they * are made almost unreachable, which is the stronger property */ export declare const upsertFile: (input: { path: string; content: string; }) => void;