0.88.0 → 0.89.0 — $quill mismatches are hard errors¶
A document's $quill: name@selector is the format it was written for. Through
0.88 the engine treated a divergence from the loaded quill as advisory: a
wrong name produced a quill::ref_mismatch warning and rendered anyway,
and the version selector was never checked. Both are now enforced —
rendering a valid document against the wrong quill (a different format, or an
incompatible version of one) yields undefined output, so it is rejected:
| Condition | 0.88 | 0.89 |
|---|---|---|
loaded quill's name ≠ $quill name |
quill::ref_mismatch warning, render succeeds |
quill::name_mismatch error |
| loaded quill's version outside the selector | unchecked, render succeeds | quill::version_mismatch error |
Both raise the new RenderError::QuillMismatch, in render and dry_run.
The name is checked first; a name mismatch leaves the version unevaluated (a
selector belongs to a named quill).
QuillMismatch is distinct from ValidationFailed: the document is well-formed,
just paired with the wrong quill. The remedy is to render with the referenced
quill, or amend $quill — fix the name, or widen the selector to @3 /
@latest. A bare name or @latest matches any version, so a document that
targets its quill correctly never trips either check.
Migrating¶
Move the handling from the result's warnings to the thrown error / Err, and
update the code:
- const result = quill.render(doc);
- if (result.warnings.some(w => w.code === "quill::ref_mismatch")) { … }
+ try {
+ const result = quill.render(doc);
+ } catch (err) {
+ // err.diagnostics[0].code is "quill::name_mismatch" or "quill::version_mismatch"
+ }
In Rust, add the variant to your render match:
match quill.render(&doc, &opts) {
+ Err(RenderError::QuillMismatch { diags }) => handle_wrong_quill(diags),
Err(RenderError::ValidationFailed { diags }) => handle_invalid_document(diags),
…
}
Python raises QuillmarkError as for any render failure; read the code off
err.diagnostics.