@memberjunction/metadata-sync 5.40.2 → 5.41.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.
@@ -7,9 +7,9 @@
7
7
  *
8
8
  * 1. **Preload** — `Config()` scans every JSON file under each entity
9
9
  * directory once, collects the set of entity names touched (including
10
- * nested `relatedEntities`), and asks `BaseEngine.Load` to issue one
11
- * unfiltered `RunView` per entity. We load *all* rows of each touched
12
- * entity, not just the PKs mentioned in files — for two reasons:
10
+ * nested `relatedEntities`), and populates one in-memory slot per
11
+ * entity. We want *all* rows of each touched entity, not just the PKs
12
+ * mentioned in files — for two reasons:
13
13
  *
14
14
  * (a) `mj sync` is for METADATA. The entities involved (Actions,
15
15
  * Prompts, Agents, Templates, etc.) are inherently bounded —
@@ -20,9 +20,35 @@
20
20
  * the local files (e.g. a category referenced by name). A
21
21
  * full preload means those lookups hit the cache too.
22
22
  *
23
- * The loaded `BaseEntity` instances live on dynamic properties named
24
- * via {@link getPropertyNameForEntity}; lookups during the sync phase
25
- * consult those arrays instead of round-tripping the DB.
23
+ * Each slot is filled one of two ways:
24
+ *
25
+ * - **Delegation (preferred)** — the CLI bootstrap runs
26
+ * `StartupManager.Startup()`, which Config()s every
27
+ * `@RegisterForStartup` engine (AIEngineBase, QueryEngine,
28
+ * IntegrationEngineBase, …) seconds before the push begins. Those
29
+ * engines already hold full, unfiltered `entity_object` caches of
30
+ * many of the entities we touch. Rather than re-querying the same
31
+ * rows, {@link delegateEntityIfCached} asks
32
+ * `BaseEngineRegistry.FindCachedEntity` for a loaded engine with an
33
+ * unfiltered, unordered, BaseEntity-typed cache and proxies our
34
+ * slot to that engine's **live array** (resolved per-access via
35
+ * engine + property name, so donor-side array reassignment can't
36
+ * strand us). Live references are safe because every accepted
37
+ * donor config passes `canUseImmediateMutation` — the donor's own
38
+ * event subscription maintains the array in place on save/delete,
39
+ * and our explicit {@link addEntityToCache} writes are
40
+ * PK-deduped on both sides.
41
+ *
42
+ * - **Self-load (fallback)** — entities no loaded engine caches
43
+ * (Templates, Actions, Entity Fields, …) are loaded by
44
+ * `BaseEngine.Load` issuing one unfiltered `RunView` per entity,
45
+ * exactly as before.
46
+ *
47
+ * Either way, the `BaseEntity` instances are reachable through
48
+ * {@link getCachedEntities} / {@link findCachedByPrimaryKey}; lookups
49
+ * during the sync phase consult those arrays instead of round-tripping
50
+ * the DB. Self-loaded slots live on dynamic properties named via
51
+ * {@link getPropertyNameForEntity}.
26
52
  *
27
53
  * 2. **Event-driven mutation** — `BaseEngine` already wires up the global
28
54
  * `BaseEntity` event bus. Because our configs carry no Filter/OrderBy,
@@ -45,6 +71,11 @@ export interface CachedFile {
45
71
  /** The fully-resolved JSON after `@include` preprocessing. Same reference as `rawData` when the file has no `@include`s. */
46
72
  fileData: unknown;
47
73
  }
74
+ /** One delegated entity → donor engine pairing, for logging/diagnostics. */
75
+ export interface DelegationSummaryEntry {
76
+ entityName: string;
77
+ engineClassName: string;
78
+ }
48
79
  /**
49
80
  * Coordinates upfront batch-preloading of `BaseEntity` instances and in-memory
50
81
  * caches for `mj sync push`. See module docstring for the full picture.
@@ -55,6 +86,12 @@ export declare class SyncMetadataEngine extends BaseEngine<SyncMetadataEngine> {
55
86
  private preloadedEntityNames;
56
87
  private lookupCache;
57
88
  private fileDataCache;
89
+ /**
90
+ * Entities whose slot proxies a donor engine's live cache instead of a
91
+ * self-loaded array. Populated by {@link delegateEntityIfCached} during
92
+ * `Config()`; consulted first by {@link resolveSlot}.
93
+ */
94
+ private delegatedSlots;
58
95
  /** Reverse index used to scope lookup invalidation on delete: entity name → set of lookup keys touching that entity. */
