Skip to content

fix: v1 contract conformance — validation, scopes, idempotency, media enum, RLS#25

Merged
sebfried merged 1 commit into
mainfrom
fix/v1-finish-open-tasks
May 28, 2026
Merged

fix: v1 contract conformance — validation, scopes, idempotency, media enum, RLS#25
sebfried merged 1 commit into
mainfrom
fix/v1-finish-open-tasks

Conversation

@sebfried

Copy link
Copy Markdown
Contributor

Council + Codex round 2. Finishes the remaining v1 findings. Backend is deno check + pnpm build green.

Changed

⚠️ Before deploy (the verification gate)

The migration 20260529000000_v1_contract_conformance.sql is not applied. Run:

supabase start && supabase db reset       # apply + verify locally
deno check supabase/functions/**/index.ts # (already green)
supabase db push && supabase functions deploy

Merging only deploys the frontend; the backend stays dormant until db push.

🤖 Generated with Claude Code

… enum, RLS

Council + Codex round 2: finish remaining v1 findings (#4-#7, #9, #12).
Backend is deno-check + pnpm build green. The migration is NOT applied —
run `supabase start && supabase db reset` to verify, then `supabase db push`.

- #5 metadata validation: new _shared/frame-metadata.ts validates both ingress
  endpoints against ui.plan.ai/frame-metadata.v1 before insert. Removes the
  silent date coercion and the flat agent_slug/channel_slug reads (schema is
  nested agent.slug/channel.slug). Adds the missing idempotency_conflict code.
- #4 scopes: media:image gates frame-submissions, media:video gates
  media-uploads (hasApiScope). Migration grandfathers existing keys.
- #6 idempotency: scoped per endpoint (idempotency_scope column + unique
  (api_key_id, idempotency_scope, idempotency_key)); PNG fingerprint now
  includes the image bytes (sha256BytesHex).
- #7 media status: frame_media.status is the frame_media_status enum; functions
  write media_processing (not processing); spec/docs aligned.
- #9 RLS: revoke client UPDATE on frame_submissions/frames (no client write
  path; transitions go through service-role Edge Functions).
- #12 OpenAPI + schema + narrative docs: media-uploads creates the submission;
  frame-submissions is image-only; removed media_upload_id.
- Fix a latent images.ts type error caught by deno check.
- skills: supabase-setup (ingress invariants), workbench-app (no client UPDATE).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sebfried sebfried merged commit c9a9911 into main May 28, 2026
1 check was pending
@sebfried sebfried deleted the fix/v1-finish-open-tasks branch May 28, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant