Skip to content

Change operations v1.1: table ops, positioned node insert, change grammar - #61

Open
ronaldtse wants to merge 2 commits into
mainfrom
change-operations
Open

Change operations v1.1: table ops, positioned node insert, change grammar#61
ronaldtse wants to merge 2 commits into
mainfrom
change-operations

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Change operations v1.1

The change tier is extended so every construct in the model is
addressable for collaborative editing (OT/CRDT-grade). This answers
two committee questions on the document:

  1. How are fine-grained operations on tables and computed content
    exchanged?
    — the whole change family now covers row/column
    insert/delete/move, cell update, cell merge, and cell split with
    grid coordinates that account for colspan/rowspan. Computed cells
    (formulas in cells) ride the existing stem construct with an open
    notation key — no new types needed.

  2. How does change ordering relate to concurrent editing?
    the existing parentIdentifier field already provides the causal
    DAG of changes. The new clause 11 v1.1 subclauses (in the spec
    PR) state plainly: changes are operation records, ordering is
    the DAG, and how concurrent operations transform against each
    other (OT, CRDT, diff/patch) is out of scope — the same neutrality
    pattern as serialization.

Models

  • models/change/tables/ — new family:
    • TableChange root
    • TableArea enum (head / body / foot)
    • CellCoordinate (row, column — zero-based grid slots)
    • RowInsert / RowDelete / RowMove (with area)
    • ColumnInsert / ColumnDelete / ColumnMove (with template
      cell)
    • CellUpdate / CellMerge / CellSplit
  • models/change/NodePosition.lml — new: container reference +
    zero-based child ordinal.
  • models/change/NodeInsert.lml — gains +position (was: only
    +content; insertion point is now explicit).

Grammar

  • grammars/basicdoc.rnc — change grammar (changeset + change +
    all operations) appended in lockstep with the LML. Targets use
    plain text (cross-document identifiers), not IDREF.
  • grammars/basicdoc-compile.rncstart = document | changeset.

Fixtures

  • examples/table-changes.{xml,yaml} — twin ChangeSet exercising
    every operation over the line-item table (li1t1) in
    document.xml, including a computed cell (FormulaBlock inside a
    ParagraphTableCell): row insert → column insert → header cell
    update → computed cell update → merge → split → row move
    (body→foot) → column move → row delete → positioned node insert
    → node delete (with hash) → node move → cursor-range text edit →
    register entry update.

Views

  • views/Changes.lml — extended with the new family and the
    inheritance associations.
  • views/TableChanges.lml — new focused plate.
  • New PNGs: images/Changes.png (regenerated), images/TableChanges.png.

Gates

rake check   ✓ (lint, parity, verify, render)
rake fixtures ✓ (XML + YAML, all four files)
rake profiles ✓ (legalexchange/1.0)

135 model files, 17 views, 135 types.

What did NOT change

  • The content tiers themselves (document/sections/blocks/inline) are
    unchanged. The audit confirmed every content construct is already
    one of four addressable shapes (string content, key/value slot,
    ordered sequence, table grid); the missing operations on
    ordered sequences (positioned node insert) and tables (the whole
    family) are exactly what this PR adds.

The spec half (clause 11 subclauses, Annex E business interchange,
Annex D extension, submodule pin) follows in the cc-lightweight-doc
PR.

…mmar

The change tier is extended so every construct in the model is
addressable for collaborative editing (OT/CRDT-grade). This answers
two TC 154 questions on the document: how fine-grained operations on
tables and computed content are exchanged, and how change ordering
relates to concurrent editing.

models/change/tables (new):
  TableChange root, TableArea enum (head/body/foot),
  CellCoordinate; RowInsert/RowDelete/RowMove, ColumnInsert/Column
  Delete/ColumnMove, CellUpdate/CellMerge/CellSplit. Grid coordinates
  account for colspan/rowspan.

models/change:
  NodePosition (parent reference + zero-based child ordinal);
  NodeInsert gains +position.

grammars/basicdoc.rnc:
  New change grammar (changeset + change + all ops); basicdoc-compile
  start now permits document | changeset.

fixtures:
  examples/table-changes.{xml,yaml} — twin ChangeSet exercising every
  operation over the line-item table (li1t1), including a computed
  cell (FormulaBlock in a ParagraphTableCell).

views:
  Changes.lml extended with the new family and inheritance; new
  TableChanges.lml focused plate. Renders as Changes.png and
  TableChanges.png.

Gates: rake check + rake fixtures + rake profiles green
(135 model files, 17 views).
A purchase order as a base BasicDocument: trade identifiers on the
document register with ISO 6523 scheme keys, clause text in sections,
line items in a table, computed total cells as formula blocks.
Referenced by the specification's Annex E (business document
interchange).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant