In this article
A declared output directory is managed as a unit; independent jobs should not treat its child paths as unrelated safe storage.
A later rerun removes another rule’s files
A model export rule declares an entire bundle directory as its output. Another rule writes a tokenizer file inside that same directory. When export reruns, its managed output cleanup can remove the tokenizer file too. The workflow has assigned overlapping ownership to paths that appear to belong to different logical operations.
Draw the producer relationship for each bundle member. The final directory should represent a deliberate assembly boundary, not a shared workspace where unrelated rules deposit files without a common dependency contract.
Directory outputs have special freshness behavior
The Snakemake rule reference describes directory outputs and the hidden timestamp used for their modification-time assessment. A directory output is not simply a promise to independently track every arbitrary change beneath its path.
Review which actual files establish the bundle’s validity. If individual members are meaningful outputs, explicit file declarations may express the graph more clearly. If the directory is the intended unit, its producer should assemble and validate the complete representation intentionally.
Ownership matters when a job executes again
The same reference explains cleanup of a declared output directory before its producing job executes. A separate rule writing inside that directory can therefore lose data when the owner reruns. Ordering a writer after the export once does not remove the overlapping ownership on future runs.
Use a dedicated assembly step or distinct intermediate locations where appropriate. The basic tutorial explains file-based producer-consumer dependencies; make those relationships visible instead of relying on incidental historical execution order.
Bundle completeness is a semantic contract
An artifact release manifest identifies the coordinated model members. A directory that exists but lacks a required tokenizer or configuration is not a valid bundle for the intended consumer. Physical existence and model completeness need different checks.
For generated tables inside the bundle, use explicit schema validation. A successful export command can still produce a structurally incomplete or semantically incompatible set of files if the workflow never defines the expected members.
Exercise a producer rerun deliberately
Use a small bundle and trigger the directory-producing rule again. The command-line guide documents execution controls; inspect the real child files before and after the controlled rerun.
Confirm that the final consumer sees the complete intended bundle under an unambiguous producer relationship. The useful result is clear ownership and reproducible assembly, not merely a directory that survived one successful execution sequence.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.