@camstack/addon-post-analysis 1.2.72 → 1.2.74

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.
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-Cv9dO26A.mjs
1
+ //#region ../types/dist/event-category-Bxo5yJjt.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -205,6 +205,33 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
205
205
  EventCategory["PipelineCameraAssigned"] = "pipeline.camera-assigned";
206
206
  EventCategory["PipelineCameraUnassigned"] = "pipeline.camera-unassigned";
207
207
  /**
208
+ * A node the orchestrator would otherwise place cameras on has NO usable
209
+ * inference device: the operator enabled one or more accelerators there and
210
+ * the live probe reports every one of them unavailable. Emitted once per
211
+ * TRANSITION into that state (never per dispatch), and the node is dropped
212
+ * from the placement candidate set for as long as it holds.
213
+ *
214
+ * This exists because the state was previously invisible: little-unraid
215
+ * absorbed 283k inference errors in a day while still being handed cameras,
216
+ * and nothing in the system said so.
217
+ *
218
+ * A node with no accelerators configured at all is NOT this — its devices
219
+ * are `disabled`, not `unavailable`, and the runner's default CPU pool
220
+ * serves it exactly as before.
221
+ */
222
+ EventCategory["PipelineNodeInferenceUnavailable"] = "pipeline.node-inference-unavailable";
223
+ /**
224
+ * A camera has an OPEN detection session and has produced no detection at
225
+ * all for longer than the blind threshold — the camera is being decoded and
226
+ * inferred and is returning nothing. Emitted once per transition into blind,
227
+ * per camera.
228
+ *
229
+ * The failure it reports: a 1h43 detection blackout on the entrance camera
230
+ * that nobody noticed, because "a camera that detects nothing" and "a quiet
231
+ * camera" produce byte-identical silence.
232
+ */
233
+ EventCategory["PipelineDetectionBlind"] = "pipeline.detection-blind";
234
+ /**
208
235
  * Per-camera pipeline config was mutated by the orchestrator
209
236
  * (3-level settings change via `setAgentAddonDefaults` /
210
237
  * `setCameraStepToggle` / `setCameraPipelineForAgent` or a
@@ -14549,6 +14576,8 @@ var NcSystemEventKindSchema = _enum([
14549
14576
  "stream-offline",
14550
14577
  "node-online",
14551
14578
  "node-offline",
14579
+ "node-inference-unavailable",
14580
+ "detection-blind",
14552
14581
  "addon-update-available",
14553
14582
  "server-update-available",
14554
14583
  "alarm-triggered",
@@ -14646,7 +14675,16 @@ var NcScheduleSchema = object({
14646
14675
  });
14647
14676
  /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
14648
14677
  var NcPlateMatcherSchema = object({
14649
- values: array(string().min(1)).min(1),
14678
+ /**
14679
+ * Plate texts (or gallery vehicle names) to match. EMPTY = **any plate the
14680
+ * pipeline could read** — the plate half of "no selection = no narrowing",
14681
+ * and the switch that says this rule is about vehicles that were IDENTIFIED
14682
+ * rather than merely seen. A subject carrying no plate still fails.
14683
+ *
14684
+ * The `.min(1)` this used to carry made that state unauthorable; nothing has
14685
+ * ever persisted an empty list, so widening it cannot change an existing rule.
14686
+ */
14687
+ values: array(string().min(1)),
14650
14688
  /** Max Levenshtein distance after normalization (uppercase alphanumeric). */
14651
14689
  maxDistance: number().int().min(0).max(3).default(1)
14652
14690
  });
