CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

authored-recording-order

Check that every command the recording laws use, run at every place in Suggesting and in Editing on every small document with another author's pending change, records a document whose accept-everything result is what a plain editor gives, whose reject-everything result is the document before, whose undo and redo give back each side, and whose review ledger matches the kernel. Use before and after changing packages/plitejs/src/authored or packages/plitejs/src/history or another file in its coverage record, when the authored-recording step of pnpm check fails, or when fixing a recording bug a seed or a tester found.

Quality

75%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

Fix and improve this skill with Tessl

tessl review fix ./.agents/skills/authored-recording-order/SKILL.md
SKILL.md
Quality
Evals
Security

Authored recording order

Handle $ARGUMENTS. check runs the gate bound, and no argument runs only the cases the change targets, as Run it says. deep runs --blocks=2 and compares its failures with Findings. lower runs --lower after a fix removes a known finding. case <identity> runs --case=<identity> to print one case's full detail. update brings the verification in line with changed code, as Coverage record says.

The property. Bob runs one command on a document that holds another author's pending change. In Suggesting and in Editing, accepting every change gives what a plain editor gives when it runs the same command on the accepted document. In Suggesting, rejecting every change gives what rejecting them gave before the command, and after a key, so does rejecting only Bob's. In Suggesting, each element's proposed children are the ones accepting everything keeps. After a key, a letter typed next lands where the plain editor puts it. In both intents the review ledger equals the kernel's projection after loading, after the command and after its undo, undo gives back the document before, review marks included, redo gives back the result, and an undo after another peer appends a paragraph gives the document before with that paragraph.

The harm. A reviewer who accepts a suggestion gets a document the author never typed, and one who rejects it keeps part of it. Seven recording fixes landed between 2026-10-24 and 2026-11-02, each found one case at a time by a lucky seed or a beta tester, and three seeds of the sampled laws in packages/plitejs/test/authored-tree-recording-laws.spec.ts still name open bugs.

What it checks

