What problem does it solve?
Distributed traces in the DXOS codebase break when intermediate methods fail to forward the ctx: Context parameter, causing @trace.span() decorators to create orphaned root spans disconnected from the trace hierarchy. This Skill provides the rules for threading context through call chains so traces stay connected.
Core Features & Use Cases
- Propagation Rules: Defines when and how to pass
ctx: Context as the first parameter across direct calls, callbacks, detached async work, and parallel fan-out.
- Boundary Guidance: Specifies correct context sources for public APIs (
Context.default()), RPC service methods (options.ctx), and lifecycle-scoped work (this._ctx).
- Audit Reference: Includes a compliance audit of context propagation across networking, space lifecycle, and resource open/close paths with prioritized fixes.
- Use Case: When adding a
@trace.span() to an internal method or reviewing a PR that touches Context, use this Skill to verify the full call chain forwards ctx and no orphaned spans are introduced.
Quick Start
Review my changes to DataSpaceManager and check whether ctx is propagated correctly through every method that reaches a @trace.span() decorated call.