Note: hooks

The hooks package manages lifecycle event dispatch for Attune AI. It exposes five public names at the package boundary: HookConfig, HookDefinition, HookEvent, HookExecutor, and HookRegistry.

How the package is structured

Three modules divide the responsibilities:

Relationship to scripts

The scripts package contains Python callables that plug into the registry as handlers. Examples include run_evaluate_session, run_pre_compact, check_init, and suggest_compact. You pass these callables to HookRegistry.register() as the handler argument. The registry assigns each registration a string ID that unregister() accepts later.

Execution log

HookRegistry.get_execution_log() returns up to 100 entries by default. Pass event_filter to narrow results to a specific HookEvent. Call clear_execution_log() to reset it between test runs or sessions.