HookContext#
- class brainstate.HookContext(operation, state_ref, timestamp=<factory>, metadata=<factory>)[source]#
Base context object passed to all hooks.
This context provides information about the hook execution environment, including the operation type, the state being operated on, timing information, and user-defined metadata.
- operation#
Type of operation (‘read’, ‘write_before’, ‘write_after’, ‘restore’, ‘init’)
- state_ref#
Weak reference to the State instance (avoids circular references)
- timestamp#
Unix timestamp when the operation occurred
- metadata#
Dictionary for user-defined metadata