nvalchemi.hooks.Hook#

class nvalchemi.hooks.Hook(*args, **kwargs)[source]#

Protocol for hooks that observe or modify workflow state.

frequency#

How often the hook runs (every N steps).

Type:

int

stage#

The stage enum value at which this hook runs, or None for hooks that are stage-agnostic until registered with a specific engine.

Type:

Enum | None

on_register#

Optional lifecycle method called once by the registry after the hook passes stage/frequency validation and before it is stored. Hooks that mutate workflow topology or configuration should document their ordering assumptions because registration order is user-owned.

Type:

Callable[[object], None], optional