@camstack/addon-matter-broker 0.2.86 → 0.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/addon.js CHANGED
@@ -7641,6 +7641,157 @@ var CameraSwitchGroupSchema = object({
7641
7641
  /** Unix ms when the group was composed server-side. */
7642
7642
  fetchedAt: number()
7643
7643
  });
7644
+ /**
7645
+ * What the gate decided about a birth, from the CALLER's point of view.
7646
+ *
7647
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
7648
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
7649
+ * The third member is the one the gate's own type cannot express, because
7650
+ * exhaustion is a property of how long the caller waited.
7651
+ */
7652
+ var BirthDecisionVerdictSchema = _enum([
7653
+ "confirmed",
7654
+ "suppressed",
7655
+ "exhausted-fallback"
7656
+ ]);
7657
+ /** One birth decision, as it is kept. */
7658
+ var BirthDecisionRecordSchema = object({
7659
+ id: string$2(),
7660
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
7661
+ at: number().int(),
7662
+ /** The camera. Required: every question here is asked per-camera. */
7663
+ deviceId: number().int(),
7664
+ /**
7665
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
7666
+ * birth has no track at all, and a confirmed one is expected to age out long
7667
+ * before this row does. Named `sourceTrackId` so the retention model's
7668
+ * ownership derivation (`collection-classification.ts`, which keys on a
7669
+ * column literally called `trackId`) cannot reach it.
7670
+ */
7671
+ sourceTrackId: string$2(),
7672
+ /** The candidate's claimed class. The miss rate is asked per class too. */
7673
+ className: string$2(),
7674
+ verdict: BirthDecisionVerdictSchema,
7675
+ /**
7676
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
7677
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
7678
+ * when the gate is DISABLED and every birth is waved through. `null` is not
7679
+ * "unknown": it says the gate took no measurement because it was off, which
7680
+ * is a different population and must never be averaged in with the rest.
7681
+ */
7682
+ reason: string$2().nullable(),
7683
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
7684
+ attempts: number().int(),
7685
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
7686
+ deferredForMs: number().int(),
7687
+ /**
7688
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
7689
+ *
7690
+ * `true` when the frame the verdict was taken on carried no matched
7691
+ * detection for this track — the tracker was coasting a frozen box and the
7692
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
7693
+ * straight out of `result.tracked` without checking, so this is reachable
7694
+ * today; the question is the RATE, per camera, and whether refusing those
7695
+ * frames would have cost real tracks (cross-read against `verdict` and
7696
+ * `decidedByBirthEvidence`).
7697
+ */
7698
+ decidedOnCoastedFrame: boolean(),
7699
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
7700
+ birthEvidenceAvailable: boolean(),
7701
+ /**
7702
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
7703
+ * deciding are different: the carried crop is confirm-only, so a candidate
7704
+ * can hold evidence, be found inconclusive on it, and be decided by a native
7705
+ * crop of a later instant. A coasted decision backed by carried evidence is
7706
+ * a real observation of the birth instant; one without it is not.
7707
+ */
7708
+ decidedByBirthEvidence: boolean(),
7709
+ /** Best class-compatible crop score, or `null` when nothing compatible was
7710
+ * found — deliberately not 0, which would be a measurement that never was. */
7711
+ bestScore: number().nullable(),
7712
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
7713
+ appliedMinConfidence: number().nullable(),
7714
+ /**
7715
+ * The track's own `firstSeen` — the candidate's first frame, which is where
7716
+ * the timeline starts. `null` for a suppressed birth, which has no track.
7717
+ */
7718
+ firstSeen: number().int().nullable(),
7719
+ /**
7720
+ * The device's most recent motion RISING EDGE at the moment of the decision,
7721
+ * or `null` when there is none, it is older than
7722
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
7723
+ */
7724
+ motionOnsetAt: number().int().nullable(),
7725
+ /**
7726
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
7727
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
7728
+ *
7729
+ * **Why motion onset and not something else.** Two other proxies were
7730
+ * considered and rejected:
7731
+ * - *the recording/pipeline session start*: for a camera on
7732
+ * `detectionMode: 'always'` the session opens at process start, hours
7733
+ * before any subject. It measures nothing.
7734
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
7735
+ * `firstSeen` IS the first detection of that object, so for the track that
7736
+ * OPENS a burst — the only one the operator is complaining about — the two
7737
+ * are the same instant and the latency is 0 by construction.
7738
+ * Motion onset is the only in-process signal produced by a DIFFERENT
7739
+ * mechanism from the object detector, so it is the only one that can precede
7740
+ * it. It is also already maintained per-device at frame rate on this very
7741
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
7742
+ * it free — and, decisively, the frame path and the motion path are gated to
7743
+ * the SAME designated post-processing node, so the mirror is never empty for
7744
+ * a camera whose births land here.
7745
+ *
7746
+ * **Error bars, all of them.**
7747
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
7748
+ * wall or a branch, and only later joined by the person, OVERSTATES the
7749
+ * latency without bound. Mitigated, never removed, by
7750
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
7751
+ * candidate for "this burst is this subject", and even then it is a
7752
+ * candidate, not a fact.
7753
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
7754
+ * intensity threshold. A subject entering slowly at the far edge of the
7755
+ * frame can clear the detector's confidence floor BEFORE it clears the
7756
+ * motion floor, making this negative. Negatives are stored as-is and
7757
+ * never clamped — clamping would fabricate the distribution's left tail,
7758
+ * which is the half that says the proxy is unreliable.
7759
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
7760
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
7761
+ * therefore comparable WITHIN a camera and not across cameras of
7762
+ * different motion sources. The motion source is deliberately not copied
7763
+ * here — it belongs to the addon that owns the device (D224) and this is
7764
+ * a write on the frame path — so group by `deviceId`, which is how the
7765
+ * question is always asked anyway.
7766
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
7767
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
7768
+ * past it this is `null`.
7769
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
7770
+ * reporting, or nothing since boot: `null`. Which is the truth about a
7771
+ * camera nobody has a reference instant for.
7772
+ *
7773
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
7774
+ * as such. It is not a per-track fact and must never be shown as one.
7775
+ */
7776
+ birthLatencyMs: number().int().nullable(),
7777
+ /**
7778
+ * How many births this device has already decided since that motion onset.
7779
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
7780
+ * this subject. `null` when there is no usable onset.
7781
+ */
7782
+ birthIndexInBurst: number().int().nullable()
7783
+ });
7784
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
7785
+ var BirthDecisionQueryInputSchema = object({
7786
+ /** Restrict to a single camera; omit for every row. */
7787
+ deviceId: number().int().optional(),
7788
+ /** Only decisions at or after this epoch ms. */
7789
+ since: number().int().optional(),
7790
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
7791
+ verdict: BirthDecisionVerdictSchema.optional(),
7792
+ /** Max rows returned, newest-first. */
7793
+ limit: number().int().min(1).max(5e3).optional()
7794
+ });
7644
7795
  /** One archived note — the operator's words plus enough context to find what
7645
7796
  * they were looking at, after the track itself is gone. */
