@camstack/addon-decoder-nodeav 1.2.87 → 1.2.88

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/index.js CHANGED
@@ -7627,6 +7627,157 @@ var CameraSwitchGroupSchema = object({
7627
7627
  /** Unix ms when the group was composed server-side. */
7628
7628
  fetchedAt: number()
7629
7629
  });
7630
+ /**
7631
+ * What the gate decided about a birth, from the CALLER's point of view.
7632
+ *
7633
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
7634
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
7635
+ * The third member is the one the gate's own type cannot express, because
7636
+ * exhaustion is a property of how long the caller waited.
7637
+ */
7638
+ var BirthDecisionVerdictSchema = _enum([
7639
+ "confirmed",
7640
+ "suppressed",
7641
+ "exhausted-fallback"
7642
+ ]);
7643
+ /** One birth decision, as it is kept. */
7644
+ var BirthDecisionRecordSchema = object({
7645
+ id: string(),
7646
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
7647
+ at: number().int(),
7648
+ /** The camera. Required: every question here is asked per-camera. */
7649
+ deviceId: number().int(),
7650
+ /**
7651
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
7652
+ * birth has no track at all, and a confirmed one is expected to age out long
7653
+ * before this row does. Named `sourceTrackId` so the retention model's
7654
+ * ownership derivation (`collection-classification.ts`, which keys on a
7655
+ * column literally called `trackId`) cannot reach it.
7656
+ */
7657
+ sourceTrackId: string(),
7658
+ /** The candidate's claimed class. The miss rate is asked per class too. */
7659
+ className: string(),
7660
+ verdict: BirthDecisionVerdictSchema,
7661
+ /**
7662
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
7663
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
7664
+ * when the gate is DISABLED and every birth is waved through. `null` is not
7665
+ * "unknown": it says the gate took no measurement because it was off, which
7666
+ * is a different population and must never be averaged in with the rest.
7667
+ */
7668
+ reason: string().nullable(),
7669
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
7670
+ attempts: number().int(),
7671
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
7672
+ deferredForMs: number().int(),
7673
+ /**
7674
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
7675
+ *
7676
+ * `true` when the frame the verdict was taken on carried no matched
7677
+ * detection for this track — the tracker was coasting a frozen box and the
7678
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
7679
+ * straight out of `result.tracked` without checking, so this is reachable
7680
+ * today; the question is the RATE, per camera, and whether refusing those
7681
+ * frames would have cost real tracks (cross-read against `verdict` and
7682
+ * `decidedByBirthEvidence`).
7683
+ */
7684
+ decidedOnCoastedFrame: boolean(),
7685
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
7686
+ birthEvidenceAvailable: boolean(),
7687
+ /**
7688
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
7689
+ * deciding are different: the carried crop is confirm-only, so a candidate
7690
+ * can hold evidence, be found inconclusive on it, and be decided by a native
7691
+ * crop of a later instant. A coasted decision backed by carried evidence is
7692
+ * a real observation of the birth instant; one without it is not.
7693
+ */
7694
+ decidedByBirthEvidence: boolean(),
7695
+ /** Best class-compatible crop score, or `null` when nothing compatible was
7696
+ * found — deliberately not 0, which would be a measurement that never was. */
7697
+ bestScore: number().nullable(),
7698
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
7699
+ appliedMinConfidence: number().nullable(),
7700
+ /**
7701
+ * The track's own `firstSeen` — the candidate's first frame, which is where
7702
+ * the timeline starts. `null` for a suppressed birth, which has no track.
7703
+ */
7704
+ firstSeen: number().int().nullable(),
7705
+ /**
7706
+ * The device's most recent motion RISING EDGE at the moment of the decision,
7707
+ * or `null` when there is none, it is older than
7708
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
7709
+ */
7710
+ motionOnsetAt: number().int().nullable(),
7711
+ /**
7712
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
7713
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
7714
+ *
7715
+ * **Why motion onset and not something else.** Two other proxies were
7716
+ * considered and rejected:
7717
+ * - *the recording/pipeline session start*: for a camera on
7718
+ * `detectionMode: 'always'` the session opens at process start, hours
7719
+ * before any subject. It measures nothing.
7720
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
7721
+ * `firstSeen` IS the first detection of that object, so for the track that
7722
+ * OPENS a burst — the only one the operator is complaining about — the two
7723
+ * are the same instant and the latency is 0 by construction.
7724
+ * Motion onset is the only in-process signal produced by a DIFFERENT
7725
+ * mechanism from the object detector, so it is the only one that can precede
7726
+ * it. It is also already maintained per-device at frame rate on this very
7727
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
7728
+ * it free — and, decisively, the frame path and the motion path are gated to
7729
+ * the SAME designated post-processing node, so the mirror is never empty for
7730
+ * a camera whose births land here.
7731
+ *
7732
+ * **Error bars, all of them.**
7733
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
7734
+ * wall or a branch, and only later joined by the person, OVERSTATES the
7735
+ * latency without bound. Mitigated, never removed, by
7736
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
7737
+ * candidate for "this burst is this subject", and even then it is a
7738
+ * candidate, not a fact.
7739
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
7740
+ * intensity threshold. A subject entering slowly at the far edge of the
7741
+ * frame can clear the detector's confidence floor BEFORE it clears the
7742
+ * motion floor, making this negative. Negatives are stored as-is and
7743
+ * never clamped — clamping would fabricate the distribution's left tail,
7744
+ * which is the half that says the proxy is unreliable.
7745
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
7746
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
7747
+ * therefore comparable WITHIN a camera and not across cameras of
7748
+ * different motion sources. The motion source is deliberately not copied
7749
+ * here — it belongs to the addon that owns the device (D224) and this is
7750
+ * a write on the frame path — so group by `deviceId`, which is how the
7751
+ * question is always asked anyway.
7752
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
7753
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
7754
+ * past it this is `null`.
7755
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
7756
+ * reporting, or nothing since boot: `null`. Which is the truth about a
7757
+ * camera nobody has a reference instant for.
7758
+ *
7759
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
7760
+ * as such. It is not a per-track fact and must never be shown as one.
7761
+ */
7762
+ birthLatencyMs: number().int().nullable(),
7763
+ /**
7764
+ * How many births this device has already decided since that motion onset.
7765
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
7766
+ * this subject. `null` when there is no usable onset.
7767
+ */
7768
+ birthIndexInBurst: number().int().nullable()
7769
+ });
7770
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
7771
+ var BirthDecisionQueryInputSchema = object({
7772
+ /** Restrict to a single camera; omit for every row. */
7773
+ deviceId: number().int().optional(),
7774
+ /** Only decisions at or after this epoch ms. */
7775
+ since: number().int().optional(),
7776
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
7777
+ verdict: BirthDecisionVerdictSchema.optional(),
7778
+ /** Max rows returned, newest-first. */
7779
+ limit: number().int().min(1).max(5e3).optional()
7780
+ });
7630
7781
  /** One archived note — the operator's words plus enough context to find what
7631
7782
  * they were looking at, after the track itself is gone. */
7632
7783
  var ArchivedDebugNoteSchema = object({
@@ -19881,7 +20032,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19881
20032
  deviceId: number(),
19882
20033
  trackId: string(),
19883
20034
  flags: TrackFlagsPatchSchema
19884
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20035
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
19885
20036
  kind: "query",
19886
20037
  auth: "admin"
19887
20038
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -33285,6 +33436,12 @@ Object.freeze({
33285
33436
  addonId: null,
33286
33437
  access: "view"
33287
33438
  },
33439
+ "pipelineAnalytics.listBirthDecisions": {
33440
+ capName: "pipeline-analytics",
33441
+ capScope: "device",
33442
+ addonId: null,
33443
+ access: "view"
33444
+ },
33288
33445
  "pipelineAnalytics.listEventKinds": {
33289
33446
  capName: "pipeline-analytics",
33290
33447
  capScope: "device",
@@ -37077,6 +37234,11 @@ Object.freeze({
37077
37234
  form: "single",
37078
37235
  optional: true
37079
37236
  }],
37237
+ "pipelineAnalytics.listBirthDecisions": [{
37238
+ name: "deviceId",
37239
+ form: "single",
37240
+ optional: true
37241
+ }],
37080
37242
  "pipelineAnalytics.listEventKinds": [{
37081
37243
  name: "deviceId",
37082
37244
  form: "single",
package/dist/index.mjs CHANGED
@@ -7623,6 +7623,157 @@ var CameraSwitchGroupSchema = object({
7623
7623
  /** Unix ms when the group was composed server-side. */
7624
7624
  fetchedAt: number()
7625
7625
  });
7626
+ /**
7627
+ * What the gate decided about a birth, from the CALLER's point of view.
7628
+ *
7629
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
7630
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
7631
+ * The third member is the one the gate's own type cannot express, because
7632
+ * exhaustion is a property of how long the caller waited.
7633
+ */
7634
+ var BirthDecisionVerdictSchema = _enum([
7635
+ "confirmed",
7636
+ "suppressed",
7637
+ "exhausted-fallback"
7638
+ ]);
7639
+ /** One birth decision, as it is kept. */
7640
+ var BirthDecisionRecordSchema = object({
7641
+ id: string(),
7642
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
7643
+ at: number().int(),
7644
+ /** The camera. Required: every question here is asked per-camera. */
7645
+ deviceId: number().int(),
7646
+ /**
7647
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
7648
+ * birth has no track at all, and a confirmed one is expected to age out long
7649
+ * before this row does. Named `sourceTrackId` so the retention model's
7650
+ * ownership derivation (`collection-classification.ts`, which keys on a
7651
+ * column literally called `trackId`) cannot reach it.
7652
+ */
7653
+ sourceTrackId: string(),
7654
+ /** The candidate's claimed class. The miss rate is asked per class too. */
7655
+ className: string(),
7656
+ verdict: BirthDecisionVerdictSchema,
7657
+ /**
7658
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
7659
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
7660
+ * when the gate is DISABLED and every birth is waved through. `null` is not
7661
+ * "unknown": it says the gate took no measurement because it was off, which
7662
+ * is a different population and must never be averaged in with the rest.
7663
+ */
7664
+ reason: string().nullable(),
7665
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
7666
+ attempts: number().int(),
7667
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
7668
+ deferredForMs: number().int(),
7669
+ /**
7670
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
7671
+ *
7672
+ * `true` when the frame the verdict was taken on carried no matched
7673
+ * detection for this track — the tracker was coasting a frozen box and the
7674
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
7675
+ * straight out of `result.tracked` without checking, so this is reachable
7676
+ * today; the question is the RATE, per camera, and whether refusing those
7677
+ * frames would have cost real tracks (cross-read against `verdict` and
7678
+ * `decidedByBirthEvidence`).
7679
+ */
7680
+ decidedOnCoastedFrame: boolean(),
7681
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
7682
+ birthEvidenceAvailable: boolean(),
7683
+ /**
7684
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
7685
+ * deciding are different: the carried crop is confirm-only, so a candidate
7686
+ * can hold evidence, be found inconclusive on it, and be decided by a native
7687
+ * crop of a later instant. A coasted decision backed by carried evidence is
7688
+ * a real observation of the birth instant; one without it is not.
7689
+ */
7690
+ decidedByBirthEvidence: boolean(),
7691
+ /** Best class-compatible crop score, or `null` when nothing compatible was
7692
+ * found — deliberately not 0, which would be a measurement that never was. */
7693
+ bestScore: number().nullable(),
7694
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
7695
+ appliedMinConfidence: number().nullable(),
7696
+ /**
7697
+ * The track's own `firstSeen` — the candidate's first frame, which is where
7698
+ * the timeline starts. `null` for a suppressed birth, which has no track.
7699
+ */
7700
+ firstSeen: number().int().nullable(),
7701
+ /**
7702
+ * The device's most recent motion RISING EDGE at the moment of the decision,
7703
+ * or `null` when there is none, it is older than
7704
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
7705
+ */
7706
+ motionOnsetAt: number().int().nullable(),
7707
+ /**
7708
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
7709
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
7710
+ *
7711
+ * **Why motion onset and not something else.** Two other proxies were
7712
+ * considered and rejected:
7713
+ * - *the recording/pipeline session start*: for a camera on
7714
+ * `detectionMode: 'always'` the session opens at process start, hours
7715
+ * before any subject. It measures nothing.
7716
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
7717
+ * `firstSeen` IS the first detection of that object, so for the track that
7718
+ * OPENS a burst — the only one the operator is complaining about — the two
7719
+ * are the same instant and the latency is 0 by construction.
7720
+ * Motion onset is the only in-process signal produced by a DIFFERENT
7721
+ * mechanism from the object detector, so it is the only one that can precede
7722
+ * it. It is also already maintained per-device at frame rate on this very
7723
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
7724
+ * it free — and, decisively, the frame path and the motion path are gated to
7725
+ * the SAME designated post-processing node, so the mirror is never empty for
7726
+ * a camera whose births land here.
7727
+ *
7728
+ * **Error bars, all of them.**
7729
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
7730
+ * wall or a branch, and only later joined by the person, OVERSTATES the
7731
+ * latency without bound. Mitigated, never removed, by
7732
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
7733
+ * candidate for "this burst is this subject", and even then it is a
7734
+ * candidate, not a fact.
7735
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
7736
+ * intensity threshold. A subject entering slowly at the far edge of the
7737
+ * frame can clear the detector's confidence floor BEFORE it clears the
7738
+ * motion floor, making this negative. Negatives are stored as-is and
7739
+ * never clamped — clamping would fabricate the distribution's left tail,
7740
+ * which is the half that says the proxy is unreliable.
7741
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
7742
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
7743
+ * therefore comparable WITHIN a camera and not across cameras of
7744
+ * different motion sources. The motion source is deliberately not copied
7745
+ * here — it belongs to the addon that owns the device (D224) and this is
7746
+ * a write on the frame path — so group by `deviceId`, which is how the
7747
+ * question is always asked anyway.
7748
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
7749
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
7750
+ * past it this is `null`.
7751
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
7752
+ * reporting, or nothing since boot: `null`. Which is the truth about a
7753
+ * camera nobody has a reference instant for.
7754
+ *
7755
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
7756
+ * as such. It is not a per-track fact and must never be shown as one.
7757
+ */
7758
+ birthLatencyMs: number().int().nullable(),
7759
+ /**
7760
+ * How many births this device has already decided since that motion onset.
7761
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
7762
+ * this subject. `null` when there is no usable onset.
7763
+ */
7764
+ birthIndexInBurst: number().int().nullable()
7765
+ });
7766
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
7767
+ var BirthDecisionQueryInputSchema = object({
7768
+ /** Restrict to a single camera; omit for every row. */
7769
+ deviceId: number().int().optional(),
7770
+ /** Only decisions at or after this epoch ms. */
7771
+ since: number().int().optional(),
7772
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
7773
+ verdict: BirthDecisionVerdictSchema.optional(),
7774
+ /** Max rows returned, newest-first. */
7775
+ limit: number().int().min(1).max(5e3).optional()
7776
+ });
7626
7777
  /** One archived note — the operator's words plus enough context to find what
7627
7778
  * they were looking at, after the track itself is gone. */
7628
7779
  var ArchivedDebugNoteSchema = object({
@@ -19877,7 +20028,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19877
20028
  deviceId: number(),
19878
20029
  trackId: string(),
19879
20030
  flags: TrackFlagsPatchSchema
19880
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20031
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
19881
20032
  kind: "query",
19882
20033
  auth: "admin"
19883
20034
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -33281,6 +33432,12 @@ Object.freeze({
33281
33432
  addonId: null,
33282
33433
  access: "view"
33283
33434
  },
33435
+ "pipelineAnalytics.listBirthDecisions": {
33436
+ capName: "pipeline-analytics",
33437
+ capScope: "device",
33438
+ addonId: null,
33439
+ access: "view"
33440
+ },
33284
33441
  "pipelineAnalytics.listEventKinds": {
33285
33442
  capName: "pipeline-analytics",
33286
33443
  capScope: "device",
@@ -37073,6 +37230,11 @@ Object.freeze({
37073
37230
  form: "single",
37074
37231
  optional: true
37075
37232
  }],
37233
+ "pipelineAnalytics.listBirthDecisions": [{
37234
+ name: "deviceId",
37235
+ form: "single",
37236
+ optional: true
37237
+ }],
37076
37238
  "pipelineAnalytics.listEventKinds": [{
37077
37239
  name: "deviceId",
37078
37240
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-decoder-nodeav",
3
- "version": "1.2.87",
3
+ "version": "1.2.88",
4
4
  "description": "Standalone in-process node-av decoder addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",