Status: 📝 PlannedDocumentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Spec:
specs/pf/specs/PF-89-api-versioning-edge-function-lifecycle.mdPlan:
specs/pf/plans/PF-89-api-versioning-edge-function-lifecycle-PLAN.mdLast updated: 2026-03-24
Purpose
Document how Edge Functions expose application-level API versions (header negotiation), how contracts are stored and validated in CI, and how deprecation signals integrate with observability (PF-48) and system health UI (PF-36).Scope
- In scope:
X-API-Version,withVersioningmiddleware pattern,supabase/functions/_shared/contracts/, deprecation headers (Deprecation,Sunset,Link), CI contract-diff behavior. - Out of scope: Supabase infrastructure path
/functions/v1/(platform-managed); GraphQL; auto-generated OpenAPI in Phase 1–4 (spec deferred).
Related platform documents
| Document | Relationship |
|---|---|
| API_CONTRACTS.md | REST path versioning narrative; must stay consistent with Edge header versioning once implemented |
| CROSS_CORE_INTEGRATIONS.md | All cores consume Edge Functions — versioning affects integration testing and rollout |
| EVENT_CONTRACTS.md | PF-48 may consume deprecated-usage events — payloads must be identifier-only (no PHI) |
Consumer obligations (all cores)
- For new or migrated versioned functions: send
X-API-Versionor accept documented default (latest stable). - Handle 400 responses with migration guidance when version unsupported.
- Respect Sunset by migrating before removal date; monitor PF-36 / Sentry warnings when enabled.
Auth and tenant isolation
- Version negotiation is orthogonal to JWT and
verifyOrgAccess()/verifyOrgRole()— no tenant data in version headers. - Contract files are server-side only; never expose raw internal types to clients.
Checklist (implementation)
- Pilot functions wrapped with
withVersioning(opt-in). -
docs/development/api-versioning-guide.mdpublished. -
API_CONTRACTS.mdupdated to cross-reference Edge header versioning. - GitHub Actions contract validation runs on PRs touching
*.contract.tsor pilot functions.