@substrat-run/contracts 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,9 @@ export declare const adminAction: z.ZodEnum<{
5
5
  grant: "grant";
6
6
  grantToOrg: "grantToOrg";
7
7
  addMember: "addMember";
8
+ removeMember: "removeMember";
9
+ createOrg: "createOrg";
10
+ registerIdentityPool: "registerIdentityPool";
8
11
  createTenant: "createTenant";
9
12
  setTenantStatus: "setTenantStatus";
10
13
  provisionScope: "provisionScope";
@@ -33,12 +36,73 @@ export declare const identityLink: z.ZodObject<{
33
36
  scopeId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "ScopeId", "out">>;
34
37
  }, z.core.$strip>;
35
38
  export type IdentityLink = z.infer<typeof identityLink>;
39
+ /**
40
+ * How an identity pool relates to tenants (K-23) — the fact that decides whether the
41
+ * same `externalId` seen in two tenants is one human or two.
42
+ *
43
+ * `central`: one pool serving many tenants. The same external subject IS the same
44
+ * person everywhere, which is what lets one login belong to several tenants (§4.3's
45
+ * staff case, and a branded multi-tenant consumer product like RallyPoint).
46
+ *
47
+ * `tenant-bound`: one pool serving exactly one tenant. Subject ids are unique only
48
+ * within it, so the same `externalId` in another tenant is a DIFFERENT person — the
49
+ * white-label case, where a consumer of two shops is correctly two accounts.
50
+ *
51
+ * Topology, not audience. The audiences in §4.3 are descriptive; this is enforceable.
52
+ */
53
+ export declare const poolTopology: z.ZodEnum<{
54
+ central: "central";
55
+ "tenant-bound": "tenant-bound";
56
+ }>;
57
+ export type PoolTopology = z.infer<typeof poolTopology>;
58
+ /**
59
+ * A registered identity provider. `provider` names exactly one pool, so separate
60
+ * per-tenant deployments take distinct provider strings (`oidc:<issuer>`) — which the
61
+ * `identityLink` comment above already assumed.
62
+ *
63
+ * `tenantId` is non-null exactly when `topology` is `tenant-bound`: it is the one
64
+ * tenant that pool may serve, and linking into any other is refused.
65
+ */
66
+ export declare const identityPool: z.ZodObject<{
67
+ provider: z.ZodString;
68
+ topology: z.ZodEnum<{
69
+ central: "central";
70
+ "tenant-bound": "tenant-bound";
71
+ }>;
72
+ tenantId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "TenantId", "out">>;
73
+ }, z.core.$strip>;
74
+ export type IdentityPool = z.infer<typeof identityPool>;
75
+ /**
76
+ * What the directory knows about an authenticated external identity, once the caller
77
+ * has said WHICH tenant's pool it came from.
78
+ *
79
+ * No `tenantId` here on purpose. The lookup takes the tenant as input (§4.3: with one
80
+ * auth pool per white-label tenant, an external subject id is unique only *within* its
81
+ * pool), so echoing it back would invite the very mental model this fixes — that the
82
+ * directory derives the tenant from the identity. You tell it which tenant; it tells
83
+ * you who.
84
+ */
36
85
  export declare const resolvedIdentity: z.ZodObject<{
37
86
  principal: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
38
- tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
39
87
  scopeId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "ScopeId", "out">>;
40
88
  }, z.core.$strip>;
41
89
  export type ResolvedIdentity = z.infer<typeof resolvedIdentity>;
90
+ /**
91
+ * One principal's membership of one org, as the directory holds it (K-21).
92
+ *
93
+ * `revokedAt` non-null is a **tombstone**: the tuple is still here and still
94
+ * readable, and the permission walk skips it. Deletion is not an option — an
95
+ * operated compliance product has to show both that access was revoked and the
96
+ * trail proving it was once granted (D-32), and a deleted row shows neither.
97
+ *
98
+ * Listing defaults to live members only; revoked rows are the evidence view.
99
+ */
100
+ export declare const orgMembership: z.ZodObject<{
101
+ principal: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
102
+ orgId: z.core.$ZodBranded<z.ZodString, "OrgId", "out">;
103
+ revokedAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
104
+ }, z.core.$strip>;
105
+ export type OrgMembership = z.infer<typeof orgMembership>;
42
106
  /**
43
107
  * An append-only admin audit row (control-plane.md §4.4). Every field except
44
108
  * `before`/`after` is stamped platform-side — never supplied by the caller —
@@ -58,6 +122,9 @@ export declare const adminLogEntry: z.ZodObject<{
58
122
  grant: "grant";
59
123
  grantToOrg: "grantToOrg";
60
124
  addMember: "addMember";
125
+ removeMember: "removeMember";
126
+ createOrg: "createOrg";
127
+ registerIdentityPool: "registerIdentityPool";
61
128
  createTenant: "createTenant";
62
129
  setTenantStatus: "setTenantStatus";
63
130
  provisionScope: "provisionScope";
@@ -69,11 +136,12 @@ export declare const adminLogEntry: z.ZodObject<{
69
136
  revokeEntitlement: "revokeEntitlement";
70
137
  linkIdentity: "linkIdentity";
71
138
  }>;
72
- tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
139
+ tenantId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "TenantId", "out">>;
73
140
  scopeId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "ScopeId", "out">>;
74
141
  vertical: z.ZodNullable<z.ZodString>;
75
142
  before: z.ZodNullable<z.ZodUnknown>;
76
143
  after: z.ZodNullable<z.ZodUnknown>;
144
+ causedBy: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "EventId", "out">>;
77
145
  at: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
78
146
  }, z.core.$strip>;
79
147
  export type AdminLogEntry = z.infer<typeof adminLogEntry>;
@@ -1 +1 @@
1
- {"version":3,"file":"control-plane.d.ts","sourceRoot":"","sources":["../src/control-plane.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;EAgBtB,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY;;;;;;iBAMvB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;A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CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4BxB,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { instant, platformActorId, principalId, scopeId, tenantId } from './ids.js';
2
+ import { eventId, instant, orgId, platformActorId, principalId, scopeId, tenantId, } from './ids.js';
3
3
  // The control plane — the shared layer across N per-vertical deployments (D-30,
4
4
  // control-plane.md). This file carries the audit contract that every effecting
5
5
  // mutation writes; the tenant registry, lifecycle, and entitlement store land in
@@ -12,6 +12,9 @@ export const adminAction = z.enum([
12
12
  'grant',
13
13
  'grantToOrg',
14
14
  'addMember',
15
+ 'removeMember', // K-21 — tombstones the membership tuple, never deletes it
16
+ 'createOrg', // K-22 — orgs are a real record, not a free-form string
17
+ 'registerIdentityPool', // K-23 — a provider declares its topology before it may link
15
18
  'createTenant', // §4.1
16
19
  'setTenantStatus', // §4.1 — before/after carry the transitioned status
17
20
  'provisionScope', // §4.2 — the first scope-lifecycle transition (→ active)
@@ -38,11 +41,67 @@ export const identityLink = z.object({
38
41
  tenantId,
39
42
  scopeId: scopeId.optional(), // omitted = tenant-level home
40
43
  });
44
+ /**
45
+ * How an identity pool relates to tenants (K-23) — the fact that decides whether the
46
+ * same `externalId` seen in two tenants is one human or two.
47
+ *
48
+ * `central`: one pool serving many tenants. The same external subject IS the same
49
+ * person everywhere, which is what lets one login belong to several tenants (§4.3's
50
+ * staff case, and a branded multi-tenant consumer product like RallyPoint).
51
+ *
52
+ * `tenant-bound`: one pool serving exactly one tenant. Subject ids are unique only
53
+ * within it, so the same `externalId` in another tenant is a DIFFERENT person — the
54
+ * white-label case, where a consumer of two shops is correctly two accounts.
55
+ *
56
+ * Topology, not audience. The audiences in §4.3 are descriptive; this is enforceable.
57
+ */
58
+ export const poolTopology = z.enum(['central', 'tenant-bound']);
59
+ /**
60
+ * A registered identity provider. `provider` names exactly one pool, so separate
61
+ * per-tenant deployments take distinct provider strings (`oidc:<issuer>`) — which the
62
+ * `identityLink` comment above already assumed.
63
+ *
64
+ * `tenantId` is non-null exactly when `topology` is `tenant-bound`: it is the one
65
+ * tenant that pool may serve, and linking into any other is refused.
66
+ */
67
+ export const identityPool = z
68
+ .object({
69
+ provider: z.string().min(1),
70
+ topology: poolTopology,
71
+ tenantId: tenantId.nullable(),
72
+ })
73
+ .refine((p) => (p.topology === 'tenant-bound') === (p.tenantId !== null), {
74
+ message: 'tenant-bound pools name their tenant; central pools must not',
75
+ });
76
+ /**
77
+ * What the directory knows about an authenticated external identity, once the caller
78
+ * has said WHICH tenant's pool it came from.
79
+ *
80
+ * No `tenantId` here on purpose. The lookup takes the tenant as input (§4.3: with one
81
+ * auth pool per white-label tenant, an external subject id is unique only *within* its
82
+ * pool), so echoing it back would invite the very mental model this fixes — that the
83
+ * directory derives the tenant from the identity. You tell it which tenant; it tells
84
+ * you who.
85
+ */
41
86
  export const resolvedIdentity = z.object({
42
87
  principal: principalId,
43
- tenantId,
44
88
  scopeId: scopeId.nullable(),
45
89
  });
90
+ /**
91
+ * One principal's membership of one org, as the directory holds it (K-21).
92
+ *
93
+ * `revokedAt` non-null is a **tombstone**: the tuple is still here and still
94
+ * readable, and the permission walk skips it. Deletion is not an option — an
95
+ * operated compliance product has to show both that access was revoked and the
96
+ * trail proving it was once granted (D-32), and a deleted row shows neither.
97
+ *
98
+ * Listing defaults to live members only; revoked rows are the evidence view.
99
+ */
100
+ export const orgMembership = z.object({
101
+ principal: principalId,
102
+ orgId,
103
+ revokedAt: instant.nullable(),
104
+ });
46
105
  /**
47
106
  * An append-only admin audit row (control-plane.md §4.4). Every field except
48
107
  * `before`/`after` is stamped platform-side — never supplied by the caller —
@@ -57,11 +116,29 @@ export const adminLogEntry = z.object({
57
116
  id: z.string().min(1), // ULID, stamped host-side; sortable = chronological
58
117
  actor: platformActorId,
59
118
  action: adminAction,
60
- tenantId,
119
+ // Nullable for PLATFORM-level actions that target no tenant — registering a central
120
+ // identity pool is the first (K-23). Every tenant-scoped action still carries one;
121
+ // null means "the platform itself", not "unknown".
122
+ tenantId: tenantId.nullable(),
61
123
  scopeId: scopeId.nullable(),
62
124
  vertical: z.string().nullable(),
63
125
  before: z.unknown().nullable(), // prior state where cheaply readable (e.g. a redefined role)
64
126
  after: z.unknown().nullable(), // the applied payload
127
+ /**
128
+ * The domain event that caused this action, when one did (K-22 §4.2).
129
+ *
130
+ * The connector seam splits a change across two halves: a module emits inside its
131
+ * own transaction, and a privileged executor outside module code effects it. That
132
+ * splits the trail too — control-plane.md §3 named it as the main thing the pattern
133
+ * worsens. This is the join, and it is the EVENT ID rather than a new correlation
134
+ * field: the envelope already carries a kernel-stamped unique id that is the
135
+ * idempotency key downstream, so reusing it avoids widening a frozen contract
136
+ * (D-5/D-28) to say something it already says.
137
+ *
138
+ * Null for the ordinary case — a staff member acting directly caused nothing but
139
+ * themselves.
140
+ */
141
+ causedBy: eventId.nullable(),
65
142
  at: instant,
66
143
  });
