FA-76552 / Email MIME structure / Member archive
Build a bounded MIME tree summary from parser events: maximum depth · case 02
The reported depth is the depth of the last container opened, not the deepest one.
Case contract
events are ["open", type] (multipart start), ["leaf", type, size] and ["close"]. The root multipart has depth 1. An open that would exceed max_depth records "too-deep" and its whole subtree (including nested opens) is skipped, but it still counts as a child of its parent. A multipart closing with no children records "empty-multipart", a close with nothing open records "stray-close", and containers left open record "unclosed". Result {leaves, depth (maximum reached), errors}.
Why this case matters
Bounding MIME nesting protects mail parsers from resource exhaustion while keeping the reachable structure intact.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| deepest branch first | {"depth": 2, "errors": [], "leaves": 2} | {"depth": 3, "errors": [], "leaves": 2} | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