Starholder API

The Emission Surface

A field-by-field guide to the structured document every world turn produces, in the wire format agents receive.

What the Emission Surface Is

Every time someone asks the world a question — whether through the browser, the REST API, an MCP tool, or a directive — the Protocol Emission Engine (PEE) runs an inference turn. The output of that turn is not a chat message. It is a structured, layered document called the Emission Surface.

The Emission Surface carries everything a consumer needs to present, analyze, or build on what the world just thought: the prose response, every entity and setting the reasoning touched, resolved imagery for each, atmospheric signals from the settings involved, how dense or sparse the territory is, what claims were made and how confident the system is, and session context that carries forward into the next turn.

This is what makes Starholder's output a media substrate rather than a text response. A documentary agent reads the prose and media layers. A podcast agent reads the prose and epistemic layers. An interactive experience reads the refs and topology layers. A research tool reads the claims and contradictions. They all consume the same document — they just use different parts of it.

Current turns carry schema: "starholder.emission.v2". Snapshots persisted before v2 can carry starholder.emission.v1; on the wire the difference is the shape of a media bundle (see Bundles).


How to Get the Emission Surface

Every API that returns a surface sends the same compact wire document, published in the OpenAPI document as WireEmissionSurface. This guide describes that document.

TransportEndpointWhere the surface is
ExecutePOST /api/v1/world/{worldId}/executedata.output.surface, when data.output.kind is emission_surface
ConsultPOST /api/v1/world/{worldId}/consultdata.output.surface
SnapshotGET /api/v1/world/{worldId}/turns/{turnId}/surfaceThe response body. Fetch any completed turn.
Room reply streamPOST /api/v1/chat/rooms/{chatRoomId}/continue with Accept: text/event-streamdata.data.surface of the surface_complete event
Room feed streamGET /api/v1/chat/rooms/{chatRoomId}/feed with Accept: text/event-streamstream.frame.data.data.surface of the persona.stream.delta event whose stream.frame.type is surface_complete
World streamGET /api/v1/world/{worldId}/streamThe surface_complete event. This stream is currently switched off; see SSE Streaming.

A snapshot written by an older turn can be stored in the expanded form instead, where refs is an object holding catalog, accepted, and anomalies arrays. A wire document's refs is a map keyed by ref.

Layer Projection

You don't always need all eight layers. Add ?layers=text,refs,context to POST .../execute, POST .../consult, or the snapshot route and you'll get only those layers (plus identity, which is always included). The surface is then a projection, { schema, requestedLayers, surface }, whose surface holds just the requested layers and whose schema ends in .projection. Unknown layer names are ignored.


The Eight Layers

LayerWhat It Tells You
identityWho produced this turn, when, under what directive, and with what authority
textThe finalized prose: annotated with ref tags, and clean for display
refsEvery ref the turn considered or used, where each appears in the text, and which were rejected — with navigable API links
mediaResolved imagery per entity or setting, positioned against specific mentions in the text
contextAtmosphere from the dominant setting (sounds, smells, light, temperature, horizon), environment-matching text, music, and semantic scene profiling
topologyRetrieval density, confidence metrics, what drove the retrieval, and how much prior reasoning exists
epistemicClaims made, confidence scores, uncertainty, contradictions detected, and reasoning mode
sessionCross-turn memory: entity momentum, accumulated claims, open threads, warm summaries

Identity Layer

Provenance for the turn. Every field you need to know who triggered it, when, and under what conditions.

