Scopes

A scope carries the identity, permissions, visible services and current position for an operation. When a user asks for elevation, the scope identifies the twin, subject, observer and Runtime for that request.

Scope Owner and lifetime Typical operation
ServiceScope A running service process. It carries the service's own identity, availability and connections. Report status or coordinate with another service during startup.
UserScope An authenticated or anonymous user as represented by a client or service. It exposes the service catalog visible to that user. List accessible projects or twins and obtain a user session on a chosen Runtime.
SessionScope A user's session hosted by a Runtime. The normal client maintains a user session for each selected Runtime. Create a context for a new digital twin.
ContextScope A user's handle into a particular twin. Derived views can carry an observer, observation focus, relationship endpoints, transaction or resolution constraints. Submit a quality for a selected subject or inspect an observation in that twin.

Follow a request across services

Authentication establishes the user scope. The client locates a Runtime and obtains or reopens the context. Selecting a watershed in Modeler corresponds to focusing that context on the subject. In Java, twin.within(subject) gives the focused view. A separate observer can be selected in the same twin. Opening a second twin creates a different context identity.

A receiving service looks up or reconstructs its local peer for the same workflow. The reference client propagates the caller's authorization, the compact scope token in klab-scope and the hosting Runtime ID in klab-service for session or context operations. Additional focus or transaction information travels with the call when needed. Use the client scope from the original operation when polling a job or querying an observation. A twin ID on its own is insufficient to identify an authorized operation.

Diagnose the wrong scope

If a project is visible but a quality request cannot start, confirm the focal twin, selected subject and observer. If a call worked before a restart and the context is now unavailable, reconnect using the saved configuration on the original Runtime and reselect the subject. If a colleague sees a different list of twins, compare identity, visible services and access rights.

Treat releasing a client context as a Runtime lifecycle operation. A Modeler tab, a Java handle and the stored study have different lifetimes. Choose a twin persistence policy for work that must outlast the session. Twin access and lifetime ยท Java scope lifecycle

The stack's scope guide traces session creation, transport and release through the client and hosting services. Scope lifecycle and transport