@camstack/addon-provider-homematic 1.2.39 → 1.2.40

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
@@ -13542,6 +13542,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13542
13542
  limit: number().optional(),
13543
13543
  tags: record(string(), string()).optional()
13544
13544
  }), array(LogEntrySchema).readonly());
13545
+ /**
13546
+ * `failure-contribution` — the capability an addon reports its OWN losses
13547
+ * through, per camera, with the denominator attached. It stores nothing.
13548
+ *
13549
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13550
+ *
13551
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13552
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13553
+ * copied: the contributor reports what it already knows, hub-main adds only
13554
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13555
+ * somebody to forget to edit.
13556
+ *
13557
+ * They are not merged, because their invariants are opposites:
13558
+ *
13559
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13560
+ * claim a camera cost nothing, which is a measurement nobody made;
13561
+ * - a `failure-contribution` zero is the **most valuable value on the
13562
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13563
+ * and it is exactly what an absent entry cannot say.
13564
+ *
13565
+ * Putting a loss counter on a cost entry would also break the reconciliation
13566
+ * that gives `load-contribution` its point: contributions are subtracted from
13567
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13568
+ * has no process.
13569
+ *
13570
+ * ## Why not a log line, since the counters already exist
13571
+ *
13572
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13573
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13574
+ * ends in a log line, and a log line is the thing the operator asked to stop
13575
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13576
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13577
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13578
+ * media blackout were both diagnosed. The counters stay; this is where they can
13579
+ * be READ.
13580
+ *
13581
+ * ## The rate is served with its denominator or not at all
13582
+ *
13583
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13584
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13585
+ * than yesterday" and was **flat across twelve hours** once divided by the
13586
+ * successes on the same path. A surface that publishes only the numerator
13587
+ * reproduces that mistake on every read.
13588
+ *
13589
+ * ## Shape
13590
+ *
13591
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13592
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13593
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13594
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13595
+ * a forked runner's entries reach hub-main over transport that already exists.
13596
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13597
+ * result through `system.getFailureContributions`.
13598
+ */
13599
+ var FailureReasonCountSchema = object({
13600
+ /**
13601
+ * Why the attempt did not land, in the contributor's own vocabulary —
13602
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13603
+ * strings that already appear in this repo's logs and, where one exists, the
13604
+ * same string the per-track `previewMissReason` records (D276): a second
13605
+ * vocabulary for the same loss would make the row and the counter
13606
+ * un-joinable.
13607
+ */
13608
+ reason: string(),
13609
+ count: number().int().nonnegative()
13610
+ });
13611
+ var FailureContributionSchema = object({
13612
+ /**
13613
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13614
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13615
+ * `unit` free: the families are owned by different addons and a shared enum
13616
+ * is a central list that rots invisibly.
13617
+ */
13618
+ family: string(),
13619
+ /**
13620
+ * The NUMERIC device id — the same value every log line carries as
13621
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13622
+ * cannot name the camera must not emit the entry, because a fleet total
13623
+ * cannot answer the only question anybody asks of this surface.
13624
+ */
13625
+ deviceId: number().int().positive(),
13626
+ /**
13627
+ * A second dimension inside the family: the model / step id for an inference
13628
+ * timeout, so "which camera AND which model" is one read. Absent when the
13629
+ * family has a single variant.
13630
+ */
13631
+ variant: string().optional(),
13632
+ /**
13633
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13634
+ * differencing two reads must drop the interval when it changes, because the
13635
+ * counter restarted from zero in a respawned runner. Same discipline as
13636
+ * `LoadContribution.startedAtMs`.
13637
+ */
13638
+ sinceMs: number(),
13639
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13640
+ atMs: number(),
13641
+ /**
13642
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13643
+ * window. A failure count published without it is the mistake this schema
13644
+ * exists to make impossible.
13645
+ */
13646
+ attempts: number().int().nonnegative(),
13647
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13648
+ succeeded: number().int().nonnegative(),
13649
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13650
+ reasons: array(FailureReasonCountSchema).readonly()
13651
+ });
13652
+ method(_void(), array(FailureContributionSchema).readonly());
13545
13653
  var LoadContributionSchema = object({
13546
13654
  role: _enum([
13547
13655
  "decode",
@@ -18132,6 +18240,20 @@ var TrackSchema = object({
18132
18240
  * `=== true` and render nothing otherwise — never infer "no rider".
18133
18241
  */
18134
18242
  hasRider: boolean().optional(),
18243
+ /**
18244
+ * WHY this track ended without a NATIVE best-shot tile
18245
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
18246
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
18247
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
18248
+ * the late-keyFrame upgrade when a native tile lands after all. The
18249
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
18250
+ * tile is a face/plate stand-in, a raster crop, or an icon.
18251
+ *
18252
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
18253
+ * that predates the field, and every track whose tile landed native all
18254
+ * omit it. Render nothing when absent.
18255
+ */
18256
+ previewMissReason: string().optional(),
18135
18257
  ...TrackFlagFields,
18136
18258
  ...TrackRetrainFields
18137
18259
  });
@@ -29307,6 +29429,13 @@ var LoggingSettingsPatchSchema = object({
29307
29429
  * anyone but its owner.
29308
29430
  */
29309
29431
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
29432
+ /**
29433
+ * One per-camera failure counter, plus WHO reported it.
29434
+ *
29435
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
29436
+ * the hub as it enumerates providers, never by the contributor.
29437
+ */
29438
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
29310
29439
  var GetLoggingSettingsInputSchema = object({
29311
29440
  scopeNodeId: string().optional(),
29312
29441
  /**
@@ -29365,7 +29494,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
29365
29494
  }), method(_void(), SiteLocationStatusSchema, {
29366
29495
  kind: "mutation",
29367
29496
  auth: "admin"
29368
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29497
+ }), 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, {
29369
29498
  kind: "mutation",
29370
29499
  auth: "admin"
29371
29500
  });
@@ -33355,6 +33484,12 @@ Object.freeze({
33355
33484
  addonId: null,
33356
33485
  access: "create"
33357
33486
  },
33487
+ "failureContribution.list": {
33488
+ capName: "failure-contribution",
33489
+ capScope: "system",
33490
+ addonId: null,
33491
+ access: "view"
33492
+ },
33358
33493
  "fanControl.setDirection": {
33359
33494
  capName: "fan-control",
33360
33495
  capScope: "device",
@@ -36661,6 +36796,12 @@ Object.freeze({
36661
36796
  addonId: null,
36662
36797
  access: "create"
36663
36798
  },
36799
+ "system.getFailureContributions": {
36800
+ capName: "system",
36801
+ capScope: "system",
36802
+ addonId: null,
36803
+ access: "view"
36804
+ },
36664
36805
  "system.getLoadContributions": {
36665
36806
  capName: "system",
36666
36807
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -13543,6 +13543,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13543
13543
  limit: number().optional(),
13544
13544
  tags: record(string(), string()).optional()
13545
13545
  }), array(LogEntrySchema).readonly());
13546
+ /**
13547
+ * `failure-contribution` — the capability an addon reports its OWN losses
13548
+ * through, per camera, with the denominator attached. It stores nothing.
13549
+ *
13550
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13551
+ *
13552
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13553
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13554
+ * copied: the contributor reports what it already knows, hub-main adds only
13555
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13556
+ * somebody to forget to edit.
13557
+ *
13558
+ * They are not merged, because their invariants are opposites:
13559
+ *
13560
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13561
+ * claim a camera cost nothing, which is a measurement nobody made;
13562
+ * - a `failure-contribution` zero is the **most valuable value on the
13563
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13564
+ * and it is exactly what an absent entry cannot say.
13565
+ *
13566
+ * Putting a loss counter on a cost entry would also break the reconciliation
13567
+ * that gives `load-contribution` its point: contributions are subtracted from
13568
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13569
+ * has no process.
13570
+ *
13571
+ * ## Why not a log line, since the counters already exist
13572
+ *
13573
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13574
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13575
+ * ends in a log line, and a log line is the thing the operator asked to stop
13576
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13577
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13578
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13579
+ * media blackout were both diagnosed. The counters stay; this is where they can
13580
+ * be READ.
13581
+ *
13582
+ * ## The rate is served with its denominator or not at all
13583
+ *
13584
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13585
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13586
+ * than yesterday" and was **flat across twelve hours** once divided by the
13587
+ * successes on the same path. A surface that publishes only the numerator
13588
+ * reproduces that mistake on every read.
13589
+ *
13590
+ * ## Shape
13591
+ *
13592
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13593
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13594
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13595
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13596
+ * a forked runner's entries reach hub-main over transport that already exists.
13597
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13598
+ * result through `system.getFailureContributions`.
13599
+ */
13600
+ var FailureReasonCountSchema = object({
13601
+ /**
13602
+ * Why the attempt did not land, in the contributor's own vocabulary —
13603
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13604
+ * strings that already appear in this repo's logs and, where one exists, the
13605
+ * same string the per-track `previewMissReason` records (D276): a second
13606
+ * vocabulary for the same loss would make the row and the counter
13607
+ * un-joinable.
13608
+ */
13609
+ reason: string(),
13610
+ count: number().int().nonnegative()
13611
+ });
13612
+ var FailureContributionSchema = object({
13613
+ /**
13614
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13615
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13616
+ * `unit` free: the families are owned by different addons and a shared enum
13617
+ * is a central list that rots invisibly.
13618
+ */
13619
+ family: string(),
13620
+ /**
13621
+ * The NUMERIC device id — the same value every log line carries as
13622
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13623
+ * cannot name the camera must not emit the entry, because a fleet total
13624
+ * cannot answer the only question anybody asks of this surface.
13625
+ */
13626
+ deviceId: number().int().positive(),
13627
+ /**
13628
+ * A second dimension inside the family: the model / step id for an inference
13629
+ * timeout, so "which camera AND which model" is one read. Absent when the
13630
+ * family has a single variant.
13631
+ */
13632
+ variant: string().optional(),
13633
+ /**
13634
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13635
+ * differencing two reads must drop the interval when it changes, because the
13636
+ * counter restarted from zero in a respawned runner. Same discipline as
13637
+ * `LoadContribution.startedAtMs`.
13638
+ */
13639
+ sinceMs: number(),
13640
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13641
+ atMs: number(),
13642
+ /**
13643
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13644
+ * window. A failure count published without it is the mistake this schema
13645
+ * exists to make impossible.
13646
+ */
13647
+ attempts: number().int().nonnegative(),
13648
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13649
+ succeeded: number().int().nonnegative(),
13650
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13651
+ reasons: array(FailureReasonCountSchema).readonly()
13652
+ });
13653
+ method(_void(), array(FailureContributionSchema).readonly());
13546
13654
  var LoadContributionSchema = object({
13547
13655
  role: _enum([
13548
13656
  "decode",
@@ -18133,6 +18241,20 @@ var TrackSchema = object({
18133
18241
  * `=== true` and render nothing otherwise — never infer "no rider".
18134
18242
  */
18135
18243
  hasRider: boolean().optional(),
18244
+ /**
18245
+ * WHY this track ended without a NATIVE best-shot tile
18246
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
18247
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
18248
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
18249
+ * the late-keyFrame upgrade when a native tile lands after all. The
18250
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
18251
+ * tile is a face/plate stand-in, a raster crop, or an icon.
18252
+ *
18253
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
18254
+ * that predates the field, and every track whose tile landed native all
18255
+ * omit it. Render nothing when absent.
18256
+ */
18257
+ previewMissReason: string().optional(),
18136
18258
  ...TrackFlagFields,
18137
18259
  ...TrackRetrainFields
18138
18260
  });
@@ -29308,6 +29430,13 @@ var LoggingSettingsPatchSchema = object({
29308
29430
  * anyone but its owner.
29309
29431
  */
29310
29432
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
29433
+ /**
29434
+ * One per-camera failure counter, plus WHO reported it.
29435
+ *
29436
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
29437
+ * the hub as it enumerates providers, never by the contributor.
29438
+ */
29439
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
29311
29440
  var GetLoggingSettingsInputSchema = object({
29312
29441
  scopeNodeId: string().optional(),
29313
29442
  /**
@@ -29366,7 +29495,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
29366
29495
  }), method(_void(), SiteLocationStatusSchema, {
29367
29496
  kind: "mutation",
29368
29497
  auth: "admin"
29369
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29498
+ }), 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, {
29370
29499
  kind: "mutation",
29371
29500
  auth: "admin"
29372
29501
  });
@@ -33356,6 +33485,12 @@ Object.freeze({
33356
33485
  addonId: null,
33357
33486
  access: "create"
33358
33487
  },
33488
+ "failureContribution.list": {
33489
+ capName: "failure-contribution",
33490
+ capScope: "system",
33491
+ addonId: null,
33492
+ access: "view"
33493
+ },
33359
33494
  "fanControl.setDirection": {
33360
33495
  capName: "fan-control",
33361
33496
  capScope: "device",
@@ -36662,6 +36797,12 @@ Object.freeze({
36662
36797
  addonId: null,
36663
36798
  access: "create"
36664
36799
  },
36800
+ "system.getFailureContributions": {
36801
+ capName: "system",
36802
+ capScope: "system",
36803
+ addonId: null,
36804
+ access: "view"
36805
+ },
36665
36806
  "system.getLoadContributions": {
36666
36807
  capName: "system",
36667
36808
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-homematic",
3
- "version": "1.2.39",
3
+ "version": "1.2.40",
4
4
  "description": "Homematic / HomematicIP (CCU3 / RaspberryMatic) device-provider addon for CamStack — wraps the nodehomematic library",
5
5
  "keywords": [
6
6
  "camstack",