@camstack/addon-pipeline 1.2.212 → 1.2.214

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.
Files changed (37) hide show
  1. package/dist/audio-analyzer/index.js +2 -2
  2. package/dist/audio-analyzer/index.mjs +2 -2
  3. package/dist/{default-detection-model-6FmFzp0X.mjs → default-detection-model-C2vYSX3O.mjs} +1 -1
  4. package/dist/{default-detection-model-CXpC8UoM.js → default-detection-model-f0PImZnh.js} +1 -1
  5. package/dist/detection-pipeline/index.js +5 -5
  6. package/dist/detection-pipeline/index.mjs +4 -4
  7. package/dist/{dist-B-MeGV6o.js → dist-DoHcimdu.js} +205 -2
  8. package/dist/{dist-C-elKxbr.mjs → dist-DttqKvsQ.mjs} +205 -2
  9. package/dist/{lazy-sharp-xDAJscmd.js → lazy-sharp-BeeQGCUu.js} +1 -1
  10. package/dist/motion-wasm/index.js +2 -2
  11. package/dist/motion-wasm/index.mjs +1 -1
  12. package/dist/{node-DPduceDa.js → node-6uF72wri.js} +1 -1
  13. package/dist/{node-DIRnjf_L.mjs → node-NtM7__8q.mjs} +1 -1
  14. package/dist/pipeline-runner/index.js +213 -24
  15. package/dist/pipeline-runner/index.mjs +212 -23
  16. package/dist/{process-memory-CUYuwW7H.js → process-memory-BRdyl5fE.js} +1 -1
  17. package/dist/{process-memory-CJ8yC9r_.mjs → process-memory-CddpCDWL.mjs} +1 -1
  18. package/dist/recorder/index.js +4 -2
  19. package/dist/recorder/index.mjs +4 -2
  20. package/dist/{segment-demux-js-CXXWV0Ph.js → segment-demux-js-CkJPdyDH.js} +1 -1
  21. package/dist/{segment-demux-js-BhBboAO1.mjs → segment-demux-js-CsFtPVzH.mjs} +1 -1
  22. package/dist/session-decode/decode-worker-child.js +319 -8
  23. package/dist/session-decode/decode-worker-child.mjs +318 -7
  24. package/dist/stream-broker/_stub.js +2 -2
  25. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-NrRAP0ec.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-CbBa4iV-.mjs} +3 -3
  26. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-0MF-KL1v.mjs +26 -0
  27. package/dist/stream-broker/{_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-LoLVfRky.mjs → _virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Uxkwkgy5.mjs} +1 -1
  28. package/dist/stream-broker/demux-worker-child.js +1 -1
  29. package/dist/stream-broker/demux-worker-child.mjs +1 -1
  30. package/dist/stream-broker/{hostInit-BxCqSqXk.mjs → hostInit-CagSUJH7.mjs} +3 -3
  31. package/dist/stream-broker/index.js +3 -3
  32. package/dist/stream-broker/index.mjs +3 -3
  33. package/dist/stream-broker/remoteEntry.js +1 -1
  34. package/dist/{worker-protocol-C0mDH3xS.mjs → worker-protocol-BKwkLZWT.mjs} +5 -2
  35. package/dist/{worker-protocol-DMNMfs2E.js → worker-protocol-BWO2WNjw.js} +5 -2
  36. package/package.json +1 -1
  37. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-Cw3x0dZG.mjs +0 -26
@@ -2,8 +2,8 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-B-MeGV6o.js");
6
- const require_process_memory = require("../process-memory-CUYuwW7H.js");
5
+ const require_dist = require("../dist-DoHcimdu.js");
6
+ const require_process_memory = require("../process-memory-BRdyl5fE.js");
7
7
  let node_fs = require("node:fs");
8
8
  node_fs = require_dist.__toESM(node_fs);
9
9
  let node_path = require("node:path");
@@ -1,6 +1,6 @@
1
1
  import { n as __require } from "../chunk-DnnnRqeS.mjs";
2
- import { Dt as resolvePoolMemoryPolicy, It as errMsg, Jt as hydrateSchema, M as audioAnalyzerCapability, S as PoolMemoryWatchdog, Ut as BaseAddon, j as audioAnalysisCapability, n as AUDIO_BACKEND_CHOICES, ot as mapAudioLabelToMacro, s as DEFAULT_AUDIO_ANALYZER_CONFIG, v as HF_BASE_URL } from "../dist-C-elKxbr.mjs";
3
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-CJ8yC9r_.mjs";
2
+ import { Dt as resolvePoolMemoryPolicy, It as errMsg, Jt as hydrateSchema, M as audioAnalyzerCapability, S as PoolMemoryWatchdog, Ut as BaseAddon, j as audioAnalysisCapability, n as AUDIO_BACKEND_CHOICES, ot as mapAudioLabelToMacro, s as DEFAULT_AUDIO_ANALYZER_CONFIG, v as HF_BASE_URL } from "../dist-DttqKvsQ.mjs";
3
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-CddpCDWL.mjs";
4
4
  import * as fs from "node:fs";
