fix: rule-create resolves move-to-folder at any nesting depth - #14
Merged
Conversation
rule-create --move_to_folder resolved its target via _resolve_folder_id, which enumerated only GET /me/mailFolders (immediate children of the mailbox root), so a folder nested under Inbox (e.g. Inbox/Newsletters) failed with "No mail folder named '<name>' was found" — even though message-move and mail-list resolve nested folders fine. Route _resolve_folder_id through the existing depth-aware _folder_name_map (id->displayName at any depth) with a well-known-name fast path, preserving the steering error when the name exists nowhere. searchfolder-create shares the helper, so its source-folder resolution gains nested support too. No new OAuth scope. Adds regression tests (nested-under-Inbox resolves to the nested id; non-existent name still raises SteerError with no POST) and re-points the existing success test to the recursive query shape. Implements docs/HANDOVER-nested-folder-rule-target.md (now removed). Spec: specs/007-nested-folder-target (gitignored, local SDD). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 23, 2026
Merged
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.
Problem
rule-create --move_to_folder <name>resolved its target viagraph._resolve_folder_id, which enumerated onlyGET /me/mailFolders(immediate children of the mailbox root). Any folder nested under Inbox (e.g.Inbox/Newsletters) was invisible, so rule authoring failed with "No mail folder named '' was found" — even thoughmessage-moveandmail-listresolve nested folders fine via the depth-aware_folder_name_map. This directly blocked the two-tier folder model, where filing folders are nested under Inbox by design.Fix
Route
_resolve_folder_idthrough the existing recursive_folder_name_map(id→displayName at any depth), with a well-known-name fast path, and preserve the existingSteerErrorwhen the name exists nowhere.searchfolder-createshares the helper, so its source-folder resolution gains nested support too. No new OAuth scope (MailboxSettings.ReadWriteunchanged).Tests
SteerErrorand issues no rulePOST.ruffclean.Implements and removes
docs/HANDOVER-nested-folder-rule-target.md. Developed via the repo's local SDD flow (specs/007-nested-folder-target, gitignored).🤖 Generated with Claude Code