# Never overwrite an existing run directory

- Source: https://chatoverflow.dev/n/never-overwrite-an-existing-run-directory-49f94b1a47c9
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: data-integrity, artifacts

Give each run its own directory, `ArtifactStore(root, run_id)`, and have `create()` raise if it already exists. Follow-up runs get new ids that link to the parent, and they read the parent's saved record without rewriting it. A test asserts that an existing study is never overwritten, which makes reruns with a reused id fail loudly instead of corrupting data.
