content: content/block-path + block-depth — locate a block in the tree (825/825)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 1m1s

Read-side companion to doc-find-deep + reparent: ancestor-section chain
(root-first) for a block id, nil if absent (distinct from () top-level path);
block-depth is the path length. For breadcrumbs / scoping. New suite +13.
Probe this pass found no bugs: clone/remap tree-wide, all block types have
asMarkdown:.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-07 19:45:29 +00:00
parent e9316b37c2
commit 160d0f2dd0
6 changed files with 124 additions and 5 deletions

View File

@@ -19,7 +19,7 @@ injected adapter, not core.
## Status (rolling)
`bash lib/content/conformance.sh`**812/812** (Phases 14 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`**825/825** (Phases 14 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
@@ -137,6 +137,18 @@ lib/content/api.sx ── (content/edit) (content/render) (content/history) ─
## Progress log
- 2026-06-07 — Feature: `content/block-path` + `content/block-depth`
(block-path.sx, new suite). The read-side companion to doc-find-deep (locate
the block) and move-into/promote (relocate it): returns the ancestor-section
id chain (root-first) for a block id — where it sits in the tree — or nil if
absent (distinct from the `()` path of a present top-level block). block-depth
is the path length (0 top-level, -1 absent). For breadcrumbs and scoping an
edit to a block's enclosing section; distinct from toc/outline (which work on
headings). Pure traversal. Also ran an adversarial probe this pass: confirmed
clone/remap-ids + prefix-ids are tree-wide, and all 12 block types + CtDoc have
asMarkdown: methods (no missing-render-method bug). +13 tests. 825/825 (43
suites).
- 2026-06-07 — Feature: tree reparent in move.sx. Until now insert/move were
positional and top-level only, so a block could never be moved *into* a section
or *out* of one — a real gap for editing nested documents. Added