@substrat-run/kernel 0.4.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.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type { AuditLogFilter, ConsumerHandler, GuardPredicate, HostAdmin, ModuleRegistration, OperationContext, OperationHandler, ProvisionScopeInput, RoleFilter, ScopedSql, ScopeFilter, ScopeHost, ScopeStub, SqlMigration, SqlValue, } from './scope-host.js';
1
+ export type { AuditLogFilter, ConsumerHandler, ExecutorHandler, GuardPredicate, HostAdmin, ModuleRegistration, OperationContext, OperationHandler, ProvisionScopeInput, RoleFilter, ScopedSql, ScopeFilter, ScopeHost, ScopeStub, SqlMigration, SqlValue, } from './scope-host.js';
2
2
  export { resolveScopeRecord } from './scope-record.js';
3
3
  export type { ResolvedScopeRecord } from './scope-record.js';
4
4
  export { assertAllowed, denyAllChecker, PermissionDenied, UNSAFE_allowAllChecker, } from './permission-checker.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,cAAc,EACd,eAAe,EACf,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,YAAY,EACZ,QAAQ,GACT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,cAAc,EACd,eAAe,EACf,eAAe,EACf,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,YAAY,EACZ,QAAQ,GACT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { AdminAction, AdminLogEntry, CapabilityGrant, CreateTenantInput, Decision, DomainEvent, DomainEventInput, EntityRef, IdentityLink, Jurisdiction, ModuleManifest, Node, PermissionKey, PlatformActorId, PrincipalId, ResolvedIdentity, RoleAssignment, RoleDefinition, Scope, ScopeId, ScopeStatus, StorageShape, Tenant, TenantId, TenantRole, TenantStatus } from '@substrat-run/contracts';
1
+ import type { AdminAction, AdminLogEntry, CapabilityGrant, CreateTenantInput, Decision, DomainEvent, DomainEventInput, EntityRef, IdentityLink, IdentityPool, Jurisdiction, ModuleManifest, CreateOrgInput, Node, Org, OrgId, OrgMembership, PermissionKey, PlatformActorId, PrincipalId, ResolvedIdentity, RoleAssignment, RoleDefinition, Scope, ScopeId, ScopeStatus, StorageShape, Tenant, TenantId, TenantRole, TenantStatus } from '@substrat-run/contracts';
2
2
  /**
3
3
  * The scope-host contract — the adapter seam (§5.1 of the design doc).
4
4
  *
@@ -65,6 +65,27 @@ export interface SqlMigration {
65
65
  * idempotent. Ordering is guaranteed only within (scope, module) — K-11.
66
66
  */
67
67
  export type ConsumerHandler = (ctx: OperationContext, event: DomainEvent) => void | Promise<void>;
68
+ /**
69
+ * An **executor**: out-of-band host code that effects, outside a scope, what a module
70
+ * asked for inside one (K-22 §4.2; D-18's triage rule — effects on the outside world
71
+ * are connectors).
72
+ *
73
+ * Why this rather than an in-scope capability: some effects are not scope-local.
74
+ * Membership tuples are tenant-wide and live in the directory, so an in-scope write
75
+ * would be a cross-DO write inside a scope transaction — two serialization domains,
76
+ * no coordinator, and an orphaned membership if the scope transaction rolls back
77
+ * after the directory write lands.
78
+ *
79
+ * The connector has no such hazard: the module's `ctx.emit` commits WITH its domain
80
+ * write, so a rollback leaves no event and nothing to effect. The executor then runs
81
+ * at-least-once from the outbox — so handlers must be idempotent, exactly as
82
+ * consumers must.
83
+ *
84
+ * It receives `HostAdmin`, not `ctx`: it acts with platform authority, which is
85
+ * precisely what module code must never hold. Admin writes it makes are stamped with
86
+ * the causing event's id (`causedBy`), so the split trail joins.
87
+ */
88
+ export type ExecutorHandler = (admin: HostAdmin, event: DomainEvent) => void | Promise<void>;
68
89
  /**
69
90
  * A named, manifest-wired pre-condition on an operation (K-17; engine-protocol
70
91
  * §6, open question 11). One module CONTRIBUTES a predicate under a name; a
@@ -136,8 +157,44 @@ export interface HostAdmin {
136
157
  assignRole(actor: PlatformActorId, assignment: RoleAssignment): Promise<void>;
137
158
  grant(actor: PlatformActorId, grant: CapabilityGrant): Promise<void>;
138
159
  /** Grant to an organization (portal customers); members reach it via membership tuples. */
