Skip to content

Phase 2+3: Auth, Workspace, Projects & Work Items - #5

Merged
LaPaGaYo merged 5 commits into
mainfrom
codex/run-2026-04-17T00-21-05-864Z
Apr 19, 2026
Merged

LaPaGaYo merged 5 commits into
mainfrom
codex/run-2026-04-17T00-21-05-864Z

Conversation

@LaPaGaYo

Copy link
Copy Markdown
Owner

Summary

  • Phase 2: Auth & Workspace - Clerk authentication, workspace CRUD with slug routing, invitation system, RBAC (Owner/Admin/Member/Viewer), atomic owner safeguards with FOR UPDATE locks, Svix webhook verification
  • Phase 3: Projects & Work Items - Workspace-scoped projects, hierarchical work items (epic/task/subtask), human-readable IDs (PROJ-42), per-project workflow states, assignees, append-only activity log, safe migration with backfill

What's included

  • 5 service layers: projects, work items, workflow states, activity log, work management
  • 12 API route files under /api/workspaces/[slug]/
  • 3 UI pages: project list, project detail, workspace dashboard
  • 26 contract tests against real Drizzle/Postgres (no in-memory mocks)
  • 2 Drizzle migrations with safe backfill for existing data
  • WorkspaceError consolidated into single source of truth

Test plan

  • npm run build passes
  • npm run lint passes
  • npm run test passes (26/26 contract tests)
  • Migration runs safely on existing data
  • Cross-tenant isolation verified
  • RBAC enforcement verified
  • Atomic ID generation verified under concurrent access
  • Manual QA: create project, create work items, verify UI

🤖 Generated with Claude Code

Henry Wen and others added 5 commits April 19, 2026 01:21
Phase 2 (Auth & Workspace):
- Clerk authentication with Svix webhook verification
- Workspace CRUD with slug-based routing
- Invitation system with email-based invites
- RBAC (Owner/Admin/Member/Viewer) with atomic owner safeguards
- FOR UPDATE row locks prevent concurrent owner demotion race conditions

Phase 3 (Projects & Work Items):
- Workspace-scoped projects with key-based identifiers
- Hierarchical work items (epic > task > subtask, max depth 3)
- Human-readable IDs (PROJ-42) via atomic counter with FOR UPDATE lock
- Per-project workflow states (Backlog, Todo, In Progress, Done)
- Work item assignment to workspace members
- Append-only activity log with transactional writes
- RBAC enforcement on all CRUD operations
- Safe migration with backfill for existing project rows
- 26 contract tests against real Drizzle/Postgres
- Basic UI: project list, detail, create dialogs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CI typecheck fails because packages/shared and packages/db are typechecked
independently with their own tsconfig.json. While the base tsconfig has
allowImportingTsExtensions, the package-level tsc invocation rejects .ts
extensions. Revert to extensionless imports which work with bundler
module resolution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CI typecheck rejects .ts extension imports across all packages. The base
tsconfig has allowImportingTsExtensions but CI's turbo typecheck runs each
package independently. Use extensionless imports which work with bundler
module resolution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contract tests import .ts server files which Node can't resolve natively.
Add tsx as devDependency and use --import tsx in the test:contracts script
so CI can run Phase 2 and Phase 3 contract tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contract tests for Phase 2 and Phase 3 need a real Postgres database.
Add a Postgres 16 service container on port 5433 and run db:migrate
before tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@LaPaGaYo
LaPaGaYo merged commit 5229d5f into main Apr 19, 2026
1 check passed
@LaPaGaYo
LaPaGaYo deleted the codex/run-2026-04-17T00-21-05-864Z branch April 19, 2026 08:23
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