Validate a document against the v1 contract and return its canonical form
(migrated: envelope keys stripped, schemaVersion stamped, pane ids derived).
Throw BAD_USER_INPUT with structured validationErrors when invalid; this
canonical value is what gets persisted, so clients cannot smuggle non-schema
or server-owned keys into storage. Warnings never block.
Validate a document against the v1 contract and return its canonical form (migrated: envelope keys stripped, schemaVersion stamped, pane ids derived). Throw BAD_USER_INPUT with structured validationErrors when invalid; this canonical value is what gets persisted, so clients cannot smuggle non-schema or server-owned keys into storage. Warnings never block.