7646
7797
  var ArchivedDebugNoteSchema = object({
@@ -20199,7 +20350,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20199
20350
  deviceId: number(),
20200
20351
  trackId: string$2(),
20201
20352
  flags: TrackFlagsPatchSchema
20202
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20353
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20203
20354
  kind: "query",
20204
20355
  auth: "admin"
20205
20356
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -20641,6 +20792,22 @@ var occupancyRecheckFramesField = {
20641
20792
  step: 1
20642
20793
  };
20643
20794
  /**
20795
+ * Frames one PRE-ROLL catch-up burst may send to inference at session open.
20796
+ *
20797
+ * The default of 12 over a ~4 s retained window is one frame per ~333 ms of
20798
+ * footage, and costs ~480 ms of ONE inference permit at the 40 ms/frame this
20799
+ * fleet measures — one-shot, and only ever taken while a permit would still be
20800
+ * spare for live. `0` turns the burst off entirely (the history is still
20801
+ * decoded, because that is how the dial reaches a decodable GOP, and is then
20802
+ * discarded — the pre-D411 behaviour).
20803
+ */
20804
+ var preRollInferenceFramesField = {
20805
+ min: 0,
20806
+ max: 30,
20807
+ default: 12,
20808
+ step: 1
20809
+ };
20810
+ /**
20644
20811
  * Source enum for motion signals fed to the runner. Extensible — add
20645
20812
  * new variants here when new motion-trigger paths are wired in
20646
20813
  * (`wasm-cross-camera`, `event-bus-relay`, etc.). The runner uses
@@ -20881,6 +21048,31 @@ var RunnerCameraConfigSchema = object({
20881
21048
  * to every occupancy rule until something moved in front of it. The churn is
20882
21049
  * now paid on the interval instead — see `occupancyRecheckSecField`.
20883
21050
  */
21051
+ /**
21052
+ * Infer the session's PRE-ROLL — the retained history the restreamer replays
21053
+ * at session open — instead of decoding it and throwing it away.
21054
+ *
21055
+ * DEFAULT `true`, and the default is the argument. This is not a new
21056
+ * capability being offered cautiously: the pre-roll is ALREADY requested,
21057
+ * already served, already decoded and already paid for on every on-motion
21058
+ * detection session that asks for history. What shipped was a last-moment
21059
+ * discard — `FrameSlot`'s throttle compares wall clocks, and ~4 s of media
21060
+ * arriving inside a few hundred ms of wall clock looks to it like one frame's
21061
+ * worth. Device 617, 2026-09-08: a re-run of the SAME model over the stored
21062
+ * recording scored the subject `vehicle 0.5669` — above the 0.50 floor —
21063
+ * 1.68 s BEFORE the live track was born, on a frame that was in the pre-roll,
21064
+ * was decoded, and was freed.
21065
+ *
21066
+ * Shipping that as opt-in would ship the bug: an operator cannot discover a
21067
+ * setting whose absence looks exactly like a camera that noticed the cyclist
21068
+ * late. What makes ON safe is not a switch but the BOUND —
21069
+ * `preRollInferenceFrames`, a wall-clock ceiling, and a lane that never takes
21070
+ * the last inference permit — so the switch exists for the camera where the
21071
+ * history is worthless (a doorbell whose subject is always already at the
21072
+ * door), not as a hedge against the feature.
21073
+ */
21074
+ preRollInferenceEnabled: boolean().default(true),
21075
+ preRollInferenceFrames: number().min(preRollInferenceFramesField.min).max(preRollInferenceFramesField.max).default(preRollInferenceFramesField.default),
20884
21076
  occupancyRecheckEnabled: boolean().default(true),
20885
21077
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
20886
21078
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
@@ -20909,7 +21101,7 @@ var RunnerCameraConfigSchema = object({
20909
21101
  */
20910
21102
  inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
20911
21103
  });
20912
- motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, maxSessionHoldMsField.min, maxSessionHoldMsField.max, maxSessionHoldMsField.step, maxSessionHoldMsField.default, audioMotionWindowMsField.min, audioMotionWindowMsField.max, audioMotionWindowMsField.step, audioMotionWindowMsField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
21104
+ motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, maxSessionHoldMsField.min, maxSessionHoldMsField.max, maxSessionHoldMsField.step, maxSessionHoldMsField.default, audioMotionWindowMsField.min, audioMotionWindowMsField.max, audioMotionWindowMsField.step, audioMotionWindowMsField.default, preRollInferenceFramesField.min, preRollInferenceFramesField.max, preRollInferenceFramesField.step, preRollInferenceFramesField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
20913
21105
  /**
20914
21106
  * Runtime load summary returned by `getLocalLoad`. Used by the orchestrator's
20915
21107
  * load-balancing levels (L2 capacity-based, L3 hardware-aware) to decide
@@ -37616,6 +37808,12 @@ Object.freeze({
37616
37808
  addonId: null,
37617
37809
  access: "view"
37618
37810
  },
37811
+ "pipelineAnalytics.listBirthDecisions": {
37812
+ capName: "pipeline-analytics",
37813
+ capScope: "device",
37814
+ addonId: null,
37815
+ access: "view"
37816
+ },
37619
37817
  "pipelineAnalytics.listEventKinds": {
37620
37818
  capName: "pipeline-analytics",
37621
37819
  capScope: "device",
@@ -41408,6 +41606,11 @@ Object.freeze({
41408
41606
  form: "single",
41409
41607
  optional: true
41410
41608
  }],
41609
+ "pipelineAnalytics.listBirthDecisions": [{
41610
+ name: "deviceId",
41611
+ form: "single",
41612
+ optional: true
41613
+ }],
41411
41614
  "pipelineAnalytics.listEventKinds": [{
41412
41615
  name: "deviceId",
41413
41616
  form: "single",
package/dist/addon.mjs CHANGED
@@ -7639,6 +7639,157 @@ var CameraSwitchGroupSchema = object({
7639
7639
  /** Unix ms when the group was composed server-side. */
7640
7640
  fetchedAt: number()
7641
7641
  });
