Skip to content

feat(id): brand ProjectID through Drizzle and Zod schemas#16948

Merged
kitlangton merged 4 commits intodevfrom
feat/session-id-brand
Mar 11, 2026
Merged

feat(id): brand ProjectID through Drizzle and Zod schemas#16948
kitlangton merged 4 commits intodevfrom
feat/session-id-brand

Conversation

@kitlangton
Copy link
Contributor

@kitlangton kitlangton commented Mar 11, 2026

Summary

  • Introduce Effect branded ProjectID type with .make(), .global, and .zod statics
  • Flow ProjectID through Drizzle columns ($type<ProjectID>()) and Zod schemas (ProjectID.zod)
  • Replace manual Omit<...> & { projectID: ProjectID } overrides with z.infer propagation
  • Brand plain strings at boundaries (HTTP params, SDK/imported data) via ProjectID.make()

Test plan

  • bun turbo typecheck passes
  • bun test passes

Introduce Effect branded ProjectID type into Drizzle table columns
and Zod schemas so the brand flows through z.infer automatically.
Adds ProjectID.zod helper to bridge Effect brands into Zod,
eliminating manual Omit & intersect type overrides.
- Remove unnecessary WorkspaceInfoType alias import
- Use input.projectID instead of config.projectID in workspace create
- Compare against ProjectID.global instead of String coercion in test
@kitlangton kitlangton marked this pull request as ready for review March 11, 2026 01:36
@kitlangton kitlangton changed the title Brand ProjectID through Drizzle and Zod schemas feat(id): brand ProjectID through Drizzle and Zod schemas Mar 11, 2026
@kitlangton kitlangton merged commit dbc00aa into dev Mar 11, 2026
14 checks passed
@kitlangton kitlangton deleted the feat/session-id-brand branch March 11, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant