Skip to content

Protect reserved observer files from artifact path aliases - #951

Draft
ktz03 wants to merge 1 commit into
IDSIA:masterfrom
ktz03:fix/ktz03/reserved-artifact-paths-950
Draft

ktz03 wants to merge 1 commit into
IDSIA:masterfrom
ktz03:fix/ktz03/reserved-artifact-paths-950

Conversation

@ktz03

@ktz03 ktz03 commented Nov 9, 2026

Copy link
Copy Markdown

FileStorageObserver blocks literal reserved filenames, but add_artifact(..., name="./config.json") bypasses that comparison and overwrites the saved configuration without an observer error.

Normalize the destination and the four protected paths to absolute, platform-case-normalized paths before comparing them. Keep the existing exception, copy destination, artifact registration and storage layout. Ordinary artifact replacement, including nested/config.json, remains supported. Fixes #950.

Validation on Windows AMD64 / CPython 3.11.16:

  • Complete FileStorageObserver test module: 65 passed, 0 skipped. The same new regression cases on unchanged source give 17 passed / 28 expected failures (20 unrelated tests deselected).
  • Real Experiment.run() -> Run.add_artifact() controls verify preserved configuration for rejected reserved aliases and successful ordinary copies/replacements.

The full Sacred suite, tox/OS/Python matrix and pre-commit were not run locally. The reused environment satisfies runtime/dev requirements; its legacy tests_require constraint mock<5 is unmet by installed mock 5.2.0, which is not imported by the selected tests. No dependency changes were made.

@ktz03
ktz03 marked this pull request as draft November 9, 2026 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FileStorageObserver artifact path aliases can overwrite reserved run metadata

1 participant