Problem
"Necessary" and "exempt" currently behave identically in the consent engine — both short-circuit isAllowed() to true. But they serve different purposes and should have different dispatch behavior.
"Exempt" destinations (error monitoring, observability) are operational — they need events immediately, not after a 2s buffer timer or consent queue drain. Current behavior adds unnecessary latency for Sentry errors and first-party analytics.
Proposed Behavioral Divergence
| Aspect |
necessary |
exempt |
| Consent UI |
Visible |
Hidden |
| Consent queue |
Participates |
Bypasses |
| Event buffer |
Participates |
Bypasses — dispatch immediately |
sentTo tracking |
Included |
Excluded (always receives, even on replay) |
Implementation
In collector.ts, when track() is called:
- Before buffering, check if any destinations are exempt
- Dispatch to exempt destinations immediately (skip buffer)
- Buffer the event for consent-gated destinations as normal
This means exempt destinations get events with near-zero latency while consent-gated destinations still respect the queue and buffer.
Edge cases
- Exempt destinations still go through
transform() and send() — no shortcutting the destination interface
- Events dispatched to exempt destinations should still emit
destination:send for debug panel visibility
sentTo should NOT include exempt destinations, so they also receive the event on consent queue replay (they're observability sinks — seeing the event twice with different consent context is valuable)
Files
packages/core/src/collector.ts — split dispatch path in track() and dispatchToDestinations()
packages/core/src/collector.test.ts — new tests for immediate exempt dispatch
Context
See standard: agent-os/standards/core/necessary-vs-exempt.md (behavioral divergence section)
Problem
"Necessary" and "exempt" currently behave identically in the consent engine — both short-circuit
isAllowed()totrue. But they serve different purposes and should have different dispatch behavior."Exempt" destinations (error monitoring, observability) are operational — they need events immediately, not after a 2s buffer timer or consent queue drain. Current behavior adds unnecessary latency for Sentry errors and first-party analytics.
Proposed Behavioral Divergence
sentTotrackingImplementation
In
collector.ts, whentrack()is called:This means exempt destinations get events with near-zero latency while consent-gated destinations still respect the queue and buffer.
Edge cases
transform()andsend()— no shortcutting the destination interfacedestination:sendfor debug panel visibilitysentToshould NOT include exempt destinations, so they also receive the event on consent queue replay (they're observability sinks — seeing the event twice with different consent context is valuable)Files
packages/core/src/collector.ts— split dispatch path intrack()anddispatchToDestinations()packages/core/src/collector.test.ts— new tests for immediate exempt dispatchContext
See standard:
agent-os/standards/core/necessary-vs-exempt.md(behavioral divergence section)