5
5
  import * as path$1 from "node:path";
6
6
  import { downloadFile } from "@camstack/system/addon-utils";
@@ -1,4 +1,4 @@
1
- import { N as audioKindId, a as COCO_80_LABELS, o as COCO_TO_MACRO, r as AUDIO_MACRO_LABELS, tt as hfModelUrl } from "./dist-C-elKxbr.mjs";
1
+ import { N as audioKindId, a as COCO_80_LABELS, o as COCO_TO_MACRO, r as AUDIO_MACRO_LABELS, tt as hfModelUrl } from "./dist-DttqKvsQ.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  //#region src/detection-pipeline/pipeline/landmark-precision-gate.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-B-MeGV6o.js");
1
+ const require_dist = require("./dist-DoHcimdu.js");
2
2
  let node_crypto = require("node:crypto");
3
3
  //#region src/detection-pipeline/pipeline/landmark-precision-gate.ts
4
4
  /**
@@ -2,12 +2,12 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-B-MeGV6o.js");
6
- const require_node = require("../node-DPduceDa.js");
7
- const require_default_detection_model = require("../default-detection-model-CXpC8UoM.js");
8
- const require_lazy_sharp = require("../lazy-sharp-xDAJscmd.js");
5
+ const require_dist = require("../dist-DoHcimdu.js");
6
+ const require_node = require("../node-6uF72wri.js");
7
+ const require_default_detection_model = require("../default-detection-model-f0PImZnh.js");
8
+ const require_lazy_sharp = require("../lazy-sharp-BeeQGCUu.js");
9
9
  const require_event_loop_stall_monitor = require("../event-loop-stall-monitor-DaUBcb13.js");
10
- const require_process_memory = require("../process-memory-CUYuwW7H.js");
10
+ const require_process_memory = require("../process-memory-BRdyl5fE.js");
11
11
  let node_os = require("node:os");
12
12
  node_os = require_dist.__toESM(node_os);
13
13
  let node_fs = require("node:fs");
@@ -1,10 +1,10 @@
1
1
  import { n as __require } from "../chunk-DnnnRqeS.mjs";
2
- import { $t as parseJsonUnknown, B as defaultDeviceFor$1, Dt as resolvePoolMemoryPolicy, G as detectionPipelineCapability, It as errMsg, J as enumerateInferenceDevices, Jt as hydrateSchema, Pt as supportedRuntimes$1, Qt as nodePin, S as PoolMemoryWatchdog, Ut as BaseAddon, X as evaluateZoneRules, c as DEFAULT_CLUSTER_STEP_MODELS, gt as pickClusterStepSettings, hn as EventCategory, ht as pickClusterStepModels, in as array, it as loadContributionCapability, k as YAMNET_TO_MACRO, kt as runtimeDevices$1, l as DEFAULT_CLUSTER_STEP_SETTINGS, m as DEVICE_BACKEND_TO_FORMAT, mn as union, nn as sleep, nt as inferModelProvider, pn as string, pt as overlayClusterStepSettings, qt as createEvent, t as APPLE_SA_TO_MACRO, un as object, wt as resolveClusterStepModelId, yt as pipelineExecutorCapability } from "../dist-C-elKxbr.mjs";
3
- import { o as readProcessCost } from "../node-DIRnjf_L.mjs";
4
- import { a as ALL_PIPELINE_STEPS, c as getStep, d as landmarkPrecisionVerdict, l as getStepDefinition, n as resolveDefaultDetectionModel, o as ALL_STEPS, r as localFrameRegistry, s as getDefaultModelForFormat, u as resolveModelForFormat } from "../default-detection-model-6FmFzp0X.mjs";
2
+ import { $t as parseJsonUnknown, B as defaultDeviceFor$1, Dt as resolvePoolMemoryPolicy, G as detectionPipelineCapability, It as errMsg, J as enumerateInferenceDevices, Jt as hydrateSchema, Pt as supportedRuntimes$1, Qt as nodePin, S as PoolMemoryWatchdog, Ut as BaseAddon, X as evaluateZoneRules, c as DEFAULT_CLUSTER_STEP_MODELS, gt as pickClusterStepSettings, hn as EventCategory, ht as pickClusterStepModels, in as array, it as loadContributionCapability, k as YAMNET_TO_MACRO, kt as runtimeDevices$1, l as DEFAULT_CLUSTER_STEP_SETTINGS, m as DEVICE_BACKEND_TO_FORMAT, mn as union, nn as sleep, nt as inferModelProvider, pn as string, pt as overlayClusterStepSettings, qt as createEvent, t as APPLE_SA_TO_MACRO, un as object, wt as resolveClusterStepModelId, yt as pipelineExecutorCapability } from "../dist-DttqKvsQ.mjs";
3
+ import { o as readProcessCost } from "../node-NtM7__8q.mjs";
4
+ import { a as ALL_PIPELINE_STEPS, c as getStep, d as landmarkPrecisionVerdict, l as getStepDefinition, n as resolveDefaultDetectionModel, o as ALL_STEPS, r as localFrameRegistry, s as getDefaultModelForFormat, u as resolveModelForFormat } from "../default-detection-model-C2vYSX3O.mjs";
5
5
  import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
6
6
  import { n as startEventLoopStallMonitor } from "../event-loop-stall-monitor-DXLNBMkY.mjs";
7
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-CJ8yC9r_.mjs";
7
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-CddpCDWL.mjs";
8
8
  import * as os from "node:os";
9
9
  import * as fs from "node:fs";
10
10
  import * as path$1 from "node:path";
@@ -8629,6 +8629,157 @@ var CameraSwitchGroupSchema = object({
8629
8629
  /** Unix ms when the group was composed server-side. */
