@camstack/addon-provider-rademacher 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
@@ -14452,6 +14452,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
14452
14452
  limit: number().optional(),
14453
14453
  tags: record(string(), string()).optional()
14454
14454
  }), array(LogEntrySchema).readonly());
14455
+ /**
14456
+ * `failure-contribution` — the capability an addon reports its OWN losses
14457
+ * through, per camera, with the denominator attached. It stores nothing.
14458
+ *
14459
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
14460
+ *
14461
+ * `load-contribution` answers *what did this camera COST*. This answers *what
14462
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
14463
+ * copied: the contributor reports what it already knows, hub-main adds only
14464
+ * `addonId`, nothing needs global knowledge, and there is no central list for
14465
+ * somebody to forget to edit.
14466
+ *
14467
+ * They are not merged, because their invariants are opposites:
14468
+ *
14469
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
14470
+ * claim a camera cost nothing, which is a measurement nobody made;
14471
+ * - a `failure-contribution` zero is the **most valuable value on the
14472
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
14473
+ * and it is exactly what an absent entry cannot say.
14474
+ *
14475
+ * Putting a loss counter on a cost entry would also break the reconciliation
14476
+ * that gives `load-contribution` its point: contributions are subtracted from
14477
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
14478
+ * has no process.
14479
+ *
14480
+ * ## Why not a log line, since the counters already exist
14481
+ *
14482
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
14483
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
14484
+ * ends in a log line, and a log line is the thing the operator asked to stop
14485
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
14486
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
14487
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
14488
+ * media blackout were both diagnosed. The counters stay; this is where they can
14489
+ * be READ.
14490
+ *
14491
+ * ## The rate is served with its denominator or not at all
14492
+ *
14493
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
14494
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
14495
+ * than yesterday" and was **flat across twelve hours** once divided by the
14496
+ * successes on the same path. A surface that publishes only the numerator
14497
+ * reproduces that mistake on every read.
14498
+ *
14499
+ * ## Shape
14500
+ *
14501
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
14502
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
14503
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
14504
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
14505
+ * a forked runner's entries reach hub-main over transport that already exists.
14506
+ * No new UDS message, no second registry (D3). The operator reads the assembled
14507
+ * result through `system.getFailureContributions`.
14508
+ */
14509
+ var FailureReasonCountSchema = object({
14510
+ /**
14511
+ * Why the attempt did not land, in the contributor's own vocabulary —
14512
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
14513
+ * strings that already appear in this repo's logs and, where one exists, the
14514
+ * same string the per-track `previewMissReason` records (D276): a second
14515
+ * vocabulary for the same loss would make the row and the counter
14516
+ * un-joinable.
14517
+ */
14518
+ reason: string(),
14519
+ count: number().int().nonnegative()
14520
+ });
14521
+ var FailureContributionSchema = object({
14522
+ /**
14523
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
14524
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
14525
+ * `unit` free: the families are owned by different addons and a shared enum
14526
+ * is a central list that rots invisibly.
14527
+ */
14528
+ family: string(),
14529
+ /**
14530
+ * The NUMERIC device id — the same value every log line carries as
14531
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
14532
+ * cannot name the camera must not emit the entry, because a fleet total
14533
+ * cannot answer the only question anybody asks of this surface.
14534
+ */
14535
+ deviceId: number().int().positive(),
14536
+ /**
14537
+ * A second dimension inside the family: the model / step id for an inference
14538
+ * timeout, so "which camera AND which model" is one read. Absent when the
14539
+ * family has a single variant.
14540
+ */
14541
+ variant: string().optional(),
14542
+ /**
14543
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
14544
+ * differencing two reads must drop the interval when it changes, because the
14545
+ * counter restarted from zero in a respawned runner. Same discipline as
14546
+ * `LoadContribution.startedAtMs`.
14547
+ */
14548
+ sinceMs: number(),
14549
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
14550
+ atMs: number(),
14551
+ /**
14552
+ * THE DENOMINATOR — every attempt on this path for this camera in the
14553
+ * window. A failure count published without it is the mistake this schema
14554
+ * exists to make impossible.
14555
+ */
14556
+ attempts: number().int().nonnegative(),
14557
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
14558
+ succeeded: number().int().nonnegative(),
14559
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
14560
+ reasons: array(FailureReasonCountSchema).readonly()
14561
+ });
14562
+ method(_void(), array(FailureContributionSchema).readonly());
14455
14563
  var LoadContributionSchema = object({
14456
14564
  role: _enum([
14457
14565
  "decode",
@@ -19042,6 +19150,20 @@ var TrackSchema = object({
19042
19150
  * `=== true` and render nothing otherwise — never infer "no rider".
19043
19151
  */
19044
19152
  hasRider: boolean().optional(),
19153
+ /**
19154
+ * WHY this track ended without a NATIVE best-shot tile
19155
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
19156
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
19157
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
19158
+ * the late-keyFrame upgrade when a native tile lands after all. The
19159
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
19160
+ * tile is a face/plate stand-in, a raster crop, or an icon.
19161
+ *
19162
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
19163
+ * that predates the field, and every track whose tile landed native all
19164
+ * omit it. Render nothing when absent.
19165
+ */
19166
+ previewMissReason: string().optional(),
19045
19167
  ...TrackFlagFields,
19046
19168
  ...TrackRetrainFields
19047
19169
  });
@@ -30217,6 +30339,13 @@ var LoggingSettingsPatchSchema = object({
30217
30339
  * anyone but its owner.
30218
30340
  */
30219
30341
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
30342
+ /**
30343
+ * One per-camera failure counter, plus WHO reported it.
30344
+ *
30345
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
30346
+ * the hub as it enumerates providers, never by the contributor.
30347
+ */
30348
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
30220
30349
  var GetLoggingSettingsInputSchema = object({
30221
30350
  scopeNodeId: string().optional(),
30222
30351
  /**
@@ -30275,7 +30404,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
30275
30404
  }), method(_void(), SiteLocationStatusSchema, {
30276
30405
  kind: "mutation",
30277
30406
  auth: "admin"
30278
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
30407
+ }), 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, {
30279
30408
  kind: "mutation",
30280
30409
  auth: "admin"
30281
30410
  });
@@ -34265,6 +34394,12 @@ Object.freeze({
34265
34394
  addonId: null,
34266
34395
  access: "create"
34267
34396
  },
34397
+ "failureContribution.list": {
34398
+ capName: "failure-contribution",
34399
+ capScope: "system",
34400
+ addonId: null,
34401
+ access: "view"
34402
+ },
34268
34403
  "fanControl.setDirection": {
34269
34404
  capName: "fan-control",
34270
34405
  capScope: "device",
@@ -37571,6 +37706,12 @@ Object.freeze({
37571
37706
  addonId: null,
37572
37707
  access: "create"
37573
37708
  },
37709
+ "system.getFailureContributions": {
37710
+ capName: "system",
37711
+ capScope: "system",
37712
+ addonId: null,
37713
+ access: "view"
37714
+ },
37574
37715
  "system.getLoadContributions": {
37575
37716
  capName: "system",
37576
37717
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -14451,6 +14451,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
14451
14451
  limit: number().optional(),
14452
14452
  tags: record(string(), string()).optional()
14453
14453
  }), array(LogEntrySchema).readonly());
14454
+ /**
14455
+ * `failure-contribution` — the capability an addon reports its OWN losses
14456
+ * through, per camera, with the denominator attached. It stores nothing.
14457
+ *
14458
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
14459
+ *
14460
+ * `load-contribution` answers *what did this camera COST*. This answers *what
14461
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
14462
+ * copied: the contributor reports what it already knows, hub-main adds only
14463
+ * `addonId`, nothing needs global knowledge, and there is no central list for
14464
+ * somebody to forget to edit.
14465
+ *
14466
+ * They are not merged, because their invariants are opposites:
14467
+ *
14468
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
14469
+ * claim a camera cost nothing, which is a measurement nobody made;
14470
+ * - a `failure-contribution` zero is the **most valuable value on the
14471
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
14472
+ * and it is exactly what an absent entry cannot say.
14473
+ *
14474
+ * Putting a loss counter on a cost entry would also break the reconciliation
14475
+ * that gives `load-contribution` its point: contributions are subtracted from
14476
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
14477
+ * has no process.
14478
+ *
14479
+ * ## Why not a log line, since the counters already exist
14480
+ *
14481
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
14482
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
14483
+ * ends in a log line, and a log line is the thing the operator asked to stop
14484
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
14485
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
14486
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
14487
+ * media blackout were both diagnosed. The counters stay; this is where they can
14488
+ * be READ.
14489
+ *
14490
+ * ## The rate is served with its denominator or not at all
14491
+ *
14492
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
14493
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
14494
+ * than yesterday" and was **flat across twelve hours** once divided by the
14495
+ * successes on the same path. A surface that publishes only the numerator
14496
+ * reproduces that mistake on every read.
14497
+ *
14498
+ * ## Shape
14499
+ *
14500
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
14501
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
14502
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
14503
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
14504
+ * a forked runner's entries reach hub-main over transport that already exists.
14505
+ * No new UDS message, no second registry (D3). The operator reads the assembled
14506
+ * result through `system.getFailureContributions`.
14507
+ */
14508
+ var FailureReasonCountSchema = object({
14509
+ /**
14510
+ * Why the attempt did not land, in the contributor's own vocabulary —
14511
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
14512
+ * strings that already appear in this repo's logs and, where one exists, the
14513
+ * same string the per-track `previewMissReason` records (D276): a second
14514
+ * vocabulary for the same loss would make the row and the counter
14515
+ * un-joinable.
14516
+ */
14517
+ reason: string(),
14518
+ count: number().int().nonnegative()
14519
+ });
14520
+ var FailureContributionSchema = object({
14521
+ /**
14522
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
14523
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
14524
+ * `unit` free: the families are owned by different addons and a shared enum
14525
+ * is a central list that rots invisibly.
14526
+ */
14527
+ family: string(),
14528
+ /**
14529
+ * The NUMERIC device id — the same value every log line carries as
14530
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
14531
+ * cannot name the camera must not emit the entry, because a fleet total
14532
+ * cannot answer the only question anybody asks of this surface.
14533
+ */
14534
+ deviceId: number().int().positive(),
14535
+ /**
14536
+ * A second dimension inside the family: the model / step id for an inference
14537
+ * timeout, so "which camera AND which model" is one read. Absent when the
14538
+ * family has a single variant.
14539
+ */
14540
+ variant: string().optional(),
14541
+ /**
14542
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
14543
+ * differencing two reads must drop the interval when it changes, because the
14544
+ * counter restarted from zero in a respawned runner. Same discipline as
14545
+ * `LoadContribution.startedAtMs`.
14546
+ */
14547
+ sinceMs: number(),
14548
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
14549
+ atMs: number(),
14550
+ /**
14551
+ * THE DENOMINATOR — every attempt on this path for this camera in the
14552
+ * window. A failure count published without it is the mistake this schema
14553
+ * exists to make impossible.
14554
+ */
14555
+ attempts: number().int().nonnegative(),
14556
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
14557
+ succeeded: number().int().nonnegative(),
14558
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
14559
+ reasons: array(FailureReasonCountSchema).readonly()
14560
+ });
14561
+ method(_void(), array(FailureContributionSchema).readonly());
14454
14562
  var LoadContributionSchema = object({
14455
14563
  role: _enum([
14456
14564
  "decode",
@@ -19041,6 +19149,20 @@ var TrackSchema = object({
19041
19149
  * `=== true` and render nothing otherwise — never infer "no rider".
19042
19150
  */
19043
19151
  hasRider: boolean().optional(),
19152
+ /**
19153
+ * WHY this track ended without a NATIVE best-shot tile
19154
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
19155
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
19156
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
19157
+ * the late-keyFrame upgrade when a native tile lands after all. The
19158
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
19159
+ * tile is a face/plate stand-in, a raster crop, or an icon.
19160
+ *
19161
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
19162
+ * that predates the field, and every track whose tile landed native all
19163
+ * omit it. Render nothing when absent.
19164
+ */
19165
+ previewMissReason: string().optional(),
19044
19166
  ...TrackFlagFields,
19045
19167
  ...TrackRetrainFields
19046
19168
  });
@@ -30216,6 +30338,13 @@ var LoggingSettingsPatchSchema = object({
30216
30338
  * anyone but its owner.
30217
30339
  */
30218
30340
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
30341
+ /**
30342
+ * One per-camera failure counter, plus WHO reported it.
30343
+ *
30344
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
30345
+ * the hub as it enumerates providers, never by the contributor.
30346
+ */
30347
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
30219
30348
  var GetLoggingSettingsInputSchema = object({
30220
30349
  scopeNodeId: string().optional(),
30221
30350
  /**
@@ -30274,7 +30403,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
30274
30403
  }), method(_void(), SiteLocationStatusSchema, {
30275
30404
  kind: "mutation",
30276
30405
  auth: "admin"
30277
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
30406
+ }), 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, {
30278
30407
  kind: "mutation",
30279
30408
  auth: "admin"
30280
30409
  });
@@ -34264,6 +34393,12 @@ Object.freeze({
34264
34393
  addonId: null,
34265
34394
  access: "create"
34266
34395
  },
34396
+ "failureContribution.list": {
34397
+ capName: "failure-contribution",
34398
+ capScope: "system",
34399
+ addonId: null,
34400
+ access: "view"
34401
+ },
34267
34402
  "fanControl.setDirection": {
34268
34403
  capName: "fan-control",
34269
34404
  capScope: "device",
@@ -37570,6 +37705,12 @@ Object.freeze({
37570
37705
  addonId: null,
37571
37706
  access: "create"
37572
37707
  },
37708
+ "system.getFailureContributions": {
37709
+ capName: "system",
37710
+ capScope: "system",
37711
+ addonId: null,
37712
+ access: "view"
37713
+ },
37573
37714
  "system.getLoadContributions": {
37574
37715
  capName: "system",
37575
37716
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-rademacher",
3
- "version": "0.2.37",
3
+ "version": "0.2.38",
4
4
  "description": "Rademacher HomePilot device-provider addon for CamStack — wraps the @apocaliss92/noderademacher local-hub client (roller shutters over the cover cap)",
5
5
  "keywords": [
6
6
  "camstack",