Make generation cleanup handle-relative#1119
Merged
Merged
Conversation
c751913 to
eed02fe
Compare
eed02fe to
bd50b35
Compare
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.
Closes #1100
Refs #899
Refs #1046
Context
Generation retention and packaged-proof cleanup validated ambient paths and then recursively deleted through them. An ancestor symlink, junction, or reparse swap could redirect that cleanup after validation.
What changed
OwnedDeletionRootboundary incodestory-workspace: callers open a trusted root once and pass only plain relative names.openatwith no-follow handles andunlinkat; Windows rejects reparse traversal and deletes the exact opened handle.CHANGELOG.md.Review
Start with
crates/codestory-workspace/src/owned_deletion.rs, then verify that each consumer supplies a trusted root plus a derived relative path. The Python proof cleanup deliberately keeps marker/archive validation ahead of CLI extraction and deletion.A code-simplifier pass found no justified broad refactor in the touched large files. I kept the OS branches explicit, removed redundant error plumbing, and applied the one clippy simplification in Qdrant cleanup.
Verification
Exact head:
c7519139de78dcc4dd6630c486a408afef97c701cargo test -p codestory-workspace owned_deletioncargo check -p codestory-workspace --target x86_64-pc-windows-msvc --lockedcargo test -p codestory-retrieval active_and_rollback_are_retained_while_stale_bundle_is_removed --lockedcargo test -p codestory-runtime search_generation_retention_keeps_active_and_one_verified_rollback --lockedcargo check -p codestory-cli --lockedafter rebasing ontoorigin/dev/codestory-next@6bd8eb5cargo clippy -p codestory-cli --locked -- -D warningspython3 .github/scripts/check-packaged-agent-proof.py --self-testnode .github/scripts/check-doc-links.mjspython3 -m py_compile .github/scripts/check-packaged-agent-proof.pygit diff --checkRisk and remaining proof
This is a deletion boundary, so the PR stays draft until the Windows-hosted test executes the junction swap and the normal draft CI is green. The Windows implementation and test compile locally, but this Mac cannot execute the Windows test binary. No full workspace or packaged matrix was run for this draft head.