139
- grantToOrg(actor: PlatformActorId, orgId: string, permission: PermissionKey, node: Node, entity?: EntityRef): Promise<void>;
140
- addMember(actor: PlatformActorId, tenantId: TenantId, principal: PrincipalId, orgId: string): Promise<void>;
160
+ grantToOrg(actor: PlatformActorId, orgId: OrgId, permission: PermissionKey, node: Node, entity?: EntityRef): Promise<void>;
161
+ addMember(actor: PlatformActorId, tenantId: TenantId, principal: PrincipalId, orgId: OrgId): Promise<void>;
162
+ /**
163
+ * Revoke a membership (K-21). **Tombstones, never deletes**: the tuple keeps its
164
+ * row, gains a `revokedAt`, and the permission walk skips it. Deletion would
165
+ * destroy the audit property K-4 rests on — a tuple that once granted access is
166
+ * evidence of why an access was allowed — and D-32's operated compliance product
167
+ * has to produce exactly that evidence.
168
+ *
169
+ * Idempotent: revoking an already-revoked or never-existing membership is a
170
+ * no-op, and a no-op is not audited. Re-adding via `addMember` clears the
171
+ * tombstone (they are a member again); the add/revoke history lives in the admin
172
+ * log, which is append-only.
173
+ */
174
+ removeMember(actor: PlatformActorId, tenantId: TenantId, principal: PrincipalId, orgId: OrgId): Promise<void>;
175
+ /**
176
+ * The members of an org. Live members only unless `includeRevoked` — the
177
+ * revoked rows are the evidence view, not the roster.
178
+ *
179
+ * Answering "who has access to this org" at all is new: membership was
180
+ * write-only before this (#34).
181
+ */
182
+ listMembers(tenantId: TenantId, orgId: OrgId, options?: {
183
+ includeRevoked?: boolean;
184
+ }): Promise<OrgMembership[]>;
185
+ /**
186
+ * Register an org. Idempotent on the id — re-creating is a no-op, not an error
187
+ * (as `createTenant`). Slugs are unique within the tenant; a collision from a
188
+ * DIFFERENT id fails closed rather than silently doing nothing.
189
+ *
190
+ * Membership and `grantToOrg` both refuse an org that does not exist here. That
191
+ * refusal is the point of the record: before it, `addMember(…, 'acme')` and
192
+ * `addMember(…, 'Acme')` silently addressed two different orgs and a typo in a
193
+ * grant reached a phantom nothing would ever resolve to.
194
+ */
195
+ createOrg(actor: PlatformActorId, input: CreateOrgInput): Promise<void>;
196
+ listOrgs(tenantId: TenantId): Promise<Org[]>;
197
+ getOrg(tenantId: TenantId, orgId: OrgId): Promise<Org | undefined>;
141
198
  /**
142
199
  * Persist a tenant. Idempotent on the id — re-creating an existing tenant is a
143
200
  * no-op, not an error (control-plane.md §4.1). `status` starts `active` and
@@ -184,10 +241,48 @@ export interface HostAdmin {
184
241
  revokeEntitlement(actor: PlatformActorId, tenantId: TenantId, entitlementKey: string): Promise<void>;
185
242
  /** The tenant's held SKU flags (control-plane.md §5 meter 2). */
186
243
  listEntitlements(tenantId: TenantId): Promise<string[]>;
187
- /** Bind an external identity to a principal + home node. Idempotent on (provider, externalId); audited. */
244
+ /**
245
+ * Bind an external identity to a principal + home node. Audited.
246
+ *
247
+ * Keyed `(tenantId, provider, externalId)` — **not** `(provider, externalId)`.
248
+ * kernel-design §4.3: with one auth pool per white-label tenant, an external subject
249
+ * id is unique only *within* its pool, so a globally-keyed mapping is a cross-tenant
250
+ * identity bleed. It is also what lets one staff login belong to several tenants: one
251
+ * external id, one row per tenant.
252
+ *
253
+ * Idempotent when the key already maps to the SAME principal. A key already bound to a
254
+ * DIFFERENT principal **throws** — it means two subjects collided, and silently
255
+ * ignoring it would resolve the second person as the first.
256
+ */
188
257
  linkIdentity(actor: PlatformActorId, input: IdentityLink): Promise<void>;
