@trillboards/edge-sdk 0.2.265 → 0.2.273

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 (102) hide show
  1. package/deploy/detector/pyproject.toml +1 -1
  2. package/deploy/detector/tests/test_loader.py +1 -1
  3. package/deploy/detector/tests/test_staff_uniform.py +342 -0
  4. package/deploy/detector/trillboards_detector/_version.py +2 -2
  5. package/deploy/detector/trillboards_detector/loader.py +6 -0
  6. package/deploy/detector/trillboards_detector/registry.py +30 -1
  7. package/deploy/detector/trillboards_detector/server.py +43 -0
  8. package/deploy/detector/trillboards_detector/staff_uniform.py +190 -0
  9. package/deploy/detector/trillboards_detector/tasks.py +9 -1
  10. package/deploy/windows/build-windows.ps1 +3 -0
  11. package/deploy/windows/ci/test-published-install.ps1 +1 -1
  12. package/deploy/windows/e2e/test-recorder-family.ps1 +1 -1
  13. package/deploy/windows/process-priority.ps1 +229 -0
  14. package/dist/ActorPerception.d.ts.map +1 -1
  15. package/dist/ActorPerception.js +3 -1
  16. package/dist/ActorPerception.js.map +1 -1
  17. package/dist/AudienceAnalyzeClient.d.ts +28 -0
  18. package/dist/AudienceAnalyzeClient.d.ts.map +1 -1
  19. package/dist/AudienceAnalyzeClient.js +89 -15
  20. package/dist/AudienceAnalyzeClient.js.map +1 -1
  21. package/dist/CctvLiveViewCoordinator.d.ts +23 -2
  22. package/dist/CctvLiveViewCoordinator.d.ts.map +1 -1
  23. package/dist/CctvLiveViewCoordinator.js +50 -0
  24. package/dist/CctvLiveViewCoordinator.js.map +1 -1
  25. package/dist/ConnectorStatusClient.d.ts +8 -0
  26. package/dist/ConnectorStatusClient.d.ts.map +1 -1
  27. package/dist/ConnectorStatusClient.js +3 -0
  28. package/dist/ConnectorStatusClient.js.map +1 -1
  29. package/dist/DetectorFields.d.ts +113 -6
  30. package/dist/DetectorFields.d.ts.map +1 -1
  31. package/dist/DetectorFields.js +163 -42
  32. package/dist/DetectorFields.js.map +1 -1
  33. package/dist/EdgeAgent.js +1 -1
  34. package/dist/LocalDetectorClient.d.ts +21 -0
  35. package/dist/LocalDetectorClient.d.ts.map +1 -1
  36. package/dist/LocalDetectorClient.js +43 -0
  37. package/dist/LocalDetectorClient.js.map +1 -1
  38. package/dist/NativeReadiness.d.ts.map +1 -1
  39. package/dist/NativeReadiness.js +8 -3
  40. package/dist/NativeReadiness.js.map +1 -1
  41. package/dist/QueueDwell.d.ts +87 -0
  42. package/dist/QueueDwell.d.ts.map +1 -0
  43. package/dist/QueueDwell.js +167 -0
  44. package/dist/QueueDwell.js.map +1 -0
  45. package/dist/ScopedVlmReview.d.ts +11 -1
  46. package/dist/ScopedVlmReview.d.ts.map +1 -1
  47. package/dist/ScopedVlmReview.js +50 -7
  48. package/dist/ScopedVlmReview.js.map +1 -1
  49. package/dist/SensingProfileClient.d.ts +7 -0
  50. package/dist/SensingProfileClient.d.ts.map +1 -1
  51. package/dist/SensingProfileClient.js +1 -0
  52. package/dist/SensingProfileClient.js.map +1 -1
  53. package/dist/config.d.ts +8 -0
  54. package/dist/config.d.ts.map +1 -1
  55. package/dist/config.js.map +1 -1
  56. package/dist/connectorUpdate.d.ts +6 -0
  57. package/dist/connectorUpdate.d.ts.map +1 -1
  58. package/dist/connectorUpdate.js +8 -1
  59. package/dist/connectorUpdate.js.map +1 -1
  60. package/dist/diagnose.d.ts +1 -1
  61. package/dist/diagnose.js +1 -1
  62. package/dist/enterpriseNetwork.d.ts +9 -0
  63. package/dist/enterpriseNetwork.d.ts.map +1 -1
  64. package/dist/enterpriseNetwork.js +14 -0
  65. package/dist/enterpriseNetwork.js.map +1 -1
  66. package/dist/index.d.ts +1 -1
  67. package/dist/index.d.ts.map +1 -1
  68. package/dist/localSensing.d.ts +45 -1
  69. package/dist/localSensing.d.ts.map +1 -1
  70. package/dist/localSensing.js +82 -8
  71. package/dist/localSensing.js.map +1 -1
  72. package/dist/mainThreadStall.d.ts +11 -0
  73. package/dist/mainThreadStall.d.ts.map +1 -1
  74. package/dist/mainThreadStall.js +35 -0
  75. package/dist/mainThreadStall.js.map +1 -1
  76. package/dist/pipelineSwitches.d.ts +82 -1
  77. package/dist/pipelineSwitches.d.ts.map +1 -1
  78. package/dist/pipelineSwitches.js +109 -15
  79. package/dist/pipelineSwitches.js.map +1 -1
  80. package/dist/processPriority.d.ts +75 -0
  81. package/dist/processPriority.d.ts.map +1 -0
  82. package/dist/processPriority.js +380 -0
  83. package/dist/processPriority.js.map +1 -0
  84. package/dist/sensingRunMode.d.ts.map +1 -1
  85. package/dist/sensingRunMode.js +22 -3
  86. package/dist/sensingRunMode.js.map +1 -1
  87. package/dist/vehicleEndWarmup.d.ts +60 -0
  88. package/dist/vehicleEndWarmup.d.ts.map +1 -0
  89. package/dist/vehicleEndWarmup.js +209 -0
  90. package/dist/vehicleEndWarmup.js.map +1 -0
  91. package/dist/windowsLiveView.d.ts +3 -1
  92. package/dist/windowsLiveView.d.ts.map +1 -1
  93. package/dist/windowsLiveView.js +2 -0
  94. package/dist/windowsLiveView.js.map +1 -1
  95. package/package.json +4 -4
  96. package/retained/RetainedCaptureClient.cjs +28 -3
  97. package/retained/__tests__/archive-lifecycle.test.cjs +44 -0
  98. package/retained/__tests__/paired-theft-manager.test.cjs +24 -0
  99. package/retained/__tests__/queue-dwell.test.cjs +238 -0
  100. package/retained/__tests__/runtime.test.cjs +3 -0
  101. package/retained/__tests__/support/theft-builder.cjs +3 -1
  102. package/retained/manager.cjs +20 -1
@@ -18,21 +18,86 @@ export type DetectorBackendMode = 'ort' | 'openvino_probe' | 'openvino' | 'openv
18
18
  * camera retires its old captures at most once every 30 s, in one batch.
19
19
  */
20
20
  export type ArchiveMode = 'legacy' | 'lean';
21
+ /**
22
+ * How long, in ms, a paired look's native detector call may take (CCTV_LOOK_DETECTOR_DEADLINE_MS).
23
+ *
24
+ * A website-managed box pairs its detector looks across cameras (retained/manager.cjs
25
+ * PAIRED_DETECTOR_CALL_MS), so a look's field call can queue behind the other look's
26
+ * inference. `5000` (today): the call gives up after 5 s and the look is left unanswered
27
+ * (detectorFields unavailable). `8000`: it may take 8 s. The detector service finishes an
28
+ * abandoned call anyway (it never checks for a client that hung up), so the longer wait takes
29
+ * an answer the detector was already computing. Measured on the Texas box (Nov 20,
30
+ * 05:40-08:40Z): 24 timeouts in 13,660 looks, each queued behind a stall-slowed call;
31
+ * would-be finish p50 5.6 s, p90 6.1 s, max 6.9 s.
32
+ */
33
+ export type LookDetectorDeadline = '5000' | '8000';
34
+ /**
35
+ * How a review answer goes up. `legacy`: one POST, bounded only by the 30-s socket
36
+ * inactivity timeout, and a failure pauses the box's one upload lane for 5 s.
37
+ * `deadline`: a POST that has not answered within REVIEW_UPLOAD_DEADLINE_MS of wall
38
+ * clock is cut and sent once more at once, byte for byte, on a new connection.
39
+ */
40
+ export type ReviewUploadMode = 'legacy' | 'deadline';
41
+ /**
42
+ * The Windows priorities of the connector, its ffmpeg children and the detector service
43
+ * (CCTV_PROCESS_PRIORITY; processPriority.ts). `legacy` (today): Task Scheduler's default task
44
+ * priority 7, below-normal CPU class with low I/O and low memory priority, inherited by every
45
+ * child; only read and reported. `normal`: the running processes are raised to normal CPU class,
46
+ * memory and I/O priority, as the live-view runbook states they run.
47
+ */
48
+ export type ProcessPriorityMode = 'legacy' | 'normal';
49
+ /**
50
+ * The parking alert's vehicle-end warm-up (CCTV_VEHICLE_END_WARMUP; vehicleEndWarmup.ts). `off`
51
+ * (today): none. `idle_180s`: while a camera's vehicle orientation gate is armed, one warm-up call
52
+ * whenever no vehicle-end call ran for 180 s.
53
+ */
54
+ export type VehicleEndWarmupMode = 'off' | 'idle_180s';
55
+ /**
56
+ * The main-thread stall monitor (CCTV_STALL_MONITOR; mainThreadStall.ts): its 100 ms event-loop
57
+ * timer, the timing of every synchronous fs call with a stack capture for a slow one, the heap
58
+ * sample and the minute file. `on` (today, 0.2.265+); `off` stops all of it and restores every fs
59
+ * function, and the beacon then carries no main-thread minutes. `off` also skips the per-look
60
+ * archive statistics (the trace's `archive`) and has RetainedCaptureClient take the archive switch
61
+ * once per switch change instead of on every capture: the rest of #16475's legacy-path overhead.
62
+ */
63
+ export type StallMonitorMode = 'on' | 'off';
21
64
  export interface PipelineSwitches {
22
65
  version: 1;
23
66
  capture: CapturePipeline;
24
67
  lookReuse: LookReuseMode;
25
68
  detectorBackend: DetectorBackendMode;
26
69
  archive: ArchiveMode;
70
+ lookDetectorDeadline: LookDetectorDeadline;
71
+ reviewUpload: ReviewUploadMode;
72
+ processPriority: ProcessPriorityMode;
73
+ vehicleEndWarmup: VehicleEndWarmupMode;
74
+ stallMonitor: StallMonitorMode;
27
75
  }
