Skip to content

Implement atomic run bundle retention - #86

Merged
codeforester merged 1 commit into
mainfrom
enhancement/62-20260804-atomic-run-bundles
Aug 5, 2026
Merged

codeforester merged 1 commit into
mainfrom
enhancement/62-20260804-atomic-run-bundles

Conversation

@codeforester

Copy link
Copy Markdown
Contributor

Summary

  • make private metadata and JSON indexes same-filesystem atomic writes with flush, fsync, atomic replacement, and symlink checks
  • add locked complete-run-bundle retention with count, age, total-size, preservation, active/inherited protection, and stale-running recovery
  • keep max_log_files compatible for legacy flat layouts while routing metadata-backed runs through bundle retention
  • add public RetentionPolicy safe defaults, lifecycle preservation metadata, index refresh, documentation, and security/failure tests

Validation

  • uv run pytest -q
  • ./tests/validate.sh
  • uv run mypy --strict examples/typed_consumer.py

Closes #62

@codeforester
codeforester marked this pull request as ready for review August 5, 2026 00:01
@codeforester
codeforester merged commit 6670562 into main Aug 5, 2026
32 of 34 checks passed
@codeforester
codeforester deleted the enhancement/62-20260804-atomic-run-bundles branch August 5, 2026 00:01
codeforester added a commit that referenced this pull request Aug 5, 2026
## Summary

Add explicit concurrency regression coverage for issue #62:

- concurrent metadata writers must always leave a valid JSON snapshot
- concurrent pruners must serialize through the retention lock and leave
a bounded, valid index

## Validation

- `uv run pytest -q tests/test_run_bundle_retention.py`

Follow-up to #86; closes the concurrency-test gap in #62.
codeforester added a commit that referenced this pull request Aug 5, 2026
## Summary

Remove the redundant post-replacement permission rewrite from atomic
JSON writes. The temporary file is already created with private
permissions and synced before replacement, so re-opening the destination
by path is unnecessary and could create a symlink-swap window.

## Validation

- `.venv/bin/python -m pytest -q tests/test_run_bundle_retention.py
tests/test_app_run_metadata.py tests/test_app_log_retention.py`
- `git diff --check`

Follow-up hardening for #86/#62.
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.

Implement atomic run bundles and complete-bundle retention policies

1 participant