@camstack/addon-post-analysis 1.2.314 → 1.2.315

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.
@@ -27145,6 +27145,22 @@ var NcLivenessLedger = class {
27145
27145
  snapshot() {
27146
27146
  return this.ledger.snapshot().toSorted((a, b) => a.subject.localeCompare(b.subject));
27147
27147
  }
27148
+ /**
27149
+ * Drop durable `node:<node>/<child>` rows an older build left behind when
27150
+ * `worker.*` was folded into the node kinds (pre-R1-H1). A runner is not a
27151
+ * node; those subjects can never flip back to online under today's intake,
27152
+ * so an offline leftover would poison the state summary forever. Returns
27153
+ * how many rows were forgotten.
27154
+ */
27155
+ async forgetWorkerNodeSubjects() {
27156
+ let forgotten = 0;
27157
+ for (const row of this.ledger.snapshot()) {
27158
+ if (!row.subject.startsWith("node:") || !row.subject.includes("/")) continue;
27159
+ await this.ledger.forget(row.subject);
27160
+ forgotten += 1;
27161
+ }
27162
+ return forgotten;
27163
+ }
27148
27164
  /** The state the ledger currently accepts for a subject, if any. */
27149
27165
  stateOf(subject) {
27150
27166
  return this.ledger.get(subject)?.state;
@@ -33846,6 +33862,7 @@ function alertItem(section, open) {
33846
33862
  }
33847
33863
  function livenessItem(row, lookup) {
33848
33864
  if (row.subject.startsWith("node:")) {
33865
+ if (row.subject.includes("/")) return null;
33849
33866
  const nodeId = row.subject.slice(5);
33850
33867
  return {
33851
33868
  section: "nodes",
@@ -40633,11 +40650,13 @@ var NotificationCenter = class {
40633
40650
  */
40634
40651
  async hydrateLiveness() {
40635
40652
  const subjects = await this.liveness.load();
40653
+ const forgottenWorkers = await this.liveness.forgetWorkerNodeSubjects();
40636
40654
  const seeded = this.liveness.seedFromDirectory(this.deviceDirectory.all(), this.now());
40637
40655
  this.logger.info("liveness ledger reseeded", { meta: {
40638
40656
  subjects,
40639
40657
  seededFromDirectory: seeded,
40640
- directory: this.deviceDirectory.size()
40658
+ directory: this.deviceDirectory.size(),
40659
+ ...forgottenWorkers > 0 ? { forgottenWorkerNodeSubjects: forgottenWorkers } : {}
40641
40660
  } });
40642
40661
  }
40643
40662
  /**
@@ -27122,6 +27122,22 @@ var NcLivenessLedger = class {
27122
27122
  snapshot() {
27123
27123
  return this.ledger.snapshot().toSorted((a, b) => a.subject.localeCompare(b.subject));
27124
27124
  }
27125
+ /**
27126
+ * Drop durable `node:<node>/<child>` rows an older build left behind when
27127
+ * `worker.*` was folded into the node kinds (pre-R1-H1). A runner is not a
27128
+ * node; those subjects can never flip back to online under today's intake,
27129
+ * so an offline leftover would poison the state summary forever. Returns
27130
+ * how many rows were forgotten.
27131
+ */
27132
+ async forgetWorkerNodeSubjects() {
27133
+ let forgotten = 0;
27134
+ for (const row of this.ledger.snapshot()) {
27135
+ if (!row.subject.startsWith("node:") || !row.subject.includes("/")) continue;
27136
+ await this.ledger.forget(row.subject);
27137
+ forgotten += 1;
27138
+ }
27139
+ return forgotten;
27140
+ }
27125
27141
  /** The state the ledger currently accepts for a subject, if any. */
27126
27142
  stateOf(subject) {
27127
27143
  return this.ledger.get(subject)?.state;
@@ -33823,6 +33839,7 @@ function alertItem(section, open) {
33823
33839
  }
33824
33840
  function livenessItem(row, lookup) {
33825
33841
  if (row.subject.startsWith("node:")) {
33842
+ if (row.subject.includes("/")) return null;
33826
33843
  const nodeId = row.subject.slice(5);
33827
33844
  return {
33828
33845
  section: "nodes",
@@ -40610,11 +40627,13 @@ var NotificationCenter = class {
40610
40627
  */
40611
40628
  async hydrateLiveness() {
40612
40629
  const subjects = await this.liveness.load();
40630
+ const forgottenWorkers = await this.liveness.forgetWorkerNodeSubjects();
40613
40631
  const seeded = this.liveness.seedFromDirectory(this.deviceDirectory.all(), this.now());
40614
40632
  this.logger.info("liveness ledger reseeded", { meta: {
40615
40633
  subjects,
40616
40634
  seededFromDirectory: seeded,
40617
- directory: this.deviceDirectory.size()
40635
+ directory: this.deviceDirectory.size(),
40636
+ ...forgottenWorkers > 0 ? { forgottenWorkerNodeSubjects: forgottenWorkers } : {}
40618
40637
  } });
40619
40638
  }
40620
40639
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-post-analysis",
3
- "version": "1.2.314",
3
+ "version": "1.2.315",
4
4
  "description": "Post-Analysis bundle — enrichment, embedding-encoder, pipeline-analytics. Multi-entry npm package shipping addons that consume pipeline output.",
5
5
  "keywords": [
6
6
  "camstack",