@@ -14885,18 +14923,47 @@ var NcConditionsSchema = object({
14885
14923
  */
14886
14924
  labelEquals: array(string().min(1)).optional(),
14887
14925
  /**
14888
- * Identity matcher. P1 boundary: matched against the record's collapsed
14889
- * `label` (the identity display name propagated by the face pipeline) —
14890
- * identity-ID matching rides in P2 when identity ids reach the record.
14926
+ * KNOWN FACES — the rule's identity scope, and the switch that says the rule
14927
+ * is about recognised people at all.
14928
+ *
14929
+ * Three states, and the empty one is the point:
14930
+ *
14931
+ * | value | meaning |
14932
+ * | --- | --- |
14933
+ * | absent | the rule does not care who it is; an unrecognised person matches |
14934
+ * | `[]` | **only known faces** — any identity in the gallery, nobody in particular |
14935
+ * | a list | only these identities |
14936
+ *
14937
+ * `[]` is the repo-wide "no selection = no narrowing" reading (an absent
14938
+ * `devices` list is every device), applied one level down: the operator has
14939
+ * turned the face scope ON and narrowed it to nothing, which is every known
14940
+ * face. No second field states the same thing — a switch that can disagree
14941
+ * with the list under it is worse than no switch (D62).
14942
+ *
14943
+ * MEMBERS ARE FACE-GALLERY `Identity.id`s (uuid), not display names. A name is
14944
+ * renameable, and a rule authored on "Gianluca" went silently dark the moment
14945
+ * the operator fixed the spelling. The id reaches the record on
14946
+ * `LabelAttribution.identityId`; the name is what the editor shows and what
14947
+ * `{{label}}` renders.
14948
+ *
14949
+ * Rules written before this carry NAMES, and are resolved to ids lazily at
14950
+ * load (`NcRuleStore.load`) against the live gallery — a name nothing answers
14951
+ * for is left as it stands and reported, never dropped. The engine also
14952
+ * accepts a display-name hit as a compatibility leg, so a rule whose
14953
+ * migration could not resolve keeps matching exactly what it matched before.
14891
14954
  */
14892
14955
  identities: array(string().min(1)).optional(),
14893
- /** Fuzzy plate matcher against the record's `label` (plate text). */
14956
+ /**
14957
+ * KNOWN PLATES / VEHICLES — the plate mirror of {@link identities}, including
14958
+ * the empty-list reading: `values: []` is "any plate the OCR could read",
14959
+ * a non-empty list is those plates (fuzzily). See {@link NcPlateMatcherSchema}.
14960
+ */
14894
14961
  plates: NcPlateMatcherSchema.optional(),
14895
14962
  /**
14896
- * Identity EXCLUDE — mirror of {@link identities} with `notIn` semantics.
14897
- * Same P1 boundary: matched against the record's collapsed `label` (the
14898
- * identity display name). A record with NO label passes (nothing to
14899
- * exclude), unlike the include variant which fails on an absent label.
14963
+ * Identity EXCLUDE — mirror of {@link identities} with `notIn` semantics, and
14964
+ * the same id members and the same lazy name→id migration. A record with NO
14965
+ * identity passes (nothing to exclude), unlike the include variant which
14966
+ * fails on an unrecognised subject. An EMPTY list excludes nobody.
14900
14967
  */
14901
14968
  identitiesExclude: array(string().min(1)).optional(),
14902
14969
  /**
@@ -15288,7 +15355,80 @@ var NcRuleInputSchema = object({
15288
15355
  * a rule that predates the gate must keep delivering byte-for-byte as it
15289
15356
  * did, and absent is the only way to say that without a migration.
15290
15357
  */
15291
- confirm: NcConfirmSchema.optional()
15358
+ confirm: NcConfirmSchema.optional(),
15359
+ /**
15360
+ * WAIT for face/plate recognition before saying anything.
15361
+ *
15362
+ * A notification's TEXT is frozen at enqueue and its media is re-resolved at
15363
+ * send; the identity is neither. A face is confirmed after `confirmFrames`
15364
+ * agreeing observations — p50 **11.4 s** after the track was first seen,
15365
+ * measured on this hub — and an `immediate` rule enqueues on the first object
15366
+ * event, seconds before that. So "Gianluca è arrivato" is unsayable on the
15367
+ * immediate path, and no amount of media re-resolution fixes a sentence.
15368
+ *
15369
+ * Only two honest answers exist, and this flag picks between them. It has
15370
+ * effect ONLY on a rule that declares a recognition scope
15371
+ * ({@link NcConditions.identities} or {@link NcConditions.plates}) — on any
15372
+ * other rule there is nothing to wait for and the flag is inert.
15373
+ *
15374
+ * | value | what happens |
15375
+ * | --- | --- |
15376
+ * | `true` | the rule stops firing on the object event and fires at TRACK CLOSE instead, once, with the name — later, and complete |
15377
+ * | absent / `false` | it fires at once WITHOUT the name, and if recognition lands before the track closes a SECOND, "…is Gianluca" notification follows (one per track, per rule, per target) |
15378
+ *
15379
+ * `.optional()` and deliberately NOT `.default()`: a Zod default does not run
15380
+ * on the addon cap path, and absent has to keep meaning exactly what every
15381
+ * rule authored before this field meant.
15382
+ *
15383
+ * The cost of `true` is stated here because the editor states it too: a rule
15384
+ * that waits also inherits track-close SEMANTICS — its `zones` condition
15385
+ * tests every zone the track visited and a `crossing` condition can no longer
15386
+ * be satisfied, because a closed track carries no crossing.
15387
+ */
15388
+ waitForEnhancement: boolean().optional(),
15389
+ /**
15390
+ * GROUP a burst of subjects into ONE notification that grows.
15391
+ *
15392
+ * Seconds of quiet after the last matching subject before the burst is
15393
+ * considered over. While it is open, the first subject enqueues immediately —
15394
+ * **exactly as today, with no added latency** — and every real growth (a new
15395
+ * subject, or a name confirmed on one already in it) REPLACES that
15396
+ * notification with an updated one naming everybody. The push carries the
15397
+ * group's own coalescing tag, so the phone replaces rather than stacks.
15398
+ *
15399
+ * `0` / absent = off, and off is today's behaviour byte for byte.
15400
+ *
15401
+ * ### Why an idle cutoff and not a window
15402
+ *
15403
+ * The measured seven-person arrival on device 590 spans 110 s with every
15404
+ * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
15405
+ * idle cutoff holds it as one and ends it when the arrival actually ends.
15406
+ * 30 is Frigate's shipped value for the same decision.
15407
+ *
15408
+ * ### What it replaces
15409
+ *
15410
+ * The blind cooldown, which collapses a burst by DISCARDING it. Measured on
15411
+ * device 615 / *Persona su Uscio* over six days: 116 qualifying tracks → 74
15412
+ * notifications, **44 (37.9%) suppressed outright**, 23 of them overlapping a
15413
+ * track that did fire and 7 carrying a confirmed identity nobody heard about.
15414
+ * A group collapses the same volume by MERGING, so the cooldown becomes a
15415
+ * budget over GROUPS — which is what it always meant — and a growth is never
15416
+ * throttled by the window its own first member spent.
15417
+ *
15418
+ * ### Interaction with {@link waitForEnhancement}
15419
+ *
15420
+ * They compose, and the order matters. `waitForEnhancement` defers the rule to
15421
+ * TRACK CLOSE, so with both set the group is opened by the first member to
15422
+ * CLOSE — already carrying its name — and grows as later members close. That
15423
+ * is later, and complete. With grouping alone the group opens on the first
15424
+ * object event and picks up names as they are confirmed, through the growth
15425
+ * path. Neither combination fires twice for one subject.
15426
+ *
15427
+ * `.optional()` and deliberately NOT `.default()`: a Zod default does not run
15428
+ * on the addon cap path, so absent must keep meaning what it meant before this
15429
+ * field existed.
15430
+ */
15431
+ groupIdleSec: number().int().min(0).max(600).optional()
15292
15432
  });
