@substrat-run/kernel 0.5.0 → 0.7.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,7 +1,10 @@
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 { AccessLogFilter, 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';
5
5
  export type { PermissionChecker } from './permission-checker.js';
6
6
  export { ulid } from './ulid.js';
7
+ export { readRoutedNode, RouterAssertionError } from './routed-node.js';
8
+ export type { RoutedNode, HeaderReader } from './routed-node.js';
9
+ export { assertPlatformCall, PlatformCallError, PLATFORM_SECRET_HEADER, } from './platform-call.js';
7
10
  //# sourceMappingURL=index.d.ts.map
@@ -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,eAAe,EACf,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;AACjC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,6 @@
1
1
  export { resolveScopeRecord } from './scope-record.js';
2
2
  export { assertAllowed, denyAllChecker, PermissionDenied, UNSAFE_allowAllChecker, } from './permission-checker.js';
3
3
  export { ulid } from './ulid.js';
4
+ export { readRoutedNode, RouterAssertionError } from './routed-node.js';
5
+ export { assertPlatformCall, PlatformCallError, PLATFORM_SECRET_HEADER, } from './platform-call.js';
4
6
  //# sourceMappingURL=index.js.map
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":"AAmBA,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;AACjC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExE,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { HeaderReader } from './routed-node.js';
2
+ /**
3
+ * Authenticating a call FROM the platform TO a vertical (K-31).
4
+ *
5
+ * Provisioning is control-plane-driven: the platform decides an instance should
6
+ * exist and tells the vertical to create it, because only the vertical can create a
7
+ * usable scope DO. This is the vertical's side of that call.
8
+ *
9
+ * It lives in the kernel for the same reason `readRoutedNode` does — five verticals
10
+ * each re-deriving how to trust a header is five chances to get it wrong, and the
11
+ * one that gets it wrong is not obviously broken.
12
+ *
13
+ * Note the direction. `readRoutedNode` answers "which tenant is this request for",
14
+ * and a request with no assertion is legitimate (a standalone deploy). This answers
15
+ * "is the platform itself calling", and there is no legitimate unauthenticated case:
16
+ * an open provisioning endpoint lets a stranger mint tenants inside the vertical.
17
+ * So this one **fails closed with no configuration at all**.
18
+ */
19
+ /** Thrown when a call does not prove it came from the platform. */
20
+ export declare class PlatformCallError extends Error {
21
+ }
22
+ /** Constant-time compare, so a wrong secret leaks nothing through timing. */
23
+ export declare function secretMatches(presented: string | null, expected: string): boolean;
24
+ /** The header the platform presents. */
25
+ export declare const PLATFORM_SECRET_HEADER = "x-substrat-platform";
26
+ /**
27
+ * Throw unless this request proves it came from the platform.
28
+ *
29
+ * **An unset secret is a failure, not a bypass.** That is the opposite of how the
30
+ * router secret behaves, and deliberately so: there, an unset secret means "no router
31
+ * is configured", which a standalone deploy legitimately wants. Here it would mean
32
+ * "anyone may provision", which nothing legitimately wants. A template copied without
33
+ * the secret configured must refuse to provision rather than provision for strangers.
34
+ */
35
+ export declare function assertPlatformCall(headers: HeaderReader, options?: {
36
+ expectedSecret?: string;
37
+ }): void;
38
+ //# sourceMappingURL=platform-call.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-call.d.ts","sourceRoot":"","sources":["../src/platform-call.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;;;;;;;;;;;;GAgBG;AAEH,mEAAmE;AACnE,qBAAa,iBAAkB,SAAQ,KAAK;CAAG;AAE/C,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAOjF;AAED,wCAAwC;AACxC,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAE5D;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,YAAY,EACrB,OAAO,GAAE;IAAE,cAAc,CAAC,EAAE,MAAM,CAAA;CAAO,GACxC,IAAI,CAQN"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Authenticating a call FROM the platform TO a vertical (K-31).
3
+ *
4
+ * Provisioning is control-plane-driven: the platform decides an instance should
5
+ * exist and tells the vertical to create it, because only the vertical can create a
6
+ * usable scope DO. This is the vertical's side of that call.
7
+ *
8
+ * It lives in the kernel for the same reason `readRoutedNode` does — five verticals
9
+ * each re-deriving how to trust a header is five chances to get it wrong, and the
10
+ * one that gets it wrong is not obviously broken.
11
+ *
12
+ * Note the direction. `readRoutedNode` answers "which tenant is this request for",
13
+ * and a request with no assertion is legitimate (a standalone deploy). This answers
14
+ * "is the platform itself calling", and there is no legitimate unauthenticated case:
15
+ * an open provisioning endpoint lets a stranger mint tenants inside the vertical.
16
+ * So this one **fails closed with no configuration at all**.
17
+ */
18
+ /** Thrown when a call does not prove it came from the platform. */
19
+ export class PlatformCallError extends Error {
20
+ }
21
+ /** Constant-time compare, so a wrong secret leaks nothing through timing. */
22
+ export function secretMatches(presented, expected) {
23
+ if (!presented || presented.length !== expected.length)
24
+ return false;
25
+ let diff = 0;
26
+ for (let i = 0; i < expected.length; i++) {
27
+ diff |= presented.charCodeAt(i) ^ expected.charCodeAt(i);
28
+ }
29
+ return diff === 0;
30
+ }
31
+ /** The header the platform presents. */
32
+ export const PLATFORM_SECRET_HEADER = 'x-substrat-platform';
33
+ /**
34
+ * Throw unless this request proves it came from the platform.
35
+ *
36
+ * **An unset secret is a failure, not a bypass.** That is the opposite of how the
37
+ * router secret behaves, and deliberately so: there, an unset secret means "no router
38
+ * is configured", which a standalone deploy legitimately wants. Here it would mean
39
+ * "anyone may provision", which nothing legitimately wants. A template copied without
40
+ * the secret configured must refuse to provision rather than provision for strangers.
41
+ */
42
+ export function assertPlatformCall(headers, options = {}) {
43
+ const { expectedSecret } = options;
44
+ if (!expectedSecret) {
45
+ throw new PlatformCallError('platform calls are not configured on this deployment');
46
+ }
47
+ if (!secretMatches(headers.get(PLATFORM_SECRET_HEADER), expectedSecret)) {
48
+ throw new PlatformCallError('not a platform call');
49
+ }
50
+ }
51
+ //# sourceMappingURL=platform-call.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-call.js","sourceRoot":"","sources":["../src/platform-call.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AAEH,mEAAmE;AACnE,MAAM,OAAO,iBAAkB,SAAQ,KAAK;CAAG;AAE/C,6EAA6E;AAC7E,MAAM,UAAU,aAAa,CAAC,SAAwB,EAAE,QAAgB;IACtE,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACrE,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACzC,IAAI,IAAI,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,IAAI,KAAK,CAAC,CAAC;AACpB,CAAC;AAED,wCAAwC;AACxC,MAAM,CAAC,MAAM,sBAAsB,GAAG,qBAAqB,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAqB,EACrB,UAAuC,EAAE;IAEzC,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC;IACnC,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,MAAM,IAAI,iBAAiB,CAAC,sDAAsD,CAAC,CAAC;IACtF,CAAC;IACD,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,EAAE,cAAc,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,iBAAiB,CAAC,qBAAqB,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
@@ -0,0 +1,51 @@
1
+ import type { ScopeId, TenantId } from '@substrat-run/contracts';
2
+ /**
3
+ * Reading the node the router asserted (K-26).
4
+ *
5
+ * The router resolves `hostname → (tenant, scope, surface)` and forwards over a
6
+ * service binding with that resolution in headers. This is the vertical's side of
7
+ * that contract, in the kernel because every vertical needs it and none of them
8
+ * should be re-deriving how to trust it.
9
+ *
10
+ * Web-standard only and structurally typed: the base tsconfig is `ES2023` with no
11
+ * DOM lib, deliberately, so no package assumes a browser. Taking the one method we
12
+ * need rather than the whole `Headers` type keeps that true and costs nothing — a
13
+ * real `Headers` satisfies it, and so does a plain object in a test.
14
+ */
15
+ /** The one method this needs from a `Headers`. A real `Headers` satisfies it. */
16
+ export interface HeaderReader {
17
+ get(name: string): string | null;
18
+ }
19
+ export interface RoutedNode {
20
+ tenantId: TenantId;
21
+ scopeId: ScopeId;
22
+ /** Which app answers: `app`, `storefront`, `back-office`, … Vertical vocabulary. */
23
+ surface: string;
24
+ verticalSlug: string | null;
25
+ }
26
+ /** Thrown when headers are present but not trustworthy. Never means "no router". */
27
+ export declare class RouterAssertionError extends Error {
28
+ }
29
+ /**
30
+ * The `(tenant, scope)` this request is for, or `null` when no router fronted it.
31
+ *
32
+ * Three outcomes, kept distinct on purpose:
33
+ *
34
+ * - **null** — no assertion at all. The caller decides: a single-tenant standalone
35
+ * deploy substitutes its own node, anything else refuses.
36
+ * - **throws** — headers are present but wrong: a bad or missing secret, or ids
37
+ * that are not ULIDs. Present-but-wrong is a misconfiguration or an attack, and
38
+ * collapsing it into `null` would let either one fall through to whatever the
39
+ * caller does for "unrouted".
40
+ * - **a node** — trustworthy, and the tenant whose data this request may touch.
41
+ *
42
+ * `expectedSecret` is what makes the headers trustworthy in code. K-26's real
43
+ * boundary is that vertical workers have no public route, so the router is the only
44
+ * possible source — but that is a deployment fact, and `workers.dev` is on by
45
+ * default. When the secret is configured, a request that did not come from the
46
+ * router cannot assert a tenant no matter how the routes are configured.
47
+ */
48
+ export declare function readRoutedNode(headers: HeaderReader, options?: {
49
+ expectedSecret?: string;
50
+ }): RoutedNode | null;
51
+ //# sourceMappingURL=routed-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routed-node.d.ts","sourceRoot":"","sources":["../src/routed-node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEjE;;;;;;;;;;;;GAYG;AAEH,iFAAiF;AACjF,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,oFAAoF;IACpF,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,oFAAoF;AACpF,qBAAa,oBAAqB,SAAQ,KAAK;CAAG;AAIlD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,YAAY,EACrB,OAAO,GAAE;IAAE,cAAc,CAAC,EAAE,MAAM,CAAA;CAAO,GACxC,UAAU,GAAG,IAAI,CAyBnB"}
@@ -0,0 +1,49 @@
1
+ import { scopeId as scopeIdSchema, tenantId as tenantIdSchema } from '@substrat-run/contracts';
2
+ import { secretMatches } from './platform-call.js';
3
+ /** Thrown when headers are present but not trustworthy. Never means "no router". */
4
+ export class RouterAssertionError extends Error {
5
+ }
6
+ /**
7
+ * The `(tenant, scope)` this request is for, or `null` when no router fronted it.
8
+ *
9
+ * Three outcomes, kept distinct on purpose:
10
+ *
11
+ * - **null** — no assertion at all. The caller decides: a single-tenant standalone
12
+ * deploy substitutes its own node, anything else refuses.
13
+ * - **throws** — headers are present but wrong: a bad or missing secret, or ids
14
+ * that are not ULIDs. Present-but-wrong is a misconfiguration or an attack, and
15
+ * collapsing it into `null` would let either one fall through to whatever the
16
+ * caller does for "unrouted".
17
+ * - **a node** — trustworthy, and the tenant whose data this request may touch.
18
+ *
19
+ * `expectedSecret` is what makes the headers trustworthy in code. K-26's real
20
+ * boundary is that vertical workers have no public route, so the router is the only
21
+ * possible source — but that is a deployment fact, and `workers.dev` is on by
22
+ * default. When the secret is configured, a request that did not come from the
23
+ * router cannot assert a tenant no matter how the routes are configured.
24
+ */
25
+ export function readRoutedNode(headers, options = {}) {
26
+ const rawTenant = headers.get('x-substrat-tenant');
27
+ const rawScope = headers.get('x-substrat-scope');
28
+ if (!rawTenant && !rawScope)
29
+ return null;
30
+ const { expectedSecret } = options;
31
+ if (expectedSecret && !secretMatches(headers.get('x-substrat-router'), expectedSecret)) {
32
+ throw new RouterAssertionError('router assertion is not signed by a known router');
33
+ }
34
+ if (!rawTenant || !rawScope) {
35
+ throw new RouterAssertionError('router assertion is incomplete');
36
+ }
37
+ const tenant = tenantIdSchema.safeParse(rawTenant);
38
+ const scope = scopeIdSchema.safeParse(rawScope);
39
+ if (!tenant.success || !scope.success) {
40
+ throw new RouterAssertionError('router assertion carries a malformed id');
41
+ }
42
+ return {
43
+ tenantId: tenant.data,
44
+ scopeId: scope.data,
45
+ surface: headers.get('x-substrat-surface') ?? 'app',
46
+ verticalSlug: headers.get('x-substrat-vertical'),
47
+ };
48
+ }
49
+ //# sourceMappingURL=routed-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routed-node.js","sourceRoot":"","sources":["../src/routed-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AA8BnD,oFAAoF;AACpF,MAAM,OAAO,oBAAqB,SAAQ,KAAK;CAAG;AAIlD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAqB,EACrB,UAAuC,EAAE;IAEzC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACnD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IACjD,IAAI,CAAC,SAAS,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAEzC,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC;IACnC,IAAI,cAAc,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,cAAc,CAAC,EAAE,CAAC;QACvF,MAAM,IAAI,oBAAoB,CAAC,kDAAkD,CAAC,CAAC;IACrF,CAAC;IACD,IAAI,CAAC,SAAS,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC5B,MAAM,IAAI,oBAAoB,CAAC,gCAAgC,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACnD,MAAM,KAAK,GAAG,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAChD,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACtC,MAAM,IAAI,oBAAoB,CAAC,yCAAyC,CAAC,CAAC;IAC5E,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,IAAI;QACrB,OAAO,EAAE,KAAK,CAAC,IAAI;QACnB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,IAAI,KAAK;QACnD,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;KACjD,CAAC;AACJ,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, AccessLogEntry, BindHostnameInput, AdminLogEntry, CapabilityGrant, CreateTenantInput, Decision, DomainEvent, DomainEventInput, EntityRef, IdentityLink, IdentityPool, Jurisdiction, ModuleManifest, CreateOrgInput, Node, Org, OrgId, OrgMembership, PermissionKey, PlatformActorId, ChannelName, HostnameBinding, HostnameStatus, PromotionAcknowledgement, PublishVersionInput, RegisterVerticalInput, RouteTarget, PrincipalId, ResolvedIdentity, RoleAssignment, RoleDefinition, Scope, ScopeId, ScopeStatus, StorageShape, Tenant, TenantId, TenantRole, Vertical, VerticalChannel, VerticalVersion, 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
@@ -132,12 +153,119 @@ export interface HostAdmin {
132
153
  * registry, so this is a read. A grant is a tuple in the scope's own database
133
154
  * and needs §5.4's admin-query RPC — the two are not the same size of problem.
134
155
  */
135
- listRoles(filter?: RoleFilter): Promise<TenantRole[]>;
156
+ listRoles(actor: PlatformActorId, filter?: RoleFilter): Promise<TenantRole[]>;
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(actor: PlatformActorId, 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(actor: PlatformActorId, tenantId: TenantId): Promise<Org[]>;
197
+ getOrg(actor: PlatformActorId, tenantId: TenantId, orgId: OrgId): Promise<Org | undefined>;
198
+ /**
199
+ * Register a vertical. Idempotent on the slug; a conflicting re-registration
200
+ * (different source) throws rather than silently rebinding what a scope runs.
201
+ */
202
+ registerVertical(actor: PlatformActorId, input: RegisterVerticalInput): Promise<void>;
203
+ listVerticals(actor: PlatformActorId): Promise<Vertical[]>;
204
+ /**
205
+ * Publish a version. It lands **pending** — a push is not a deploy.
206
+ *
207
+ * The digests are what promotion compares. `boundary-lint` and the migration and
208
+ * permission diffs are the admission gates, and binding a scope is a separate step
209
+ * (`bindScopeVersion`), so the two human checkpoints fire where the blast radius is
210
+ * rather than where the typing was.
211
+ */
212
+ publishVersion(actor: PlatformActorId, input: PublishVersionInput): Promise<void>;
213
+ listVersions(actor: PlatformActorId, verticalSlug: string): Promise<VerticalVersion[]>;
214
+ /** Admit a pending version — the gates passed. Idempotent on an already-admitted one. */
215
+ admitVersion(actor: PlatformActorId, versionId: string): Promise<void>;
216
+ /** Reject a pending version, with the reason. Rejected is terminal: publish a new one. */
217
+ rejectVersion(actor: PlatformActorId, versionId: string, note: string): Promise<void>;
218
+ /**
219
+ * Promote a version to a channel (#31 step 2) — the moment a change reaches
220
+ * anyone, and therefore where §4's two human checkpoints belong.
221
+ *
222
+ * **Refuses when a digest differs and the change is not acknowledged.** The
223
+ * migration and permission diffs are a merge-time convention today: CI renders
224
+ * them and a human is expected to look, but nothing ties that looking to the
225
+ * moment of exposure. Here it is tied — and the acknowledgement is recorded, so
226
+ * "someone reviewed it" becomes evidence rather than a claim.
227
+ *
228
+ * Only admitted versions may be promoted, for the same reason they are the only
229
+ * ones bindable.
230
+ */
231
+ promoteVersion(actor: PlatformActorId, verticalSlug: string, channel: ChannelName, versionId: string, acknowledge?: PromotionAcknowledgement): Promise<void>;
232
+ listChannels(actor: PlatformActorId, verticalSlug: string): Promise<VerticalChannel[]>;
233
+ /**
234
+ * Point a scope at a version.
235
+ *
236
+ * **Refuses anything not admitted.** That refusal is the registry's reason to
237
+ * exist: without it "push lands pending" is a convention, and a convention is what
238
+ * D-30's lockstep-upgrade argument says we cannot afford to rely on.
239
+ */
240
+ bindScopeVersion(actor: PlatformActorId, tenantId: TenantId, scopeId: ScopeId, versionId: string): Promise<void>;
241
+ /**
242
+ * Bind a hostname to a scope's surface. Lands `pending` — a custom domain is DNS
243
+ * validation and certificate issuance, not a string somebody sets, so the states
244
+ * it passes through are §4.2's business.
245
+ *
246
+ * Exactly one hostname per (scope, surface) may be canonical; binding a second
247
+ * canonical demotes the first, because "which one do certs and redirects use" has
248
+ * to have one answer.
249
+ */
250
+ bindHostname(actor: PlatformActorId, input: BindHostnameInput): Promise<void>;
251
+ setHostnameStatus(actor: PlatformActorId, hostname: string, status: HostnameStatus, note?: string): Promise<void>;
252
+ listHostnames(actor: PlatformActorId, filter?: {
253
+ tenantId?: TenantId;
254
+ scopeId?: ScopeId;
255
+ }): Promise<HostnameBinding[]>;
256
+ /**
257
+ * Resolve a hostname for the router — the per-request read path.
258
+ *
259
+ * Takes NO actor and is not logged, for the same reason `resolveIdentity` does
260
+ * not: this runs on every request, by a machine, before any staff member is
261
+ * involved. K-24's access log records who *read the directory*, and a router
262
+ * dispatching traffic is not that.
263
+ *
264
+ * Returns only `active` bindings. It does **not** re-check tenant or scope
265
+ * suspension: `getScope` already fails closed there (§7), and a second
266
+ * enforcement point is a second thing that can disagree.
267
+ */
268
+ resolveHostname(hostname: string): Promise<RouteTarget | undefined>;
141
269
  /**
142
270
  * Persist a tenant. Idempotent on the id — re-creating an existing tenant is a
143
271
  * no-op, not an error (control-plane.md §4.1). `status` starts `active` and
@@ -152,10 +280,10 @@ export interface HostAdmin {
152
280
  */
153
281
  setTenantStatus(actor: PlatformActorId, tenantId: TenantId, status: TenantStatus): Promise<void>;
154
282
  /** The tenant registry — the directory's inventory (control-plane.md §4.5 console item 1). */
155
- listTenants(): Promise<Tenant[]>;
156
- getTenant(tenantId: TenantId): Promise<Tenant | undefined>;
283
+ listTenants(actor: PlatformActorId): Promise<Tenant[]>;
284
+ getTenant(actor: PlatformActorId, tenantId: TenantId): Promise<Tenant | undefined>;
157
285
  /** The scope inventory. Ordered by scope_id (ULID = chronological). */
158
- listScopes(filter?: ScopeFilter): Promise<Scope[]>;
286
+ listScopes(actor: PlatformActorId, filter?: ScopeFilter): Promise<Scope[]>;
159
287
  /**
160
288
  * One scope's directory record. Cross-checks the (tenantId, scopeId) pair and
161
289
  * returns undefined on a mismatch rather than another tenant's scope (K-3) —
@@ -165,7 +293,7 @@ export interface HostAdmin {
165
293
  * principal and grants no read of the record. This returns the record and
166
294
  * grants no execution.
167
295
  */
168
- getScopeRecord(tenantId: TenantId, scopeId: ScopeId): Promise<Scope | undefined>;
296
+ getScopeRecord(actor: PlatformActorId, tenantId: TenantId, scopeId: ScopeId): Promise<Scope | undefined>;
169
297
  /** active → suspended. Reversible containment (incident, dispute). */
170
298
  suspendScope(actor: PlatformActorId, tenantId: TenantId, scopeId: ScopeId): Promise<void>;
171
299
  /** suspended → active. */
@@ -183,11 +311,49 @@ export interface HostAdmin {
183
311
  /** Turn it off. A tenant's scopes lose access to that module's operations. */
184
312
  revokeEntitlement(actor: PlatformActorId, tenantId: TenantId, entitlementKey: string): Promise<void>;
185
313
  /** The tenant's held SKU flags (control-plane.md §5 meter 2). */
186
- listEntitlements(tenantId: TenantId): Promise<string[]>;
187
- /** Bind an external identity to a principal + home node. Idempotent on (provider, externalId); audited. */
314
+ listEntitlements(actor: PlatformActorId, tenantId: TenantId): Promise<string[]>;
315
+ /**
316
+ * Bind an external identity to a principal + home node. Audited.
317
+ *
318
+ * Keyed `(tenantId, provider, externalId)` — **not** `(provider, externalId)`.
319
+ * kernel-design §4.3: with one auth pool per white-label tenant, an external subject
320
+ * id is unique only *within* its pool, so a globally-keyed mapping is a cross-tenant
321
+ * identity bleed. It is also what lets one staff login belong to several tenants: one
322
+ * external id, one row per tenant.
323
+ *
324
+ * Idempotent when the key already maps to the SAME principal. A key already bound to a
325
+ * DIFFERENT principal **throws** — it means two subjects collided, and silently
326
+ * ignoring it would resolve the second person as the first.
327
+ */
188
328
  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>;
329
+ /**
330
+ * Register an identity pool and its topology (K-23). A provider must be registered
331
+ * before it may link: an unregistered pool has not said whether the same
332
+ * `externalId` in two tenants is one human or two, and the kernel will not guess.
333
+ * Idempotent on an identical registration; a conflicting re-registration throws,
334
+ * since changing a live pool's topology silently reinterprets every row it owns.
335
+ */
336
+ registerIdentityPool(actor: PlatformActorId, pool: IdentityPool): Promise<void>;
337
+ getIdentityPool(actor: PlatformActorId, provider: string): Promise<IdentityPool | undefined>;
338
+ /**
339
+ * Which tenants this login exists in — the cross-tenant question, kept distinct
340
+ * from resolution because they have different safety conditions.
341
+ *
342
+ * **Central pools only.** On a tenant-bound pool the same `externalId` in another
343
+ * tenant is a different person, so enumerating would hand one person another's
344
+ * tenant list; this throws there rather than returning the single obvious answer,
345
+ * because asking at all is a category error the caller should see.
346
+ */
347
+ listIdentityTenants(actor: PlatformActorId, provider: string, externalId: string): Promise<TenantId[]>;
348
+ /**
349
+ * Resolve an external identity within a tenant — the auth adapter's read path.
350
+ *
351
+ * The tenant is an INPUT: the caller knows which pool the credential came from (its
352
+ * hostname, or the org claim on a pool-scoped token). It is not derived from the
353
+ * identity, because across per-tenant pools the same `externalId` legitimately names
354
+ * different people.
355
+ */
356
+ resolveIdentity(tenantId: TenantId, provider: string, externalId: string): Promise<ResolvedIdentity | undefined>;
191
357
  /**
192
358
  * The append-only admin audit trail, oldest first by default (ULID order is
193
359
  * chronological). Read path for the console history and the permission-diff
@@ -195,7 +361,22 @@ export interface HostAdmin {
195
361
  * `before`/`after`: a redefined role captures its old and new shape there, and
196
362
  * that diff IS the checkpoint.
197
363
  */
198
- auditLog(filter?: AuditLogFilter): Promise<AdminLogEntry[]>;
364
+ auditLog(actor: PlatformActorId, filter?: AuditLogFilter): Promise<AdminLogEntry[]>;
365
+ /**
366
+ * The staff access log (K-24) — who READ the directory, when, and how much came
367
+ * back. Reading it is itself recorded: who examined the record of who looked is
368
+ * the question an incident asks second.
369
+ */
370
+ accessLog(actor: PlatformActorId, filter?: AccessLogFilter): Promise<AccessLogEntry[]>;
371
+ /**
372
+ * Prune access-log rows already shipped to Tier 2, oldest first, up to `limit`.
373
+ *
374
+ * **Only drained rows.** Pruning on age alone would destroy evidence while calling
375
+ * itself a retention policy — the failure K-21 rejected for tuples, one layer up.
376
+ * Nothing drains yet, so today this prunes nothing and the log grows: a stated
377
+ * limitation, not a policy, and the reason `drainedAt` ships before the sink.
378
+ */
379
+ pruneAccessLog(actor: PlatformActorId, limit: number): Promise<number>;
199
380
  }
200
381
  export interface ProvisionScopeInput {
201
382
  tenantId: TenantId;
@@ -242,6 +423,12 @@ export interface ScopeFilter {
242
423
  * conjunctive AND; omitting all of them reads the whole log, which is why `limit`
243
424
  * exists — the table is append-only and only grows.
244
425
  */
426
+ export interface AccessLogFilter {
427
+ actor?: PlatformActorId;
428
+ tenantId?: TenantId;
429
+ method?: string;
430
+ limit?: number;
431
+ }
245
432
  export interface AuditLogFilter {
246
433
  tenantId?: TenantId;
247
434
  scopeId?: ScopeId;
@@ -288,6 +475,19 @@ export interface ScopeHost {
288
475
  readonly admin: HostAdmin;
289
476
  /** Register a module: validates the manifest, applies migrations lazily per scope. */
290
477
  registerModule(registration: ModuleRegistration): void;
478
+ /**
479
+ * Register an executor for an event type (K-22 §4.2). Host code, not module code:
480
+ * `id` names the delivery target in the kernel's at-least-once journal, the same
481
+ * way a module id does for a consumer, so an executor is redelivered until it
482
+ * succeeds and never runs twice for one event once it has.
483
+ *
484
+ * Executors are dispatched **inline after commit**, with the outbox as the
485
+ * durability and retry backstop. The contract stays eventually consistent — that
486
+ * is what makes it correct under crash — but the common case completes inside the
487
+ * originating request, so "requested but not yet effected" is a rare-case fallback
488
+ * rather than the normal experience.
489
+ */
490
+ registerExecutor(id: string, eventType: string, handler: ExecutorHandler): void;
291
491
  /** Bare operation registration (tests, glue). Names are module-namespaced: 'workorder/create'. */
292
492
  defineOperation<I, O>(name: string, handler: OperationHandler<I, O>): void;
293
493
  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,MAA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,CAAC,IAAI,CAAC,CAAC;IAElF,wEAAwE;IACxE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAE1B,sFAAsF;IACtF,cAAc,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAEvD;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAEhF,kGAAkG;IAClG,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;IAE3E,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@substrat-run/kernel",
3
- "version": "0.5.0",
3
+ "version": "0.7.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,16 +22,18 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@substrat-run/contracts": "^0.5.0"
25
+ "@substrat-run/contracts": "^0.7.0"
26
26
  },
27
27
  "devDependencies": {
28
- "typescript": "^5.6.0"
28
+ "typescript": "^5.6.0",
29
+ "vitest": "^3.0.0"
29
30
  },
30
31
  "publishConfig": {
31
32
  "access": "public"
32
33
  },
33
34
  "scripts": {
34
35
  "build": "tsc -p tsconfig.json",
35
- "typecheck": "tsc -p tsconfig.json --noEmit"
36
+ "typecheck": "tsc -p tsconfig.json --noEmit",
37
+ "test": "vitest run"
36
38
  }
37
39
  }