Skip to content

Commit 3716360

Browse files
committed
test: pin sys_user's one default on every user-context producer, and the baseline unchanged on the real declarations
- service-automation: a booted stack with no baseline and one authored '*' read set reads sys_user under its declared default on a request, a runAs:'user' flow run and a runAs:'user' hook fired from a hand-built system context: its own row plus the acting organisation's members, and exactly the rows the two shipped literals admit on that same context. On the same composition, plugin-auth's sys_sso_provider extension (the one shipped extend of a platform object) still registers, and an extend that sets defaultRowScope is refused by name. - plugin-security: with the shipped baseline, every persona (member, viewer, organization admin, a user in no organisation, the platform admin, and an MCP agent for each of three delegators) reads all 23 declarers exactly as without the declarations; the census names where a default is now collected: on the agent ceilings' legs only. - The declarations' comments now say the collection applies the key. Claude-Session: https://claude.ai/code/session_01FatVyDAFEST48jZDQcbheU Co-authored-by: Claude <noreply@anthropic.com>
1 parent 48b1eb0 commit 3716360

25 files changed

Lines changed: 781 additions & 189 deletions

‎packages/platform-objects/src/identity/sys-account.object.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ export const SysAccount = ObjectSchema.create({
114114
},
115115
},
116116

117-
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one
118-
// policy plugin-security's shipped permission sets spread for it today
119-
// (the `_self` carve-outs in `default-permission-sets.ts`), moved here
120-
// verbatim. Layer 0 is inert on this table (no organization column), so Layer 1
121-
// silence is to mean this scope, not no filter. Not read yet: the sets keep
122-
// carrying the same literal, and the security plugin's collection is to apply
123-
// this key when no held set carries a policy for the object. An `extend`
124-
// contribution cannot set or loosen it (refused at registration).
117+
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one policy
118+
// plugin-security's shipped permission sets spread for it today (the `_self`
119+
// carve-outs in `default-permission-sets.ts`), moved here verbatim. Layer 0 is inert
120+
// on this table (no organization column), so Layer 1 silence means this scope, not no
121+
// filter. The security plugin's row-policy collection applies it when no set the
122+
// caller holds carries a row policy for the object and operation; the shipped sets
123+
// still carry it, so their holders read as before. An `extend` contribution cannot set
124+
// or loosen it (refused at registration).
125125
defaultRowScope: {
126126
name: 'sys_account_self',
127127
operation: 'select',

‎packages/platform-objects/src/identity/sys-api-key.object.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,14 @@ export const SysApiKey = ObjectSchema.create({
227227
},
228228
},
229229

230-
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one
231-
// policy plugin-security's shipped permission sets spread for it today
232-
// (the `_self` carve-outs in `default-permission-sets.ts`), moved here
233-
// verbatim. Layer 0 is inert on this table (no organization column), so Layer 1
234-
// silence is to mean this scope, not no filter. Not read yet: the sets keep
235-
// carrying the same literal, and the security plugin's collection is to apply
236-
// this key when no held set carries a policy for the object. An `extend`
237-
// contribution cannot set or loosen it (refused at registration).
230+
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one policy
231+
// plugin-security's shipped permission sets spread for it today (the `_self`
232+
// carve-outs in `default-permission-sets.ts`), moved here verbatim. Layer 0 is inert
233+
// on this table (no organization column), so Layer 1 silence means this scope, not no
234+
// filter. The security plugin's row-policy collection applies it when no set the
235+
// caller holds carries a row policy for the object and operation; the shipped sets
236+
// still carry it, so their holders read as before. An `extend` contribution cannot set
237+
// or loosen it (refused at registration).
238238
defaultRowScope: {
239239
name: 'sys_api_key_self',
240240
operation: 'all',

‎packages/platform-objects/src/identity/sys-device-code.object.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ export const SysDeviceCode = ObjectSchema.create({
5151
titleFormat: '{user_code}',
5252
highlightFields: ['user_code', 'status', 'client_id', 'expires_at'],
5353

54-
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one
55-
// policy plugin-security's shipped permission sets spread for it today
56-
// (the `_self` carve-outs in `default-permission-sets.ts`), moved here
57-
// verbatim. Layer 0 is inert on this table (no organization column), so Layer 1
58-
// silence is to mean this scope, not no filter. Not read yet: the sets keep
59-
// carrying the same literal, and the security plugin's collection is to apply
60-
// this key when no held set carries a policy for the object. An `extend`
61-
// contribution cannot set or loosen it (refused at registration).
54+
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one policy
55+
// plugin-security's shipped permission sets spread for it today (the `_self`
56+
// carve-outs in `default-permission-sets.ts`), moved here verbatim. Layer 0 is inert
57+
// on this table (no organization column), so Layer 1 silence means this scope, not no
58+
// filter. The security plugin's row-policy collection applies it when no set the
59+
// caller holds carries a row policy for the object and operation; the shipped sets
60+
// still carry it, so their holders read as before. An `extend` contribution cannot set
61+
// or loosen it (refused at registration).
6262
defaultRowScope: {
6363
name: 'sys_device_code_self',
6464
operation: 'all',

‎packages/platform-objects/src/identity/sys-jwks.object.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ export const SysJwks = ObjectSchema.create({
3939
description: 'Asymmetric key pairs used to sign and verify issued JWTs',
4040
highlightFields: ['id', 'created_at', 'expires_at'],
4141

42-
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one
43-
// policy plugin-security's shipped permission sets spread for it today
44-
// (`privateCredentialRowScope` in `default-permission-sets.ts`), moved here
45-
// verbatim. Layer 0 is inert on this table (no organization column), so Layer 1
46-
// silence is to mean this scope, not no filter. Not read yet: the sets keep
47-
// carrying the same literal, and the security plugin's collection is to apply
48-
// this key when no held set carries a policy for the object. An `extend`
42+
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one policy
43+
// plugin-security's shipped permission sets spread for it today
44+
// (`privateCredentialRowScope` in `default-permission-sets.ts`), moved here verbatim.
45+
// Layer 0 is inert on this table (no organization column), so Layer 1 silence means
46+
// this scope, not no filter. The security plugin's row-policy collection applies it
47+
// when no set the caller holds carries a row policy for the object and operation; the
48+
// shipped sets still carry it, so their holders read as before. An `extend`
4949
// contribution cannot set or loosen it (refused at registration).
5050
defaultRowScope: {
5151
name: 'sys_jwks_none',

‎packages/platform-objects/src/identity/sys-oauth-access-token.object.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ export const SysOauthAccessToken = ObjectSchema.create({
3838
description: 'Opaque OAuth access tokens issued to client applications',
3939
highlightFields: ['client_id', 'user_id', 'expires_at'],
4040

41-
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one
42-
// policy plugin-security's shipped permission sets spread for it today
43-
// (the `_self` carve-outs in `default-permission-sets.ts`), moved here
44-
// verbatim. Layer 0 is inert on this table (no organization column), so Layer 1
45-
// silence is to mean this scope, not no filter. Not read yet: the sets keep
46-
// carrying the same literal, and the security plugin's collection is to apply
47-
// this key when no held set carries a policy for the object. An `extend`
48-
// contribution cannot set or loosen it (refused at registration).
41+
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one policy
42+
// plugin-security's shipped permission sets spread for it today (the `_self`
43+
// carve-outs in `default-permission-sets.ts`), moved here verbatim. Layer 0 is inert
44+
// on this table (no organization column), so Layer 1 silence means this scope, not no
45+
// filter. The security plugin's row-policy collection applies it when no set the
46+
// caller holds carries a row policy for the object and operation; the shipped sets
47+
// still carry it, so their holders read as before. An `extend` contribution cannot set
48+
// or loosen it (refused at registration).
4949
defaultRowScope: {
5050
name: 'sys_oauth_access_token_self',
5151
operation: 'select',

‎packages/platform-objects/src/identity/sys-oauth-application.object.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,14 @@ export const SysOauthApplication = ObjectSchema.create({
284284
},
285285
},
286286

287-
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one
288-
// policy plugin-security's shipped permission sets spread for it today
289-
// (the `_self` carve-outs in `default-permission-sets.ts`), moved here
290-
// verbatim. Layer 0 is inert on this table (no organization column), so Layer 1
291-
// silence is to mean this scope, not no filter. Not read yet: the sets keep
292-
// carrying the same literal, and the security plugin's collection is to apply
293-
// this key when no held set carries a policy for the object. An `extend`
294-
// contribution cannot set or loosen it (refused at registration).
287+
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one policy
288+
// plugin-security's shipped permission sets spread for it today (the `_self`
289+
// carve-outs in `default-permission-sets.ts`), moved here verbatim. Layer 0 is inert
290+
// on this table (no organization column), so Layer 1 silence means this scope, not no
291+
// filter. The security plugin's row-policy collection applies it when no set the
292+
// caller holds carries a row policy for the object and operation; the shipped sets
293+
// still carry it, so their holders read as before. An `extend` contribution cannot set
294+
// or loosen it (refused at registration).
295295
defaultRowScope: {
296296
name: 'sys_oauth_application_self',
297297
operation: 'all',

‎packages/platform-objects/src/identity/sys-oauth-consent.object.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ export const SysOauthConsent = ObjectSchema.create({
3434
description: 'User consent records for OAuth client applications',
3535
highlightFields: ['client_id', 'user_id', 'scopes'],
3636

37-
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one
38-
// policy plugin-security's shipped permission sets spread for it today
39-
// (the `_self` carve-outs in `default-permission-sets.ts`), moved here
40-
// verbatim. Layer 0 is inert on this table (no organization column), so Layer 1
41-
// silence is to mean this scope, not no filter. Not read yet: the sets keep
42-
// carrying the same literal, and the security plugin's collection is to apply
43-
// this key when no held set carries a policy for the object. An `extend`
44-
// contribution cannot set or loosen it (refused at registration).
37+
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one policy
38+
// plugin-security's shipped permission sets spread for it today (the `_self`
39+
// carve-outs in `default-permission-sets.ts`), moved here verbatim. Layer 0 is inert
40+
// on this table (no organization column), so Layer 1 silence means this scope, not no
41+
// filter. The security plugin's row-policy collection applies it when no set the
42+
// caller holds carries a row policy for the object and operation; the shipped sets
43+
// still carry it, so their holders read as before. An `extend` contribution cannot set
44+
// or loosen it (refused at registration).
4545
defaultRowScope: {
4646
name: 'sys_oauth_consent_self',
4747
operation: 'all',

‎packages/platform-objects/src/identity/sys-oauth-refresh-token.object.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ export const SysOauthRefreshToken = ObjectSchema.create({
3737
description: 'Opaque OAuth refresh tokens (linked to a session)',
3838
highlightFields: ['client_id', 'user_id', 'expires_at'],
3939

40-
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one
41-
// policy plugin-security's shipped permission sets spread for it today
42-
// (the `_self` carve-outs in `default-permission-sets.ts`), moved here
43-
// verbatim. Layer 0 is inert on this table (no organization column), so Layer 1
44-
// silence is to mean this scope, not no filter. Not read yet: the sets keep
45-
// carrying the same literal, and the security plugin's collection is to apply
46-
// this key when no held set carries a policy for the object. An `extend`
47-
// contribution cannot set or loosen it (refused at registration).
40+
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one policy
41+
// plugin-security's shipped permission sets spread for it today (the `_self`
42+
// carve-outs in `default-permission-sets.ts`), moved here verbatim. Layer 0 is inert
43+
// on this table (no organization column), so Layer 1 silence means this scope, not no
44+
// filter. The security plugin's row-policy collection applies it when no set the
45+
// caller holds carries a row policy for the object and operation; the shipped sets
46+
// still carry it, so their holders read as before. An `extend` contribution cannot set
47+
// or loosen it (refused at registration).
4848
defaultRowScope: {
4949
name: 'sys_oauth_refresh_token_self',
5050
operation: 'select',

‎packages/platform-objects/src/identity/sys-organization.object.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -299,14 +299,14 @@ export const SysOrganization = ObjectSchema.create({
299299
},
300300
},
301301

302-
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one
303-
// policy plugin-security's shipped permission sets spread for it today
304-
// (the `_self` carve-outs in `default-permission-sets.ts`), moved here
305-
// verbatim. Layer 0 is inert on this table (no organization column), so Layer 1
306-
// silence is to mean this scope, not no filter. Not read yet: the sets keep
307-
// carrying the same literal, and the security plugin's collection is to apply
308-
// this key when no held set carries a policy for the object. An `extend`
309-
// contribution cannot set or loosen it (refused at registration).
302+
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one policy
303+
// plugin-security's shipped permission sets spread for it today (the `_self`
304+
// carve-outs in `default-permission-sets.ts`), moved here verbatim. Layer 0 is inert
305+
// on this table (no organization column), so Layer 1 silence means this scope, not no
306+
// filter. The security plugin's row-policy collection applies it when no set the
307+
// caller holds carries a row policy for the object and operation; the shipped sets
308+
// still carry it, so their holders read as before. An `extend` contribution cannot set
309+
// or loosen it (refused at registration).
310310
defaultRowScope: {
311311
name: 'sys_organization_self',
312312
operation: 'all',

‎packages/platform-objects/src/identity/sys-scim-connection-binding.object.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ export const SysScimConnectionBinding = ObjectSchema.create({
5151
},
5252
},
5353

54-
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one
55-
// policy plugin-security's shipped permission sets spread for it today
56-
// (`scimProjectionRowScope` in `default-permission-sets.ts`), moved here
57-
// verbatim. Layer 0 is inert on this table (no organization column), so Layer 1
58-
// silence is to mean this scope, not no filter. Not read yet: the sets keep
59-
// carrying the same literal, and the security plugin's collection is to apply
60-
// this key when no held set carries a policy for the object. An `extend`
54+
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one policy
55+
// plugin-security's shipped permission sets spread for it today
56+
// (`scimProjectionRowScope` in `default-permission-sets.ts`), moved here verbatim.
57+
// Layer 0 is inert on this table (no organization column), so Layer 1 silence means
58+
// this scope, not no filter. The security plugin's row-policy collection applies it
59+
// when no set the caller holds carries a row policy for the object and operation; the
60+
// shipped sets still carry it, so their holders read as before. An `extend`
6161
// contribution cannot set or loosen it (refused at registration).
6262
defaultRowScope: {
6363
name: 'sys_scim_connection_binding_none',

0 commit comments

Comments
 (0)