15293
15433
  /**
15294
15434
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -15475,6 +15615,14 @@ var NC_CONDITION_CATALOG = [
15475
15615
  value: "node-offline",
15476
15616
  label: "Node offline"
15477
15617
  },
15618
+ {
15619
+ value: "node-inference-unavailable",
15620
+ label: "Node has no usable inference device"
15621
+ },
15622
+ {
15623
+ value: "detection-blind",
15624
+ label: "Camera detecting nothing"
15625
+ },
15478
15626
  {
15479
15627
  value: "addon-update-available",
15480
15628
  label: "Addon update available"
@@ -15632,32 +15780,32 @@ var NC_CONDITION_CATALOG = [
15632
15780
  {
15633
15781
  id: "identities",
15634
15782
  group: "label",
15635
- label: "Identities",
15783
+ label: "Known faces",
15636
15784
  valueType: "stringList",
15637
15785
  operator: "in",
15638
15786
  appliesTo: ["immediate", "track-end"],
15639
15787
  phase: "P1",
15640
- description: "P1: matched against the identity display name on the record label."
15788
+ description: "Only recognised people. Selecting NOBODY means every identity in the face gallery; selecting some narrows to those. Matched on the gallery id, so renaming a person does not break the rule. On immediate delivery the name is not known yet when the notification is enqueued — see the rule’s \"wait for recognition\" switch."
15641
15789
  },
15642
15790
  {
15643
15791
  id: "plates",
15644
15792
  group: "label",
15645
- label: "License plates",
15793
+ label: "Known plates",
15646
15794
  valueType: "plateMatcher",
15647
15795
  operator: "fuzzyIn",
15648
15796
  appliesTo: ["immediate", "track-end"],
15649
15797
  phase: "P1",
15650
- description: "Levenshtein-tolerant match against the plate text."
15798
+ description: "Only vehicles whose plate was read. Selecting NO plate means any readable plate; listed plates are matched Levenshtein-tolerantly, because OCR noise makes an exact match useless."
15651
15799
  },
15652
15800
  {
15653
15801
  id: "identitiesExclude",
15654
15802
  group: "label",
15655
- label: "Excluded identities",
15803
+ label: "Excluded faces",
15656
15804
  valueType: "stringList",
15657
15805
  operator: "notIn",
15658
15806
  appliesTo: ["immediate", "track-end"],
15659
15807
  phase: "P1",
15660
- description: "Veto by identity display name (mirror of Identities; absent label passes)."
15808
+ description: "Veto by identity (mirror of Known faces, same gallery ids). A subject nobody recognised passes — there is nothing to exclude."
15661
15809
  },
15662
15810
  {
15663
15811
  id: "minLabelConfidence",
@@ -16721,7 +16869,7 @@ var TrackEnvelopeSchema = object({
16721
16869
  * `snapshots[]` references — megabytes across a page of tracks. `slim`
16722
16870
  * keeps every scalar the list surfaces actually render (ids, class(es),
16723
16871
  * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
16724
- * zonesVisited, bestEventId, envelope, hasFace) and returns `positions` /
16872
+ * zonesVisited, bestEventId, envelope, hasFace, hasRider) and returns `positions` /
16725
16873
  * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
16726
16874
  * `getTrack`. Mirrors the event-store `projection` convention
16727
16875
  * (`getObjectEvents` et al.).
@@ -16857,7 +17005,21 @@ union([literal(1), literal(2)]);
16857
17005
  var LabelAttributionSchema = object({
16858
17006
  stepId: string(),
16859
17007
  modelId: string().optional(),
16860
- decidedAt: number()
17008
+ decidedAt: number(),
17009
+ /**
17010
+ * The GALLERY id behind a recognised tier-2 label — a face-gallery
17011
+ * `Identity.id` or a plate-gallery `Vehicle.id` (both `randomUUID`).
17012
+ *
17013
+ * The text alone is a DISPLAY NAME, and a display name is renameable: a
17014
+ * notification rule authored on "Gianluca" stopped matching the moment the
17015
+ * operator fixed the spelling in the gallery, and nothing said so. The id is
17016
+ * the thing that does not move, so it is what a rule matches on
17017
+ * (`NcConditions.identities`) and the text is what a human is shown.
17018
+ *
17019
+ * Absent when the label names no gallery row — a plate the OCR read but no
17020
+ * vehicle claims, a sub-class, a species, any tier-1 value.
17021
+ */
17022
+ identityId: string().optional()
16861
17023
  });
