@camstack/addon-notifiers 1.2.42 → 1.2.43

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.
package/dist/addon.js CHANGED
@@ -13377,6 +13377,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13377
13377
  limit: number().optional(),
13378
13378
  tags: record(string(), string()).optional()
13379
13379
  }), array(LogEntrySchema).readonly());
13380
+ /**
13381
+ * `failure-contribution` — the capability an addon reports its OWN losses
13382
+ * through, per camera, with the denominator attached. It stores nothing.
13383
+ *
13384
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13385
+ *
13386
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13387
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13388
+ * copied: the contributor reports what it already knows, hub-main adds only
13389
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13390
+ * somebody to forget to edit.
13391
+ *
13392
+ * They are not merged, because their invariants are opposites:
13393
+ *
13394
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13395
+ * claim a camera cost nothing, which is a measurement nobody made;
13396
+ * - a `failure-contribution` zero is the **most valuable value on the
13397
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13398
+ * and it is exactly what an absent entry cannot say.
13399
+ *
13400
+ * Putting a loss counter on a cost entry would also break the reconciliation
13401
+ * that gives `load-contribution` its point: contributions are subtracted from
13402
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13403
+ * has no process.
13404
+ *
13405
+ * ## Why not a log line, since the counters already exist
13406
+ *
13407
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13408
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13409
+ * ends in a log line, and a log line is the thing the operator asked to stop
13410
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13411
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13412
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13413
+ * media blackout were both diagnosed. The counters stay; this is where they can
13414
+ * be READ.
13415
+ *
13416
+ * ## The rate is served with its denominator or not at all
13417
+ *
13418
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13419
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13420
+ * than yesterday" and was **flat across twelve hours** once divided by the
13421
+ * successes on the same path. A surface that publishes only the numerator
13422
+ * reproduces that mistake on every read.
13423
+ *
13424
+ * ## Shape
13425
+ *
13426
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13427
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13428
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13429
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13430
+ * a forked runner's entries reach hub-main over transport that already exists.
13431
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13432
+ * result through `system.getFailureContributions`.
13433
+ */
13434
+ var FailureReasonCountSchema = object({
13435
+ /**
13436
+ * Why the attempt did not land, in the contributor's own vocabulary —
13437
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13438
+ * strings that already appear in this repo's logs and, where one exists, the
13439
+ * same string the per-track `previewMissReason` records (D276): a second
13440
+ * vocabulary for the same loss would make the row and the counter
13441
+ * un-joinable.
13442
+ */
13443
+ reason: string(),
13444
+ count: number().int().nonnegative()
13445
+ });
13446
+ var FailureContributionSchema = object({
13447
+ /**
13448
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13449
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13450
+ * `unit` free: the families are owned by different addons and a shared enum
13451
+ * is a central list that rots invisibly.
13452
+ */
13453
+ family: string(),
13454
+ /**
13455
+ * The NUMERIC device id — the same value every log line carries as
13456
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13457
+ * cannot name the camera must not emit the entry, because a fleet total
13458
+ * cannot answer the only question anybody asks of this surface.
13459
+ */
13460
+ deviceId: number().int().positive(),
13461
+ /**
13462
+ * A second dimension inside the family: the model / step id for an inference
13463
+ * timeout, so "which camera AND which model" is one read. Absent when the
13464
+ * family has a single variant.
13465
+ */
13466
+ variant: string().optional(),
13467
+ /**
13468
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13469
+ * differencing two reads must drop the interval when it changes, because the
13470
+ * counter restarted from zero in a respawned runner. Same discipline as
13471
+ * `LoadContribution.startedAtMs`.
13472
+ */
13473
+ sinceMs: number(),
13474
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13475
+ atMs: number(),
13476
+ /**
13477
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13478
+ * window. A failure count published without it is the mistake this schema
13479
+ * exists to make impossible.
13480
+ */
13481
+ attempts: number().int().nonnegative(),
13482
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13483
+ succeeded: number().int().nonnegative(),
13484
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13485
+ reasons: array(FailureReasonCountSchema).readonly()
13486
+ });
13487
+ method(_void(), array(FailureContributionSchema).readonly());
13380
13488
  var LoadContributionSchema = object({
13381
13489
  role: _enum([
13382
13490
  "decode",
@@ -17903,6 +18011,20 @@ var TrackSchema = object({
17903
18011
  * `=== true` and render nothing otherwise — never infer "no rider".
17904
18012
  */
17905
18013
  hasRider: boolean().optional(),
18014
+ /**
18015
+ * WHY this track ended without a NATIVE best-shot tile
18016
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
18017
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
18018
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
18019
+ * the late-keyFrame upgrade when a native tile lands after all. The
18020
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
18021
+ * tile is a face/plate stand-in, a raster crop, or an icon.
18022
+ *
18023
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
18024
+ * that predates the field, and every track whose tile landed native all
18025
+ * omit it. Render nothing when absent.
18026
+ */
18027
+ previewMissReason: string().optional(),
17906
18028
  ...TrackFlagFields,
17907
18029
  ...TrackRetrainFields
17908
18030
  });
@@ -27129,6 +27251,13 @@ var LoggingSettingsPatchSchema = object({
27129
27251
  * anyone but its owner.
27130
27252
  */
27131
27253
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
27254
+ /**
27255
+ * One per-camera failure counter, plus WHO reported it.
27256
+ *
27257
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
27258
+ * the hub as it enumerates providers, never by the contributor.
27259
+ */
27260
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
27132
27261
  var GetLoggingSettingsInputSchema = object({
27133
27262
  scopeNodeId: string().optional(),
27134
27263
  /**
@@ -27187,7 +27316,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
27187
27316
  }), method(_void(), SiteLocationStatusSchema, {
27188
27317
  kind: "mutation",
27189
27318
  auth: "admin"
27190
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
27319
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(_void(), array(ReportedFailureContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
27191
27320
  kind: "mutation",
27192
27321
  auth: "admin"
27193
27322
  });
@@ -29769,6 +29898,12 @@ Object.freeze({
29769
29898
  addonId: null,
29770
29899
  access: "create"
29771
29900
  },
29901
+ "failureContribution.list": {
29902
+ capName: "failure-contribution",
29903
+ capScope: "system",
29904
+ addonId: null,
29905
+ access: "view"
29906
+ },
29772
29907
  "fanControl.setDirection": {
29773
29908
  capName: "fan-control",
29774
29909
  capScope: "device",
@@ -33075,6 +33210,12 @@ Object.freeze({
33075
33210
  addonId: null,
33076
33211
  access: "create"
33077
33212
  },
33213
+ "system.getFailureContributions": {
33214
+ capName: "system",
33215
+ capScope: "system",
33216
+ addonId: null,
33217
+ access: "view"
33218
+ },
33078
33219
  "system.getLoadContributions": {
33079
33220
  capName: "system",
33080
33221
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -13350,6 +13350,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13350
13350
  limit: number().optional(),
13351
13351
  tags: record(string(), string()).optional()
13352
13352
  }), array(LogEntrySchema).readonly());
13353
+ /**
13354
+ * `failure-contribution` — the capability an addon reports its OWN losses
13355
+ * through, per camera, with the denominator attached. It stores nothing.
13356
+ *
13357
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13358
+ *
13359
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13360
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13361
+ * copied: the contributor reports what it already knows, hub-main adds only
13362
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13363
+ * somebody to forget to edit.
13364
+ *
13365
+ * They are not merged, because their invariants are opposites:
13366
+ *
13367
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13368
+ * claim a camera cost nothing, which is a measurement nobody made;
13369
+ * - a `failure-contribution` zero is the **most valuable value on the
13370
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13371
+ * and it is exactly what an absent entry cannot say.
13372
+ *
13373
+ * Putting a loss counter on a cost entry would also break the reconciliation
13374
+ * that gives `load-contribution` its point: contributions are subtracted from
13375
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13376
+ * has no process.
13377
+ *
13378
+ * ## Why not a log line, since the counters already exist
13379
+ *
13380
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13381
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13382
+ * ends in a log line, and a log line is the thing the operator asked to stop
13383
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13384
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13385
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13386
+ * media blackout were both diagnosed. The counters stay; this is where they can
13387
+ * be READ.
13388
+ *
13389
+ * ## The rate is served with its denominator or not at all
13390
+ *
13391
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13392
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13393
+ * than yesterday" and was **flat across twelve hours** once divided by the
13394
+ * successes on the same path. A surface that publishes only the numerator
13395
+ * reproduces that mistake on every read.
13396
+ *
13397
+ * ## Shape
13398
+ *
13399
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13400
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13401
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13402
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13403
+ * a forked runner's entries reach hub-main over transport that already exists.
13404
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13405
+ * result through `system.getFailureContributions`.
13406
+ */
13407
+ var FailureReasonCountSchema = object({
13408
+ /**
13409
+ * Why the attempt did not land, in the contributor's own vocabulary —
13410
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13411
+ * strings that already appear in this repo's logs and, where one exists, the
13412
+ * same string the per-track `previewMissReason` records (D276): a second
13413
+ * vocabulary for the same loss would make the row and the counter
13414
+ * un-joinable.
13415
+ */
13416
+ reason: string(),
13417
+ count: number().int().nonnegative()
13418
+ });
13419
+ var FailureContributionSchema = object({
13420
+ /**
13421
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13422
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13423
+ * `unit` free: the families are owned by different addons and a shared enum
13424
+ * is a central list that rots invisibly.
13425
+ */
13426
+ family: string(),
13427
+ /**
13428
+ * The NUMERIC device id — the same value every log line carries as
13429
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13430
+ * cannot name the camera must not emit the entry, because a fleet total
13431
+ * cannot answer the only question anybody asks of this surface.
13432
+ */
13433
+ deviceId: number().int().positive(),
13434
+ /**
13435
+ * A second dimension inside the family: the model / step id for an inference
13436
+ * timeout, so "which camera AND which model" is one read. Absent when the
13437
+ * family has a single variant.
13438
+ */
13439
+ variant: string().optional(),
13440
+ /**
13441
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13442
+ * differencing two reads must drop the interval when it changes, because the
13443
+ * counter restarted from zero in a respawned runner. Same discipline as
13444
+ * `LoadContribution.startedAtMs`.
13445
+ */
13446
+ sinceMs: number(),
13447
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13448
+ atMs: number(),
13449
+ /**
13450
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13451
+ * window. A failure count published without it is the mistake this schema
13452
+ * exists to make impossible.
13453
+ */
13454
+ attempts: number().int().nonnegative(),
13455
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13456
+ succeeded: number().int().nonnegative(),
13457
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13458
+ reasons: array(FailureReasonCountSchema).readonly()
13459
+ });
13460
+ method(_void(), array(FailureContributionSchema).readonly());
13353
13461
  var LoadContributionSchema = object({
13354
13462
  role: _enum([
13355
13463
  "decode",
@@ -17876,6 +17984,20 @@ var TrackSchema = object({
17876
17984
  * `=== true` and render nothing otherwise — never infer "no rider".
17877
17985
  */
17878
17986
  hasRider: boolean().optional(),
17987
+ /**
17988
+ * WHY this track ended without a NATIVE best-shot tile
17989
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
17990
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
17991
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
17992
+ * the late-keyFrame upgrade when a native tile lands after all. The
17993
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
17994
+ * tile is a face/plate stand-in, a raster crop, or an icon.
17995
+ *
17996
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
17997
+ * that predates the field, and every track whose tile landed native all
17998
+ * omit it. Render nothing when absent.
17999
+ */
18000
+ previewMissReason: string().optional(),
17879
18001
  ...TrackFlagFields,
17880
18002
  ...TrackRetrainFields
17881
18003
  });
@@ -27102,6 +27224,13 @@ var LoggingSettingsPatchSchema = object({
27102
27224
  * anyone but its owner.
27103
27225
  */
27104
27226
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
27227
+ /**
27228
+ * One per-camera failure counter, plus WHO reported it.
27229
+ *
27230
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
27231
+ * the hub as it enumerates providers, never by the contributor.
27232
+ */
27233
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
27105
27234
  var GetLoggingSettingsInputSchema = object({
27106
27235
  scopeNodeId: string().optional(),
27107
27236
  /**
@@ -27160,7 +27289,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
27160
27289
  }), method(_void(), SiteLocationStatusSchema, {
27161
27290
  kind: "mutation",
27162
27291
  auth: "admin"
27163
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
27292
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(_void(), array(ReportedFailureContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
27164
27293
  kind: "mutation",
27165
27294
  auth: "admin"
27166
27295
  });
@@ -29742,6 +29871,12 @@ Object.freeze({
29742
29871
  addonId: null,
29743
29872
  access: "create"
29744
29873
  },
29874
+ "failureContribution.list": {
29875
+ capName: "failure-contribution",
29876
+ capScope: "system",
29877
+ addonId: null,
29878
+ access: "view"
29879
+ },
29745
29880
  "fanControl.setDirection": {
29746
29881
  capName: "fan-control",
29747
29882
  capScope: "device",
@@ -33048,6 +33183,12 @@ Object.freeze({
33048
33183
  addonId: null,
33049
33184
  access: "create"
33050
33185
  },
33186
+ "system.getFailureContributions": {
33187
+ capName: "system",
33188
+ capScope: "system",
33189
+ addonId: null,
33190
+ access: "view"
33191
+ },
33051
33192
  "system.getLoadContributions": {
33052
33193
  capName: "system",
33053
33194
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-notifiers",
3
- "version": "1.2.42",
3
+ "version": "1.2.43",
4
4
  "description": "System notifiers addon for CamStack — a `notification-output` collection provider hosting per-kind notifier adapters (ntfy, pushover, gotify, telegram, discord, webhook, zentik).",
5
5
  "keywords": [
6
6
  "camstack",