@camstack/addon-ai 0.4.90 → 0.4.92

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
@@ -7830,6 +7830,157 @@ var CameraSwitchGroupSchema = object({
7830
7830
  /** Unix ms when the group was composed server-side. */
7831
7831
  fetchedAt: number$1()
7832
7832
  });
7833
+ /**
7834
+ * What the gate decided about a birth, from the CALLER's point of view.
7835
+ *
7836
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
7837
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
7838
+ * The third member is the one the gate's own type cannot express, because
7839
+ * exhaustion is a property of how long the caller waited.
7840
+ */
7841
+ var BirthDecisionVerdictSchema = _enum([
7842
+ "confirmed",
7843
+ "suppressed",
7844
+ "exhausted-fallback"
7845
+ ]);
7846
+ /** One birth decision, as it is kept. */
7847
+ var BirthDecisionRecordSchema = object({
7848
+ id: string(),
7849
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
7850
+ at: number$1().int(),
7851
+ /** The camera. Required: every question here is asked per-camera. */
7852
+ deviceId: number$1().int(),
7853
+ /**
7854
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
7855
+ * birth has no track at all, and a confirmed one is expected to age out long
7856
+ * before this row does. Named `sourceTrackId` so the retention model's
7857
+ * ownership derivation (`collection-classification.ts`, which keys on a
7858
+ * column literally called `trackId`) cannot reach it.
7859
+ */
7860
+ sourceTrackId: string(),
7861
+ /** The candidate's claimed class. The miss rate is asked per class too. */
7862
+ className: string(),
7863
+ verdict: BirthDecisionVerdictSchema,
7864
+ /**
7865
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
7866
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
7867
+ * when the gate is DISABLED and every birth is waved through. `null` is not
7868
+ * "unknown": it says the gate took no measurement because it was off, which
7869
+ * is a different population and must never be averaged in with the rest.
7870
+ */
7871
+ reason: string().nullable(),
7872
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
7873
+ attempts: number$1().int(),
7874
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
7875
+ deferredForMs: number$1().int(),
7876
+ /**
7877
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
7878
+ *
7879
+ * `true` when the frame the verdict was taken on carried no matched
7880
+ * detection for this track — the tracker was coasting a frozen box and the
7881
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
7882
+ * straight out of `result.tracked` without checking, so this is reachable
7883
+ * today; the question is the RATE, per camera, and whether refusing those
7884
+ * frames would have cost real tracks (cross-read against `verdict` and
7885
+ * `decidedByBirthEvidence`).
7886
+ */
7887
+ decidedOnCoastedFrame: boolean(),
7888
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
7889
+ birthEvidenceAvailable: boolean(),
7890
+ /**
7891
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
7892
+ * deciding are different: the carried crop is confirm-only, so a candidate
7893
+ * can hold evidence, be found inconclusive on it, and be decided by a native
7894
+ * crop of a later instant. A coasted decision backed by carried evidence is
7895
+ * a real observation of the birth instant; one without it is not.
7896
+ */
7897
+ decidedByBirthEvidence: boolean(),
7898
+ /** Best class-compatible crop score, or `null` when nothing compatible was
7899
+ * found — deliberately not 0, which would be a measurement that never was. */
7900
+ bestScore: number$1().nullable(),
7901
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
7902
+ appliedMinConfidence: number$1().nullable(),
7903
+ /**
7904
+ * The track's own `firstSeen` — the candidate's first frame, which is where
7905
+ * the timeline starts. `null` for a suppressed birth, which has no track.
7906
+ */
7907
+ firstSeen: number$1().int().nullable(),
7908
+ /**
7909
+ * The device's most recent motion RISING EDGE at the moment of the decision,
7910
+ * or `null` when there is none, it is older than
7911
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
7912
+ */
7913
+ motionOnsetAt: number$1().int().nullable(),
7914
+ /**
7915
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
7916
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
7917
+ *
7918
+ * **Why motion onset and not something else.** Two other proxies were
7919
+ * considered and rejected:
7920
+ * - *the recording/pipeline session start*: for a camera on
7921
+ * `detectionMode: 'always'` the session opens at process start, hours
7922
+ * before any subject. It measures nothing.
7923
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
7924
+ * `firstSeen` IS the first detection of that object, so for the track that
7925
+ * OPENS a burst — the only one the operator is complaining about — the two
7926
+ * are the same instant and the latency is 0 by construction.
7927
+ * Motion onset is the only in-process signal produced by a DIFFERENT
7928
+ * mechanism from the object detector, so it is the only one that can precede
7929
+ * it. It is also already maintained per-device at frame rate on this very
7930
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
7931
+ * it free — and, decisively, the frame path and the motion path are gated to
7932
+ * the SAME designated post-processing node, so the mirror is never empty for
7933
+ * a camera whose births land here.
7934
+ *
7935
+ * **Error bars, all of them.**
7936
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
7937
+ * wall or a branch, and only later joined by the person, OVERSTATES the
7938
+ * latency without bound. Mitigated, never removed, by
7939
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
7940
+ * candidate for "this burst is this subject", and even then it is a
7941
+ * candidate, not a fact.
7942
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
7943
+ * intensity threshold. A subject entering slowly at the far edge of the
7944
+ * frame can clear the detector's confidence floor BEFORE it clears the
7945
+ * motion floor, making this negative. Negatives are stored as-is and
7946
+ * never clamped — clamping would fabricate the distribution's left tail,
7947
+ * which is the half that says the proxy is unreliable.
7948
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
7949
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
7950
+ * therefore comparable WITHIN a camera and not across cameras of
7951
+ * different motion sources. The motion source is deliberately not copied
7952
+ * here — it belongs to the addon that owns the device (D224) and this is
7953
+ * a write on the frame path — so group by `deviceId`, which is how the
7954
+ * question is always asked anyway.
7955
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
7956
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
7957
+ * past it this is `null`.
7958
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
7959
+ * reporting, or nothing since boot: `null`. Which is the truth about a
7960
+ * camera nobody has a reference instant for.
7961
+ *
7962
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
7963
+ * as such. It is not a per-track fact and must never be shown as one.
7964
+ */
7965
+ birthLatencyMs: number$1().int().nullable(),
7966
+ /**
7967
+ * How many births this device has already decided since that motion onset.
7968
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
7969
+ * this subject. `null` when there is no usable onset.
7970
+ */
7971
+ birthIndexInBurst: number$1().int().nullable()
7972
+ });
7973
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
7974
+ var BirthDecisionQueryInputSchema = object({
7975
+ /** Restrict to a single camera; omit for every row. */
7976
+ deviceId: number$1().int().optional(),
7977
+ /** Only decisions at or after this epoch ms. */
7978
+ since: number$1().int().optional(),
7979
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
7980
+ verdict: BirthDecisionVerdictSchema.optional(),
7981
+ /** Max rows returned, newest-first. */
7982
+ limit: number$1().int().min(1).max(5e3).optional()
7983
+ });
7833
7984
  /** One archived note — the operator's words plus enough context to find what
7834
7985
  * they were looking at, after the track itself is gone. */