16862
17024
  /**
16863
17025
  * The TIERED label model (roadmap 4g), spread into `TrackSchema` and
@@ -16994,6 +17156,28 @@ var TrackSchema = object({
16994
17156
  * `=== true` and render nothing otherwise, never infer "no face".
16995
17157
  */
16996
17158
  hasFace: boolean().optional(),
17159
+ /**
17160
+ * This subject CONTAINS a folded rider — a person the rider-pairing step
17161
+ * ([D34](../decisions/adr-0034.md)) removed from the frame BEFORE the tracker,
17162
+ * so the passage is tracked once and as a VEHICLE.
17163
+ *
17164
+ * It exists because the fold's record was dishonest. D34 and the code both
17165
+ * said "the person is not lost — it is reported so both entities stay on the
17166
+ * record"; in fact the pair went into a per-processor RAM field behind an
17167
+ * accessor nobody called, and every durable surface said `vehicle`, full
17168
+ * stop. This is the composition note that makes the row true.
17169
+ *
17170
+ * A COMPOSITION, never a class and never a label. "This vehicle contains a
17171
+ * person" is not an answer to "what is this" — both label tiers would refuse
17172
+ * a macro token anyway (D89), and correctly. Nothing here changes what the
17173
+ * subject IS: a cyclist stays one vehicle track, occupancy still counts one,
17174
+ * and a `person` rule still does not fire for someone cycling past.
17175
+ *
17176
+ * **Absent ≠ false**, exactly like {@link hasFace}: every row written before
17177
+ * the column, and every hub that predates the field, omits it. Test
17178
+ * `=== true` and render nothing otherwise — never infer "no rider".
17179
+ */
17180
+ hasRider: boolean().optional(),
16997
17181
  ...TrackFlagFields,
16998
17182
  ...TrackRetrainFields
16999
17183
  });
@@ -37879,4 +38063,4 @@ function vectorDimFromBase64(encoded) {
37879
38063
  return Math.floor(Buffer.from(encoded, "base64").byteLength / 4);
37880
38064
  }
37881
38065
  //#endregion
37882
- export { readDeviceStateFrom as $, TimelapseRuleInputSchema as A, customAction as B, NcSnoozeSchema as C, unknown as Ct, RECORDING_EXPORT_MAX_READ_BYTES as D, OpsLogEntrySchema as E, alarmPanelCapability as F, faceGalleryCapability as G, deriveRecordingMode as H, assertTimelapseCadences as I, isScheduleActive as J, hfModelUrl as K, audioMetricsCapability as L, TimelapseRuleSchema as M, TrackSourceSchema as N, RetrainStatusSchema as O, addonWidgetsSourceCapability as P, plateGalleryCapability as Q, buildEventKindDescriptor as R, NcSnoozeInputSchema as S, string as St, NcTaxonomySchema as T, embeddingEncoderCapability as U, defineCustomActions as V, encodeVectorBase64 as W, notificationRulesCapability as X, kebabToCamel as Y, pipelineAnalyticsCapability as Z, NcRuleInputSchema as _, literal as _t, DETECTION_PIPELINE_CAP_NAME as a, errMsg as at, NcRuleTargetSchema as b, partialRecord as bt, EVENT_PAD_MS as c, createEvent as ct, NC_ALARM_SYSTEM_EVENT_KINDS as d, nodePin as dt, readTimelapseGeneratedAt as et, NC_CONDITION_CATALOG as f, sleep as ft, NcConditionDescriptorSchema as g, discriminatedUnion as gt, NC_TAXONOMY as h, boolean as ht, DETECTION_MACRO_CLASSES as i, zoneAnalyticsCapability as it, TimelapseRulePatchSchema as j, TIMELAPSE_DENSE_FLOOR_SEC as k, LabelAttributionSchema as l, hydrateSchema as lt, NC_SNOOZE_MAX_MINUTES as m, array as mt, DEFAULT_EVENT_COLOR as n, vectorDimFromBase64 as nt, DeclaredDevices as o, BaseAddon as ot, NC_DEFAULT_SNOOZE_MINUTES as p, _enum as pt, isDetectionMacroClass as q, DEFAULT_TIMELAPSE_PREVIEW_TEXT as r, videoclipsCapability as rt, EVENT_KIND_BY_CAP as s, DeviceType as st, BaseDevice as t, subKindsOf as tt, MACRO_LABELS as u, isDeviceScopedCap as ut, NcRulePatchSchema as v, number as vt, NcSnoozeSuppressedSchema as w, EventCategory as wt, NcScheduleSchema as x, record as xt, NcRuleSchema as y, object as yt, cosineSimilarity as z };
38066
+ export { plateGalleryCapability as $, TIMELAPSE_DENSE_FLOOR_SEC as A, cosineSimilarity as B, NcSnoozeSchema as C, string as Ct, OpsLogEntrySchema as D, NcTaxonomySchema as E, addonWidgetsSourceCapability as F, encodeVectorBase64 as G, defineCustomActions as H, alarmPanelCapability as I, isDetectionMacroClass as J, faceGalleryCapability as K, assertTimelapseCadences as L, TimelapseRulePatchSchema as M, TimelapseRuleSchema as N, RECORDING_EXPORT_MAX_READ_BYTES as O, TrackSourceSchema as P, pipelineAnalyticsCapability as Q, audioMetricsCapability as R, NcSnoozeInputSchema as S, record as St, NcSystemEventKindSchema as T, EventCategory as Tt, deriveRecordingMode as U, customAction as V, embeddingEncoderCapability as W, kebabToCamel as X, isScheduleActive as Y, notificationRulesCapability as Z, NcRuleInputSchema as _, discriminatedUnion as _t, DETECTION_PIPELINE_CAP_NAME as a, zoneAnalyticsCapability as at, NcRuleTargetSchema as b, object as bt, EVENT_PAD_MS as c, DeviceType as ct, NC_ALARM_SYSTEM_EVENT_KINDS as d, isDeviceScopedCap as dt, readDeviceStateFrom as et, NC_CONDITION_CATALOG as f, nodePin as ft, NcConditionDescriptorSchema as g, boolean as gt, NC_TAXONOMY as h, array as ht, DETECTION_MACRO_CLASSES as i, videoclipsCapability as it, TimelapseRuleInputSchema as j, RetrainStatusSchema as k, LabelAttributionSchema as l, createEvent as lt, NC_SNOOZE_MAX_MINUTES as m, _enum as mt, DEFAULT_EVENT_COLOR as n, subKindsOf as nt, DeclaredDevices as o, errMsg as ot, NC_DEFAULT_SNOOZE_MINUTES as p, sleep as pt, hfModelUrl as q, DEFAULT_TIMELAPSE_PREVIEW_TEXT as r, vectorDimFromBase64 as rt, EVENT_KIND_BY_CAP as s, BaseAddon as st, BaseDevice as t, readTimelapseGeneratedAt as tt, MACRO_LABELS as u, hydrateSchema as ut, NcRulePatchSchema as v, literal as vt, NcSnoozeSuppressedSchema as w, unknown as wt, NcScheduleSchema as x, partialRecord as xt, NcRuleSchema as y, number as yt, buildEventKindDescriptor as z };
@@ -29,7 +29,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  enumerable: true
30
30
  }) : target, mod));
