MWMS Supabase Event Schema

Document Type: Specification
Status: Active
Version: v1.1
Authority: Affiliate Brain (Audience Infrastructure Layer)
Applies To: Audience event logging, state derivation, attribution tagging, and audience-infrastructure schema discipline
Parent: Content-to-Audience Flow Map
Linked Canon: Content-to-Audience Flow Map
Last Reviewed: 2026-03-15

Purpose

Supabase Event Schema defines the structural event-logging model required to power the Audience Engine.

It standardises:

• engagement tracking
• state progression triggers
• attribution tagging
• audit traceability
• future automation compatibility

No event may exist outside schema definition.

Scope

This specification applies to:

• audience_events schema structure
• audience_state schema structure
• approved event categories and event types
• state derivation rules
• integrity requirements for audience-event capture
• audience-infrastructure drift protection

This document governs how audience events must be structured and interpreted inside the Audience Engine.

It does not govern:

• manual audience-state assignment
• capital decisions
• campaign approval
• direct behavioural scoring outside declared schema rules
• automation activation by itself
• canon changes to event taxonomy without formal update

Those remain governed by Affiliate Brain architecture, relevant canon pages, and future approved automation layers.

Definition / Rules

Primary Table: audience_events

Required Fields:

• id (uuid, primary key)
• created_at (timestamp with timezone)
• user_id (uuid, nullable)
• session_id (text)
• event_type (text)
• event_category (text)
• event_source (text)
• utm_source (text, nullable)
• utm_medium (text, nullable)
• utm_campaign (text, nullable)
• utm_content (text, nullable)
• utm_term (text, nullable)
• metadata (jsonb)

Event Category Types

Approved categories:

• engagement
• subscription
• advocacy
• retention
• attribution
• system

No custom categories permitted without Canon update.

Approved Event Types

engagement:

• content_view
• scroll_depth_75
• video_completion_75
• multi_internal_click
• long_form_completion
• repeat_session_30d
• high_frequency_session

subscription:

• email_subscribe
• asset_download

advocacy:

• content_share
• referral_click
• comment_repeat
• mention_tag
• advocacy_repeat

retention:

• downgrade_state
• inactivity_threshold

attribution:

• utm_recorded
• session_start

system:

• event_validation_pass
• event_validation_fail

State Derivation Logic

Audience state must be derived via query logic.

No manual assignment permitted.

State progression must be based on:

• event frequency
• time window
• cross-event validation

The logic layer must exist separate from the raw event table.

Secondary Table: audience_state

Required Fields:

• user_id (uuid, primary key)
• current_state (text)
• state_updated_at (timestamp)
• engagement_score (numeric)
• last_event_type (text)

This table is derived, not manually edited.

Integrity Requirements

All events must:

• include created_at
• include event_type
• include event_category
• include source context
• validate against approved types

Unrecognised event_type must be rejected.

ANIL Integration (Future)

Aggregated audience growth velocity may later feed:

• Authority Validation Score
• Narrative Momentum Analysis

No automatic influence permitted without Canon update.

Activation Status

Schema defined.

Database creation pending.

Automation inactive.

Drift Protection

The system must block:

• manual state edits
• event injection without schema compliance
• duplicate event spamming
• vanity metric insertion
• direct capital linkage

Audience schema must remain informational.

Architectural Intent

Supabase Event Schema exists to give the Audience Engine a controlled event foundation that is structurally clean, attributable, and future-compatible.

Its role is to ensure that raw behavioural events remain standardised, that audience-state logic is derived rather than improvised, and that future automation can build on a disciplined event model rather than noisy or inconsistent tracking.

Final Rule

If an audience event is not schema-compliant, it is not valid Audience Engine data.

Structure comes before automation.

Change Log

Version: v1.1
Date: 2026-03-15
Author: MWMS HeadOffice / Affiliate Brain
Change: Rebuilt page to align with the locked MWMS document standard for this cleanup pass. Preserved the original audience_events and audience_state structures, approved event categories and event types, state derivation rules, integrity requirements, ANIL future note, activation status, and drift-protection logic. Added Document Type, Applies To, Purpose / Scope / Definition / Rules structure, Architectural Intent, Final Rule, and updated review metadata.

Version: v1.0
Date: 2026-02-25
Author: Affiliate Brain
Change: Initial creation of Supabase Event Schema defining the structural event-logging model for the Audience Engine.

END – SUPABASE EVENT SCHEMA v1.1