Workstream: Integration · Part of #89
Context
All three rungs of the escalation ladder (#89) participate in a single write, and we must define one coherent ordering across them — not just rules-vs-hooks:
- Rules (CEL) — pure, in-transaction, before persistence.
- gRPC hooks —
before_* (blocking, pre-persistence) and after_* (detached, post-persistence) (crates/schema-forge-acton/src/hooks/mod.rs).
- Webhooks — outbound, fire-and-forget, dispatched on CRUD events alongside
after_change; never block the response, retry with backoff (crates/schema-forge-acton/src/webhook.rs; dispatch in routes/entities.rs).
Defining this lets us also leverage that rules fix the documented hook reentrancy/ordering/consistency caveats.
Scope
- Full write sequence: rule defaults → rule compute → rule validate →
before_* hooks → persist → { after_* hooks, webhook dispatch }.
- All rules evaluate in-transaction before persistence; specify precedence between rules and
before_* hooks (rules first — they're pure and cheap, and can short-circuit before a network round-trip).
- Pin down the post-persistence fan-out: relative ordering (if any) of
after_* hooks vs. webhook dispatch, and that both are detached so neither blocks the API response.
- Guarantee determinism for the in-transaction phase (engine-controlled ordering) and no rule reentrancy.
- Confirm a rule abort prevents persistence and suppresses the post-persistence fan-out (no webhook/
after_* fires for a rejected write).
Acceptance
- Documented, tested ordering model covering rules,
before_*/after_* hooks, and webhooks.
- Rules evaluate in-transaction ahead of
before_* hooks; a rule rejection fires no downstream hook or webhook.
Dependencies: Suggested order: after at least one capability lands (#92). Soft.
Workstream: Integration · Part of #89
Context
All three rungs of the escalation ladder (#89) participate in a single write, and we must define one coherent ordering across them — not just rules-vs-hooks:
before_*(blocking, pre-persistence) andafter_*(detached, post-persistence) (crates/schema-forge-acton/src/hooks/mod.rs).after_change; never block the response, retry with backoff (crates/schema-forge-acton/src/webhook.rs; dispatch inroutes/entities.rs).Defining this lets us also leverage that rules fix the documented hook reentrancy/ordering/consistency caveats.
Scope
before_*hooks → persist → {after_*hooks, webhook dispatch }.before_*hooks (rules first — they're pure and cheap, and can short-circuit before a network round-trip).after_*hooks vs. webhook dispatch, and that both are detached so neither blocks the API response.after_*fires for a rejected write).Acceptance
before_*/after_*hooks, and webhooks.before_*hooks; a rule rejection fires no downstream hook or webhook.Dependencies: Suggested order: after at least one capability lands (#92). Soft.