@camstack/addon-pipeline-orchestrator 1.2.122 → 1.2.125

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/index.js CHANGED
@@ -8915,18 +8915,61 @@ var RelocateFootageInputSchema = object({
8915
8915
  * `RecordingConfig.enabled` or camera wrapper bindings. */
8916
8916
  var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
8917
8917
  var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
8918
+ /**
8919
+ * What a `relocateMedia` pass DOES. One engine, three passes — never a second
8920
+ * mover (the engine already walks both collections with a timestamp cursor and
8921
+ * already has a stamp-without-copy path).
8922
+ *
8923
+ * - `move` — the default and the historical behaviour: event-media and
8924
+ * retrain blobs move to `toLocationId` and their rows are
8925
+ * stamped. The enrolled gallery is skipped (D197).
8926
+ * - `seal` — ROWS ONLY, no bytes. Every row whose `locationId` is NULL is
8927
+ * stamped with `toLocationId`. `toLocationId` here is the id the
8928
+ * bytes ALREADY sit on — today's `eventMedia` default — because
8929
+ * a NULL row means "wherever `eventMedia` points *now*", and the
8930
+ * instant a repoint moves that pointer the row reads from the
8931
+ * new disk while its bytes are on the old one.
8932
+ * - `gallery` — the inverse selection of `move`: ONLY the retention-exempt
8933
+ * (enrolled-gallery) rows, which `move` deliberately skips.
8934
+ * `galleryMedia` is `cardinality: 'single'`, so this pass can
8935
+ * never run beside a live second location: it is stop-the-world
8936
+ * by construction, which is acceptable only because the gallery
8937
+ * is a few KB per enrolled sample.
8938
+ */
8939
+ var MediaRelocateModeSchema = _enum([
8940
+ "move",
8941
+ "seal",
8942
+ "gallery"
8943
+ ]);
8918
8944
  var RelocateMediaInputSchema = object({
8919
8945
  toLocationId: string(),
8920
- throttleMbps: number().min(1).max(1e3).optional()
8946
+ throttleMbps: number().min(1).max(1e3).optional(),
8947
+ /** Omitted = `move`, the pre-existing behaviour. */
8948
+ mode: MediaRelocateModeSchema.optional()
8949
+ });
8950
+ /** How many rows still carry NO `locationId` — the population a repoint would
8951
+ * silently re-aim at a disk that does not hold their bytes. Zero is the only
8952
+ * value that permits a non-blocking `eventMedia` cutover. */
8953
+ var UnstampedEventMediaCountSchema = object({
8954
+ media: number().int().nonnegative(),
8955
+ retrainFrames: number().int().nonnegative(),
8956
+ total: number().int().nonnegative()
8921
8957
  });
8922
8958
  var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
8923
- /** The independently selectable logical storage classes. `recordings`
8924
- * encompasses the high and mid segment profiles; `recordingsLow` is low
8925
- * segments; `eventMedia` is post-analysis blobs. */
8959
+ /** The independently selectable logical storage classes — every class
8960
+ * `storage.listLocationDeclarations` reports, so an operator never meets a
8961
+ * Zod enum error where they should meet an explanation.
8962
+ *
8963
+ * `recordings` encompasses the high and mid segment profiles; `recordingsLow`
8964
+ * is low segments; `eventMedia` is post-analysis blobs; `galleryMedia` is the
8965
+ * enrolled gallery; `backups` is the system backup archive. The last two have
8966
+ * their own rules — see {@link StorageMigrationFindingCodeSchema}. */
8926
8967
  var StorageMigrationClassSchema = _enum([
8927
8968
  "recordings",
8928
8969
  "recordingsLow",
8929
- "eventMedia"
8970
+ "eventMedia",
8971
+ "backups",
8972
+ "galleryMedia"
8930
8973
  ]);
8931
8974
  /** A destination is always an existing, fully-qualified location id. The
8932
8975
  * migration API intentionally never changes a source location's `basePath`:
@@ -8934,20 +8977,56 @@ var StorageMigrationClassSchema = _enum([
8934
8977
  var StorageMigrationDestinationsSchema = object({
8935
8978
  recordings: string().min(1).optional(),
8936
8979
  recordingsLow: string().min(1).optional(),
8937
- eventMedia: string().min(1).optional()
8980
+ eventMedia: string().min(1).optional(),
8981
+ backups: string().min(1).optional(),
8982
+ galleryMedia: string().min(1).optional()
8938
8983
  }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8984
+ /**
8985
+ * How a migration sequences the cutover against the byte move.
8986
+ *
8987
+ * - `blocking` — the historical order: pause, move every byte, repoint,
8988
+ * resume. Recording is stopped for the whole move. Right
8989
+ * for a small or a cold class, and the only legal mode for
8990
+ * a `cardinality: 'single'` class.
8991
+ * - `nonBlocking` — repoint FIRST, drain behind: seal, pause, repoint,
8992
+ * refresh, resume, then move the past with everything
8993
+ * running. The pause is three bounded instants (a detach +
8994
+ * attach round, a write-gate drain, a lease) instead of one
8995
+ * bounded by bytes. 1.09 TB at 7–14 MB/s is thirty hours of
8996
+ * stopped recording under `blocking`; the same move is
8997
+ * seconds of stopped recording under `nonBlocking`.
8998
+ *
8999
+ * The mode is on the JOB, not only on the input, because `status` is where an
9000
+ * operator finds out which one is running.
9001
+ */
9002
+ var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
8939
9003
  /** Shared input for planning and starting an orchestrated storage migration. */
8940
9004
  var StorageMigrationInputSchema = object({
8941
9005
  destinations: StorageMigrationDestinationsSchema,
8942
- throttleMbps: number().min(1).max(1e3).optional()
9006
+ throttleMbps: number().min(1).max(1e3).optional(),
9007
+ /** Omitted = `blocking`, which stays the default. */
9008
+ mode: StorageMigrationModeSchema.optional()
8943
9009
  });
8944
- /** The durable coordinator state machine. The only phase that changes default
8945
- * locations is `repointing`, after every selected mover has completed and been
8946
- * verified. */
9010
+ /**
9011
+ * The durable coordinator state machine.
9012
+ *
9013
+ * `blocking`:
9014
+ * planning → pausing → moving → verifying → repointing → refreshing → resuming → done
9015
+ *
9016
+ * `nonBlocking`:
9017
+ * planning → sealing → pausing → repointing → refreshing → resuming → draining → verifying → done
9018
+ *
9019
+ * Same phases, different order plus two new ones — not a second mover.
9020
+ * `sealing` closes the `eventMedia` NULL-row hole BEFORE anything is paused;
9021
+ * `draining` runs the same movers UNLEASED, after every writer is back up.
9022
+ * `repointing` is still the only phase that changes a default location.
9023
+ */
8947
9024
  var StorageMigrationPhaseSchema = _enum([
8948
9025
  "planning",
9026
+ "sealing",
8949
9027
  "pausing",
8950
9028
  "moving",
9029
+ "draining",
8951
9030
  "verifying",
8952
9031
  "repointing",
8953
9032
  "refreshing",
@@ -8961,17 +9040,56 @@ var StorageMigrationParticipantSchema = _enum([
8961
9040
  "recorder",
8962
9041
  "analytics"
8963
9042
  ]);
9043
+ /**
9044
+ * The mover's own numbers, folded onto the coordinator's durable move record.
9045
+ *
9046
+ * The long half of a non-blocking migration is `draining`, and it is measured
9047
+ * in hours: 136 885 files at ~4 MB/s is about five of them. Before this shape
9048
+ * existed the only place those numbers appeared was a Loki line, so an operator
9049
+ * watching the Admin UI saw `phase: draining` and nothing else for a whole
9050
+ * afternoon.
9051
+ *
9052
+ * It is POLLED, never pushed. Events are telemetry and may be dropped
9053
+ * (D8/D11), and a dropped progress event is indistinguishable from a stalled
9054
+ * mover — which is the exact failure this is meant to end. The coordinator's
9055
+ * `waitForMoves` already fetches the whole {@link RelocateJob} on every tick to
9056
+ * read `state`; folding the counters costs no extra read and makes the durable
9057
+ * record say afterwards how far a move actually got.
9058
+ *
9059
+ * `filesTotal` is `null` for "no honest denominator" and is never zero-filled:
9060
+ * a windowed footage job (`sinceMs`) and a node with no ledger both genuinely
9061
+ * cannot say M, and a 0 there would render as "100 % done".
9062
+ */
9063
+ var StorageMigrationMoveProgressSchema = object({
9064
+ filesMoved: number().int().nonnegative(),
9065
+ /** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
9066
+ filesTotal: number().int().nonnegative().nullable(),
9067
+ bytesMoved: number().int().nonnegative(),
9068
+ /** The MOVER's start, not the migration's: a drain restarted after an addon
9069
+ * crash gets a new mover, and a rate computed from the migration's start
9070
+ * would silently average in the time nothing was running. */
9071
+ startedAt: number(),
9072
+ /** When the coordinator last read these numbers. Paired with `startedAt` it
9073
+ * is the only honest rate: both clocks are the hub's, so a UI never has to
9074
+ * subtract its own. */
9075
+ observedAt: number()
9076
+ });
8964
9077
  var StorageMigrationMoveSchema = object({
8965
9078
  storageClass: StorageMigrationClassSchema,
8966
9079
  fromLocationId: string(),
8967
9080
  toLocationId: string(),
8968
9081
  moverJobId: string().nullable(),
8969
9082
  state: RelocateJobStateSchema.nullable(),
8970
- error: string().nullable()
9083
+ error: string().nullable(),
9084
+ /** Last observed mover counters; `null` until the mover has been polled once. */
9085
+ progress: StorageMigrationMoveProgressSchema.nullable()
8971
9086
  });
8972
9087
  var StorageMigrationJobSchema = object({
8973
9088
  jobId: string(),
8974
9089
  phase: StorageMigrationPhaseSchema,
9090
+ /** Which order this job is running. `status` is the only place an operator
9091
+ * can tell a seconds-long cutover from a thirty-hour one. */
9092
+ mode: StorageMigrationModeSchema,
8975
9093
  destinations: StorageMigrationDestinationsSchema,
8976
9094
  throttleMbps: number(),
8977
9095
  moves: array(StorageMigrationMoveSchema),
@@ -8984,13 +9102,122 @@ var StorageMigrationJobSchema = object({
8984
9102
  finishedAt: number().nullable(),
8985
9103
  error: string().nullable()
8986
9104
  });
9105
+ var StorageMigrationFindingSchema = object({
9106
+ code: _enum([
9107
+ "sharesDeviceWithSource",
9108
+ "deviceIdentityUnknown",
9109
+ "unstampedEventMediaRows",
9110
+ "blockingOnly",
9111
+ "noMover"
9112
+ ]),
9113
+ storageClass: StorageMigrationClassSchema,
9114
+ /** Human-readable, already carrying the ids and counts. */
9115
+ message: string()
9116
+ });
8987
9117
  var StorageMigrationPlanSchema = object({
8988
9118
  destinations: StorageMigrationDestinationsSchema,
9119
+ /** The mode this plan was built for. A plan is only valid for its mode: the
9120
+ * `eventMedia` seal gate and the single-cardinality refusal both depend on
9121
+ * it. */
9122
+ mode: StorageMigrationModeSchema,
8989
9123
  moves: array(object({
8990
9124
  storageClass: StorageMigrationClassSchema,
8991
9125
  fromLocationId: string(),
8992
9126
  toLocationId: string()
8993
- }))
9127
+ })),
9128
+ findings: array(StorageMigrationFindingSchema)
9129
+ });
9130
+ /**
9131
+ * A mover as it exists RIGHT NOW, whether or not a migration job owns it.
9132
+ *
9133
+ * The coordinator's job record is the state of record for a migration, and its
9134
+ * moves carry {@link StorageMigrationMoveProgress}. But the movers are usable
9135
+ * standalone — `recording.relocateFootage` and `pipelineAnalytics.relocateMedia`
9136
+ * are both operator-callable, and on 2026-08-29 a five-hour drain was armed that
9137
+ * way because no supported UI path existed. A mover armed like that has no job
9138
+ * to fold progress into, so it has to be readable on its own or it is invisible.
9139
+ *
9140
+ * `migrationJobId` is what tells the two apart: `null` means nothing here
9141
+ * orchestrated it.
9142
+ */
9143
+ var StorageMigrationMoverSchema = object({
9144
+ lane: _enum(["footage", "media"]),
9145
+ job: RelocateJobSchema,
9146
+ /** The coordinator job that armed this mover, or `null` for a mover armed
9147
+ * directly against the owning addon. */
9148
+ migrationJobId: string().nullable(),
9149
+ /** When the hub read these counters. Stamped here so a rate is `bytesMoved`
9150
+ * over (`observedAt` − `job.startedAt`) with BOTH ends on the hub's clock —
9151
+ * a browser subtracting its own `Date.now()` from a server `startedAt` is a
9152
+ * rate made of two different clocks. */
9153
+ observedAt: number()
9154
+ });
9155
+ /**
9156
+ * What a SOURCE still holds for one storage class — the number that makes a
9157
+ * "drain remaining" action honest rather than hopeful.
9158
+ *
9159
+ * It comes from the archive (`SegmentHourLedger.census` for footage, the media
9160
+ * engine's own selection count for media), never from the resident index: a
9161
+ * drain sized off `RecordingIndex` is what reported `done` over 80.3 GB it had
9162
+ * never been told about (D295).
9163
+ *
9164
+ * `items`/`bytes` are `null` for "the archive could not be asked", which is
9165
+ * deliberately NOT zero: a drain is still offered for an unknown residue,
9166
+ * because refusing on an unanswerable read would hide exactly the case an
9167
+ * operator needs to act on.
9168
+ */
9169
+ var StorageMigrationResidueSchema = object({
9170
+ storageClass: StorageMigrationClassSchema,
9171
+ /** The location still holding the data. `'*'` for the media lane, whose rows
9172
+ * move from wherever they are rather than from one named source. */
9173
+ fromLocationId: string(),
9174
+ /** Where a drain would move it — the class's CURRENT default. */
9175
+ toLocationId: string(),
9176
+ /** Segments (footage lane) or rows (media lane) still on the source. */
9177
+ items: number().int().nonnegative().nullable(),
9178
+ /** Bytes on the source; `null` when the lane counts rows rather than bytes. */
9179
+ bytes: number().int().nonnegative().nullable()
9180
+ });
9181
+ /**
9182
+ * Run the DRAIN half and nothing else.
9183
+ *
9184
+ * A migration that reached `done` has already repointed, so `start` correctly
9185
+ * refuses its destination ("already the default") — there is nothing left to
9186
+ * repoint. But the drain can fail, be cancelled, be interrupted by a restart,
9187
+ * or finish against a work list that was a tenth of the archive (D295), and
9188
+ * before this there was no supported way to run only that half: the only way
9189
+ * through was calling `recording.relocateFootage` by hand over admin tRPC.
9190
+ *
9191
+ * `drain` NEVER calls `setDefaultLocations`. That is what keeps `start`'s
9192
+ * refusal meaningful: the two verbs are disjoint, so nothing here can silently
9193
+ * re-repoint a class that is already migrated.
9194
+ */
9195
+ var StorageMigrationDrainInputSchema = object({
9196
+ /** The classes to drain. Each must appear in `storageMigration.residue`, so
9197
+ * a class whose source is already empty is refused rather than started. */
9198
+ classes: array(StorageMigrationClassSchema).min(1),
9199
+ throttleMbps: number().min(1).max(1e3).optional()
9200
+ });
9201
+ /** What a footage source still holds, asked of the durable hour ledger. */
9202
+ var RelocateResidueInputSchema = object({
9203
+ fromLocationId: string().min(1),
9204
+ /** Narrow to one logical class; omit for every profile on the location. */
9205
+ footageClass: RelocateFootageClassSchema.optional()
9206
+ });
9207
+ /** `null` = the archive could not answer (no ledger on this node, or the
9208
+ * aggregate failed). Never conflated with an empty source. */
9209
+ var RelocateResidueSchema = object({
9210
+ segments: number().int().nonnegative(),
9211
+ bytes: number().int().nonnegative()
9212
+ }).nullable();
9213
+ /** How many rows a media pass would still act on against a given target — the
9214
+ * media lane's denominator AND its residue, from ONE derivation so the two can
9215
+ * never disagree. `null` = the count could not be taken. */
9216
+ var RelocatableMediaCountSchema = object({ rows: number().int().nonnegative() }).nullable();
9217
+ var RelocatableMediaCountInputSchema = object({
9218
+ toLocationId: string().min(1),
9219
+ /** Omitted = `move`. */
9220
+ mode: MediaRelocateModeSchema.optional()
8994
9221
  });
8995
9222
  /**
8996
9223
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -9096,6 +9323,32 @@ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(
9096
9323
  * two addons declaring the same `id` must agree on `cardinality` (validated
9097
9324
  * at kernel aggregation time, not here).
9098
9325
  */
9326
+ /**
9327
+ * `StorageAccess` — how the service that DECLARED a storage-location kind
9328
+ * actually reaches the bytes. It is the constraint that decides which
9329
+ * `storage-provider`s may back a location of that kind.
9330
+ *
9331
+ * - `'local-path'` — the service asks `storage.resolve` for a path string and
9332
+ * then does its own `node:fs` I/O on it (the recorder's segment writer, the
9333
+ * post-analysis media roots). Only a provider that serves a genuine local
9334
+ * filesystem (`getProviderInfo().nodeLocal === true`) can satisfy that: a
9335
+ * remote provider's `resolve` returns a path on the REMOTE host, and
9336
+ * `fs.readdir` of it on this node either fails or — far worse — succeeds
9337
+ * against a same-named local directory that is something else entirely.
9338
+ *
9339
+ * - `'cap-mediated'` — every byte travels through the `storage` cap
9340
+ * (`read`/`write`, or `beginUpload`/`writeChunk`/`finalizeUpload`). The
9341
+ * service never sees a path, so any provider can back it. `backups` is the
9342
+ * one kind that qualifies today.
9343
+ *
9344
+ * Before this existed, `recordings` was unreachable by SFTP/S3/WebDAV only as
9345
+ * an EMERGENT property of how the recorder happened to be written. Nothing
9346
+ * refused the configuration; the first write simply went somewhere wrong, and
9347
+ * a recording write that goes wrong surfaces as a silent black window rather
9348
+ * than an error (the read path does not `stat`). This turns that accident into
9349
+ * a declared, enforced, testable refusal.
9350
+ */
9351
+ var StorageAccessSchema = _enum(["local-path", "cap-mediated"]);
9099
9352
  var StorageLocationDeclarationSchema = object({
9100
9353
  /**
9101
9354
  * Global location identifier, e.g. `recordings` or `recordingsLow`.
@@ -9115,6 +9368,19 @@ var StorageLocationDeclarationSchema = object({
9115
9368
  */
9116
9369
  cardinality: _enum(["single", "multi"]),
9117
9370
  /**
9371
+ * HOW the declaring service reaches the bytes — and therefore WHICH
9372
+ * providers may back a location of this kind. See {@link StorageAccessSchema}
9373
+ * and {@link STORAGE_ACCESS_FALLBACK}.
9374
+ *
9375
+ * Absent means `'local-path'`. That default is FAIL-CLOSED on purpose: it
9376
+ * can only over-restrict (refuse a remote provider for a kind that might
9377
+ * have coped) and never under-restrict. Declaring `'cap-mediated'` is the
9378
+ * permissive direction and is therefore never inferred — a repo guard
9379
+ * (`scripts/check-storage-access-declarations.ts`) refuses to let it be
9380
+ * reached by omission.
9381
+ */
9382
+ access: StorageAccessSchema.optional(),
9383
+ /**
9118
9384
  * When set, the default instance for this location inherits its resolved
9119
9385
  * root from the named location's default instance. Useful for derivative
9120
9386
  * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
@@ -18943,8 +19209,10 @@ var TrackSchema = object({
18943
19209
  lastSeen: number(),
18944
19210
  /** Frame-rate position history (subject to maxPositionHistory cap). */
18945
19211
  positions: array(TrackPositionSchema).readonly(),
18946
- /** Periodic snapshots at snapshotIntervalMs cadence (subject to
18947
- * saveThumbnails policy). */
19212
+ /** Periodic snapshots at snapshotIntervalMs cadence DEBUG media, produced
19213
+ * only while `MediaSettings.debugMediaEnabled` is on for the camera (D299;
19214
+ * the retired `saveThumbnails` used to gate this and the rolling
19215
+ * `lastFrame` together). Empty is the healthy default, not a capture gap. */
18948
19216
  snapshots: array(TrackSnapshotSchema).readonly(),
18949
19217
  /** Deduplicated zones the track has entered at least once. Zone IDS. */
18950
19218
  zonesVisited: array(string()).readonly(),
@@ -19804,6 +20072,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19804
20072
  }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
19805
20073
  kind: "mutation",
19806
20074
  auth: "admin"
20075
+ }), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
20076
+ kind: "query",
20077
+ auth: "admin"
19807
20078
  }), method(object({}), array(RelocateJobSchema).readonly(), {
19808
20079
  kind: "query",
19809
20080
  auth: "admin"
@@ -22192,7 +22463,10 @@ method(object({
22192
22463
  }), StorageLocationSchema, {
22193
22464
  kind: "mutation",
22194
22465
  auth: "admin"
22195
- }), method(object({ id: string() }), _void(), {
22466
+ }), method(object({
22467
+ id: string(),
22468
+ force: boolean().optional()
22469
+ }), _void(), {
22196
22470
  kind: "mutation",
22197
22471
  auth: "admin"
22198
22472
  }), method(object({ id: string() }), object({
@@ -22241,6 +22515,9 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
22241
22515
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
22242
22516
  kind: "mutation",
22243
22517
  auth: "admin"
22518
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
22519
+ kind: "mutation",
22520
+ auth: "admin"
22244
22521
  });
22245
22522
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
22246
22523
  providerId: string().min(1),
@@ -22639,12 +22916,38 @@ response: record(string(), unknown()) }), object({
22639
22916
  *
22640
22917
  * ## Why this is a capability and not a helper
22641
22918
  *
22642
- * Six stores in `addon-post-analysis` already hold vectors object CLIP, face,
22643
- * plate, vehicle, identity, and the event store's derivativesand every one of
22644
- * them keeps its vectors in a `JSON` settings-store column and ranks them by
22645
- * brute-force cosine in JS. Measured on the live hub that costs ~11.7 KB per row
22646
- * (512 floats as TEXT, `JSON.parse`d on every search) and made semantic search
22647
- * load 5,000 rows before ranking anything.
22919
+ * This capability was introduced with the claim that SIX stores in
22920
+ * `addon-post-analysis` held vectors in a `JSON` settings-store columnobject
22921
+ * CLIP, face, plate, vehicle, identity, and the event store's derivatives. That
22922
+ * claim was never true, and leaving it here made five stores look like pending
22923
+ * work when three of them have no vector at all. Counted column by column on
22924
+ * 2026-08-30, exactly THREE ever held one:
22925
+ *
22926
+ * - `object-clip` — 512-dim CLIP image embedding, migrated 2026-08-06.
22927
+ * - `faces.embedding` — 512-dim ArcFace face embedding, migrated 2026-08-30.
22928
+ * - `identity-samples.embedding` — the same ArcFace vector for an ENROLLED
22929
+ * face, migrated 2026-08-30 into its OWN index (see below).
22930
+ *
22931
+ * `plates` and `vehicle-samples` store a plate STRING and a score; `vehicles`
22932
+ * and `identities` store a name; the event store stores no derivative vector.
22933
+ * They are not migration candidates and never were.
22934
+ *
22935
+ * Measured on the live hub the JSON encoding cost ~11.7 KB per row (512 floats
22936
+ * as TEXT, `JSON.parse`d on every search) and made semantic search load 5,000
22937
+ * rows before ranking anything.
22938
+ *
22939
+ * ## One index per COMPARISON, never per encoder
22940
+ *
22941
+ * `faces` and `identity-samples` hold the same 512 ArcFace dims from the same
22942
+ * model, and they still get two indexes. An index is a set of things that are
22943
+ * ranked against each other and that live and die together, and these two are
22944
+ * neither: a `faces` row is TRACK-OWNED and cascades away with its track under
22945
+ * a per-camera capacity cap, an `identity-samples` row is retention-EXEMPT
22946
+ * forever and is the gallery every recognition ranks against. One index would
22947
+ * mean every gallery load and every reconcile carried a filter whose failure
22948
+ * mode is either ranking a candidate against itself or reclaiming an enrolled
22949
+ * person's only sample. The dimension they share is not a reason to share an
22950
+ * index; the question they answer is, and it differs.
22648
22951
  *
22649
22952
  * The fix is not a faster loop, it is a different backend — and the backend
22650
22953
  * should be replaceable without touching six callers. So: a singleton
@@ -22749,7 +23052,20 @@ var VectorQueryResultSchema = object({
22749
23052
  */
22750
23053
  scanned: number(),
22751
23054
  /** True when the backend could not consider every row that passed the filter. */
22752
- truncated: boolean()
23055
+ truncated: boolean(),
23056
+ /**
23057
+ * The `topK` the backend actually ran with.
23058
+ *
23059
+ * Every backend has a ceiling — sqlite-vec's is 4,096 — and a caller asking
23060
+ * past it used to learn nothing but a boolean, from a WARN in the provider's
23061
+ * own log rather than in its answer. That is how an audit asking for 20,000
23062
+ * consumed 4,096 and reported `examined: 4096` as if it had walked the index,
23063
+ * for weeks. `truncated` says THAT the answer was short; this says BY HOW
23064
+ * MUCH, in the return value, where the caller cannot fail to see it.
23065
+ *
23066
+ * Equals the requested `topK` whenever nothing was lowered.
23067
+ */
23068
+ effectiveTopK: number().int().positive()
22753
23069
  });
22754
23070
  var VectorDeleteInputSchema = object({
22755
23071
  index: string(),
@@ -22778,6 +23094,68 @@ var VectorGetResultSchema = object({ items: array(object({
22778
23094
  id: string(),
22779
23095
  metadata: VectorMetadataSchema
22780
23096
  })) });
23097
+ /**
23098
+ * Ids to read back WITH their vectors.
23099
+ *
23100
+ * The sibling of {@link VectorGetResultSchema}, and deliberately a separate
23101
+ * method rather than a flag on it: `getByIds` promises no vectors and its one
23102
+ * caller depends on that promise. This one promises the opposite.
23103
+ *
23104
+ * It exists because a store cannot put its vectors here otherwise. An ArcFace
23105
+ * gallery is ranked IN PROCESS, per detection, against every enrolled sample —
23106
+ * a per-face cross-process KNN would be a network round trip inside the
23107
+ * recognition loop. So the gallery is loaded once and held in RAM, and loading
23108
+ * it requires the index to hand the floats back. Without this method the only
23109
+ * way to keep a readable vector is a JSON column, which is the thing this
23110
+ * capability exists to delete.
23111
+ *
23112
+ * BOUNDED BY THE CALLER: ids are named, never "everything". Enumerating an
23113
+ * index is {@link VectorScanInputSchema}'s job, and it returns no vectors.
23114
+ */
23115
+ var VectorFetchInputSchema = object({
23116
+ index: string(),
23117
+ ids: array(string())
23118
+ });
23119
+ var VectorFetchResultSchema = object({ items: array(object({
23120
+ id: string(),
23121
+ /** base64 Float32LE — the same wire form `upsert` accepts. */
23122
+ vector: string(),
23123
+ metadata: VectorMetadataSchema
23124
+ })) });
23125
+ /**
23126
+ * ENUMERATE an index: one page of rows in a stable order, no ranking.
23127
+ *
23128
+ * A reconcile does not want the nearest rows, it wants ALL of them, and asking
23129
+ * a KNN for "all" is the wrong question twice over. It hits the backend's `k`
23130
+ * ceiling — 4,096 on sqlite-vec against a 22,128-row index — and it needs a
23131
+ * probe vector it does not have, so the audit passed a ZERO vector whose cosine
23132
+ * distance to every row is degenerate. `examined: 4096` then read as "we
23133
+ * looked" for as long as anyone cared to read it.
23134
+ *
23135
+ * This is the primitive that question actually needs: a bounded page, ordered
23136
+ * by the backend's own row order, costing no distance computation at all.
23137
+ * Vectors are NOT returned — an enumeration that shipped 2 KB per row would be
23138
+ * the full-table read this capability was built to stop.
23139
+ */
23140
+ var VectorScanInputSchema = object({
23141
+ index: string(),
23142
+ /** Opaque resume point. `0` starts at the top; pass back `nextCursor`. */
23143
+ cursor: number().int().nonnegative().default(0),
23144
+ limit: number().int().positive()
23145
+ });
23146
+ var VectorScanResultSchema = object({
23147
+ items: array(object({
23148
+ id: string(),
23149
+ metadata: VectorMetadataSchema
23150
+ })),
23151
+ /**
23152
+ * Where the next page starts, or `null` when the walk reached the end.
23153
+ *
23154
+ * `null` is the ONLY end-of-index signal. A caller must not infer the end
23155
+ * from a short page: a backend is free to return fewer rows than asked.
23156
+ */
23157
+ nextCursor: number().int().nonnegative().nullable()
23158
+ });
22781
23159
  var VectorStatsInputSchema = object({ index: string() });
22782
23160
  var VectorStatsResultSchema = object({
22783
23161
  /** Provider id, so an operator can tell brute force from an ANN index. */
@@ -22796,7 +23174,7 @@ method(VectorDeclareIndexInputSchema, _void(), {
22796
23174
  }), method(VectorUpsertInputSchema, VectorUpsertResultSchema, {
22797
23175
  kind: "mutation",
22798
23176
  auth: "admin"
22799
- }), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
23177
+ }), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorFetchInputSchema, VectorFetchResultSchema, { auth: "admin" }), method(VectorScanInputSchema, VectorScanResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
22800
23178
  kind: "mutation",
22801
23179
  auth: "admin"
22802
23180
  }), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, {
@@ -27700,6 +28078,9 @@ method(object({
27700
28078
  }), method(object({}), array(RelocateJobSchema).readonly(), {
27701
28079
  kind: "query",
27702
28080
  auth: "admin"
28081
+ }), method(RelocateResidueInputSchema, RelocateResidueSchema, {
28082
+ kind: "query",
28083
+ auth: "admin"
27703
28084
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
27704
28085
  kind: "mutation",
27705
28086
  auth: "admin"
@@ -32749,6 +33130,18 @@ Object.freeze({
32749
33130
  addonId: null,
32750
33131
  access: "create"
32751
33132
  },
33133
+ "pipelineAnalytics.countRelocatableMedia": {
33134
+ capName: "pipeline-analytics",
33135
+ capScope: "device",
33136
+ addonId: null,
33137
+ access: "view"
33138
+ },
33139
+ "pipelineAnalytics.countUnstampedEventMedia": {
33140
+ capName: "pipeline-analytics",
33141
+ capScope: "device",
33142
+ addonId: null,
33143
+ access: "view"
33144
+ },
32752
33145
  "pipelineAnalytics.deleteDeviceEvents": {
32753
33146
  capName: "pipeline-analytics",
32754
33147
  capScope: "device",
@@ -33907,6 +34300,12 @@ Object.freeze({
33907
34300
  addonId: null,
33908
34301
  access: "view"
33909
34302
  },
34303
+ "recording.getRelocateResidue": {
34304
+ capName: "recording",
34305
+ capScope: "system",
34306
+ addonId: null,
34307
+ access: "view"
34308
+ },
33910
34309
  "recording.getStorageMigrationMoveStatus": {
33911
34310
  capName: "recording",
33912
34311
  capScope: "system",
@@ -34453,12 +34852,30 @@ Object.freeze({
34453
34852
  addonId: null,
34454
34853
  access: "create"
34455
34854
  },
34855
+ "storageMigration.drain": {
34856
+ capName: "storage-migration",
34857
+ capScope: "system",
34858
+ addonId: null,
34859
+ access: "create"
34860
+ },
34861
+ "storageMigration.movers": {
34862
+ capName: "storage-migration",
34863
+ capScope: "system",
34864
+ addonId: null,
34865
+ access: "view"
34866
+ },
34456
34867
  "storageMigration.plan": {
34457
34868
  capName: "storage-migration",
34458
34869
  capScope: "system",
34459
34870
  addonId: null,
34460
34871
  access: "view"
34461
34872
  },
34873
+ "storageMigration.residue": {
34874
+ capName: "storage-migration",
34875
+ capScope: "system",
34876
+ addonId: null,
34877
+ access: "view"
34878
+ },
34462
34879
  "storageMigration.start": {
34463
34880
  capName: "storage-migration",
34464
34881
  capScope: "system",
@@ -35293,6 +35710,12 @@ Object.freeze({
35293
35710
  addonId: null,
35294
35711
  access: "delete"
35295
35712
  },
35713
+ "vectorStore.fetchByIds": {
35714
+ capName: "vector-store",
35715
+ capScope: "system",
35716
+ addonId: null,
35717
+ access: "view"
35718
+ },
35296
35719
  "vectorStore.getByIds": {
35297
35720
  capName: "vector-store",
35298
35721
  capScope: "system",
@@ -35305,6 +35728,12 @@ Object.freeze({
35305
35728
  addonId: null,
35306
35729
  access: "view"
35307
35730
  },
35731
+ "vectorStore.scan": {
35732
+ capName: "vector-store",
35733
+ capScope: "system",
35734
+ addonId: null,
35735
+ access: "view"
35736
+ },
35308
35737
  "vectorStore.stats": {
35309
35738
  capName: "vector-store",
35310
35739
  capScope: "system",