Skip to content

Allow checkpoint-only version artifact directories#198

Open
anth-volk wants to merge 1 commit into
mainfrom
codex/fix-179-artifact-checkpoint-collision
Open

Allow checkpoint-only version artifact directories#198
anth-volk wants to merge 1 commit into
mainfrom
codex/fix-179-artifact-checkpoint-collision

Conversation

@anth-volk
Copy link
Copy Markdown
Contributor

Summary

Fixes #179.

  • Allow an explicit version artifact directory to be reused when its existing contents are limited to the configured PE-US rebuild checkpoint trees for the same run.
  • Preserve the existing collision behavior for unrelated contents, unconfigured checkpoint contents, missing checkpoint configuration, and non-directory version paths.
  • Forward stage_runtime_writer through save_versioned_us_microplex_artifacts() to match the existing _finalize_versioned_build_artifacts() call path.

Notes on Scope

The checkpoint-only directory allowance is the direct #179 fix. While validating the full versioned-artifacts test file, current main also exposed an adjacent finalization mismatch: _finalize_versioned_build_artifacts() already passed stage_runtime_writer, but save_versioned_us_microplex_artifacts() did not accept or forward it. This PR includes that small pass-through so the live stage-runtime path remains consistent.

Tests

  • ruff check src/microplex_us/pipelines/versioned_artifacts.py tests/pipelines/test_versioned_artifacts.py
  • git diff --check
  • PYTHONPATH=/Users/administrator/Documents/PolicyEngine/microplex-us/src PYTHONDONTWRITEBYTECODE=1 /Users/administrator/Documents/PolicyEngine/worktrees/microplex-us/fix-pe-rebuild-smoke-issues/.venv/bin/python -m pytest -q -p no:cacheprovider tests/pipelines/test_versioned_artifacts.py -k 'configured_checkpoint or unrelated_existing or unconfigured_checkpoint or existing_version_file'
  • PYTHONPATH=/Users/administrator/Documents/PolicyEngine/microplex-us/src PYTHONDONTWRITEBYTECODE=1 /Users/administrator/Documents/PolicyEngine/worktrees/microplex-us/fix-pe-rebuild-smoke-issues/.venv/bin/python -m pytest -q -p no:cacheprovider tests/pipelines/test_artifacts.py::test_source_provider_versioned_build_initializes_live_stage_writer

A full tests/pipelines/test_versioned_artifacts.py run passed before the final non-directory guard was added; after the guard, the focused allocator tests above cover the changed behavior.

@anth-volk anth-volk requested a review from MaxGhenis June 3, 2026 17:28
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.

PE-US rebuild final artifact allocation fails when checkpoint paths are inside version directory

1 participant