@camstack/addon-provider-velux 0.2.38 → 0.2.39

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
@@ -13467,6 +13467,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13467
13467
  limit: number().optional(),
13468
13468
  tags: record(string(), string()).optional()
13469
13469
  }), array(LogEntrySchema).readonly());
13470
+ /**
13471
+ * `failure-contribution` — the capability an addon reports its OWN losses
13472
+ * through, per camera, with the denominator attached. It stores nothing.
13473
+ *
13474
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13475
+ *
13476
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13477
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13478
+ * copied: the contributor reports what it already knows, hub-main adds only
13479
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13480
+ * somebody to forget to edit.
13481
+ *
13482
+ * They are not merged, because their invariants are opposites:
13483
+ *
13484
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13485
+ * claim a camera cost nothing, which is a measurement nobody made;
13486
+ * - a `failure-contribution` zero is the **most valuable value on the
13487
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13488
+ * and it is exactly what an absent entry cannot say.
13489
+ *
13490
+ * Putting a loss counter on a cost entry would also break the reconciliation
13491
+ * that gives `load-contribution` its point: contributions are subtracted from
13492
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13493
+ * has no process.
13494
+ *
13495
+ * ## Why not a log line, since the counters already exist
13496
+ *
13497
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13498
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13499
+ * ends in a log line, and a log line is the thing the operator asked to stop
13500
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13501
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13502
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13503
+ * media blackout were both diagnosed. The counters stay; this is where they can
13504
+ * be READ.
13505
+ *
13506
+ * ## The rate is served with its denominator or not at all
13507
+ *
13508
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13509
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13510
+ * than yesterday" and was **flat across twelve hours** once divided by the
13511
+ * successes on the same path. A surface that publishes only the numerator
13512
+ * reproduces that mistake on every read.
13513
+ *
13514
+ * ## Shape
13515
+ *
13516
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13517
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13518
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13519
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13520
+ * a forked runner's entries reach hub-main over transport that already exists.
13521
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13522
+ * result through `system.getFailureContributions`.
13523
+ */
13524
+ var FailureReasonCountSchema = object({
13525
+ /**
13526
+ * Why the attempt did not land, in the contributor's own vocabulary —
13527
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13528
+ * strings that already appear in this repo's logs and, where one exists, the
13529
+ * same string the per-track `previewMissReason` records (D276): a second
13530
+ * vocabulary for the same loss would make the row and the counter
13531
+ * un-joinable.
13532
+ */
13533
+ reason: string(),
13534
+ count: number().int().nonnegative()
13535
+ });
13536
+ var FailureContributionSchema = object({
13537
+ /**
13538
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13539
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13540
+ * `unit` free: the families are owned by different addons and a shared enum
13541
+ * is a central list that rots invisibly.
13542
+ */
13543
+ family: string(),
13544
+ /**
13545
+ * The NUMERIC device id — the same value every log line carries as
13546
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13547
+ * cannot name the camera must not emit the entry, because a fleet total
13548
+ * cannot answer the only question anybody asks of this surface.
13549
+ */
13550
+ deviceId: number().int().positive(),
13551
+ /**
13552
+ * A second dimension inside the family: the model / step id for an inference
13553
+ * timeout, so "which camera AND which model" is one read. Absent when the
13554
+ * family has a single variant.
13555
+ */
13556
+ variant: string().optional(),
13557
+ /**
13558
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13559
+ * differencing two reads must drop the interval when it changes, because the
13560
+ * counter restarted from zero in a respawned runner. Same discipline as
13561
+ * `LoadContribution.startedAtMs`.
13562
+ */
13563
+ sinceMs: number(),
13564
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13565
+ atMs: number(),
13566
+ /**
13567
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13568
+ * window. A failure count published without it is the mistake this schema
13569
+ * exists to make impossible.
13570
+ */
13571
+ attempts: number().int().nonnegative(),
13572
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13573
+ succeeded: number().int().nonnegative(),
13574
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13575
+ reasons: array(FailureReasonCountSchema).readonly()
13576
+ });
13577
+ method(_void(), array(FailureContributionSchema).readonly());
13470
13578
  var LoadContributionSchema = object({
13471
13579
  role: _enum([
13472
13580
  "decode",
@@ -18057,6 +18165,20 @@ var TrackSchema = object({
18057
18165
  * `=== true` and render nothing otherwise — never infer "no rider".
18058
18166
  */
18059
18167
  hasRider: boolean().optional(),
18168
+ /**
18169
+ * WHY this track ended without a NATIVE best-shot tile
18170
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
18171
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
18172
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
18173
+ * the late-keyFrame upgrade when a native tile lands after all. The
18174
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
18175
+ * tile is a face/plate stand-in, a raster crop, or an icon.
18176
+ *
18177
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
18178
+ * that predates the field, and every track whose tile landed native all
18179
+ * omit it. Render nothing when absent.
18180
+ */
18181
+ previewMissReason: string().optional(),
18060
18182
  ...TrackFlagFields,
18061
18183
  ...TrackRetrainFields
18062
18184
  });
@@ -29232,6 +29354,13 @@ var LoggingSettingsPatchSchema = object({
29232
29354
  * anyone but its owner.
29233
29355
  */
29234
29356
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
29357
+ /**
29358
+ * One per-camera failure counter, plus WHO reported it.
29359
+ *
29360
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
29361
+ * the hub as it enumerates providers, never by the contributor.
29362
+ */
29363
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
29235
29364
  var GetLoggingSettingsInputSchema = object({
29236
29365
  scopeNodeId: string().optional(),
29237
29366
  /**
@@ -29290,7 +29419,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
29290
29419
  }), method(_void(), SiteLocationStatusSchema, {
29291
29420
  kind: "mutation",
29292
29421
  auth: "admin"
29293
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29422
+ }), 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, {
29294
29423
  kind: "mutation",
29295
29424
  auth: "admin"
29296
29425
  });
@@ -33280,6 +33409,12 @@ Object.freeze({
33280
33409
  addonId: null,
33281
33410
  access: "create"
33282
33411
  },
33412
+ "failureContribution.list": {
33413
+ capName: "failure-contribution",
33414
+ capScope: "system",
33415
+ addonId: null,
33416
+ access: "view"
33417
+ },
33283
33418
  "fanControl.setDirection": {
33284
33419
  capName: "fan-control",
33285
33420
  capScope: "device",
@@ -36586,6 +36721,12 @@ Object.freeze({
36586
36721
  addonId: null,
36587
36722
  access: "create"
36588
36723
  },
36724
+ "system.getFailureContributions": {
36725
+ capName: "system",
36726
+ capScope: "system",
36727
+ addonId: null,
36728
+ access: "view"
36729
+ },
36589
36730
  "system.getLoadContributions": {
36590
36731
  capName: "system",
36591
36732
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -13466,6 +13466,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13466
13466
  limit: number().optional(),
13467
13467
  tags: record(string(), string()).optional()
13468
13468
  }), array(LogEntrySchema).readonly());
13469
+ /**
13470
+ * `failure-contribution` — the capability an addon reports its OWN losses
13471
+ * through, per camera, with the denominator attached. It stores nothing.
13472
+ *
13473
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13474
+ *
13475
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13476
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13477
+ * copied: the contributor reports what it already knows, hub-main adds only
13478
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13479
+ * somebody to forget to edit.
13480
+ *
13481
+ * They are not merged, because their invariants are opposites:
13482
+ *
13483
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13484
+ * claim a camera cost nothing, which is a measurement nobody made;
13485
+ * - a `failure-contribution` zero is the **most valuable value on the
13486
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13487
+ * and it is exactly what an absent entry cannot say.
13488
+ *
13489
+ * Putting a loss counter on a cost entry would also break the reconciliation
13490
+ * that gives `load-contribution` its point: contributions are subtracted from
13491
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13492
+ * has no process.
13493
+ *
13494
+ * ## Why not a log line, since the counters already exist
13495
+ *
13496
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13497
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13498
+ * ends in a log line, and a log line is the thing the operator asked to stop
13499
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13500
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13501
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13502
+ * media blackout were both diagnosed. The counters stay; this is where they can
13503
+ * be READ.
13504
+ *
13505
+ * ## The rate is served with its denominator or not at all
13506
+ *
13507
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13508
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13509
+ * than yesterday" and was **flat across twelve hours** once divided by the
13510
+ * successes on the same path. A surface that publishes only the numerator
13511
+ * reproduces that mistake on every read.
13512
+ *
13513
+ * ## Shape
13514
+ *
13515
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13516
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13517
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13518
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13519
+ * a forked runner's entries reach hub-main over transport that already exists.
13520
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13521
+ * result through `system.getFailureContributions`.
13522
+ */
13523
+ var FailureReasonCountSchema = object({
13524
+ /**
13525
+ * Why the attempt did not land, in the contributor's own vocabulary —
13526
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13527
+ * strings that already appear in this repo's logs and, where one exists, the
13528
+ * same string the per-track `previewMissReason` records (D276): a second
13529
+ * vocabulary for the same loss would make the row and the counter
13530
+ * un-joinable.
13531
+ */
13532
+ reason: string(),
13533
+ count: number().int().nonnegative()
13534
+ });
13535
+ var FailureContributionSchema = object({
13536
+ /**
13537
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13538
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13539
+ * `unit` free: the families are owned by different addons and a shared enum
13540
+ * is a central list that rots invisibly.
13541
+ */
13542
+ family: string(),
13543
+ /**
13544
+ * The NUMERIC device id — the same value every log line carries as
13545
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13546
+ * cannot name the camera must not emit the entry, because a fleet total
13547
+ * cannot answer the only question anybody asks of this surface.
13548
+ */
13549
+ deviceId: number().int().positive(),
13550
+ /**
13551
+ * A second dimension inside the family: the model / step id for an inference
13552
+ * timeout, so "which camera AND which model" is one read. Absent when the
13553
+ * family has a single variant.
13554
+ */
13555
+ variant: string().optional(),
13556
+ /**
13557
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13558
+ * differencing two reads must drop the interval when it changes, because the
13559
+ * counter restarted from zero in a respawned runner. Same discipline as
13560
+ * `LoadContribution.startedAtMs`.
13561
+ */
13562
+ sinceMs: number(),
13563
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13564
+ atMs: number(),
13565
+ /**
13566
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13567
+ * window. A failure count published without it is the mistake this schema
13568
+ * exists to make impossible.
13569
+ */
13570
+ attempts: number().int().nonnegative(),
13571
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13572
+ succeeded: number().int().nonnegative(),
13573
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13574
+ reasons: array(FailureReasonCountSchema).readonly()
13575
+ });
13576
+ method(_void(), array(FailureContributionSchema).readonly());
13469
13577
  var LoadContributionSchema = object({
13470
13578
  role: _enum([
13471
13579
  "decode",
@@ -18056,6 +18164,20 @@ var TrackSchema = object({
18056
18164
  * `=== true` and render nothing otherwise — never infer "no rider".
18057
18165
  */
18058
18166
  hasRider: boolean().optional(),
18167
+ /**
18168
+ * WHY this track ended without a NATIVE best-shot tile
18169
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
18170
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
18171
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
18172
+ * the late-keyFrame upgrade when a native tile lands after all. The
18173
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
18174
+ * tile is a face/plate stand-in, a raster crop, or an icon.
18175
+ *
18176
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
18177
+ * that predates the field, and every track whose tile landed native all
18178
+ * omit it. Render nothing when absent.
18179
+ */
18180
+ previewMissReason: string().optional(),
18059
18181
  ...TrackFlagFields,
18060
18182
  ...TrackRetrainFields
18061
18183
  });
@@ -29231,6 +29353,13 @@ var LoggingSettingsPatchSchema = object({
29231
29353
  * anyone but its owner.
29232
29354
  */
29233
29355
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
29356
+ /**
29357
+ * One per-camera failure counter, plus WHO reported it.
29358
+ *
29359
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
29360
+ * the hub as it enumerates providers, never by the contributor.
29361
+ */
29362
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
29234
29363
  var GetLoggingSettingsInputSchema = object({
29235
29364
  scopeNodeId: string().optional(),
29236
29365
  /**
@@ -29289,7 +29418,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
29289
29418
  }), method(_void(), SiteLocationStatusSchema, {
29290
29419
  kind: "mutation",
29291
29420
  auth: "admin"
29292
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29421
+ }), 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, {
29293
29422
  kind: "mutation",
29294
29423
  auth: "admin"
29295
29424
  });
@@ -33279,6 +33408,12 @@ Object.freeze({
33279
33408
  addonId: null,
33280
33409
  access: "create"
33281
33410
  },
33411
+ "failureContribution.list": {
33412
+ capName: "failure-contribution",
33413
+ capScope: "system",
33414
+ addonId: null,
33415
+ access: "view"
33416
+ },
33282
33417
  "fanControl.setDirection": {
33283
33418
  capName: "fan-control",
33284
33419
  capScope: "device",
@@ -36585,6 +36720,12 @@ Object.freeze({
36585
36720
  addonId: null,
36586
36721
  access: "create"
36587
36722
  },
36723
+ "system.getFailureContributions": {
36724
+ capName: "system",
36725
+ capScope: "system",
36726
+ addonId: null,
36727
+ access: "view"
36728
+ },
36588
36729
  "system.getLoadContributions": {
36589
36730
  capName: "system",
36590
36731
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-velux",
3
- "version": "0.2.38",
3
+ "version": "0.2.39",
4
4
  "description": "Velux KLF-200 device-provider addon for CamStack — local-gateway window + shutter covers (positional, no tilt)",
5
5
  "keywords": [
6
6
  "camstack",