67
144
  //# sourceMappingURL=control-plane.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"control-plane.js","sourceRoot":"","sources":["../src/control-plane.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpF,gFAAgF;AAChF,+EAA+E;AAC/E,iFAAiF;AACjF,4CAA4C;AAE5C,2EAA2E;AAC3E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC;IAChC,YAAY;IACZ,YAAY;IACZ,OAAO;IACP,YAAY;IACZ,WAAW;IACX,cAAc,EAAE,OAAO;IACvB,iBAAiB,EAAE,oDAAoD;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AO,CAAC,QAAQ,EAAE;IAC3B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,6DAA6D;IAC7F,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,sBAAsB;IACrD;;;;;;;;;;;;;OAaG;IACH,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE;IAC5B,EAAE,EAAE,OAAO;CACZ,CAAC,CAAC"}
package/dist/ids.d.ts CHANGED
@@ -5,6 +5,8 @@ export declare const scopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
5
5
  export type ScopeId = z.infer<typeof scopeId>;
6
6
  export declare const principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
7
7
  export type PrincipalId = z.infer<typeof principalId>;
8
+ export declare const orgId: z.core.$ZodBranded<z.ZodString, "OrgId", "out">;
9
+ export type OrgId = z.infer<typeof orgId>;
8
10
  export declare const platformActorId: z.core.$ZodBranded<z.ZodString, "PlatformActorId", "out">;
