Transclusion Architecture

How content reuse works in Xudanu — what we built, what we're building, and how it connects to the Xanadu lineage

Xanadu Lineage: Transclusion is Ted Nelson's term for reusing content from one document inside another — not by copying, but by reference. The original passage maintains its bond to the source, carrying full provenance. Xudanu implements this concept using modern Rust and web technology, building on the open-source Udanax Gold release (1999).

How It Works Today

Source Document chars 100–200 The passage being transcluded... BLAKE3 hash stored Revision pinned reference Compound Document Original text written here... ▣ transclusion [source:100-200] The passage being transcluded... More original text... Provenance Original author: Jane Austen (historical) Hash verified: Source revision: 3
A transclusion in a compound document. The green block is live content from another work. Provenance flows through automatically.

Current Implementation

FeatureStatusDetails
Structural transclusionWorking (FR-37)Inline RangeElement::Transclusion in the O-tree — single source of truth, no side-table drift; read-only resolution with generation-stamped caches
Placement UXWorkingPlace transclusions at arbitrary positions; pinned quotations in the placement UI
Range-based referenceWorkingStores (source_work_id, char_start, char_end)
Recursive resolutionWorking32-level depth with cycle detection
Span migrationWorkingPositions update when the source is edited; migration through arbitrary deltas, including inside materialized virtuals
Provenance propagationWorkingOriginal author attribution flows through transclusion chains; attribution splits honestly when passages are edited
Derived worksWorking (FR-37)Trails materialize as real derived editions; generation-checked ensure keeps derived content consistent with sources
Content hash (BLAKE3)FR-26Hash stored at creation, verified on resolution
Version pinningFR-26Source revision recorded, original version retrievable from history
Immutable snapshotsFR-26 Phase 3Blob store preserves exact content, survives source deletion
Cross-server transclusionWorking (FR-6)Domain-based tumblers; content fetched from remote servers with BLAKE3 verification and Ed25519 TOFU identity
SpanfiladeFutureI-stream transclusion — see below

Structural Transclusion (FR-37)

The largest architectural change since this document was first written: transclusions now live inside the document model itself, as an inline RangeElement::Transclusion element in the O-tree — one source of truth, where the earlier design kept a separate compound side-table (which could drift from the text).

Current focus: read-only structural transclusion is the production path. Edge cases under active hardening: padding newlines, position migration on source edit, overlapping regions in the DOM builder. See the GitHub repository for the FR-37 design notes.

Content-Addressed Transclusion (FR-26)

Since v1.1, every new transclusion stores a BLAKE3 content hash alongside the range reference. This means:

Created BLAKE3 hash computed Revision pinned Source edited Hash mismatch detected Warning logged Resolution Shows current text + "source changed" indicator Phase 3 Blob snapshot survives deletion
Transclusion lifecycle: creation → source change → resolution → (future) immutable snapshot

Recursive Resolution

Transclusions can chain: Document A transcludes from B, which transcludes from C. Xudanu resolves these chains recursively up to 32 levels deep, with automatic cycle detection.

Doc A compound transcludes Doc B also compound transcludes Doc C source work depth 0 depth 1 depth 2 provenance flows back through chain
Three-level transclusion chain with provenance propagation

Span Migration

When a source document is edited, the character positions of transclusions referencing it need to update. Xudanu uses delta-based span migration: the text delta (insert/delete operations) is used to compute new positions for all affected transclusion ranges.

What this means: If you transclude characters 100–200 from a document, then someone inserts 50 characters at position 50, your transclusion automatically shifts to 150–250. No manual updating needed.

What We Don't Have (Yet)

Spanfilade

Gold's spanfilade is a fundamentally different model. Instead of referencing character positions, it inserts content at the I-stream level — a layer below character offsets. This means:

Our path: FR-26 Phase 3 (blob snapshots) provides the key property — transclusions become permanent references that survive source deletion. It's not spanfilade, but it gives 80% of the practical value. Full spanfilade would require reimplementing the enfilade data structure (months of work), but the ent/ module already has the crum/HTree machinery to support it.

Cross-Server Transclusion

Cross-server transclusion works today (FR-6): a transclusion references a tumbler "server.domain".work_id.revision.start-end, and the content is fetched from the remote server with BLAKE3 hash verification and Ed25519 trust-on-first-use server identity (pinned on first contact, change-detected thereafter). A transclusion from another server renders exactly like a local one, and its provenance chain reaches across the network. See the network guide for the trust model and the adversarial resilience notes for how peer-supplied content is validated at the boundary.

The Xanadu Connection

Design heritage: Xudanu's transclusion model is inspired by but not identical to Udanax Gold's. The ent/ module has inline citations to specific Gold source files (entx.cxx, dagwoodx.cxx, branchx.cxx). The design decision to use range-based transclusion instead of spanfilade is documented in docs/dev/FR-17-storage-architecture.md.

The key architectural choices:

ConceptGoldXudanu
Content referenceEnfilade/I-stream positionCharacter range + BLAKE3 hash
Version persistenceEnfilade preserves all versionsRevision history (FR-23) + blob snapshots (FR-26 P3)
ProvenanceCrum-basedEd25519 signatures + span provenance
Cross-serverCosmic tumblers + FeBeDNS-anchored tumblers + XCP/HTTP
Live updatesBuilt into enfiladeO-tree CRDT delta + span migration

Visual Walkthrough

Real screenshots of transclusion in action. These are not mockups.

1. Start with a source document

The source document contains the original text. Any passage can be transcluded into other documents.

Source document with original content
This is the document we'll pull a passage from. The text lives here and maintains its provenance.

2. Select a passage to transclude

Select text in the source document and click the Transclude button. The passage is held in memory.

Selecting a passage with the Transclude button
The selected passage will maintain a live link back to this source document.

3. Place the transclusion

Navigate to the destination document and click to place the transclusion. The excerpt text appears inline.

Placing the transclusion in the destination document
The placed content is a live reference, not a copy. If the source is edited, the transclusion updates.

4. Transcluded content with provenance

The placed transclusion shows its source origin. The derivation chain traces the content back to its original author.

Transcluded content showing derivation chain and provenance
Each transclusion carries the original author's attribution through the chain — this is the Xanadu principle in action.

5. Transclusion visible in Connections

The Connections panel shows all transclusions in the current document — source title, excerpt, and character range.

Transclusion entry in the Connections panel
Click an entry to highlight the transclusion in the document. A ⚠ changed badge appears if the source was edited after transclusion.

Try It Yourself

# Clone and build
git clone https://github.com/jonesd/xudanu.git
cd xudanu
cargo build --features server -p xudanu

# Start the server
./target/debug/xudanu-server run 127.0.0.1:8080

# Open http://localhost:5173
# 1. Create a document with some text
# 2. Select a passage, click "Transclude"
# 3. Create another document
# 4. Place the transclusion in the new document
# 5. Edit the source — watch the transclusion update live

Further Reading

Xudanu is an independent open-source project (Apache 2.0), not affiliated with Project Xanadu™ or the Udanax team. Transclusion concept © Ted Nelson. Udanax Gold released under X11 license (1999).