Repository navigation
v0.135.0
Upgrade path: 0.134 → 0.135. Core is
single-writer: a write under a stale base throws edit::stale_base where it
rebased, and writers that answer late merge through @quillmark/collab.
Saves move to quillmark/document@0.135.0, which a 0.134 build refuses, so
every reader of a store upgrades before any writer. Breaks no type checker
reports: a write refuses a Content that normalize would rewrite, an
anchor step naming a held id needs move: true, and a conformed text
field stores as content spelling codec: "plain", so its stored value and
hash change.
Single writer
- refactor(core)!: core is single-writer; a stale base refuses. A
write's base is the hash its writer read. A value that hashes otherwise
refuses withedit::stale_base, carryingcurrent, and writes nothing.
The rebase engine (quillmark_content::rebase), the per-card change log,
read_at, the structural document merge andReceipt::rebasedare gone,
andedit::rebase_conflictis retired. The writer's revise and
reviseDocumenttake{ baseHash }alone in WASM andbase_hash=in
Python;baseMarkdownis gone.EditError::StaleBase(StaleBase)and
BoundParseError::StaleBasecarry the refusal. - refactor!: collab policy leaves core. Core says which repair
write-backs land twice (Repair::inserts) and leaves who writes one back
to@quillmark/collab. TheDeltatype leaves@quillmark/wasm, since no
verb takes or answers one.
Ids
- feat(content)!: a write mints the ids its change leaves open. A record
a change puts may carry a placeholder id opening with?, which the write
fills and names in the receipt's newminted; a value holding such an id
is invalid. Themintmodule andids::is_placeholderare new. - feat(core)!: a write mints from the value it lands on, never from the
card's history of writes, so one write over equal values stores equal
bytes on every card. - feat(core)!:
addCardandunchecked.insertCardanswer the placed
card's$id:CardAdded { id, warnings }in Rust and WASM, a dict in
Python. - fix(content): a mint past an id at the top of
u64takes the lowest
number free under its prefix, where it overflowed.
Structural edits
- feat(wasm)!: the structural edits are
Documentverbs.
doc.splitBlock,joinBlocks,deleteRange,indent,outdentand
wrapwrite and answer aReceipt, refusing a stalebase, where module
functions answered aChange.diffRange(before, after, { from, to })
lowers the range a ProseMirrorReplaceStepnames as one exact splice, and
doc.blockAt(addr, offset)answers the block at an offset. In Rust,
gesturesisstructural,GestureisStructuralEdit,Edit::Gesture
isEdit::Structural, andCardgains the verbs,block_atand
diff::diff_range.
One spelling per value
- feat(content)!: a write takes a
Contentonly in its canonical form.
Every verb taking one butnormalizerefuses a valuenormalizewould
rewrite (Invariant::NotCanonical). A stored row reads leniently through
Content::from_value_lenient, warningcontent::noncanonical_readat each
rewritten value so the host stores it again. - feat(content)!: a value, change or step holding a key its shape does
not define is refused (ParseError::UnknownKey), a remove step holding
its set twin's keys included, and a built-in member'sattrshold only the
entries it names. Islandpropsandx-attrsstay open; a stored value
drops the key and warns. - feat(content)!: a table cell and a footnote's note are each one
paragraph, its lines parted byU+2028.<br><br>and a<p>boundary
in a cell import as one hard break, a value holding a\nthere is
refused (Invariant::BreakInCell), and a stored read andrepairjoin
one. - feat(core)!: every write on
Documentvalidates. A content value in a
field, at any depth, decodes and stores canonical as a body's does, and an
invalid one throwsedit::field_decode. The writes no schema checks move
underunchecked:doc.unchecked.storeFieldandinsertCardin WASM,
doc.unchecked.store_fieldandinsert_cardin Python,doc.unchecked()
in Rust.
Text fields
- feat(core)!: a
textfield is stored as content spellingcodec: "plain", so it holds comment anchors and ids, andtoMarkdownwrites
its literal text.getStoredanswers the object andreader.getthe
literal text.field_hashhashes the content,Invariant::NotPlain
refuses a plain value holding a mark, island, container or block other
than a paragraph, andreattachanswers a whole-field selector as
reattached, so a comment can sit on a field of any type. - fix(content)!: the plain codec spells a paragraph break as a blank
line and a hard break as a lone\n, both ways. - fix(core): a typed revise of a
textfield still at rest as a string
answers one splice over its literal text.
Anchors
- feat(content)!: an
anchorstep places or moves, never both.
{id, start, end}refuses an id the value holds (ApplyError::AnchorHeld),
andmove: truemoves the held one.AnchorStep::SetisPlaceand
Move. - feat(content)!:
movedAnchorsnames every surviving anchor a write
moved, a point included, each with areason:position,blockor
context. - feat(content)!: anchor contexts read off the stored text: a selector's
quote,prefixandsuffixspell a hard breakU+2028and a cell's
block break one\n.reattachplaces a selector in either spelling. - fix(content): a revise carries anchors through one word diff. Word
tokens follow UAX #29 boundaries with each punctuation mark its own, a
replaced run's lines pair by greatest similarity, and a quote moves within
text the revise itself inserted.
Revise and markdown
- feat!: the body is an address.
writer.revise(addr, text, opts)
replacesreviseBodyandreviseField(Pythonwriter.revise(text, field=None, card=None)),reader.getandgetContentread the body with
no field, and Rust's typed writers and readers take aTargetin
revise,hash_of,getandget_content. - feat(core)!: the writer's revise answers the content
Receipt,
{ applied, hash, droppedAnchors, movedAnchors, warnings, minted }.
Revisedis gone:mapPosmaps a position throughapplied, and
reattachtakes each path'sapplied. - feat(wasm,python)!: one markdown door each way.
Document.parse
replacesfromMarkdown, anddoc.toMarkdown(addr?, { annotated })
replacestoAnnotatedMarkdown,annotatedAt,annotatedand
bodyMarkdown. An annotated export answers{ markdown, anchors }, and
DocumentRevised.dropped_anchorsholds the selectorsreattachtakes.
Python gainsimport_markdown,export_markdown,normalize,
is_inlineandis_plain. - feat(core)!: every revise is the content
revise. A typed
reviseFieldorreviseDocumentrelocates a moved quote of four
characters or more, atextfield diffs by word, a typedrichtext
revise refuses to drop anx-island, andreviseDocumentkeeps a value
whose markdown would not validate, warningedit::content_applyat its
path. - fix(content): formatting inside a link's text writes inside its
brackets, so a revise keeps it, andto_markdown_checkednames anx-
block or mark among its losses (Loss::ExtBlock,Loss::ExtMark). - fix(content): a revise of a short paragraph keeps its neighbours'
records: lines pair by the diff's word tokens, and a rewrite of the first
block keeps the\nthat opens the next. - feat(core):
edit::content_applynames its failure inreason
(stale,unknown_block,anchor_held,bad_step,invalidand the
rest), with thestepit refuses at forstaleandbad_step.
Repair and mapping
- feat(content)!:
repairanswers its change,{content, repairs, change}, from the merged state, so a peer maps a caret through it.
repair::change_incounts it in a host's units, and Python gains
repair. A range anchor on a heading's repaired hard break shrinks off it. - fix(content): a position maps through an island a change moves, each
removal paired with the insert that carries its slots, andinvert's
inverse splice carries what it deletes.
Bounds
- feat(content)!: content values, changes and markdown are bounded at
every door: marks per text (64, plus 4 per character), 100 000 anchors
per value, 10 MiB of markdown per import and of text per binding input,
16 384 steps per change, and 1 000 000 characters of footnote note copies.
Each refuses under its own code (edit::too_many_marks,
too_many_anchors,input_too_large,too_many_steps); a note
reference past the budget stays as its text, warningfootnote:size.
Storage and the line form
- feat(core)!: saves write
quillmark/document@0.135.0, whose content
values may carrycodec, so a 0.134 build refuses a row 0.135 saves. A
0.134.0row loads unchanged. - feat(core): a line-form value loads migrated, and warns. A v1 body,
field at any depth or$seedvalue, under any tag, loads as the content
model withcontent::noncanonical_readat its path, so a resave over
every row finds and rewrites the rows still holding the line form. A
$extvalue stays as stored. - refactor(content,core)!: one content model.
quillmark_core::Content
is the content model, and the line form lives under the hidden
quillmark_content::lines. Markdown import and export, the Typst emitter,
acroform, card bodies and a revise's anchor carry read the model, with
output unchanged across the parity corpus.quillmark::Lines,Deltaand
the line-form verbs (body_lines,overwrite_body,revise_body_content
and their kin) are gone; the migration guide lists the renames.
Surface
- refactor!: error enums are
#[non_exhaustive]:EditError,
StorageError,WireError,ParseError,ApplyError,MoveReason,
Repair,ReasonandInvariant.quillmarkre-exports the content
write types:CardMut,Edit,Located,Target,Unchecked,
WriteOptions,Change,Dropped,MovedandMoveReason.
Performance
- perf(content): revise, replace and repair find ids by index. A
one-word revise of a 40 000-item list takes about a second where it took
26 s, and repair of a valid 10 000-item list tens of milliseconds where it
took 0.7 s. - perf(core): a write hashes once, streamed over the canonical bytes
with noValuetree, and a card keeps the hash each write left.