@camstack/addon-export-alexa 1.2.44 → 1.2.45

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.
@@ -13498,6 +13498,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13498
13498
  limit: number().optional(),
13499
13499
  tags: record(string(), string()).optional()
13500
13500
  }), array(LogEntrySchema).readonly());
13501
+ /**
13502
+ * `failure-contribution` — the capability an addon reports its OWN losses
13503
+ * through, per camera, with the denominator attached. It stores nothing.
13504
+ *
13505
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13506
+ *
13507
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13508
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13509
+ * copied: the contributor reports what it already knows, hub-main adds only
13510
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13511
+ * somebody to forget to edit.
13512
+ *
13513
+ * They are not merged, because their invariants are opposites:
13514
+ *
13515
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13516
+ * claim a camera cost nothing, which is a measurement nobody made;
13517
+ * - a `failure-contribution` zero is the **most valuable value on the
13518
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13519
+ * and it is exactly what an absent entry cannot say.
13520
+ *
13521
+ * Putting a loss counter on a cost entry would also break the reconciliation
13522
+ * that gives `load-contribution` its point: contributions are subtracted from
13523
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13524
+ * has no process.
13525
+ *
13526
+ * ## Why not a log line, since the counters already exist
13527
+ *
13528
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13529
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13530
+ * ends in a log line, and a log line is the thing the operator asked to stop
13531
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13532
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13533
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13534
+ * media blackout were both diagnosed. The counters stay; this is where they can
13535
+ * be READ.
13536
+ *
13537
+ * ## The rate is served with its denominator or not at all
13538
+ *
13539
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13540
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13541
+ * than yesterday" and was **flat across twelve hours** once divided by the
13542
+ * successes on the same path. A surface that publishes only the numerator
13543
+ * reproduces that mistake on every read.
13544
+ *
13545
+ * ## Shape
13546
+ *
13547
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13548
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13549
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13550
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13551
+ * a forked runner's entries reach hub-main over transport that already exists.
13552
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13553
+ * result through `system.getFailureContributions`.
13554
+ */
13555
+ var FailureReasonCountSchema = object({
13556
+ /**
13557
+ * Why the attempt did not land, in the contributor's own vocabulary —
13558
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13559
+ * strings that already appear in this repo's logs and, where one exists, the
13560
+ * same string the per-track `previewMissReason` records (D276): a second
13561
+ * vocabulary for the same loss would make the row and the counter
13562
+ * un-joinable.
13563
+ */
13564
+ reason: string(),
13565
+ count: number().int().nonnegative()
13566
+ });
13567
+ var FailureContributionSchema = object({
13568
+ /**
13569
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13570
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13571
+ * `unit` free: the families are owned by different addons and a shared enum
13572
+ * is a central list that rots invisibly.
13573
+ */
13574
+ family: string(),
13575
+ /**
13576
+ * The NUMERIC device id — the same value every log line carries as
13577
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13578
+ * cannot name the camera must not emit the entry, because a fleet total
13579
+ * cannot answer the only question anybody asks of this surface.
13580
+ */
13581
+ deviceId: number().int().positive(),
13582
+ /**
13583
+ * A second dimension inside the family: the model / step id for an inference
13584
+ * timeout, so "which camera AND which model" is one read. Absent when the
13585
+ * family has a single variant.
13586
+ */
13587
+ variant: string().optional(),
13588
+ /**
13589
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13590
+ * differencing two reads must drop the interval when it changes, because the
13591
+ * counter restarted from zero in a respawned runner. Same discipline as
13592
+ * `LoadContribution.startedAtMs`.
13593
+ */
13594
+ sinceMs: number(),
13595
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13596
+ atMs: number(),
13597
+ /**
13598
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13599
+ * window. A failure count published without it is the mistake this schema
13600
+ * exists to make impossible.
13601
+ */
13602
+ attempts: number().int().nonnegative(),
13603
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13604
+ succeeded: number().int().nonnegative(),
13605
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13606
+ reasons: array(FailureReasonCountSchema).readonly()
13607
+ });
13608
+ method(_void(), array(FailureContributionSchema).readonly());
13501
13609
  var LoadContributionSchema = object({
13502
13610
  role: _enum([
13503
13611
  "decode",
@@ -18026,6 +18134,20 @@ var TrackSchema = object({
18026
18134
  * `=== true` and render nothing otherwise — never infer "no rider".
18027
18135
  */
18028
18136
  hasRider: boolean().optional(),
18137
+ /**
18138
+ * WHY this track ended without a NATIVE best-shot tile
18139
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
18140
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
18141
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
18142
+ * the late-keyFrame upgrade when a native tile lands after all. The
18143
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
18144
+ * tile is a face/plate stand-in, a raster crop, or an icon.
18145
+ *
18146
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
18147
+ * that predates the field, and every track whose tile landed native all
18148
+ * omit it. Render nothing when absent.
18149
+ */
18150
+ previewMissReason: string().optional(),
18029
18151
  ...TrackFlagFields,
18030
18152
  ...TrackRetrainFields
18031
18153
  });
@@ -27252,6 +27374,13 @@ var LoggingSettingsPatchSchema = object({
27252
27374
  * anyone but its owner.
27253
27375
  */
27254
27376
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
27377
+ /**
27378
+ * One per-camera failure counter, plus WHO reported it.
27379
+ *
27380
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
27381
+ * the hub as it enumerates providers, never by the contributor.
27382
+ */
27383
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
27255
27384
  var GetLoggingSettingsInputSchema = object({
27256
27385
  scopeNodeId: string().optional(),
27257
27386
  /**
@@ -27310,7 +27439,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
27310
27439
  }), method(_void(), SiteLocationStatusSchema, {
27311
27440
  kind: "mutation",
27312
27441
  auth: "admin"
27313
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
27442
+ }), 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, {
27314
27443
  kind: "mutation",
27315
27444
  auth: "admin"
27316
27445
  });
@@ -29892,6 +30021,12 @@ Object.freeze({
29892
30021
  addonId: null,
29893
30022
  access: "create"
29894
30023
  },
30024
+ "failureContribution.list": {
30025
+ capName: "failure-contribution",
30026
+ capScope: "system",
30027
+ addonId: null,
30028
+ access: "view"
30029
+ },
29895
30030
  "fanControl.setDirection": {
29896
30031
  capName: "fan-control",
29897
30032
  capScope: "device",
@@ -33198,6 +33333,12 @@ Object.freeze({
33198
33333
  addonId: null,
33199
33334
  access: "create"
33200
33335
  },
33336
+ "system.getFailureContributions": {
33337
+ capName: "system",
33338
+ capScope: "system",
33339
+ addonId: null,
33340
+ access: "view"
33341
+ },
33201
33342
  "system.getLoadContributions": {
33202
33343
  capName: "system",
33203
33344
  capScope: "system",
@@ -13471,6 +13471,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13471
13471
  limit: number().optional(),
13472
13472
  tags: record(string(), string()).optional()
13473
13473
  }), array(LogEntrySchema).readonly());
13474
+ /**
13475
+ * `failure-contribution` — the capability an addon reports its OWN losses
13476
+ * through, per camera, with the denominator attached. It stores nothing.
13477
+ *
13478
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13479
+ *
13480
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13481
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13482
+ * copied: the contributor reports what it already knows, hub-main adds only
13483
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13484
+ * somebody to forget to edit.
13485
+ *
13486
+ * They are not merged, because their invariants are opposites:
13487
+ *
13488
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13489
+ * claim a camera cost nothing, which is a measurement nobody made;
13490
+ * - a `failure-contribution` zero is the **most valuable value on the
13491
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13492
+ * and it is exactly what an absent entry cannot say.
13493
+ *
13494
+ * Putting a loss counter on a cost entry would also break the reconciliation
13495
+ * that gives `load-contribution` its point: contributions are subtracted from
13496
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13497
+ * has no process.
13498
+ *
13499
+ * ## Why not a log line, since the counters already exist
13500
+ *
13501
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13502
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13503
+ * ends in a log line, and a log line is the thing the operator asked to stop
13504
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13505
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13506
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13507
+ * media blackout were both diagnosed. The counters stay; this is where they can
13508
+ * be READ.
13509
+ *
13510
+ * ## The rate is served with its denominator or not at all
13511
+ *
13512
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13513
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13514
+ * than yesterday" and was **flat across twelve hours** once divided by the
13515
+ * successes on the same path. A surface that publishes only the numerator
13516
+ * reproduces that mistake on every read.
13517
+ *
13518
+ * ## Shape
13519
+ *
13520
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13521
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13522
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13523
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13524
+ * a forked runner's entries reach hub-main over transport that already exists.
13525
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13526
+ * result through `system.getFailureContributions`.
13527
+ */
13528
+ var FailureReasonCountSchema = object({
13529
+ /**
13530
+ * Why the attempt did not land, in the contributor's own vocabulary —
13531
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13532
+ * strings that already appear in this repo's logs and, where one exists, the
13533
+ * same string the per-track `previewMissReason` records (D276): a second
13534
+ * vocabulary for the same loss would make the row and the counter
13535
+ * un-joinable.
13536
+ */
13537
+ reason: string(),
13538
+ count: number().int().nonnegative()
13539
+ });
13540
+ var FailureContributionSchema = object({
13541
+ /**
13542
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13543
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13544
+ * `unit` free: the families are owned by different addons and a shared enum
13545
+ * is a central list that rots invisibly.
13546
+ */
13547
+ family: string(),
13548
+ /**
13549
+ * The NUMERIC device id — the same value every log line carries as
13550
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13551
+ * cannot name the camera must not emit the entry, because a fleet total
13552
+ * cannot answer the only question anybody asks of this surface.
13553
+ */
13554
+ deviceId: number().int().positive(),
13555
+ /**
13556
+ * A second dimension inside the family: the model / step id for an inference
13557
+ * timeout, so "which camera AND which model" is one read. Absent when the
13558
+ * family has a single variant.
13559
+ */
13560
+ variant: string().optional(),
13561
+ /**
13562
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13563
+ * differencing two reads must drop the interval when it changes, because the
13564
+ * counter restarted from zero in a respawned runner. Same discipline as
13565
+ * `LoadContribution.startedAtMs`.
13566
+ */
13567
+ sinceMs: number(),
13568
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13569
+ atMs: number(),
13570
+ /**
13571
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13572
+ * window. A failure count published without it is the mistake this schema
13573
+ * exists to make impossible.
13574
+ */
13575
+ attempts: number().int().nonnegative(),
13576
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13577
+ succeeded: number().int().nonnegative(),
13578
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13579
+ reasons: array(FailureReasonCountSchema).readonly()
13580
+ });
13581
+ method(_void(), array(FailureContributionSchema).readonly());
13474
13582
  var LoadContributionSchema = object({
13475
13583
  role: _enum([
13476
13584
  "decode",
@@ -17999,6 +18107,20 @@ var TrackSchema = object({
17999
18107
  * `=== true` and render nothing otherwise — never infer "no rider".
18000
18108
  */
18001
18109
  hasRider: boolean().optional(),
18110
+ /**
18111
+ * WHY this track ended without a NATIVE best-shot tile
18112
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
18113
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
18114
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
18115
+ * the late-keyFrame upgrade when a native tile lands after all. The
18116
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
18117
+ * tile is a face/plate stand-in, a raster crop, or an icon.
18118
+ *
18119
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
18120
+ * that predates the field, and every track whose tile landed native all
18121
+ * omit it. Render nothing when absent.
18122
+ */
18123
+ previewMissReason: string().optional(),
18002
18124
  ...TrackFlagFields,
18003
18125
  ...TrackRetrainFields
18004
18126
  });
@@ -27225,6 +27347,13 @@ var LoggingSettingsPatchSchema = object({
27225
27347
  * anyone but its owner.
27226
27348
  */
27227
27349
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
27350
+ /**
27351
+ * One per-camera failure counter, plus WHO reported it.
27352
+ *
27353
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
27354
+ * the hub as it enumerates providers, never by the contributor.
27355
+ */
27356
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
27228
27357
  var GetLoggingSettingsInputSchema = object({
27229
27358
  scopeNodeId: string().optional(),
27230
27359
  /**
@@ -27283,7 +27412,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
27283
27412
  }), method(_void(), SiteLocationStatusSchema, {
27284
27413
  kind: "mutation",
27285
27414
  auth: "admin"
27286
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
27415
+ }), 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, {
27287
27416
  kind: "mutation",
27288
27417
  auth: "admin"
27289
27418
  });
@@ -29865,6 +29994,12 @@ Object.freeze({
29865
29994
  addonId: null,
29866
29995
  access: "create"
29867
29996
  },
29997
+ "failureContribution.list": {
29998
+ capName: "failure-contribution",
29999
+ capScope: "system",
30000
+ addonId: null,
30001
+ access: "view"
30002
+ },
29868
30003
  "fanControl.setDirection": {
29869
30004
  capName: "fan-control",
29870
30005
  capScope: "device",
@@ -33171,6 +33306,12 @@ Object.freeze({
33171
33306
  addonId: null,
33172
33307
  access: "create"
33173
33308
  },
33309
+ "system.getFailureContributions": {
33310
+ capName: "system",
33311
+ capScope: "system",
33312
+ addonId: null,
33313
+ access: "view"
33314
+ },
33174
33315
  "system.getLoadContributions": {
33175
33316
  capName: "system",
33176
33317
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-export-alexa",
3
- "version": "1.2.44",
3
+ "version": "1.2.45",
4
4
  "description": "Alexa Smart Home Skill export — hub-side OAuth provider + directive handler. The companion AWS Lambda forwards Alexa directives to this addon's /addon/export-alexa/directive endpoint.",
5
5
  "keywords": [
6
6
  "camstack",