Skip to main content
Status: ✅ Complete
Spec: specs/pf/specs/PF-98-ai-staff-headshot-generator.md
Tasks: specs/pf/tasks/PF-98-TASKS.md
Context: specs/pf/specs/PF-98-CONTEXT.md
Created: 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-webhook or pf-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_at check on pf_user_role_assignments (not is_active); see PF-98-CONTEXT.md § Area 7.
  • Trigger functions use update_updated_at_column() (not pf_set_updated_at()).