@openinc/parse-server-opendash 4.8.3 → 4.8.5

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.
@@ -10,6 +10,8 @@ export interface PassReport {
10
10
  skipped: number;
11
11
  /** Non-fatal oddities worth a human look — unparseable values, missing refs. */
12
12
  warnings: string[];
13
+ /** Every warning raised, including those `warnings` no longer samples. */
14
+ warningCount: number;
13
15
  /** Pass-level summary lines. Never suppressed — see `Report.info`. */
14
16
  notes: string[];
15
17
  /** Fatal per-row failures; the pass continues, the run is marked failed. */
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Report = void 0;
4
+ /** Closes a pass's warning sample once the cap is reached. */
5
+ const SUPPRESSED = "… further warnings suppressed";
4
6
  class Report {
5
7
  passes = [];
6
8
  current;
@@ -11,6 +13,7 @@ class Report {
11
13
  updated: 0,
12
14
  skipped: 0,
13
15
  warnings: [],
16
+ warningCount: 0,
14
17
  notes: [],
15
18
  errors: [],
16
19
  startedAt: new Date().toISOString(),
@@ -23,9 +26,11 @@ class Report {
23
26
  if (!this.current)
24
27
  return;
25
28
  this.current.finishedAt = new Date().toISOString();
26
- const { created, updated, skipped, warnings, errors } = this.current;
29
+ const { created, updated, skipped, warnings, warningCount, errors } = this.current;
30
+ const shown = warnings.filter((w) => w !== SUPPRESSED).length;
27
31
  console.log(` created ${created} · updated ${updated} · skipped ${skipped}` +
28
- `${warnings.length ? ` · ${warnings.length} warning(s)` : ""}` +
32
+ `${warningCount ? ` · ${warningCount} warning(s)` : ""}` +
33
+ `${warningCount > shown ? ` (${shown} shown)` : ""}` +
29
34
  `${errors.length ? ` · ${errors.length} ERROR(S)` : ""}`);
30
35
  this.current = undefined;
31
36
  }
@@ -43,12 +48,13 @@ class Report {
43
48
  }
44
49
  /** A capped sample of per-row warnings. */
45
50
  warn(report, message, cap = 25) {
51
+ report.warningCount += 1;
46
52
  if (report.warnings.length < cap) {
47
53
  report.warnings.push(message);
48
54
  console.warn(` ! ${message}`);
49
55
  }
50
56
  else if (report.warnings.length === cap) {
51
- report.warnings.push(`… further warnings suppressed`);
57
+ report.warnings.push(SUPPRESSED);
52
58
  console.warn(` ! further warnings suppressed`);
53
59
  }
54
60
  }
@@ -300,7 +300,46 @@ export declare class PlanIndex {
300
300
  private readonly plans;
301
301
  static load(config: ReadScope): Promise<PlanIndex>;
302
302
  plan(v1PlanId: string): Maintenance_Schedule | undefined;
303
- /** The v1 plan id an execution belongs to, if any. */
303
+ /**
304
+ * The v1 plan id an execution belongs to, if any — possibly a plan that no
305
+ * longer exists (see {@link executionHome}). It still decides the step ids
306
+ * and whether the run counts as a plan run.
307
+ */
304
308
  resolve(execution: Maintenance_Schedule_Execution): string | undefined;
305
309
  }
310
+ /**
311
+ * The ids of every `OD3_Source` that still exists.
312
+ *
313
+ * Unscoped on purpose: under `--tenant`, a source of another tenant is not a
314
+ * deleted one.
315
+ */
316
+ export declare function existingSourceIds(batchSize: number): Promise<Set<string>>;
317
+ export type ExecutionHome = {
318
+ home: "plan";
319
+ v1PlanId: string;
320
+ } | {
321
+ home: "machine";
322
+ v1SourceId: string;
323
+ deletedPlanId?: string;
324
+ } | {
325
+ home: "nowhere";
326
+ reason: string;
327
+ };
328
+ /**
329
+ * Where a v1 execution lives in v2.
330
+ *
331
+ * - **plan** — its plan still exists, so pass 14 migrated it.
332
+ * - **machine** — no plan, or a plan that was deleted. v1 deleted a plan
333
+ * without its runs (the `beforeDelete` in `hooks/Maintenance_Schedule.ts`
334
+ * has no cascade), and its machine log lists executions by `source`, so a
335
+ * deleted plan's protocols stayed visible there. v2's counterpart is a
336
+ * direct maintenance on the machine; `deletedPlanId` records that it was
337
+ * once a plan run.
338
+ * - **nowhere** — neither a surviving plan nor a surviving source. v1 showed
339
+ * such a run nowhere, and v2 refuses an execution about nothing.
340
+ *
341
+ * Shared by pass 15 and `verify.ts`, so the check expects exactly what the
342
+ * pass writes.
343
+ */
344
+ export declare function executionHome(execution: Maintenance_Schedule_Execution, plans: PlanIndex, sources: ReadonlySet<string>): ExecutionHome;
306
345
  export {};
@@ -24,6 +24,8 @@ exports.v1Recipients = v1Recipients;
24
24
  exports.notificationRules = notificationRules;
25
25
  exports.classifyExecution = classifyExecution;
26
26
  exports.executionStepsByExecution = executionStepsByExecution;
27
+ exports.existingSourceIds = existingSourceIds;
28
+ exports.executionHome = executionHome;
27
29
  const node_crypto_1 = require("node:crypto");
28
30
  const node_1 = __importDefault(require("parse/node"));
29
31
  const index_js_1 = require("../../../types/index.js");
@@ -598,7 +600,11 @@ class PlanIndex {
598
600
  plan(v1PlanId) {
599
601
  return this.plans.get(v1PlanId);
600
602
  }
601
- /** The v1 plan id an execution belongs to, if any. */
603
+ /**
604
+ * The v1 plan id an execution belongs to, if any — possibly a plan that no
605
+ * longer exists (see {@link executionHome}). It still decides the step ids
606
+ * and whether the run counts as a plan run.
607
+ */
602
608
  resolve(execution) {
603
609
  const direct = (0, pass_js_1.refId)(execution.get("schedule"));
604
610
  if (direct)
@@ -611,3 +617,47 @@ class PlanIndex {
611
617
  }
612
618
  }
613
619
  exports.PlanIndex = PlanIndex;
620
+ /**
621
+ * The ids of every `OD3_Source` that still exists.
622
+ *
623
+ * Unscoped on purpose: under `--tenant`, a source of another tenant is not a
624
+ * deleted one.
625
+ */
626
+ async function existingSourceIds(batchSize) {
627
+ const rows = await (0, pass_js_1.all)(() => new node_1.default.Query(index_js_1.Source).select("objectId"), batchSize);
628
+ return new Set(rows.flatMap((row) => (row.id ? [row.id] : [])));
629
+ }
630
+ /**
631
+ * Where a v1 execution lives in v2.
632
+ *
633
+ * - **plan** — its plan still exists, so pass 14 migrated it.
634
+ * - **machine** — no plan, or a plan that was deleted. v1 deleted a plan
635
+ * without its runs (the `beforeDelete` in `hooks/Maintenance_Schedule.ts`
636
+ * has no cascade), and its machine log lists executions by `source`, so a
637
+ * deleted plan's protocols stayed visible there. v2's counterpart is a
638
+ * direct maintenance on the machine; `deletedPlanId` records that it was
639
+ * once a plan run.
640
+ * - **nowhere** — neither a surviving plan nor a surviving source. v1 showed
641
+ * such a run nowhere, and v2 refuses an execution about nothing.
642
+ *
643
+ * Shared by pass 15 and `verify.ts`, so the check expects exactly what the
644
+ * pass writes.
645
+ */
646
+ function executionHome(execution, plans, sources) {
647
+ const v1PlanId = plans.resolve(execution);
648
+ if (v1PlanId && plans.plan(v1PlanId))
649
+ return { home: "plan", v1PlanId };
650
+ const v1SourceId = (0, pass_js_1.refId)(execution.get("source"));
651
+ if (v1SourceId && sources.has(v1SourceId)) {
652
+ return {
653
+ home: "machine",
654
+ v1SourceId,
655
+ ...(v1PlanId ? { deletedPlanId: v1PlanId } : {}),
656
+ };
657
+ }
658
+ const plan = v1PlanId ? `its plan ${v1PlanId} was deleted` : "it has no plan";
659
+ const source = v1SourceId
660
+ ? `its source ${v1SourceId} no longer exists`
661
+ : "it names no source";
662
+ return { home: "nowhere", reason: `${plan} and ${source}` };
663
+ }
@@ -259,9 +259,17 @@ exports.pass03 = {
259
259
  report.error(entry, `source ${id} sits in a parent cycle`);
260
260
  }
261
261
  }
262
- const ancestorsAdded = needed.size - referenced.size;
263
- report.info(entry, `${referenced.size} referenced source(s) + ${ancestorsAdded} ancestor(s) = ` +
262
+ // v1 deleted sources without what points at them.
263
+ const deleted = [...referenced].filter((id) => !byId.has(id));
264
+ const existing = referenced.size - deleted.length;
265
+ report.info(entry, `${existing} referenced source(s) + ${needed.size - existing} ancestor(s) = ` +
264
266
  `${needed.size} equipment; ${allSources.length - needed.size} source(s) skipped (D3)`);
267
+ if (deleted.length) {
268
+ report.info(entry, `${deleted.length} reference(s) point at deleted source(s) ` +
269
+ `(${deleted.slice(0, 10).join(", ")}${deleted.length > 10 ? ", …" : ""}) ` +
270
+ `— tickets on them keep no machine, executions on them without a ` +
271
+ `surviving plan are not migrated (pass 15)`);
272
+ }
265
273
  // Parents before children, so `Equipment.parent` can resolve through the map.
266
274
  const depth = (id) => {
267
275
  let d = 0;
@@ -282,6 +290,21 @@ exports.pass03 = {
282
290
  .sort((a, b) => depth(a.id) - depth(b.id));
283
291
  // sourceId -> equipment id, for the SourceMeta step below.
284
292
  const equipmentBySource = new Map();
293
+ // v2's header picker matches equipment by `sourceTags` and adds the
294
+ // descendants of every match, so a tagless equipment below a tagged
295
+ // ancestor is still reachable; only a lineage without any tag is not.
296
+ const tagAbove = (id) => {
297
+ let cursor = (0, pass_js_1.refId)(byId.get(id)?.get("parent"));
298
+ const guard = new Set();
299
+ while (cursor && byId.has(cursor) && !guard.has(cursor)) {
300
+ guard.add(cursor);
301
+ if (byId.get(cursor).get("tag"))
302
+ return true;
303
+ cursor = (0, pass_js_1.refId)(byId.get(cursor).get("parent"));
304
+ }
305
+ return false;
306
+ };
307
+ let inheritsTag = 0;
285
308
  for (const source of ordered) {
286
309
  const sourceId = source.id;
287
310
  if (!sourceId)
@@ -312,8 +335,12 @@ exports.pass03 = {
312
335
  if (parentPtr)
313
336
  target.set("parent", parentPtr);
314
337
  if (!source.get("tag")) {
315
- report.warn(entry, `source ${sourceId} ("${source.get("name")}") has no tag — the equipment ` +
316
- `will not match any source at read time`);
338
+ if (tagAbove(sourceId))
339
+ inheritsTag += 1;
340
+ else {
341
+ report.warn(entry, `source ${sourceId} ("${source.get("name")}") has no tag and neither has any ` +
342
+ `ancestor — the equipment will not show in the header's equipment picker`);
343
+ }
317
344
  }
318
345
  if (!existingId) {
319
346
  target.setACL((0, acl_js_1.migrationAcl)({ tenantId, allowTenantUserWrite: true }));
@@ -347,6 +374,10 @@ exports.pass03 = {
347
374
  continue;
348
375
  }
349
376
  }
377
+ if (inheritsTag > 0) {
378
+ report.info(entry, `${inheritsTag} equipment without a tag of their own sit below a tagged ` +
379
+ `parent — the header picker reaches them through it`);
380
+ }
350
381
  // Header data last: it needs the equipment ids this loop just handed out.
351
382
  await migrateSourceMeta(ctx, allSources, equipmentBySource);
352
383
  },
@@ -12,6 +12,8 @@ const ptr_js_1 = require("../lib/ptr.js");
12
12
  const latest_js_1 = require("../lib/latest.js");
13
13
  const message_js_1 = require("../lib/message.js");
14
14
  const pass_js_1 = require("../lib/pass.js");
15
+ /** The chat text of a v1 comment that was only attachments. */
16
+ const attachmentOnlyText = (count) => count === 1 ? "Anhang" : `${count} Anhänge`;
15
17
  /**
16
18
  * Pass 10 — v1 comments → `OD3_Chat_Message`, with their media as attachments.
17
19
  *
@@ -66,6 +68,7 @@ exports.pass10 = {
66
68
  });
67
69
  let orphaned = 0;
68
70
  let attachmentsMigrated = 0;
71
+ let attachmentOnly = 0;
69
72
  for (const message of ordered) {
70
73
  const sourceId = message.id;
71
74
  if (!sourceId)
@@ -88,37 +91,8 @@ exports.pass10 = {
88
91
  const tenantIdOfMessage = (0, pass_js_1.refId)(message.get("tenant"));
89
92
  const authorId = (0, pass_js_1.refId)(message.get("user"));
90
93
  const contextString = (0, ptr_js_1.contextToString)((0, ptr_js_1.ticketContext)(newTicketId));
91
- // v1 had a title and a body; the chat has one text field. A real subject
92
- // becomes a bold first line — but v1 stores an i18n *key* there when the user
93
- // left the subject blank, and rendering that key would be visible nonsense.
94
- // See lib/message.ts.
95
- const text = (0, message_js_1.chatText)(message);
96
- if (!text) {
97
- // `Chat_Message.text` is required.
98
- report.warn(entry, `message ${sourceId} has no usable text — skipped`);
99
- entry.skipped++;
100
- continue;
101
- }
102
- target.set("context", contextString);
103
- target.set("text", text);
104
- target.set("deleted", false);
105
- if (authorId)
106
- target.set("author", (0, ptr_js_1.userPtr)(authorId));
107
- if (tenantIdOfMessage) {
108
- target.set("tenant", (0, ptr_js_1.tenantPtr)(tenantIdOfMessage));
109
- }
110
- const replyToSourceId = (0, pass_js_1.refId)(message.get("replyTo"));
111
- const replyToTargetId = replyToSourceId
112
- ? map.get(index_js_1.Maintenance_Message.className, replyToSourceId)
113
- : undefined;
114
- const parentPtr = (0, ptr_js_1.maybePtr)(index_js_1.Chat_Message.className, replyToTargetId);
115
- if (parentPtr)
116
- target.set("parent", parentPtr);
117
- else if (replyToSourceId) {
118
- report.warn(entry, `message ${sourceId} replies to ${replyToSourceId}, which was not migrated ` +
119
- `— it becomes a top-level comment`);
120
- }
121
94
  // ── media → Assets rows + attachments ──────────────────────────────────
95
+ // Before the text: a v1 comment can be a photo and nothing else.
122
96
  const attachments = [];
123
97
  const mediaRows = (await (0, latest_js_1.relationObjects)(message, "media", config.batchSize));
124
98
  for (const media of mediaRows) {
@@ -180,6 +154,41 @@ exports.pass10 = {
180
154
  }
181
155
  if (attachments.length)
182
156
  target.set("attachments", attachments);
157
+ // v1 had a title and a body; the chat has one text field. A real subject
158
+ // becomes a bold first line — but v1 stores an i18n *key* there when the user
159
+ // left the subject blank, and rendering that key would be visible nonsense.
160
+ // See lib/message.ts.
161
+ let text = (0, message_js_1.chatText)(message);
162
+ if (!text && attachments.length) {
163
+ // `Chat_Message.text` is required, so an attachment-only comment says
164
+ // what it is rather than being dropped along with its files.
165
+ text = attachmentOnlyText(attachments.length);
166
+ attachmentOnly += 1;
167
+ }
168
+ if (!text) {
169
+ report.warn(entry, `message ${sourceId} has no text and no attachment — skipped`);
170
+ entry.skipped++;
171
+ continue;
172
+ }
173
+ target.set("context", contextString);
174
+ target.set("text", text);
175
+ target.set("deleted", false);
176
+ if (authorId)
177
+ target.set("author", (0, ptr_js_1.userPtr)(authorId));
178
+ if (tenantIdOfMessage) {
179
+ target.set("tenant", (0, ptr_js_1.tenantPtr)(tenantIdOfMessage));
180
+ }
181
+ const replyToSourceId = (0, pass_js_1.refId)(message.get("replyTo"));
182
+ const replyToTargetId = replyToSourceId
183
+ ? map.get(index_js_1.Maintenance_Message.className, replyToSourceId)
184
+ : undefined;
185
+ const parentPtr = (0, ptr_js_1.maybePtr)(index_js_1.Chat_Message.className, replyToTargetId);
186
+ if (parentPtr)
187
+ target.set("parent", parentPtr);
188
+ else if (replyToSourceId) {
189
+ report.warn(entry, `message ${sourceId} replies to ${replyToSourceId}, which was not migrated ` +
190
+ `— it becomes a top-level comment`);
191
+ }
183
192
  if (!existingId) {
184
193
  target.setACL((0, acl_js_1.migrationAcl)({
185
194
  tenantId: tenantIdOfMessage,
@@ -222,6 +231,10 @@ exports.pass10 = {
222
231
  report.info(entry, `${orphaned} message(s) referenced an object that is not a migrated ticket ` +
223
232
  `(v1 'referencedObjectId' is not ticket-only) — skipped`);
224
233
  }
234
+ if (attachmentOnly > 0) {
235
+ report.info(entry, `${attachmentOnly} comment(s) were attachments only — written with the ` +
236
+ `text "${attachmentOnlyText(1)}" / "${attachmentOnlyText(2)}"`);
237
+ }
225
238
  if (attachmentsMigrated > 0) {
226
239
  report.info(entry, `${attachmentsMigrated} Maintenance_Media file(s) became Assets rows in the ` +
227
240
  `ticket context`);
@@ -23,6 +23,14 @@ import { type Pass } from "../lib/pass.js";
23
23
  * thing since 2026-09-25: no `schedule`, the machine in `equipment`, its own
24
24
  * title, description and steps.
25
25
  *
26
+ * A run of a **deleted** plan becomes one too. v1 deleted plans without their
27
+ * runs, and its machine log kept listing them by source; there is no plan left
28
+ * to hang them on, and the protocol is complete without it, because the steps
29
+ * were frozen onto the run. It keeps the template's title and is still
30
+ * classified as a plan run. A run with neither a surviving plan nor a
31
+ * surviving source was visible nowhere in v1 and is not migrated. See
32
+ * `executionHome`.
33
+ *
26
34
  * v1 recorded material per *execution*, v2 per *step*. It goes onto one
27
35
  * synthetic, completed step at the end ("Verbrauchtes Material"), because
28
36
  * attaching it to a real step would claim that step consumed it. The
@@ -40,6 +40,14 @@ const DIRECT_TITLE = "Direkte Wartung";
40
40
  * thing since 2026-09-25: no `schedule`, the machine in `equipment`, its own
41
41
  * title, description and steps.
42
42
  *
43
+ * A run of a **deleted** plan becomes one too. v1 deleted plans without their
44
+ * runs, and its machine log kept listing them by source; there is no plan left
45
+ * to hang them on, and the protocol is complete without it, because the steps
46
+ * were frozen onto the run. It keeps the template's title and is still
47
+ * classified as a plan run. A run with neither a surviving plan nor a
48
+ * surviving source was visible nowhere in v1 and is not migrated. See
49
+ * `executionHome`.
50
+ *
43
51
  * v1 recorded material per *execution*, v2 per *step*. It goes onto one
44
52
  * synthetic, completed step at the end ("Verbrauchtes Material"), because
45
53
  * attaching it to a real step would claim that step consumed it. The
@@ -54,15 +62,18 @@ exports.pass15 = {
54
62
  needs: ["03", "05", "14"],
55
63
  async run({ config, map, report, entry }) {
56
64
  const plans = await schedule_js_1.PlanIndex.load(config);
65
+ const sources = await (0, schedule_js_1.existingSourceIds)(config.batchSize);
57
66
  const stepsByExecution = await (0, schedule_js_1.executionStepsByExecution)(config);
58
67
  let completed = 0;
59
68
  let open = 0;
60
69
  let direct = 0;
70
+ let ofDeletedPlan = 0;
71
+ let homeless = 0;
61
72
  let viaTemplate = 0;
62
73
  let withMaterial = 0;
63
74
  const abandoned = new Map();
64
75
  let legacySteps = 0;
65
- for await (const page of (0, pass_js_1.pages)(() => (0, pass_js_1.scopeToTenant)(new node_1.default.Query(index_js_1.Maintenance_Schedule_Execution), config.tenantId), config.batchSize)) {
76
+ for await (const page of (0, pass_js_1.pages)(() => (0, pass_js_1.scopeToTenant)(new node_1.default.Query(index_js_1.Maintenance_Schedule_Execution), config.tenantId).include("origin"), config.batchSize)) {
66
77
  for (const execution of page) {
67
78
  const sourceId = execution.id;
68
79
  if (!sourceId)
@@ -78,13 +89,20 @@ exports.pass15 = {
78
89
  continue;
79
90
  }
80
91
  // ── where it belongs: a plan, or a machine ─────────────────────────
92
+ const home = (0, schedule_js_1.executionHome)(execution, plans, sources);
93
+ if (home.home === "nowhere") {
94
+ homeless += 1;
95
+ report.warn(entry, `${label} not migrated: ${home.reason} — v1 showed it nowhere`);
96
+ entry.skipped++;
97
+ continue;
98
+ }
81
99
  const v1Plan = v1PlanId ? plans.plan(v1PlanId) : undefined;
82
100
  let placement;
83
- if (v1PlanId) {
84
- const planId = map.get(index_js_1.Maintenance_Schedule.className, v1PlanId);
101
+ if (home.home === "plan") {
102
+ const planId = map.get(index_js_1.Maintenance_Schedule.className, home.v1PlanId);
85
103
  if (!planId) {
86
- report.error(entry, `${label} belongs to plan ${v1PlanId}, which has no migrated ` +
87
- `counterpart — run pass 14 first`);
104
+ report.error(entry, `${label} belongs to plan ${home.v1PlanId}, which has no ` +
105
+ `migrated counterpart — run pass 14 first`);
88
106
  entry.skipped++;
89
107
  continue;
90
108
  }
@@ -96,22 +114,17 @@ exports.pass15 = {
96
114
  };
97
115
  }
98
116
  else {
99
- const v1SourceId = (0, pass_js_1.refId)(execution.get("source"));
100
- const equipmentId = v1SourceId
101
- ? map.get(index_js_1.Source.className, v1SourceId)
102
- : undefined;
117
+ const equipmentId = map.get(index_js_1.Source.className, home.v1SourceId);
103
118
  if (!equipmentId) {
104
- // v2 refuses an execution about nothing: without a plan it needs
105
- // the machine, or no view can place it.
106
- report.error(entry, `${label} has no plan and ` +
107
- (v1SourceId
108
- ? `its source ${v1SourceId} has no Equipment (run pass 03 first)`
109
- : `no source`) +
110
- ` — v2 needs one of the two, skipped`);
119
+ report.error(entry, `${label}: source ${home.v1SourceId} has no Equipment — run ` +
120
+ `pass 03 first`);
111
121
  entry.skipped++;
112
122
  continue;
113
123
  }
114
- direct += 1;
124
+ if (home.deletedPlanId)
125
+ ofDeletedPlan += 1;
126
+ else
127
+ direct += 1;
115
128
  placement = {
116
129
  field: "equipment",
117
130
  pointer: (0, ptr_js_1.ptr)(index_js_1.Service_Equipment.className, equipmentId),
@@ -171,8 +184,11 @@ exports.pass15 = {
171
184
  // ── the record ─────────────────────────────────────────────────────
172
185
  const userId = (0, pass_js_1.refId)(execution.get("user"));
173
186
  target.set(placement.field, placement.pointer);
187
+ // A plan run shows its plan's title; on the machine it needs its own.
188
+ const templateTitle = String(execution.get("origin")?.get("title") ??
189
+ "").trim();
174
190
  const title = String(execution.get("title") ?? "").trim() ||
175
- (v1PlanId ? "" : DIRECT_TITLE);
191
+ (home.home === "plan" ? "" : templateTitle || DIRECT_TITLE);
176
192
  if (title)
177
193
  target.set("title", title);
178
194
  if (execution.get("description")) {
@@ -226,6 +242,15 @@ exports.pass15 = {
226
242
  }
227
243
  report.info(entry, `${completed} protocol(s), ${open} open run(s), of them ${direct} direct ` +
228
244
  `maintenance(s) without a plan`);
245
+ if (ofDeletedPlan > 0) {
246
+ report.info(entry, `${ofDeletedPlan} run(s) of deleted v1 plans → direct maintenance on ` +
247
+ `their machine (v1 deleted plans without their runs; its machine ` +
248
+ `log kept showing them)`);
249
+ }
250
+ if (homeless > 0) {
251
+ report.info(entry, `${homeless} run(s) with neither a surviving plan nor a surviving ` +
252
+ `source not migrated — v1 showed them nowhere`);
253
+ }
229
254
  for (const [reason, count] of abandoned) {
230
255
  report.info(entry, `${count} abandoned run(s) not migrated — ${reason}`);
231
256
  }
@@ -189,7 +189,8 @@ const checks = [
189
189
  return comments === migrated
190
190
  ? undefined
191
191
  : `${comments} human v1 comment(s) vs ${migrated} chat message(s) — the ` +
192
- `difference should equal pass 10's "not a migrated ticket" skips`;
192
+ `difference should equal pass 10's "not a migrated ticket" and ` +
193
+ `"no text and no attachment" skips`;
193
194
  },
194
195
  },
195
196
  // ── Required fields ──────────────────────────────────────────────────────
@@ -792,21 +793,25 @@ const checks = [
792
793
  },
793
794
  },
794
795
  {
795
- name: "every v1 execution was migrated, except the abandoned runs",
796
+ name: "every v1 execution was migrated, except the abandoned and homeless runs",
796
797
  hard: true,
797
798
  async run(tenantId, batchSize) {
798
799
  // The same classification pass 15 applies — imported, so the check
799
800
  // cannot disagree with the pass it checks.
800
801
  const scope = { tenantId, batchSize };
801
802
  const plans = await schedule_js_1.PlanIndex.load(scope);
803
+ const sources = await (0, schedule_js_1.existingSourceIds)(batchSize);
802
804
  const stepsByExecution = await (0, schedule_js_1.executionStepsByExecution)(scope);
803
805
  let expected = 0;
804
806
  let abandoned = 0;
807
+ let homeless = 0;
805
808
  for await (const page of (0, pass_js_1.pages)(() => (0, pass_js_1.scopeToTenant)(new node_1.default.Query(index_js_1.Maintenance_Schedule_Execution), tenantId), batchSize)) {
806
809
  for (const execution of page) {
807
810
  const fate = (0, schedule_js_1.classifyExecution)(execution, stepsByExecution.get(execution.id ?? "") ?? [], !!plans.resolve(execution));
808
811
  if (fate.fate === "abandoned")
809
812
  abandoned += 1;
813
+ else if ((0, schedule_js_1.executionHome)(execution, plans, sources).home === "nowhere")
814
+ homeless += 1;
810
815
  else
811
816
  expected += 1;
812
817
  }
@@ -814,8 +819,8 @@ const checks = [
814
819
  const migrated = await migratedCount(index_js_1.Maintenance_Schedule_Execution.className, batchSize);
815
820
  return migrated >= expected
816
821
  ? undefined
817
- : `${expected} v1 execution(s) to migrate (${abandoned} abandoned left ` +
818
- `out) but only ${migrated} mapping(s)`;
822
+ : `${expected} v1 execution(s) to migrate (${abandoned} abandoned and ` +
823
+ `${homeless} homeless left out) but only ${migrated} mapping(s)`;
819
824
  },
820
825
  },
821
826
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openinc/parse-server-opendash",
3
- "version": "4.8.3",
3
+ "version": "4.8.5",
4
4
  "description": "Parse Server Cloud Code for open.INC Stack.",
5
5
  "packageManager": "pnpm@11.25.0",
6
6
  "keywords": [