59
96
  private lookupKeysByEntity;
60
97
  /**
@@ -87,17 +124,27 @@ export declare class SyncMetadataEngine extends BaseEngine<SyncMetadataEngine> {
87
124
  */
88
125
  getPropertyNameForEntity(entityName: string): string;
89
126
  /**
90
- * Build the dynamic configuration list and trigger `BaseEngine.Load` —
91
- * which fans the per-entity unfiltered views out over a single `RunViews`
92
- * batch under the hood. Then check each loaded slot for size and emit
93
- * warnings if anything came back larger than the metadata-scale threshold.
127
+ * Scan the metadata tree for touched entities, then fill one slot per
128
+ * entity: delegate to an already-loaded engine's cache when
129
+ * {@link delegateEntityIfCached} finds a suitable donor, otherwise
130
+ * self-load via `BaseEngine.Load` (which fans the per-entity unfiltered
131
+ * views out over a single `RunViews` batch under the hood). Finally,
132
+ * build the PK indexes and emit size warnings over BOTH kinds of slot.
133
+ *
134
+ * Note: `forceRefresh` only governs the self-loaded entities. Delegated
135
+ * data was loaded by `StartupManager` during this same process bootstrap,
136
+ * which satisfies preload's "current as of process start" freshness
137
+ * requirement without a second round of identical queries.
94
138
  */
95
139
  Config(forceRefresh?: boolean, contextUser?: UserInfo, provider?: IMetadataProvider): Promise<unknown>;
96
140
  /**
97
- * Build the per-entity PK → entity Map from each populated slot.
98
- * Runs once after `BaseEngine.Load` completes. The cost (one walk
99
- * over the loaded arrays, building Map entries) is trivial compared
100
- * to the per-record-lookup savings it enables downstream.
141
+ * Build the per-entity PK → entity Map from each populated slot
142
+ * (self-loaded and delegated alike). Runs once after `Config()` fills
143
+ * the slots. The cost (one walk over the arrays, building Map entries)
144
+ * is trivial compared to the per-record-lookup savings it enables
145
+ * downstream. Delegated arrays mutate out-of-band (the donor's event
146
+ * subscription replaces saved instances with clones) — that drift is
147
+ * absorbed by {@link findCachedByPrimaryKey}'s scan-and-repair fallback.
101
148
  */
102
149
  private buildPKIndexes;
103
150
  /**
@@ -111,6 +158,32 @@ export declare class SyncMetadataEngine extends BaseEngine<SyncMetadataEngine> {
111
158
  findCachedByPrimaryKey(entityName: string, primaryKey: Record<string, unknown>): BaseEntity | null;
112
159
  markEntityAsPreloaded(entityName: string): void;
113
160
  isEntityPreloaded(entityName: string): boolean;
161
+ /**
162
+ * Try to serve an entity's slot from another loaded engine's cache instead
163
+ * of re-querying the DB. Accepts the first `BaseEngineRegistry` match that
164
+ * holds the **complete** entity set in a live-mutation-safe shape:
165
+ *
166
+ * - `unfilteredOnly` — a `Filter` means a subset, useless as a full cache.
167
+ * - no `OrderBy` — ordered configs fail `canUseImmediateMutation`, so the
168
+ * donor responds to entity events with a full refresh that *reassigns*
169
+ * the array property mid-push instead of mutating it in place.
170
+ * - not `ResultType: 'simple'` and rows are `BaseEntity` instances — the
171
+ * sync phase calls `.Get()` / `.PrimaryKey` on cached rows.
172
+ * - not ourselves — a prior run's own slot must not masquerade as a donor.
173
+ *
174
+ * Returns true when a donor was registered; the caller then skips the
175
+ * self-load config for this entity.
176
+ */
177
+ delegateEntityIfCached(entityName: string): boolean;
178
+ /** Delegated entity → donor engine pairings from the last `Config()` run, for logging. */
179
+ getDelegationSummary(): DelegationSummaryEntry[];
180
+ /**
181
+ * The single resolution point for an entity's backing array: the donor
182
+ * engine's live array when delegated (re-read per access — see
183
+ * {@link DelegatedSlot}), our own `cached_*` slot otherwise. Returns
184
+ * `undefined` when no slot exists yet.
185
+ */
186
+ private resolveSlot;
114
187
  getCachedEntities(entityName: string): BaseEntity[];