7642
+ /**
7643
+ * What the gate decided about a birth, from the CALLER's point of view.
7644
+ *
7645
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
7646
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
7647
+ * The third member is the one the gate's own type cannot express, because
7648
+ * exhaustion is a property of how long the caller waited.
7649
+ */
7650
+ var BirthDecisionVerdictSchema = _enum([
7651
+ "confirmed",
7652
+ "suppressed",
7653
+ "exhausted-fallback"
7654
+ ]);
7655
+ /** One birth decision, as it is kept. */
7656
+ var BirthDecisionRecordSchema = object({
7657
+ id: string$2(),
7658
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
7659
+ at: number().int(),
7660
+ /** The camera. Required: every question here is asked per-camera. */
7661
+ deviceId: number().int(),
7662
+ /**
7663
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
7664
+ * birth has no track at all, and a confirmed one is expected to age out long
7665
+ * before this row does. Named `sourceTrackId` so the retention model's
7666
+ * ownership derivation (`collection-classification.ts`, which keys on a
7667
+ * column literally called `trackId`) cannot reach it.
7668
+ */
7669
+ sourceTrackId: string$2(),
7670
+ /** The candidate's claimed class. The miss rate is asked per class too. */
7671
+ className: string$2(),
7672
+ verdict: BirthDecisionVerdictSchema,
7673
+ /**
7674
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
7675
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
7676
+ * when the gate is DISABLED and every birth is waved through. `null` is not
7677
+ * "unknown": it says the gate took no measurement because it was off, which
7678
+ * is a different population and must never be averaged in with the rest.
7679
+ */
7680
+ reason: string$2().nullable(),
7681
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
7682
+ attempts: number().int(),
7683
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
7684
+ deferredForMs: number().int(),
7685
+ /**
7686
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
7687
+ *
7688
+ * `true` when the frame the verdict was taken on carried no matched
7689
+ * detection for this track — the tracker was coasting a frozen box and the
7690
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
7691
+ * straight out of `result.tracked` without checking, so this is reachable
7692
+ * today; the question is the RATE, per camera, and whether refusing those
7693
+ * frames would have cost real tracks (cross-read against `verdict` and
7694
+ * `decidedByBirthEvidence`).
7695
+ */
7696
+ decidedOnCoastedFrame: boolean(),
7697
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
7698
+ birthEvidenceAvailable: boolean(),
7699
+ /**
7700
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
7701
+ * deciding are different: the carried crop is confirm-only, so a candidate
7702
+ * can hold evidence, be found inconclusive on it, and be decided by a native
7703
+ * crop of a later instant. A coasted decision backed by carried evidence is
7704
+ * a real observation of the birth instant; one without it is not.
7705
+ */
7706
+ decidedByBirthEvidence: boolean(),
7707
+ /** Best class-compatible crop score, or `null` when nothing compatible was
7708
+ * found — deliberately not 0, which would be a measurement that never was. */
7709
+ bestScore: number().nullable(),
7710
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
7711
+ appliedMinConfidence: number().nullable(),
7712
+ /**
7713
+ * The track's own `firstSeen` — the candidate's first frame, which is where
7714
+ * the timeline starts. `null` for a suppressed birth, which has no track.
7715
+ */
7716
+ firstSeen: number().int().nullable(),
7717
+ /**
7718
+ * The device's most recent motion RISING EDGE at the moment of the decision,
7719
+ * or `null` when there is none, it is older than
7720
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
7721
+ */
7722
+ motionOnsetAt: number().int().nullable(),
7723
+ /**
7724
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
7725
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
7726
+ *
7727
+ * **Why motion onset and not something else.** Two other proxies were
7728
+ * considered and rejected:
7729
+ * - *the recording/pipeline session start*: for a camera on
7730
+ * `detectionMode: 'always'` the session opens at process start, hours
7731
+ * before any subject. It measures nothing.
7732
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
7733
+ * `firstSeen` IS the first detection of that object, so for the track that
7734
+ * OPENS a burst — the only one the operator is complaining about — the two
7735
+ * are the same instant and the latency is 0 by construction.
7736
+ * Motion onset is the only in-process signal produced by a DIFFERENT
7737
+ * mechanism from the object detector, so it is the only one that can precede
7738
+ * it. It is also already maintained per-device at frame rate on this very
7739
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
7740
+ * it free — and, decisively, the frame path and the motion path are gated to
7741
+ * the SAME designated post-processing node, so the mirror is never empty for
7742
+ * a camera whose births land here.
7743
+ *
7744
+ * **Error bars, all of them.**
7745
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
7746
+ * wall or a branch, and only later joined by the person, OVERSTATES the
7747
+ * latency without bound. Mitigated, never removed, by
7748
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
7749
+ * candidate for "this burst is this subject", and even then it is a
7750
+ * candidate, not a fact.
7751
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
7752
+ * intensity threshold. A subject entering slowly at the far edge of the
7753
+ * frame can clear the detector's confidence floor BEFORE it clears the
7754
+ * motion floor, making this negative. Negatives are stored as-is and
7755
+ * never clamped — clamping would fabricate the distribution's left tail,
7756
+ * which is the half that says the proxy is unreliable.
7757
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
7758
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
7759
+ * therefore comparable WITHIN a camera and not across cameras of
7760
+ * different motion sources. The motion source is deliberately not copied
7761
+ * here — it belongs to the addon that owns the device (D224) and this is
7762
+ * a write on the frame path — so group by `deviceId`, which is how the
7763
+ * question is always asked anyway.
7764
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
7765
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
7766
+ * past it this is `null`.
7767
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
7768
+ * reporting, or nothing since boot: `null`. Which is the truth about a
7769
+ * camera nobody has a reference instant for.
7770
+ *
7771
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
7772
+ * as such. It is not a per-track fact and must never be shown as one.
7773
+ */
7774
+ birthLatencyMs: number().int().nullable(),
7775
+ /**
7776
+ * How many births this device has already decided since that motion onset.
7777
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
7778
+ * this subject. `null` when there is no usable onset.
7779
+ */
7780
+ birthIndexInBurst: number().int().nullable()
7781
+ });
7782
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
7783
+ var BirthDecisionQueryInputSchema = object({
7784
+ /** Restrict to a single camera; omit for every row. */
7785
+ deviceId: number().int().optional(),
7786
+ /** Only decisions at or after this epoch ms. */
7787
+ since: number().int().optional(),
7788
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
7789
+ verdict: BirthDecisionVerdictSchema.optional(),
7790
+ /** Max rows returned, newest-first. */
7791
+ limit: number().int().min(1).max(5e3).optional()
7792
+ });
7642
7793
  /** One archived note — the operator's words plus enough context to find what
7643
7794
  * they were looking at, after the track itself is gone. */