8630
8630
  fetchedAt: number()
8631
8631
  });
8632
+ /**
8633
+ * What the gate decided about a birth, from the CALLER's point of view.
8634
+ *
8635
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
8636
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
8637
+ * The third member is the one the gate's own type cannot express, because
8638
+ * exhaustion is a property of how long the caller waited.
8639
+ */
8640
+ var BirthDecisionVerdictSchema = _enum([
8641
+ "confirmed",
8642
+ "suppressed",
8643
+ "exhausted-fallback"
8644
+ ]);
8645
+ /** One birth decision, as it is kept. */
8646
+ var BirthDecisionRecordSchema = object({
8647
+ id: string(),
8648
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
8649
+ at: number().int(),
8650
+ /** The camera. Required: every question here is asked per-camera. */
8651
+ deviceId: number().int(),
8652
+ /**
8653
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
8654
+ * birth has no track at all, and a confirmed one is expected to age out long
8655
+ * before this row does. Named `sourceTrackId` so the retention model's
8656
+ * ownership derivation (`collection-classification.ts`, which keys on a
8657
+ * column literally called `trackId`) cannot reach it.
8658
+ */
8659
+ sourceTrackId: string(),
8660
+ /** The candidate's claimed class. The miss rate is asked per class too. */
8661
+ className: string(),
8662
+ verdict: BirthDecisionVerdictSchema,
8663
+ /**
8664
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
8665
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
8666
+ * when the gate is DISABLED and every birth is waved through. `null` is not
8667
+ * "unknown": it says the gate took no measurement because it was off, which
8668
+ * is a different population and must never be averaged in with the rest.
8669
+ */
8670
+ reason: string().nullable(),
8671
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
8672
+ attempts: number().int(),
8673
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
8674
+ deferredForMs: number().int(),
8675
+ /**
8676
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
8677
+ *
8678
+ * `true` when the frame the verdict was taken on carried no matched
8679
+ * detection for this track — the tracker was coasting a frozen box and the
8680
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
8681
+ * straight out of `result.tracked` without checking, so this is reachable
8682
+ * today; the question is the RATE, per camera, and whether refusing those
8683
+ * frames would have cost real tracks (cross-read against `verdict` and
8684
+ * `decidedByBirthEvidence`).
8685
+ */
8686
+ decidedOnCoastedFrame: boolean(),
8687
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
8688
+ birthEvidenceAvailable: boolean(),
8689
+ /**
8690
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
8691
+ * deciding are different: the carried crop is confirm-only, so a candidate
8692
+ * can hold evidence, be found inconclusive on it, and be decided by a native
8693
+ * crop of a later instant. A coasted decision backed by carried evidence is
8694
+ * a real observation of the birth instant; one without it is not.
8695
+ */
8696
+ decidedByBirthEvidence: boolean(),
8697
+ /** Best class-compatible crop score, or `null` when nothing compatible was
8698
+ * found — deliberately not 0, which would be a measurement that never was. */
8699
+ bestScore: number().nullable(),
8700
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
8701
+ appliedMinConfidence: number().nullable(),
8702
+ /**
8703
+ * The track's own `firstSeen` — the candidate's first frame, which is where
8704
+ * the timeline starts. `null` for a suppressed birth, which has no track.
8705
+ */
8706
+ firstSeen: number().int().nullable(),
8707
+ /**
8708
+ * The device's most recent motion RISING EDGE at the moment of the decision,
8709
+ * or `null` when there is none, it is older than
8710
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
8711
+ */
8712
+ motionOnsetAt: number().int().nullable(),
8713
+ /**
8714
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
8715
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
8716
+ *
8717
+ * **Why motion onset and not something else.** Two other proxies were
8718
+ * considered and rejected:
8719
+ * - *the recording/pipeline session start*: for a camera on
8720
+ * `detectionMode: 'always'` the session opens at process start, hours
8721
+ * before any subject. It measures nothing.
8722
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
8723
+ * `firstSeen` IS the first detection of that object, so for the track that
8724
+ * OPENS a burst — the only one the operator is complaining about — the two
8725
+ * are the same instant and the latency is 0 by construction.
8726
+ * Motion onset is the only in-process signal produced by a DIFFERENT
8727
+ * mechanism from the object detector, so it is the only one that can precede
8728
+ * it. It is also already maintained per-device at frame rate on this very
8729
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
8730
+ * it free — and, decisively, the frame path and the motion path are gated to
8731
+ * the SAME designated post-processing node, so the mirror is never empty for
8732
+ * a camera whose births land here.
8733
+ *
8734
+ * **Error bars, all of them.**
8735
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
8736
+ * wall or a branch, and only later joined by the person, OVERSTATES the
8737
+ * latency without bound. Mitigated, never removed, by
8738
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
8739
+ * candidate for "this burst is this subject", and even then it is a
8740
+ * candidate, not a fact.
8741
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
8742
+ * intensity threshold. A subject entering slowly at the far edge of the
8743
+ * frame can clear the detector's confidence floor BEFORE it clears the
8744
+ * motion floor, making this negative. Negatives are stored as-is and
8745
+ * never clamped — clamping would fabricate the distribution's left tail,
8746
+ * which is the half that says the proxy is unreliable.
8747
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
8748
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
8749
+ * therefore comparable WITHIN a camera and not across cameras of
8750
+ * different motion sources. The motion source is deliberately not copied
8751
+ * here — it belongs to the addon that owns the device (D224) and this is
8752
+ * a write on the frame path — so group by `deviceId`, which is how the
8753
+ * question is always asked anyway.
8754
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
8755
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
8756
+ * past it this is `null`.
8757
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
8758
+ * reporting, or nothing since boot: `null`. Which is the truth about a
8759
+ * camera nobody has a reference instant for.
8760
+ *
8761
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
8762
+ * as such. It is not a per-track fact and must never be shown as one.
8763
+ */
8764
+ birthLatencyMs: number().int().nullable(),
8765
+ /**
8766
+ * How many births this device has already decided since that motion onset.
8767
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
8768
+ * this subject. `null` when there is no usable onset.
8769
+ */
8770
+ birthIndexInBurst: number().int().nullable()
8771
+ });
8772
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
8773
+ var BirthDecisionQueryInputSchema = object({
8774
+ /** Restrict to a single camera; omit for every row. */
8775
+ deviceId: number().int().optional(),
8776
+ /** Only decisions at or after this epoch ms. */
8777
+ since: number().int().optional(),
8778
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
8779
+ verdict: BirthDecisionVerdictSchema.optional(),
8780
+ /** Max rows returned, newest-first. */
8781
+ limit: number().int().min(1).max(5e3).optional()
8782
+ });
8632
8783
  /** One archived note — the operator's words plus enough context to find what
8633
8784
  * they were looking at, after the track itself is gone. */
