@substrat-run/adapter-sqlite 0.138.0 → 0.140.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.
@@ -17,7 +17,7 @@
17
17
  * process the harness IS the whole trust domain — the same stance as `@substrat-run/dev-issuer`'s
18
18
  * `/dev/token`. What the broker keeps identical to production is everything else: the caller must
19
19
  * be a live, primary instance of its vertical in the tenant, the target is resolved by the
20
- * kernel's one rule (`resolveVerticalInstance`: same tenant, primary, active, exactly one), and the
20
+ * kernel's one rule (`resolvePeerInstanceFrom`: same tenant, primary, active, bound or exactly one), and the
21
21
  * call goes through the target's peer door (`getVerticalScope`), whose admission and checks are
22
22
  * the ones a hosted call meets. On the hosted path the router plays this part, from facts the
23
23
  * calling deployment cannot influence.
@@ -44,13 +44,18 @@ export interface LocalVerticalClient {
44
44
  * Invoke `operation` on the instance of vertical `target` in the caller's tenant, as the
45
45
  * caller. Throws `forbidden` when the caller is not a live primary instance or the target's
46
46
  * door refuses it, `not_found` when the target is not installed in the tenant, `conflict`
47
- * when the tenant runs more than one instance of it.
47
+ * when the tenant runs more than one instance without a choice, or a choice is unavailable.
48
48
  */
49
49
  invoke<O = unknown>(target: string, operation: string, input?: unknown, options?: InvokeOptions): Promise<O>;
50
50
  }
51
51
  export interface LocalVerticalBroker {
52
52
  /** A client that speaks as `from` — the harness's own scope, and only that. */
53
53
  clientFor(from: LocalVerticalCallerRef): LocalVerticalClient;
54
+ /**
55
+ * Harness-owned choice across the caller and target hosts' separate directories.
56
+ * Choices are in memory and disappear when this broker is recreated or the process restarts.
57
+ */
58
+ setBinding(from: LocalVerticalCallerRef, target: string, targetScopeId: ScopeId | null): Promise<void>;
54
59
  }
55
60
  /**
56
61
  * Stand two (or more) verticals side by side on the pure host, each on its own `SqliteScopeHost`
@@ -1 +1 @@
1
- {"version":3,"file":"vertical-broker.d.ts","sourceRoot":"","sources":["../src/vertical-broker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;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eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,6FAA6F;AAC7F,eAAO,MAAM,kBAAkB,EAAE,eAAqE,CAAC;AAEvG,6DAA6D;AAC7D,MAAM,WAAW,sBAAsB;IACrC,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,8FAA8F;AAC9F,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,MAAM,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC9G;AAED,MAAM,WAAW,mBAAmB;IAClC,+EAA+E;IAC/E,SAAS,CAAC,IAAI,EAAE,sBAAsB,GAAG,mBAAmB,CAAC;IAC7D;;;OAGG;IACH,UAAU,CAAC,IAAI,EAAE,sBAAsB,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxG;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,GAAG,mBAAmB,CAiH/G"}
@@ -17,7 +17,7 @@
17
17
  * process the harness IS the whole trust domain — the same stance as `@substrat-run/dev-issuer`'s
18
18
  * `/dev/token`. What the broker keeps identical to production is everything else: the caller must
19
19
  * be a live, primary instance of its vertical in the tenant, the target is resolved by the
20
- * kernel's one rule (`resolveVerticalInstance`: same tenant, primary, active, exactly one), and the
20
+ * kernel's one rule (`resolvePeerInstanceFrom`: same tenant, primary, active, bound or exactly one), and the
21
21
  * call goes through the target's peer door (`getVerticalScope`), whose admission and checks are
22
22
  * the ones a hosted call meets. On the hosted path the router plays this part, from facts the
23
23
  * calling deployment cannot influence.
@@ -27,7 +27,7 @@
27
27
  * a preview (never resolved as a target, and refused as a caller).
28
28
  */
