Spec:
specs/pf/specs/PF-98-ai-staff-headshot-generator.mdTasks:
specs/pf/tasks/PF-98-TASKS.mdContext:
specs/pf/specs/PF-98-CONTEXT.mdCreated: 2026-04-11
Updated: 2026-04-11
Purpose
Defines integration contracts for the AI Staff Headshot Generator feature: events published, storage contracts, provider API abstraction, and Edge Function inventory. PF-98 is a PF-internal feature with no cross-core consumers; integrations are limited to PF platform services (notifications, quota tracking).Dependencies
Events Published
pf_headshot_job_completed
- Publisher: PF-98 (Edge Function
pf-headshot-webhook) - Subscribers: PF-10 (user notification), PF-43 (quota decrement)
- Trigger: AI provider webhook confirms job completion
- Payload: See
EVENT_CONTRACTS.md§ PF-98
pf_headshot_campaign_completed
- Publisher: PF-98 (Edge Function
pf-headshot-webhookorpf-headshot-status-poll) - Subscribers: PF-10 (admin notification)
- Trigger: All campaign members have completed headshot generation
- Payload: See
EVENT_CONTRACTS.md§ PF-98
Storage Contract
Edge Functions
Permission Keys
Notes
- PF-98 is PF-internal; no other core consumes or publishes to it.
- Provider API keys are stored as Supabase Edge Function secrets, not in the database.
- RLS helpers must use
expires_atcheck onpf_user_role_assignments(notis_active); seePF-98-CONTEXT.md§ Area 7. - Trigger functions use
update_updated_at_column()(notpf_set_updated_at()).