115
188
  getCachedFile(filePath: string): CachedFile | undefined;
116
189
  cacheFile(filePath: string, rawData: unknown, fileData: unknown): void;
@@ -143,16 +216,22 @@ export declare class SyncMetadataEngine extends BaseEngine<SyncMetadataEngine> {
143
216
  serializePrimaryKey(entityInfo: EntityInfo, primaryKey: Record<string, unknown>): string;
144
217
  /**
145
218
  * Walk every entity referenced by metadata files (including nested
146
- * `relatedEntities`) and build one unfiltered `BaseEngine` config per
147
- * entity. Each config triggers a single `SELECT * FROM vw<Entity>`
148
- * (capped by `IgnoreMaxRows: true` in BaseEngine), pre-populating the
149
- * per-entity slot the sync path will read from.
219
+ * `relatedEntities`) and return the set of entity names touched by this
220
+ * run. Also primes the file cache as a side effect of the scan.
221
+ */
222
+ private collectTouchedEntities;
223
+ /**
224
+ * Decide, per touched entity, whether the slot delegates to an
225
+ * already-loaded engine's cache or self-loads. Returns the `BaseEngine`
226
+ * configs for the self-load remainder; each one triggers a single
227
+ * `SELECT * FROM vw<Entity>` (capped by `IgnoreMaxRows: true` in
228
+ * BaseEngine), pre-populating the per-entity slot the sync path reads.
150
229
  */
151
- private buildDynamicConfigs;
230
+ private partitionEntities;
152
231
  /**
153
- * After `BaseEngine.Load` finishes, walk the configs and check whether any
154
- * single preloaded entity exceeded the metadata-scale threshold. Emit a
155
- * warning so the operator knows their sync is loading something it
232
+ * After the slots are filled, check whether any single preloaded entity
233
+ * (self-loaded or delegated) exceeds the metadata-scale threshold. Emit a
234
+ * warning so the operator knows their sync is using something it
156
235
  * probably shouldn't be.
157
236
  */
158
237
  private warnOnOversizedSlots;
@@ -1 +1 @@
1
- {"version":3,"file":"sync-metadata-engine.d.ts","sourceRoot":"","sources":["../../src/lib/sync-metadata-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,EACL,UAAU,EAEV,UAAU,EACV,UAAU,EAEV,iBAAiB,EACjB,QAAQ,EACT,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAiB3C,yDAAyD;AACzD,MAAM,WAAW,UAAU;IACzB,wFAAwF;IACxF,OAAO,EAAE,OAAO,CAAC;IACjB,4HAA4H;IAC5H,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,UAAU,CAAC,kBAAkB,CAAC;IACpE,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,oBAAoB,CAA0B;IACtD,OAAO,CAAC,WAAW,CAAkC;IACrD,OAAO,CAAC,aAAa,CAAsC;IAE3D,wHAAwH;IACxH,OAAO,CAAC,kBAAkB,CAAuC;IAEjE;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,SAAS,CAAmD;IAEpE,kIAAkI;IAClI,OAAO,CAAC,QAAQ,CAAgB;IAEzB,gBAAgB,CAAC,UAAU,EAAE,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,OAAO,GAAG,IAAI;IAI7E;;;;OAIG;IACI,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAI5C,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI;IA6C9D,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAqBpF,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIhD,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI;IAanE,gBAAgB,IAAI,IAAI;IAK/B;;;;;;;;OAQG;IACI,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAU3D;;;;OAIG;IACI,mBAAmB,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;IAe/F;;;;OAIG;YACW,sBAAsB;IAsBpC;;;;;;OAMG;IACH,OAAO,CAAC,iBAAiB;IA4BzB;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAY5B;;;;;;;OAOG;IACH,OAAO,CAAC,wBAAwB;IAkChC;;;;OAIG;YACW,sBAAsB;YAgBtB,qBAAqB;CAgBpC"}
@@ -7,9 +7,9 @@
7
7
  *
8
8
  * 1. **Preload** — `Config()` scans every JSON file under each entity
9
9
  * directory once, collects the set of entity names touched (including
10
- * nested `relatedEntities`), and asks `BaseEngine.Load` to issue one
11
- * unfiltered `RunView` per entity. We load *all* rows of each touched
12
- * entity, not just the PKs mentioned in files — for two reasons:
10
+ * nested `relatedEntities`), and populates one in-memory slot per
11
+ * entity. We want *all* rows of each touched entity, not just the PKs
12
+ * mentioned in files — for two reasons:
13
13
  *
14
14
  * (a) `mj sync` is for METADATA. The entities involved (Actions,
15
15
  * Prompts, Agents, Templates, etc.) are inherently bounded —
@@ -20,9 +20,35 @@
20
20
  * the local files (e.g. a category referenced by name). A
21
21
  * full preload means those lookups hit the cache too.
22
22
  *
23
- * The loaded `BaseEntity` instances live on dynamic properties named
24
- * via {@link getPropertyNameForEntity}; lookups during the sync phase
25
- * consult those arrays instead of round-tripping the DB.
23
+ * Each slot is filled one of two ways:
24
+ *
25
+ * - **Delegation (preferred)** — the CLI bootstrap runs
26
+ * `StartupManager.Startup()`, which Config()s every
27
+ * `@RegisterForStartup` engine (AIEngineBase, QueryEngine,
28
+ * IntegrationEngineBase, …) seconds before the push begins. Those
29
+ * engines already hold full, unfiltered `entity_object` caches of
30
+ * many of the entities we touch. Rather than re-querying the same
31
+ * rows, {@link delegateEntityIfCached} asks
32
+ * `BaseEngineRegistry.FindCachedEntity` for a loaded engine with an
33
+ * unfiltered, unordered, BaseEntity-typed cache and proxies our
34
+ * slot to that engine's **live array** (resolved per-access via
35
+ * engine + property name, so donor-side array reassignment can't
36
+ * strand us). Live references are safe because every accepted
37
+ * donor config passes `canUseImmediateMutation` — the donor's own
38
+ * event subscription maintains the array in place on save/delete,
39
+ * and our explicit {@link addEntityToCache} writes are
40
+ * PK-deduped on both sides.
41
+ *
42
+ * - **Self-load (fallback)** — entities no loaded engine caches
43
+ * (Templates, Actions, Entity Fields, …) are loaded by
44
+ * `BaseEngine.Load` issuing one unfiltered `RunView` per entity,
45
+ * exactly as before.
46
+ *
47
+ * Either way, the `BaseEntity` instances are reachable through
48
+ * {@link getCachedEntities} / {@link findCachedByPrimaryKey}; lookups
49
+ * during the sync phase consult those arrays instead of round-tripping
50
+ * the DB. Self-loaded slots live on dynamic properties named via
51
+ * {@link getPropertyNameForEntity}.
26
52
  *
