Skip to content

Derive special-mailbox paths from the Envelope Index — remove the vacuous walk (Refs #315) - #331

Merged
kiki830621 merged 1 commit into
mainfrom
idd/315-special-mailbox-paths-from-index
Aug 1, 2026
Merged

Derive special-mailbox paths from the Envelope Index — remove the vacuous walk (Refs #315)#331
kiki830621 merged 1 commit into
mainfrom
idd/315-special-mailbox-paths-from-index

Conversation

@kiki830621

Copy link
Copy Markdown
Member

Refs #315

Summary

The #268 AppleScript container walk could never work: unified-container references have a non-mailbox container on first probe, so it succeeded vacuously and returned leaf-for-nested — 4/5 types wrong on all 7 live accounts, with both documented fail-safes structurally unreachable. This lands the diagnosis's approach (b): AppleScript identifies leaves; the Server layer joins them against the account's Envelope-Index paths (MailboxURL.mailboxPath, the same representation search_emails returns). Zero/ambiguous candidates → _path honestly omitted (leaf stays). The tool description drops its refuted "no leaf-suffix heuristic needed" advice and states the omission contract (per the #318 rule).

Verification

Coordination

Server.swift also touched by #314's PR (different regions) and #307 (line 17). MailController.swift shares the file with #314/#307 — separate regions. Textual-adjacency conflicts only.

🤖 Generated by /idd-all. Do NOT add a GitHub close trailer — run /idd-close after merge.

…e vacuous AppleScript walk

The #268 container walk enumerated children of the app-level UNIFIED
container; those references have a non-mailbox container on the first
probe, so the climb never executed and the walk succeeded vacuously —
emitting the leaf as the full path. Live: 4/5 types wrong on all 7
accounts, and neither documented fail-safe fired because nothing failed;
the wrong value was wire-indistinguishable from a correct top-level
result (the #315 diagnosis's third failure mode the design never
anticipated).

Approach (b) from the diagnosis: AppleScript keeps what it is uniquely
good for (leaf + special-type identification via the unified containers);
the full path is joined at the Server layer from the account's
Envelope-Index mailbox paths — MailboxURL.mailboxPath, the exact
representation search_emails returns, which was correct all along.
joinSpecialMailboxPath is pure and honest by construction: exactly one
candidate (== leaf or ends in /leaf) wins; zero (no index / EWS / unknown
leaf) or 2+ (ambiguous leaf) omit the key while the leaf stays present —
the observable absent-path signal #268 promised but never delivered.

Server.swift's description walks back the 'compare full-path directly
instead of a leaf-suffix heuristic' advice that steered consumers into
the silent wrong answer; it now states the omission contract plainly
(per the #318 deferred-live-verification rule: caveats live where
consumers read).

Tests: walk-PINNING builder tests are replaced by walk-ABSENCE tests
(the walk must not quietly return); leaf guards' survival pinned; pure
join covered for nested / top-level / ambiguous / unknown / boundary /
no-index cases.

Plan-tier note: implemented under unattended /idd-all — Plan
deliberation skipped per orchestrator contract, marked here.

1073 tests, 0 failures.

Refs #315
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.

1 participant