8634
8785
  var ArchivedDebugNoteSchema = object({
@@ -22488,7 +22639,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
22488
22639
  deviceId: number(),
22489
22640
  trackId: string(),
22490
22641
  flags: TrackFlagsPatchSchema
22491
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
22642
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
22492
22643
  kind: "query",
22493
22644
  auth: "admin"
22494
22645
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -22930,6 +23081,22 @@ var occupancyRecheckFramesField = {
22930
23081
  step: 1
22931
23082
  };
22932
23083
  /**
23084
+ * Frames one PRE-ROLL catch-up burst may send to inference at session open.
23085
+ *
23086
+ * The default of 12 over a ~4 s retained window is one frame per ~333 ms of
23087
+ * footage, and costs ~480 ms of ONE inference permit at the 40 ms/frame this
23088
+ * fleet measures — one-shot, and only ever taken while a permit would still be
23089
+ * spare for live. `0` turns the burst off entirely (the history is still
23090
+ * decoded, because that is how the dial reaches a decodable GOP, and is then
23091
+ * discarded — the pre-D411 behaviour).
23092
+ */
23093
+ var preRollInferenceFramesField = {
23094
+ min: 0,
23095
+ max: 30,
23096
+ default: 12,
23097
+ step: 1
23098
+ };
23099
+ /**
22933
23100
  * Source enum for motion signals fed to the runner. Extensible — add
22934
23101
  * new variants here when new motion-trigger paths are wired in
22935
23102
  * (`wasm-cross-camera`, `event-bus-relay`, etc.). The runner uses
@@ -23170,6 +23337,31 @@ var RunnerCameraConfigSchema = object({
23170
23337
  * to every occupancy rule until something moved in front of it. The churn is
23171
23338
  * now paid on the interval instead — see `occupancyRecheckSecField`.
23172
23339
  */
23340
+ /**
23341
+ * Infer the session's PRE-ROLL — the retained history the restreamer replays
23342
+ * at session open — instead of decoding it and throwing it away.
23343
+ *
23344
+ * DEFAULT `true`, and the default is the argument. This is not a new
23345
+ * capability being offered cautiously: the pre-roll is ALREADY requested,
23346
+ * already served, already decoded and already paid for on every on-motion
23347
+ * detection session that asks for history. What shipped was a last-moment
23348
+ * discard — `FrameSlot`'s throttle compares wall clocks, and ~4 s of media
23349
+ * arriving inside a few hundred ms of wall clock looks to it like one frame's
23350
+ * worth. Device 617, 2026-09-08: a re-run of the SAME model over the stored
23351
+ * recording scored the subject `vehicle 0.5669` — above the 0.50 floor —
23352
+ * 1.68 s BEFORE the live track was born, on a frame that was in the pre-roll,
23353
+ * was decoded, and was freed.
23354
+ *
23355
+ * Shipping that as opt-in would ship the bug: an operator cannot discover a
23356
+ * setting whose absence looks exactly like a camera that noticed the cyclist
23357
+ * late. What makes ON safe is not a switch but the BOUND —
23358
+ * `preRollInferenceFrames`, a wall-clock ceiling, and a lane that never takes
23359
+ * the last inference permit — so the switch exists for the camera where the
23360
+ * history is worthless (a doorbell whose subject is always already at the
23361
+ * door), not as a hedge against the feature.
23362
+ */
23363
+ preRollInferenceEnabled: boolean().default(true),
23364
+ preRollInferenceFrames: number().min(preRollInferenceFramesField.min).max(preRollInferenceFramesField.max).default(preRollInferenceFramesField.default),
23173
23365
  occupancyRecheckEnabled: boolean().default(true),
23174
23366
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
23175
23367
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
@@ -23198,7 +23390,7 @@ var RunnerCameraConfigSchema = object({
23198
23390
  */
23199
23391
  inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
23200
23392
  });
23201
- 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;
23393
+ 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;
23202
23394
  /**
23203
23395
  * Runtime load summary returned by `getLocalLoad`. Used by the orchestrator's
23204
23396
  * load-balancing levels (L2 capacity-based, L3 hardware-aware) to decide
@@ -36637,6 +36829,12 @@ Object.freeze({
36637
36829
  addonId: null,
36638
36830
  access: "view"
36639
36831
  },
36832
+ "pipelineAnalytics.listBirthDecisions": {
36833
+ capName: "pipeline-analytics",
36834
+ capScope: "device",
36835
+ addonId: null,
36836
+ access: "view"
36837
+ },
36640
36838
  "pipelineAnalytics.listEventKinds": {
36641
36839
  capName: "pipeline-analytics",
36642
36840
  capScope: "device",
@@ -40429,6 +40627,11 @@ Object.freeze({
40429
40627
  form: "single",
40430
40628
  optional: true
40431
40629
  }],
40630
+ "pipelineAnalytics.listBirthDecisions": [{
40631
+ name: "deviceId",
40632
+ form: "single",
40633
+ optional: true
40634
+ }],
40432
40635
  "pipelineAnalytics.listEventKinds": [{
40433
40636
  name: "deviceId",
40434
40637
  form: "single",
@@ -8606,6 +8606,157 @@ var CameraSwitchGroupSchema = object({
8606
8606
  /** Unix ms when the group was composed server-side. */
8607
8607
  fetchedAt: number()
8608
8608
  });