27
53
  * 2. **Event-driven mutation** — `BaseEngine` already wires up the global
28
54
  * `BaseEntity` event bus. Because our configs carry no Filter/OrderBy,
@@ -36,7 +62,7 @@
36
62
  *
37
63
  * @module sync-metadata-engine
38
64
  */
39
- import { BaseEngine } from '@memberjunction/core';
65
+ import { BaseEngine, BaseEngineRegistry, BaseEntity } from '@memberjunction/core';
40
66
  import { IsUuidSQLType } from '@memberjunction/sql-dialect';
41
67
  import fastGlob from 'fast-glob';
42
68
  import fs from 'fs-extra';
@@ -65,6 +91,12 @@ export class SyncMetadataEngine extends BaseEngine {
65
91
  this.preloadedEntityNames = new Set();
66
92
  this.lookupCache = new Map();
67
93
  this.fileDataCache = new Map();
94
+ /**
95
+ * Entities whose slot proxies a donor engine's live cache instead of a
96
+ * self-loaded array. Populated by {@link delegateEntityIfCached} during
97
+ * `Config()`; consulted first by {@link resolveSlot}.
98
+ */
99
+ this.delegatedSlots = new Map();
68
100
  /** Reverse index used to scope lookup invalidation on delete: entity name → set of lookup keys touching that entity. */
69
101
  this.lookupKeysByEntity = new Map();
70
102
  /**
@@ -108,36 +140,47 @@ export class SyncMetadataEngine extends BaseEngine {
108
140
  return `${CACHED_ENTITY_PROP_PREFIX}${entityName.replace(/[^a-zA-Z0-9]/g, '_')}`;
109
141
  }
110
142
  /**
111
- * Build the dynamic configuration list and trigger `BaseEngine.Load` —
112
- * which fans the per-entity unfiltered views out over a single `RunViews`
113
- * batch under the hood. Then check each loaded slot for size and emit
114
- * warnings if anything came back larger than the metadata-scale threshold.
143
+ * Scan the metadata tree for touched entities, then fill one slot per
144
+ * entity: delegate to an already-loaded engine's cache when
145
+ * {@link delegateEntityIfCached} finds a suitable donor, otherwise
146
+ * self-load via `BaseEngine.Load` (which fans the per-entity unfiltered
147
+ * views out over a single `RunViews` batch under the hood). Finally,
148
+ * build the PK indexes and emit size warnings over BOTH kinds of slot.
149
+ *
150
+ * Note: `forceRefresh` only governs the self-loaded entities. Delegated
151
+ * data was loaded by `StartupManager` during this same process bootstrap,
152
+ * which satisfies preload's "current as of process start" freshness
153
+ * requirement without a second round of identical queries.
115
154
  */
116
155
  async Config(forceRefresh, contextUser, provider) {
117
- const configs = await this.buildDynamicConfigs();
156
+ const entityNames = await this.collectTouchedEntities();
157
+ const configs = this.partitionEntities(entityNames);
118
158
  const providerToUse = provider || this.ProviderToUse;
119
159
  if (configs.length > 0) {
120
160
  await this.Load(configs, providerToUse, forceRefresh, contextUser);
121
- this.buildPKIndexes(configs);
122
- this.warnOnOversizedSlots(configs);
161
+ }
162
+ if (this.preloadedEntityNames.size > 0) {
163
+ this.buildPKIndexes(this.preloadedEntityNames);
164
+ this.warnOnOversizedSlots(this.preloadedEntityNames);
123
165
  }
124
166
  return true;
125
167
  }
126
168
  /**
127
- * Build the per-entity PK → entity Map from each populated slot.
128
- * Runs once after `BaseEngine.Load` completes. The cost (one walk
129
- * over the loaded arrays, building Map entries) is trivial compared
130
- * to the per-record-lookup savings it enables downstream.
169
+ * Build the per-entity PK → entity Map from each populated slot
170
+ * (self-loaded and delegated alike). Runs once after `Config()` fills
171
+ * the slots. The cost (one walk over the arrays, building Map entries)
172
+ * is trivial compared to the per-record-lookup savings it enables
173
+ * downstream. Delegated arrays mutate out-of-band (the donor's event
174
+ * subscription replaces saved instances with clones) — that drift is
175
+ * absorbed by {@link findCachedByPrimaryKey}'s scan-and-repair fallback.
131
176
  */
132
- buildPKIndexes(configs) {
133
- for (const config of configs) {
134
- if (!config.PropertyName || !config.EntityName)
135
- continue;
136
- const entityInfo = this.syncEngine.getEntityInfo(config.EntityName);
177
+ buildPKIndexes(entityNames) {
178
+ for (const entityName of entityNames) {
179
+ const entityInfo = this.syncEngine.getEntityInfo(entityName);
137
180
  if (!entityInfo)
138
181
  continue;
139
- const list = this[config.PropertyName];
140
- if (!Array.isArray(list))
182
+ const list = this.resolveSlot(entityName);
183
+ if (!list)
141
184
  continue;
142
185
  const index = new Map();
143
186
  for (const entity of list) {
@@ -151,7 +194,7 @@ export class SyncMetadataEngine extends BaseEngine {
151
194
  // will still find it if needed.
152
195
  }
153
196
  }
154
- this.pkIndexes.set(config.EntityName, index);
197
+ this.pkIndexes.set(entityName, index);
155
198
  }
156
199
  }
157
200
  /**
@@ -197,10 +240,71 @@ export class SyncMetadataEngine extends BaseEngine {
197
240
  isEntityPreloaded(entityName) {
198
241
  return this.preloadedEntityNames.has(entityName);
199
242
  }
200
- getCachedEntities(entityName) {
243
+ /**
244
+ * Try to serve an entity's slot from another loaded engine's cache instead
245
+ * of re-querying the DB. Accepts the first `BaseEngineRegistry` match that
246
+ * holds the **complete** entity set in a live-mutation-safe shape:
247
+ *
248
+ * - `unfilteredOnly` — a `Filter` means a subset, useless as a full cache.
249
+ * - no `OrderBy` — ordered configs fail `canUseImmediateMutation`, so the
250
+ * donor responds to entity events with a full refresh that *reassigns*
251
+ * the array property mid-push instead of mutating it in place.
252
+ * - not `ResultType: 'simple'` and rows are `BaseEntity` instances — the
253
+ * sync phase calls `.Get()` / `.PrimaryKey` on cached rows.
254
+ * - not ourselves — a prior run's own slot must not masquerade as a donor.
255
+ *
256
+ * Returns true when a donor was registered; the caller then skips the
257
+ * self-load config for this entity.
258
+ */
259
+ delegateEntityIfCached(entityName) {
260
+ const matches = BaseEngineRegistry.Instance.FindCachedEntity(entityName, { unfilteredOnly: true });
261
+ for (const match of matches) {
262
+ if (match.engine === this)
263
+ continue;
264
+ if (!match.config.PropertyName)
265
+ continue;
266
+ if (match.config.OrderBy)
267
+ continue;
268
+ if (match.config.ResultType === 'simple')
269
+ continue;
270
+ if (match.records.length > 0 && !(match.records[0] instanceof BaseEntity))
271
+ continue;
272
+ this.delegatedSlots.set(entityName, {
273
+ engine: match.engine,
274
+ propertyName: match.config.PropertyName,
275
+ engineClassName: match.engineClassName
276
+ });
277
+ return true;
278
+ }
279
+ return false;
280
+ }
281
+ /** Delegated entity → donor engine pairings from the last `Config()` run, for logging. */
282
+ getDelegationSummary() {
283
+ return Array.from(this.delegatedSlots.entries()).map(([entityName, slot]) => ({
284
+ entityName,
285
+ engineClassName: slot.engineClassName
286
+ }));
287
+ }
288
+ /**
289
+ * The single resolution point for an entity's backing array: the donor
290
+ * engine's live array when delegated (re-read per access — see
291
+ * {@link DelegatedSlot}), our own `cached_*` slot otherwise. Returns
292
+ * `undefined` when no slot exists yet.
293
+ */
294
+ resolveSlot(entityName) {
295
+ const delegated = this.delegatedSlots.get(entityName);
296
+ if (delegated) {
297
+ const live = delegated.engine[delegated.propertyName];
298
+ if (Array.isArray(live))
299
+ return live;
300
+ // Defensive: donor slot vanished — fall through to our own slot.
301
+ }
201
302
  const propName = this.getPropertyNameForEntity(entityName);
202
303
  const list = this[propName];
203
- return Array.isArray(list) ? list : [];
304
+ return Array.isArray(list) ? list : undefined;
305
+ }
306
+ getCachedEntities(entityName) {
307
+ return this.resolveSlot(entityName) ?? [];
204
308
  }
205
309
  getCachedFile(filePath) {
206
310
  return this.fileDataCache.get(filePath);
@@ -217,12 +321,17 @@ export class SyncMetadataEngine extends BaseEngine {
217
321
  this.fileDataCache.delete(filePath);
218
322
  }
219
323
  addEntityToCache(entityName, entity) {
220
- const propName = this.getPropertyNameForEntity(entityName);
221
- const slot = this;
222
- if (!Array.isArray(slot[propName])) {
324
+ // Delegated entities write into the donor's live array: PK-dedup below
325
+ // prevents a duplicate against rows the donor already holds, and the
326
+ // donor's own save-event handler sees our instance by reference and
327
+ // no-ops rather than double-inserting.
328
+ let list = this.resolveSlot(entityName);
329
+ if (!list) {
330
+ const propName = this.getPropertyNameForEntity(entityName);
331
+ const slot = this;
223
332
  slot[propName] = [];
333
+ list = slot[propName];
224
334
  }
225
- const list = slot[propName];
226
335
  // `PrimaryKey.Equals` requires the entity to have a populated composite
227
336
  // key; if either side is missing one we fall back to reference equality
228
337
  // only (the entity might not be saved yet, in which case no dedup is
@@ -259,8 +368,9 @@ export class SyncMetadataEngine extends BaseEngine {
259
368
  catch { /* defensive: malformed entity */ }
260
369
  }
261
370
  removeEntityFromCache(entityName, primaryKey) {
262
- const propName = this.getPropertyNameForEntity(entityName);
263
- const list = this[propName];
371
+ // For delegated entities this splices the donor's live array; the donor's
372
+ // delete-event handler tolerates the row already being gone.
373
+ const list = this.resolveSlot(entityName);
264
374
  const entityInfo = this.syncEngine.getEntityInfo(entityName);
265
375
  let pkStr = null;
266
376
  if (entityInfo) {
@@ -336,12 +446,10 @@ export class SyncMetadataEngine extends BaseEngine {
336
446
  }
337
447
  /**
338
448
  * Walk every entity referenced by metadata files (including nested
339
- * `relatedEntities`) and build one unfiltered `BaseEngine` config per
340
- * entity. Each config triggers a single `SELECT * FROM vw<Entity>`
341
- * (capped by `IgnoreMaxRows: true` in BaseEngine), pre-populating the
342
- * per-entity slot the sync path will read from.
449
+ * `relatedEntities`) and return the set of entity names touched by this
450
+ * run. Also primes the file cache as a side effect of the scan.
343
451
  */
344
- async buildDynamicConfigs() {
452
+ async collectTouchedEntities() {
345
453
  const entitiesFound = new Set();
346
454
  for (const entityDir of this.entityDirs) {
347
455
  const entityConfig = await loadEntityConfig(entityDir);
@@ -357,12 +465,26 @@ export class SyncMetadataEngine extends BaseEngine {
357
465
  });
358
466
  await this.processFilesInParallel(files, entityConfig.entity, entitiesFound);
359
467
  }
468
+ return entitiesFound;
469
+ }
470
+ /**
471
+ * Decide, per touched entity, whether the slot delegates to an
472
+ * already-loaded engine's cache or self-loads. Returns the `BaseEngine`
473
+ * configs for the self-load remainder; each one triggers a single
474
+ * `SELECT * FROM vw<Entity>` (capped by `IgnoreMaxRows: true` in
475
+ * BaseEngine), pre-populating the per-entity slot the sync path reads.
476
+ */
477
+ partitionEntities(entityNames) {
478
+ this.delegatedSlots.clear();
360
479
  const configs = [];
361
- for (const entityName of entitiesFound) {
480
+ for (const entityName of entityNames) {
362
481
  const entityInfo = this.syncEngine.getEntityInfo(entityName);
363
482
  if (!entityInfo)
364
483
  continue;
365
484
  this.markEntityAsPreloaded(entityName);
485
+ if (this.delegateEntityIfCached(entityName)) {
486
+ continue;
487
+ }
366
488
  configs.push({
367
489
  PropertyName: this.getPropertyNameForEntity(entityName),
368
490
  EntityName: entityName,
@@ -378,20 +500,18 @@ export class SyncMetadataEngine extends BaseEngine {
378
500
  return configs;
379
501
  }
380
502
  /**
381
- * After `BaseEngine.Load` finishes, walk the configs and check whether any
382
- * single preloaded entity exceeded the metadata-scale threshold. Emit a
383
- * warning so the operator knows their sync is loading something it
503
+ * After the slots are filled, check whether any single preloaded entity
504
+ * (self-loaded or delegated) exceeds the metadata-scale threshold. Emit a
505
+ * warning so the operator knows their sync is using something it
384
506
  * probably shouldn't be.
385
507
  */
386
- warnOnOversizedSlots(configs) {
387
- for (const config of configs) {
388
- if (!config.PropertyName || !config.EntityName)
389
- continue;
390
- const list = this[config.PropertyName];
391
- if (!Array.isArray(list))
508
+ warnOnOversizedSlots(entityNames) {
509
+ for (const entityName of entityNames) {
510
+ const list = this.resolveSlot(entityName);
511
+ if (!list)
392
512
  continue;
393
513
  if (list.length > LARGE_ENTITY_WARN_THRESHOLD) {
394
- this.warnings.push(`Preloaded ${list.length.toLocaleString()} rows of '${config.EntityName}'. mj sync is intended for metadata-scale entities (hundreds to low tens of thousands); this is large enough that you may want to confirm this entity belongs in a sync workflow.`);
514
+ this.warnings.push(`Preloaded ${list.length.toLocaleString()} rows of '${entityName}'. mj sync is intended for metadata-scale entities (hundreds to low tens of thousands); this is large enough that you may want to confirm this entity belongs in a sync workflow.`);
395
515
  }
396
516
  }
397
517
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sync-metadata-engine.js","sourceRoot":"","sources":["../../src/lib/sync-metadata-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,EACL,UAAU,EAOX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG7C,+FAA+F;AAC/F,MAAM,yBAAyB,GAAG,SAAS,CAAC;AAE5C,8DA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,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YAC9F,KAAK,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,MAAM,EAAE,CAAC;gBACrD,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;gBAC5C,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;gBAChE,IAAI,CAAC,wBAAwB,CAAC,OAAyC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC;YAChH,CAAC;QACH,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,qBAAqB,CACjC,QAAgB;QAEhB,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,QAAQ,GAAY,OAAO,CAAC;QAEhC,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC3C,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAE3F,IAAI,WAAW,EAAE,CAAC;YAChB,MAAM,YAAY,GAAG,IAAI,gBAAgB,EAAE,CAAC;YAC5C,QAAQ,GAAG,MAAM,YAAY,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QACtD,CAAC;QAED,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IACzC,CAAC;CACF"}
@@ -1,4 +1,5 @@
1
1
  import { ValidationResult } from '../types/validation.js';
2
+ import type { RecordChangeDetail } from './PushService.js';
2
3
  export declare class FormattingService {
3
4
  /**
4
5
  * Format validation result as JSON
@@ -22,6 +23,29 @@ export declare class FormattingService {
22
23
  unchanged?: number;
23
24
  deferred?: number;
24
25
  }): string;
26
+ /**
27
+ * Render a single two-column row of the summary box. Cell contents are kept as raw
28
+ * (uncolored) text so column/border alignment math is exact — only the box borders are
29
+ * colored. Each column is `label` (padded) + `value`, clamped to a fixed column width.
30
+ */
31
+ private boxRow;
32
+ /**
33
+ * Render the end-of-run "Changes" recap: a focused block summarizing what was
34
+ * created/updated/deleted, GROUPED by entity + operation with counts (no per-record IDs
35
+ * or field diffs — those scale poorly and live in the detailed report instead). One line
36
+ * per entity/operation means the recap stays compact whether 1 or 10,000 records changed.
37
+ * Returns '' when there were no changes (caller should skip printing).
38
+ *
39
+ * For full per-record detail use `--verbose` (streams diffs inline during the push) or
40
+ * `--change-detail` (writes the report from `formatChangesReport()` to a file).
41
+ */
42
+ formatChangesRecap(changes: RecordChangeDetail[]): string;
43
+ /**
44
+ * Render the FULL per-record change report as plain text (no ANSI), suitable for writing
45
+ * to a file via `--change-detail`. Lists every record's operation, entity, primary key,
46
+ * and — for updates — the field-level diffs.
47
+ */
48
+ formatChangesReport(changes: RecordChangeDetail[], generatedAt: string): string;
25
49
  private formatHeader;
26
50
  private formatSectionHeader;
27
51
  private formatSummaryBox;
@@ -30,7 +54,7 @@ export declare class FormattingService {
30
54
  private formatWarning;
31
55
  private formatFooter;
32
56
  private shortenPath;
33
- private formatDuration;
57
+ formatDuration(ms: number): string;
34
58
  /**
35
59
  * Get count of errors by type
36
60
  */
@@ -1 +1 @@
1
- {"version":3,"file":"FormattingService.d.ts","sourceRoot":"","sources":["../../src/services/FormattingService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAA4D,MAAM,qBAAqB,CAAC;AAEjH,qBAAa,iBAAiB;IAC1B;;OAEG;IACI,4BAA4B,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM;IA+BrE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAgBtB;IAEF;;OAEG;IACI,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,GAAE,OAAe,GAAG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