@memberjunction/integration-progress-artifacts 6.2.0-edge.6 → 6.2.0-edge.7

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.
@@ -1,69 +1,115 @@
1
1
  import { promises as fs } from 'node:fs';
2
2
  import { join } from 'node:path';
3
3
  import { CountsContributeToAggregate } from './types.js';
4
+ import { DefaultRunArtifactRoot } from './RunArtifactRoot.js';
4
5
  /**
5
6
  * Read API for the progress artifacts. Frontend / health-check / resumption code
6
7
  * uses this to inspect ongoing or completed runs without touching the emitter.
7
8
  *
8
9
  * Implementation is purely file-system reads; no shared state with the emitter
9
10
  * (an emitter in another process can write while this reader tails).
11
+ *
12
+ * **Read cost is part of the contract.** A run's journal reaches 12–13 k events with multi-KB
13
+ * payloads, and on App Service's SMB filesystem `IntegrationListRuns` with `limit:1` once took 73
14
+ * seconds and then timed out (MJ-RUN-5/21) — because it hydrated EVERY run before applying the
15
+ * limit, and each hydration read the whole journal four times. So:
16
+ *
17
+ * - every filter {@link ListRuns} supports is answered from `manifest.json`/`result.json`, and the
18
+ * limit is applied BEFORE anything opens a journal;
19
+ * - a run that finished carries its own numbers in `result.json`, and they are taken from there
20
+ * rather than re-derived;
21
+ * - when a journal must be read, it is read ONCE and every value comes out of that pass.
10
22
  */
