Compound Document Builder

Assemble new documents from passages of existing works — the Xanadu EDL model, made visual

Contents

What Is a Compound Document?

A compound document is a document assembled from passages of other documents. Instead of writing everything from scratch, you select relevant passages from existing works and arrange them with your own connecting text. Each transcluded passage maintains a live reference to its source — if the source changes, the transclusion updates.

This is Ted Nelson's EDL (Edit Decision List) concept: the document doesn't contain copies of text — it contains addresses pointing to text in other documents. When you read a compound document, the system fetches and assembles the referenced content in real time.

Your Document (Compound) [Original] Introduction paragraph [From: Criminal Code] "Theft is defined as..." [Original] Analysis connecting the law... [From: Case Law] "The court held that..." [From: Legal Commentary] "Scholars argue..." [Original] Conclusion live references to source works Criminal Code Case Law Commentary
A compound document mixes original text with transcluded passages from multiple sources

Why Use Compound Documents?

Never Copy-Paste Again

Transclusion replaces copy-paste. The passage stays connected to its source. No drift, no outdated copies.

Automatic Attribution

Every transcluded passage carries its provenance. Readers can trace any quote back to its origin in one click.

Live Updates

If a source document is revised, the transcluded content updates in your compound — through span migration.

Build Arguments

Assemble evidence from multiple sources, add your analysis between them. The structure IS the argument.

Misquote-Proof

Because passages are live references, readers can verify they match the source. No cherry-picking or distortion.

Reusable Structure

Others can transclude from YOUR compound into theirs. Content flows through the docuverse with full provenance.

How to Use the Builder

Opening the Builder

Open any document and click "Build" in the document toolbar (next to "Compare" and "Perspective"). The three-panel builder layout opens:

Source Pool Source A Source B + Add source Select text → Include Compound Document (live preview) [Original] Intro text [From: A] "Transcluded text..." [Original] Your analysis [From: B] "More text..." [Original] Conclusion Structure 1. [Original] Intro 2. [From A] Passage 3. [Original] Analysis 4. [From B] Evidence 5. [Original] Conclusion

Step-by-Step

  1. Add a source: Click "+ Add source" in the left panel. Pick a document from your library.
  2. Read the source: Click the source name to expand its text in the lower-left panel.
  3. Select a passage: Click and drag to select text in the source. The "Include passage" button appears at the top.
  4. Include it: Click "Include passage". The text is transcluded into your document at the end.
  5. Repeat: Add more sources, include more passages. Mix in your own original text.
  6. Review structure: The right panel shows the document composition — what's original vs. what's transcluded.
  7. Done: Click "Done" to return to the normal editor. Your compound is saved.
Phase 2 features:
What happens behind the scenes: Each "Include" creates an inline RangeElement::Transclusion in the O-tree CRDT. The transclusion stores the source work ID, character span, and BLAKE3 content hash. Span migration keeps positions valid through edits. Provenance chains trace each passage back to its origin.

Example 1: Single-Source Compound

Quoting a Single Source with Commentary

You're writing a response to an essay. You want to quote specific passages and respond to each one.

Structure:

Each quote is a live transclusion. If the essay is revised, your document shows the updated quotes automatically. Readers can click any quote to verify it against the source.

Example 2: Multi-Source Compound

Building a Literature Review

You're surveying multiple papers on a topic. Each paper contributes a key finding.

Structure:

Four sources, one document. Each finding is traceable to its paper. The structure shows how ideas build on and challenge each other.

Building a Legal Argument from Statutes and Precedents

A legal brief is inherently a compound document — it assembles statutes, case law, and commentary into a coherent argument.

Structure:

Three source types: statute, case law, commentary. The lawyer's original analysis weaves them together. Every citation is verifiable — no misquotation possible.

Example 4: Literary Anthology

Curating a Thematic Collection

You're assembling a collection of passages from different works that explore a common theme.

Structure:

Four authors in conversation. The curator's notes bridge the passages. Each quote is a live link to the source text — readers can explore the original context.

Understanding the Structure

The structure outline (right panel) shows your document's composition. Each entry is either:

Original — text you wrote yourself
Transclusion — text included from another work

The outline tells you:

A document with 0 transclusions is just a regular document. A document with 1+ transclusions is a compound.

Provenance and Attribution

Every transcluded passage carries provenance — a chain showing where the content originated and how it reached your document. This is Gold's again() function: recursive tracing of content reuse.

Your Compound ↑ transcluded from Legal Commentary ↑ quoted from Brown v. State ↑ cited from Penal Code § 487 ✓ ORIGINAL
Provenance chain: trace any passage back through its full reuse history

To view the provenance chain for a transcluded passage, click the passage and select "Trace provenance". The chain shows each hop with the work title, author, and whether the content is original or derived.

EDL Export

A compound document is fundamentally an EDL — a list of content references. The structure can be exported as JSON:

{
  "version": 1,
  "title": "My Legal Brief",
  "entries": [
    { "type": "text", "content": "Introduction paragraph..." },
    {
      "type": "transclusion",
      "source_work_id": "0x415",
      "source_title": "Penal Code",
      "char_start": 120,
      "char_end": 340,
      "content_hash": "a1b2c3...",
      "resolved_text": "Grand theft is theft committed when..."
    },
    { "type": "text", "content": "Analysis paragraph..." }
  ]
}

This format is compatible with the Xanadu EDL concept and could be imported by other systems that understand content-addressed transclusion.

Connection to Udanax-Gold

Gold's primary document creation model was compound-based. The compound builder is the modern equivalent of Gold's assembly facilities:

Gold conceptXudanu equivalentWhat it does
EnfiladeO-tree CRDTStores document structure
TumblerBeId + char positionAddresses content within works
Transclusion linkRangeElement::TransclusionInline reference to source passage
again()compute_provenance_chainRecursive content origin tracing
Intercomparisonfind_shared_regions + PerspectiveVisual document comparison
Bazik (assembly)Compound BuilderVisual document assembly

The compound builder completes the loop: it provides the authoring tool that makes the docuverse structure buildable. Without it, users can link and view documents but can't easily build new documents from existing content. With it, the full Xanadu model — create, connect, transclude, trace — is available in a visual interface.

Try it: Open a document, click "Build", add a source, select a passage, click "Include passage". Your document is now a compound. Click "Done" and use the Compound panel (left rail) to explore its structure.

Stretch Goals: Where the Builder Could Go

The current Compound Builder is Phase 1 — basic assembly. Here's what it could become:

Drag to Reorder

Drag transcluded passages up/down to rearrange your document. The O-tree CRDT already supports position changes — we just need the drag UI.

Drag from Source

Instead of select-then-click, drag selected text directly from a source panel into the document at the exact insertion point. Visual drop indicator shows where it lands.

Compound from Trail

Convert a trail (curated reading sequence) into a compound document. Each trail stop becomes a transcluded passage, with your connecting text between them. Result: a guided anthology built from the docuverse.

Perspective Integration

Enter Build mode directly from the Perspective view. Drag passages from neighbor columns into your center document. Sources auto-populate from Perspective neighbors. Build while you explore.

Fuzzy Match Suggestions

When you type text similar to a passage in another document, the Builder suggests: "This resembles a passage in [Source]. Transclude instead?" Turns accidental duplication into intentional structure.

Version Sync

When a source document is revised, the Builder shows which transclusions are affected. Option to update to latest source version, or keep the original. Diff view shows what changed.

Auto-Citation

Generate citations from transclusion provenance. Format as MLA, APA, Chicago, or legal (Bluebook). Inline citations auto-inserted. Bibliography auto-generated from all transclusion sources.

Templates

Pre-defined compound templates: Legal Brief (statute + precedent + analysis sections), Literature Review (paper + critique + synthesis), Debate Brief (claim + counter-claim + rebuttal). Template defines structure; user fills with transcluded content.

EDL Import

Import an EDL (Edit Decision List) from an external source. The Builder creates the compound from the EDL's content references, fetching each source passage. Interoperability with other Xanadu-lineage systems.

Nested Compounds

A compound document can itself be a source for another compound. The Builder shows nesting depth. Structure outline uses indentation to show hierarchy. Provenance chains trace through multiple levels of assembly.

Collaborative Assembly

Multiple users build the same compound simultaneously via CRDT. Each user sees the other's transclusions appear in real-time. Useful for team research projects, collaborative legal briefs, group anthologies.

Smart Compilation

The Builder analyzes your original text and suggests relevant passages from the docuverse using content fingerprinting. "You mentioned X — here are passages from 3 works that discuss X. Include any?"

Priority Order

FeatureEffortImpactWhy
Drag to reorderSmallHighEssential for document flow
Compound from TrailSmallHighConnects two existing features
Perspective integrationMediumHighBuild while exploring
Fuzzy match suggestionsMediumHighProactive structure building
Auto-citationMediumHighReal-world academic use case
Version syncMediumMediumImportant for long-lived compounds
TemplatesMediumMediumLowers barrier for new users
EDL importSmallLowInteroperability
Nested compoundsAutomaticLowAlready works, needs UI
Collaborative assemblyAlready worksMediumCRDT handles it; needs testing
Smart compilationLargeHighAI-assisted authoring