Commit 6d83431
feat(security)!: ADR-0090 P1 breaking wave — position rename, profile removal, secure OWD default, principal/external spec shapes (#2697)
* feat(security)!: ADR-0090 P1 breaking wave — position rename, profile removal, secure OWD default, principal/external spec shapes
One coordinated pre-launch pass implementing ADR-0090 D1-D4 and the P1
spec shapes of D10/D11 (docs/adr/0090). No compatibility aliases.
Renames (D3): sys_role→sys_position (+assignment/binding tables and
fields), RoleSchema→PositionSchema (flat, parent removed),
ctx.roles→ctx.positions, current_user.roles→current_user.positions
(formula validators, RLS docs, CEL examples), stack roles:→positions:,
metadata kinds role/profile→position. better-auth boundary untouched
(sys_member.role, additionalOrgRoles, org_membership_level).
Profile removal (D2): isProfile deleted from PermissionSetSchema and all
fixtures; isDefault narrowed to an install-time suggestion;
appDefaultProfileName→appDefaultPermissionSetName (isDefault-only).
OWD (D1/D4/D11): enum reduced to the canonical four; custom objects with
an owner field and no sharingModel now resolve PRIVATE (fail-closed for
unrecognised stored values; system objects keep the public fall-through);
new optional externalSharingModel field (external ≤ internal, P1 shape).
Regression tests pin the objectui#2348 incident shape (unset OWD + C/R/U
grant must not read others' records).
Principal taxonomy (D10, shape only): principalKind/audience/onBehalfOf
on ExecutionContext.
Sharing recipients: 'role'→'position' expanded via sys_user_position ∪
the membership transition source; 'role_and_subordinates' removed —
'unit_and_subordinates' expands the BU subtree (ADR-0057 D5 re-homing,
replacing the walk over a parent column that never existed).
Translations patched in place per generated-file contract; conformance
matrix row updated.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012oLzaP8n7A3YKFmgaHWC8H
* fix(liveness,contract): position ledger rename + externalSharingModel classification + downstream fixture
Liveness: GOVERNED kind role→position; liveness/role.json→position.json
(flat, parent dropped); permission ledger rowLevelSecurity.positions;
object ledger gains externalSharingModel as 'authorable' with the P1
shape-only rationale and the #2696 pointer. Downstream-contract sharing
fixture moves to the position recipient.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012oLzaP8n7A3YKFmgaHWC8H
* fix(examples): showcase stack positions property, coverage kind, position identifiers
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012oLzaP8n7A3YKFmgaHWC8H
* fix(runtime,sharing,examples): app-plugin position sections, runtime recipient enum, D1 grandfather stamps — dogfood 39/39 green
- app-plugin: stack section registration positions→'position' kind (the
seeding gap: declared positions never reached the registry); standalone
artifact surface roles→positions; CLI diff/stats keys.
- sys_sharing_rule.recipient_type runtime enum role→position (seeding
inserted 'position' and was rejected by the stale enum), description
updated to the BU-subtree semantics of unit_and_subordinates.
- ADR-0090 D1 grandfather stamps: explicit `sharingModel:
'public_read_write'` on showcase/dogfood fixture objects whose isolation
is RLS-owned or intentionally public (they carry an auto-injected
owner_id, so the new unset⇒private default would owner-filter them).
- dogfood expectations updated to v2 semantics (recipient 'position';
appDefaultPermissionSetName is isDefault-only).
- service-datasource test: explicit casts for Response.json() unknowns
(latent, surfaced by the affected-package typecheck).
Full dogfood suite 39 files / 191 tests green; repo-wide typecheck clean.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012oLzaP8n7A3YKFmgaHWC8H
* fix(spec,automation,core): regenerate API-surface snapshot for the position rename; runas/authz test fixtures to v2 field names
The spec export surface intentionally changed (RoleSchema→PositionSchema,
definePosition, ShareRecipientType 'position', ExecutionContext.positions,
principal-taxonomy fields, externalSharingModel) — snapshot regenerated per
the gate's documented flow. Test fixtures updated: sys_user_position rows
use the 'position' field, sys_position_permission_set uses position_id,
automation trigger identity uses positions[].
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012oLzaP8n7A3YKFmgaHWC8H
* chore(changeset): P1 breaking wave is a MAJOR bump per the API-surface gate
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012oLzaP8n7A3YKFmgaHWC8H
* test(plugin-security): RLSCompiler fixtures to current_user.positions (v2 vocabulary)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012oLzaP8n7A3YKFmgaHWC8H
* docs(adr,design): ADR-0090 addendum — assignment-level BU anchor semantics, multi-org benchmark recalibration
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012oLzaP8n7A3YKFmgaHWC8H
* test(objectql,runtime,auth): remaining v2-vocabulary fixture updates — overlay whitelist guards, option-visibility positions, standalone surface
role/profile kinds asserted as retired (reintroduction guards per ADR-0090
D2/D3); position asserted allowOrgOverride:true. customSession projection
tests read user.positions. Standalone artifact surface tests use positions[].
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012oLzaP8n7A3YKFmgaHWC8H
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent d8b6304 commit 6d83431
195 files changed
Lines changed: 1498 additions & 1326 deletions
File tree
- .changeset
- docs
- adr
- design
- examples
- app-crm
- src/security
- app-showcase
- src
- data/objects
- external
- security
- test
- app-todo/test
- packages
- cli
- src
- commands
- utils
- test
- core
- src/security
- dogfood/test
- fixtures
- downstream-contract
- src
- test
- formula/src
- objectql
- src
- validation
- platform-objects
- src
- apps/translations
- pages
- plugins
- plugin-approvals
- src
- plugin-auth/src
- plugin-email/src
- plugin-hono-server/src
- plugin-reports/src
- plugin-security
- src
- objects
- translations
- plugin-sharing
- src
- objects
- translations
- plugin-webhooks
- rest
- src
- runtime
- src
- security
- services
- service-automation/src
- builtin
- service-datasource/src/__tests__
- service-job/src
- service-knowledge/src
- __tests__
- service-queue/src
- spec
- liveness
- scripts/liveness
- src
- contracts
- data
- identity
- kernel
- security
- system
- constants
- ui
- triggers/trigger-record-change/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
492 | 516 | | |
493 | 517 | | |
494 | 518 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
36 | 49 | | |
37 | 50 | | |
38 | 51 | | |
| |||
69 | 82 | | |
70 | 83 | | |
71 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
72 | 93 | | |
73 | 94 | | |
74 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
Lines changed: 4 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | | - | |
| 22 | + | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | | - | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
| |||
55 | 53 | | |
56 | 54 | | |
57 | 55 | | |
58 | | - | |
59 | 56 | | |
60 | 57 | | |
61 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
| 122 | + | |
124 | 123 | | |
125 | 124 | | |
126 | | - | |
| 125 | + | |
127 | 126 | | |
128 | | - | |
| 127 | + | |
129 | 128 | | |
130 | 129 | | |
131 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| |||
0 commit comments