Skip to content

fix: let the person delete an empty folder inside a Bot's folder - #38808

Merged
buluoray merged 1 commit into
mainfrom
crew/slack/37434-bot-subfolder-delete
Nov 18, 2026
Merged

buluoray merged 1 commit into
mainfrom
crew/slack/37434-bot-subfolder-delete

Conversation

@buluoray

@buluoray buluoray commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #37434

Problem / Motivation

Goal: the person can delete an empty folder inside a Bot's home folder, and "Clean up empty folders" offers it, while the home folder itself stays the Bot's.

A Bot files every folder it makes under its own home folder. When the work in one ends, the empty folder stays in the sidebar for good: the person's delete is refused mate_home_locked (403), and "Clean up empty folders" skips every folder in a Bot's home, so clicking it does nothing for them.

Why it matters

A busy Bot makes one sub-folder per task, so the sidebar fills with empty folders that the person can only clear by deleting the whole Bot or editing folders.json by hand (#37434).

Not a goal

  • Deleting, renaming, moving or recoloring a Bot's home folder.
  • Deleting a sub-folder that still holds a live, archived or scheduled session, or a child folder.
  • Moving, renaming or hiding a Bot's sub-folder.
  • Changing what a Bot, an app or another crew member may delete.

What changed (motivation → approach → change)

This implements docs/request-for-change/rfc-bot-subfolder-person-delete.md, accepted by a maintainer on #38152.

Root cause: api_chat_folder_delete refused every write into a Bot's home with one test (is_mate_home(target) or refuses_write_into(...)), and removable_folder_ids treated the whole home subtree as kept.

Path Before After
Person deletes the Bot's home mate_home_locked mate_home_locked
Person deletes an empty folder inside it mate_home_locked deleted
Person deletes a non-empty one mate_home_locked folder_not_empty (409)
An app, another Bot, or an agent tool call in the person's session mate_home_locked mate_home_locked
Sidebar menu on an empty sub-folder none Delete folder only
"Clean up empty folders" skips the whole home offers empty sub-folders, keeps the home
  • dashboard/mate_subfolder_delete.py holds the person's empty-only delete and is_person_browser (no app, no member, no internal secret). It counts archived sessions first, then, under the folder-store lock, refuses a folder with a child folder, a live or closing session, or a saved cron job filing into it. An unreadable cron store deletes nothing (503).
  • chat_folders_routes.py sends a delete of a folder inside a Bot's home there only when is_person_browser holds; every other caller is refused as before.
  • chat_folder_cleanup.py uses the same check. It keeps the home rows, keeps a Bot sub-folder that holds an archived session or carries a project_dir, and keeps every folder in a Bot's home for any other caller or for a root scope inside a home. The confirm step re-reads archived counts in _prepare under the lock.
  • website/src/utils/mateFolders.ts (isEmptyBotSubfolder), folderBlocks.tsx and boardLane.tsx open a Delete-only menu on an empty Bot sub-folder, in the list view and in board columns.
  • Docs: session-control.md, the feature map and the path B §6 row name the exception; the RFC moves to accepted and names each refusal's code; docs/decisions/2026-11-17-the-person-may-delete-an-empty-folder-inside-a-bots-home.md records the maintainer's sign-off.

Backwards compatibility

Compatible: a call refused today can now succeed for the person on an empty Bot sub-folder; nothing that works today stops working.

Removes nothing: no field, route or key is removed; the change only allows a delete that was refused.

Tests

  • test/test_mate_folder_routes.py: the person deletes an empty sub-folder, even one with a project_dir; one with a child folder, a live, closing, cron-filed or archived session gets 409 and stays; an unreadable cron store gets 503; another Bot, an agent tool call and a delete of the home are refused; a cron job saved before the delete keeps the folder and one saved after it is refused (two event-gated tests on the real folder-store lock).
  • test/test_chat_folder_cleanup.py: the cleanup offers an empty sub-folder and never the home; an icon or color does not keep one, a project_dir does; the confirm keeps one that gained an archived session after the preview; an internal caller and a root scope inside a Bot's home remove nothing.
  • test/test_mate_folders.py: a conductor naming the deleted sub-folder files in its home.
  • website/src/test/ChatSidebar.mateFolderWrites.test.tsx: the empty sub-folder's menu holds only Delete folder; no menu on one with an archived session.
  • Local run: 347 backend tests (the touched files plus the wait and flake ratchets) and 1,893 sidebar frontend tests pass. The cron-ordering tests wait at most 60 s on each signal, above the wait ratchet's 30 s floor.
  • Cost of the confirm's archived-count re-read (_folder_history_counts, off the event loop): median 1.4 ms at 1,000 sessions and 6.6 ms at 5,000 on a warm index.
  • Proof: PROVEN test/test_chat_folder_cleanup.py::TestCleanupOfBotSubfolders::test_the_person_is_offered_an_empty_one_and_never_the_home, test/test_chat_folder_cleanup.py::TestCleanupOfBotSubfolders::test_a_setting_the_bot_chose_does_not_keep_one[setting0], test/test_chat_folder_cleanup.py::TestCleanupOfBotSubfolders::test_a_setting_the_bot_chose_does_not_keep_one[setting1], test/test_chat_folder_cleanup.py::TestCleanupOfBotSubfolders::test_confirm_keeps_one_that_gained_an_archived_session, test/test_mate_folder_routes.py::TestAPersonMayDeleteAnEmptyFolderInsideAMateHome::test_an_empty_one_is_deleted (head 69b0c1f)

Manual verification

node website/capture/shoot-bot-subfolder-delete.mjs renders the real sidebar with a fixed folder tree, in the list view and in a board column, and asserts: the empty sub-folder shows 0 at rest like any empty folder; its menu holds one item, Delete folder; no menu on the Bot's home or on a sub-folder with archived sessions; and the confirm dialog names the folder (28 checks, both themes). With a list row's menu open, the row's action buttons cover its count on every folder, the same as on main.

Screenshots / video

Component render, not the live page.

List view at rest: the empty sub-folder shows 0
Menu on the empty Bot sub-folder, list view
Menu on the empty Bot sub-folder, board column
Delete confirm for the empty Bot sub-folder
Menu on the empty Bot sub-folder, light

Related Issues

Fixes #37434. RFC: #38152. Refs #34316, #34297.

Follow-up (not in this PR): the delete confirm reads "Sessions will be ungrouped." even for an empty folder. That is main's existing wording for every folder, left unchanged here.

Sibling sweep

Swept: git grep -n "mate_home_subtree_ids|refuses_write_into(state._folders, fid" -- src/
Sibling: src/kiro_crew/dashboard/chat_folders_routes.py -- changed here
Sibling: src/kiro_crew/dashboard/chat_folder_cleanup.py -- changed here
Sibling: src/kiro_crew/dashboard/chat_folder_suggest.py -- not affected -- it only hides Bot folders as move targets

Pattern harvest

Not generalizable: a product rule (who may delete in a Bot's home) changed by an RFC, not a repeatable coding defect.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners November 17, 2026 23:18
@buluoray
buluoray requested a review from bolichen97 November 17, 2026 23:18
@buluoray
buluoray enabled auto-merge (squash) November 17, 2026 23:18
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of c08aebe3838fe54295d223f9a709672df6dc0dd0 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: an accepted RFC and a decision record back the change, it only loosens one refusal for the person's browser, and five rendered screenshots cover the new menu.

[DESIGN-REVIEWED] c08aebe

Description read

[DESCRIPTION-READ] 3ba4d39157cf0353cbf84de2efbca45566431ed7417701f3d3531cbf8bef9215

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ human override accepted

@buluoray overrode this lane for c08aebe3838fe54295d223f9a709672df6dc0dd0 via /ai-review override (this commit only).

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of c08aebe3838fe54295d223f9a709672df6dc0dd0 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks: the blind reader understood the ⋯ menu, "Delete folder" and the confirm dialog on the Bot sub-folder, and said they would use all three.

Notes

  • Confirm copy "Delete 'PR review'? Sessions will be ungrouped." describes sessions that can't exist, because this menu only appears on an empty folder. The reader called it "the only hint that my chats are kept." For an empty folder, say "Delete empty folder 'PR review'?" instead. The PR already lists this as a follow-up.
  • The board-column copy (shot-03) had the blind reader confused about the folder counts ("Radar says 2… but 0 in shot 3", "Triage… no number here"). That's existing behaviour, but the PR's main screenshot shows it. Use a fixture whose counts match across both views.

[UX-REVIEWED] c08aebe

Description read

[DESCRIPTION-READ] 022297d7ea0fd2d2a0f62078f1bd22a8de4ae5e97aab4d2a8772ee2532ac02dd

That sha256 names everything this verdict read: the PR description, plus the 8 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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed c08aebe3838fe54295d223f9a709672df6dc0dd0 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] c08aebe

Verdict parsed from the review's SHA-scoped output markers for commit c08aebe3838fe54295d223f9a709672df6dc0dd0.

False positive or not applicable? A repository writer can comment:
/ai-review override fable c08aebe3838fe54295d223f9a709672df6dc0dd0 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of c08aebe3838fe54295d223f9a709672df6dc0dd0 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] c08aebe

False positive or not applicable? A repository writer can comment:
/ai-review override gpt c08aebe3838fe54295d223f9a709672df6dc0dd0 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 18, 2026
@buluoray
buluoray force-pushed the crew/slack/37434-bot-subfolder-delete branch 2 times, most recently from 7a3c444 to e0a57a2 Compare November 18, 2026 00:19
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 18, 2026
@buluoray
buluoray force-pushed the crew/slack/37434-bot-subfolder-delete branch from e0a57a2 to 69b0c1f Compare November 18, 2026 00:58
@buluoray

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 69b0c1f owner-decision: maintainer Bolin approved the RFC for this change and merged it (#38152 (review)); this PR records that acceptance by setting the RFC status to accepted.

@github-actions

Copy link
Copy Markdown
Contributor

AI-review override not recorded: class owner-decision needs a link to the owner's decision comment (https://github.com/<owner>/<repo>/pull/<n>#issuecomment-<id>) in the reason. Use /ai-review override <fable|gpt|design|ux|first-principles|scope|all> <current-sha> <class>[ #N]: <reason, 20 to 500 characters>, where <class> is one of false-positive, not-applicable, pre-existing, evidence-supplied, infra-failure, reissue, deferred, owner-decision. What each class needs: docs/ci/ci-and-reviews.md#risk-release-records.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 18, 2026
@buluoray

Copy link
Copy Markdown
Contributor Author

Decision record: the design for this change is RFC #38152, which maintainer @bolichen97 approved (#38152 (review)) and merged. This PR implements that accepted RFC and moves its status from draft to accepted.

@buluoray

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 69b0c1f owner-decision: maintainer approved and merged the RFC this PR implements; this PR records it as accepted: #38808 (comment)

@github-actions

Copy link
Copy Markdown
Contributor

AI-review override not recorded: the handler could not load its command reader (a GitHub read failed, not your command). Re-issue the command.

@buluoray

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 69b0c1f owner-decision: maintainer approved and merged the RFC this PR implements; this PR records it as accepted: #38808 (comment)

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@buluoray recorded a owner-decision release (class owner-decision) for the first-principles AI finding on 69b0c1faa77ed1a219d40544f211e4baf91ecaab.

maintainer approved and merged the RFC this PR implements; this PR records it as accepted: #38808 (comment)

This decision applies only to this commit. A new push requires a new judgment.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Nov 18, 2026
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

This changes behaviour users already rely on, so it needs a design sign-off from a maintainer before it can merge. A maintainer will post the decision here.

The PR links the merged RFC #38152 as its design. A maintainer should confirm here that this implementation matches it.

The author's own override cleared the First-Principles lane on this head (owner-decision, citing the author's comment), and that lane's original finding can no longer be read. This change turns a 403 that main returns into an allowed delete, so a maintainer other than the author should read that finding before merging.

Review result: no blocking finding on 69b0c1f.

  • The new allow applies only when the caller is the person's browser: no app or member principal and no internal secret header. Every other caller still gets mate_home_locked, and the Bot home stays refused.
  • The checks for child folders, live and closing sessions, and cron jobs run inside the folder-store callback. A cron store that cannot be read is refused with 503. Two event-gated tests prove the cron ordering.
  • Every RFC exit criterion has a named backend test. PR Readiness is green on this head.

Optional:

  • website/src/pages/chat-sidebar/boardLane.tsx: no vitest covers the board-column menu or the new !mateManaged guard on New chat. One case with tagColumnsEnabled: true and a Bot sub-folder would pin both.
  • docs/request-for-change/rfc-bot-subfolder-person-delete.md:17: the body still says "Status: draft. Nothing is built" while the front matter says accepted.
  • src/kiro_crew/dashboard/mate_subfolder_delete.py:123: the post-removal steps (icon epochs, pending icon task, slots push, audit) are a third copy of the ones in chat_folders_routes.py. One shared helper would keep the three delete paths in step.

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head 69b0c1faa7. No blocking defect found, but not approving: KiroCrewCaptain asks for a maintainer design sign-off that this implementation matches the merged RFC #38152, and the First-Principles lane was cleared by the author's own override. A maintainer other than the author must sign off.

