Skip to content

v0.7.0

@hudhaifas hudhaifas tagged this 05 Jun 11:15
Add a uniform hook system so consumers (Django projects depending on
django-agentic) can attach behavior at six lifecycle moments without
forking the package or relying on signals.

Hooks resolve a dotted-path setting to a callable, cached per setting
value with override_settings support and one-shot logging on bad config:

  AGENTIC_USAGELOG_PRE_CREATE   - mutate fields before AIUsageLog write
  AGENTIC_USAGELOG_POST_CREATE  - sidecar tables, audit, event emission
  AGENTIC_PROFILE_POST_CREATE   - signup grants, welcome flows
  AGENTIC_CREDITS_POST_DEDUCT   - bookkeeping, third-party metering
  AGENTIC_CREDITS_REFILLED      - notifications, audit
  AGENTIC_CREDIT_LIMIT_EXCEEDED - funnel analytics, upgrade offers

Hooks fire synchronously, in-process, inside the surrounding transaction
where one exists. Hook failures roll back the package's own write —
consumers wanting isolation handle their own try/except. This is the
explicit-call pattern Django docs recommend over post_save signals.

See HOOKS.md for the trade-off matrix and per-hook docs.
Assets 2
Loading