7644
7795
  var ArchivedDebugNoteSchema = object({
@@ -20197,7 +20348,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20197
20348
  deviceId: number(),
20198
20349
  trackId: string$2(),
20199
20350
  flags: TrackFlagsPatchSchema
20200
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20351
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20201
20352
  kind: "query",
20202
20353
  auth: "admin"
20203
20354
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -20639,6 +20790,22 @@ var occupancyRecheckFramesField = {
20639
20790
  step: 1
20640
20791
  };
20641
20792
  /**
20793
+ * Frames one PRE-ROLL catch-up burst may send to inference at session open.
20794
+ *
20795
+ * The default of 12 over a ~4 s retained window is one frame per ~333 ms of
20796
+ * footage, and costs ~480 ms of ONE inference permit at the 40 ms/frame this
20797
+ * fleet measures — one-shot, and only ever taken while a permit would still be
20798
+ * spare for live. `0` turns the burst off entirely (the history is still
20799
+ * decoded, because that is how the dial reaches a decodable GOP, and is then
20800
+ * discarded — the pre-D411 behaviour).
20801
+ */
20802
+ var preRollInferenceFramesField = {
20803
+ min: 0,
20804
+ max: 30,
20805
+ default: 12,
20806
+ step: 1
20807
+ };
20808
+ /**
20642
20809
  * Source enum for motion signals fed to the runner. Extensible — add
20643
20810
  * new variants here when new motion-trigger paths are wired in
20644
20811
  * (`wasm-cross-camera`, `event-bus-relay`, etc.). The runner uses
@@ -20879,6 +21046,31 @@ var RunnerCameraConfigSchema = object({
20879
21046
  * to every occupancy rule until something moved in front of it. The churn is
20880
21047
  * now paid on the interval instead — see `occupancyRecheckSecField`.
20881
21048
  */
21049
+ /**
21050
+ * Infer the session's PRE-ROLL — the retained history the restreamer replays
21051
+ * at session open — instead of decoding it and throwing it away.
21052
+ *
21053
+ * DEFAULT `true`, and the default is the argument. This is not a new
21054
+ * capability being offered cautiously: the pre-roll is ALREADY requested,
21055
+ * already served, already decoded and already paid for on every on-motion
21056
+ * detection session that asks for history. What shipped was a last-moment
21057
+ * discard — `FrameSlot`'s throttle compares wall clocks, and ~4 s of media
21058
+ * arriving inside a few hundred ms of wall clock looks to it like one frame's
21059
+ * worth. Device 617, 2026-09-08: a re-run of the SAME model over the stored
21060
+ * recording scored the subject `vehicle 0.5669` — above the 0.50 floor —
21061
+ * 1.68 s BEFORE the live track was born, on a frame that was in the pre-roll,
21062
+ * was decoded, and was freed.
21063
+ *
21064
+ * Shipping that as opt-in would ship the bug: an operator cannot discover a
21065
+ * setting whose absence looks exactly like a camera that noticed the cyclist
21066
+ * late. What makes ON safe is not a switch but the BOUND —
21067
+ * `preRollInferenceFrames`, a wall-clock ceiling, and a lane that never takes
21068
+ * the last inference permit — so the switch exists for the camera where the
21069
+ * history is worthless (a doorbell whose subject is always already at the
21070
+ * door), not as a hedge against the feature.
21071
+ */
21072
+ preRollInferenceEnabled: boolean().default(true),
21073
+ preRollInferenceFrames: number().min(preRollInferenceFramesField.min).max(preRollInferenceFramesField.max).default(preRollInferenceFramesField.default),
20882
21074
  occupancyRecheckEnabled: boolean().default(true),
20883
21075
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
20884
21076
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
@@ -20907,7 +21099,7 @@ var RunnerCameraConfigSchema = object({
20907
21099
  */
20908
21100
  inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
20909
21101
  });
20910
- motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, maxSessionHoldMsField.min, maxSessionHoldMsField.max, maxSessionHoldMsField.step, maxSessionHoldMsField.default, audioMotionWindowMsField.min, audioMotionWindowMsField.max, audioMotionWindowMsField.step, audioMotionWindowMsField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
21102
+ motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, maxSessionHoldMsField.min, maxSessionHoldMsField.max, maxSessionHoldMsField.step, maxSessionHoldMsField.default, audioMotionWindowMsField.min, audioMotionWindowMsField.max, audioMotionWindowMsField.step, audioMotionWindowMsField.default, preRollInferenceFramesField.min, preRollInferenceFramesField.max, preRollInferenceFramesField.step, preRollInferenceFramesField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
20911
21103
  /**
20912
21104
  * Runtime load summary returned by `getLocalLoad`. Used by the orchestrator's
20913
21105
  * load-balancing levels (L2 capacity-based, L3 hardware-aware) to decide
@@ -37614,6 +37806,12 @@ Object.freeze({
37614
37806
  addonId: null,
37615
37807
  access: "view"
37616
37808
  },
37809
+ "pipelineAnalytics.listBirthDecisions": {
37810
+ capName: "pipeline-analytics",
37811
+ capScope: "device",
37812
+ addonId: null,
37813
+ access: "view"
37814
+ },
37617
37815
  "pipelineAnalytics.listEventKinds": {
37618
37816
  capName: "pipeline-analytics",
37619
37817
  capScope: "device",
@@ -41406,6 +41604,11 @@ Object.freeze({
41406
41604
  form: "single",
41407
41605
  optional: true
41408
41606
  }],
41607
+ "pipelineAnalytics.listBirthDecisions": [{
41608
+ name: "deviceId",
41609
+ form: "single",
41610
+ optional: true
41611
+ }],
41409
41612
  "pipelineAnalytics.listEventKinds": [{
41410
41613
  name: "deviceId",
41411
41614
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-matter-broker",
3
- "version": "0.2.86",
3
+ "version": "0.2.88",
4
4
  "description": "Matter broker addon for CamStack — owns a Matter fabric (commissioning + the long-lived controller) via the matter.js controller and brokers commissioned Matter nodes into CamStack",
5
5
  "keywords": [
6
6
  "camstack",