packages/plitejs/scripts/authored-recording-order.ts runs the real recorder, resolver and history on every case up to a bound. It checks the TypeScript code itself, not a model of it, because no verifier runs on this code.

  1. Worlds. quotes is the recording laws' schema: paragraphs and quotes of paragraphs, with links, a pending align line format on paragraphs and quotes, and no prefix. titled puts a required title before the same body through schema.content.prefix, the shape behind 09a9769bcc. grid is the decision-order check's grid schema, with ten documents. In seven, Alice's Suggesting editor strikes a table, a row, each again with Dan's pending letter inside, a table between two struck lines, one struck line between two live ones with no table, and a table between two lines of two letters, so a range that keeps a letter of each line can join them. Two hold a live table between two lines of two letters, once with nothing pending, so its commands run unframed, and once with Alice's pending letter after it, so they run framed. The tenth holds a three-row table whose middle row Alice struck. fields holds one paragraph, a, a field, b, a mention, c, where the field and the mention are inline voids and only the field type holds a unique fieldId, so a retype between them crosses a unique target. Its four documents are that paragraph and three that Alice's Suggesting editor writes on it: the field turned into a mention, the mention turned into a field with its own id, and a letter typed after b. Its id generator returns one value, so the review and the plain editor give a new field the same id. code holds paragraphs and a code block whose schema allows exactly one text. Its six documents are the paragraph a, the code block bc and the paragraph d; that document with the code block's deletion pending as Alice's; and four where the code block between a and d is a pending insertion holding bc or nothing, once as Bob's own and once as Alice's. The builder below makes none of these three worlds' documents.
  2. Documents. packages/plitejs/scripts/authored-documents.ts, the builder the decision-order check uses, builds every document of up to --blocks top-level blocks, --marks pending marks and --changes changes. It places marks at every place recording writes one: a join, a joined claim, a split, a follow, a block's or leaf's insertion or deletion, a wrap or unwrap, an align format with and without its stored value, and the cut link that Enter inside a link writes. The script turns change s0 into alice and s1 into bob, so --marks=2 gives Bob pending changes of his own. In titled, the first block becomes the title, and the title never carries a whole-block insertion or deletion, because a required block cannot be pending as a whole. In both worlds, no document holds a pending join on a quote or on a block right after one, because no recording writes one there: Suggesting records a join into a quote as a copy of the line moved inside it and a struck original, and Editing merges the lines at once.
  3. Commands. Every step at every caret beside a letter: type Z, Enter, Backspace and Delete, and a selection delete in both directions between every two carets. Every command the recording laws use: paste of two lines at every caret, deleteRange and typeOver from every letter to itself or a later one, transferText, moveNode and transferNode for every pair of letters, wrap, unwrap and removeLink at every letter, and replaceChildren at every shift. Each runs as Bob in Suggesting and in Editing. The fields world runs only retypeAfter, which sets the type of the inline element right after a letter to field or mention and skips one that has that type already. Every other command finds the same entries on its documents whether the key is unique or not. The code world runs a typed letter, a typed newline, a paste and Enter at every offset of each code block's text. Over the whole text of a code block that holds letters, it runs a selection delete in both directions and deleteRange. Its writes run the one-text law and the history and room laws, and its deletes run every law.
  4. Laws. The script calls the laws in packages/plitejs/test/support/recording-laws.ts, the same code the sampled spec calls, and adds the history laws. A case records its first failure per rule:
    • recording-accept: accepting everything differs from what a plain editor gives when it runs the same step or command on the accepted document. After a step, the law also compares the two after a letter typed next.
    • recording-reject: rejecting everything differs from doing so before the command. After a step, the law also compares rejecting only Bob's changes.
    • recording-applies: accepting or rejecting everything does not apply.
    • recording-proposed: after a Suggesting command, an element's proposed children differ from the ones accepting everything keeps.
    • recording-schema: the step or command throws a schema validation error under review where a plain editor on the accepted document runs it.
    • recording-plain: a step or a text command throws a schema validation error in a plain editor on the accepted document. The rule leaves out moveNode, transferNode, nest, wrap, unwrap and replaceChildren, because each names a node or slot the schema may refuse on purpose. A step runs where the accept law places it on the accepted document, so a step whose letter accepting removes still runs. Every other law reads a plain-editor schema error as a refusal and skips the case, which is how typing over a whole document that starts with a quote stayed hidden until this rule.
    • recording-ledger: the review ledger differs from the kernel's projection after the load, the command or its undo.
    • recording-undo: undo, redo, the command again after undo, or undo after another peer appends a paragraph does not give what it should. The remote paragraph goes at the end of the document, because beside a moved letter the law would have to pick a side. An undo that puts a block back at the end could land on either side of that paragraph, so the law checks that the paragraph is still there and that the other blocks are the document before.
    • recording-shape: an empty element, two joins on a line, a typed letter with a deletion, a doubled letter or another author's lost letter.
    • recording-throws: any other error.
    • recording-grid: in the grid world, an edit that should refuse does not refuse with reasons ['grid'] or changes the document, or a join that should record refuses. A key should refuse at a caret inside a struck table, row or cell, and as a Backspace or Delete whose plain join brings two lines together across a struck table or row. A selection delete, deleteRange and typeOver should refuse with an end inside such a part, and when a plain editor leaves the letters just outside the range in one line across a struck table or row. deleteRange and typeOver with both ends in live lines should also refuse when a plain editor on the stored document, which reads the struck parts as live, changes a struck table or row without removing it whole, because these writes run unframed and see the stored document. A join should record across only struck lines, and across a live table the join removes whole, struck rows inside it included, because the table goes with every pending change inside it. A removePart command removes the table or row holding a letter by path, unframed as a call through a view runs. It should refuse when that table or row is struck or lies in a struck table, and record when it removes a live table that holds a struck row. A live row gets no expectation. The expectation comes from the stored document and a plain editor's step, on the accepted document for a join. The grid world runs deleteRange, typeOver and removePart unframed under this law alone, and runs the keys and selection deletes under the other laws too, the sync room's grant, forgery, crossed and take-back laws included.
    • recording-one-text: in the code world, a write or delete in a code block does not record or refuse as this rule says. In Editing, and in Suggesting in Bob's own pending block, a typed letter, a typed newline or a paste should record as one text, in Suggesting as part of Bob's pending block rather than a change of its own, and accepting everything should give what a plain editor gives. In Suggesting, a write into a live code block or one Alice inserted, or a delete of its whole text, should refuse as unrepresentable and leave the document as it was, while that delete records in Bob's own pending block. In both intents, every write, Enter and delete aimed at a code block whose deletion is pending should refuse the same way. Enter into any other code block gets no expectation.
    • recording-grant: the sync room's grant for the writer and intent refuses an honest command, undo or redo. The laws judge each batch with refusedByGrant in packages/plitejs/test/support/recording-laws.ts.
    • recording-forgery: the room admits a batch forged from one its grant covers, such as one that moves, strips or re-attributes another author's claim. packages/plitejs/scripts/authored-recording-order-forgeries.ts builds the forgeries. It builds no forgery that changes only nodes the batch creates: one that gives the writer a fresh claim in place of a claim no node held before the batch, such as the claim an undo restores to another author's insertion, or one that drops a claim from a created node while another node already holds it. The writer may send either batch as a new suggestion of its own. A claim another author held before the batch is still forged.
    • recording-verdict-forgery: the room admits a batch forged from a decision that puts a verdict, or from its undo that drops one, by an operator such as foreign-copy, drop-foreign, reserve, partial-incarnation or regrant.
    • recording-crossed and recording-crossed-refused: after a teammate's one-command edit lands first, the room admits a decision with a document other than the one the decider's tab shows once it imports that edit, or refuses it for the cause the identity names.
    • recording-crossed-kept: the room refuses a crossed decision, and once the decider's tab gets the receipt, the tab stops, does not hold the decision as its one kept batch, or shows a document other than the room's.
    • recording-crossed-unsent: the teammate's entry reaches the decider's tab in the same turn as the decision, so it crosses the decision while the tab holds it saved and not yet sent, and the tab decides it again at the new head. Saving the decision starts an async digest before the frame is built, which is what lets the entry cross first. The rule fails when the room admits the frame and the tab stops or shows a document other than the room's, or when the room refuses the frame or the tab keeps the decision unsent and the tab stops, does not hold the decision as its one kept batch, or shows a document other than the room's. A frame not built at the new head fails as recording-throws. The summary's crossedUnsent counts admitted, refused and kept outcomes.
    • The gate lane alone runs recording-crossed-kept and recording-crossed-unsent. The --after-commands lane keeps its three crossed rules, because recording its baseline with these checks needs a 16-core stress run, which the owner's throttle does not allow as of 2026-11-16.
    • recording-crossed-after, recording-crossed-after-refused and recording-crossed-after-lost: the same crossing on each document a law's Suggesting command leaves, which only --after-commands runs. The lost rule replays the teammate's command on the decided document and fails when that replay keeps a letter or block the teammate's entry added and the room's document lacks it. No baseline holds a lost entry, because one means the room dropped a teammate's work.
    • recording-take-back and recording-take-back-refused: after the reviewer's own edit and its undo, or after a teammate's edit, the check builds the room's own take-back of the decision, sends it through a real room and compares it with history's undo. The first rule fails when history's undo changes nothing, drops no verdict or differs from the take-back, or when the room refuses its own take-back. The second fails when the room has no take-back, for the cause the identity names.
    • The crossed and take-back rules take each teammate's edit from three kinds: every step and command above at every letter, a line W inserted at each top-level index, and every element moved to each other index among its siblings. In the grid world they take only the inserted lines and the moved elements. A table is one top-level block, so the room's take-back window holds all of it. A letter command inside a table reaches only causes that quotes and titled reach on fewer letters.
  5. A refusal the editor gives on purpose, such as "decide the pending join first", counts in the summary's refused and is not a failure, because the editor declined what it cannot record. A refusal after the laws started comparing is a failure.
  6. It compares the findings with packages/plitejs/scripts/authored-recording-order-baseline.json through tooling/scripts/finding-baseline.mjs. Every finding is filed under packages/plitejs/src/authored. An identity names the world, the document as the builder's story prints it, the intent and the command, never the result. The code, grid and fields worlds' entries of the room's rules, recording-grant, recording-forgery, recording-verdict-forgery, recording-crossed, recording-crossed-refused, recording-crossed-kept, recording-crossed-unsent, recording-take-back and recording-take-back-refused, compare with a count file of each world's own instead, packages/plitejs/scripts/authored-recording-order-grid-baseline.json, authored-recording-order-fields-baseline.json and authored-recording-order-code-baseline.json beside them. The room's known causes show up at every place in a table, about 8,300 entries, at every letter beside the voids, about 3,100, and at every place in a code block, about 1,600. That is too many to list one by one, so each file keeps one count per rule and cause, where the cause is the identity's last part, as the --after-commands lane's file does. A count may only fall.