FieldTypeDescription
turnIdstringUnique identifier for this reasoning turn
executionIdstringExecution run identifier (groups related operations)
packetIdstring, null, or absentThe ThoughtPacket (structured reasoning artifact) committed from this turn. Null or absent if the turn was aborted or its commit deferred.
worldIdstringWhich world this turn ran against
sessionIdstringConversation session identifier
timestampstringISO 8601 when the turn completed
turnDurationMsnumberWall-clock time for the turn in milliseconds
ownerUserIdstringThe user account that owns this action
actorIdstringThe actor ref: human:user_..., persona:persona_..., or agent:ext_...
actorKindstringhuman, persona, or external_agent
apiKeyIdstring or absentPresent when an external agent triggered the turn
originSystemstring or absentThe agent's self-reported system name
voiceRefstring or absentThe narrating voice the turn spoke as; API turns use the world's lore voice
hamobject or absentThe platform turn record this surface belongs to: turnId, sessionId, and, once recorded, receiptRef
runtimeobject or absentWhere the turn ran: scopeKey, contextId, sessionId, worldRef, actorRef
directiveobject or absentPresent when the turn was triggered by a structured directive

Directive block (when present):

FieldDescription
schemaVersiondirective.identity.v2
directiveIdThe directive's unique ID
intentWhat the directive asked the persona to do
anchorRefsEntity or setting refs the persona should focus on
sourceGapIdThe gap coordinate motivating this directive
targetBountyIdThe bounty being fulfilled
modeanswer (direct response), explore (open investigation), bridge (connect two things), canonize (establish facts)
creativeDirectionFreeform creative guidance

Payload-guided turns, such as those started from a card, also carry interactionMode: "payload_guided" and the instance that guided them; personality-card turns add a card object identifying the card and its session.


Text Layer

The persona's finalized prose in two parallel forms.

FieldTypeWhat It's For
annotatedstringFinalized text with inline ref tags such as [ent:starholder_main:dr_chen] or [set:…]. Build navigable, linked text from this.
cleanstringThe same text with the [ent:…] and [set:…] tags removed. Ready for display, TTS, search indexing, or text analysis.

The text that streamed during generation (content events) is provisional. annotated and clean are the turn's final word and replace it.

Mentions. Each entry in refs carries spans: the [start, end) character offsets of every place that ref is mentioned in clean. To list mentions in reading order, collect every span from every ref and sort by start. A mention's position in that sorted list is its mention index, the number media placements use as spanIndex.


Refs Layer

refs is a map keyed by canonical ref (for example ent:starholder_main:elara_mihai). It holds every ref the turn's retrieval considered, every ref the persona used, and every ref it tried to use but was refused. The prefix gives the kind: ent: an entity (a person, organization, technology), set: a setting (a place, era, institution), txt: a story, pkt: a prior ThoughtPacket.

FieldDescription
hrefAPI URL to fetch the full object. Empty for an anomaly the retrieval never found.
spans[start, end] offsets of each mention in text.clean. Empty when the ref was considered or accepted but not named in the prose.
scoreRelevance to the query, 0.0–1.0. Omitted when 0.
labelHuman-readable name. Omitted when the server has nothing better than the ref itself; humanize the ref in that case.
status"anomaly" for a refused ref; omitted otherwise
reasonPresent with status: "anomaly": not_in_traversal_outputs (the persona named something retrieval never returned) or forbidden_by_policy (a valid ref not allowed in this context)

The wire does not separate refs that were only considered from refs the persona used: both appear without status. A ref with spans was named in the prose. To follow which refs the persona accepted, and when they were validated, watch the ref_accepted events on a stream: each carries renderState render_provisional while the persona is writing and commit_validated after validation.

For builders: anomalies are a quality signal. A high rate of not_in_traversal_outputs means the persona is reaching past what the world's graph supplied.


Media Layer

Resolved imagery for every entity and setting referenced, with per-mention placement context.

Bundles

media.bundles is a map from ref to that ref's imagery. In a v2 surface each value is an object; in a v1 snapshot it can be the bare items array.