7835
7986
  var ArchivedDebugNoteSchema = object({
@@ -20048,7 +20199,7 @@ DeviceType.Camera, method(object({ deviceId: number$1() }), array(TrackSchema).r
20048
20199
  deviceId: number$1(),
20049
20200
  trackId: string(),
20050
20201
  flags: TrackFlagsPatchSchema
20051
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20202
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20052
20203
  kind: "query",
20053
20204
  auth: "admin"
20054
20205
  }), method(object({ deviceId: number$1().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -20490,6 +20641,22 @@ var occupancyRecheckFramesField = {
20490
20641
  step: 1
20491
20642
  };
20492
20643
  /**
20644
+ * Frames one PRE-ROLL catch-up burst may send to inference at session open.
20645
+ *
20646
+ * The default of 12 over a ~4 s retained window is one frame per ~333 ms of
20647
+ * footage, and costs ~480 ms of ONE inference permit at the 40 ms/frame this
20648
+ * fleet measures — one-shot, and only ever taken while a permit would still be
20649
+ * spare for live. `0` turns the burst off entirely (the history is still
20650
+ * decoded, because that is how the dial reaches a decodable GOP, and is then
20651
+ * discarded — the pre-D411 behaviour).
20652
+ */
20653
+ var preRollInferenceFramesField = {
20654
+ min: 0,
20655
+ max: 30,
20656
+ default: 12,
20657
+ step: 1
20658
+ };
20659
+ /**
20493
20660
  * Source enum for motion signals fed to the runner. Extensible — add
20494
20661
  * new variants here when new motion-trigger paths are wired in
20495
20662
  * (`wasm-cross-camera`, `event-bus-relay`, etc.). The runner uses
@@ -20730,6 +20897,31 @@ var RunnerCameraConfigSchema = object({
20730
20897
  * to every occupancy rule until something moved in front of it. The churn is
20731
20898
  * now paid on the interval instead — see `occupancyRecheckSecField`.
20732
20899
  */
20900
+ /**
20901
+ * Infer the session's PRE-ROLL — the retained history the restreamer replays
20902
+ * at session open — instead of decoding it and throwing it away.
20903
+ *
20904
+ * DEFAULT `true`, and the default is the argument. This is not a new
20905
+ * capability being offered cautiously: the pre-roll is ALREADY requested,
20906
+ * already served, already decoded and already paid for on every on-motion
20907
+ * detection session that asks for history. What shipped was a last-moment
20908
+ * discard — `FrameSlot`'s throttle compares wall clocks, and ~4 s of media
20909
+ * arriving inside a few hundred ms of wall clock looks to it like one frame's
20910
+ * worth. Device 617, 2026-09-08: a re-run of the SAME model over the stored
20911
+ * recording scored the subject `vehicle 0.5669` — above the 0.50 floor —
20912
+ * 1.68 s BEFORE the live track was born, on a frame that was in the pre-roll,
20913
+ * was decoded, and was freed.
20914
+ *
20915
+ * Shipping that as opt-in would ship the bug: an operator cannot discover a
20916
+ * setting whose absence looks exactly like a camera that noticed the cyclist
20917
+ * late. What makes ON safe is not a switch but the BOUND —
20918
+ * `preRollInferenceFrames`, a wall-clock ceiling, and a lane that never takes
20919
+ * the last inference permit — so the switch exists for the camera where the
20920
+ * history is worthless (a doorbell whose subject is always already at the
20921
+ * door), not as a hedge against the feature.
20922
+ */
20923
+ preRollInferenceEnabled: boolean().default(true),
20924
+ preRollInferenceFrames: number$1().min(preRollInferenceFramesField.min).max(preRollInferenceFramesField.max).default(preRollInferenceFramesField.default),
20733
20925
  occupancyRecheckEnabled: boolean().default(true),
20734
20926
  occupancyRecheckSec: number$1().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
20735
20927
  occupancyRecheckFrames: number$1().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
@@ -20758,7 +20950,7 @@ var RunnerCameraConfigSchema = object({
20758
20950
  */
20759
20951
  inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
20760
20952
  });
20761
- 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;
20953
+ 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;
20762
20954
  /**
20763
20955
  * Runtime load summary returned by `getLocalLoad`. Used by the orchestrator's
20764
20956
  * load-balancing levels (L2 capacity-based, L3 hardware-aware) to decide
@@ -33452,6 +33644,12 @@ Object.freeze({
33452
33644
  addonId: null,
33453
33645
  access: "view"
33454
33646
  },
33647
+ "pipelineAnalytics.listBirthDecisions": {
33648
+ capName: "pipeline-analytics",
33649
+ capScope: "device",
33650
+ addonId: null,
33651
+ access: "view"
33652
+ },
33455
33653
  "pipelineAnalytics.listEventKinds": {
33456
33654
  capName: "pipeline-analytics",
33457
33655
  capScope: "device",
@@ -37244,6 +37442,11 @@ Object.freeze({
37244
37442
  form: "single",
37245
37443
  optional: true
37246
37444
  }],
37445
+ "pipelineAnalytics.listBirthDecisions": [{
37446
+ name: "deviceId",
37447
+ form: "single",
37448
+ optional: true
37449
+ }],
37247
37450
  "pipelineAnalytics.listEventKinds": [{
37248
37451
  name: "deviceId",
37249
37452
  form: "single",
package/dist/addon.mjs CHANGED
@@ -7857,6 +7857,157 @@ var CameraSwitchGroupSchema = object({
7857
7857
  /** Unix ms when the group was composed server-side. */
7858
7858
  fetchedAt: number$1()
7859
7859
  });
7860
+ /**
7861
+ * What the gate decided about a birth, from the CALLER's point of view.
7862
+ *
7863
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
7864
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
7865
+ * The third member is the one the gate's own type cannot express, because
7866
+ * exhaustion is a property of how long the caller waited.
7867
+ */
7868
+ var BirthDecisionVerdictSchema = _enum([
7869
+ "confirmed",
7870
+ "suppressed",
7871
+ "exhausted-fallback"
7872
+ ]);
7873
+ /** One birth decision, as it is kept. */
7874
+ var BirthDecisionRecordSchema = object({
7875
+ id: string(),
7876
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
7877
+ at: number$1().int(),
7878
+ /** The camera. Required: every question here is asked per-camera. */
7879
+ deviceId: number$1().int(),
7880
+ /**
7881
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
7882
+ * birth has no track at all, and a confirmed one is expected to age out long
7883
+ * before this row does. Named `sourceTrackId` so the retention model's
7884
+ * ownership derivation (`collection-classification.ts`, which keys on a
7885
+ * column literally called `trackId`) cannot reach it.
7886
+ */
7887
+ sourceTrackId: string(),
7888
+ /** The candidate's claimed class. The miss rate is asked per class too. */
7889
+ className: string(),
7890
+ verdict: BirthDecisionVerdictSchema,
7891
+ /**
7892
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
7893
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
7894
+ * when the gate is DISABLED and every birth is waved through. `null` is not
7895
+ * "unknown": it says the gate took no measurement because it was off, which
7896
+ * is a different population and must never be averaged in with the rest.
7897
+ */
7898
+ reason: string().nullable(),
7899
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
7900
+ attempts: number$1().int(),
7901
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
7902
+ deferredForMs: number$1().int(),
7903
+ /**
7904
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
7905
+ *
7906
+ * `true` when the frame the verdict was taken on carried no matched
7907
+ * detection for this track — the tracker was coasting a frozen box and the
7908
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
7909
+ * straight out of `result.tracked` without checking, so this is reachable
7910
+ * today; the question is the RATE, per camera, and whether refusing those
7911
+ * frames would have cost real tracks (cross-read against `verdict` and
7912
+ * `decidedByBirthEvidence`).
7913
+ */
7914
+ decidedOnCoastedFrame: boolean(),
7915
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
7916
+ birthEvidenceAvailable: boolean(),
7917
+ /**
7918
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
7919
+ * deciding are different: the carried crop is confirm-only, so a candidate
7920
+ * can hold evidence, be found inconclusive on it, and be decided by a native
7921
+ * crop of a later instant. A coasted decision backed by carried evidence is
7922
+ * a real observation of the birth instant; one without it is not.
7923
+ */
7924
+ decidedByBirthEvidence: boolean(),
7925
+ /** Best class-compatible crop score, or `null` when nothing compatible was
7926
+ * found — deliberately not 0, which would be a measurement that never was. */
7927
+ bestScore: number$1().nullable(),
7928
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
7929
+ appliedMinConfidence: number$1().nullable(),
7930
+ /**
7931
+ * The track's own `firstSeen` — the candidate's first frame, which is where
7932
+ * the timeline starts. `null` for a suppressed birth, which has no track.
7933
+ */
7934
+ firstSeen: number$1().int().nullable(),
7935
+ /**
7936
+ * The device's most recent motion RISING EDGE at the moment of the decision,
7937
+ * or `null` when there is none, it is older than
7938
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
7939
+ */
7940
+ motionOnsetAt: number$1().int().nullable(),
7941
+ /**
7942
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
7943
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
7944
+ *
7945
+ * **Why motion onset and not something else.** Two other proxies were
7946
+ * considered and rejected:
7947
+ * - *the recording/pipeline session start*: for a camera on
7948
+ * `detectionMode: 'always'` the session opens at process start, hours
7949
+ * before any subject. It measures nothing.
7950
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
7951
+ * `firstSeen` IS the first detection of that object, so for the track that
7952
+ * OPENS a burst — the only one the operator is complaining about — the two
7953
+ * are the same instant and the latency is 0 by construction.
7954
+ * Motion onset is the only in-process signal produced by a DIFFERENT
7955
+ * mechanism from the object detector, so it is the only one that can precede
7956
+ * it. It is also already maintained per-device at frame rate on this very
7957
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
7958
+ * it free — and, decisively, the frame path and the motion path are gated to
7959
+ * the SAME designated post-processing node, so the mirror is never empty for
7960
+ * a camera whose births land here.
7961
+ *
7962
+ * **Error bars, all of them.**
7963
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
7964
+ * wall or a branch, and only later joined by the person, OVERSTATES the
7965
+ * latency without bound. Mitigated, never removed, by
7966
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
7967
+ * candidate for "this burst is this subject", and even then it is a
7968
+ * candidate, not a fact.
7969
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
7970
+ * intensity threshold. A subject entering slowly at the far edge of the
7971
+ * frame can clear the detector's confidence floor BEFORE it clears the
7972
+ * motion floor, making this negative. Negatives are stored as-is and
7973
+ * never clamped — clamping would fabricate the distribution's left tail,
7974
+ * which is the half that says the proxy is unreliable.
7975
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
7976
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
7977
+ * therefore comparable WITHIN a camera and not across cameras of
7978
+ * different motion sources. The motion source is deliberately not copied
7979
+ * here — it belongs to the addon that owns the device (D224) and this is
7980
+ * a write on the frame path — so group by `deviceId`, which is how the
7981
+ * question is always asked anyway.
7982
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
7983
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
7984
+ * past it this is `null`.
7985
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
7986
+ * reporting, or nothing since boot: `null`. Which is the truth about a
7987
+ * camera nobody has a reference instant for.
7988
+ *
7989
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
7990
+ * as such. It is not a per-track fact and must never be shown as one.
7991
+ */
7992
+ birthLatencyMs: number$1().int().nullable(),
7993
+ /**
7994
+ * How many births this device has already decided since that motion onset.
7995
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
7996
+ * this subject. `null` when there is no usable onset.
7997
+ */
7998
+ birthIndexInBurst: number$1().int().nullable()
7999
+ });
8000
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
8001
+ var BirthDecisionQueryInputSchema = object({
8002
+ /** Restrict to a single camera; omit for every row. */
8003
+ deviceId: number$1().int().optional(),
8004
+ /** Only decisions at or after this epoch ms. */
8005
+ since: number$1().int().optional(),
8006
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
8007
+ verdict: BirthDecisionVerdictSchema.optional(),
8008
+ /** Max rows returned, newest-first. */
8009
+ limit: number$1().int().min(1).max(5e3).optional()
8010
+ });
7860
8011
  /** One archived note — the operator's words plus enough context to find what
7861
8012
  * they were looking at, after the track itself is gone. */
7862
8013
  var ArchivedDebugNoteSchema = object({
@@ -20075,7 +20226,7 @@ DeviceType.Camera, method(object({ deviceId: number$1() }), array(TrackSchema).r
20075
20226
  deviceId: number$1(),
20076
20227
  trackId: string(),
20077
20228
  flags: TrackFlagsPatchSchema
20078
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20229
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20079
20230
  kind: "query",
20080
20231
  auth: "admin"
20081
20232
  }), method(object({ deviceId: number$1().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -20517,6 +20668,22 @@ var occupancyRecheckFramesField = {
20517
20668
  step: 1
20518
20669
  };
20519
20670
  /**
20671
+ * Frames one PRE-ROLL catch-up burst may send to inference at session open.
20672
+ *
20673
+ * The default of 12 over a ~4 s retained window is one frame per ~333 ms of
20674
+ * footage, and costs ~480 ms of ONE inference permit at the 40 ms/frame this
20675
+ * fleet measures — one-shot, and only ever taken while a permit would still be
20676
+ * spare for live. `0` turns the burst off entirely (the history is still
20677
+ * decoded, because that is how the dial reaches a decodable GOP, and is then
20678
+ * discarded — the pre-D411 behaviour).
20679
+ */
20680
+ var preRollInferenceFramesField = {
20681
+ min: 0,
20682
+ max: 30,
20683
+ default: 12,
20684
+ step: 1
20685
+ };
20686
+ /**
20520
20687
  * Source enum for motion signals fed to the runner. Extensible — add
20521
20688
  * new variants here when new motion-trigger paths are wired in
20522
20689
  * (`wasm-cross-camera`, `event-bus-relay`, etc.). The runner uses
@@ -20757,6 +20924,31 @@ var RunnerCameraConfigSchema = object({
20757
20924
  * to every occupancy rule until something moved in front of it. The churn is
20758
20925
  * now paid on the interval instead — see `occupancyRecheckSecField`.
20759
20926
  */
20927
+ /**
20928
+ * Infer the session's PRE-ROLL — the retained history the restreamer replays
20929
+ * at session open — instead of decoding it and throwing it away.
20930
+ *
20931
+ * DEFAULT `true`, and the default is the argument. This is not a new
20932
+ * capability being offered cautiously: the pre-roll is ALREADY requested,
20933
+ * already served, already decoded and already paid for on every on-motion
20934
+ * detection session that asks for history. What shipped was a last-moment
20935
+ * discard — `FrameSlot`'s throttle compares wall clocks, and ~4 s of media
20936
+ * arriving inside a few hundred ms of wall clock looks to it like one frame's
20937
+ * worth. Device 617, 2026-09-08: a re-run of the SAME model over the stored
20938
+ * recording scored the subject `vehicle 0.5669` — above the 0.50 floor —
20939
+ * 1.68 s BEFORE the live track was born, on a frame that was in the pre-roll,
20940
+ * was decoded, and was freed.
20941
+ *
20942
+ * Shipping that as opt-in would ship the bug: an operator cannot discover a
20943
+ * setting whose absence looks exactly like a camera that noticed the cyclist
20944
+ * late. What makes ON safe is not a switch but the BOUND —
20945
+ * `preRollInferenceFrames`, a wall-clock ceiling, and a lane that never takes
20946
+ * the last inference permit — so the switch exists for the camera where the
20947
+ * history is worthless (a doorbell whose subject is always already at the
20948
+ * door), not as a hedge against the feature.
20949
+ */
20950
+ preRollInferenceEnabled: boolean().default(true),
20951
+ preRollInferenceFrames: number$1().min(preRollInferenceFramesField.min).max(preRollInferenceFramesField.max).default(preRollInferenceFramesField.default),
20760
20952
  occupancyRecheckEnabled: boolean().default(true),
20761
20953
  occupancyRecheckSec: number$1().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
20762
20954
  occupancyRecheckFrames: number$1().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
@@ -20785,7 +20977,7 @@ var RunnerCameraConfigSchema = object({
20785
20977
  */
20786
20978
  inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
20787
20979
  });
20788
- 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;
20980
+ 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;
20789
20981
  /**
20790
20982
  * Runtime load summary returned by `getLocalLoad`. Used by the orchestrator's
20791
20983
  * load-balancing levels (L2 capacity-based, L3 hardware-aware) to decide
@@ -33479,6 +33671,12 @@ Object.freeze({
33479
33671
  addonId: null,
33480
33672
  access: "view"
33481
33673
  },
33674
+ "pipelineAnalytics.listBirthDecisions": {
33675
+ capName: "pipeline-analytics",
33676
+ capScope: "device",
33677
+ addonId: null,
33678
+ access: "view"
33679
+ },
33482
33680
  "pipelineAnalytics.listEventKinds": {
33483
33681
  capName: "pipeline-analytics",
33484
33682
  capScope: "device",
@@ -37271,6 +37469,11 @@ Object.freeze({
37271
37469
  form: "single",
37272
37470
  optional: true
37273
37471
  }],
37472
+ "pipelineAnalytics.listBirthDecisions": [{
37473
+ name: "deviceId",
37474
+ form: "single",
37475
+ optional: true
37476
+ }],
37274
37477
  "pipelineAnalytics.listEventKinds": [{
37275
37478
  name: "deviceId",
37276
37479
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-ai",
3
- "version": "0.4.90",
3
+ "version": "0.4.92",
4
4
  "description": "AI addon for CamStack — the `llm` collection provider (cloud, LAN, and camstack-managed local llama.cpp profiles) plus the per-node `llm-runtime` managed executor.",
5
5
  "keywords": [
6
6
  "camstack",