@camstack/addon-provider-gree 0.2.37 → 0.2.38

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