top of page

Can a Reader Open a Report While Your Workflow Is Still Writing It?

Oct 24
3 min read
Atomic File Publication: Expose Only Complete Reports: Write a private candidate; Validate the complete file; Publish at one boundary.

A nightly export uses the same filename every day. A partner downloads it just as the next run begins and receives only the first few rows. The export eventually finishes correctly, but the partner has already acted on an incomplete file.


The underlying problem is publication timing. A path that readers can open is being used as a workspace for unfinished output. The acceptance goal is that a reader obtains a complete previous version or a complete new version, never an accidental intermediate state.


Separate preparation from publication


Generate the candidate away from the public filename. Close the writer, validate the result and then perform the supported publication operation. Record the point at which the new file becomes available to readers.


For local files, Python's documentation for os.replace describes replacement and states that a successful rename is atomic, with a warning that crossing filesystems can fail. That is a specific filesystem operation, not a promise that any copy, cloud upload or shared drive behaves the same way.


Example: a partner resource export


Imagine a synthetic export containing a header and one hundred records. The old published version contains ninety records. While the candidate is written, a reader should still obtain the complete old version. After publication, a new read should obtain the complete candidate.


Test the record identities as well as the count. Two malformed rows and two missing rows can still leave the total looking plausible.


Validate before exposing the candidate


Choose checks appropriate to the artifact: successful parsing, required headers, expected encoding, reconciled row count and the absence of known generation errors. A nonzero file size is not sufficient.


If the export has a footer or manifest, verify it as part of the candidate. Record a version identifier or checksum so a partner can report which output they received. Keep that identifier with the publication evidence.


A failure rehearsal


Interrupt generation after only part of the candidate is written in a controlled test environment. Confirm that the public filename still resolves to the complete previous version and that the incomplete candidate is not advertised as current.


Next, simulate a validation failure. The workflow should preserve the usable published artifact, report the failed attempt and avoid sending a success notification.


Distinguish atomic visibility from durable storage


Atomic replacement addresses what a reader sees at the publication boundary. It does not, by itself, establish every guarantee about surviving a machine crash, retaining a backup or synchronizing remote storage.


Ask the implementation owner which storage semantics apply. If power-loss durability matters, require evidence for that requirement separately. If the destination is object storage, use its documented upload and object-version behavior rather than translating a local-file recipe without review.


Multiple writers need their own coordination policy. Two complete candidates can still overwrite each other in the wrong order. Identify the allowed publisher and decide how an older run is prevented from replacing a newer result.


Make recovery visible to operations


The run record should identify the candidate, validation result, published version and final notification status. A failure after publication but before notification is different from a failure before publication.


Give temporary artifacts a retention and cleanup policy. Cleanup must recognize active work and should not remove a candidate another process still owns. Preserve failed candidates only when their diagnostic value justifies the storage and data exposure.


For a handover, ask for three demonstrations: successful publication, interrupted preparation and rejected validation. In each, show exactly what a reader can retrieve. This turns a vague promise to “save the report safely” into a reviewable contract for the partner who depends on it.


The final acceptance record should also state what remains outside scope, such as concurrent writers or crash durability. Explicit limits are more useful than calling the entire export process atomic when only one step has that property.


Continue with the related FutureOS guide for the related planning decision.


The published FutureOS introduction describes the project as being in prelaunch. Use this guide to prepare a concrete project discussion; it does not announce an available FutureOS feature.



Prepared with AI assistance. Primary sources checked on October 24, 2026. Examples and procedures are illustrative editorial guidance, not FutureOS product announcements or an independently reviewed assessment.

Recent Posts

See All

Comments


bottom of page