31
31
  //#endregion
32
- //#region ../types/dist/event-category-Cv9dO26A.mjs
32
+ //#region ../types/dist/event-category-Bxo5yJjt.mjs
33
33
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
34
34
  EventCategory["SystemBoot"] = "system.boot";
35
35
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -236,6 +236,33 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
236
236
  EventCategory["PipelineCameraAssigned"] = "pipeline.camera-assigned";
237
237
  EventCategory["PipelineCameraUnassigned"] = "pipeline.camera-unassigned";
238
238
  /**
239
+ * A node the orchestrator would otherwise place cameras on has NO usable
240
+ * inference device: the operator enabled one or more accelerators there and
241
+ * the live probe reports every one of them unavailable. Emitted once per
242
+ * TRANSITION into that state (never per dispatch), and the node is dropped
243
+ * from the placement candidate set for as long as it holds.
244
+ *
245
+ * This exists because the state was previously invisible: little-unraid
246
+ * absorbed 283k inference errors in a day while still being handed cameras,
247
+ * and nothing in the system said so.
248
+ *
249
+ * A node with no accelerators configured at all is NOT this — its devices
250
+ * are `disabled`, not `unavailable`, and the runner's default CPU pool
251
+ * serves it exactly as before.
252
+ */
253
+ EventCategory["PipelineNodeInferenceUnavailable"] = "pipeline.node-inference-unavailable";
254
+ /**
255
+ * A camera has an OPEN detection session and has produced no detection at
256
+ * all for longer than the blind threshold — the camera is being decoded and
257
+ * inferred and is returning nothing. Emitted once per transition into blind,
258
+ * per camera.
259
+ *
260
+ * The failure it reports: a 1h43 detection blackout on the entrance camera
261
+ * that nobody noticed, because "a camera that detects nothing" and "a quiet
262
+ * camera" produce byte-identical silence.
263
+ */
264
+ EventCategory["PipelineDetectionBlind"] = "pipeline.detection-blind";
265
+ /**
239
266
  * Per-camera pipeline config was mutated by the orchestrator
240
267
  * (3-level settings change via `setAgentAddonDefaults` /
241
268
  * `setCameraStepToggle` / `setCameraPipelineForAgent` or a
@@ -14580,6 +14607,8 @@ var NcSystemEventKindSchema = _enum([
14580
14607
  "stream-offline",
14581
14608
  "node-online",
14582
14609
  "node-offline",
14610
+ "node-inference-unavailable",
14611
+ "detection-blind",
14583
14612
  "addon-update-available",
14584
14613
  "server-update-available",
14585
14614
  "alarm-triggered",
@@ -14677,7 +14706,16 @@ var NcScheduleSchema = object({
14677
14706
  });
14678
14707
  /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
14679
14708
  var NcPlateMatcherSchema = object({
14680
- values: array(string().min(1)).min(1),
14709
+ /**
14710
+ * Plate texts (or gallery vehicle names) to match. EMPTY = **any plate the
14711
+ * pipeline could read** — the plate half of "no selection = no narrowing",
14712
+ * and the switch that says this rule is about vehicles that were IDENTIFIED
14713
+ * rather than merely seen. A subject carrying no plate still fails.
14714
+ *
14715
+ * The `.min(1)` this used to carry made that state unauthorable; nothing has
14716
+ * ever persisted an empty list, so widening it cannot change an existing rule.
14717
+ */
14718
+ values: array(string().min(1)),
14681
14719
  /** Max Levenshtein distance after normalization (uppercase alphanumeric). */
