context property

Context get context

The operational Context defining the forensic identity, administrative authority, and causal lineage of this specific Cell handle.

The context is a foundational architectural element that represents the "Identity" or "Provenance" under which the cell performs its logic. It acts as the primary metadata anchor for the testRule, providing the necessary evidence to verify if an incoming Pulse possesses the required authority to trigger a state transition.

Architectural Significance: The Forensic Anchor

In a multi-package or monorepo environment, the context ensures Causal Integrity. It prevents unauthorized "cross-talk" between different layers of the application (e.g., a UI component attempting to trigger a low-level system-tier mutation) by validating the lineage of every stimulus.

When to use

  • Integrity Rules: Within a TestCell gate to verify if the acting authority matches the expected tier for a specific command.
  • Forensic Auditing: When logging state changes to identify which subsystem or authority triggered the mutation.
  • Deputy Evolution: To use as a parent reference when calling Context.evolve to create a more specialized or restricted scope.

How it works

The context employs a Tiered Resolution Strategy to determine the handle's identity:

  1. Local Override: It first checks for a context defined explicitly in this nucleus's local segment.
  2. Prototype Inheritance: If not found locally, it walks up the principal chain to inherit a context from its prototype.
  3. Causal Binding: If the resolved context is the default Context.system and the node is binded to an upstream source, it adopts the context of the bound cell.
  4. Global Default: If no context is found in the lineage or bindings, it defaults to Context.system.

Non‑obvious

  • Immutability: The context is established during the Reciprocal Handshake at the node's synthesis and cannot be changed.
  • Deputy Restrictions: While a principal cell and its deputies share the same internal state, they each possess a unique context, allowing for authority attenuation (e.g., a "Guest" deputy of a "System" cell).
  • Trace Stamping: Every Pulse emitted by this cell is stamped with this context in the forensic Pulse.trace.

Returns:

The Context instance representing the forensic anchor and authority tier of this node.

Implementation

Context get context;