Write block(s)
traceable_block_writeInsert one or more body blocks at an anchor: after a TraceID (afterItemId), after a [[row N]] anchor (afterOrder, from a document read), or at the start/end of the body (position; default end). The anchor must be a body row: title-page content is written with traceable_segment_write. Returns the created rows with their new row orders, plus a renumbered marker when the insert shifted existing rows (by: rows inserted, rowsShifted: visible body rows that moved; footer rows below are renumbered too but not counted). IMPORTANT: an insert renumbers every row after the anchor, so row orders from earlier reads/responses go stale — re-read before further order-based calls, or anchor by TraceID (immune to renumbering).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| position | No | Fallback position in the body when no anchor is given (default end) | |
| afterOrder | No | Insert after this row order (the [[row N]] anchor) | |
| documentId | Yes | The document UUID | |
| trmContent | Yes | Traceable Markdown (TrMD). GitHub-flavored Markdown plus [[directive]] blocks — see traceable_capabilities. Read-only annotations ([[row]]/[[document]]) are rejected. | |
| afterItemId | No | Insert after the row with this TraceID (e.g. FR-003) | |
| baseRevision | No | The revision (meta.revision) from the traceable_doc_read, or the previous write, this change is based on. When given, the write is refused with nothing changed if the document has changed since, so you never overwrite edits you have not seen. Each write returns the current revision. The revision tracks the document's content rows, so changes that touch no row (its name and other metadata, the reference list, Test Plan entries) return it unchanged. A revision is an opaque value: compare it whole, never read meaning into its parts (they are not a counter). |