What I checked:

  • src/kiro_crew/dashboard/mate_subfolder_delete.py: the allow applies only to the person's browser (is_person_browser: no principal, no internal secret). The Bot home itself still returns mate_home_locked. Child folders, live and closing sessions and cron jobs are checked inside the mutate_folders callback, archived sessions before it, and an unreadable cron store returns 503 and deletes nothing.
  • Tests: test/test_chat_folder_cleanup.py, test/test_mate_folder_routes.py, test/test_mate_folders.py and the other chat-folder / mate-folder suites pass at head (502 passed, -n 8).

Small items (non-blocking): the RFC body line 17 still says "Status: draft. Nothing is built" while its front matter says accepted, and no vitest covers the board-column menu's new !mateManaged guard.

AI-assisted, sent by Bolin Review bot

@buluoray

Copy link
Copy Markdown
Contributor Author

Thanks for the review (5952969566). Both small items are fixed in 9ac10ac81b1:

  • RFC status line. rfc-bot-subfolder-person-delete.md line 17 now says the RFC is accepted, names docs(rfc): propose person-only delete of empty Bot sub-folders #38152 as the approval and fix: let the person delete an empty folder inside a Bot's folder #38808 as the build, and the front matter carries doc-pr: 38152 and implementation-prs: [38808].
  • Board-column menu test. ChatSidebar.mateFolderWrites.test.tsx adds "a board column gives an empty folder inside a mate home a Delete-only menu". It checks that the column copy of the empty child opens a menu with one Delete item, and shows no header or empty-body new-chat button. Removing the !mateManaged guard on the column's new-chat button turns this test red (checked locally, then restored).

No code outside the test changed. The open ask is still the maintainer sign-off that the build matches RFC #38152.

@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: passed Eligible automated validation passed for the current revision labels Nov 18, 2026
@buluoray
buluoray force-pushed the crew/slack/37434-bot-subfolder-delete branch from 9ac10ac to 85725a3 Compare November 18, 2026 08:47
@buluoray

Copy link
Copy Markdown
Contributor Author

Disposition for the review of 9ac10ac81b1. The fix is in 85725a36b99, which is also rebased onto main because the branch had a conflict in docs/request-for-change/README.md.

Opus 5.5, BLOCKING, folderBlocks.tsx:58 / boardLane.tsx:84: fixed. The finding is right. slotFolders is built from the person's filtered list, which leaves out a live mate thread's sessions, so a sub-folder that still held one looked empty and got a Delete menu the server would refuse with 409. This is one class with two sites, and both now use the same new selector:

  • selectFoldersHoldingSessions (website/src/store/personSlots.ts) reads the full store slots, state.dashboard.slots, the list the server's state._slots check matches. It is memoized on the raw rows.
  • ChatSidebar.tsx reads it once and passes it on the sidebar scope as foldersHoldingSessions. folderBlocks.tsx and boardLane.tsx call foldersHoldingSessions.has(folder.id).
  • New test in ChatSidebar.mateFolderWrites.test.tsx: "a folder inside a mate home that holds a live Bot thread's session offers no menu". If folderBlocks.tsx goes back to slotFolders, this test fails (checked locally, then restored).
  • Checked: 169 sidebar test files and 1898 tests pass. The backend chat-folder and mate-folder suites pass: 513 tests.

Design (PASS) and First Principles notes, item 9: the duplicate of the if_empty branch. Not changed in this PR. delete_empty_bot_subfolder deliberately refuses more than if_empty does: closing slots, cron-filed folders, and an unreadable cron store. Making if_empty use the same rule would change the delete that every ordinary folder uses, and this PR's goal does not cover that. Merging the two into one remover is a fair follow-up.

Design note: project_dir asymmetry. This is deliberate. The RFC states it and says why the cleanup keeps such a folder: a bulk cleanup must never move a Bot's later work out of its repository. A single delete is the person's explicit choice for one folder. The bulk cleanup offers a whole set at once, so it keeps a folder that carries a project_dir.

First Principles BLOCK (the RFC still reads draft on base). Same finding as on the earlier heads. #38152 merged with a maintainer's approval, and the repository owner records the override.

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 18, 2026
@buluoray
buluoray force-pushed the crew/slack/37434-bot-subfolder-delete branch from 85725a3 to c08aebe Compare November 18, 2026 09:46
@buluoray

Copy link
Copy Markdown
Contributor Author

Disposition for GPT 6.1 on 85725a36b99. The fix is in c08aebe3838.

GPT 6.1, BLOCKING, security-class, mate_subfolder_delete.py:101: "Cancellation after a committed delete skips its audit." Fixed. The finding is right. FolderRepository.mutate keeps a write that has already landed and then re-raises the cancellation, so the slots push and the SEL audit were skipped. The new delete now follows the same order as the person's ordinary delete (api_chat_folder_delete):

  • It captures the cancellation with VocabularyDeleteCancellations.capturing_commit() and marks the write as committed through on_committed.
  • If the cancellation came before the write was proven, it re-raises with nothing to finish.
  • If the write landed, it runs the icon cleanup, push_slots_update and sel().log_api_access(...), and only then calls cancels.reraise_in_order(). Nothing between the commit and the audit awaits, so no second cancellation can land there.
  • Tests in test_mate_folder_routes.py, class TestACancelledDeleteStillAuditsWhatLanded:
    • A cancel after the write landed still pushes and audits once.
    • A cancel before the write landed pushes and audits nothing.
  • Mutation check: the first test fails on the previous version of the module. Checked locally, then restored.
  • The chat-folder and mate-folder suites pass: 515 tests.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 18, 2026
@buluoray

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles c08aebe owner-decision: maintainer approved and merged the RFC this PR implements; this PR records it as accepted: #38808 (comment)

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@buluoray recorded a owner-decision release (class owner-decision) for the first-principles AI finding on c08aebe3838fe54295d223f9a709672df6dc0dd0.

maintainer approved and merged the RFC this PR implements; this PR records it as accepted: #38808 (comment)

This decision applies only to this commit. A new push requires a new judgment.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Nov 18, 2026
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, but it changes 1108 lines, more than the 400 it may approve on its own.

This PR implements the accepted RFC: the person may delete an empty folder inside a Bot's home folder, and "Clean up empty folders" offers such folders. The home folder itself is still refused first. Every caller other than the person's browser (no app or member principal, no internal secret) is still refused with mate_home_locked, and the Bot's own delete path is unchanged. The emptiness checks follow the existing if_empty branch: archived sessions are counted first, then a child folder, a live or closing session, or a cron job filing into the folder is refused inside the folder-store lock, and an unreadable cron store deletes nothing (503). The cleanup keeps the home and any folder inside a Bot's home that holds an archived session or carries a project_dir. A non-browser caller or a root scope inside a Bot's home removes nothing there, and the confirm step re-reads archived counts under the lock. In the sidebar, the menu on an empty folder inside a Bot's home holds Delete folder only, and "empty" counts sessions the person's list hides. Backend and frontend tests cover each path, including cron-save ordering in both directions and a cancelled delete. CI is green.

Tier: 2, held for a person: design-doc-gate: D.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit c08aebe383 · 1108 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review checked head c08aebe. The single delete still refuses a Bot's home folder first. A folder inside the home is deleted only when the request comes from the person's browser, meaning no app or member principal and no internal secret header. App, member, MCP and cron-script callers still get mate_home_locked. The checks for child folders, live and closing sessions, and cron-filed folders run inside the folder-store lock. A cron store that cannot be read returns 503. A cancel that lands after the write still pushes and audits. PR Readiness passes on this head.

Security: the only loosening is a 403 that becomes a 200 for the person's own browser, which already holds full authority over every ordinary folder. Other callers keep main's refusal, the Bot home stays refused at the route, under the lock and in the cleanup, and outside Bot homes the cleanup behaves the same as on main.

Done well: one shared predicate, is_person_browser, decides both the single delete and the cleanup. Event-gated tests drive the real folder-store lock, with no sleeps.

The design is signed off under the standing maintainer sign-off for changes by team members.

Optional:

  • mate_subfolder_delete.py:143: the post-delete steps (icon epoch, pending icon task, slots push, audit) are another copy of the ones in chat_folders_routes.py and chat_folder_cleanup.py. One shared helper, or a linked follow-up issue, would keep them in step.
  • The Proof line in the body names head 69b0c1f. Re-running it on c08aebe would also cover the new cancellation tests.
  • chat_folder_cleanup.py:537: the archive scan under the lock could run only when the caller is the person's browser and some folder sits inside a Bot home.

@buluoray
buluoray merged commit 70225fe into main Nov 18, 2026
102 of 104 checks passed
@buluoray
buluoray deleted the crew/slack/37434-bot-subfolder-delete branch November 18, 2026 12:08
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running labels Nov 18, 2026
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.

dashboard: a Bot's sub-folder can't be deleted, moved, or hidden by anyone, and "Clean up empty folders" skips it

3 participants