Skip to content

chore(authz): adopt typed Warden relation contract from providers#99

Open
hobbescodes wants to merge 4 commits into
masterfrom
chore/typed-authz-relations
Open

chore(authz): adopt typed Warden relation contract from providers#99
hobbescodes wants to merge 4 commits into
masterfrom
chore/typed-authz-relations

Conversation

@hobbescodes

@hobbescodes hobbescodes commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Description

Task link: N/A

Two changes:

1. Adopt the typed Warden relation contract from @omnidotdev/providers. The lib/authz checkPermission wrapper is now generic over the resource type, so permission is constrained to the relations Warden defines for that type. All existing call sites already use valid relations, so this adds type safety with no behavior change.

2. Fix a pre-existing migration gap (unrelated to the authz change). Migration 0015 creates pgvector columns (signal_cluster.centroid, the post/signal embeddings) but no migration enabled the pgvector extension, so a fresh bun db:migrate failed with type "vector" does not exist. Prepend CREATE EXTENSION IF NOT EXISTS vector; to 0015 so a fresh migrate works without a separate db:setup step. Mirrors the same change already on feature/agentic-workflows.

Important

Depends on omnidotdev/providers#6. The @omnidotdev/providers pin points at the feature-branch commit 1d1c21d; re-pin it to the merge commit once omnidotdev/providers#6 merges, before merging this.

Test Steps

  1. bunx tsc --noEmit clean, bunx biome check clean, bunx knip clean.
  2. bun db:migrate on a fresh DB -> migrations apply and "Schema generated successfully".

Make the lib/authz checkPermission wrapper generic over the resource type so
permission is constrained to the relations Warden defines for it, matching the
new @omnidotdev/providers signature. All existing call sites already use valid
relations, so this adds type safety with no behavior change. Bumps providers to
the build that ships the contract.
Migration 0015 creates vector columns (signal_cluster.centroid, the post and
signal embeddings) but no migration enabled the pgvector extension, so a fresh
bun db:migrate failed with "type vector does not exist". Prepend
CREATE EXTENSION IF NOT EXISTS vector to 0015 so a fresh migrate works without a
separate db:setup step. Mirrors the same change already on
feature/agentic-workflows.
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