189
- /** Resolve an external identity to its principal + home node — the auth adapter's read path. */
190
- resolveIdentity(provider: string, externalId: string): Promise<ResolvedIdentity | undefined>;
258
+ /**
259
+ * Register an identity pool and its topology (K-23). A provider must be registered
260
+ * before it may link: an unregistered pool has not said whether the same
261
+ * `externalId` in two tenants is one human or two, and the kernel will not guess.
262
+ * Idempotent on an identical registration; a conflicting re-registration throws,
263
+ * since changing a live pool's topology silently reinterprets every row it owns.
264
+ */
265
+ registerIdentityPool(actor: PlatformActorId, pool: IdentityPool): Promise<void>;
266
+ getIdentityPool(provider: string): Promise<IdentityPool | undefined>;
267
+ /**
268
+ * Which tenants this login exists in — the cross-tenant question, kept distinct
269
+ * from resolution because they have different safety conditions.
270
+ *
271
+ * **Central pools only.** On a tenant-bound pool the same `externalId` in another
272
+ * tenant is a different person, so enumerating would hand one person another's
273
+ * tenant list; this throws there rather than returning the single obvious answer,
274
+ * because asking at all is a category error the caller should see.
275
+ */
276
+ listIdentityTenants(provider: string, externalId: string): Promise<TenantId[]>;
277
+ /**
278
+ * Resolve an external identity within a tenant — the auth adapter's read path.
279
+ *
280
+ * The tenant is an INPUT: the caller knows which pool the credential came from (its
281
+ * hostname, or the org claim on a pool-scoped token). It is not derived from the
282
+ * identity, because across per-tenant pools the same `externalId` legitimately names
283
+ * different people.
284
+ */
285
+ resolveIdentity(tenantId: TenantId, provider: string, externalId: string): Promise<ResolvedIdentity | undefined>;
191
286
  /**
192
287
  * The append-only admin audit trail, oldest first by default (ULID order is
193
288
  * chronological). Read path for the console history and the permission-diff
@@ -288,6 +383,19 @@ export interface ScopeHost {
288
383
  readonly admin: HostAdmin;
289
384
  /** Register a module: validates the manifest, applies migrations lazily per scope. */
290
385
  registerModule(registration: ModuleRegistration): void;
386
+ /**
387
+ * Register an executor for an event type (K-22 §4.2). Host code, not module code:
388
+ * `id` names the delivery target in the kernel's at-least-once journal, the same
389
+ * way a module id does for a consumer, so an executor is redelivered until it
390
+ * succeeds and never runs twice for one event once it has.
391
+ *
392
+ * Executors are dispatched **inline after commit**, with the outbox as the
393
+ * durability and retry backstop. The contract stays eventually consistent — that
394
+ * is what makes it correct under crash — but the common case completes inside the
395
+ * originating request, so "requested but not yet effected" is a rare-case fallback
396
+ * rather than the normal experience.
397
+ */
398
+ registerExecutor(id: string, eventType: string, handler: ExecutorHandler): void;
291
399
  /** Bare operation registration (tests, glue). Names are module-namespaced: 'workorder/create'. */
292
400
  defineOperation<I, O>(name: string, handler: OperationHandler<I, O>): void;
293
401
  close(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"scope-host.d.ts","sourceRoot":"","sources":["../src/scope-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,IAAI,EACJ,aAAa,EACb,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,KAAK,EACL,OAAO,EACP,WAAW,EACX,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,UAAU,EACV,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;GAcG;AAEH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC;AAEpE,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC;IACpF,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,QAAQ,EAAE,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACtE;AAED,iGAAiG;AACjG,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC,QAAQ,CAAC,GAAG,EAAE,SAAS,CA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- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Substrat kernel contracts and services — pure TypeScript, no platform imports (D-14)",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
@@ -22,7 +22,7 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@substrat-run/contracts": "^0.4.0"
25
+ "@substrat-run/contracts": "^0.6.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "typescript": "^5.6.0"