14682
14720
  maxDistance: number().int().min(0).max(3).default(1)
14683
14721
  });
@@ -14916,18 +14954,47 @@ var NcConditionsSchema = object({
14916
14954
  */
14917
14955
  labelEquals: array(string().min(1)).optional(),
14918
14956
  /**
14919
- * Identity matcher. P1 boundary: matched against the record's collapsed
14920
- * `label` (the identity display name propagated by the face pipeline) —
14921
- * identity-ID matching rides in P2 when identity ids reach the record.
14957
+ * KNOWN FACES — the rule's identity scope, and the switch that says the rule
14958
+ * is about recognised people at all.
14959
+ *
14960
+ * Three states, and the empty one is the point:
14961
+ *
14962
+ * | value | meaning |
14963
+ * | --- | --- |
14964
+ * | absent | the rule does not care who it is; an unrecognised person matches |
14965
+ * | `[]` | **only known faces** — any identity in the gallery, nobody in particular |
14966
+ * | a list | only these identities |
14967
+ *
14968
+ * `[]` is the repo-wide "no selection = no narrowing" reading (an absent
14969
+ * `devices` list is every device), applied one level down: the operator has
14970
+ * turned the face scope ON and narrowed it to nothing, which is every known
14971
+ * face. No second field states the same thing — a switch that can disagree
14972
+ * with the list under it is worse than no switch (D62).
14973
+ *
14974
+ * MEMBERS ARE FACE-GALLERY `Identity.id`s (uuid), not display names. A name is
14975
+ * renameable, and a rule authored on "Gianluca" went silently dark the moment
14976
+ * the operator fixed the spelling. The id reaches the record on
14977
+ * `LabelAttribution.identityId`; the name is what the editor shows and what
14978
+ * `{{label}}` renders.
14979
+ *
14980
+ * Rules written before this carry NAMES, and are resolved to ids lazily at
14981
+ * load (`NcRuleStore.load`) against the live gallery — a name nothing answers
14982
+ * for is left as it stands and reported, never dropped. The engine also
14983
+ * accepts a display-name hit as a compatibility leg, so a rule whose
14984
+ * migration could not resolve keeps matching exactly what it matched before.
14922
14985
  */
14923
14986
  identities: array(string().min(1)).optional(),
14924
- /** Fuzzy plate matcher against the record's `label` (plate text). */
14987
+ /**
14988
+ * KNOWN PLATES / VEHICLES — the plate mirror of {@link identities}, including
14989
+ * the empty-list reading: `values: []` is "any plate the OCR could read",
14990
+ * a non-empty list is those plates (fuzzily). See {@link NcPlateMatcherSchema}.
14991
+ */
14925
14992
  plates: NcPlateMatcherSchema.optional(),
14926
14993
  /**
14927
- * Identity EXCLUDE — mirror of {@link identities} with `notIn` semantics.
14928
- * Same P1 boundary: matched against the record's collapsed `label` (the
14929
- * identity display name). A record with NO label passes (nothing to
14930
- * exclude), unlike the include variant which fails on an absent label.
14994
+ * Identity EXCLUDE — mirror of {@link identities} with `notIn` semantics, and
14995
+ * the same id members and the same lazy name→id migration. A record with NO
14996
+ * identity passes (nothing to exclude), unlike the include variant which
14997
+ * fails on an unrecognised subject. An EMPTY list excludes nobody.
14931
14998
  */
14932
14999
  identitiesExclude: array(string().min(1)).optional(),
14933
15000
  /**
@@ -15319,7 +15386,80 @@ var NcRuleInputSchema = object({
15319
15386
  * a rule that predates the gate must keep delivering byte-for-byte as it
15320
15387
  * did, and absent is the only way to say that without a migration.
15321
15388
  */
15322
- confirm: NcConfirmSchema.optional()
15389
+ confirm: NcConfirmSchema.optional(),
15390
+ /**
15391
+ * WAIT for face/plate recognition before saying anything.
15392
+ *
15393
+ * A notification's TEXT is frozen at enqueue and its media is re-resolved at
15394
+ * send; the identity is neither. A face is confirmed after `confirmFrames`
15395
+ * agreeing observations — p50 **11.4 s** after the track was first seen,
15396
+ * measured on this hub — and an `immediate` rule enqueues on the first object
15397
+ * event, seconds before that. So "Gianluca è arrivato" is unsayable on the
15398
+ * immediate path, and no amount of media re-resolution fixes a sentence.
15399
+ *
15400
+ * Only two honest answers exist, and this flag picks between them. It has
15401
+ * effect ONLY on a rule that declares a recognition scope
15402
+ * ({@link NcConditions.identities} or {@link NcConditions.plates}) — on any
15403
+ * other rule there is nothing to wait for and the flag is inert.
15404
+ *
15405
+ * | value | what happens |
15406
+ * | --- | --- |
15407
+ * | `true` | the rule stops firing on the object event and fires at TRACK CLOSE instead, once, with the name — later, and complete |
15408
+ * | absent / `false` | it fires at once WITHOUT the name, and if recognition lands before the track closes a SECOND, "…is Gianluca" notification follows (one per track, per rule, per target) |
15409
+ *
15410
+ * `.optional()` and deliberately NOT `.default()`: a Zod default does not run
15411
+ * on the addon cap path, and absent has to keep meaning exactly what every
15412
+ * rule authored before this field meant.
15413
+ *
15414
+ * The cost of `true` is stated here because the editor states it too: a rule
15415
+ * that waits also inherits track-close SEMANTICS — its `zones` condition
15416
+ * tests every zone the track visited and a `crossing` condition can no longer
15417
+ * be satisfied, because a closed track carries no crossing.
15418
+ */
15419
+ waitForEnhancement: boolean().optional(),
15420
+ /**
15421
+ * GROUP a burst of subjects into ONE notification that grows.
15422
+ *
15423
+ * Seconds of quiet after the last matching subject before the burst is
15424
+ * considered over. While it is open, the first subject enqueues immediately —
15425
+ * **exactly as today, with no added latency** — and every real growth (a new
15426
+ * subject, or a name confirmed on one already in it) REPLACES that
15427
+ * notification with an updated one naming everybody. The push carries the
15428
+ * group's own coalescing tag, so the phone replaces rather than stacks.
15429
+ *
15430
+ * `0` / absent = off, and off is today's behaviour byte for byte.
15431
+ *
15432
+ * ### Why an idle cutoff and not a window
15433
+ *
15434
+ * The measured seven-person arrival on device 590 spans 110 s with every
15435
+ * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
15436
+ * idle cutoff holds it as one and ends it when the arrival actually ends.
15437
+ * 30 is Frigate's shipped value for the same decision.
15438
+ *
15439
+ * ### What it replaces
15440
+ *
15441
+ * The blind cooldown, which collapses a burst by DISCARDING it. Measured on
15442
+ * device 615 / *Persona su Uscio* over six days: 116 qualifying tracks → 74
15443
+ * notifications, **44 (37.9%) suppressed outright**, 23 of them overlapping a
15444
+ * track that did fire and 7 carrying a confirmed identity nobody heard about.
15445
+ * A group collapses the same volume by MERGING, so the cooldown becomes a
15446
+ * budget over GROUPS — which is what it always meant — and a growth is never
15447
+ * throttled by the window its own first member spent.
15448
+ *
15449
+ * ### Interaction with {@link waitForEnhancement}
15450
+ *
15451
+ * They compose, and the order matters. `waitForEnhancement` defers the rule to
15452
+ * TRACK CLOSE, so with both set the group is opened by the first member to
15453
+ * CLOSE — already carrying its name — and grows as later members close. That
15454
+ * is later, and complete. With grouping alone the group opens on the first
15455
+ * object event and picks up names as they are confirmed, through the growth
15456
+ * path. Neither combination fires twice for one subject.
15457
+ *
15458
+ * `.optional()` and deliberately NOT `.default()`: a Zod default does not run
15459
+ * on the addon cap path, so absent must keep meaning what it meant before this
15460
+ * field existed.
15461
+ */
15462
+ groupIdleSec: number().int().min(0).max(600).optional()
15323
15463
  });