8609
+ /**
8610
+ * What the gate decided about a birth, from the CALLER's point of view.
8611
+ *
8612
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
8613
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
8614
+ * The third member is the one the gate's own type cannot express, because
8615
+ * exhaustion is a property of how long the caller waited.
8616
+ */
8617
+ var BirthDecisionVerdictSchema = _enum([
8618
+ "confirmed",
8619
+ "suppressed",
8620
+ "exhausted-fallback"
8621
+ ]);
8622
+ /** One birth decision, as it is kept. */
8623
+ var BirthDecisionRecordSchema = object({
8624
+ id: string(),
8625
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
8626
+ at: number().int(),
8627
+ /** The camera. Required: every question here is asked per-camera. */
8628
+ deviceId: number().int(),
8629
+ /**
8630
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
8631
+ * birth has no track at all, and a confirmed one is expected to age out long
8632
+ * before this row does. Named `sourceTrackId` so the retention model's
8633
+ * ownership derivation (`collection-classification.ts`, which keys on a
8634
+ * column literally called `trackId`) cannot reach it.
8635
+ */
8636
+ sourceTrackId: string(),
8637
+ /** The candidate's claimed class. The miss rate is asked per class too. */
8638
+ className: string(),
8639
+ verdict: BirthDecisionVerdictSchema,
8640
+ /**
8641
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
8642
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
8643
+ * when the gate is DISABLED and every birth is waved through. `null` is not
8644
+ * "unknown": it says the gate took no measurement because it was off, which
8645
+ * is a different population and must never be averaged in with the rest.
8646
+ */
8647
+ reason: string().nullable(),
8648
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
8649
+ attempts: number().int(),
8650
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
8651
+ deferredForMs: number().int(),
8652
+ /**
8653
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
8654
+ *
8655
+ * `true` when the frame the verdict was taken on carried no matched
8656
+ * detection for this track — the tracker was coasting a frozen box and the
8657
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
8658
+ * straight out of `result.tracked` without checking, so this is reachable
8659
+ * today; the question is the RATE, per camera, and whether refusing those
8660
+ * frames would have cost real tracks (cross-read against `verdict` and
8661
+ * `decidedByBirthEvidence`).
8662
+ */
8663
+ decidedOnCoastedFrame: boolean(),
8664
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
8665
+ birthEvidenceAvailable: boolean(),
8666
+ /**
8667
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
8668
+ * deciding are different: the carried crop is confirm-only, so a candidate
8669
+ * can hold evidence, be found inconclusive on it, and be decided by a native
8670
+ * crop of a later instant. A coasted decision backed by carried evidence is
8671
+ * a real observation of the birth instant; one without it is not.
8672
+ */
8673
+ decidedByBirthEvidence: boolean(),
8674
+ /** Best class-compatible crop score, or `null` when nothing compatible was
8675
+ * found — deliberately not 0, which would be a measurement that never was. */
8676
+ bestScore: number().nullable(),
8677
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
8678
+ appliedMinConfidence: number().nullable(),
8679
+ /**
8680
+ * The track's own `firstSeen` — the candidate's first frame, which is where
8681
+ * the timeline starts. `null` for a suppressed birth, which has no track.
8682
+ */
8683
+ firstSeen: number().int().nullable(),
8684
+ /**
8685
+ * The device's most recent motion RISING EDGE at the moment of the decision,
8686
+ * or `null` when there is none, it is older than
8687
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
8688
+ */
8689
+ motionOnsetAt: number().int().nullable(),
8690
+ /**
8691
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
8692
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
8693
+ *
8694
+ * **Why motion onset and not something else.** Two other proxies were
8695
+ * considered and rejected:
8696
+ * - *the recording/pipeline session start*: for a camera on
8697
+ * `detectionMode: 'always'` the session opens at process start, hours
8698
+ * before any subject. It measures nothing.
8699
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
8700
+ * `firstSeen` IS the first detection of that object, so for the track that
8701
+ * OPENS a burst — the only one the operator is complaining about — the two
8702
+ * are the same instant and the latency is 0 by construction.
8703
+ * Motion onset is the only in-process signal produced by a DIFFERENT
8704
+ * mechanism from the object detector, so it is the only one that can precede
8705
+ * it. It is also already maintained per-device at frame rate on this very
8706
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
8707
+ * it free — and, decisively, the frame path and the motion path are gated to
8708
+ * the SAME designated post-processing node, so the mirror is never empty for
8709
+ * a camera whose births land here.
8710
+ *
8711
+ * **Error bars, all of them.**
8712
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
8713
+ * wall or a branch, and only later joined by the person, OVERSTATES the
8714
+ * latency without bound. Mitigated, never removed, by
8715
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
8716
+ * candidate for "this burst is this subject", and even then it is a
8717
+ * candidate, not a fact.
8718
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
8719
+ * intensity threshold. A subject entering slowly at the far edge of the
8720
+ * frame can clear the detector's confidence floor BEFORE it clears the
8721
+ * motion floor, making this negative. Negatives are stored as-is and
8722
+ * never clamped — clamping would fabricate the distribution's left tail,
8723
+ * which is the half that says the proxy is unreliable.
8724
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
8725
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
8726
+ * therefore comparable WITHIN a camera and not across cameras of
8727
+ * different motion sources. The motion source is deliberately not copied
8728
+ * here — it belongs to the addon that owns the device (D224) and this is
8729
+ * a write on the frame path — so group by `deviceId`, which is how the
8730
+ * question is always asked anyway.
8731
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
8732
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
8733
+ * past it this is `null`.
8734
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
8735
+ * reporting, or nothing since boot: `null`. Which is the truth about a
8736
+ * camera nobody has a reference instant for.
8737
+ *
8738
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
8739
+ * as such. It is not a per-track fact and must never be shown as one.
8740
+ */
8741
+ birthLatencyMs: number().int().nullable(),
8742
+ /**
8743
+ * How many births this device has already decided since that motion onset.
8744
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
8745
+ * this subject. `null` when there is no usable onset.
8746
+ */
8747
+ birthIndexInBurst: number().int().nullable()
8748
+ });
8749
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
8750
+ var BirthDecisionQueryInputSchema = object({
8751
+ /** Restrict to a single camera; omit for every row. */
8752
+ deviceId: number().int().optional(),
8753
+ /** Only decisions at or after this epoch ms. */
8754
+ since: number().int().optional(),
8755
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
8756
+ verdict: BirthDecisionVerdictSchema.optional(),
8757
+ /** Max rows returned, newest-first. */
8758
+ limit: number().int().min(1).max(5e3).optional()
8759
+ });
8609
8760
  /** One archived note — the operator's words plus enough context to find what
8610
8761
  * they were looking at, after the track itself is gone. */
