From fd16c7869876c671b84bfda9cd50dfc8b1ba1a7a Mon Sep 17 00:00:00 2001 From: giles Date: Sun, 7 Jun 2026 09:03:23 +0000 Subject: [PATCH] content: lock op-log block-type coverage (callout/media via store) + 4 tests (746/746) Co-Authored-By: Claude Opus 4.8 (1M context) --- lib/content/scoreboard.json | 6 +++--- lib/content/scoreboard.md | 4 ++-- lib/content/tests/store.sx | 32 ++++++++++++++++++++++++++++++++ plans/content-on-sx.md | 7 ++++++- 4 files changed, 43 insertions(+), 6 deletions(-) diff --git a/lib/content/scoreboard.json b/lib/content/scoreboard.json index 526cba50..f5634352 100644 --- a/lib/content/scoreboard.json +++ b/lib/content/scoreboard.json @@ -31,7 +31,7 @@ "data": {"pass": 25, "fail": 0}, "wire": {"pass": 11, "fail": 0}, "validate": {"pass": 23, "fail": 0}, - "store": {"pass": 29, "fail": 0}, + "store": {"pass": 33, "fail": 0}, "snapshot": {"pass": 20, "fail": 0}, "crdt": {"pass": 34, "fail": 0}, "crdt-tree": {"pass": 21, "fail": 0}, @@ -42,7 +42,7 @@ "md-doc": {"pass": 12, "fail": 0}, "fed": {"pass": 20, "fail": 0} }, - "total_pass": 742, + "total_pass": 746, "total_fail": 0, - "total": 742 + "total": 746 } diff --git a/lib/content/scoreboard.md b/lib/content/scoreboard.md index 0811d718..73064634 100644 --- a/lib/content/scoreboard.md +++ b/lib/content/scoreboard.md @@ -35,7 +35,7 @@ _Generated by `lib/content/conformance.sh`_ | data | 25 | 0 | 25 | | wire | 11 | 0 | 11 | | validate | 23 | 0 | 23 | -| store | 29 | 0 | 29 | +| store | 33 | 0 | 33 | | snapshot | 20 | 0 | 20 | | crdt | 34 | 0 | 34 | | crdt-tree | 21 | 0 | 21 | @@ -45,4 +45,4 @@ _Generated by `lib/content/conformance.sh`_ | md-import | 38 | 0 | 38 | | md-doc | 12 | 0 | 12 | | fed | 20 | 0 | 20 | -| **Total** | **742** | **0** | **742** | +| **Total** | **746** | **0** | **746** | diff --git a/lib/content/tests/store.sx b/lib/content/tests/store.sx index 6065bc5e..56e0061a 100644 --- a/lib/content/tests/store.sx +++ b/lib/content/tests/store.sx @@ -119,3 +119,35 @@ "head of empty stream" (doc-ids (content/head B "never")) (list)) + +;; ── op-log carries non-core block types (callout/media) through replay ── +(content-bootstrap-callout!) +(content-bootstrap-media!) +(define B3 (persist/open)) +(content/commit! + B3 + "rich" + (op-insert (mk-callout "co" "note" "hi") nil) + 1) +(content/commit! + B3 + "rich" + (op-insert (mk-media "v" "video" "/c.mp4") "co") + 2) +(content/commit! B3 "rich" (op-update "co" "text" "edited") 3) +(content-test + "op-log rich ids" + (doc-ids (content/head B3 "rich")) + (list "co" "v")) +(content-test + "op-log callout type" + (blk-type (doc-find (content/head B3 "rich") "co")) + "callout") +(content-test + "op-log callout update" + (str (blk-send (doc-find (content/head B3 "rich") "co") "text")) + "edited") +(content-test + "op-log media type" + (blk-type (doc-find (content/head B3 "rich") "v")) + "media") diff --git a/plans/content-on-sx.md b/plans/content-on-sx.md index f4c920c9..c25bdc7c 100644 --- a/plans/content-on-sx.md +++ b/plans/content-on-sx.md @@ -19,7 +19,7 @@ injected adapter, not core. ## Status (rolling) -`bash lib/content/conformance.sh` → **742/742** (Phases 1–4 COMPLETE + ~34 extensions, hardened: HTML/SX escaping, Markdown render + import/export incl. tables & frontmatter (full round-trip), CvRDT flat + nested-tree + durable replication, tree-aware validation, snapshot cache, doc metadata, plain-text render, nested block trees + deep editing + flatten + relative reorder, doc stats + summary + multi-doc index, table + callout + media blocks, HTML page wrapper + SEO page, doc composition + id-remap, portable data + wire serialization, block query + transforms + find/replace, TOC + anchored headings + outline, normalization) +`bash lib/content/conformance.sh` → **746/746** (Phases 1–4 COMPLETE + ~34 extensions, hardened: HTML/SX escaping, Markdown render + import/export incl. tables & frontmatter (full round-trip), CvRDT flat + nested-tree + durable replication, tree-aware validation, snapshot cache, doc metadata, plain-text render, nested block trees + deep editing + flatten + relative reorder, doc stats + summary + multi-doc index, table + callout + media blocks, HTML page wrapper + SEO page, doc composition + id-remap, portable data + wire serialization, block query + transforms + find/replace, TOC + anchored headings + outline, normalization) ## Ground rules @@ -113,6 +113,11 @@ lib/content/api.sx ── (content/edit) (content/render) (content/history) ─ ## Progress log +- 2026-06-07 — Hardening: audit confirmed the persist op-log (store.sx) carries + every block type through commit → replay (op-insert carries the block + instance; updates apply by id). Locked with +4 store tests (callout/media + insert + update via the durable log). No bug; coverage gap closed. Suite + 746/746. - 2026-06-07 — Hardening: tree-CRDT orphan reparenting. Concurrent delete-section + insert-child previously orphaned the child (its parent no longer a live section) → silently dropped from materialise. Fixed