Open app
Moonborn — Developers

Fork attribution

Read the lineage tree, count downstream forks, find the canonical ancestor of any persona.

Every fork writes a parent edge into the lineage tree. Queries:

Find a persona's ancestry

const lineage = await client.personas.getLineage({ id: persona.id });
console.log(lineage.ancestors); // root → ... → parent
console.log(lineage.root.id);

Count direct + transitive forks

lineage.descendants returns every persona that traces back to this one (transitive). lineage.children returns the direct forks.

const lineage = await client.personas.getLineage({ id: canonical.id });
console.log({
  directForks: lineage.children.length,
  totalDescendants: lineage.descendants.length,
});

Walk the marketplace attribution graph

Listings publish with a fromPersonaId. When a downstream user installs and then forks, the original listing appears in the fork's ancestry. To bill or report on a listing's downstream impact:

const listing = await client.marketplace.getListing({ id: listing.id });
console.log({
  downloads: listing.downloads,   // installs (no further mutation)
  forks: listing.forks,           // installs that produced new personas
  ratingsAvg: listing.ratingsAvg,
});

Cross-org attribution

A fork from a marketplace install respects the original listing's license (CC-BY / ShareAlike / commercial-use). The lineage edge records both the immediate parent (the install) and the marketplace listing — visible in lineage.ancestors with a marketplaceListingId breadcrumb.

Tier

Lineage queries: every tier. Marketplace cross-org attribution: Free and up (listing must be public).

Related