Repository navigation
fix(meetings): finish a meeting delete a held file interrupted - #32190
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. Keeping Notes
[DESIGN-REVIEWED] 19e4f65 Description read[DESCRIPTION-READ] 503e7aafa06c06a5473254518d1acd6739205bf0ff3374462df81703384977f0 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix works on the cause: Not checked: Windows What this change shipsInventory (6 items) — 6 justifiedIntent: let a user finish deleting a meeting on Windows when another program holds one of its files open. FIX.
[FIRST-PRINCIPLES-REVIEWED] 19e4f65 Description read[DESCRIPTION-READ] 2203d9fc00fddd12439aa5165eeaddf90acc30ff2a34e985c0c458bb15a0dc83 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
8cb1e00 to
daff96e
Compare
|
Rebased: main moved in docs/system-specs/modules/*.md and src/kiro_crew/acp/skill_projection.py (plus 22 more overlapping by directory or import) since this head went green (b65af1a -> 0795ebc); CI re-running. [operator: bolichen97] The same push removes a link or junction inside a meeting through the existing unlink_link_or_junction helper (GPT 6.1 finding on 347fd32), with a junction test on Windows. |
daff96e to
9618255
Compare
|
[operator: bolichen97] test/test_security_gate_liveness.py::test_the_package_stays_within_its_line_budget is red on main too (this PR does not touch src/kiro_crew/security_gate); #32183 raises the budget. This PR waits for it and rebases once it merges. |
9618255 to
19e4f65
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (11 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: meeting delete and app uninstall retry a Windows file another program holds open (#27832). Spec files changed as a ride-along (a minority of the diff on both file count and changed lines), not reviewed as a design decision: docs/system-specs/common/platform-compat.md, docs/system-specs/modules/meetings.md.
On Windows, deleting a custom appearance pack while another program held one of its files open (an editor, an indexer, an antivirus scan) failed with WinError 32 and left a half-deleted pack behind. The delete now goes through platform_compat.remove_with_retry, which waits out the sharing violation for about three seconds, the same helper the meeting delete uses since #32190. Where shutil.rmtree walks a folder by path (Windows), the pack's entries are removed one at a time with manifest.json last, so a hold that outlasts the wait leaves the pack listed and a second delete finishes it. Everywhere else the delete stays one shutil.rmtree call, which removes through the folder it opened. The platform-compat helper table names the pack delete among its callers. Part of #32171
On Windows, deleting a custom appearance pack while another program held one of its files open (an editor, an indexer, an antivirus scan) failed with WinError 32 and left a half-deleted pack behind. The delete now goes through platform_compat.remove_with_retry, which waits out the sharing violation for about three seconds, the same helper the meeting delete uses since #32190. Where shutil.rmtree walks a folder by path (Windows), the pack's entries are removed one at a time with manifest.json last, so a hold that outlasts the wait leaves the pack listed and a second delete finishes it. Everywhere else the delete stays one shutil.rmtree call, which removes through the folder it opened. The platform-compat helper table names the pack delete among its callers. Part of #32171
On Windows, deleting a custom appearance pack while another program held one of its files open (an editor, an indexer, an antivirus scan) failed with WinError 32 and left a half-deleted pack behind. The delete now goes through platform_compat.remove_with_retry, which waits out the sharing violation for about three seconds, the same helper the meeting delete uses since #32190. Where shutil.rmtree walks a folder by path (Windows), the pack's entries are removed one at a time with manifest.json last, so a hold that outlasts the wait leaves the pack listed and a second delete finishes it. Everywhere else the delete stays one shutil.rmtree call, which removes through the folder it opened. The platform-compat helper table names the pack delete among its callers. Part of #32171
Problem / Motivation
Goal: Deleting a meeting on Windows while another program holds one of its files open finishes the delete, or fails in a way that a second delete completes.
On Windows, a meeting delete contended by a held file half-deletes the meeting, and a retry answers not found.
delete_meetingremoved the session directory first with a bareshutil.rmtree; a file held withoutFILE_SHARE_DELETEstopped it partway, aftersession.json(the existence marker) was already gone. The retry then returnedFalse, the route answered 404meeting_not_found, and the transcript, edits or note stayed on disk.Why it matters
A user who deletes a meeting while an editor, indexer or antivirus scan has its transcript or note open cannot finish the delete from the product, and the private transcript text stays on disk out of the delete route's reach.
Not a goal
rmtree(code_review_sage,appearance_packs,pptx_maker), tracked in windows: code_review_sage and appearance pack deletes fail on a briefly held file, bare shutil.rmtree with no retry #32171.What changed (motivation → approach → change)
On Windows a held file no longer fails a meeting delete if it is let go within about three seconds. A longer hold gets an error naming the file, and deleting again after the program lets go finishes. POSIX is unchanged.
delete_meeting(meetingsstore.py)session.json, thensession.jsonand the folder. Any failure leavessession.json, so a retry finds the meeting. A held file that outlasts the wait answers500 meeting_delete_failedwith the file name, as JSON the dashboard can showremove_with_retryinsrc/kiro_crew/platform_compat_files.py, forwarded bysrc/kiro_crew/platform_compat.pywinerror32/33, 15 attempts x 0.2 s, no sleep on an event-loop thread, the final error names the held file plus the caller's hint. A link or junction is unlinked, never followedmanager_uninstall._rmtree_app_dirContainment, the link refusal and
meta_transaction()indelete_meetingstay as they are. Specsplatform-compat.md(helper table) andmeetings.md(delete paragraph) describe the new behaviour.Backwards compatibility
Compatible: every delete that succeeds today succeeds the same way; a held file that used to fail at once now waits first, and the meeting route answers JSON instead of a bare 500.
Reader: src/kiro_crew/apps/manager.py:_RMTREE_MAX_ATTEMPTS -- app -- the three uninstall retry constants leave the
managerfacade and live inplatform_compat_files; the only reader, test/test_app_manager.py, reads them thereTests
test/test_meetings_store.py:test_delete_waits_out_a_file_held_open_briefly(one sharing violation ontranscript.jsonl, the delete returnsTrueand every tree is gone) andtest_delete_held_past_the_budget_keeps_the_marker_for_a_retry(violation on every attempt:500 meeting_delete_failednaming the file,session.jsonsurvives, a later delete returnsTrue). Both fail with the olddelete_meetingbody.test_delete_unlinks_a_directory_link_inside_the_meeting_without_following_itpins that a link inside the meeting is removed and its target kept (a symlink on POSIX, a junction on Windows).test/test_app_manager.pyuninstall retry tests patch the moved constants; assertions unchanged.test/test_manager_uninstall.pyunchanged and green.test/test_platform_compat_refactor_facade.pylists the helper and its constants;test/link_screen_sites.pyrecordsremove_with_retryas a site that unlinks a link and never traverses one.test/test_meetings_store.pyrun 10 times, each in a fresh shuffled order, 73 of 73 every run.Proof: PROVEN test/test_platform_compat_refactor_facade.py::test_every_moved_name_is_defined_by_its_owner_and_read_through_the_facade[kiro_crew.platform_compat_files-_SHARING_VIOLATION_WINERRORS], test/test_platform_compat_refactor_facade.py::test_every_moved_name_is_defined_by_its_owner_and_read_through_the_facade[kiro_crew.platform_compat_files-_RMTREE_MAX_ATTEMPTS], test/test_platform_compat_refactor_facade.py::test_every_moved_name_is_defined_by_its_owner_and_read_through_the_facade[kiro_crew.platform_compat_files-_RMTREE_BACKOFF_SECONDS], test/test_platform_compat_refactor_facade.py::test_every_moved_name_is_defined_by_its_owner_and_read_through_the_facade[kiro_crew.platform_compat_files-remove_with_retry], test/test_platform_compat_refactor_facade.py::test_every_moved_name_is_forwarded_unless_code_still_here_reads_it (head 9618255)
Manual verification
Native Windows 11, a scratch
KIROCREW_HOME, one meeting withsession.json,transcript.jsonl, an edits sidecar and a note. A second process holds one file withopen(..., "rb").transcript.jsonl, 1 sFalseTruein 1.0 s, nothing leftnote.md, 1 sFalseTruein 1.0 s, nothing lefttranscript.jsonl, 10 sFalsemeeting_delete_failednaming the file after 2.8 s;session.jsonkeptTrue, nothing leftTrueTrueThe issue's portable script prints
FAIL: marker deleted, rest of tree strandedon this host.Related Issues
Closes #27832
Refs #24889
Sibling sweep
Swept: git grep -nE "shutil.rmtree(" -- src/kiro_crew/apps src/kiro_crew/appearance_packs
Sibling: src/kiro_crew/apps/builtins/meetings/backend/store.py -- changed here
Sibling: src/kiro_crew/apps/manager_uninstall.py -- changed here
Sibling: src/kiro_crew/apps/builtins/code_review_sage/sage_lib/store.py -- tracked in #32171
Sibling: src/kiro_crew/apps/builtins/code_review_sage/sage_lib/learning.py -- tracked in #32171
Sibling: src/kiro_crew/appearance_packs/store.py -- tracked in #32171
Sibling: src/kiro_crew/apps/builtins/pptx_maker/backend/routes.py -- not affected -- an engine-asset move that #15394 rewrites
Pattern harvest
Not generalizable: whether a delete must keep an existence marker until last depends on what each store treats as "exists", which a rule cannot see; the retry itself is now one shared helper.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)