Context
Purpose
A Context provides supplemental information that may influence how a Call is interpreted or processed.
Contexts are attached to Calls by Contracts.
The Canonical Data Model defines the structure of a Context but does not define the available Context types.
---
Structure
A Context consists of:
type- Identifies the kind of context.content- Contains the data associated with that context.
The interpretation of content is determined by type.
---
Characteristics
- Contexts are typed.
- Contexts are independent.
- Contexts may contain any valid data.
- A Call may contain zero or more Contexts.
---
Recognized detail: Object navigation on a Runtime Call
When a Runtime Call results from an interaction inside an Object opened on Carry (see
layout.md, Object navigation), it carries:
- context.runtime_state.origin_object — the id of the container Object the interaction
occurred in.
The Runtime supplies this id verbatim from the presentation context the interaction came from
(the panel, scene node, or element the Object was rendered into). It does not derive the id by
walking its own view tree, and it does not decide, from the Object's type or role, whether to
send the id or omit it — that decision is World's.
World resolves what origin_object means against the current snapshot: for an ordinary Object
open on Carry it routes the result into that Object in place, pushing the Object's previous
navigation state onto its history; for a Dashboard, or for an id that names no Object open on
Carry, it ignores the in-place route and composes the result normally. Following a link within
an Object never opens another Object on Carry. The World operation world.back uses
context.runtime_state.origin_object to pop that Object's navigation history.
Recognized detail: focus on a World Dataset
Every World Dataset carries context.focus.object_id — the id of the one Object World
considers focused for that response, or "" for none. World sets it; a Runtime reads it to
decide which Object to highlight and never picks a focused Object on its own. To focus a
Finding that carries no open Action, a Runtime submits the World operation world.focus with
the Finding's Object id in context.runtime_state.origin_object; World opens that Object on
Carry from the current snapshot, without a Service call.
Recognized detail: region focus
Alongside title, depth, history, members, and subject, a context.objects entry
(Object navigation on a Runtime Call, above) carries region — the semantic region
(html.md, Semantic regions) currently focused within that container's content, or "" for
its region list. World sets it; a Runtime reads it and never tracks a region focus itself.
A Runtime focuses a region by submitting the World operation world.focus_region with
context.runtime_state.origin_object naming the container and content.region naming the
region. World performs this with no Service call — the region's content already exists in the
composed Dataset — but it is still a World state change: the container's currently-focused
region is pushed onto the exact same per-Object history a document swap pushes onto
(Composer::focusRegion), so world.back pops a region focus and a document navigation
indifferently, one flat history regardless of which kind of step it was. A freshly opened or
freshly navigated-to document always starts with region empty, whether the open came from a
Finding, a Dashboard entry, or following a link.
Recognized detail: alt focus
Alt focus (see layout.md, Focus and alt focus) opens a result in a new Object instead of
routing it into the Object the interaction came from. For a link, a Runtime performs this by
omitting context.runtime_state.origin_object from the Call that would otherwise carry it:
World's existing rule for an absent or unresolvable origin_object already composes the result
as a fresh open rather than an in-place navigation (Object navigation on a Runtime Call, above).
No separate World operation exists for alt-focusing a link — omitting origin_object is
sufficient.
This does not yet cover alt-focusing content an Object already holds without a link to follow
(for example, a document region, html.md Region navigation): opening a second Object for
content that requires no new Call — world.focus no-ops when the target is already
carry-placed — is not yet defined and needs its own World mechanism before alt focus on a
region can be built.
Recognized detail: Thread continuity
A Call that continues an existing Thread (thread.md) carries context.thread_id. A Runtime
supplies it verbatim from the Thread it last received; omitting it starts a new Thread. World
resolves or creates the Thread named by context.thread_id, appends the Call's own input as
that Thread's new Turn, and, when it calls Conductor, includes a bounded window of the
Thread's recent Turns as context.thread_history — this is how a follow-up ("slices nearby")
is resolved together with what the Thread already knows, rather than as an isolated request.
World returns context.thread_id on its response so the Runtime can carry it forward
unchanged; a Runtime never generates, inspects, or decides between Thread ids itself.