@camstack/addon-provider-rtsp 1.2.46 → 1.2.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +259 -174
- package/dist/addon.mjs +259 -174
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -13240,6 +13240,114 @@ method(object({
|
|
|
13240
13240
|
height: number()
|
|
13241
13241
|
}), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
|
|
13242
13242
|
/**
|
|
13243
|
+
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
13244
|
+
* through, per camera, with the denominator attached. It stores nothing.
|
|
13245
|
+
*
|
|
13246
|
+
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13247
|
+
*
|
|
13248
|
+
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13249
|
+
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13250
|
+
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13251
|
+
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13252
|
+
* somebody to forget to edit.
|
|
13253
|
+
*
|
|
13254
|
+
* They are not merged, because their invariants are opposites:
|
|
13255
|
+
*
|
|
13256
|
+
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13257
|
+
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13258
|
+
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13259
|
+
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13260
|
+
* and it is exactly what an absent entry cannot say.
|
|
13261
|
+
*
|
|
13262
|
+
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13263
|
+
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13264
|
+
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13265
|
+
* has no process.
|
|
13266
|
+
*
|
|
13267
|
+
* ## Why not a log line, since the counters already exist
|
|
13268
|
+
*
|
|
13269
|
+
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13270
|
+
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13271
|
+
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13272
|
+
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13273
|
+
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13274
|
+
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13275
|
+
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13276
|
+
* be READ.
|
|
13277
|
+
*
|
|
13278
|
+
* ## The rate is served with its denominator or not at all
|
|
13279
|
+
*
|
|
13280
|
+
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13281
|
+
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13282
|
+
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13283
|
+
* successes on the same path. A surface that publishes only the numerator
|
|
13284
|
+
* reproduces that mistake on every read.
|
|
13285
|
+
*
|
|
13286
|
+
* ## Shape
|
|
13287
|
+
*
|
|
13288
|
+
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13289
|
+
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13290
|
+
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13291
|
+
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13292
|
+
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13293
|
+
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13294
|
+
* result through `system.getFailureContributions`.
|
|
13295
|
+
*/
|
|
13296
|
+
var FailureReasonCountSchema = object({
|
|
13297
|
+
/**
|
|
13298
|
+
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13299
|
+
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13300
|
+
* strings that already appear in this repo's logs and, where one exists, the
|
|
13301
|
+
* same string the per-track `previewMissReason` records (D276): a second
|
|
13302
|
+
* vocabulary for the same loss would make the row and the counter
|
|
13303
|
+
* un-joinable.
|
|
13304
|
+
*/
|
|
13305
|
+
reason: string(),
|
|
13306
|
+
count: number().int().nonnegative()
|
|
13307
|
+
});
|
|
13308
|
+
var FailureContributionSchema = object({
|
|
13309
|
+
/**
|
|
13310
|
+
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13311
|
+
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13312
|
+
* `unit` free: the families are owned by different addons and a shared enum
|
|
13313
|
+
* is a central list that rots invisibly.
|
|
13314
|
+
*/
|
|
13315
|
+
family: string(),
|
|
13316
|
+
/**
|
|
13317
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13318
|
+
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13319
|
+
* cannot name the camera must not emit the entry, because a fleet total
|
|
13320
|
+
* cannot answer the only question anybody asks of this surface.
|
|
13321
|
+
*/
|
|
13322
|
+
deviceId: number().int().positive(),
|
|
13323
|
+
/**
|
|
13324
|
+
* A second dimension inside the family: the model / step id for an inference
|
|
13325
|
+
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13326
|
+
* family has a single variant.
|
|
13327
|
+
*/
|
|
13328
|
+
variant: string().optional(),
|
|
13329
|
+
/**
|
|
13330
|
+
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13331
|
+
* differencing two reads must drop the interval when it changes, because the
|
|
13332
|
+
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13333
|
+
* `LoadContribution.startedAtMs`.
|
|
13334
|
+
*/
|
|
13335
|
+
sinceMs: number(),
|
|
13336
|
+
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13337
|
+
atMs: number(),
|
|
13338
|
+
/**
|
|
13339
|
+
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13340
|
+
* window. A failure count published without it is the mistake this schema
|
|
13341
|
+
* exists to make impossible.
|
|
13342
|
+
*/
|
|
13343
|
+
attempts: number().int().nonnegative(),
|
|
13344
|
+
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13345
|
+
succeeded: number().int().nonnegative(),
|
|
13346
|
+
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13347
|
+
reasons: array(FailureReasonCountSchema).readonly()
|
|
13348
|
+
});
|
|
13349
|
+
method(_void(), array(FailureContributionSchema).readonly());
|
|
13350
|
+
/**
|
|
13243
13351
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
13244
13352
|
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
13245
13353
|
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
@@ -13761,6 +13869,68 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13761
13869
|
kind: "mutation",
|
|
13762
13870
|
auth: "admin"
|
|
13763
13871
|
});
|
|
13872
|
+
var LoadContributionSchema = object({
|
|
13873
|
+
role: _enum([
|
|
13874
|
+
"decode",
|
|
13875
|
+
"transcode",
|
|
13876
|
+
"recording",
|
|
13877
|
+
"streaming",
|
|
13878
|
+
"detection"
|
|
13879
|
+
]),
|
|
13880
|
+
/**
|
|
13881
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13882
|
+
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
13883
|
+
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
13884
|
+
* contributor that cannot name its camera must not emit the entry at all,
|
|
13885
|
+
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
13886
|
+
* and would quietly turn one camera's cost into everybody's.
|
|
13887
|
+
*/
|
|
13888
|
+
deviceId: number().int().positive().nullable(),
|
|
13889
|
+
attribution: _enum([
|
|
13890
|
+
"measured",
|
|
13891
|
+
"accounted",
|
|
13892
|
+
"unattributable"
|
|
13893
|
+
]),
|
|
13894
|
+
/**
|
|
13895
|
+
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
13896
|
+
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
13897
|
+
* family and inventing a common one would lose the only information that
|
|
13898
|
+
* makes two entries for the same camera distinguishable.
|
|
13899
|
+
*/
|
|
13900
|
+
unit: string(),
|
|
13901
|
+
/**
|
|
13902
|
+
* The OS process this cost lives in, when there is one. Present so a
|
|
13903
|
+
* consumer can (a) tell two generations of the same unit apart across a
|
|
13904
|
+
* restart, and (b) subtract claimed processes from the node's process
|
|
13905
|
+
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
13906
|
+
* process of its own.
|
|
13907
|
+
*/
|
|
13908
|
+
pid: number().int().positive().optional(),
|
|
13909
|
+
/**
|
|
13910
|
+
* When this generation started. The pid's incarnation marker: a consumer
|
|
13911
|
+
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
13912
|
+
* window when this changes, because the counter restarted from zero in a new
|
|
13913
|
+
* process.
|
|
13914
|
+
*/
|
|
13915
|
+
startedAtMs: number().optional(),
|
|
13916
|
+
/**
|
|
13917
|
+
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
13918
|
+
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
13919
|
+
* contribution is asked for.
|
|
13920
|
+
*
|
|
13921
|
+
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
13922
|
+
* needs a sampler, and a new per-node sampler is the defect half of
|
|
13923
|
+
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
13924
|
+
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
13925
|
+
*
|
|
13926
|
+
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
13927
|
+
* an entry with no process.
|
|
13928
|
+
*/
|
|
13929
|
+
cpuSeconds: number().optional(),
|
|
13930
|
+
/** Resident bytes of this unit's process, same source and same rules. */
|
|
13931
|
+
rssBytes: number().optional()
|
|
13932
|
+
});
|
|
13933
|
+
method(_void(), array(LoadContributionSchema).readonly());
|
|
13764
13934
|
/**
|
|
13765
13935
|
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13766
13936
|
* through. It stores nothing.
|
|
@@ -13837,176 +14007,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
13837
14007
|
tags: record(string(), string()).optional()
|
|
13838
14008
|
}), array(LogEntrySchema).readonly());
|
|
13839
14009
|
/**
|
|
13840
|
-
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
13841
|
-
* through, per camera, with the denominator attached. It stores nothing.
|
|
13842
|
-
*
|
|
13843
|
-
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13844
|
-
*
|
|
13845
|
-
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13846
|
-
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13847
|
-
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13848
|
-
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13849
|
-
* somebody to forget to edit.
|
|
13850
|
-
*
|
|
13851
|
-
* They are not merged, because their invariants are opposites:
|
|
13852
|
-
*
|
|
13853
|
-
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13854
|
-
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13855
|
-
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13856
|
-
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13857
|
-
* and it is exactly what an absent entry cannot say.
|
|
13858
|
-
*
|
|
13859
|
-
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13860
|
-
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13861
|
-
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13862
|
-
* has no process.
|
|
13863
|
-
*
|
|
13864
|
-
* ## Why not a log line, since the counters already exist
|
|
13865
|
-
*
|
|
13866
|
-
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13867
|
-
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13868
|
-
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13869
|
-
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13870
|
-
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13871
|
-
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13872
|
-
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13873
|
-
* be READ.
|
|
13874
|
-
*
|
|
13875
|
-
* ## The rate is served with its denominator or not at all
|
|
13876
|
-
*
|
|
13877
|
-
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13878
|
-
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13879
|
-
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13880
|
-
* successes on the same path. A surface that publishes only the numerator
|
|
13881
|
-
* reproduces that mistake on every read.
|
|
13882
|
-
*
|
|
13883
|
-
* ## Shape
|
|
13884
|
-
*
|
|
13885
|
-
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13886
|
-
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13887
|
-
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13888
|
-
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13889
|
-
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13890
|
-
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13891
|
-
* result through `system.getFailureContributions`.
|
|
13892
|
-
*/
|
|
13893
|
-
var FailureReasonCountSchema = object({
|
|
13894
|
-
/**
|
|
13895
|
-
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13896
|
-
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13897
|
-
* strings that already appear in this repo's logs and, where one exists, the
|
|
13898
|
-
* same string the per-track `previewMissReason` records (D276): a second
|
|
13899
|
-
* vocabulary for the same loss would make the row and the counter
|
|
13900
|
-
* un-joinable.
|
|
13901
|
-
*/
|
|
13902
|
-
reason: string(),
|
|
13903
|
-
count: number().int().nonnegative()
|
|
13904
|
-
});
|
|
13905
|
-
var FailureContributionSchema = object({
|
|
13906
|
-
/**
|
|
13907
|
-
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13908
|
-
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13909
|
-
* `unit` free: the families are owned by different addons and a shared enum
|
|
13910
|
-
* is a central list that rots invisibly.
|
|
13911
|
-
*/
|
|
13912
|
-
family: string(),
|
|
13913
|
-
/**
|
|
13914
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
13915
|
-
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13916
|
-
* cannot name the camera must not emit the entry, because a fleet total
|
|
13917
|
-
* cannot answer the only question anybody asks of this surface.
|
|
13918
|
-
*/
|
|
13919
|
-
deviceId: number().int().positive(),
|
|
13920
|
-
/**
|
|
13921
|
-
* A second dimension inside the family: the model / step id for an inference
|
|
13922
|
-
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13923
|
-
* family has a single variant.
|
|
13924
|
-
*/
|
|
13925
|
-
variant: string().optional(),
|
|
13926
|
-
/**
|
|
13927
|
-
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13928
|
-
* differencing two reads must drop the interval when it changes, because the
|
|
13929
|
-
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13930
|
-
* `LoadContribution.startedAtMs`.
|
|
13931
|
-
*/
|
|
13932
|
-
sinceMs: number(),
|
|
13933
|
-
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13934
|
-
atMs: number(),
|
|
13935
|
-
/**
|
|
13936
|
-
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13937
|
-
* window. A failure count published without it is the mistake this schema
|
|
13938
|
-
* exists to make impossible.
|
|
13939
|
-
*/
|
|
13940
|
-
attempts: number().int().nonnegative(),
|
|
13941
|
-
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13942
|
-
succeeded: number().int().nonnegative(),
|
|
13943
|
-
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13944
|
-
reasons: array(FailureReasonCountSchema).readonly()
|
|
13945
|
-
});
|
|
13946
|
-
method(_void(), array(FailureContributionSchema).readonly());
|
|
13947
|
-
var LoadContributionSchema = object({
|
|
13948
|
-
role: _enum([
|
|
13949
|
-
"decode",
|
|
13950
|
-
"transcode",
|
|
13951
|
-
"recording",
|
|
13952
|
-
"streaming",
|
|
13953
|
-
"detection"
|
|
13954
|
-
]),
|
|
13955
|
-
/**
|
|
13956
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
13957
|
-
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
13958
|
-
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
13959
|
-
* contributor that cannot name its camera must not emit the entry at all,
|
|
13960
|
-
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
13961
|
-
* and would quietly turn one camera's cost into everybody's.
|
|
13962
|
-
*/
|
|
13963
|
-
deviceId: number().int().positive().nullable(),
|
|
13964
|
-
attribution: _enum([
|
|
13965
|
-
"measured",
|
|
13966
|
-
"accounted",
|
|
13967
|
-
"unattributable"
|
|
13968
|
-
]),
|
|
13969
|
-
/**
|
|
13970
|
-
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
13971
|
-
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
13972
|
-
* family and inventing a common one would lose the only information that
|
|
13973
|
-
* makes two entries for the same camera distinguishable.
|
|
13974
|
-
*/
|
|
13975
|
-
unit: string(),
|
|
13976
|
-
/**
|
|
13977
|
-
* The OS process this cost lives in, when there is one. Present so a
|
|
13978
|
-
* consumer can (a) tell two generations of the same unit apart across a
|
|
13979
|
-
* restart, and (b) subtract claimed processes from the node's process
|
|
13980
|
-
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
13981
|
-
* process of its own.
|
|
13982
|
-
*/
|
|
13983
|
-
pid: number().int().positive().optional(),
|
|
13984
|
-
/**
|
|
13985
|
-
* When this generation started. The pid's incarnation marker: a consumer
|
|
13986
|
-
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
13987
|
-
* window when this changes, because the counter restarted from zero in a new
|
|
13988
|
-
* process.
|
|
13989
|
-
*/
|
|
13990
|
-
startedAtMs: number().optional(),
|
|
13991
|
-
/**
|
|
13992
|
-
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
13993
|
-
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
13994
|
-
* contribution is asked for.
|
|
13995
|
-
*
|
|
13996
|
-
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
13997
|
-
* needs a sampler, and a new per-node sampler is the defect half of
|
|
13998
|
-
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
13999
|
-
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
14000
|
-
*
|
|
14001
|
-
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
14002
|
-
* an entry with no process.
|
|
14003
|
-
*/
|
|
14004
|
-
cpuSeconds: number().optional(),
|
|
14005
|
-
/** Resident bytes of this unit's process, same source and same rules. */
|
|
14006
|
-
rssBytes: number().optional()
|
|
14007
|
-
});
|
|
14008
|
-
method(_void(), array(LoadContributionSchema).readonly());
|
|
14009
|
-
/**
|
|
14010
14010
|
* `login-method` — collection cap through which auth addons contribute
|
|
14011
14011
|
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
14012
14012
|
* generic mechanism that supersedes the dead `auth.listProviders` reader:
|
|
@@ -18744,12 +18744,53 @@ var MediaFileKindEnum = _enum([
|
|
|
18744
18744
|
"keyFrameSmall",
|
|
18745
18745
|
"thumbnailSmall"
|
|
18746
18746
|
]);
|
|
18747
|
+
/**
|
|
18748
|
+
* One media row ON THE WIRE: what it is, how big it is, and WHERE ITS BYTES
|
|
18749
|
+
* ARE — never the bytes themselves.
|
|
18750
|
+
*
|
|
18751
|
+
* ## Why `url` and not `base64`
|
|
18752
|
+
*
|
|
18753
|
+
* Measured on the live hub 2026-08-30: `getTrackMedia {trackId, deviceId}`
|
|
18754
|
+
* with no `kinds` returned 6 rows / **3 597 219 B**, of which `keyFrame` alone
|
|
18755
|
+
* was **2 824 077 B** — one full-resolution frame, base64, so +33 % on the
|
|
18756
|
+
* wire. Forty events is ~144 MB. Every byte of it was read off disk,
|
|
18757
|
+
* base64-encoded, held whole in a unary tRPC envelope, and materialised in
|
|
18758
|
+
* hub-main's heap on the way past — for an `<img>` that would have cached it.
|
|
18759
|
+
*
|
|
18760
|
+
* `url` points at the `event-media` data plane
|
|
18761
|
+
* (`/addon/<addonId>/event-media/<storedKey>`), which serves the same blob
|
|
18762
|
+
* with an ETag and `Cache-Control: immutable`, honours conditional GETs, can
|
|
18763
|
+
* render a `?variant=thumb`, and streams. The hub gate in front of it requires
|
|
18764
|
+
* a bearer or the session cookie (`access: 'authenticated'`), so the bytes are
|
|
18765
|
+
* no less protected than they were inside a `view`-level cap response — see
|
|
18766
|
+
* `data-plane-access.ts` for the rule and the one gap it does not close
|
|
18767
|
+
* (per-device scoping).
|
|
18768
|
+
*
|
|
18769
|
+
* The URL is built from the row's **stored** key, which is not always its
|
|
18770
|
+
* published `kind`: a track's face/plate crop is stored as `crop` under
|
|
18771
|
+
* `('face'|'plate', '<prefix>-<trackId>')` and published as
|
|
18772
|
+
* `faceCrop`/`plateCrop`. `MediaStore.getByKey` knows only the stored key.
|
|
18773
|
+
*
|
|
18774
|
+
* ## `base64` is TRANSITIONAL and is going away
|
|
18775
|
+
*
|
|
18776
|
+
* It is still populated for one reason: the deployed viewer's track-detail
|
|
18777
|
+
* HERO tile reads it (`use-track-media-entry.ts` → `parseMediaFiles`, which
|
|
18778
|
+
* REQUIRES the field), and a row without it parses as a FAILED read — the red
|
|
18779
|
+
* triangle — not as absence. Removing the field before that viewer ships is an
|
|
18780
|
+
* outage, not a cleanup. Once the viewer takes its hero bytes from `url`,
|
|
18781
|
+
* delete this line and the `withBytes` pass-through in
|
|
18782
|
+
* `analytics-query-facade.ts`; nothing else reads it.
|
|
18783
|
+
*/
|
|
18747
18784
|
var MediaFileSchema = object({
|
|
18748
18785
|
key: string(),
|
|
18749
18786
|
kind: MediaFileKindEnum,
|
|
18750
|
-
base64: string(),
|
|
18751
18787
|
sizeBytes: number(),
|
|
18752
18788
|
timestamp: number()
|
|
18789
|
+
}).extend({
|
|
18790
|
+
/** `/addon/<addonId>/event-media/<encoded stored key>`. Always present. */
|
|
18791
|
+
url: string(),
|
|
18792
|
+
/** @deprecated Transitional — see the schema docblock. Use {@link url}. */
|
|
18793
|
+
base64: string()
|
|
18753
18794
|
});
|
|
18754
18795
|
/**
|
|
18755
18796
|
* One media row WITHOUT its bytes.
|
|
@@ -18761,7 +18802,9 @@ var MediaFileSchema = object({
|
|
|
18761
18802
|
* blocks the whole view.
|
|
18762
18803
|
*
|
|
18763
18804
|
* `sizeBytes` is carried because it is what lets a client decide between the
|
|
18764
|
-
* stored blob and a `?variant=thumb` rendering without fetching either
|
|
18805
|
+
* stored blob and a `?variant=thumb` rendering without fetching either, and
|
|
18806
|
+
* `url` because a client that had to build the plane path itself is a second
|
|
18807
|
+
* copy of a route — the embed, the viewer and the admin UI each grew one.
|
|
18765
18808
|
*/
|
|
18766
18809
|
var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
|
|
18767
18810
|
/**
|
|
@@ -19450,6 +19493,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19450
19493
|
}), array(MediaFileSchema).readonly()), method(object({
|
|
19451
19494
|
trackId: string(),
|
|
19452
19495
|
deviceId: number()
|
|
19496
|
+
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
19497
|
+
eventId: string(),
|
|
19498
|
+
deviceId: number()
|
|
19453
19499
|
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
19454
19500
|
kind: "mutation",
|
|
19455
19501
|
auth: "admin"
|
|
@@ -24552,10 +24598,24 @@ var FaceClusterSchema = object({
|
|
|
24552
24598
|
size: number().int(),
|
|
24553
24599
|
cohesion: number()
|
|
24554
24600
|
});
|
|
24601
|
+
/**
|
|
24602
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
24603
|
+
* are — never the bytes.
|
|
24604
|
+
*
|
|
24605
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
24606
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
24607
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
24608
|
+
* caller is the admin UI's detail modal, which was building
|
|
24609
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
24610
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
24611
|
+
*
|
|
24612
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
24613
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
24614
|
+
*/
|
|
24555
24615
|
var MediaFileLiteSchema$1 = object({
|
|
24556
24616
|
key: string(),
|
|
24557
24617
|
kind: string(),
|
|
24558
|
-
|
|
24618
|
+
url: string(),
|
|
24559
24619
|
sizeBytes: number(),
|
|
24560
24620
|
timestamp: number()
|
|
24561
24621
|
});
|
|
@@ -27577,10 +27637,24 @@ var PlateInfoSchema = object({
|
|
|
27577
27637
|
*/
|
|
27578
27638
|
cropUrl: string().optional()
|
|
27579
27639
|
});
|
|
27640
|
+
/**
|
|
27641
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
27642
|
+
* are — never the bytes.
|
|
27643
|
+
*
|
|
27644
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
27645
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
27646
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
27647
|
+
* caller is the admin UI's detail modal, which was building
|
|
27648
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
27649
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
27650
|
+
*
|
|
27651
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
27652
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
27653
|
+
*/
|
|
27580
27654
|
var MediaFileLiteSchema = object({
|
|
27581
27655
|
key: string(),
|
|
27582
27656
|
kind: string(),
|
|
27583
|
-
|
|
27657
|
+
url: string(),
|
|
27584
27658
|
sizeBytes: number(),
|
|
27585
27659
|
timestamp: number()
|
|
27586
27660
|
});
|
|
@@ -35543,6 +35617,12 @@ Object.freeze({
|
|
|
35543
35617
|
addonId: null,
|
|
35544
35618
|
access: "view"
|
|
35545
35619
|
},
|
|
35620
|
+
"pipelineAnalytics.listEventMedia": {
|
|
35621
|
+
capName: "pipeline-analytics",
|
|
35622
|
+
capScope: "device",
|
|
35623
|
+
addonId: null,
|
|
35624
|
+
access: "view"
|
|
35625
|
+
},
|
|
35546
35626
|
"pipelineAnalytics.listGroups": {
|
|
35547
35627
|
capName: "pipeline-analytics",
|
|
35548
35628
|
capScope: "device",
|
|
@@ -39166,6 +39246,11 @@ Object.freeze({
|
|
|
39166
39246
|
form: "array",
|
|
39167
39247
|
optional: false
|
|
39168
39248
|
}],
|
|
39249
|
+
"pipelineAnalytics.listEventMedia": [{
|
|
39250
|
+
name: "deviceId",
|
|
39251
|
+
form: "single",
|
|
39252
|
+
optional: false
|
|
39253
|
+
}],
|
|
39169
39254
|
"pipelineAnalytics.listGroups": [{
|
|
39170
39255
|
name: "deviceIds",
|
|
39171
39256
|
form: "array",
|
package/dist/addon.mjs
CHANGED
|
@@ -13216,6 +13216,114 @@ method(object({
|
|
|
13216
13216
|
height: number()
|
|
13217
13217
|
}), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
|
|
13218
13218
|
/**
|
|
13219
|
+
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
13220
|
+
* through, per camera, with the denominator attached. It stores nothing.
|
|
13221
|
+
*
|
|
13222
|
+
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13223
|
+
*
|
|
13224
|
+
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13225
|
+
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13226
|
+
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13227
|
+
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13228
|
+
* somebody to forget to edit.
|
|
13229
|
+
*
|
|
13230
|
+
* They are not merged, because their invariants are opposites:
|
|
13231
|
+
*
|
|
13232
|
+
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13233
|
+
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13234
|
+
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13235
|
+
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13236
|
+
* and it is exactly what an absent entry cannot say.
|
|
13237
|
+
*
|
|
13238
|
+
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13239
|
+
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13240
|
+
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13241
|
+
* has no process.
|
|
13242
|
+
*
|
|
13243
|
+
* ## Why not a log line, since the counters already exist
|
|
13244
|
+
*
|
|
13245
|
+
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13246
|
+
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13247
|
+
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13248
|
+
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13249
|
+
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13250
|
+
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13251
|
+
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13252
|
+
* be READ.
|
|
13253
|
+
*
|
|
13254
|
+
* ## The rate is served with its denominator or not at all
|
|
13255
|
+
*
|
|
13256
|
+
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13257
|
+
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13258
|
+
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13259
|
+
* successes on the same path. A surface that publishes only the numerator
|
|
13260
|
+
* reproduces that mistake on every read.
|
|
13261
|
+
*
|
|
13262
|
+
* ## Shape
|
|
13263
|
+
*
|
|
13264
|
+
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13265
|
+
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13266
|
+
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13267
|
+
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13268
|
+
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13269
|
+
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13270
|
+
* result through `system.getFailureContributions`.
|
|
13271
|
+
*/
|
|
13272
|
+
var FailureReasonCountSchema = object({
|
|
13273
|
+
/**
|
|
13274
|
+
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13275
|
+
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13276
|
+
* strings that already appear in this repo's logs and, where one exists, the
|
|
13277
|
+
* same string the per-track `previewMissReason` records (D276): a second
|
|
13278
|
+
* vocabulary for the same loss would make the row and the counter
|
|
13279
|
+
* un-joinable.
|
|
13280
|
+
*/
|
|
13281
|
+
reason: string(),
|
|
13282
|
+
count: number().int().nonnegative()
|
|
13283
|
+
});
|
|
13284
|
+
var FailureContributionSchema = object({
|
|
13285
|
+
/**
|
|
13286
|
+
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13287
|
+
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13288
|
+
* `unit` free: the families are owned by different addons and a shared enum
|
|
13289
|
+
* is a central list that rots invisibly.
|
|
13290
|
+
*/
|
|
13291
|
+
family: string(),
|
|
13292
|
+
/**
|
|
13293
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13294
|
+
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13295
|
+
* cannot name the camera must not emit the entry, because a fleet total
|
|
13296
|
+
* cannot answer the only question anybody asks of this surface.
|
|
13297
|
+
*/
|
|
13298
|
+
deviceId: number().int().positive(),
|
|
13299
|
+
/**
|
|
13300
|
+
* A second dimension inside the family: the model / step id for an inference
|
|
13301
|
+
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13302
|
+
* family has a single variant.
|
|
13303
|
+
*/
|
|
13304
|
+
variant: string().optional(),
|
|
13305
|
+
/**
|
|
13306
|
+
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13307
|
+
* differencing two reads must drop the interval when it changes, because the
|
|
13308
|
+
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13309
|
+
* `LoadContribution.startedAtMs`.
|
|
13310
|
+
*/
|
|
13311
|
+
sinceMs: number(),
|
|
13312
|
+
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13313
|
+
atMs: number(),
|
|
13314
|
+
/**
|
|
13315
|
+
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13316
|
+
* window. A failure count published without it is the mistake this schema
|
|
13317
|
+
* exists to make impossible.
|
|
13318
|
+
*/
|
|
13319
|
+
attempts: number().int().nonnegative(),
|
|
13320
|
+
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13321
|
+
succeeded: number().int().nonnegative(),
|
|
13322
|
+
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13323
|
+
reasons: array(FailureReasonCountSchema).readonly()
|
|
13324
|
+
});
|
|
13325
|
+
method(_void(), array(FailureContributionSchema).readonly());
|
|
13326
|
+
/**
|
|
13219
13327
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
13220
13328
|
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
13221
13329
|
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
@@ -13737,6 +13845,68 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13737
13845
|
kind: "mutation",
|
|
13738
13846
|
auth: "admin"
|
|
13739
13847
|
});
|
|
13848
|
+
var LoadContributionSchema = object({
|
|
13849
|
+
role: _enum([
|
|
13850
|
+
"decode",
|
|
13851
|
+
"transcode",
|
|
13852
|
+
"recording",
|
|
13853
|
+
"streaming",
|
|
13854
|
+
"detection"
|
|
13855
|
+
]),
|
|
13856
|
+
/**
|
|
13857
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13858
|
+
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
13859
|
+
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
13860
|
+
* contributor that cannot name its camera must not emit the entry at all,
|
|
13861
|
+
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
13862
|
+
* and would quietly turn one camera's cost into everybody's.
|
|
13863
|
+
*/
|
|
13864
|
+
deviceId: number().int().positive().nullable(),
|
|
13865
|
+
attribution: _enum([
|
|
13866
|
+
"measured",
|
|
13867
|
+
"accounted",
|
|
13868
|
+
"unattributable"
|
|
13869
|
+
]),
|
|
13870
|
+
/**
|
|
13871
|
+
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
13872
|
+
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
13873
|
+
* family and inventing a common one would lose the only information that
|
|
13874
|
+
* makes two entries for the same camera distinguishable.
|
|
13875
|
+
*/
|
|
13876
|
+
unit: string(),
|
|
13877
|
+
/**
|
|
13878
|
+
* The OS process this cost lives in, when there is one. Present so a
|
|
13879
|
+
* consumer can (a) tell two generations of the same unit apart across a
|
|
13880
|
+
* restart, and (b) subtract claimed processes from the node's process
|
|
13881
|
+
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
13882
|
+
* process of its own.
|
|
13883
|
+
*/
|
|
13884
|
+
pid: number().int().positive().optional(),
|
|
13885
|
+
/**
|
|
13886
|
+
* When this generation started. The pid's incarnation marker: a consumer
|
|
13887
|
+
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
13888
|
+
* window when this changes, because the counter restarted from zero in a new
|
|
13889
|
+
* process.
|
|
13890
|
+
*/
|
|
13891
|
+
startedAtMs: number().optional(),
|
|
13892
|
+
/**
|
|
13893
|
+
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
13894
|
+
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
13895
|
+
* contribution is asked for.
|
|
13896
|
+
*
|
|
13897
|
+
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
13898
|
+
* needs a sampler, and a new per-node sampler is the defect half of
|
|
13899
|
+
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
13900
|
+
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
13901
|
+
*
|
|
13902
|
+
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
13903
|
+
* an entry with no process.
|
|
13904
|
+
*/
|
|
13905
|
+
cpuSeconds: number().optional(),
|
|
13906
|
+
/** Resident bytes of this unit's process, same source and same rules. */
|
|
13907
|
+
rssBytes: number().optional()
|
|
13908
|
+
});
|
|
13909
|
+
method(_void(), array(LoadContributionSchema).readonly());
|
|
13740
13910
|
/**
|
|
13741
13911
|
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13742
13912
|
* through. It stores nothing.
|
|
@@ -13813,176 +13983,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
13813
13983
|
tags: record(string(), string()).optional()
|
|
13814
13984
|
}), array(LogEntrySchema).readonly());
|
|
13815
13985
|
/**
|
|
13816
|
-
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
13817
|
-
* through, per camera, with the denominator attached. It stores nothing.
|
|
13818
|
-
*
|
|
13819
|
-
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13820
|
-
*
|
|
13821
|
-
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13822
|
-
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13823
|
-
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13824
|
-
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13825
|
-
* somebody to forget to edit.
|
|
13826
|
-
*
|
|
13827
|
-
* They are not merged, because their invariants are opposites:
|
|
13828
|
-
*
|
|
13829
|
-
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13830
|
-
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13831
|
-
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13832
|
-
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13833
|
-
* and it is exactly what an absent entry cannot say.
|
|
13834
|
-
*
|
|
13835
|
-
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13836
|
-
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13837
|
-
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13838
|
-
* has no process.
|
|
13839
|
-
*
|
|
13840
|
-
* ## Why not a log line, since the counters already exist
|
|
13841
|
-
*
|
|
13842
|
-
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13843
|
-
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13844
|
-
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13845
|
-
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13846
|
-
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13847
|
-
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13848
|
-
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13849
|
-
* be READ.
|
|
13850
|
-
*
|
|
13851
|
-
* ## The rate is served with its denominator or not at all
|
|
13852
|
-
*
|
|
13853
|
-
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13854
|
-
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13855
|
-
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13856
|
-
* successes on the same path. A surface that publishes only the numerator
|
|
13857
|
-
* reproduces that mistake on every read.
|
|
13858
|
-
*
|
|
13859
|
-
* ## Shape
|
|
13860
|
-
*
|
|
13861
|
-
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13862
|
-
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13863
|
-
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13864
|
-
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13865
|
-
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13866
|
-
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13867
|
-
* result through `system.getFailureContributions`.
|
|
13868
|
-
*/
|
|
13869
|
-
var FailureReasonCountSchema = object({
|
|
13870
|
-
/**
|
|
13871
|
-
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13872
|
-
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13873
|
-
* strings that already appear in this repo's logs and, where one exists, the
|
|
13874
|
-
* same string the per-track `previewMissReason` records (D276): a second
|
|
13875
|
-
* vocabulary for the same loss would make the row and the counter
|
|
13876
|
-
* un-joinable.
|
|
13877
|
-
*/
|
|
13878
|
-
reason: string(),
|
|
13879
|
-
count: number().int().nonnegative()
|
|
13880
|
-
});
|
|
13881
|
-
var FailureContributionSchema = object({
|
|
13882
|
-
/**
|
|
13883
|
-
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13884
|
-
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13885
|
-
* `unit` free: the families are owned by different addons and a shared enum
|
|
13886
|
-
* is a central list that rots invisibly.
|
|
13887
|
-
*/
|
|
13888
|
-
family: string(),
|
|
13889
|
-
/**
|
|
13890
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
13891
|
-
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13892
|
-
* cannot name the camera must not emit the entry, because a fleet total
|
|
13893
|
-
* cannot answer the only question anybody asks of this surface.
|
|
13894
|
-
*/
|
|
13895
|
-
deviceId: number().int().positive(),
|
|
13896
|
-
/**
|
|
13897
|
-
* A second dimension inside the family: the model / step id for an inference
|
|
13898
|
-
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13899
|
-
* family has a single variant.
|
|
13900
|
-
*/
|
|
13901
|
-
variant: string().optional(),
|
|
13902
|
-
/**
|
|
13903
|
-
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13904
|
-
* differencing two reads must drop the interval when it changes, because the
|
|
13905
|
-
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13906
|
-
* `LoadContribution.startedAtMs`.
|
|
13907
|
-
*/
|
|
13908
|
-
sinceMs: number(),
|
|
13909
|
-
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13910
|
-
atMs: number(),
|
|
13911
|
-
/**
|
|
13912
|
-
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13913
|
-
* window. A failure count published without it is the mistake this schema
|
|
13914
|
-
* exists to make impossible.
|
|
13915
|
-
*/
|
|
13916
|
-
attempts: number().int().nonnegative(),
|
|
13917
|
-
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13918
|
-
succeeded: number().int().nonnegative(),
|
|
13919
|
-
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13920
|
-
reasons: array(FailureReasonCountSchema).readonly()
|
|
13921
|
-
});
|
|
13922
|
-
method(_void(), array(FailureContributionSchema).readonly());
|
|
13923
|
-
var LoadContributionSchema = object({
|
|
13924
|
-
role: _enum([
|
|
13925
|
-
"decode",
|
|
13926
|
-
"transcode",
|
|
13927
|
-
"recording",
|
|
13928
|
-
"streaming",
|
|
13929
|
-
"detection"
|
|
13930
|
-
]),
|
|
13931
|
-
/**
|
|
13932
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
13933
|
-
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
13934
|
-
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
13935
|
-
* contributor that cannot name its camera must not emit the entry at all,
|
|
13936
|
-
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
13937
|
-
* and would quietly turn one camera's cost into everybody's.
|
|
13938
|
-
*/
|
|
13939
|
-
deviceId: number().int().positive().nullable(),
|
|
13940
|
-
attribution: _enum([
|
|
13941
|
-
"measured",
|
|
13942
|
-
"accounted",
|
|
13943
|
-
"unattributable"
|
|
13944
|
-
]),
|
|
13945
|
-
/**
|
|
13946
|
-
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
13947
|
-
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
13948
|
-
* family and inventing a common one would lose the only information that
|
|
13949
|
-
* makes two entries for the same camera distinguishable.
|
|
13950
|
-
*/
|
|
13951
|
-
unit: string(),
|
|
13952
|
-
/**
|
|
13953
|
-
* The OS process this cost lives in, when there is one. Present so a
|
|
13954
|
-
* consumer can (a) tell two generations of the same unit apart across a
|
|
13955
|
-
* restart, and (b) subtract claimed processes from the node's process
|
|
13956
|
-
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
13957
|
-
* process of its own.
|
|
13958
|
-
*/
|
|
13959
|
-
pid: number().int().positive().optional(),
|
|
13960
|
-
/**
|
|
13961
|
-
* When this generation started. The pid's incarnation marker: a consumer
|
|
13962
|
-
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
13963
|
-
* window when this changes, because the counter restarted from zero in a new
|
|
13964
|
-
* process.
|
|
13965
|
-
*/
|
|
13966
|
-
startedAtMs: number().optional(),
|
|
13967
|
-
/**
|
|
13968
|
-
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
13969
|
-
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
13970
|
-
* contribution is asked for.
|
|
13971
|
-
*
|
|
13972
|
-
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
13973
|
-
* needs a sampler, and a new per-node sampler is the defect half of
|
|
13974
|
-
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
13975
|
-
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
13976
|
-
*
|
|
13977
|
-
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
13978
|
-
* an entry with no process.
|
|
13979
|
-
*/
|
|
13980
|
-
cpuSeconds: number().optional(),
|
|
13981
|
-
/** Resident bytes of this unit's process, same source and same rules. */
|
|
13982
|
-
rssBytes: number().optional()
|
|
13983
|
-
});
|
|
13984
|
-
method(_void(), array(LoadContributionSchema).readonly());
|
|
13985
|
-
/**
|
|
13986
13986
|
* `login-method` — collection cap through which auth addons contribute
|
|
13987
13987
|
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
13988
13988
|
* generic mechanism that supersedes the dead `auth.listProviders` reader:
|
|
@@ -18720,12 +18720,53 @@ var MediaFileKindEnum = _enum([
|
|
|
18720
18720
|
"keyFrameSmall",
|
|
18721
18721
|
"thumbnailSmall"
|
|
18722
18722
|
]);
|
|
18723
|
+
/**
|
|
18724
|
+
* One media row ON THE WIRE: what it is, how big it is, and WHERE ITS BYTES
|
|
18725
|
+
* ARE — never the bytes themselves.
|
|
18726
|
+
*
|
|
18727
|
+
* ## Why `url` and not `base64`
|
|
18728
|
+
*
|
|
18729
|
+
* Measured on the live hub 2026-08-30: `getTrackMedia {trackId, deviceId}`
|
|
18730
|
+
* with no `kinds` returned 6 rows / **3 597 219 B**, of which `keyFrame` alone
|
|
18731
|
+
* was **2 824 077 B** — one full-resolution frame, base64, so +33 % on the
|
|
18732
|
+
* wire. Forty events is ~144 MB. Every byte of it was read off disk,
|
|
18733
|
+
* base64-encoded, held whole in a unary tRPC envelope, and materialised in
|
|
18734
|
+
* hub-main's heap on the way past — for an `<img>` that would have cached it.
|
|
18735
|
+
*
|
|
18736
|
+
* `url` points at the `event-media` data plane
|
|
18737
|
+
* (`/addon/<addonId>/event-media/<storedKey>`), which serves the same blob
|
|
18738
|
+
* with an ETag and `Cache-Control: immutable`, honours conditional GETs, can
|
|
18739
|
+
* render a `?variant=thumb`, and streams. The hub gate in front of it requires
|
|
18740
|
+
* a bearer or the session cookie (`access: 'authenticated'`), so the bytes are
|
|
18741
|
+
* no less protected than they were inside a `view`-level cap response — see
|
|
18742
|
+
* `data-plane-access.ts` for the rule and the one gap it does not close
|
|
18743
|
+
* (per-device scoping).
|
|
18744
|
+
*
|
|
18745
|
+
* The URL is built from the row's **stored** key, which is not always its
|
|
18746
|
+
* published `kind`: a track's face/plate crop is stored as `crop` under
|
|
18747
|
+
* `('face'|'plate', '<prefix>-<trackId>')` and published as
|
|
18748
|
+
* `faceCrop`/`plateCrop`. `MediaStore.getByKey` knows only the stored key.
|
|
18749
|
+
*
|
|
18750
|
+
* ## `base64` is TRANSITIONAL and is going away
|
|
18751
|
+
*
|
|
18752
|
+
* It is still populated for one reason: the deployed viewer's track-detail
|
|
18753
|
+
* HERO tile reads it (`use-track-media-entry.ts` → `parseMediaFiles`, which
|
|
18754
|
+
* REQUIRES the field), and a row without it parses as a FAILED read — the red
|
|
18755
|
+
* triangle — not as absence. Removing the field before that viewer ships is an
|
|
18756
|
+
* outage, not a cleanup. Once the viewer takes its hero bytes from `url`,
|
|
18757
|
+
* delete this line and the `withBytes` pass-through in
|
|
18758
|
+
* `analytics-query-facade.ts`; nothing else reads it.
|
|
18759
|
+
*/
|
|
18723
18760
|
var MediaFileSchema = object({
|
|
18724
18761
|
key: string(),
|
|
18725
18762
|
kind: MediaFileKindEnum,
|
|
18726
|
-
base64: string(),
|
|
18727
18763
|
sizeBytes: number(),
|
|
18728
18764
|
timestamp: number()
|
|
18765
|
+
}).extend({
|
|
18766
|
+
/** `/addon/<addonId>/event-media/<encoded stored key>`. Always present. */
|
|
18767
|
+
url: string(),
|
|
18768
|
+
/** @deprecated Transitional — see the schema docblock. Use {@link url}. */
|
|
18769
|
+
base64: string()
|
|
18729
18770
|
});
|
|
18730
18771
|
/**
|
|
18731
18772
|
* One media row WITHOUT its bytes.
|
|
@@ -18737,7 +18778,9 @@ var MediaFileSchema = object({
|
|
|
18737
18778
|
* blocks the whole view.
|
|
18738
18779
|
*
|
|
18739
18780
|
* `sizeBytes` is carried because it is what lets a client decide between the
|
|
18740
|
-
* stored blob and a `?variant=thumb` rendering without fetching either
|
|
18781
|
+
* stored blob and a `?variant=thumb` rendering without fetching either, and
|
|
18782
|
+
* `url` because a client that had to build the plane path itself is a second
|
|
18783
|
+
* copy of a route — the embed, the viewer and the admin UI each grew one.
|
|
18741
18784
|
*/
|
|
18742
18785
|
var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
|
|
18743
18786
|
/**
|
|
@@ -19426,6 +19469,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19426
19469
|
}), array(MediaFileSchema).readonly()), method(object({
|
|
19427
19470
|
trackId: string(),
|
|
19428
19471
|
deviceId: number()
|
|
19472
|
+
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
19473
|
+
eventId: string(),
|
|
19474
|
+
deviceId: number()
|
|
19429
19475
|
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
19430
19476
|
kind: "mutation",
|
|
19431
19477
|
auth: "admin"
|
|
@@ -24528,10 +24574,24 @@ var FaceClusterSchema = object({
|
|
|
24528
24574
|
size: number().int(),
|
|
24529
24575
|
cohesion: number()
|
|
24530
24576
|
});
|
|
24577
|
+
/**
|
|
24578
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
24579
|
+
* are — never the bytes.
|
|
24580
|
+
*
|
|
24581
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
24582
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
24583
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
24584
|
+
* caller is the admin UI's detail modal, which was building
|
|
24585
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
24586
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
24587
|
+
*
|
|
24588
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
24589
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
24590
|
+
*/
|
|
24531
24591
|
var MediaFileLiteSchema$1 = object({
|
|
24532
24592
|
key: string(),
|
|
24533
24593
|
kind: string(),
|
|
24534
|
-
|
|
24594
|
+
url: string(),
|
|
24535
24595
|
sizeBytes: number(),
|
|
24536
24596
|
timestamp: number()
|
|
24537
24597
|
});
|
|
@@ -27553,10 +27613,24 @@ var PlateInfoSchema = object({
|
|
|
27553
27613
|
*/
|
|
27554
27614
|
cropUrl: string().optional()
|
|
27555
27615
|
});
|
|
27616
|
+
/**
|
|
27617
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
27618
|
+
* are — never the bytes.
|
|
27619
|
+
*
|
|
27620
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
27621
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
27622
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
27623
|
+
* caller is the admin UI's detail modal, which was building
|
|
27624
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
27625
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
27626
|
+
*
|
|
27627
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
27628
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
27629
|
+
*/
|
|
27556
27630
|
var MediaFileLiteSchema = object({
|
|
27557
27631
|
key: string(),
|
|
27558
27632
|
kind: string(),
|
|
27559
|
-
|
|
27633
|
+
url: string(),
|
|
27560
27634
|
sizeBytes: number(),
|
|
27561
27635
|
timestamp: number()
|
|
27562
27636
|
});
|
|
@@ -35519,6 +35593,12 @@ Object.freeze({
|
|
|
35519
35593
|
addonId: null,
|
|
35520
35594
|
access: "view"
|
|
35521
35595
|
},
|
|
35596
|
+
"pipelineAnalytics.listEventMedia": {
|
|
35597
|
+
capName: "pipeline-analytics",
|
|
35598
|
+
capScope: "device",
|
|
35599
|
+
addonId: null,
|
|
35600
|
+
access: "view"
|
|
35601
|
+
},
|
|
35522
35602
|
"pipelineAnalytics.listGroups": {
|
|
35523
35603
|
capName: "pipeline-analytics",
|
|
35524
35604
|
capScope: "device",
|
|
@@ -39142,6 +39222,11 @@ Object.freeze({
|
|
|
39142
39222
|
form: "array",
|
|
39143
39223
|
optional: false
|
|
39144
39224
|
}],
|
|
39225
|
+
"pipelineAnalytics.listEventMedia": [{
|
|
39226
|
+
name: "deviceId",
|
|
39227
|
+
form: "single",
|
|
39228
|
+
optional: false
|
|
39229
|
+
}],
|
|
39145
39230
|
"pipelineAnalytics.listGroups": [{
|
|
39146
39231
|
name: "deviceIds",
|
|
39147
39232
|
form: "array",
|