Skip to content

Commit 91f9dfd

Browse files
improvement(governance): derived access (#5134)
* improvement(governance): org-ws-credential roles clarity * revert isHosted * improvement(credentials): code cleanup * address comments * make kb cascade delete on user hard delete * revert env flags * chore(db): drop local 0242 migration to regenerate after merging staging Our 0242 collides with staging's 0242. Remove it (and its snapshot + journal entry) so the KB-cascade migration can be regenerated with the correct number on top of the merged staging migrations. * chore(db): regenerate kb→workspace cascade migration as 0243 Regenerated via drizzle-kit generate on top of the merged staging migrations (staging took 0242). Re-applied the safety edits: NOT VALID + separate VALIDATE on the FK re-add, and the -- migration-safe note on the DROP. check:migrations passes. * improve copy * update docs
1 parent c419a34 commit 91f9dfd

193 files changed

Lines changed: 18988 additions & 1562 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/rules/sim-architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ apps/
2929
└── realtime/ # Bun Socket.IO server (collaborative canvas)
3030
3131
packages/ # @sim/* — audit, auth, db, logger, realtime-protocol,
32-
# security, tsconfig, utils, workflow-authz,
32+
# security, tsconfig, utils, platform-authz,
3333
# workflow-persistence, workflow-types
3434
```
3535

.cursor/rules/sim-architecture.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ apps/
2828
└── realtime/ # Bun Socket.IO server (collaborative canvas)
2929

3030
packages/ # @sim/* — audit, auth, db, logger, realtime-protocol,
31-
# security, tsconfig, utils, workflow-authz,
31+
# security, tsconfig, utils, platform-authz,
3232
# workflow-persistence, workflow-types
3333
```
3434

.cursor/rules/sim-testing.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ These modules are mocked globally — do NOT re-mock them in test files unless y
2222
- `@/stores/console/store`, `@/stores/terminal`, `@/stores/execution/store`
2323
- `@/blocks/registry`
2424
- `@trigger.dev/sdk`
25-
- `@sim/workflow-authz` → `workflowAuthzMock`
25+
- `@sim/platform-authz/workflow` → `workflowAuthzMock`
2626

2727
## Structure
2828

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Thank you for your interest in contributing to Sim! Our goal is to provide devel
88
> - `apps/sim/` — the main Next.js application (App Router, ReactFlow, Zustand, Shadcn, Tailwind CSS).
99
> - `apps/realtime/` — a small Bun + Socket.IO server that powers the collaborative canvas. Shares DB and Better Auth secrets with `apps/sim` via `@sim/*` packages.
1010
> - `apps/docs/` — Fumadocs-based documentation site.
11-
> - `packages/` — shared workspace packages (`@sim/db`, `@sim/auth`, `@sim/audit`, `@sim/workflow-types`, `@sim/workflow-persistence`, `@sim/workflow-authz`, `@sim/realtime-protocol`, `@sim/security`, `@sim/logger`, `@sim/utils`, `@sim/testing`, `@sim/tsconfig`).
11+
> - `packages/` — shared workspace packages (`@sim/db`, `@sim/auth`, `@sim/audit`, `@sim/workflow-types`, `@sim/workflow-persistence`, `@sim/platform-authz`, `@sim/realtime-protocol`, `@sim/security`, `@sim/logger`, `@sim/utils`, `@sim/testing`, `@sim/tsconfig`).
1212
>
1313
> Strict one-way dependency flow: `apps/* → packages/*`. Packages never import from apps. Please ensure your contributions follow this and our best practices for clarity, maintainability, and consistency.
1414

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ packages/
5151
├── auth/ # @sim/auth — shared Better Auth verifier
5252
├── db/ # @sim/db — drizzle schema + client
5353
├── logger/ # @sim/logger
54+
├── platform-authz/ # @sim/platform-authz — workspace + workflow authz (subpath exports)
5455
├── realtime-protocol/ # @sim/realtime-protocol — socket op constants + zod schemas
5556
├── security/ # @sim/security — safeCompare
5657
├── tsconfig/ # shared tsconfig presets
5758
├── utils/ # @sim/utils
58-
├── workflow-authz/ # @sim/workflow-authz
5959
├── workflow-persistence/ # @sim/workflow-persistence
6060
└── workflow-types/ # @sim/workflow-types — pure BlockState/Loop/Parallel types
6161
```
@@ -409,7 +409,7 @@ Use Vitest. Test files: `feature.ts` → `feature.test.ts`. See `.cursor/rules/s
409409

410410
### Global Mocks (vitest.setup.ts)
411411

412-
`@sim/db`, `@sim/db/schema`, `drizzle-orm`, `@sim/logger`, `@sim/workflow-authz`, `@/blocks/registry`, `@/lib/auth`, `@/lib/auth/hybrid`, `@/lib/core/utils/request`, `@trigger.dev/sdk`, and store mocks are provided globally. Do NOT re-mock them unless overriding behavior. (The `vi.mock('@/lib/auth', ...)` in the example below is an override of the global mock so `getSession` can be controlled per-test.)
412+
`@sim/db`, `@sim/db/schema`, `drizzle-orm`, `@sim/logger`, `@sim/platform-authz/workflow`, `@/blocks/registry`, `@/lib/auth`, `@/lib/auth/hybrid`, `@/lib/core/utils/request`, `@trigger.dev/sdk`, and store mocks are provided globally. Do NOT re-mock them unless overriding behavior. (The `vi.mock('@/lib/auth', ...)` in the example below is an override of the global mock so `getSession` can be controlled per-test.)
413413

414414
### Standard Test Pattern
415415

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ packages/
5151
├── auth/ # @sim/auth — shared Better Auth verifier
5252
├── db/ # @sim/db — drizzle schema + client
5353
├── logger/ # @sim/logger
54+
├── platform-authz/ # @sim/platform-authz — workspace + workflow authz (subpath exports)
5455
├── realtime-protocol/ # @sim/realtime-protocol — socket op constants + zod schemas
5556
├── security/ # @sim/security — safeCompare
5657
├── tsconfig/ # shared tsconfig presets
5758
├── utils/ # @sim/utils
58-
├── workflow-authz/ # @sim/workflow-authz
5959
├── workflow-persistence/ # @sim/workflow-persistence
6060
└── workflow-types/ # @sim/workflow-types — pure BlockState/Loop/Parallel types
6161
```
@@ -409,7 +409,7 @@ Use Vitest. Test files: `feature.ts` → `feature.test.ts`. See `.cursor/rules/s
409409

410410
### Global Mocks (vitest.setup.ts)
411411

412-
`@sim/db`, `@sim/db/schema`, `drizzle-orm`, `@sim/logger`, `@sim/workflow-authz`, `@/blocks/registry`, `@/lib/auth`, `@/lib/auth/hybrid`, `@/lib/core/utils/request`, `@trigger.dev/sdk`, and store mocks are provided globally. Do NOT re-mock them unless overriding behavior. (The `vi.mock('@/lib/auth', ...)` in the example below is an override of the global mock so `getSession` can be controlled per-test.)
412+
`@sim/db`, `@sim/db/schema`, `drizzle-orm`, `@sim/logger`, `@sim/platform-authz/workflow`, `@/blocks/registry`, `@/lib/auth`, `@/lib/auth/hybrid`, `@/lib/core/utils/request`, `@trigger.dev/sdk`, and store mocks are provided globally. Do NOT re-mock them unless overriding behavior. (The `vi.mock('@/lib/auth', ...)` in the example below is an override of the global mock so `getSession` can be controlled per-test.)
413413

414414
### Standard Test Pattern
415415

0 commit comments

Comments
 (0)