Repository navigation
docs(rfc): propose person-only delete of empty Bot sub-folders - #38152
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: this is a draft RFC with no code, and it limits the opening to the person's browser, checks emptiness under the folder-store lock, and makes the cleanup and the single delete give the same answer. Notes
[DESIGN-REVIEWED] fc44679 Description read[DESCRIPTION-READ] 7f98b5210e7d81048313a1e98d8f0df4d9656b8a1b5128c35c49e51c0f91744d 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 |
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: |
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: |
ff5a540 to
26d1018
Compare
Code change approver recommendation: A person should decideWhy: the decider estimates an 8% chance that this change introduces a defect, within the 12% limit for approving on its own, but it is held at tier 2: design-doc-gate: D. Docs-only draft RFC plus one index row. All cited symbols are accurate at the head commit: api_chat_folder_delete's mate_home_locked test, _MEMBER_CHAT_FOLDER_ID_METHODS={PATCH}, LAYOUT_ONLY_FIELDS, mate_home_subtree_ids in removable_folder_ids, _remove_if_empty under the store lock, _persist_holding_folder, request_origin and the token auth that requires a token on loopback. The proposed trust boundary (person's browser only: no app, no member principal, no internal secret) is sound and reuses existing lock patterns. Cleanup and single delete give the same answer except for the documented project_dir case. CI and the AI review lanes are all 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 |
|
Review input on the RFC. The scope reads right to me: person-only, empty only, the home never removable, and every check reuses one that Open question 1 (delete a non-empty Bot sub-folder): agree with no. Unfiling a Bot's live or archived sessions moves its work out from under it, and the Bot would then file new work into a fresh sub-folder anyway. Keeping it empty-only is the smaller and safer opening. Open question 2 (Delete in the sidebar menu): I'd do it in the same phase. Section 1 already adds the server branch for a single Two small points for the design:
This is design input only. A team member has to sign off on the design before the code PR. AI-assisted, sent by Bolin Review bot |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Thanks for the narrow, well-sourced RFC. I checked the current-state claims against main and most of them hold. One contradiction needs fixing before a maintainer can agree to the design.
docs/request-for-change/rfc-bot-subfolder-person-delete.md:110(§2 Cleanup). Take a Bot sub-folder with no live session, no cron job and no child folder that still holds archived sessions. If a person runs "Clean up empty folders", it is removed and its archived sessions become unfiled. The reason: §2 lists the rules that still keep a folder (live session, cron job, default folder, channel folder), and on mainchat_folder_cleanup.pysays "Archived sessions do not keep a folder". But §1 (line 92) and the exit criteria (lines 131-133) refuse the single delete for that same folder. The two person paths give opposite answers for one folder, and §2 breaks the PR's stated non-goal ("Deleting a sub-folder that still holds a live, archived or scheduled session"). Smallest fix: in §2, add a keep rule for a folder inside a Bot home whose_folder_history_countsis non-zero. The dry run already computes this count. Then add a matching cleanup exit criterion.
For the security review:
- §1 defines "the person" as a caller with no effective app and no member principal (lines 86-88), and it drops the
CREATED_BY_SESSIONtest. The person's own ordinary agent sessions also pass that test when they call thechat_folder_deleteMCP tool withif_empty=true. So the line "An agent gains nothing" (line 146) does not hold as written. Consider requiring a dashboard-origin request (request_origin(...)[0] == "dashboard", no internal secret), and add an exit criterion showing that an internal MCP caller is refused on a Bot sub-folder. This RFC widens who may delete inside a Bot's home, so a maintainer makes that decision.
Optional:
- In this phase, no UI reaches §1's single-delete branch: the cleanup uses its own route and
_prune, and the sidebar menu stays closed. §2 alone may meet the goal, with the single delete moved into open question 2. - Line 45 and the README index row say an app gets
folder_delete_forbidden. On a Bot sub-folder, an app getsmate_home_lockedfirst, and the owning Bot is refused at the member chat-route gate.
26d1018 to
10cffd6
Compare
|
Thanks both. All points are taken in KiroCrewCaptain review
bolichen97
The code branch will follow the revised RFC once a team member signs off. |
|
Follow-up on the earlier change request (head 26d1018). Each point against head 10cffd6:
Nothing from that review still stands. I also checked the RFC's "Current state" citations at this head, and they hold: the This RFC widens what an authorization check on the folder delete route allows. Today the person gets For the security review:
Optional:
|
Withdrawn: every item in this review is fixed or answered on the current head (see the follow-up comment). Other holds on this PR are listed there.
10cffd6 to
84be473
Compare
|
Thanks. The three points from the follow-up are taken in
The decision on widening the delete gate is a maintainer's and the security review's, as you say. |
|
Thanks. All points are taken in
The code branch matches ( |
|
Follow-up on the earlier change request (head 26d1018). Each item checked at head 1376505:
Nothing from that review still stands. At this head the diff adds only the RFC and one index row in 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 RFC also widens what the folder delete route allows. On main the person gets For the security review:
Optional:
|
1376505 to
ff0f93f
Compare
|
Thanks. Taken in
The code branch matches ( |
|
Follow-up on the earlier change request (head 26d1018). Each item checked at head ff0f93f:
Nothing from that review still stands. The root-scoped cleanup point from the last follow-up is also fixed: section 2 now keeps every folder in a Bot's home when 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 RFC also widens what the folder delete route allows. On main the person gets For the security review:
Optional:
|
|
Thanks. These three are noted and will go into the next push, with any maintainer review, so CI does not restart for them alone:
Correcting the record on demand: "Why it matters" says several reports with screenshots. The public record is one report, #37434, with no image, so please weigh demand on #37434 alone. |
bolichen97
left a comment
There was a problem hiding this comment.
Review of ff0f93f.
Follow-up on our earlier design input. Both points are answered on this head:
- Cron check outside the folder-store lock: §1 now runs the cron read in a
prepare=callback ofmutate_folders, under the folder-store lock, and a job save checks the folder while holding the same lock (_persist_holding_folder). So the window is closed, not just named, and Security considerations says so. I checked that_persist_holding_folder(src/kiro_crew/dashboard/handlers/cron_jobs.py:580) andchat_folder_ids_asyncexist on main as cited. - Exit criterion for the conductor fallback: added. A Bot conductor that names the deleted sub-folder files its next session in its home (
mate_home_filing). There is also an event-gated ordering test for the cron race.
Open question 2 is now answered as I suggested: the sidebar menu offers Delete folder on an empty Bot sub-folder, never on the home.
The Captain's items at this head are fixed too: the shared "person's browser" predicate with request_origin(...)[0] == "dashboard", archived-session counts re-read in _prepare, and the root-scoped cleanup keeping every folder in a Bot's home. Its three optional points (the "same rule" wording for a leaf folder with a project_dir, the demand record, and the cost of the archive scan under the lock) are still in the text on this head. The author has said they go in the next push. The demand correction is already in a PR comment.
I have no further design findings. This RFC widens what the folder delete route allows (today mate_home_locked on every Bot sub-folder; under this RFC a 200 on an empty one for the person). A team member has to sign off on the design before the code PR. This comment is not that sign-off.
AI-assisted, sent by Bolin Review bot
ff0f93f to
fc44679
Compare
|
Thanks, Bolin. The saved optional notes are in
Nothing else changed. The RFC now waits for a team member's design sign-off before the code PR opens. |
|
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. This RFC widens what the folder delete route allows. On main every Bot sub-folder answers Earlier change request (head 26d1018), checked at fc44679:
Review result: nothing blocks. The diff adds only the RFC and one index row. The "Current state" citations resolve on main, and the lock reuse holds: the For the security review:
Optional:
|
|
Thanks. These are noted for the next push, with any maintainer review, so CI does not restart for them alone:
Agreed that the code PR changes an authorization check and needs its own security review. |
bolichen97
left a comment
There was a problem hiding this comment.
Maintainer design sign-off on fc44679, @buluoray: I agree with this RFC. The person, and only the person, may delete an empty sub-folder under a Bot's home folder, and "Clean up empty folders" may offer those; the home folder itself stays the Bot's. Our two earlier points and the Captain's asks are answered. Implementation PRs can start against this design.
AI-assisted, sent by Bolin Review bot
Part of #37434
Problem / Motivation
Goal: agree a design, before code lands, that lets the person delete an empty folder inside a Bot's home folder, and lets "Clean up empty folders" offer it, while the home folder itself stays the Bot's.
A Bot files every folder it makes under its own home folder. Once the work in a sub-folder ends, the folder stays in the sidebar for good: the person cannot delete, move or hide it, the Bot cannot delete it, and "Clean up empty folders" skips it. A maintainer triaged #37434 as a design-level change to the Bot home rule and pointed it at the RFC process.
Why it matters
A busy Bot makes one sub-folder per task, so the sidebar fills with empty folders the person has no way to clear short of deleting the Bot or editing
folders.jsonby hand. Users have reported this more than once, with screenshots of several empty sub-folders under one Bot.Not a goal
What changed (motivation → approach → change)
docs/request-for-change/rfc-bot-subfolder-person-delete.md: new RFC, statusdraft, tracking dashboard: a Bot's sub-folder can't be deleted, moved, or hidden by anyone, and "Clean up empty folders" skips it #37434. It proposes one narrow opening in the Bot home rule:if_emptybranch does;Section "Current state" maps each refused path to the symbol that refuses it, read at
574320d20fc. Alternatives (Bot-side delete, allowinghidden, explaining the skip) are listed; the two open questions are answered as review settled them.docs/request-for-change/README.md: one index row at the top of the table, statusdraft.Backwards compatibility
Compatible: docs only; no behavior changes.
Removes nothing: one new Markdown file and one new index row.
Tests
Docs only; there is no code to test.
bash scripts/docs-lint.sh: passed.BRAND_BASE_REF=<merge-base> python3 scripts/check_brand_name.py: no misspellings in the added lines.scripts/verify_no_internal_host.pyover both files: no internal host.574320d20fc.Manual verification
N/A: documentation only.
Screenshots / video
Why no screenshot: no markup change; Markdown files only.
Related Issues
Part of #37434. Refs #34316, #34297.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)