15324
15464
  /**
15325
15465
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -15506,6 +15646,14 @@ var NC_CONDITION_CATALOG = [
15506
15646
  value: "node-offline",
15507
15647
  label: "Node offline"
15508
15648
  },
15649
+ {
15650
+ value: "node-inference-unavailable",
15651
+ label: "Node has no usable inference device"
15652
+ },
15653
+ {
15654
+ value: "detection-blind",
15655
+ label: "Camera detecting nothing"
15656
+ },
15509
15657
  {
15510
15658
  value: "addon-update-available",
15511
15659
  label: "Addon update available"
@@ -15663,32 +15811,32 @@ var NC_CONDITION_CATALOG = [
15663
15811
  {
15664
15812
  id: "identities",
15665
15813
  group: "label",
15666
- label: "Identities",
15814
+ label: "Known faces",
15667
15815
  valueType: "stringList",
15668
15816
  operator: "in",
15669
15817
  appliesTo: ["immediate", "track-end"],
15670
15818
  phase: "P1",
15671
- description: "P1: matched against the identity display name on the record label."
15819
+ description: "Only recognised people. Selecting NOBODY means every identity in the face gallery; selecting some narrows to those. Matched on the gallery id, so renaming a person does not break the rule. On immediate delivery the name is not known yet when the notification is enqueued — see the rule’s \"wait for recognition\" switch."
15672
15820
  },
15673
15821
  {
15674
15822
  id: "plates",
15675
15823
  group: "label",
15676
- label: "License plates",
15824
+ label: "Known plates",
15677
15825
  valueType: "plateMatcher",
15678
15826
  operator: "fuzzyIn",
15679
15827
  appliesTo: ["immediate", "track-end"],
15680
15828
  phase: "P1",
15681
- description: "Levenshtein-tolerant match against the plate text."
15829
+ description: "Only vehicles whose plate was read. Selecting NO plate means any readable plate; listed plates are matched Levenshtein-tolerantly, because OCR noise makes an exact match useless."
15682
15830
  },
15683
15831
  {
15684
15832
  id: "identitiesExclude",
15685
15833
  group: "label",
15686
- label: "Excluded identities",
15834
+ label: "Excluded faces",
15687
15835
  valueType: "stringList",
15688
15836
  operator: "notIn",
15689
15837
  appliesTo: ["immediate", "track-end"],
15690
15838
  phase: "P1",
15691
- description: "Veto by identity display name (mirror of Identities; absent label passes)."
15839
+ description: "Veto by identity (mirror of Known faces, same gallery ids). A subject nobody recognised passes — there is nothing to exclude."
15692
15840
  },
15693
15841
  {
15694
15842
  id: "minLabelConfidence",
@@ -16752,7 +16900,7 @@ var TrackEnvelopeSchema = object({
16752
16900
  * `snapshots[]` references — megabytes across a page of tracks. `slim`
16753
16901
  * keeps every scalar the list surfaces actually render (ids, class(es),
16754
16902
  * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
16755
- * zonesVisited, bestEventId, envelope, hasFace) and returns `positions` /
16903
+ * zonesVisited, bestEventId, envelope, hasFace, hasRider) and returns `positions` /
16756
16904
  * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
16757
16905
  * `getTrack`. Mirrors the event-store `projection` convention
16758
16906
  * (`getObjectEvents` et al.).
@@ -16888,7 +17036,21 @@ union([literal(1), literal(2)]);
16888
17036
  var LabelAttributionSchema = object({
16889
17037
  stepId: string(),
16890
17038
  modelId: string().optional(),
16891
- decidedAt: number()
17039
+ decidedAt: number(),
17040
+ /**
17041
+ * The GALLERY id behind a recognised tier-2 label — a face-gallery
17042
+ * `Identity.id` or a plate-gallery `Vehicle.id` (both `randomUUID`).
17043
+ *
17044
+ * The text alone is a DISPLAY NAME, and a display name is renameable: a
17045
+ * notification rule authored on "Gianluca" stopped matching the moment the
17046
+ * operator fixed the spelling in the gallery, and nothing said so. The id is
17047
+ * the thing that does not move, so it is what a rule matches on
17048
+ * (`NcConditions.identities`) and the text is what a human is shown.
17049
+ *
17050
+ * Absent when the label names no gallery row — a plate the OCR read but no
17051
+ * vehicle claims, a sub-class, a species, any tier-1 value.
17052
+ */
17053
+ identityId: string().optional()
16892
17054
  });
