Verification spike: issue #26 skill refresh data-loss path - #68
Merged
Merged
Conversation
Characterize publish_staged_tree / rollback_or_retain_backup on current main, add publish-failure rollback test, document proof gaps vs #29, and clarify K10 acceptance for double-failure recovery retention. Co-authored-by: jon <jonathan10620.dev@gmail.com>
jon-devlapaz
marked this pull request as ready for review
September 9, 2026 17:00
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.
Verdict
Partially mitigated — the original silent-drop failure mode from #26 is not present on current
main. On publish+rollback double failure,rollback_or_retain_backupcallsTempDir::keep()and the error names the recovery backup path. #26 can be closed as mitigated for the refresh/replace path. #29 should stay open for the shared durable helper, temp-ish recovery naming, and other call sites.Background checked
Issue #26 (opened @
7209ca3) described: live skill moved to staging backup; if publish and restore both fail, droppingTempDirdeletes the only copy.Current
main(4c86577) uses a different path.Current behavior (characterization)
Skill refresh flows through:
refresh::refresh_skill→skills::replace_verified(src/refresh.rs:177)replace_verified_innerstages beside destination, copies tonew/, then callspublish_staged_tree(src/skills.rs:791-820)publish_staged_tree(src/skills.rs:778-788):rename(target → staging/old)rename(staged → target); on failure →rollback_or_retain_backuprollback_or_retain_backup(src/skills.rs:752-773):staging.keep(), build recovery pathkept/old, return error namingrecovery backup: <path>Same helper is used by library promotion (
src/library.rs:163) and skillset refresh publish (src/skillsets.rs:527,1252).Evidence
Commands run
All passed locally on Linux x86_64.
Key assertions
skills::tests::rollback_failure_retains_recovery_backuprollback_or_retain_backup: error containsrecovery backup, original bytes remain atkept/old/skills::tests::publish_staged_tree_restores_target_when_publish_fails(new)publish_staged_treeseam: missingnew/→ publish fails → rollback restores original target bytes; no recovery backup messagek10_skillset_refresh_updates_clean_tree_and_refuses_local_editsWhat is not proven
publish_staged_treeline 786 →rollback_or_retain_backup) is the strongest honest proof available without Refactor: durable atomic skill-tree swap (shared helper) #29 refactors.Residual risks vs #29
.tink-update-*/.tink-promote-*beside destination — operator-visible but not a durable orphan name (#29 design target)install_local(first install)src/skills.rs:735-746). Different failure shape; not #26's replace pathkeep()inmanifest::write_atomic(src/manifest.rs:346-364) — #29 scopeupdate::replace_binaryhas its own keep-on-rollback-failure path (src/update.rs:442-451)keep()winning the raceACCEPTANCE.md)Recommendation
Changes
publish_staged_tree_restores_target_when_publish_failsunit testdocs/RELIABILITY.md, proof gaps indocs/TESTING.mdRelates to #26, #29