11
23
  export class IntegrationProgressReader {
12
- constructor(rootDir = join(process.cwd(), 'logs', 'integration-runs')) {
24
+ constructor(rootDir = DefaultRunArtifactRoot()) {
13
25
  this.rootDir = rootDir;
14
26
  }
15
27
  /** Directory these artifacts live in, so callers can address a run's files directly. */
16
28
  get RootDir() {
17
29
  return this.rootDir;
18
30
  }
19
- /** List runs, newest-first by mtime. */
20
- async ListRuns(filter = {}, limit = 50) {
31
+ /**
32
+ * List runs, newest-STARTED first.
33
+ *
34
+ * Ordering is by the manifest's `startedAt`, not by directory mtime. A stranded run stops being
35
+ * written to, so its mtime freezes at the moment it stranded and mtime ordering sank it below
36
+ * every later run — hiding, behind the `limit`, exactly the run an operator is looking for. A
37
+ * start time never moves. (The same reasoning governs retention; see
38
+ * `IntegrationProgressEmitter.pruneOldRuns`.)
39
+ *
40
+ * `offset` exists because the caller authorization-filters AFTER this returns, so a short page
41
+ * does not mean the source is exhausted — it may just mean the caller could not read some of
42
+ * what came back. Without an offset there is no way to ask for the next slice, and both UI
43
+ * surfaces faked paging by re-requesting with a doubled limit.
44
+ *
45
+ * Filters and the limit are applied on the run HEADS — `manifest.json` plus the presence of
46
+ * `result.json` — so only the runs actually being returned are hydrated.
47
+ */
48
+ async ListRuns(filter = {}, limit = 50, offset = 0) {
21
49
  const entries = await this.safeReadDir(this.rootDir);
22
- const snapshots = [];
50
+ const heads = [];
23
51
  for (const runID of entries) {
24
- const snap = await this.GetRun(runID);
25
- if (!snap)
52
+ const head = await this.readRunHead(runID);
53
+ if (!head)
54
+ continue; // not a run dir (or a manifest still being written)
55
+ const manifest = head.manifest;
56
+ if (filter.runKind && manifest.runKind !== filter.runKind)
26
57
  continue;
27
- if (filter.runKind && snap.manifest.runKind !== filter.runKind)
58
+ if (filter.integrationID && manifest.integrationID !== filter.integrationID)
28
59
  continue;
29
- if (filter.integrationID && snap.manifest.integrationID !== filter.integrationID)
60
+ if (filter.companyIntegrationID && !IntegrationProgressReader.RunCoversCompanyIntegration(manifest, filter.companyIntegrationID))
30
61
  continue;
31
- if (filter.companyIntegrationID && snap.manifest.companyIntegrationID !== filter.companyIntegrationID)
62
+ if (filter.sinceTs && manifest.startedAt < filter.sinceTs)
32
63
  continue;
33
- if (filter.sinceTs && snap.manifest.startedAt < filter.sinceTs)
64
+ if (filter.inFlightOnly && head.result)
34
65
  continue;
35
- if (filter.inFlightOnly && !snap.isInFlight)
36
- continue;
37
- const mtime = await this.runMtime(runID);
38
- snapshots.push({ snap, mtimeMs: mtime });
66
+ heads.push({ runID, head });
67
+ }
68
+ heads.sort((a, b) => {
69
+ const byStart = IntegrationProgressReader.startMs(b.head.manifest) - IntegrationProgressReader.startMs(a.head.manifest);
70
+ if (byStart !== 0)
71
+ return byStart;
72
+ // Run IDs embed their mint time and a random suffix, so this is a stable, deterministic
73
+ // tiebreak for two runs that started in the same millisecond.
74
+ return a.runID < b.runID ? 1 : a.runID > b.runID ? -1 : 0;
75
+ });
76
+ const start = Math.max(0, offset);
77
+ const kept = heads.slice(start, start + limit);
78
+ const snapshots = [];
79
+ for (const k of kept) {
80
+ snapshots.push(await this.hydrate(k.runID, k.head));
81
+ }
82
+ return snapshots;
83
+ }
84
+ /**
85
+ * The complete set of connections a run touched, normalised across the two manifest shapes.
86
+ *
87
+ * Single-connection runs (every sync, every discovery) carry only `companyIntegrationID`;
88
+ * runs that can span a batch (RSU) carry the full set in `companyIntegrationIDs` and set the
89
+ * singular field only when the set has exactly one member. Callers that make a per-connection
90
+ * decision — listing, and above all AUTHORIZATION — must read the set, not the singular field,
91
+ * or a batch run silently looks connection-less.
92
+ *
93
+ * Returns an empty array for a run with no connection identity at all.
94
+ */
95
+ static CompanyIntegrationIDsFor(manifest) {
96
+ if (manifest.companyIntegrationIDs && manifest.companyIntegrationIDs.length > 0) {
97
+ return manifest.companyIntegrationIDs;
39
98
  }
40
- snapshots.sort((a, b) => b.mtimeMs - a.mtimeMs);
41
- return snapshots.slice(0, limit).map(s => s.snap);
99
+ return manifest.companyIntegrationID ? [manifest.companyIntegrationID] : [];
100
+ }
101
+ /** Whether the given connection is one of the connections a run touched. */
102
+ static RunCoversCompanyIntegration(manifest, companyIntegrationID) {
103
+ return IntegrationProgressReader.CompanyIntegrationIDsFor(manifest).includes(companyIntegrationID);
42
104
  }
43
105
  /** Read snapshot of a single run. Returns undefined if runID not found. */
44
106
  async GetRun(runID) {
45
107
  if (!IntegrationProgressReader.isSafeRunID(runID))
46
108
  return undefined;
47
- const runDir = join(this.rootDir, runID);
48
- const manifest = await this.safeReadJSON(join(runDir, 'manifest.json'));
49
- if (!manifest)
109
+ const head = await this.readRunHead(runID);
110
+ if (!head)
50
111
  return undefined;
51
- const result = await this.safeReadJSON(join(runDir, 'result.json'));
52
- const events = await this.readProgressTail(join(runDir, 'progress.jsonl'), 1);
53
- const latestEvent = events[events.length - 1];
54
- const allCounts = await this.aggregateCountsFromTail(join(runDir, 'progress.jsonl'));
55
- const warnings = await this.aggregateWarningsFromTail(join(runDir, 'progress.jsonl'));
56
- const eventCount = await this.countLines(join(runDir, 'progress.jsonl'));
57
- return {
58
- manifest,
59
- latestEvent,
60
- eventCount,
61
- result,
62
- isInFlight: !result,
63
- counts: allCounts,
64
- warnings: warnings.length > 0 ? warnings : undefined,
65
- warningCount: warnings.length,
66
- };
112
+ return this.hydrate(runID, head);
67
113
  }
68
114
  /** Tail events since a given sequence. */
69
115
  async Tail(runID, sinceSeq = 0) {
@@ -100,6 +146,61 @@ export class IntegrationProgressReader {
100
146
  return this.ListRuns({ inFlightOnly: true }, 1000);
101
147
  }
102
148
  // ── Internals ──────────────────────────────────────────────────────
149
+ /** Sortable run start, from the manifest. An unparseable timestamp sorts oldest rather than throwing. */
150
+ static startMs(manifest) {
151
+ const parsed = Date.parse(manifest.startedAt);
152
+ return Number.isFinite(parsed) ? parsed : 0;
153
+ }
154
+ /**
155
+ * The manifest and (if the run finished) the terminal record. Two small files, no journal.
156
+ *
157
+ * A missing or unparseable manifest means "not a run" — the same rule the emitter's resume path
158
+ * applies — so a stray file under the root is skipped rather than reported as a run.
159
+ */
160
+ async readRunHead(runID) {
161
+ const runDir = join(this.rootDir, runID);
162
+ const manifest = await this.safeReadJSON(join(runDir, 'manifest.json'));
163
+ if (!manifest)
164
+ return undefined;
165
+ const result = await this.safeReadJSON(join(runDir, 'result.json'));
166
+ return { manifest, result };
167
+ }
168
+ /**
169
+ * Turns a run head into the full snapshot.
170
+ *
171
+ * A finished run costs ZERO journal reads: the emitter already wrote its aggregate counts,
172
+ * warnings, event count and final event into `result.json` — re-deriving them from the journal is
173
+ * what made a listing read every run's whole event log. A run still in flight, and a run whose
174
+ * `result.json` predates the persisted counters, take exactly one pass.
175
+ */
176
+ async hydrate(runID, head) {
177
+ const result = head.result;
178
+ if (result && result.eventCount !== undefined) {
179
+ return {
180
+ manifest: head.manifest,
181
+ latestEvent: result.latestEvent,
182
+ eventCount: result.eventCount,
183
+ result,
184
+ isInFlight: false,
185
+ counts: result.aggregateCounts,
186
+ warnings: result.warnings,
187
+ warningCount: result.warningCount ?? result.warnings?.length ?? 0,
188
+ };
189
+ }
190
+ const digest = await this.readJournalDigest(join(this.rootDir, runID, 'progress.jsonl'));
191
+ return {
192
+ manifest: head.manifest,
193
+ latestEvent: digest.latestEvent,
194
+ eventCount: digest.eventCount,
195
+ result,
196
+ isInFlight: !result,
197
+ // A terminal record still wins where it has the number: it is the emitter's own account of
198
+ // the run, and for a resumed run it spans both processes.
199
+ counts: result?.aggregateCounts ?? digest.counts,
200
+ warnings: result?.warnings ?? (digest.warnings.length > 0 ? digest.warnings : undefined),
201
+ warningCount: result?.warningCount ?? digest.warnings.length,
202
+ };
203
+ }
103
204
  /**
104
205
  * SECURITY: run IDs reach {@link GetRun} / {@link Tail} from callers that may pass
105
206
  * client-supplied values (e.g. the `IntegrationGetRun` / `IntegrationTailRunEvents` GraphQL
@@ -144,84 +245,95 @@ export class IntegrationProgressReader {
144
245
  return undefined;
145
246
  }
146
247
  }
147
- async runMtime(runID) {
148
- try {
149
- const s = await fs.stat(join(this.rootDir, runID));
150
- return s.mtimeMs;
151
- }
152
- catch {
153
- return 0;
154
- }
155
- }
156
- async readProgressTail(path, maxLines) {
157
- const raw = await this.safeReadFile(path);
158
- if (!raw)
159
- return [];
160
- const lines = raw.split('\n').filter(Boolean);
161
- const tail = lines.slice(Math.max(0, lines.length - maxLines));
162
- const out = [];
163
- for (const line of tail) {
164
- try {
165
- out.push(JSON.parse(line));
166
- }
167
- catch { /* skip */ }
248
+ /**
249
+ * Per-entity outcome counts for a sync run, recovered from its event stream.
250
+ *
251
+ * The run ROW records only TotalRecords, so history could never show created vs updated vs
252
+ * skipped per table — the field existed on the API type and was never populated, which is what
253
+ * thing.txt saw as an empty breakdown. The engine already emits every number needed on
254
+ * `sync.entity-map.complete`; this reads them back.
255
+ *
256
+ * Honest ceiling: artifacts are pruned by the retention cap and are node-local, so a run old
257
+ * enough to have been pruned yields nothing. The caller must render that as "not recorded"
258
+ * rather than as zeros.
259
+ */
260
+ async EntityOutcomes(runID) {
261
+ const events = await this.Tail(runID, 0);
262
+ const byEntity = new Map();
263
+ for (const ev of events) {
264
+ // A sync mirrors each entity map's completion as a `stage.complete` whose stage is the
265
+ // object name. `counts` folds created and updated into `succeeded`, so the split rides
266
+ // alongside in `data`.
267
+ if (ev.eventType !== 'stage.complete')
268
+ continue;
269
+ const d = (ev.data ?? {});
270
+ if (d.recordsCreated === undefined && d.recordsUpdated === undefined)
271
+ continue;
272
+ const name = String(d.mjEntity ?? ev.stage ?? '');
273
+ if (!name)
274
+ continue;
275
+ const row = byEntity.get(name) ?? { EntityName: name, InsertCount: 0, UpdateCount: 0, SkipCount: 0, ErrorCount: 0 };
276
+ // A map can appear more than once in a run (resume, or a push pass after a pull), so
277
+ // accumulate rather than overwrite.
278
+ row.InsertCount += Number(d.recordsCreated ?? 0);
279
+ row.UpdateCount += Number(d.recordsUpdated ?? 0);
280
+ row.SkipCount += Number(ev.counts?.skipped ?? 0);
281
+ row.ErrorCount += Number(ev.counts?.failed ?? 0);
282
+ byEntity.set(name, row);
168
283
  }
169
- return out;
170
- }
171
- async countLines(path) {
172
- const raw = await this.safeReadFile(path);
173
- if (!raw)
174
- return 0;
175
- return raw.split('\n').filter(Boolean).length;
284
+ return [...byEntity.values()];
176
285
  }
177
- async aggregateCountsFromTail(path) {
286
+ /**
287
+ * ONE pass over a journal, yielding every value a snapshot needs from it: the event count, the
288
+ * latest event, the applied-count aggregate and the warnings rollup.
289
+ *
290
+ * This replaces four independent helpers that each read the whole file into a JS string. On a
291
+ * 12–13 k-event journal that was four multi-megabyte strings per run per call — a heap risk as
292
+ * much as an I/O one.
293
+ */
294
+ async readJournalDigest(path) {
178
295
  const raw = await this.safeReadFile(path);
179
- if (!raw)
180
- return undefined;
296
+ if (raw === undefined)
297
+ return { eventCount: 0, warnings: [] };
181
298
  const totals = { processed: 0, succeeded: 0, failed: 0, skipped: 0 };
299
+ const warnings = [];
300
+ let eventCount = 0;
301
+ let latestEvent;
182
302
  for (const line of raw.split('\n')) {
183
303
  if (!line.trim())
184
304
  continue;
305
+ eventCount++;
306
+ let ev;
185
307
  try {
186
- const ev = JSON.parse(line);
187
- if (!ev.counts)
188
- continue;
189
- // Mirror the emitter's rule (CountsContributeToAggregate): only the APPLIED
190
- // rollup events (`stage.complete`/`run.complete`) feed the total. The FETCHED
191
- // `processed` on `records.batch.complete` is per-batch progress only and would
192
- // double-count every record if summed here. Keeping the rule in one place
193
- // guarantees a re-derived count matches the emitter's running aggregate.
194
- if (!CountsContributeToAggregate(ev.eventType))
195
- continue;
196
- totals.processed += ev.counts.processed ?? 0;
197
- totals.succeeded += ev.counts.succeeded ?? 0;
198
- totals.failed += ev.counts.failed ?? 0;
199
- totals.skipped += ev.counts.skipped ?? 0;
308
+ ev = JSON.parse(line);
200
309
  }
201
- catch { /* skip */ }
202
- }
203
- return totals;
204
- }
205
- async aggregateWarningsFromTail(path) {
206
- const raw = await this.safeReadFile(path);
207
- if (!raw)
208
- return [];
209
- const warnings = [];
210
- for (const line of raw.split('\n')) {
211
- if (!line.trim())
310
+ catch {
212
311
  continue;
213
- try {
214
- const ev = JSON.parse(line);
215
- if (ev.eventType !== 'warning')
216
- continue;
217
- warnings.push(this.warningFromEvent(ev));
218
312
  }
219
- catch { /* skip */ }
313
+ // The last PARSEABLE line, not literally the last line: a run killed mid-append leaves a
314
+ // torn fragment, and treating that as "no latest event" is what makes a killed run
315
+ // unrecognisable to the resume path, which matches on the run's last stage.
316
+ latestEvent = ev;
317
+ if (ev.eventType === 'warning')
318
+ warnings.push(IntegrationProgressReader.warningFromEvent(ev));
319
+ if (!ev.counts)
320
+ continue;
321
+ // Mirror the emitter's rule (CountsContributeToAggregate): only the APPLIED
322
+ // rollup events (`stage.complete`/`run.complete`) feed the total. The FETCHED
323
+ // `processed` on `records.batch.complete` is per-batch progress only and would
324
+ // double-count every record if summed here. Keeping the rule in one place
325
+ // guarantees a re-derived count matches the emitter's running aggregate.
326
+ if (!CountsContributeToAggregate(ev.eventType))
327
+ continue;
328
+ totals.processed += ev.counts.processed ?? 0;
329
+ totals.succeeded += ev.counts.succeeded ?? 0;
330
+ totals.failed += ev.counts.failed ?? 0;
331
+ totals.skipped += ev.counts.skipped ?? 0;
220
332
  }
221
- return warnings;
333
+ return { eventCount, latestEvent, counts: totals, warnings };
222
334
  }
223
335
  /** Reconstruct a {@link SyncWarning} from a persisted `'warning'` event. */
224
- warningFromEvent(event) {
336
+ static warningFromEvent(event) {
225
337
  const { code, ...rest } = event.data ?? {};
226
338
  return {
227
339
  code: typeof code === 'string' ? code : 'UNKNOWN',
@@ -1 +1 @@
1
- {"version":3,"file":"IntegrationProgressReader.js","sourceRoot":"","sources":["../src/IntegrationProgressReader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAUzD;;;;;;GAMG;AACH,MAAM,OAAO,yBAAyB;IAClC,YAA6B,UAAkB,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,kBAAkB,CAAC;QAAjE,YAAO,GAAP,OAAO,CAA0D;IAAG,CAAC;IAElG,wFAAwF;IACxF,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,wCAAwC;IACjC,KAAK,CAAC,QAAQ,CAAC,SAA+B,EAAE,EAAE,KAAK,GAAG,EAAE;QAC/D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrD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,+EAA+E;YAC/E,0EAA0E;YAC1E,yEAAyE;YACzE,IAAI,CAAC,2BAA2B,CAAC,EAAE,CAAC,SAAS,CAAC;gBAAE,SAAS;YACzD,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,CAAC;YAC7C,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,CAAC;YAC7C,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;YACvC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IACjE,CAAC;IAED,4EAA4E;IACpE,MAAM,CAAC,gBAAgB,CAAC,KAA+B;QAC3D,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;QAC3C,OAAO;YACH,IAAI,EAAE,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;YACjD,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,EAAE;YACxB,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,EAAE;YAC5B,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;SACxD,CAAC;IACN,CAAC;CACJ"}
@@ -1,3 +1,4 @@
1
+ import type { IntegrationRunSnapshot } from './types.js';
1
2
  /**
2
3
  * Closes out run artifacts that a process death left open.
3
4
  *
@@ -19,13 +20,18 @@
19
20
  * `'killed'` is already the artifact vocabulary's term for this exit, so consumers that classify by
20
21
  * `exitReason` need no change to understand the result.
21
22
  *
23
+ * `skip` names the runs that are NOT dead: ones the starting process is itself the continuation
24
+ * of and will resume (see `RSUPostRestartProgressSession` in MJServer). They are reported in
25
+ * `Skipped`, untouched, so the caller can sweep whichever of them nothing resumed after all.
26
+ *
22
27
  * KNOWN LIMIT — assumes ONE process per artifact directory, which is the same single-writer
23
28
  * assumption the surrounding services document. If MJAPI is ever scaled past one replica sharing a
24
29
  * directory, a starting replica would close out a sibling's live runs. Gate the call, not this
25
30
  * function, if that day comes.
26
31
  */
27
- export declare function SweepInterruptedRuns(rootDir?: string, log?: (message: string) => void): Promise<{
32
+ export declare function SweepInterruptedRuns(rootDir?: string, log?: (message: string) => void, skip?: (snapshot: IntegrationRunSnapshot) => boolean): Promise<{
28
33
  Swept: string[];
29
34
  Failed: string[];
35
+ Skipped: string[];
30
36
  }>;
31
37
  //# sourceMappingURL=IntegrationRunReconciler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntegrationRunReconciler.d.ts","sourceRoot":"","sources":["../src/IntegrationRunReconciler.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,oBAAoB,CACtC,OAAO,CAAC,EAAE,MAAM,EAChB,GAAG,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAe,GAC1C,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAoDhD"}
1
+ {"version":3,"file":"IntegrationRunReconciler.d.ts","sourceRoot":"","sources":["../src/IntegrationRunReconciler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAwB,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,oBAAoB,CACtC,OAAO,CAAC,EAAE,MAAM,EAChB,GAAG,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAe,EACzC,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,sBAAsB,KAAK,OAAO,GACrD,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CA6DnE"}
@@ -22,27 +22,40 @@ import { IntegrationProgressReader } from './IntegrationProgressReader.js';
22
22
  * `'killed'` is already the artifact vocabulary's term for this exit, so consumers that classify by
23
23
  * `exitReason` need no change to understand the result.
24
24
  *
25
+ * `skip` names the runs that are NOT dead: ones the starting process is itself the continuation
26
+ * of and will resume (see `RSUPostRestartProgressSession` in MJServer). They are reported in
27
+ * `Skipped`, untouched, so the caller can sweep whichever of them nothing resumed after all.
28
+ *
25
29
  * KNOWN LIMIT — assumes ONE process per artifact directory, which is the same single-writer
26
30
  * assumption the surrounding services document. If MJAPI is ever scaled past one replica sharing a
27
31
  * directory, a starting replica would close out a sibling's live runs. Gate the call, not this
28
32
  * function, if that day comes.
29
33
  */
30
- export async function SweepInterruptedRuns(rootDir, log = () => { }) {
34
+ export async function SweepInterruptedRuns(rootDir, log = () => { }, skip) {
31
35
  const reader = rootDir ? new IntegrationProgressReader(rootDir) : new IntegrationProgressReader();
32
36
  const swept = [];
33
37
  const failed = [];
38
+ const skipped = [];
34
39
  let inFlight;
35
40
  try {
36
41
  inFlight = await reader.FindInFlight();
37
42
  }
38
43
  catch (e) {
39
44
  log(`[RunReconciler] could not list in-flight runs: ${e instanceof Error ? e.message : String(e)}`);
40
- return { Swept: swept, Failed: failed };
45
+ return { Swept: swept, Failed: failed, Skipped: skipped };
41
46
  }
42
47
  if (inFlight.length === 0)
43
- return { Swept: swept, Failed: failed };
48
+ return { Swept: swept, Failed: failed, Skipped: skipped };
44
49
  for (const snap of inFlight) {
45
50
  const runID = snap.manifest.runID;
51
+ // A run the caller intends to pick back up is not dead — it is waiting for its continuation
52
+ // (an RSU run killed inside its own RestartMJAPI step is exactly this). Leave it in flight
53
+ // and name it, so the caller can close out whatever it then fails to re-attach to.
54
+ if (skip?.(snap)) {
55
+ skipped.push(runID);
56
+ log(`[RunReconciler] left ${snap.manifest.runKind} run ${runID} in flight for its continuation to resume`);
57
+ continue;
58
+ }
46
59
  // Name the step it died on. That is the single most useful fact for whoever reads this
47
60
  // afterwards, and it is the one thing a killed run cannot say for itself.
48
61
  const lastStage = snap.latestEvent?.stage;
@@ -79,6 +92,6 @@ export async function SweepInterruptedRuns(rootDir, log = () => { }) {
79
92
  log(`[RunReconciler] could not close run ${runID}: ${e instanceof Error ? e.message : String(e)}`);
80
93
  }
81
94
  }
82
- return { Swept: swept, Failed: failed };
95
+ return { Swept: swept, Failed: failed, Skipped: skipped };
83
96
  }
84
97
  //# sourceMappingURL=IntegrationRunReconciler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntegrationRunReconciler.js","sourceRoot":"","sources":["../src/IntegrationRunReconciler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAG3E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACtC,OAAgB,EAChB,MAAiC,GAAG,EAAE,GAAE,CAAC;IAEzC,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,yBAAyB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,yBAAyB,EAAE,CAAC;IAClG,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,QAAwE,CAAC;IAC7E,IAAI,CAAC;QACD,QAAQ,GAAG,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;IAC3C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;Q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KAAK,EAAE,CAAC,CAAC;QAC5F,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,MAAM,IAAI,GAAI,CAA2B,EAAE,IAAI,CAAC;YAChD,IAAI,IAAI,KAAK,QAAQ;gBAAE,SAAS;YAChC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACnB,GAAG,CAAC,uCAAuC,KAAK,KAAK,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACvG,CAAC;IACL,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Environment variable that relocates the run-artifact tree.
3
+ *
4
+ * Why it has to exist: the default root is resolved against `process.cwd()`, and on a
5
+ * symlink-swap deploy the working directory IS the release directory. A deploy points the symlink
6
+ * at a fresh release and prunes the old ones, so every run artifact under the previous release is
7
+ * first orphaned and then deleted — measured live 2026-09-13, where a connector refresh's 652-event
8
+ * journal existed one minute before a deploy and the run listing returned `0 run(s)` immediately
9
+ * after. The artifacts survive the RSU's own pm2 restart (the symlink does not move) but not a
10
+ * deploy, which is exactly backwards from what an operator needs.
11
+ *
12
+ * Point this at a path OUTSIDE the swappable release directory (a sibling of `current`, alongside
13
+ * the environment file a deploy already treats as durable) and the run history outlives the deploy
14
+ * that would otherwise destroy the evidence.
15
+ */
16
+ export declare const RUN_ARTIFACT_ROOT_ENV_VAR = "MJ_INTEGRATION_RUN_ARTIFACT_ROOT";
17
+ /**
18
+ * The root directory for run artifacts: {@link RUN_ARTIFACT_ROOT_ENV_VAR} when set, otherwise
19
+ * today's `<cwd>/logs/integration-runs`.
20
+ *
21
+ * Read on EVERY call rather than captured at module load. The emitter that writes a run and the
22
+ * reader that resumes or lists it are constructed at different moments in the process's life — and
23
+ * in the RSU's case, in different processes — so a value frozen at import time is a way for one
24
+ * half to read a different directory than the other half wrote. (Contrast `MJ_INTEGRATION_MAX_RUN_DIRS`,
25
+ * which is a number and genuinely can be read once.)
26
+ */
27
+ export declare function DefaultRunArtifactRoot(): string;
28
+ //# sourceMappingURL=RunArtifactRoot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RunArtifactRoot.d.ts","sourceRoot":"","sources":["../src/RunArtifactRoot.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,yBAAyB,qCAAqC,CAAC;AAE5E;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAK/C"}
@@ -0,0 +1,35 @@
1
+ import { join } from 'node:path';
2
+ /**
3
+ * Environment variable that relocates the run-artifact tree.
4
+ *
5
+ * Why it has to exist: the default root is resolved against `process.cwd()`, and on a
6
+ * symlink-swap deploy the working directory IS the release directory. A deploy points the symlink
7
+ * at a fresh release and prunes the old ones, so every run artifact under the previous release is
8
+ * first orphaned and then deleted — measured live 2026-09-13, where a connector refresh's 652-event
9
+ * journal existed one minute before a deploy and the run listing returned `0 run(s)` immediately
10
+ * after. The artifacts survive the RSU's own pm2 restart (the symlink does not move) but not a
11
+ * deploy, which is exactly backwards from what an operator needs.
12
+ *
13
+ * Point this at a path OUTSIDE the swappable release directory (a sibling of `current`, alongside
14
+ * the environment file a deploy already treats as durable) and the run history outlives the deploy
15
+ * that would otherwise destroy the evidence.
16
+ */
17
+ export const RUN_ARTIFACT_ROOT_ENV_VAR = 'MJ_INTEGRATION_RUN_ARTIFACT_ROOT';
18
+ /**
19
+ * The root directory for run artifacts: {@link RUN_ARTIFACT_ROOT_ENV_VAR} when set, otherwise
20
+ * today's `<cwd>/logs/integration-runs`.
21
+ *
22
+ * Read on EVERY call rather than captured at module load. The emitter that writes a run and the
23
+ * reader that resumes or lists it are constructed at different moments in the process's life — and
24
+ * in the RSU's case, in different processes — so a value frozen at import time is a way for one
25
+ * half to read a different directory than the other half wrote. (Contrast `MJ_INTEGRATION_MAX_RUN_DIRS`,
26
+ * which is a number and genuinely can be read once.)
27
+ */
28
+ export function DefaultRunArtifactRoot() {
29
+ const configured = process.env[RUN_ARTIFACT_ROOT_ENV_VAR];
30
+ const trimmed = configured?.trim();
31
+ if (trimmed)
32
+ return trimmed;
33
+ return join(process.cwd(), 'logs', 'integration-runs');
34
+ }
35
+ //# sourceMappingURL=RunArtifactRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RunArtifactRoot.js","sourceRoot":"","sources":["../src/RunArtifactRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,kCAAkC,CAAC;AAE5E;;;;;;;;;GASG;AACH,MAAM,UAAU,sBAAsB;IAClC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,UAAU,EAAE,IAAI,EAAE,CAAC;IACnC,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC;IAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAC3D,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './types.js';
2
- export { IntegrationProgressEmitter } from './IntegrationProgressEmitter.js';
2
+ export { DefaultRunArtifactRoot, RUN_ARTIFACT_ROOT_ENV_VAR } from './RunArtifactRoot.js';
3
+ export { IntegrationProgressEmitter, IntegrationRunResumeError } from './IntegrationProgressEmitter.js';
3
4
  export type { EmitterOptions } from './IntegrationProgressEmitter.js';
4
5
  export { IntegrationProgressReader } from './IntegrationProgressReader.js';
5
6
  export { SweepInterruptedRuns } from './IntegrationRunReconciler.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,YAAY,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACxG,YAAY,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './types.js';
2
- export { IntegrationProgressEmitter } from './IntegrationProgressEmitter.js';
2
+ export { DefaultRunArtifactRoot, RUN_ARTIFACT_ROOT_ENV_VAR } from './RunArtifactRoot.js';
3
+ export { IntegrationProgressEmitter, IntegrationRunResumeError } from './IntegrationProgressEmitter.js';
3
4
  export { IntegrationProgressReader } from './IntegrationProgressReader.js';
4
5
  export { SweepInterruptedRuns } from './IntegrationRunReconciler.js';
5
6
  //# sourceMappingURL=index.js.map