16893
17055
  /**
16894
17056
  * The TIERED label model (roadmap 4g), spread into `TrackSchema` and
@@ -17025,6 +17187,28 @@ var TrackSchema = object({
17025
17187
  * `=== true` and render nothing otherwise, never infer "no face".
17026
17188
  */
17027
17189
  hasFace: boolean().optional(),
17190
+ /**
17191
+ * This subject CONTAINS a folded rider — a person the rider-pairing step
17192
+ * ([D34](../decisions/adr-0034.md)) removed from the frame BEFORE the tracker,
17193
+ * so the passage is tracked once and as a VEHICLE.
17194
+ *
17195
+ * It exists because the fold's record was dishonest. D34 and the code both
17196
+ * said "the person is not lost — it is reported so both entities stay on the
17197
+ * record"; in fact the pair went into a per-processor RAM field behind an
17198
+ * accessor nobody called, and every durable surface said `vehicle`, full
17199
+ * stop. This is the composition note that makes the row true.
17200
+ *
17201
+ * A COMPOSITION, never a class and never a label. "This vehicle contains a
17202
+ * person" is not an answer to "what is this" — both label tiers would refuse
17203
+ * a macro token anyway (D89), and correctly. Nothing here changes what the
17204
+ * subject IS: a cyclist stays one vehicle track, occupancy still counts one,
17205
+ * and a `person` rule still does not fire for someone cycling past.
17206
+ *
17207
+ * **Absent ≠ false**, exactly like {@link hasFace}: every row written before
17208
+ * the column, and every hub that predates the field, omits it. Test
17209
+ * `=== true` and render nothing otherwise — never infer "no rider".
17210
+ */
17211
+ hasRider: boolean().optional(),
17028
17212
  ...TrackFlagFields,
17029
17213
  ...TrackRetrainFields
17030
17214
  });
@@ -38072,6 +38256,12 @@ Object.defineProperty(exports, "NcSnoozeSuppressedSchema", {
38072
38256
  return NcSnoozeSuppressedSchema;
38073
38257
  }
38074
38258
  });
38259
+ Object.defineProperty(exports, "NcSystemEventKindSchema", {
38260
+ enumerable: true,
38261
+ get: function() {
38262
+ return NcSystemEventKindSchema;
38263
+ }
38264
+ });
38075
38265
  Object.defineProperty(exports, "NcTaxonomySchema", {
38076
38266
  enumerable: true,
38077
38267
  get: function() {