Run it

Run every command from the repository root.

  • In a session, run pnpm check authored-recording --light before a diff panel. While you fix, run only the cases the change targets: --case for each case a fix or a new finding names, and --replay for a law's counterexample. Local CI runs the gate on next after each landing and starts a fix run when it fails, and in the week to 2026-11-19 a session's run of the gate took 17 minutes at the median. Run the gate in a session only to lower the baseline with --lower after a fix removes a known finding, or when the owner asks (owner's word, 2026-11-19).
  • pnpm check:authored-recording --light runs a fixed share of the gate in every world. It keeps 1 in 60 of each quotes, titled and grid document's commands, 1 in 10 of the code world's and 1 in 7 of the fields world's. It keeps 1 in 300 of the room's crossed decisions and take-backs in every world, because those hold most of the gate's work. A hash picks each command and each decision, keyed by its findings' identity with the intent left out, so every light finding is a gate finding with the same identity. It compares 195 cases of the gate's 15,264 and runs 863 of its 251,568 crossed decisions and take-backs. It took 128 s with the default jobs on 2026-11-22, while the load average ran between 158 and 169 on 18 cores. It fails on a finding the baseline does not list and passes the listed findings it does not reach. The code, fields and grid worlds count the room's findings by cause, and the light run keeps its own count file for each, authored-recording-order-<world>-light-baseline.json. It fails on a cause its file lacks and on a count above its file's. A count that falls passes, so a fix that lowers the gate's counts never fails a session's light run. --light --lower lowers those files, and --light --init seeds a missing one. The gate alone also checks that every operator in REFUSED_EVEN_WHEN_ALIKE was judged. It also fails when it compares other than 195 cases, the LIGHT_CASES constant. It takes no bound, --world, --case, --replay, --after-commands or --deadline.
  • pnpm check:authored-recording checks the gate bound: one block, one pending mark, line formats, all five worlds. With one mark, every pending change is alice's. It compares 15,264 cases, 5,840 of them on the grid world's 10 documents, 22 on the fields world's 4 and 193 on the code world's 6. With --jobs=4, the cores the check runner reserves for the step, it took 1,867 s and 5,153 CPU seconds on 2026-11-22, while other sessions held the load average between 66 and 93 on 18 cores. With --jobs=16 it took 1,465 s and 6,190 CPU seconds at a load average near 105. It prints one JSON summary line, then each finding the baseline does not list. pnpm check authored-recording runs the same step through the check runner, and Local CI runs it on next after each landing.
  • --blocks, --marks and --changes raise one part of the bound. --world=quotes --blocks=2 builds 293 documents and compares 92,250 cases in 200 to 330 s on a quiet machine, and in 684 s while other sessions load it. --marks=2 gives Bob his own pending changes. A bound other than the gate's, --world, --case or --replay skips the baseline and exits 1 on any failure.
  • --world=quotes, --world=titled, --world=grid, --world=fields or --world=code runs one world.
  • --replay='<counterexample>' runs every command on the document a sampled recording law's counterexample leaves. Pass the [initial, history, command] array fast-check prints. It runs in the quotes world and skips the baseline.
  • --case='<identity or part of one>' prints the full stack of each failure whose identity contains it. Add --world to make it quick, such as --world=titled --case='title("a") paragraph{join alice:1}("b") :: propose Enter at b|1'.
  • --after-commands runs only the stress lane. A law's Suggesting command on a gate document of the quotes or titled world leaves 1,501 distinct documents that have a decision to make. The lane leaves out each world whose room entries the gate counts in a file of its own: code, grid and fields. The lane crosses every decision on each of them, with the decider and the teammate each in Editing and in Suggesting.
    • The lane runs past the hour, so run it only as a stress run: node .agents/pstack/proof.mjs --stress --timeout 7200 --cores 16 -- pnpm check:authored-recording --after-commands --jobs=16 --deadline=6600 --list=<run directory>/lane.txt.
    • It finds hundreds of thousands of entries, so packages/plitejs/scripts/authored-recording-order-after-baseline.json keeps one count per rule and cause. A count may only fall. --init seeds the file and --lower lowers it.
    • --deadline=<seconds> stops each shard from starting another document once that many seconds have passed since the shards started. A run that would pass its timeout then still prints its summary, and the lane fails because its afterCommandDocuments falls short of the pin.
    • The summary line also prints afterCommandDocuments, crossedSkips and replayed. crossedSkips counts decisions that commit nothing, teammate edits that commit nothing and teammate entries the room refuses. replayed counts which document the teammate's replayed command matches: the room's, the tab's, neither, or none because the command cannot run.
    • The lane fails when a document stops loading, when its document count misses AFTER_COMMAND_DOCUMENTS, or on any recording-crossed-after-lost entry.
  • --list=<file> writes every entry's rule and identity to a file, in any run, for comparing two runs.
  • --jobs=<n> sets the number of worker processes. It defaults to CHECK_CORES, the cores the check runner reserves for the step, and otherwise to the machine's cores up to 16.
  • Exit 0 is a pass and exit 1 a finding or a document that does not load. Exit 2 is a bad flag or a crashed worker. At the gate the run also fails when it compares other than 15,264 cases, the GATE_CASES constant, so a change that stops commands from applying cannot shrink the gate while the baseline still matches. Update the constant only with the reason the count moved. It moved from 15,071 to 15,264 when the code world joined the gate.
  • After a fix removes a known finding, the gate fails until you run pnpm check:authored-recording --lower, which lowers the baseline and each world's counts. None grows. --init seeds only a rule the baseline lacks, or a world's counts when its file is missing, and --lower and --init write nothing when the case count misses GATE_CASES.

Read a failure

A finding prints its rule, identity and the first line of its detail:

recording-reject titled title{align alice:1}("a") paragraph("b") :: propose Enter at a|0
  rejecting everything differs: {"before":[...],"intent":"propose","step":{...}}

recording-schema titled title("a") paragraph("b"{insert alice:1}) :: propose select a|0..b|1 Backspace
  Editor primary root cannot contain "title".

Both are known findings. In the first, Bob's suggested Enter at the start of the title records a new title and turns the old one into a paragraph, and rejecting everything leaves both. In the second, Bob's suggested delete across the title and Alice's pending insertion builds a document the schema refuses. Run --case on the identity for the full diff and stack.

Tell a real bug from a modeling error before you change code:

  • Real bug. A user can reach the document and run the command, the plain editor runs it, and a law still fails. Fix the recorder, resolver or history, then run --lower.
  • Modeling error. The document is one no recording reaches, or the law's oracle is ambiguous for that command, such as an undo that has to choose which side of a moved letter another peer's text stays on. Fix the builder or the script with the reason, as the title rule and the remote paragraph above do.
  • Intended change. A change to what a command does changes the plain editor too, so the laws follow it. Never weaken a law or add a baseline entry to get green.

Findings

The gate finds 261: 43 recording-accept, 33 recording-applies, 5 recording-plain, 72 recording-reject and 108 recording-schema. All but 8 sit beside the required title, which no sampled law's schema holds. Each class is one cause:

  • A selection delete, deleteRange or typeOver across the title and the body. With any pending change in the document, the step throws Editor primary root cannot contain "title" in Suggesting, and in Editing when the title holds a pending deletion. 108 recording-schema entries.
  • Paste of two lines in a titled document. Rejecting everything does not apply, or gives another document, and accepting everything differs from the plain editor. Pasting into the title records a new title and a type change on the old one. 33 recording-applies, 36 recording-reject and 8 recording-accept entries.
  • Suggested Enter in a titled document. Rejecting everything gives another document. At the title's start the old title becomes a paragraph under a new empty title, and the reject leaves both. The split records no history of the type and properties it drops from the new line, and the resolver treats the emptied title as gone, so the line that holds the title's text stands in for it instead of rejoining it. 35 recording-reject entries, and 8 recording-accept entries beside a body another author struck whole.
  • A plain Backspace or range delete that leaves the title alone. In a plain editor, Backspace at the start of a quote right after an empty title joins the quote's line into the title, and a delete or typeOver from the title's first letter, inside a link, to the end of the body joins the body into it. Either leaves the root without the body block the schema requires, so the step throws Editor primary root requires at least 2 children. 5 recording-plain entries.
  • Editing Enter right before another author's struck letter. The next letter Bob types lands on the other line than a plain editor puts it. 4 quotes and 12 titled recording-accept entries.
  • A wrap inside a quote with a pending unwrap. Accepting everything loses Bob's wrap: quote{unwrap alice:1}(paragraph("a")) with a suggested wrap of a accepts to paragraph("a"), where the plain editor gives quote(paragraph("a")). 3 quotes and 1 titled recording-accept entries, and in titled 1 more beside a pending join.
  • Moves and transfers beside the title. moveNode and transferNode of a quoted line with a pending align or unwrap to after the title, and transferText across a split link, accept to another document than the plain editor's. 6 recording-accept entries.
  • Suggested Enter at the start of a line that holds another author's joined claim. Rejecting everything does not give back the document before. A prototype that fixes the titled Enter class clears this entry too, so it has the same cause. 1 recording-reject entry.

The grid world's room rules find 8,267 entries, which the grid file counts by cause: 7 recording-grant, 7,640 recording-forgery, 108 recording-crossed-refused and 512 recording-take-back-refused. Each repeats a cause the baseline lists in the other worlds, at a place in a table. One cause repeats a known one with another claim. Dan's pending letter, which only grid documents hold, gives 234 forge recreate insert dan dan:1 entries beside the known recreate insert alice ones. The writer's own suggest access covers them, as it covers typing the same letter as a suggestion.

The fields world's room rules find 3,096 entries, which its file counts by cause: 24 recording-forgery, 820 recording-crossed-refused, 12 recording-take-back and 2,240 recording-take-back-refused. Its recording laws find none. In the 12 recording-take-back entries the room refuses the take-back's setup, Carol's suggested move of the field or Dan's own move and its undo, as the room refuses carol’s edit, refused, grant and its Dan twin. No other world finds that cause, and it comes whether the key is unique or not. The forgeries repeat the baseline's recreate cause. Four of them recreate Bob's deletion of a void after Alice withdraws her change, forge recreate delete bob bob:last, a claim the other worlds do not give, and they come only with the key unique, because only a retype that crosses it writes a deletion.

The code world's room rules find 1,641 entries, which its file counts by cause: 3 recording-grant, 55 recording-forgery, 788 recording-crossed-refused and 795 recording-take-back-refused. Its recording-one-text law and its other recording laws find none. Each cause is one the grid file also counts, such as the room's grant refusing an undo, and the forgeries recreate Alice's insertion as the baseline's recreate cause does.

--world=quotes --blocks=2 fails 643 cases: 260 recording-accept, 356 recording-undo, 11 recording-ledger, 10 recording-reject and 6 recording-plain. The deep run reads no baseline. Two of its classes are the gate's quotes classes: Editing Enter before a struck letter in 28 cases, and a suggested Enter beside a joined claim in all 10 reject cases. It adds these classes:

  • Undo after another peer appends a paragraph. In Editing, a delete that merges two blocks, such as Delete at the end of quote(paragraph("a")) before paragraph{align alice:1}("b"), leaves quote(paragraph("ab")) after its undo once another peer appends a paragraph. All 356 recording-undo cases, 18 of them an Editing typeOver of a quote and the block after it.
  • Moves, deleteRange and typeOver beside a pending join inside a quote. paragraph("a") quote(paragraph("b") paragraph{join alice:1}("c")) with moveNode a before c accepts to another document than the plain editor's. 101 recording-accept cases.
  • Commands beside a pending unwrap of a two-line quote. Wraps, moves, deleteRange, typeOver and replaceChildren on paragraph("a") quote{unwrap alice:1}(paragraph("b") paragraph("c")) accept to another document. 77 recording-accept cases.
  • Editing moves of a quoted line with a pending align. quote(paragraph[align center]{align alice:1}("a")) paragraph("b") with moveNode a after b. 32 recording-accept cases.
  • deleteRange and typeOver beside a line another author struck whole. 20 recording-accept cases, such as deleteRange a..b on paragraph("a") quote(paragraph("b") paragraph{delete alice:1}("c"{delete alice:1})). In 4 of them a typeOver covers the whole document once the struck line is gone.
  • A plain delete from the start of a quote's later line to the start of a block two lines below. On quote(paragraph("a") paragraph("b")) paragraph("c") paragraph("d"), which accepting a pending unwrap leaves, select b|0..d|0 with Backspace or Delete throws Editor element "quote" at [0] cannot contain "text", because the delete puts an empty copy of the quote before it. A delete from b|0 to the empty line that accepting another author's struck c leaves throws the same error. 6 recording-plain cases. The table subject's Open work owns this with the other hanging deletes from a container's block.
  • The review ledger after an Editing delete or move and its undo. Beside a pending split the accepted preview differs from the kernel's in 9 cases, and beside a pending join the proposed preview does in 2.
  • Moves beside a pending split. 2 recording-accept cases.

What a pass proves

The gate catches a history that loses its mappings or keeps a redo it should clear, and a review ledger that merges two authors' cards. Bugs planted at fc9906287b showed where that holds:

  • Mutant rec-undo-h2, where addMapping in packages/plitejs/src/history/history-state.ts drops the mapping that a history-skip commit queues, gives 4,521 recording-undo findings. Undo after another peer appends a paragraph no longer applies, because the undo entry still counts the document without that paragraph. Undo and redo alone never see this bug, which is why the remote law exists.
  • Mutant rec-undo-h5, where a new undo entry no longer clears the redo stack, gives 4,521 recording-undo findings. The command again after its undo leaves a redo.
  • Mutant rec-r8, where the ledger merges a card with the previous one by book alone and not by author, gives 777 recording-ledger findings.
  • On quotes paragraph("a"{delete alice:1}) with Dan accepting alice:1, a writer that stops on a refused receipt instead of keeping the batch gives 12 recording-crossed-kept findings (2026-11-16). A writer that rebases a crossed saved decision instead of deciding it again moves crossedUnsent from 26 admitted and 12 kept to 18 admitted, 18 kept and 2 refused, and gives no finding, because every outcome it reaches still leaves the tab on the room's document with the decision kept: the rule judges the tab, not which path decided.
  • With the lowering of a retype that crosses a unique key turned off in packages/plitejs/src/authored/tree/record.ts, the fields world compares 18 of its 22 cases and fails them with 3 recording-applies, 19 recording-grant, 5 recording-forgery, 3 recording-ledger, 1 recording-schema and 3 recording-throws entries, and one of its documents no longer loads (2026-11-19).
  • The three open seeds of the sampled laws, -956128617, -627200196 and 719949670, fail the same law here. --replay with each counterexample gives 3, 16 and 7 recording-proposed findings, and the counterexample's own command is among them. Seed 198320648 passes in the spec and here, because an earlier fix removed its bug.
  • Mutant window-edge, where the take-back window in packages/plitejs/src/sync/server/window.ts no longer counts a writer whose edit starts at its edge, changes 29,826 recording-take-back-refused entries in the quotes, titled, fields and code worlds (2026-11-22).

The gate does not catch three resolver bugs, and neither does --world=quotes --blocks=2, whose findings under each mutant equal the clean run's one for one:

  • rec-r2, where rejecting a cut joins its halves without the content between them, in packages/plitejs/src/authored/tree/cuts.ts.
  • rec-r6, where a rejected cut whose left half no longer holds keeps its dependencies, in the same file.
  • rec-r12, where resolveAuthoredChildren ignores a stored accept verdict.

Each needs a document no generated document holds: plain content between the halves of a cut, which only an earlier edit writes, or a stored verdict. The decision-order check and the sampled laws at their default runs miss them too.

The gate does not catch three room bugs planted on 2026-11-22 either. Run alone with its letter crossings, the grid world finds the same entries under each bug as its clean run, so the crossings the gate leaves out caught none of them:

  • restore-dropped, where a take-back in packages/plitejs/src/sync/server/take-back.ts restores without checking that the blocks it drops were the entry's.
  • shallow-ancestors, where the grant in packages/plitejs/src/authored/facts/writes.ts reads claims from a node's top two ancestors only, so a table cell's and its line's claims no longer govern the text inside.
  • part-above-inserts, where the grant in packages/plitejs/src/authored/facts/grant.ts counts only insertions among a table part's claims above it.

Coverage record

Synced at test(plitejs): check every recording command's accept and reject on every small document. The verification describes these files as they stand there:

FileWhat the check exercises
packages/plitejs/src/authored/tree/record.tshow Suggesting records each command
packages/plitejs/src/authored/tree/record-completion.tscompletion of a recorded change, the prefix slot included
packages/plitejs/src/authored/tree/resolve.tsaccepting and rejecting everything
packages/plitejs/src/authored/tree/cuts.tsjoining the halves of a rejected cut
packages/plitejs/src/authored/ledgerthe review ledger the ledger law compares
packages/plitejs/src/history/history-state.tsundo, redo and the mapping through a remote paragraph
packages/plitejs/test/support/recording-laws.tsthe laws the check and the sampled spec share
packages/plitejs/scripts/authored-documents.tsthe documents both formal checks build

To see whether the verification needs another look, find the sync commit with git log --oneline -1 --grep "check every recording command's accept and reject", then run git log --oneline <that commit>..HEAD -- with the table's files and packages/plitejs/scripts/authored-recording-order.ts. For each commit it lists, read the diff and confirm three things. A new command or mark kind that recording writes is in actsOf or the builder. A new refusal the editor gives on purpose is still an EditorRefusalError. The laws still compare with a plain editor, not with the resolver's own output. Move the sync commit in this file forward, naming its subject, only after that check and a run of pnpm check:authored-recording.

What it does not cover

  • Documents of more than one top-level block at the gate, and prior edits. The sampled laws start at two blocks with two-letter lines and up to three earlier edits, so they still own that space.
  • Plain content between the halves of a cut and stored verdicts, so the three resolver mutants in What a pass proves pass.
  • --replay reads only a recording law's counterexample, [initial, history, command]. The ledger law's counterexample has another shape, and the flag refuses it.
  • A bug the resolver repeats before and after the command. The reject law compares the resolver with itself across the command, so a resolver that rejects some stored shape wrongly passes when the shape was already there.
  • A node command that a plain editor's schema refuses wrongly. recording-plain leaves out commands that name a node or slot, and every other law skips a case whose plain editor throws a schema error.
  • A key typed over a selection. typeOver calls tx.text.insert, while a keystroke dispatches the text.insert command, which replaces whole blocks first. Over the whole text of a quote with a pending unwrap, that command refuses in both intents where tx.text.insert records, and the check would count the refusal as no failure.
  • Decisions one at a time, stored verdicts and their order, which the authored-decision-order check owns.
  • Named roots, nested roots, lists and marks other than links, which no world holds. Inline voids and a unique key only in the fields world's four documents, under retypes alone. Tables only in the grid world's ten documents, under its keys, selection deletes, deleteRange, typeOver and removePart. Paste, Enter over a selection, a text write at a node's path, the removal of a live row and other node commands in a table get no grid expectation. In the grid world a teammate's step or command at a letter never crosses a decision, so the crossed and take-back rules judge its documents only under an inserted line or a moved element. A key or selection delete is judged on the accepted document alone, because its frame hides the struck parts, and a deleteRange or typeOver with an end in a struck line gets no stored-document expectation, because landing moves that end. Code blocks only in the code world's six documents, under its writes and whole-text deletes. A selection with one end outside a code block, a mark toggle, a paste of more than the one letter Z and a format another author left pending on the code text get no one-text expectation.
  • The browser, beforeinput, IME, the clipboard and Yjs.

/pstack:maintain-formal-verification-skill brings this verification back in line after changes that did not recheck it.

Repository

udecode/plate

Path

.agents/skills/authored-recording-order/SKILL.md

Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.