Durable orphan naming for manifest and binary replace paths (#29) - #72
Merged
Merged
Conversation
When manifest lock publish or binary probe rollback fails after displacing the live file, rename the recovery backup beside the destination root to .tink-orphan-<name>-<unique> instead of retaining temp-prefixed paths. Extract shared orphan naming helpers in paths.rs and reuse them from skills::rollback_or_retain_backup. Fall back to tempfile keep() only when the durable rename fails. Add characterization tests and update RELIABILITY.md plus the #29 spike matrix. Shared swap-helper unification remains open on #29. Co-authored-by: jon <jonathan10620.dev@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed / why
Issue #29 residual: tree replace already renames displaced originals to
.tink-orphan-*on double failure (#70). Manifest (manifest::write_atomic) and binary (update::replace_binary) still retained recovery artifacts under temp prefixes (.skills-manifest-backup-*,.tink-backup-*) viakeep().This PR aligns file replace paths with the tree safety story:
.tink-orphan-<file-name>-<unique>.recovery backup: …).keep()is used only when the durable orphan rename fails.paths::orphan_recovery_pathandpaths::move_file_to_orphan;skills::rollback_or_retain_backupnow reuses the naming helper.Happy path and successful single-failure rollback leave no durable orphans (existing + extended characterization tests).
Proof commands + test names
What remains on #29
publish_staged_tree,write_atomic, andreplace_binary(explicitly out of scope for this PR).docs/issue-29-verification-spike.md.#29 should stay open until the shared-helper consolidation slice is tracked/landed separately.
Fixes the manifest/binary durable-naming slice of #29; does not close #29.