29
29
  import { platformActorId, scopeId as scopeIdOf, substratError, tenantId as tenantIdOf, verticalSlug, } from '@substrat-run/contracts';
30
- import { isPrimaryScope } from '@substrat-run/kernel';
30
+ import { isPrimaryScope, resolvePeerInstanceFrom } from '@substrat-run/kernel';
31
31
  /** The platform actor the broker reads the directory as — the platform, on the pure host. */
32
32
  export const LOCAL_BROKER_ACTOR = platformActorId.parse('01JZ00000000000000PEERBRKR');
33
33
  /**
@@ -38,7 +38,42 @@ export const LOCAL_BROKER_ACTOR = platformActorId.parse('01JZ00000000000000PEERB
38
38
  */
39
39
  export function createLocalVerticalBroker(hosts) {
40
40
  const hostOf = (vertical) => Object.prototype.hasOwnProperty.call(hosts, vertical) ? hosts[vertical] : undefined;
41
+ // The broker is one in-process harness spanning hosts; no individual host directory has
42
+ // both endpoints. Production's directory keeps this row durably instead.
43
+ const bindings = new Map();
44
+ const bindingKey = (from, target) => JSON.stringify([from.tenantId, from.scopeId, target]);
45
+ const archiveRevision = async (host, tenantId, scopeId) => (await host.admin.auditLog(LOCAL_BROKER_ACTOR, {
46
+ tenantId, scopeId, action: ['archiveScope', 'reapScope', 'deleteSnapshot'], order: 'desc', limit: 1,
47
+ }))[0]?.id ?? null;
41
48
  return {
49
+ async setBinding(from, target, targetScopeId) {
50
+ const caller = {
51
+ vertical: verticalSlug.parse(from.vertical),
52
+ tenantId: tenantIdOf.parse(from.tenantId),
53
+ scopeId: scopeIdOf.parse(from.scopeId),
54
+ };
55
+ const target_ = verticalSlug.parse(target);
56
+ const selected = targetScopeId === null ? null : scopeIdOf.parse(targetScopeId);
57
+ const record = await hostOf(caller.vertical)?.admin.getScopeRecord(LOCAL_BROKER_ACTOR, caller.tenantId, caller.scopeId);
58
+ if (!record || record.vertical !== caller.vertical || record.status !== 'active' || !isPrimaryScope(record)) {
59
+ throw substratError('not_found', 'calling app is not a live primary scope in this tenant');
60
+ }
61
+ if (selected !== null) {
62
+ const candidate = await hostOf(target_)?.admin.getScopeRecord(LOCAL_BROKER_ACTOR, caller.tenantId, selected);
63
+ if (!candidate || candidate.vertical !== target_ || candidate.status !== 'active' || !isPrimaryScope(candidate)) {
64
+ throw substratError('not_found', 'target is not a live primary instance of this vertical in this tenant');
65
+ }
66
+ }
67
+ const key = bindingKey(caller, target_);
68
+ if (selected === null)
69
+ bindings.delete(key);
70
+ else
71
+ bindings.set(key, {
72
+ targetScopeId: selected,
73
+ invalidated: false,
74
+ archiveRevision: await archiveRevision(hostOf(target_), caller.tenantId, selected),
75
+ });
76
+ },
42
77
  clientFor(from) {
43
78
  const caller = {
44
79
  vertical: verticalSlug.parse(from.vertical),
@@ -66,12 +101,26 @@ export function createLocalVerticalBroker(hosts) {
66
101
  // 2. The target, by slug, in the CALLER's tenant only — the kernel's one rule.
67
102
  const target_ = verticalSlug.parse(target);
68
103
  const targetHost = hostOf(target_);
69
- const resolution = targetHost
70
- ? await targetHost.admin.resolveVerticalInstance(caller.tenantId, target_)
71
- : { outcome: 'not-installed', tenantId: caller.tenantId, vertical: target_ };
104
+ const scopes = targetHost
105
+ ? await targetHost.admin.listScopes(LOCAL_BROKER_ACTOR, { tenantId: caller.tenantId, vertical: target_ })
106
+ : [];
107
+ const binding = bindings.get(bindingKey(caller, target_));
108
+ // The immutable audit ID catches even an archive and unarchive between calls.
109
+ // Suspension changes no archive revision, so it refuses only while suspended.
110
+ if (binding && !binding.invalidated) {
111
+ const chosen = scopes.find((scope) => scope.id === binding.targetScopeId);
112
+ if (!chosen || chosen.status === 'archived' || !targetHost ||
113
+ await archiveRevision(targetHost, caller.tenantId, binding.targetScopeId) !== binding.archiveRevision) {
114
+ binding.invalidated = true;
115
+ }
116
+ }
117
+ const resolution = resolvePeerInstanceFrom(scopes, caller.tenantId, target_, binding?.targetScopeId ?? null, binding?.invalidated ?? false);
72
118
  if (resolution.outcome === 'not-installed') {
73
119
  throw substratError('not_found', `vertical '${target_}' is not installed in this tenant`);
74
120
  }
121
+ if (resolution.outcome === 'bound-unavailable') {
122
+ throw substratError('conflict', `the bound instance of '${target_}' is unavailable; rebind or clear this app's peer binding`);
123
+ }
75
124
  if (resolution.outcome === 'ambiguous') {
76
125
  throw substratError('conflict', `this tenant runs ${resolution.count} instances of '${target_}' — a call cannot pick one; ` +
77
126
  'bind the instance first');
@@ -1 +1 @@
1
- {"version":3,"file":"vertical-broker.js","sourceRoot":"","sources":["../src/vertical-broker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EACL,eAAe,EACf,OAAO,IAAI,SAAS,EACpB,aAAa,EACb,QAAQ,IAAI,UAAU,EACtB,YAAY,GAIb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAsB,MAAM,sBAAsB,CAAC;AAG1E,6FAA6F;AAC7F,MAAM,CAAC,MAAM,kBAAkB,GAAoB,eAAe,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;AA0BvG;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CAAC,KAAgD;IACxF,MAAM,MAAM,GAAG,CAAC,QAAgB,EAA+B,EAAE,CAC/D,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEtF,OAAO;QACL,SAAS,CAAC,IAAI;YACZ,MAAM,MAAM,GAAG;gBACb,QAAQ,EAAE,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;gBAC3C,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;gBACzC,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;aACvC,CAAC;YACF,OAAO;gBACL,KAAK,CAAC,MAAM,CAAI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,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@substrat-run/adapter-sqlite",
3
- "version": "0.138.0",
3
+ "version": "0.140.0",
4
4
  "description": "Pure-SQLite scope host — real kernel semantics with no Cloudflare dependency (D-14): local dev, CI, self-host/escrow",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
@@ -39,17 +39,17 @@
39
39
  ],
40
40
  "dependencies": {
41
41
  "better-sqlite3": "^13.0.3",
42
- "@substrat-run/contracts": "^0.138.0",
43
- "@substrat-run/kernel": "^0.138.0"
42
+ "@substrat-run/contracts": "^0.140.0",
43
+ "@substrat-run/kernel": "^0.140.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/better-sqlite3": "^9.6.0",
47
47
  "hono": "^4.13.12",
48
48
  "typescript": "^7.0.0",
49
49
  "vitest": "^3.2.7",
50
- "@substrat-run/contract-tests": "^0.138.0",
51
- "@substrat-run/vertical-auth": "^0.19.1",
52
- "@substrat-run/attachment-extractors": "^0.1.4"
50
+ "@substrat-run/attachment-extractors": "^0.2.1",
51
+ "@substrat-run/contract-tests": "^0.140.0",
52
+ "@substrat-run/vertical-auth": "^0.21.0"
53
53
  },
54
54
  "publishConfig": {
55
55
  "access": "public"