28
76
  export declare const CAPTURE_PIPELINES: readonly CapturePipeline[];
29
77
  export declare const LOOK_REUSE_MODES: readonly LookReuseMode[];
30
78
  export declare const DETECTOR_BACKENDS: readonly DetectorBackendMode[];
31
79
  export declare const ARCHIVE_MODES: readonly ArchiveMode[];
80
+ export declare const LOOK_DETECTOR_DEADLINES: readonly LookDetectorDeadline[];
81
+ export declare const PROCESS_PRIORITY_MODES: readonly ProcessPriorityMode[];
82
+ export declare const VEHICLE_END_WARMUP_MODES: readonly VehicleEndWarmupMode[];
83
+ export declare const STALL_MONITOR_MODES: readonly StallMonitorMode[];
84
+ export declare const REVIEW_UPLOAD_MODES: readonly ReviewUploadMode[];
85
+ /**
86
+ * The review-upload deadline under `deadline`. On 2026-11-19 at 17:32Z one upload from
87
+ * the Texas box hung, never reaching the API, and held the box's one upload lane for
88
+ * 35 s (the 30-s inactivity timeout, then the 5-s pause) while every camera waited for
89
+ * its answer's receipt: 40-46 s with no look on any of 7 cameras. Over the three store
90
+ * days to then (143,549 looks), a look's answer-to-receipt time, which includes any
91
+ * wait behind another upload in the lane, had a p99.9 of 2.3-3.1 s; 4-7 a day took
92
+ * over 8 s, and the longest outside that stall took 22 s.
93
+ */
94
+ export declare const REVIEW_UPLOAD_DEADLINE_MS = 8000;
32
95
  export declare const DEFAULT_PIPELINE_SWITCHES: Readonly<PipelineSwitches>;
33
96
  /**
34
97
  * Strictly read a `pipeline` body; null when any part is unusable (the box keeps what it has).
35
- * `archive` is the one optional key: absent (a server before it) is `legacy`.
98
+ * `archive`, `lookDetectorDeadline`, `reviewUpload`, `processPriority`, `vehicleEndWarmup` and
99
+ * `stallMonitor` are optional: absent (a server or a saved file from before them) is `legacy`,
100
+ * '5000', `legacy`, `legacy`, `off` and `on`.
36
101
  */
37
102
  export declare function parsePipelineSwitches(raw: unknown): PipelineSwitches | null;
38
103
  type Listener = (switches: PipelineSwitches) => void;
@@ -49,6 +114,15 @@ export declare function restorePipelineSwitches(dataDir: string): PipelineSwitch
49
114
  */
50
115
  export declare function notePipelineSwitches(raw: unknown): void;
51
116
  export declare function currentPipelineSwitches(): PipelineSwitches;
117
+ /**
118
+ * The served paired-look detector deadline in ms (CCTV_LOOK_DETECTOR_DEADLINE_MS), read at
119
+ * call time: localSensing gives a paired box's look field call and the field producers it
120
+ * builds per review this bound, so a CAS reaches the next look with no rebuild.
121
+ */
122
+ export declare function lookDetectorDeadlineMs(): number;
123
+ /** The wall-clock deadline a review upload takes now: REVIEW_UPLOAD_DEADLINE_MS under `deadline`, none under `legacy`. */
124
+ export declare function reviewUploadDeadlineMs(): number | undefined;
125
+ export declare function noteReviewUploadCut(resend: 'ok' | 'failed'): void;
52
126
  /** Called now with the current switches, then on every change. Returns the unsubscribe. */
53
127
  export declare function onPipelineSwitches(listener: Listener): () => void;
54
128
  /**
@@ -80,6 +154,13 @@ export declare function noteDetectorBackend(snapshot: DetectorBackendSnapshot |
80
154
  */
81
155
  type ArchiveStatsReader = () => Record<string, number> | null;
82
156
  export declare function bindArchiveStats(reader: ArchiveStatsReader | null): void;
