Skip to content
language.blue
repo.blue ↗Run this example

05 · Collection embedding

Five Embeddings, Three Games

One Host operation attaches Alpha twice, Beta twice, and Gamma once. The workspace retains three unique managed Games but displays five embedding paths, and the Host observes initialization independently at every occurrence.

Executable Playground example1 guided action5 occurrence paths3 child sessions

The identity distinction

A repeated reference is not a copied document.

Alpha has one authoritative child identity even though it occurs twice in the Host’s collection. The same is true for Beta. Gamma occurs once. Initialization runs once per unique managed child, while the Host’s occurrence-scoped listener reacts at all five paths.

Three initializations; five Host observations.

Document identity controls child-session reuse. Occurrence identity controls where the child is embedded and where the parent applies its event.

Host /children
├─ /alphaHome ── Alpha Game ─┐
├─ /alphaAway ─ Alpha Game ─┘ one child
├─ /betaHome ─── Beta Game ──┐
├─ /betaAway ─── Beta Game ──┘ one child
└─ /gamma ────── Gamma Game ─── one child

5 paths · 3 sessions · 5 Host events
distribution: Alpha 2 / Beta 2 / Gamma 1

Run it

One request builds the whole graph.

This lesson uses one deliberately dense operation so the exact request, deduplication boundary, and occurrence-scoped results can be compared side by side.

01
Inspect the Host-only initial state.No child cube or embedding edge exists yet.
02
Run the five-document attachment request.The request names all five paths and the exact processable child documents.
03
Count the resulting cubes.The canvas shows the Host plus Alpha, Beta, and Gamma: four cubes, not six.
04
Inspect Links and Activity.See five labelled occurrence paths, three child initializations, and five parent applications distributed 2/2/1.

What this teaches

Deduplication must happen at the right layer.

Collapsing equal references into one child session is correct. Collapsing their parent occurrences would lose meaning and events.

Document IDSelects one unique managed child session.
Occurrence pathNames one place that child appears inside the Host.
InitializationRuns once for each unique child document.
Parent eventApplies once for every matching occurrence path.
Next: make authority itself a living document.

Alice’s Agent uses an active Operation Mandate to gain one exact power and loses it again after termination.