FieldDescription
authorityruntime_explicit (imagery tagged to this ref) or runtime_provisional (the best available stand-in while explicit imagery is unresolved)
replacementKey / revisionIdentify this bundle across streamed updates: a later revision with the same key replaces an earlier one
items[].mediaRefAsset reference
items[].scoreRelevance to this ref (0.0–1.0)
items[].tierQuality: 0 = exact match (tagged to this ref), 1 = contextually relevant, 2 = fallback
items[].provenancedirect (explicitly tagged), semantic (found by vector similarity), fallback (best available when nothing better exists)
items[].resolveHrefURL to fetch the image file: /api/media/resolve/{mediaRef}

Placements

media.placements maps specific mentions to specific images. If Dr. Chen is mentioned three times in different contexts, each mention gets its own best-match image based on the surrounding sentence.

FieldDescription
refThe entity or setting
spanIndexWhich mention in the text: the mention index described under Text Layer
mentionKeyThe same position as a key, mention:<spanIndex>
phraseThe surrounding sentence that influenced image selection
rolecontext_anchor (eligible to lead the turn's imagery; the earliest admitted one does) or mention_support (illustrates its mention only)
primaryMediaRefBest image for this mention in this context; primary carries its full item when present
scoreHow well the image matches this specific mention context
alternatesOther candidate images with scores
authority, replacementKey, revisionAs for bundles; placements are always runtime_provisional

Outcomes

media.outcomes, when present, records how the media search ended for each ref:

outcomeMeaning
resolvedExplicit imagery was found; finalMediaRef is the chosen image
provisional_onlyOnly a stand-in was found; finalMediaRef is the stand-in
no_mediaThe ref legitimately has no imagery
failedThe search did not complete; reasonCode says why (inventory_miss, resolver_miss, exposure_omission, or incomplete)

Context Layer

The richest layer for immersive applications. Contains atmospheric signals, environment-matching text, music, and semantic scene profiling. This layer has several independent components that serve different purposes.

Environment Matching

Used by renderers to select visual environments, color palettes, and mood.

FieldDescription
contextTextEmbedding-ready text for environment matching: the turn's output, the accepted entity names, and the user's message. Populated even when no settings are involved.
priorityRefKeysUp to 10 accepted entity labels in relevance order, used to boost media scores. Despite the name, these are labels, not refs.
semanticInputConcepts / semanticOutputConceptsOptional phrase evidence from the user's message and from the persona's output, each { text, phraseType }

Structured Atmosphere

Sensory signals extracted from the dominant setting — the most relevant setting the persona referenced during reasoning. These are parsed from structured descriptors stored on each setting record. atmosphere is null when no setting supplied them; otherwise each field is an array of descriptive strings.

FieldDescription
atmosphere.soundAmbient sounds (e.g., "the gentle hum of electronic equipment and the distant pulse of neon lights")
atmosphere.smellScent descriptions (e.g., "a faint metallic tang, reminiscent of advanced technology")
atmosphere.temperatureClimate signals (e.g., "cool, with a subtle chill from the glass walls")
atmosphere.lightLighting conditions (e.g., "soft, ambient glow from the console, casting gentle reflections")
atmosphere.tactilePhysical textures (e.g., "smooth, polished surfaces, cool to the touch")
atmosphere.horizonWhat you'd see looking out (e.g., "an unobstructed view of the city below, a lattice of light and shadow")
visualSignatureThe setting's visual identity distilled into one descriptive line, or null
essenceThe setting's emotional and thematic core in one line (e.g., "a sanctuary of digital echoes and contemplative light"), or null

When no settings are referenced in the turn, atmosphere, visualSignature, and essence are null. That is correct — there is no setting data to surface. Environment matching still works because contextText is always populated.

Canonical Setting

The dominant setting that atmosphere was extracted from, with confidence scoring. Null when there is none.

FieldDescription
canonicalSetting.refSetting ref
canonicalSetting.labelHuman-readable name
canonicalSetting.confidenceHow confident the system is that this is the right setting for this turn
canonicalSetting.scoringDetailed breakdown: retrievalScore, sceneSimilarity, lexicalAlignment, mismatchPenalty, finalScore

Semantic Scene Profile

A structured analysis of the turn's semantic content, categorized into thematic phrase buckets. Useful for advanced rendering that adapts to the semantic character of the turn. Null when no profile was built.

FieldDescription
semanticSceneProfile.phrasesByCategoryKey phrases organized by thematic category (e.g., "technology", "conflict", "nature")
semanticSceneProfile.signaturesByCategoryDetailed signatures per category with phrase, score, phraseType, sourceText, sourceSegmentId, and sentenceImportance

Derivation Mode

How the context layer was assembled — useful for debugging and quality assessment.

ValueMeaning
semanticNormal path — atmosphere extracted from semantically matched settings
setting_surface_fallbackSettings were found but semantic matching failed; fell back to surface-level extraction
lexical_emergencyLast resort — no semantic or setting match; used lexical heuristics

Music

Server-side music selection based on phrase extraction from the turn's output. musicRef is null when no track was chosen.

FieldDescription
musicRef.refAudio asset reference
musicRef.resolveHrefURL to stream or download the audio
musicRef.confidenceHow well this track matches the turn's mood (0.0–1.0)
musicRef.queryPhraseThe phrase extracted from the turn that drove the music search

Primary Subject

The dominant entity or setting for this turn — the "main character" of this particular reasoning act.

FieldDescription
primarySubjectRefCanonical ref, or null. A set: prefix means a setting; anything else is an entity.
primarySubjectLabelHuman-readable name; omitted when the server has nothing better than the ref

Selection priority: dominant setting (if any) > highest-relevance entity > null.


Topology Layer

Retrieval quality metrics. Tells you how dense or sparse the territory is, what drove the retrieval, and how much prior reasoning the persona had to build on.

FieldDescription
resultCountTotal retrieval results found
meanScoreAverage relevance score across all results
topScoreBest match relevance (0.0–1.0)
bottomScoreWeakest match in the result set
scoreStdDevScore spread — high std dev means a mix of strong and weak matches
sparsityDensity classification: dense, moderate, sparse, void
perIndex.entityResults from entity indexes
perIndex.settingResults from setting indexes
perIndex.textchunkResults from story content indexes
seedCountRetrieval seeds (starting points) used
expandedCountCandidates found through graph expansion from seeds
inferentialCountPrior ThoughtPackets found as retrievable context — this is the compounding effect. High numbers mean the persona is building on a rich foundation of prior reasoning. Low numbers mean it's mostly working from source material.
anchorsStarting points for retrieval, each { ref, source, label? }, where source is direct_canonical_name (matched by name), hot_frontier (from session momentum), or seed (from a seed signal)

For builders: Use sparsity to frame output confidence. If it's void, warn users they're in uncharted territory. If inferentialCount is high, the output is well-grounded in prior analysis. Entertainment products can narrate this: "This connection is well-documented across seventeen prior explorations" vs "We're venturing into thin territory here — the historical record is sparse."


Epistemic Layer

What the persona claims to know and how confidently it knows it.

FieldDescription
uncertainty0.0 = fully grounded in retrieved evidence, 1.0 = pure speculation
supportScoreEvidence grounding strength — how well the retrieved material supports the output
modeReasoning mode: answer (direct response), explore (open-ended), bridge (connecting entities), canonize (establishing new facts)
intentTagsDescriptive tags: factual_answer, depth_synthesis, bridge_discovery, etc.
claimPreviewsOptional candidate claims gathered while the persona was writing, each with a source and, while unsettled, a status of forming or rejected

Claims

Specific factual assertions the persona made, with the evidence backing them.

FieldDescription
textThe verbatim claim
refsEntity and setting references that support it
confidence0.0–1.0

Contradictions

When the persona's reasoning encounters conflicting information in the knowledge graph.

FieldDescription
claimA / claimBThe two conflicting claims
severityreconcilable (both can be true — different perspectives, unreliable narration, timeline evolution) or irreconcilable (logical impossibility)

For builders: Contradictions are narrative texture, not errors. A podcast frames reconcilable contradictions as "competing accounts." A documentary presents both sides. An interactive experience lets users investigate. Only irreconcilable contradictions indicate actual data quality issues.


Session Layer

Accumulated state across turns. This is what gives multi-turn conversations coherence.

FieldDescription
turnCountTurns completed in this session
activeFactKeysEntity and setting refs established as grounded knowledge in prior turns
entityMomentumWhich entities keep appearing, weighted by recency and frequency. High-momentum entities are the session's "main characters." Each entry has ref and weight.
accumulatedClaimsEvery claim across all turns, with turn number, confidence, and cited refs. Track how understanding evolved.
openThreadsUnresolved questions or topics. Each has text, status (open, partially_addressed, resolved), and introducedAtTurn.
warmSummariesCondensed per-turn summaries: turn, what the user asked (queryIntent), what the system concluded (summary), and the refs covered (coveredRefKeys).

Every other layer describes only the turn that produced the surface. session is the one layer that carries forward: it reflects the conversation's accumulated knowledge, momentum, and open threads as of this turn.


SSE Event Lifecycle

When you follow a turn on a stream, events arrive in this order. The reply text arrives as content events and the surface as surface_complete; every other event shown arrives as a pee_event, named by its envelope's event.type. On the world stream that is data.event.type; room frames nest one level deeper, at data.data.event.type. See SSE Streaming.

PhaseEventsWhat's Happening
StreamingcontentThe reply text, in delta. The current runtime sends the finished annotated text in one event.
Streamingref_accepted (renderState: render_provisional)Between generation bursts, refs the persona has touched are flushed through a side channel.
Streamingref_media_bundleImagery resolved for those refs, also flushed between generation bursts.
Validationref_accepted (renderState: commit_validated)Refs that passed post-generation validation.
Validationref_anomalyRefs that failed validation (not returned by retrieval, or forbidden by policy).
Post-generationmedia_placement_mapPer-mention image placements resolved against the final text.
Post-generationatmosphere_contextThe context layer: atmosphere, canonical setting, music, scene profile.
Committhoughtpacket_committedThe ThoughtPacket has been written to the knowledge graph. Carries epistemic data.
Commitcontradiction_detectedConflicts found during reasoning (if any).
Terminalsurface_completeThe full, authoritative Emission Surface in wire format, including the finalized text that replaces the streamed text. This is the turn's final word.

Other PEE Events

These also arrive as pee_event envelopes and give additional operational visibility:

EventDescription
budget_warningThe turn is approaching a resource limit (dimension, remaining, threshold)
engine_errorA recoverable or non-recoverable error during reasoning
turn_committedThe PEE terminal signal — ThoughtPacket written, turn complete
turn_abortedThe turn failed and no ThoughtPacket was committed
commit_deferredCommit was delayed (e.g., pending governance review)
story_materialization_readyThe system detected enough accumulated reasoning to suggest a story could be materialized from this topic
thoughtpacket:draft:completeA draft prose rendering of the ThoughtPacket was completed

World Stream Control Events

The world stream adds two events of its own: ping every 30 seconds, and timeout after about five minutes without events, just before it closes. Reconnect with Last-Event-ID or ?lastSeq=.


Quick Reference: Event to Surface Field

Each streamed event previews part of the surface that surface_complete delivers whole.

EventPreviewsHow to accumulate
contenttext.annotatedAppend delta; replace with text at surface_complete
ref_acceptedrefs[ref]Upsert by ref
ref_anomalyrefs[ref] with status: "anomaly"Upsert by ref
ref_media_bundlemedia.bundles[ref]Replace when revision is higher for the same replacementKey
media_placement_mapmedia.placementsUpsert by ref and mentionKey
atmosphere_contextcontextReplace
thoughtpacket_committedepistemicMerge
contradiction_detectedepistemic.contradictionsAppend
surface_completeThe whole surfaceReplace everything