8611
8762
  var ArchivedDebugNoteSchema = object({
@@ -22465,7 +22616,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
22465
22616
  deviceId: number(),
22466
22617
  trackId: string(),
22467
22618
  flags: TrackFlagsPatchSchema
22468
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
22619
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
22469
22620
  kind: "query",
22470
22621
  auth: "admin"
22471
22622
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -22907,6 +23058,22 @@ var occupancyRecheckFramesField = {
22907
23058
  step: 1
22908
23059
  };
22909
23060
  /**
23061
+ * Frames one PRE-ROLL catch-up burst may send to inference at session open.
23062
+ *
23063
+ * The default of 12 over a ~4 s retained window is one frame per ~333 ms of
23064
+ * footage, and costs ~480 ms of ONE inference permit at the 40 ms/frame this
23065
+ * fleet measures — one-shot, and only ever taken while a permit would still be
23066
+ * spare for live. `0` turns the burst off entirely (the history is still
23067
+ * decoded, because that is how the dial reaches a decodable GOP, and is then
23068
+ * discarded — the pre-D411 behaviour).
23069
+ */
23070
+ var preRollInferenceFramesField = {
23071
+ min: 0,
23072
+ max: 30,
23073
+ default: 12,
23074
+ step: 1
23075
+ };
23076
+ /**
22910
23077
  * Source enum for motion signals fed to the runner. Extensible — add
22911
23078
  * new variants here when new motion-trigger paths are wired in
22912
23079
  * (`wasm-cross-camera`, `event-bus-relay`, etc.). The runner uses
@@ -23147,6 +23314,31 @@ var RunnerCameraConfigSchema = object({
23147
23314
  * to every occupancy rule until something moved in front of it. The churn is
23148
23315
  * now paid on the interval instead — see `occupancyRecheckSecField`.
23149
23316
  */
23317
+ /**
23318
+ * Infer the session's PRE-ROLL — the retained history the restreamer replays
23319
+ * at session open — instead of decoding it and throwing it away.
23320
+ *
23321
+ * DEFAULT `true`, and the default is the argument. This is not a new
23322
+ * capability being offered cautiously: the pre-roll is ALREADY requested,
23323
+ * already served, already decoded and already paid for on every on-motion
23324
+ * detection session that asks for history. What shipped was a last-moment
23325
+ * discard — `FrameSlot`'s throttle compares wall clocks, and ~4 s of media
23326
+ * arriving inside a few hundred ms of wall clock looks to it like one frame's
23327
+ * worth. Device 617, 2026-09-08: a re-run of the SAME model over the stored
23328
+ * recording scored the subject `vehicle 0.5669` — above the 0.50 floor —
23329
+ * 1.68 s BEFORE the live track was born, on a frame that was in the pre-roll,
23330
+ * was decoded, and was freed.
23331
+ *
23332
+ * Shipping that as opt-in would ship the bug: an operator cannot discover a
23333
+ * setting whose absence looks exactly like a camera that noticed the cyclist
23334
+ * late. What makes ON safe is not a switch but the BOUND —
23335
+ * `preRollInferenceFrames`, a wall-clock ceiling, and a lane that never takes
23336
+ * the last inference permit — so the switch exists for the camera where the
23337
+ * history is worthless (a doorbell whose subject is always already at the
23338
+ * door), not as a hedge against the feature.
23339
+ */
23340
+ preRollInferenceEnabled: boolean().default(true),
23341
+ preRollInferenceFrames: number().min(preRollInferenceFramesField.min).max(preRollInferenceFramesField.max).default(preRollInferenceFramesField.default),
23150
23342
  occupancyRecheckEnabled: boolean().default(true),
23151
23343
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
23152
23344
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
@@ -23175,7 +23367,7 @@ var RunnerCameraConfigSchema = object({
23175
23367
  */
23176
23368
  inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
23177
23369
  });
23178
- 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;
23370
+ 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;
23179
23371
  /**
23180
23372
  * Runtime load summary returned by `getLocalLoad`. Used by the orchestrator's
23181
23373
  * load-balancing levels (L2 capacity-based, L3 hardware-aware) to decide
@@ -36614,6 +36806,12 @@ Object.freeze({
36614
36806
  addonId: null,
36615
36807
  access: "view"
36616
36808
  },
36809
+ "pipelineAnalytics.listBirthDecisions": {
36810
+ capName: "pipeline-analytics",
36811
+ capScope: "device",
36812
+ addonId: null,
36813
+ access: "view"
36814
+ },
36617
36815
  "pipelineAnalytics.listEventKinds": {
36618
36816
  capName: "pipeline-analytics",
36619
36817
  capScope: "device",
@@ -40406,6 +40604,11 @@ Object.freeze({
40406
40604
  form: "single",
40407
40605
  optional: true
40408
40606
  }],
40607
+ "pipelineAnalytics.listBirthDecisions": [{
40608
+ name: "deviceId",
40609
+ form: "single",
40610
+ optional: true
40611
+ }],
40409
40612
  "pipelineAnalytics.listEventKinds": [{
40410
40613
  name: "deviceId",
40411
40614
  form: "single",
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-B-MeGV6o.js");
1
+ const require_dist = require("./dist-DoHcimdu.js");
2
2
  let node_path = require("node:path");
3
3
  node_path = require_dist.__toESM(node_path);
4
4
  let node_url = require("node:url");
@@ -2,8 +2,8 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-B-MeGV6o.js");
6
- const require_lazy_sharp = require("../lazy-sharp-xDAJscmd.js");
5
+ const require_dist = require("../dist-DoHcimdu.js");
6
+ const require_lazy_sharp = require("../lazy-sharp-BeeQGCUu.js");
7
7
  let node_fs = require("node:fs");
8
8
  let node_path = require("node:path");
9
9
  //#region src/motion-wasm/region-grouping.ts
@@ -1,4 +1,4 @@
1
- import { Jt as hydrateSchema, Kt as DeviceType, Ut as BaseAddon, X as evaluateZoneRules, ft as motionDetectionCapability } from "../dist-C-elKxbr.mjs";
1
+ import { Jt as hydrateSchema, Kt as DeviceType, Ut as BaseAddon, X as evaluateZoneRules, ft as motionDetectionCapability } from "../dist-DttqKvsQ.mjs";
2
2
  import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
3
3
  import { readFileSync } from "node:fs";
4
4
  import { join } from "node:path";
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-B-MeGV6o.js");
1
+ const require_dist = require("./dist-DoHcimdu.js");
2
2
  let node_crypto = require("node:crypto");
3
3
  let node_fs = require("node:fs");
4
4
  node_fs = require_dist.__toESM(node_fs, 1);
@@ -1,4 +1,4 @@
1
- import { It as errMsg, Rt as Fmp4BoxSplitter, Vt as isSoftwareDecode, zt as buildFfmpegArgs } from "./dist-C-elKxbr.mjs";
1
+ import { It as errMsg, Rt as Fmp4BoxSplitter, Vt as isSoftwareDecode, zt as buildFfmpegArgs } from "./dist-DttqKvsQ.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { realpathSync } from "node:fs";
4
4
  import path from "node:path";