@camstack/types 1.2.168 → 1.2.170

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.
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Debug-note archive — the durable corpus of what operators asked to be
3
+ * checked, and the ONE thing about a debug note that outlives its track.
4
+ *
5
+ * D353 bound `debugNote` to the `debug` flag: turning the flag off clears the
6
+ * note in the same statement, so a track can never present a question without
7
+ * the flag that explains it. That invariant is right and stays. Its side
8
+ * effect was not: the act of REVIEWING a debug set destroyed every note in it,
9
+ * and the notes that survived a sweep aged out with their tracks anyway. On
10
+ * 2026-09-08 the notes from one morning's review — 25 to 27 of them — were
11
+ * already unreadable by the afternoon, leaving 11.
12
+ *
13
+ * So the clear now ARCHIVES first (D405). A row here is:
14
+ *
15
+ * - written ONLY by the hub, from `applyTrackFlags`, immediately before the
16
+ * note is cleared off the track row;
17
+ * - keyed by ITS OWN id, derived from `(sourceTrackId, note)` so reviewing
18
+ * the same track twice cannot double the corpus;
19
+ * - NOT a track row, NOT subject to track retention, and NOT a durability pin
20
+ * on anything — the track it names is expected to be gone.
21
+ *
22
+ * `sourceTrackId` is deliberately not called `trackId`. The analytics
23
+ * retention model derives track OWNERSHIP from a declared `trackId` column
24
+ * (`collection-classification.ts`), and a row that the cascade would delete
25
+ * with its track is exactly the row this table exists to keep. The name says
26
+ * PROVENANCE — the same distinction the stationary registry draws for the same
27
+ * reason.
28
+ */
29
+ import { z } from 'zod';
30
+ /**
31
+ * How many archived notes the cluster keeps, across every camera.
32
+ *
33
+ * GLOBAL, not per-device, and a COUNT, not an age. Both halves are deliberate:
34
+ *
35
+ * - A per-device bound multiplies by the fleet — 30 cameras at 500 each is
36
+ * 15 000 rows to protect a corpus that only ever gets read fleet-wide (the
37
+ * thing being mined is "what keeps going wrong", not "what goes wrong on
38
+ * 617"). One global ceiling is one number to reason about.
39
+ * - An AGE bound would delete the corpus for being old, which is the failure
40
+ * being fixed: a note from six months ago is the most valuable row in the
41
+ * table precisely because the pattern it describes has had time to repeat.
42
+ *
43
+ * The number is sized off the measured rate. The 2026-09-08 sweep produced
44
+ * 25–27 notes; call a heavy day 100. 5 000 rows is roughly fifty such days,
45
+ * and at the observed rate (a few sweeps a week) several years. The cost is
46
+ * bounded by construction: a note is capped at `MAX_TRACK_DEBUG_NOTE_LEN`
47
+ * (500 chars) and the metadata beside it is under 100 bytes, so the ceiling is
48
+ * ~3 MB of text and the realistic occupancy is well under 1 MB — against a
49
+ * `tracks` table measured at 4.6 MB for a single 501-row page.
50
+ */
51
+ export declare const MAX_ARCHIVED_DEBUG_NOTES = 5000;
52
+ /** Default page size for `listArchivedDebugNotes` when the caller omits one. */
53
+ export declare const ARCHIVED_DEBUG_NOTES_DEFAULT_LIMIT = 200;
54
+ /** One archived note — the operator's words plus enough context to find what
55
+ * they were looking at, after the track itself is gone. */
56
+ export declare const ArchivedDebugNoteSchema: z.ZodObject<{
57
+ id: z.ZodString;
58
+ note: z.ZodString;
59
+ deviceId: z.ZodNumber;
60
+ sourceTrackId: z.ZodString;
61
+ archivedAt: z.ZodNumber;
62
+ trackStartedAt: z.ZodNullable<z.ZodNumber>;
63
+ trackClass: z.ZodNullable<z.ZodString>;
64
+ trackLabel: z.ZodNullable<z.ZodString>;
65
+ }, z.core.$strip>;
66
+ export type ArchivedDebugNote = z.infer<typeof ArchivedDebugNoteSchema>;
67
+ /** Query input for `listArchivedDebugNotes` — newest first, one camera or all. */
68
+ export declare const ArchivedDebugNoteQueryInputSchema: z.ZodObject<{
69
+ deviceId: z.ZodOptional<z.ZodNumber>;
70
+ limit: z.ZodOptional<z.ZodNumber>;
71
+ }, z.core.$strip>;
72
+ export type ArchivedDebugNoteQueryInput = z.infer<typeof ArchivedDebugNoteQueryInputSchema>;
@@ -255,8 +255,15 @@ export interface PipelineAnalyticsPlateGalleryChangedPayload {
255
255
  * Emitted by `addon-post-analysis` when a package-drop is confirmed — a
256
256
  * newly-appeared stationary object of a package class that cleared the
257
257
  * class / zone / dwell / size gates inside a package zone. Telemetry (D8):
258
- * the durable record is the `package-events` store row; this drives
259
- * notifier rules + live UI. See
258
+ * the durable record is the `package-events` store row.
259
+ *
260
+ * It drives NOTHING today — swept 2026-09-08, this payload and its
261
+ * `…PackedUp` sibling have no subscriber anywhere in `packages/`, `server/`,
262
+ * `camstack/` or `scripts/`. The notification path is the persist hook
263
+ * (`pipeline-analytics/index.ts` → `notificationCenter.onPackageEventPersisted`),
264
+ * not this event. The previous sentence here claimed it drove notifier rules
265
+ * and the live UI, which read as verification of a wiring that does not
266
+ * exist. See
260
267
  * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
261
268
  */
262
269
  export interface PipelineAnalyticsPackageDeliveredPayload {
@@ -290,6 +297,14 @@ export interface PipelineAnalyticsPackagePickedUpPayload {
290
297
  /** The `package-events` delivery row this pick-up pairs to. */
291
298
  readonly deliveredEventId: string;
292
299
  readonly className: string;
300
+ /**
301
+ * The track of the PERSON who collected the parcel, when one was resolved
302
+ * (D404). It is also the pick-up row's media owner, which is what puts a
303
+ * frame of the collector — rather than of the empty doormat — on the
304
+ * notification. Absent means nobody qualified near the parcel's last
305
+ * sighting; the pick-up still fires, carrying the parcel's own owner.
306
+ */
307
+ readonly collectorTrackId?: string;
293
308
  readonly timestamp: number;
294
309
  readonly [key: string]: unknown;
295
310
  }
@@ -3518,6 +3518,7 @@ function createDeviceProxy(api, binding, opts) {
3518
3518
  reconcileFromDisk: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "reconcileFromDisk", "mutation", input),
3519
3519
  deleteTracks: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "deleteTracks", "mutation", input),
3520
3520
  setTrackFlags: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "setTrackFlags", "mutation", input),
3521
+ listArchivedDebugNotes: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "listArchivedDebugNotes", "query", input),
3521
3522
  getEventStoreFootprint: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getEventStoreFootprint", "query", input),
3522
3523
  getEventMediaFootprintByKind: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getEventMediaFootprintByKind", "query", input),
3523
3524
  pruneEvents: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "pruneEvents", "mutation", input),
@@ -3518,6 +3518,7 @@ function createDeviceProxy(api, binding, opts) {
3518
3518
  reconcileFromDisk: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "reconcileFromDisk", "mutation", input),
3519
3519
  deleteTracks: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "deleteTracks", "mutation", input),
3520
3520
  setTrackFlags: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "setTrackFlags", "mutation", input),
3521
+ listArchivedDebugNotes: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "listArchivedDebugNotes", "query", input),
3521
3522
  getEventStoreFootprint: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getEventStoreFootprint", "query", input),
3522
3523
  getEventMediaFootprintByKind: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getEventMediaFootprintByKind", "query", input),
3523
3524
  pruneEvents: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "pruneEvents", "mutation", input),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.168",
3
+ "version": "1.2.170",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",