157
+ /**
158
+ * The vehicle-end warm-up's counters for this run (CCTV_VEHICLE_END_WARMUP, vehicleEndWarmup.ts):
159
+ * warm-up calls sent, answered and failed, the last one's duration and the cameras armed. Bound
160
+ * when a camera first arms it; the reader answers null while the switch is off and none was sent.
161
+ */
162
+ type WarmupStatsReader = () => object | null;
163
+ export declare function bindVehicleEndWarmupStats(reader: WarmupStatsReader | null): void;
83
164
  export declare function noteServerClock(sentAtMs: number, receivedAtMs: number, serverNowMs: unknown): void;
84
165
  /** What a look reports about the pipeline that produced it. Bounded and diagnostic. */
85
166
  export declare function pipelineTrace(feedName: string | undefined, lookReuse?: unknown): Record<string, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"pipelineSwitches.d.ts","sourceRoot":"","sources":["../src/pipelineSwitches.ts"],"names":[],"mappings":"AA0BA,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,cAAc,GAAG,iBAAiB,GAAG,WAAW,GAAG,cAAc,CAAC;AAC3G,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AACtD,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,gBAAgB,GAAG,UAAU,GAAG,cAAc,CAAC;AACzF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE5C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,CAAC,CAAC;IACX,OAAO,EAAE,eAAe,CAAC;IACzB,SAAS,EAAE,aAAa,CAAC;IACzB,eAAe,EAAE,mBAAmB,CAAC;IACrC,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,eAAO,MAAM,iBAAiB,EAAE,SAAS,eAAe,EACmC,CAAC;AAC5F,eAAO,MAAM,gBAAgB,EAAE,SAAS,aAAa,EAA6C,CAAC;AACnG,eAAO,MAAM,iBAAiB,EAAE,SAAS,mBAAmB,EACU,CAAC;AACvE,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAAsC,CAAC;AAEvF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,gBAAgB,CAE/D,CAAC;AAEH;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,GAAG,IAAI,CAW3E;AAED,KAAK,QAA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AG,MAAM,MAAM,GAAG,IAAI,CAAC;AAG7C,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAEhF;AAWD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,IAAI,CAOlG;AASD,uFAAuF;AACvF,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA8BxG;AAED,wBAAgB,+BAA+B,IAAI,IAAI,CActD"}
@@ -33,15 +33,19 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.DEFAULT_PIPELINE_SWITCHES = exports.ARCHIVE_MODES = exports.DETECTOR_BACKENDS = exports.LOOK_REUSE_MODES = exports.CAPTURE_PIPELINES = void 0;
36
+ exports.DEFAULT_PIPELINE_SWITCHES = exports.REVIEW_UPLOAD_DEADLINE_MS = exports.REVIEW_UPLOAD_MODES = exports.STALL_MONITOR_MODES = exports.VEHICLE_END_WARMUP_MODES = exports.PROCESS_PRIORITY_MODES = exports.LOOK_DETECTOR_DEADLINES = exports.ARCHIVE_MODES = exports.DETECTOR_BACKENDS = exports.LOOK_REUSE_MODES = exports.CAPTURE_PIPELINES = void 0;
37
37
  exports.parsePipelineSwitches = parsePipelineSwitches;
38
38
  exports.restorePipelineSwitches = restorePipelineSwitches;
39
39
  exports.notePipelineSwitches = notePipelineSwitches;
40
40
  exports.currentPipelineSwitches = currentPipelineSwitches;
41
+ exports.lookDetectorDeadlineMs = lookDetectorDeadlineMs;
42
+ exports.reviewUploadDeadlineMs = reviewUploadDeadlineMs;
43
+ exports.noteReviewUploadCut = noteReviewUploadCut;
41
44
  exports.onPipelineSwitches = onPipelineSwitches;
42
45
  exports.bindCapturePipeline = bindCapturePipeline;
43
46
  exports.noteDetectorBackend = noteDetectorBackend;
44
47
  exports.bindArchiveStats = bindArchiveStats;
48
+ exports.bindVehicleEndWarmupStats = bindVehicleEndWarmupStats;
45
49
  exports.noteServerClock = noteServerClock;
46
50
  exports.pipelineTrace = pipelineTrace;
47
51
  exports.__resetPipelineSwitchesForTests = __resetPipelineSwitchesForTests;
@@ -49,11 +53,15 @@ exports.__resetPipelineSwitchesForTests = __resetPipelineSwitchesForTests;
49
53
  * The store-PC pipeline switches (plan v7 W8), and the diagnostics each look
50
54
  * carries about them.
51
55
  *
52
- * The server sends `pipeline: { version: 1, capture, lookReuse, detectorBackend, archive }`
53
- * on every sensing-profile response (runtime_config CCTV_CAPTURE_PIPELINE,
54
- * CCTV_LOOK_REUSE, CCTV_DETECTOR_BACKEND, CCTV_CAPTURE_ARCHIVE;
55
- * cameraPairingController.pipelineSwitches). A server that sends no `archive`
56
- * is `legacy`, so a box behind an older server keeps today's archive writes.
56
+ * The server sends `pipeline: { version: 1, capture, lookReuse, detectorBackend, archive,
57
+ * lookDetectorDeadline, reviewUpload, processPriority, vehicleEndWarmup, stallMonitor }` on
58
+ * every sensing-profile response (runtime_config CCTV_CAPTURE_PIPELINE, CCTV_LOOK_REUSE,
59
+ * CCTV_DETECTOR_BACKEND, CCTV_CAPTURE_ARCHIVE, CCTV_LOOK_DETECTOR_DEADLINE_MS, CCTV_REVIEW_UPLOAD,
60
+ * CCTV_PROCESS_PRIORITY, CCTV_VEHICLE_END_WARMUP, CCTV_STALL_MONITOR;
61
+ * cameraPairingController.pipelineSwitches). A server that sends no `archive` is `legacy`,
62
+ * one that sends no `lookDetectorDeadline` is '5000', one that sends no `reviewUpload` is
63
+ * `legacy`, and one that sends none of the last three is `legacy`, `off` and `on`, so a box
64
+ * behind an older server keeps today's behaviour.
57
65
  * `SensingProfileClient.fetchProfile` hands every parsed body to
58
66
  * `notePipelineSwitches`, exactly as it hands `connectorRelease` to the update
59
67
  * loop, so a switch reaches the box within one profile poll with no release.
@@ -63,7 +71,11 @@ exports.__resetPipelineSwitchesForTests = __resetPipelineSwitchesForTests;
63
71
  * stay out of every archived review context: flipping one cannot restart an
64
72
  * alert's episode or wait clock.
65
73
  *
66
- * DEFAULTS ARE TODAY'S BEHAVIOUR: legacy capture, no look reuse, ONNX Runtime.
74
+ * DEFAULTS ARE TODAY'S BEHAVIOUR: legacy capture, no look reuse, ONNX Runtime,
75
+ * the legacy archive, a 5 s paired-look detector call, legacy review uploads, Task
76
+ * Scheduler's process priorities, no vehicle-end warm-up and the main-thread stall monitor
77
+ * running. A server that sends no `archive` or no `reviewUpload` means `legacy` for it, and
78
+ * no `lookDetectorDeadline` means '5000'.
67
79
  * A restart starts from the last switches this box saw (persisted beside the
68
80
  * scene memory), so a box that was told `select_first` does not run one legacy
69
81
  * session per camera before its first poll.
@@ -74,26 +86,57 @@ exports.CAPTURE_PIPELINES = Object.freeze(['legacy', 'select_first', 'select_fir
74
86
  exports.LOOK_REUSE_MODES = Object.freeze(['off', 'shadow', 'live']);
75
87
  exports.DETECTOR_BACKENDS = Object.freeze(['ort', 'openvino_probe', 'openvino', 'openvino_gpu']);
76
88
  exports.ARCHIVE_MODES = Object.freeze(['legacy', 'lean']);
89
+ exports.LOOK_DETECTOR_DEADLINES = Object.freeze(['5000', '8000']);
90
+ exports.PROCESS_PRIORITY_MODES = Object.freeze(['legacy', 'normal']);
91
+ exports.VEHICLE_END_WARMUP_MODES = Object.freeze(['off', 'idle_180s']);
92
+ exports.STALL_MONITOR_MODES = Object.freeze(['on', 'off']);
93
+ exports.REVIEW_UPLOAD_MODES = Object.freeze(['legacy', 'deadline']);
94
+ /**
95
+ * The review-upload deadline under `deadline`. On 2026-11-19 at 17:32Z one upload from
96
+ * the Texas box hung, never reaching the API, and held the box's one upload lane for
97
+ * 35 s (the 30-s inactivity timeout, then the 5-s pause) while every camera waited for
98
+ * its answer's receipt: 40-46 s with no look on any of 7 cameras. Over the three store
99
+ * days to then (143,549 looks), a look's answer-to-receipt time, which includes any
100
+ * wait behind another upload in the lane, had a p99.9 of 2.3-3.1 s; 4-7 a day took
101
+ * over 8 s, and the longest outside that stall took 22 s.
102
+ */
103
+ exports.REVIEW_UPLOAD_DEADLINE_MS = 8000;
77
104
  exports.DEFAULT_PIPELINE_SWITCHES = Object.freeze({
78
- version: 1, capture: 'legacy', lookReuse: 'off', detectorBackend: 'ort', archive: 'legacy',
105
+ version: 1, capture: 'legacy', lookReuse: 'off', detectorBackend: 'ort', archive: 'legacy', lookDetectorDeadline: '5000',
106
+ reviewUpload: 'legacy', processPriority: 'legacy', vehicleEndWarmup: 'off', stallMonitor: 'on',
79
107
  });
80
108
  /**
81
109
  * Strictly read a `pipeline` body; null when any part is unusable (the box keeps what it has).
82
- * `archive` is the one optional key: absent (a server before it) is `legacy`.
110
+ * `archive`, `lookDetectorDeadline`, `reviewUpload`, `processPriority`, `vehicleEndWarmup` and
111
+ * `stallMonitor` are optional: absent (a server or a saved file from before them) is `legacy`,
112
+ * '5000', `legacy`, `legacy`, `off` and `on`.
83
113
  */
84
114
  function parsePipelineSwitches(raw) {
85
115
  if (!raw || typeof raw !== 'object' || Array.isArray(raw))
86
116
  return null;
87
117
  const o = raw;
88
118
  const archive = o.archive === undefined ? 'legacy' : o.archive;
119
+ const lookDetectorDeadline = o.lookDetectorDeadline === undefined ? '5000' : o.lookDetectorDeadline;
120
+ const reviewUpload = o.reviewUpload === undefined ? 'legacy' : o.reviewUpload;
121
+ const processPriority = o.processPriority === undefined ? 'legacy' : o.processPriority;
122
+ const vehicleEndWarmup = o.vehicleEndWarmup === undefined ? 'off' : o.vehicleEndWarmup;
123
+ const stallMonitor = o.stallMonitor === undefined ? 'on' : o.stallMonitor;
89
124
  if (o.version !== 1
90
125
  || !exports.CAPTURE_PIPELINES.includes(o.capture)
91
126
  || !exports.LOOK_REUSE_MODES.includes(o.lookReuse)
92
127
  || !exports.DETECTOR_BACKENDS.includes(o.detectorBackend)
93
- || !exports.ARCHIVE_MODES.includes(archive))
128
+ || !exports.ARCHIVE_MODES.includes(archive)
129
+ || !exports.LOOK_DETECTOR_DEADLINES.includes(lookDetectorDeadline)
130
+ || !exports.REVIEW_UPLOAD_MODES.includes(reviewUpload)
131
+ || !exports.PROCESS_PRIORITY_MODES.includes(processPriority)
132
+ || !exports.VEHICLE_END_WARMUP_MODES.includes(vehicleEndWarmup)
133
+ || !exports.STALL_MONITOR_MODES.includes(stallMonitor))
94
134
  return null;
95
135
  return { version: 1, capture: o.capture, lookReuse: o.lookReuse,
96
- detectorBackend: o.detectorBackend, archive: archive };
136
+ detectorBackend: o.detectorBackend, archive: archive,
137
+ lookDetectorDeadline: lookDetectorDeadline, reviewUpload: reviewUpload,
138
+ processPriority: processPriority, vehicleEndWarmup: vehicleEndWarmup,
139
+ stallMonitor: stallMonitor };
97
140
  }
98
141
  let current = { ...exports.DEFAULT_PIPELINE_SWITCHES };
99
142
  /** Where the box last saw switches, so a restart starts from them; null = not persisted. */
@@ -102,7 +145,10 @@ let fromServer = false;
102
145
  const listeners = new Set();
103
146
  function same(a, b) {
104
147
  return a.capture === b.capture && a.lookReuse === b.lookReuse && a.detectorBackend === b.detectorBackend
105
- && a.archive === b.archive;
148
+ && a.archive === b.archive && a.lookDetectorDeadline === b.lookDetectorDeadline
149
+ && a.reviewUpload === b.reviewUpload
150
+ && a.processPriority === b.processPriority && a.vehicleEndWarmup === b.vehicleEndWarmup
151
+ && a.stallMonitor === b.stallMonitor;
106
152
  }
107
153
  function announce() {
108
154
  for (const listener of [...listeners]) {
@@ -158,6 +204,31 @@ function notePipelineSwitches(raw) {
158
204
  function currentPipelineSwitches() {
159
205
  return current;
160
206
  }
207
+ /**
208
+ * The served paired-look detector deadline in ms (CCTV_LOOK_DETECTOR_DEADLINE_MS), read at
209
+ * call time: localSensing gives a paired box's look field call and the field producers it
210
+ * builds per review this bound, so a CAS reaches the next look with no rebuild.
211
+ */
212
+ function lookDetectorDeadlineMs() {
213
+ return Number(current.lookDetectorDeadline);
214
+ }
215
+ /** The wall-clock deadline a review upload takes now: REVIEW_UPLOAD_DEADLINE_MS under `deadline`, none under `legacy`. */
216
+ function reviewUploadDeadlineMs() {
217
+ return current.reviewUpload === 'deadline' ? exports.REVIEW_UPLOAD_DEADLINE_MS : undefined;
218
+ }
219
+ /**
220
+ * Review uploads this run cut at their deadline, and how the immediate resend went
221
+ * (`retryOk`: the server answered it; `retryFailed`: it failed too, and the lane took
222
+ * its ordinary 5-s pause). Box-wide; every look's trace carries them.
223
+ */
224
+ const reviewUploadCounts = { cuts: 0, retryOk: 0, retryFailed: 0 };
225
+ function noteReviewUploadCut(resend) {
226
+ reviewUploadCounts.cuts++;
227
+ if (resend === 'ok')
228
+ reviewUploadCounts.retryOk++;
229
+ else
230
+ reviewUploadCounts.retryFailed++;
231
+ }
161
232
  /** Called now with the current switches, then on every change. Returns the unsubscribe. */
162
233
  function onPipelineSwitches(listener) {
163
234
  listeners.add(listener);
@@ -200,6 +271,10 @@ let archiveStats = null;
200
271
  function bindArchiveStats(reader) {
201
272
  archiveStats = typeof reader === 'function' ? reader : null;
202
273
  }
274
+ let warmupStats = null;
275
+ function bindVehicleEndWarmupStats(reader) {
276
+ warmupStats = typeof reader === 'function' ? reader : null;
277
+ }
203
278
  const clockSamples = [];
204
279
  function noteServerClock(sentAtMs, receivedAtMs, serverNowMs) {
205
280
  if (typeof serverNowMs !== 'number' || !Number.isSafeInteger(serverNowMs) || serverNowMs <= 0)
@@ -233,20 +308,35 @@ function pipelineTrace(feedName, lookReuse) {
233
308
  }
234
309
  const clock = clockEstimate();
235
310
  let archive = null;
311
+ // CCTV_STALL_MONITOR=off also skips the per-look archive statistics (the A/B of #16475's
312
+ // legacy-path overhead): the look carries no `archive` block while it is off.
313
+ if (current.stallMonitor !== 'off') {
314
+ try {
315
+ archive = archiveStats?.() ?? null;
316
+ }
317
+ catch {
318
+ archive = null;
319
+ }
320
+ }
321
+ let vehicleEndWarmup = null;
236
322
  try {
237
- archive = archiveStats?.() ?? null;
323
+ vehicleEndWarmup = warmupStats?.() ?? null;
238
324
  }
239
325
  catch {
240
- archive = null;
326
+ vehicleEndWarmup = null;
241
327
  }
242
328
  return {
243
329
  version: 1,
244
330
  switches: { capture: current.capture, lookReuse: current.lookReuse, detectorBackend: current.detectorBackend,
245
- archive: current.archive },
331
+ archive: current.archive, lookDetectorDeadline: current.lookDetectorDeadline, reviewUpload: current.reviewUpload,
332
+ processPriority: current.processPriority, vehicleEndWarmup: current.vehicleEndWarmup,
333
+ stallMonitor: current.stallMonitor },
334
+ reviewUpload: { ...reviewUploadCounts },
246
335
  ...(capture ? { capture } : {}),
247
336
  ...(detectorSnapshot ? { detector: detectorSnapshot } : {}),
248
337
  ...(clock ? { clock } : {}),
249
338
  ...(archive ? { archive } : {}),
339
+ ...(vehicleEndWarmup ? { vehicleEndWarmup } : {}),
250
340
  ...(lookReuse && typeof lookReuse === 'object' ? { lookReuse } : {}),
251
341
  };
252
342
  }
@@ -259,6 +349,10 @@ function __resetPipelineSwitchesForTests() {
259
349
  captureListening = false;
260
350
  detectorSnapshot = null;
261
351
  archiveStats = null;
352
+ warmupStats = null;
262
353
  clockSamples.length = 0;
354
+ reviewUploadCounts.cuts = 0;
355
+ reviewUploadCounts.retryOk = 0;
356
+ reviewUploadCounts.retryFailed = 0;
263
357
  }
264
358
  //# sourceMappingURL=pipelineSwitches.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pipelineSwitches.js","sourceRoot":"","sources":["../src/pipelineSwitches.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,sDAWC;AA0BD,0DAUC;AAOD,oDAgBC;AAED,0DAEC;AAGD,gDAIC;AAWD,kDAaC;AAgBD,kDAEC;AAUD,4CAEC;AAWD,0CAOC;AAUD,sCAoBC;AAED,0EAUC;AAzQD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,uCAAyB;AACzB,2CAA6B;AA+BhB,QAAA,iBAAiB,GAC5B,M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AAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3B,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/B,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,GAAG,CAAC,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACrE,CAAC;AACJ,CAAC;AAED,SAAgB,+BAA+B;IAC7C,OAAO,GAAG,EAAE,GAAG,iCAAyB,EAAE,CAAC;IAC3C,SAAS,GAAG,IAAI,CAAC;IACjB,UAAU,GAAG,KAAK,CAAC;IACnB,SAAS,CAAC,KAAK,EAAE,CAAC;IAClB,YAAY,CAAC,KAAK,EAAE,CAAC;IACrB,gBAAgB,GAAG,KAAK,CAAC;IACzB,gBAAgB,GAAG,IAAI,CAAC;IACxB,YAAY,GAAG,IAAI,CAAC;IACpB,WAAW,GAAG,IAAI,CAAC;IACnB,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;IACxB,kBAAkB,CAAC,IAAI,GAAG,CAAC,CAAC;IAC5B,kBAAkB,CAAC,OAAO,GAAG,CAAC,CAAC;IAC/B,kBAAkB,CAAC,WAAW,GAAG,CAAC,CAAC;AACrC,CAAC"}
@@ -0,0 +1,75 @@
1
+ import { type ProcessPriorityMode } from './pipelineSwitches';
2
+ export type CpuPriorityClass = 'idle' | 'below_normal' | 'normal' | 'above_normal' | 'high' | 'realtime';
3
+ /** One process's levels: CPU class, memory priority (1-5, 5 normal), I/O priority (0-3, 2 normal). Null: unreadable. */
4
+ export interface PriorityLevels {
5
+ cpu: CpuPriorityClass | null;
6
+ memory: number | null;
7
+ io: number | null;
8
+ }
9
+ /** The connector-status beacon's `processPriority` block. */
10
+ export interface ProcessPriorityReport {
11
+ version: 1;
12
+ /** The served switch the run applied (CCTV_PROCESS_PRIORITY). */
13
+ mode: ProcessPriorityMode;
14
+ /** What the run did: read only, raised to normal, or put back the levels read before the first raise. */
15
+ action: 'read' | 'normal' | 'restore';
16
+ /** When the helper read the levels below, epoch ms (box clock). */
17
+ readAtMs: number;
18
+ /** The connector's own process, after the run. */
19
+ connector: PriorityLevels | null;
20
+ /** The process listening on the detector port, after the run; null when none listens or it could not be read. */
21
+ detector: PriorityLevels | null;
22
+ /** The lowest of each level across the connector's direct ffmpeg children, after the run; null with none. */
23
+ ffmpeg: (PriorityLevels & {
24
+ count: number;
25
+ }) | null;
26
+ /** What failed, bounded; null when every call succeeded. */
27
+ error: string | null;
28
+ }
29
+ export declare const PRIORITY_FIRST_RUN_DELAY_MS = 120000;
30
+ export declare const PRIORITY_NORMAL_INTERVAL_MS = 900000;
31
+ export declare const PRIORITY_RESTORE_RETRY_MS = 120000;
32
+ interface HelperTarget {
33
+ pid: number;
34
+ before: PriorityLevels | null;
35
+ after: PriorityLevels | null;
36
+ error: string | null;
37
+ }
38
+ interface HelperOutput {
39
+ connector: HelperTarget | null;
40
+ detector: HelperTarget | null;
41
+ ffmpeg: HelperTarget[];
42
+ errors: string[];
43
+ }
44
+ export interface ProcessPriorityDeps {
45
+ platform?: NodeJS.Platform;
46
+ /** The helper script; default `process-priority.ps1` beside node.exe, when it exists. */
47
+ scriptPath?: string | null;
48
+ connectorPid?: number;
49
+ detectorPort?: number;
50
+ /** Where the raise is remembered across connector restarts (process-priority.json); none: memory only. */
51
+ stateDir?: string | null;
52
+ /** Run the helper with these arguments and resolve its stdout (tests). */
53
+ runHelper?: (scriptPath: string, args: string[]) => Promise<string>;
54
+ now?: () => number;
55
+ setTimer?: (fn: () => void, ms: number) => unknown;
56
+ clearTimer?: (handle: unknown) => void;
57
+ subscribe?: (listener: (mode: ProcessPriorityMode) => void) => () => void;
58
+ log?: (message: string) => void;
59
+ }
60
+ /** Read the helper's one JSON line; null when it is not one. */
61
+ export declare function parseHelperOutput(stdout: string): HelperOutput | null;
62
+ /** The lowest of each level across `targets` (the beacon's ffmpeg block); null with none. */
63
+ export declare function lowestLevels(targets: Array<PriorityLevels | null>): (PriorityLevels & {
64
+ count: number;
65
+ }) | null;
66
+ /** The latest reading for the status beacon; null before the first run, or where nothing runs. */
67
+ export declare function currentProcessPriorityReport(): ProcessPriorityReport | null;
68
+ /**
69
+ * Start reading (and, under `normal`, raising) the process priorities. Once per process: a second
70
+ * start keeps the running one. Returns the stop.
71
+ */
72
+ export declare function startProcessPriority(deps?: ProcessPriorityDeps): () => void;
73
+ export declare function __resetProcessPriorityForTests(): void;
74
+ export {};
75
+ //# sourceMappingURL=processPriority.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processPriority.d.ts","sourceRoot":"","sources":["../src/processPriority.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAsB,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAElF,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,cAAc,GAAG,QAAQ,GAAG,cAAc,GAAG,MAAM,GAAG,UAAU,CAAC;AAEzG,wHAAwH;AACxH,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CACnB;AAED,6DAA6D;AAC7D,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,CAAC,CAAC;IACX,iEAAiE;IACjE,IAAI,EAAE,mBAAmB,CAAC;IAC1B,yGAAyG;IACzG,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IACtC,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,SAAS,EAAE,cAAc,GAAG,IAAI,CAAC;IACjC,iHAAiH;IACjH,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,6G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