9
11
  export type PlatformActorId = z.infer<typeof platformActorId>;
10
12
  export declare const eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
package/dist/ids.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../src/ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,QAAQ,oDAA6C,CAAC;AACnE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD,eAAO,MAAM,OAAO,mDAA4C,CAAC;AACjE,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;AAE9C,eAAO,MAAM,WAAW,uDAAgD,CAAC;AACzE,M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AM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAMtD,eAAO,MAAM,KAAK,iDAA0C,CAAC;AAC7D,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC;AAK1C,eAAO,MAAM,eAAe,2DAAoD,CAAC;AACjF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,eAAO,MAAM,OAAO,mDAA4C,CAAC;AACjE,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;AAE9C,eAAO,MAAM,aAAa,yDAAkD,CAAC;AAC7E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAG1D,eAAO,MAAM,QAAQ,oDAGC,CAAC;AACvB,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAGhD,eAAO,MAAM,OAAO,mDAA2D,CAAC;AAChF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;AAG9C,eAAO,MAAM,aAAa,yDAGC,CAAC;AAC5B,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,eAAO,MAAM,IAAI,aAAwD,CAAC"}
package/dist/ids.js CHANGED
@@ -6,6 +6,11 @@ const ULID = /^[0-9A-HJKMNP-TV-Z]{26}$/;
6
6
  export const tenantId = z.string().regex(ULID).brand();
7
7
  export const scopeId = z.string().regex(ULID).brand();
8
8
  export const principalId = z.string().regex(ULID).brand();
9
+ // An organization inside a tenant — the subject of membership tuples and the target
10
+ // of `grantToOrg` (K-22). Branded like every other id: `orgId` was a free-form string
11
+ // until orgs became a real record, so `acme` and `Acme` silently addressed different
12
+ // orgs and a typo in a grant reached a phantom nothing would ever resolve to.
13
+ export const orgId = z.string().regex(ULID).brand();
9
14
  // A platform-staff actor — the subject of every control-plane mutation (D-30, K-20).
10
15
  // Branded DISTINCTLY from PrincipalId on purpose: a platform actor is not a principal
11
16
  // in any tenant, and the compiler must refuse to confuse the two.
package/dist/ids.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ids.js","sourceRoot":"","sources":["../src/ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,oFAAoF;AACpF,oFAAoF;AACpF,oEAAoE;AAEpE,MAAM,IAAI,GAAG,0BAA0B,CAAC;AAExC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAc,CAAC;AAGnE,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAa,CAAC;AAGjE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAiB,CAAC;AAGzE,qFAAqF;AACrF,sFAAsF;AACtF,kEAAkE;AAClE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAqB,CAAC;AAGjF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAa,CAAC;AAGjE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAmB,CAAC;AAG7E,4DAA4D;AAC5D,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC;KACtB,MAA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,OAAO,aAAwD,CAAC;AAE7E,eAAO,MAAM,cAAc;;;;iBAUzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,UAAU;;;;;iBAAsC,CAAC;AAC9D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,eAAO,MAAM,cAAc;;;;;;;iBAIzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAM5D,eAAO,MAAM,eAAe;;;;;;;;;;;;;iBAO1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAgB9D,eAAO,MAAM,SAAS,qDAGC,CAAC;AACxB,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAGlD,eAAO,MAAM,YAAY,aAAqC,CAAC;AAE/D,eAAO,MAAM,aAAa;;;;iBAIxB,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAQ1D,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;8BAUnB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;iBAS/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -54,6 +54,11 @@ export const capabilityGrant = z.object({
54
54
  // ============================================================================
55
55
  // 'principal:<ulid>' | 'org:<ulid>' | 'tenant:<ulid>' | 'scope:<ulid>' |
56
56
  // '<entityType>:<entityId>' — namespace:id
57
+ //
58
+ // The regex is deliberately loose on the id half: entity ids are vertical-owned and
59
+ // need not be ULIDs. The kernel-owned namespaces above ARE all branded ULIDs at their
60
+ // own boundary — `org:` became one in K-22, which is when this comment stopped being
61
+ // aspirational.
57
62
  export const objectRef = z
58
63
  .string()
59
64
  .regex(/^[a-z0-9_-]+:[^\s]+$/)
@@ -1 +1 @@
1
- {"version":3,"file":"permission.js","sourceRoot":"","sources":["../src/permission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,+EAA+E;AAC/E,qEAAqE;AACrE,+EAA+E;AAE/E,wEAAwE;AACxE,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,QAAQ;IACR,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;AAE7E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,GAAG,EAAE,OAAO;IACZ,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1C,6EAA6E;IAC7E,4EAA4E;IAC5E,8EAA8E;IAC9E,8EAA8E;IAC9E,gFAAgF;IAChF,iEAAiE;IACjE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;CACnD,CAAC,CAAC;AAGH;;;;;;GAMG;AACH,MAAM,CAAC,MA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AAC,CAAC,MAAM,CAAC;IACpC,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,YAAY;IACtB,MAAM,EAAE,SAAS;CAClB,CAAC,CAAC;AAGH,+EAA+E;AAC/E,8EAA8E;AAC9E,0EAA0E;AAC1E,4DAA4D;AAC5D,+EAA+E;AAE/E,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;IACtD,CAAC,CAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;QACxB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;KACrC,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;QACzB,OAAO,EAAE,aAAa;QACtB,IAAI;KACL,CAAC;CACH,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,WAAW;IACX,IAAI;IACJ,WAAW,EAAE,CAAC,CAAC,KAAK,CAClB,CAAC,CAAC,MAAM,CAAC;QACP,UAAU,EAAE,aAAa;QACzB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;KACrC,CAAC,CACH;CACF,CAAC,CAAC"}
package/dist/tenancy.d.ts CHANGED
@@ -23,6 +23,35 @@ export declare const createTenantInput: z.ZodObject<{
23
23
  name: z.ZodString;
24
24
  }, z.core.$strip>;
25
25
  export type CreateTenantInput = z.infer<typeof createTenantInput>;
26
+ /**
27
+ * An organization inside a tenant (K-22) — who membership tuples point at and what
28
+ * `grantToOrg` targets. Portal customers, staff groups, partner companies.
29
+ *
30
+ * `slug` and `name` are **attributes, not identity**: the id is a ULID, so renaming an
31
+ * org cannot silently orphan the tuples and grants that reference it. `tenantId` on the
32
+ * row is also kernel-design §4.3's required `orgId ↔ tenantId` join — *"an explicit,
33
+ * stable directory row, one per tenant, never reconstructed from names or slugs"* —
34
+ * which is why the identity adapter's org sync hangs off this record rather than a
35
+ * string convention.
36
+ *
37
+ * No lifecycle status yet, deliberately: nothing consumes one, and adding a nullable
38
+ * column later is additive. The branded id is the part that is brutal to retrofit.
39
+ */
40
+ export declare const org: z.ZodObject<{
41
+ id: z.core.$ZodBranded<z.ZodString, "OrgId", "out">;
42
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
43
+ slug: z.ZodString;
44
+ name: z.ZodString;
45
+ createdAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
46
+ }, z.core.$strip>;
47
+ export type Org = z.infer<typeof org>;
48
+ export declare const createOrgInput: z.ZodObject<{
49
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
50
+ id: z.core.$ZodBranded<z.ZodString, "OrgId", "out">;
51
+ slug: z.ZodString;
52
+ name: z.ZodString;
53
+ }, z.core.$strip>;
54
+ export type CreateOrgInput = z.infer<typeof createOrgInput>;
26
55
  export declare const scopeStatus: z.ZodEnum<{
27
56
  active: "active";
28
57
  suspended: "suspended";
@@ -40,6 +69,32 @@ export declare const jurisdiction: z.ZodNullable<z.ZodEnum<{
40
69
  eu: "eu";
41
70
  }>>;
42
71
  export type Jurisdiction = z.infer<typeof jurisdiction>;
72
+ /**
73
+ * A scope's last *failed* migration attempt (kernel-design §5.3), or null when the
74
+ * last attempt succeeded and when none has run.
75
+ *
76
+ * Migrations fail closed per scope: `applyPendingMigrations` rolls back and throws,
77
+ * so the scope serves nothing. Before this record existed the directory learned
78
+ * nothing from that — `schemaVersion` is projected only on the success path, so a
79
+ * half-migrated scope kept a stale value and rendered as healthy.
80
+ *
81
+ * Deliberately **not** a `scopeStatus` member: the scope already fails closed at the
82
+ * migration layer, so nothing about lifecycle gating changes, and the §3.3 machine
83
+ * (`provisioning → active → suspended ⇄ active → archiving → archived`) has no
84
+ * sensible transition for it. Structured rather than a flag because the
85
+ * reconciliation sweep (§5.3) retries with backoff and reports
86
+ * "487/500 migrated, 13 pending, 0 failed" — which needs the attempt count and the
87
+ * failing version, not a boolean.
88
+ *
89
+ * `attempts` counts *consecutive* failures and resets to 0 on a successful apply.
90
+ */
91
+ export declare const migrationFailure: z.ZodNullable<z.ZodObject<{
92
+ version: z.ZodString;
93
+ error: z.ZodString;
94
+ attempts: z.ZodNumber;
95
+ lastAttemptAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
96
+ }, z.core.$strip>>;
97
+ export type MigrationFailure = z.infer<typeof migrationFailure>;
43
98
  export declare const scope: z.ZodObject<{
44
99
  id: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
45
100
  tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
@@ -63,6 +118,12 @@ export declare const scope: z.ZodObject<{
63
118
  }>>;
64
119
  vertical: z.ZodNullable<z.ZodString>;
65
120
  schemaVersion: z.ZodString;
121
+ migrationFailure: z.ZodNullable<z.ZodObject<{
122
+ version: z.ZodString;
123
+ error: z.ZodString;
124
+ attempts: z.ZodNumber;
125
+ lastAttemptAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
126
+ }, z.core.$strip>>;
66
127
  createdAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
67
128
  }, z.core.$strip>;
68
129
  export type Scope = z.infer<typeof scope>;
@@ -1 +1 @@
1
- {"version":3,"file":"tenancy.d.ts","sourceRoot":"","sources":["../src/tenancy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,YAAY;;;;EAA8C,CAAC;AACxE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,eAAO,MAAM,MAAM;;;;;;;;;;iBAMjB,CAAC;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,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,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC;AAGtC,eAAO,MAAM,cAAc;;;;;iBAAiE,CAAC;AAC7F,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,eAAO,MAAM,WAAW;;;;;;EAMtB,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAGtD,eAAO,MAAM,YAAY;;;EAAqB,CAAC;AAC/C,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAGxD,eAAO,MAAM,YAAY;;GAA4B,CAAC;AACtD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,gBAAgB;;;;;kBAOhB,CAAC;AACd,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuBhB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC"}
package/dist/tenancy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { instant, scopeId, slug, tenantId } from './ids.js';
2
+ import { instant, orgId, scopeId, slug, tenantId } from './ids.js';
3
3
  export const tenantStatus = z.enum(['active', 'suspended', 'deleting']);
4
4
  export const tenant = z.object({
5
5
  id: tenantId,
@@ -11,6 +11,29 @@ export const tenant = z.object({
11
11
  // What the caller supplies to createTenant (control-plane.md §4.1); `status`
12
12
  // (active) and `createdAt` are stamped host-side, never caller-supplied.
13
13
  export const createTenantInput = tenant.pick({ id: true, slug: true, name: true });
14
+ /**
15
+ * An organization inside a tenant (K-22) — who membership tuples point at and what
16
+ * `grantToOrg` targets. Portal customers, staff groups, partner companies.
17
+ *
18
+ * `slug` and `name` are **attributes, not identity**: the id is a ULID, so renaming an
19
+ * org cannot silently orphan the tuples and grants that reference it. `tenantId` on the
20
+ * row is also kernel-design §4.3's required `orgId ↔ tenantId` join — *"an explicit,
21
+ * stable directory row, one per tenant, never reconstructed from names or slugs"* —
22
+ * which is why the identity adapter's org sync hangs off this record rather than a
23
+ * string convention.
24
+ *
25
+ * No lifecycle status yet, deliberately: nothing consumes one, and adding a nullable
26
+ * column later is additive. The branded id is the part that is brutal to retrofit.
27
+ */
28
+ export const org = z.object({
29
+ id: orgId,
30
+ tenantId,
31
+ slug, // unique within the tenant
32
+ name: z.string().min(1),
33
+ createdAt: instant,
34
+ });
35
+ // `status`/`createdAt` are stamped host-side, never caller-supplied (as createTenantInput).
36
+ export const createOrgInput = org.pick({ id: true, tenantId: true, slug: true, name: true });
14
37
  export const scopeStatus = z.enum([
15
38
  'provisioning',
16
39
  'active',
@@ -22,6 +45,33 @@ export const scopeStatus = z.enum([
22
45
  export const storageShape = z.enum(['A', 'B']);
23
46
  // Fixed at provisioning; a DO can never relocate (design K-7)
24
47
  export const jurisdiction = z.enum(['eu']).nullable();
48
+ /**
49
+ * A scope's last *failed* migration attempt (kernel-design §5.3), or null when the
50
+ * last attempt succeeded and when none has run.
51
+ *
52
+ * Migrations fail closed per scope: `applyPendingMigrations` rolls back and throws,
53
+ * so the scope serves nothing. Before this record existed the directory learned
54
+ * nothing from that — `schemaVersion` is projected only on the success path, so a
55
+ * half-migrated scope kept a stale value and rendered as healthy.
56
+ *
57
+ * Deliberately **not** a `scopeStatus` member: the scope already fails closed at the
58
+ * migration layer, so nothing about lifecycle gating changes, and the §3.3 machine
59
+ * (`provisioning → active → suspended ⇄ active → archiving → archived`) has no
60
+ * sensible transition for it. Structured rather than a flag because the
61
+ * reconciliation sweep (§5.3) retries with backoff and reports
62
+ * "487/500 migrated, 13 pending, 0 failed" — which needs the attempt count and the
63
+ * failing version, not a boolean.
64
+ *
65
+ * `attempts` counts *consecutive* failures and resets to 0 on a successful apply.
66
+ */
67
+ export const migrationFailure = z
68
+ .object({
69
+ version: z.string().min(1), // the `module@version` that threw
70
+ error: z.string(),
71
+ attempts: z.number().int().positive(), // ≥1: the record only exists after a failure
72
+ lastAttemptAt: instant,
73
+ })
74
+ .nullable();
25
75
  export const scope = z.object({
26
76
  id: scopeId, // globally unique; APIs still take (tenantId, scopeId) and cross-check (K-3)
27
77
  tenantId,
@@ -43,6 +93,7 @@ export const scope = z.object({
43
93
  // '0' means "provisioned, nothing applied yet". Comparing it against the host's
44
94
  // registered migration total is what answers §5.4's "which scopes are behind".
45
95
  schemaVersion: z.string(),
96
+ migrationFailure,
46
97
  createdAt: instant,
47
98
  });
48
99
  //# sourceMappingURL=tenancy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tenancy.js","sourceRoot":"","sources":["../src/tenancy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE5D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC;AAGxE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,EAAE,EAAE,QAAQ;IACZ,IAAI;IACJ,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,MAAM,EAAE,YAAY;IACpB,SAAS,EAAE,OAAO;CACnB,CAAC,CAAC;AAGH,6EAA6E;AAC7E,yEAAyE;AACzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI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,CAAC,QAAQ,EAAE;IACtC,6EAA6E;IAC7E,iFAAiF;IACjF,gFAAgF;IAChF,+EAA+E;IAC/E,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,gBAAgB;IAChB,SAAS,EAAE,OAAO;CACnB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@substrat-run/contracts",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Substrat kernel contract schemas — Zod is the source of truth (master plan D-22); OAS/JSON Schema are emitted artifacts",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {