@camstack/addon-pipeline 1.2.151 → 1.2.153
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/audio-analyzer/index.js +2 -2
- package/dist/audio-analyzer/index.mjs +2 -2
- package/dist/detection-pipeline/index.js +5 -5
- package/dist/detection-pipeline/index.mjs +4 -4
- package/dist/{dist-hmG3nfuW.js → dist-DnVnWACi.js} +346 -214
- package/dist/{dist-BjzcUac4.mjs → dist-Dsritt4-.mjs} +346 -214
- package/dist/{lazy-sharp-RLE6klOt.js → lazy-sharp-DZWYKdV2.js} +1 -1
- package/dist/{local-frame-registry-Ct2vQ7Dp.js → local-frame-registry-BpFLRfbw.js} +1 -1
- package/dist/{local-frame-registry-BFaxbRtK.mjs → local-frame-registry-Yf-uIxbS.mjs} +1 -1
- package/dist/motion-wasm/index.js +2 -2
- package/dist/motion-wasm/index.mjs +1 -1
- package/dist/{node-BwXwfrvA.js → node-C5xmFvjS.js} +1 -1
- package/dist/{node-U9fJ-bQN.mjs → node-CNGxkfes.mjs} +1 -1
- package/dist/pipeline-runner/index.js +5 -5
- package/dist/pipeline-runner/index.mjs +4 -4
- package/dist/{process-memory-DR9jSxpX.js → process-memory-COT8rA8L.js} +1 -1
- package/dist/{process-memory-4WDUPavu.mjs → process-memory-DX_KCfdx.mjs} +1 -1
- package/dist/recorder/index.js +167 -28
- package/dist/recorder/index.mjs +167 -28
- package/dist/{segment-demux-js-kUN5AQVv.mjs → segment-demux-js-CTFSl-b9.mjs} +1 -1
- package/dist/{segment-demux-js-zqUNh3pj.js → segment-demux-js-Dwg9Jq5_.js} +1 -1
- package/dist/session-decode/decode-worker-child.js +2 -2
- package/dist/session-decode/decode-worker-child.mjs +1 -1
- package/dist/stream-broker/_stub.js +2 -2
- package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-BOXQSR0X.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-ZucA907q.mjs} +3 -3
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-B14Zc1oq.mjs +26 -0
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DO6LkN6o.mjs +26 -0
- package/dist/stream-broker/demux-worker-child.js +1 -1
- package/dist/stream-broker/demux-worker-child.mjs +1 -1
- package/dist/stream-broker/{hostInit-CnUhcNPG.mjs → hostInit-BqUcM0Fh.mjs} +3 -3
- package/dist/stream-broker/index.js +3 -3
- package/dist/stream-broker/index.mjs +3 -3
- package/dist/stream-broker/remoteEntry.js +1 -1
- package/dist/{worker-protocol-DE_jjbFA.js → worker-protocol-BsvaPb-G.js} +1 -1
- package/dist/{worker-protocol-BzlEZ56r.mjs → worker-protocol-CDBQXOIu.mjs} +1 -1
- package/package.json +1 -1
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CyIaTPRY.mjs +0 -26
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Cyyhy_D8.mjs +0 -26
|
@@ -9338,6 +9338,21 @@ var RelocateJobSchema = object({
|
|
|
9338
9338
|
bytesMoved: number().int(),
|
|
9339
9339
|
/** Total files discovered up front; null while (or when) unknown. */
|
|
9340
9340
|
filesTotal: number().int().nullable(),
|
|
9341
|
+
/**
|
|
9342
|
+
* Rows this run CORRECTED while moving them — a durable mutation the move
|
|
9343
|
+
* made that nobody asked for, so it is reported where the operator reads the
|
|
9344
|
+
* job rather than only in a log line.
|
|
9345
|
+
*
|
|
9346
|
+
* A footage segment records its byte count in its own NAME, and the durable
|
|
9347
|
+
* hour row derives its aggregates from those names. A file that does not
|
|
9348
|
+
* match its name therefore makes the ledger's sums — and with them quota and
|
|
9349
|
+
* pressure eviction — wrong by the difference, and only a rename can fix it.
|
|
9350
|
+
* On 2026-08-30 one such row also stalled a 110 749-file drain permanently.
|
|
9351
|
+
*
|
|
9352
|
+
* Absent on lanes where the question has no meaning: a media blob's size is
|
|
9353
|
+
* in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
|
|
9354
|
+
*/
|
|
9355
|
+
rowsReconciled: number().int().nonnegative().optional(),
|
|
9341
9356
|
startedAt: number(),
|
|
9342
9357
|
finishedAt: number().nullable(),
|
|
9343
9358
|
error: string().nullable()
|
|
@@ -9406,14 +9421,42 @@ var RelocateMediaInputSchema = object({
|
|
|
9406
9421
|
/** Omitted = `move`, the pre-existing behaviour. */
|
|
9407
9422
|
mode: MediaRelocateModeSchema.optional()
|
|
9408
9423
|
});
|
|
9409
|
-
/**
|
|
9410
|
-
*
|
|
9411
|
-
*
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9424
|
+
/**
|
|
9425
|
+
* The unstamped population of ONE collection — split, because the gate and the
|
|
9426
|
+
* operator ask two different questions and only one of them has to be cheap.
|
|
9427
|
+
*
|
|
9428
|
+
* `present` is the GATE: "is there at least one row that would be orphaned by a
|
|
9429
|
+
* repoint". It is a single indexed seek to the first matching row, so it stays
|
|
9430
|
+
* answerable on a saturated disk and answers in O(log n) precisely in the state
|
|
9431
|
+
* that matters — after a seal, when the population is empty.
|
|
9432
|
+
*
|
|
9433
|
+
* `rows` is the NUMBER, for the refusal message and the operator's sense of
|
|
9434
|
+
* scale. It is a second, indexed `COUNT(*)`, and `null` means **not
|
|
9435
|
+
* measurable** — never zero. `{ present: true, rows: null }` is a legitimate
|
|
9436
|
+
* and useful answer: "there are some, and this read could not say how many"
|
|
9437
|
+
* still refuses the cutover, which is the whole job.
|
|
9438
|
+
*/
|
|
9439
|
+
var UnstampedRowsSchema = object({
|
|
9440
|
+
present: boolean(),
|
|
9441
|
+
rows: number().int().nonnegative().nullable()
|
|
9416
9442
|
});
|
|
9443
|
+
/**
|
|
9444
|
+
* How many rows still carry NO `locationId` — the population a repoint would
|
|
9445
|
+
* silently re-aim at a disk that does not hold their bytes.
|
|
9446
|
+
*
|
|
9447
|
+
* **`null` = the count could not be taken**, and it is NOT permission to cut
|
|
9448
|
+
* over. The gate opens on a measured absence and on nothing else; an unread
|
|
9449
|
+
* collection and an empty one are different facts, and this repo has already
|
|
9450
|
+
* paid for conflating them (`RelocateResidueSchema`, D295).
|
|
9451
|
+
*/
|
|
9452
|
+
var UnstampedEventMediaCountSchema = object({
|
|
9453
|
+
media: UnstampedRowsSchema,
|
|
9454
|
+
retrainFrames: UnstampedRowsSchema,
|
|
9455
|
+
/** True when EITHER collection holds one. The refusal reads this. */
|
|
9456
|
+
anyPresent: boolean(),
|
|
9457
|
+
/** Sum across both, or `null` when either lane could not be counted. */
|
|
9458
|
+
total: number().int().nonnegative().nullable()
|
|
9459
|
+
}).nullable();
|
|
9417
9460
|
var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
|
|
9418
9461
|
/** The independently selectable logical storage classes — every class
|
|
9419
9462
|
* `storage.listLocationDeclarations` reports, so an operator never meets a
|
|
@@ -9524,6 +9567,10 @@ var StorageMigrationMoveProgressSchema = object({
|
|
|
9524
9567
|
/** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
|
|
9525
9568
|
filesTotal: number().int().nonnegative().nullable(),
|
|
9526
9569
|
bytesMoved: number().int().nonnegative(),
|
|
9570
|
+
/** Rows the mover corrected while moving them — see `RelocateJob`. Absent on
|
|
9571
|
+
* a lane that cannot reconcile. A migration that silently rewrote durable
|
|
9572
|
+
* rows would be the same failure as one that silently skipped them. */
|
|
9573
|
+
rowsReconciled: number().int().nonnegative().optional(),
|
|
9527
9574
|
/** The MOVER's start, not the migration's: a drain restarted after an addon
|
|
9528
9575
|
* crash gets a new mover, and a rate computed from the migration's start
|
|
9529
9576
|
* would silently average in the time nothing was running. */
|
|
@@ -14789,6 +14836,133 @@ method(object({
|
|
|
14789
14836
|
height: number()
|
|
14790
14837
|
}), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
|
|
14791
14838
|
/**
|
|
14839
|
+
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
14840
|
+
* through, per camera, with the denominator attached. It stores nothing.
|
|
14841
|
+
*
|
|
14842
|
+
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
14843
|
+
*
|
|
14844
|
+
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
14845
|
+
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
14846
|
+
* copied: the contributor reports what it already knows, hub-main adds only
|
|
14847
|
+
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
14848
|
+
* somebody to forget to edit.
|
|
14849
|
+
*
|
|
14850
|
+
* They are not merged, because their invariants are opposites:
|
|
14851
|
+
*
|
|
14852
|
+
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
14853
|
+
* claim a camera cost nothing, which is a measurement nobody made;
|
|
14854
|
+
* - a `failure-contribution` zero is the **most valuable value on the
|
|
14855
|
+
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
14856
|
+
* and it is exactly what an absent entry cannot say.
|
|
14857
|
+
*
|
|
14858
|
+
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
14859
|
+
* that gives `load-contribution` its point: contributions are subtracted from
|
|
14860
|
+
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
14861
|
+
* has no process.
|
|
14862
|
+
*
|
|
14863
|
+
* ## Why not a log line, since the counters already exist
|
|
14864
|
+
*
|
|
14865
|
+
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
14866
|
+
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
14867
|
+
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
14868
|
+
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
14869
|
+
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
14870
|
+
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
14871
|
+
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
14872
|
+
* be READ.
|
|
14873
|
+
*
|
|
14874
|
+
* ## The rate is served with its denominator or not at all
|
|
14875
|
+
*
|
|
14876
|
+
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
14877
|
+
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
14878
|
+
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
14879
|
+
* successes on the same path. A surface that publishes only the numerator
|
|
14880
|
+
* reproduces that mistake on every read.
|
|
14881
|
+
*
|
|
14882
|
+
* ## Shape
|
|
14883
|
+
*
|
|
14884
|
+
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
14885
|
+
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
14886
|
+
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
14887
|
+
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
14888
|
+
* a forked runner's entries reach hub-main over transport that already exists.
|
|
14889
|
+
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
14890
|
+
* result through `system.getFailureContributions`.
|
|
14891
|
+
*/
|
|
14892
|
+
var FailureReasonCountSchema = object({
|
|
14893
|
+
/**
|
|
14894
|
+
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
14895
|
+
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
14896
|
+
* strings that already appear in this repo's logs and, where one exists, the
|
|
14897
|
+
* same string the per-track `previewMissReason` records (D276): a second
|
|
14898
|
+
* vocabulary for the same loss would make the row and the counter
|
|
14899
|
+
* un-joinable.
|
|
14900
|
+
*/
|
|
14901
|
+
reason: string(),
|
|
14902
|
+
count: number().int().nonnegative()
|
|
14903
|
+
});
|
|
14904
|
+
var FailureContributionSchema = object({
|
|
14905
|
+
/**
|
|
14906
|
+
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
14907
|
+
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
14908
|
+
* `unit` free: the families are owned by different addons and a shared enum
|
|
14909
|
+
* is a central list that rots invisibly.
|
|
14910
|
+
*/
|
|
14911
|
+
family: string(),
|
|
14912
|
+
/**
|
|
14913
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
14914
|
+
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
14915
|
+
* cannot name the camera must not emit the entry, because a fleet total
|
|
14916
|
+
* cannot answer the only question anybody asks of this surface.
|
|
14917
|
+
*/
|
|
14918
|
+
deviceId: number().int().positive(),
|
|
14919
|
+
/**
|
|
14920
|
+
* A second dimension inside the family: the model / step id for an inference
|
|
14921
|
+
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
14922
|
+
* family has a single variant.
|
|
14923
|
+
*/
|
|
14924
|
+
variant: string().optional(),
|
|
14925
|
+
/**
|
|
14926
|
+
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
14927
|
+
* differencing two reads must drop the interval when it changes, because the
|
|
14928
|
+
* counter restarted from zero in a respawned runner. Same discipline as
|
|
14929
|
+
* `LoadContribution.startedAtMs`.
|
|
14930
|
+
*/
|
|
14931
|
+
sinceMs: number(),
|
|
14932
|
+
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
14933
|
+
atMs: number(),
|
|
14934
|
+
/**
|
|
14935
|
+
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
14936
|
+
* window. A failure count published without it is the mistake this schema
|
|
14937
|
+
* exists to make impossible.
|
|
14938
|
+
*/
|
|
14939
|
+
attempts: number().int().nonnegative(),
|
|
14940
|
+
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
14941
|
+
succeeded: number().int().nonnegative(),
|
|
14942
|
+
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
14943
|
+
reasons: array(FailureReasonCountSchema).readonly()
|
|
14944
|
+
});
|
|
14945
|
+
var failureContributionCapability = {
|
|
14946
|
+
name: "failure-contribution",
|
|
14947
|
+
scope: "system",
|
|
14948
|
+
mode: "collection",
|
|
14949
|
+
internal: true,
|
|
14950
|
+
methods: {
|
|
14951
|
+
/**
|
|
14952
|
+
* This addon's per-camera failure counters, read live from bounded in-RAM
|
|
14953
|
+
* state it already keeps. Inert: no persistence, no sampling, no timer.
|
|
14954
|
+
*
|
|
14955
|
+
* READING NEVER RESETS. The counters are CUMULATIVE since `sinceMs`, and a
|
|
14956
|
+
* consumer that wants a rate differences two reads. A draining read would
|
|
14957
|
+
* make two operators with the page open each destroy half of the other's
|
|
14958
|
+
* numbers, and `load-contribution` already settled the same question the
|
|
14959
|
+
* same way for `cpuSeconds`.
|
|
14960
|
+
*/
|
|
14961
|
+
list: method(_void(), array(FailureContributionSchema).readonly()) },
|
|
14962
|
+
/** In-process only — enumerated through `addons.listCapabilityProviders`. */
|
|
14963
|
+
mount: { kind: "skip" }
|
|
14964
|
+
};
|
|
14965
|
+
/**
|
|
14792
14966
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
14793
14967
|
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
14794
14968
|
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
@@ -15310,6 +15484,82 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
15310
15484
|
kind: "mutation",
|
|
15311
15485
|
auth: "admin"
|
|
15312
15486
|
});
|
|
15487
|
+
var LoadContributionSchema = object({
|
|
15488
|
+
role: _enum([
|
|
15489
|
+
"decode",
|
|
15490
|
+
"transcode",
|
|
15491
|
+
"recording",
|
|
15492
|
+
"streaming",
|
|
15493
|
+
"detection"
|
|
15494
|
+
]),
|
|
15495
|
+
/**
|
|
15496
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
15497
|
+
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
15498
|
+
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
15499
|
+
* contributor that cannot name its camera must not emit the entry at all,
|
|
15500
|
+
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
15501
|
+
* and would quietly turn one camera's cost into everybody's.
|
|
15502
|
+
*/
|
|
15503
|
+
deviceId: number().int().positive().nullable(),
|
|
15504
|
+
attribution: _enum([
|
|
15505
|
+
"measured",
|
|
15506
|
+
"accounted",
|
|
15507
|
+
"unattributable"
|
|
15508
|
+
]),
|
|
15509
|
+
/**
|
|
15510
|
+
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
15511
|
+
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
15512
|
+
* family and inventing a common one would lose the only information that
|
|
15513
|
+
* makes two entries for the same camera distinguishable.
|
|
15514
|
+
*/
|
|
15515
|
+
unit: string(),
|
|
15516
|
+
/**
|
|
15517
|
+
* The OS process this cost lives in, when there is one. Present so a
|
|
15518
|
+
* consumer can (a) tell two generations of the same unit apart across a
|
|
15519
|
+
* restart, and (b) subtract claimed processes from the node's process
|
|
15520
|
+
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
15521
|
+
* process of its own.
|
|
15522
|
+
*/
|
|
15523
|
+
pid: number().int().positive().optional(),
|
|
15524
|
+
/**
|
|
15525
|
+
* When this generation started. The pid's incarnation marker: a consumer
|
|
15526
|
+
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
15527
|
+
* window when this changes, because the counter restarted from zero in a new
|
|
15528
|
+
* process.
|
|
15529
|
+
*/
|
|
15530
|
+
startedAtMs: number().optional(),
|
|
15531
|
+
/**
|
|
15532
|
+
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
15533
|
+
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
15534
|
+
* contribution is asked for.
|
|
15535
|
+
*
|
|
15536
|
+
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
15537
|
+
* needs a sampler, and a new per-node sampler is the defect half of
|
|
15538
|
+
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
15539
|
+
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
15540
|
+
*
|
|
15541
|
+
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
15542
|
+
* an entry with no process.
|
|
15543
|
+
*/
|
|
15544
|
+
cpuSeconds: number().optional(),
|
|
15545
|
+
/** Resident bytes of this unit's process, same source and same rules. */
|
|
15546
|
+
rssBytes: number().optional()
|
|
15547
|
+
});
|
|
15548
|
+
var loadContributionCapability = {
|
|
15549
|
+
name: "load-contribution",
|
|
15550
|
+
scope: "system",
|
|
15551
|
+
mode: "collection",
|
|
15552
|
+
internal: true,
|
|
15553
|
+
methods: {
|
|
15554
|
+
/**
|
|
15555
|
+
* This addon's own cost entries, computed live from state it already
|
|
15556
|
+
* holds. Inert: no persistence, no sampling, no timer. It is answered on
|
|
15557
|
+
* whatever beat the caller already has.
|
|
15558
|
+
*/
|
|
15559
|
+
list: method(_void(), array(LoadContributionSchema).readonly()) },
|
|
15560
|
+
/** In-process only — enumerated through `addons.listCapabilityProviders`. */
|
|
15561
|
+
mount: { kind: "skip" }
|
|
15562
|
+
};
|
|
15313
15563
|
/**
|
|
15314
15564
|
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
15315
15565
|
* through. It stores nothing.
|
|
@@ -15407,209 +15657,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
15407
15657
|
tags: record(string(), string()).optional()
|
|
15408
15658
|
}), array(LogEntrySchema).readonly());
|
|
15409
15659
|
/**
|
|
15410
|
-
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
15411
|
-
* through, per camera, with the denominator attached. It stores nothing.
|
|
15412
|
-
*
|
|
15413
|
-
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
15414
|
-
*
|
|
15415
|
-
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
15416
|
-
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
15417
|
-
* copied: the contributor reports what it already knows, hub-main adds only
|
|
15418
|
-
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
15419
|
-
* somebody to forget to edit.
|
|
15420
|
-
*
|
|
15421
|
-
* They are not merged, because their invariants are opposites:
|
|
15422
|
-
*
|
|
15423
|
-
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
15424
|
-
* claim a camera cost nothing, which is a measurement nobody made;
|
|
15425
|
-
* - a `failure-contribution` zero is the **most valuable value on the
|
|
15426
|
-
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
15427
|
-
* and it is exactly what an absent entry cannot say.
|
|
15428
|
-
*
|
|
15429
|
-
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
15430
|
-
* that gives `load-contribution` its point: contributions are subtracted from
|
|
15431
|
-
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
15432
|
-
* has no process.
|
|
15433
|
-
*
|
|
15434
|
-
* ## Why not a log line, since the counters already exist
|
|
15435
|
-
*
|
|
15436
|
-
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
15437
|
-
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
15438
|
-
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
15439
|
-
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
15440
|
-
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
15441
|
-
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
15442
|
-
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
15443
|
-
* be READ.
|
|
15444
|
-
*
|
|
15445
|
-
* ## The rate is served with its denominator or not at all
|
|
15446
|
-
*
|
|
15447
|
-
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
15448
|
-
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
15449
|
-
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
15450
|
-
* successes on the same path. A surface that publishes only the numerator
|
|
15451
|
-
* reproduces that mistake on every read.
|
|
15452
|
-
*
|
|
15453
|
-
* ## Shape
|
|
15454
|
-
*
|
|
15455
|
-
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
15456
|
-
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
15457
|
-
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
15458
|
-
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
15459
|
-
* a forked runner's entries reach hub-main over transport that already exists.
|
|
15460
|
-
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
15461
|
-
* result through `system.getFailureContributions`.
|
|
15462
|
-
*/
|
|
15463
|
-
var FailureReasonCountSchema = object({
|
|
15464
|
-
/**
|
|
15465
|
-
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
15466
|
-
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
15467
|
-
* strings that already appear in this repo's logs and, where one exists, the
|
|
15468
|
-
* same string the per-track `previewMissReason` records (D276): a second
|
|
15469
|
-
* vocabulary for the same loss would make the row and the counter
|
|
15470
|
-
* un-joinable.
|
|
15471
|
-
*/
|
|
15472
|
-
reason: string(),
|
|
15473
|
-
count: number().int().nonnegative()
|
|
15474
|
-
});
|
|
15475
|
-
var FailureContributionSchema = object({
|
|
15476
|
-
/**
|
|
15477
|
-
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
15478
|
-
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
15479
|
-
* `unit` free: the families are owned by different addons and a shared enum
|
|
15480
|
-
* is a central list that rots invisibly.
|
|
15481
|
-
*/
|
|
15482
|
-
family: string(),
|
|
15483
|
-
/**
|
|
15484
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
15485
|
-
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
15486
|
-
* cannot name the camera must not emit the entry, because a fleet total
|
|
15487
|
-
* cannot answer the only question anybody asks of this surface.
|
|
15488
|
-
*/
|
|
15489
|
-
deviceId: number().int().positive(),
|
|
15490
|
-
/**
|
|
15491
|
-
* A second dimension inside the family: the model / step id for an inference
|
|
15492
|
-
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
15493
|
-
* family has a single variant.
|
|
15494
|
-
*/
|
|
15495
|
-
variant: string().optional(),
|
|
15496
|
-
/**
|
|
15497
|
-
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
15498
|
-
* differencing two reads must drop the interval when it changes, because the
|
|
15499
|
-
* counter restarted from zero in a respawned runner. Same discipline as
|
|
15500
|
-
* `LoadContribution.startedAtMs`.
|
|
15501
|
-
*/
|
|
15502
|
-
sinceMs: number(),
|
|
15503
|
-
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
15504
|
-
atMs: number(),
|
|
15505
|
-
/**
|
|
15506
|
-
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
15507
|
-
* window. A failure count published without it is the mistake this schema
|
|
15508
|
-
* exists to make impossible.
|
|
15509
|
-
*/
|
|
15510
|
-
attempts: number().int().nonnegative(),
|
|
15511
|
-
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
15512
|
-
succeeded: number().int().nonnegative(),
|
|
15513
|
-
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
15514
|
-
reasons: array(FailureReasonCountSchema).readonly()
|
|
15515
|
-
});
|
|
15516
|
-
var failureContributionCapability = {
|
|
15517
|
-
name: "failure-contribution",
|
|
15518
|
-
scope: "system",
|
|
15519
|
-
mode: "collection",
|
|
15520
|
-
internal: true,
|
|
15521
|
-
methods: {
|
|
15522
|
-
/**
|
|
15523
|
-
* This addon's per-camera failure counters, read live from bounded in-RAM
|
|
15524
|
-
* state it already keeps. Inert: no persistence, no sampling, no timer.
|
|
15525
|
-
*
|
|
15526
|
-
* READING NEVER RESETS. The counters are CUMULATIVE since `sinceMs`, and a
|
|
15527
|
-
* consumer that wants a rate differences two reads. A draining read would
|
|
15528
|
-
* make two operators with the page open each destroy half of the other's
|
|
15529
|
-
* numbers, and `load-contribution` already settled the same question the
|
|
15530
|
-
* same way for `cpuSeconds`.
|
|
15531
|
-
*/
|
|
15532
|
-
list: method(_void(), array(FailureContributionSchema).readonly()) },
|
|
15533
|
-
/** In-process only — enumerated through `addons.listCapabilityProviders`. */
|
|
15534
|
-
mount: { kind: "skip" }
|
|
15535
|
-
};
|
|
15536
|
-
var LoadContributionSchema = object({
|
|
15537
|
-
role: _enum([
|
|
15538
|
-
"decode",
|
|
15539
|
-
"transcode",
|
|
15540
|
-
"recording",
|
|
15541
|
-
"streaming",
|
|
15542
|
-
"detection"
|
|
15543
|
-
]),
|
|
15544
|
-
/**
|
|
15545
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
15546
|
-
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
15547
|
-
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
15548
|
-
* contributor that cannot name its camera must not emit the entry at all,
|
|
15549
|
-
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
15550
|
-
* and would quietly turn one camera's cost into everybody's.
|
|
15551
|
-
*/
|
|
15552
|
-
deviceId: number().int().positive().nullable(),
|
|
15553
|
-
attribution: _enum([
|
|
15554
|
-
"measured",
|
|
15555
|
-
"accounted",
|
|
15556
|
-
"unattributable"
|
|
15557
|
-
]),
|
|
15558
|
-
/**
|
|
15559
|
-
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
15560
|
-
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
15561
|
-
* family and inventing a common one would lose the only information that
|
|
15562
|
-
* makes two entries for the same camera distinguishable.
|
|
15563
|
-
*/
|
|
15564
|
-
unit: string(),
|
|
15565
|
-
/**
|
|
15566
|
-
* The OS process this cost lives in, when there is one. Present so a
|
|
15567
|
-
* consumer can (a) tell two generations of the same unit apart across a
|
|
15568
|
-
* restart, and (b) subtract claimed processes from the node's process
|
|
15569
|
-
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
15570
|
-
* process of its own.
|
|
15571
|
-
*/
|
|
15572
|
-
pid: number().int().positive().optional(),
|
|
15573
|
-
/**
|
|
15574
|
-
* When this generation started. The pid's incarnation marker: a consumer
|
|
15575
|
-
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
15576
|
-
* window when this changes, because the counter restarted from zero in a new
|
|
15577
|
-
* process.
|
|
15578
|
-
*/
|
|
15579
|
-
startedAtMs: number().optional(),
|
|
15580
|
-
/**
|
|
15581
|
-
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
15582
|
-
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
15583
|
-
* contribution is asked for.
|
|
15584
|
-
*
|
|
15585
|
-
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
15586
|
-
* needs a sampler, and a new per-node sampler is the defect half of
|
|
15587
|
-
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
15588
|
-
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
15589
|
-
*
|
|
15590
|
-
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
15591
|
-
* an entry with no process.
|
|
15592
|
-
*/
|
|
15593
|
-
cpuSeconds: number().optional(),
|
|
15594
|
-
/** Resident bytes of this unit's process, same source and same rules. */
|
|
15595
|
-
rssBytes: number().optional()
|
|
15596
|
-
});
|
|
15597
|
-
var loadContributionCapability = {
|
|
15598
|
-
name: "load-contribution",
|
|
15599
|
-
scope: "system",
|
|
15600
|
-
mode: "collection",
|
|
15601
|
-
internal: true,
|
|
15602
|
-
methods: {
|
|
15603
|
-
/**
|
|
15604
|
-
* This addon's own cost entries, computed live from state it already
|
|
15605
|
-
* holds. Inert: no persistence, no sampling, no timer. It is answered on
|
|
15606
|
-
* whatever beat the caller already has.
|
|
15607
|
-
*/
|
|
15608
|
-
list: method(_void(), array(LoadContributionSchema).readonly()) },
|
|
15609
|
-
/** In-process only — enumerated through `addons.listCapabilityProviders`. */
|
|
15610
|
-
mount: { kind: "skip" }
|
|
15611
|
-
};
|
|
15612
|
-
/**
|
|
15613
15660
|
* `login-method` — collection cap through which auth addons contribute
|
|
15614
15661
|
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
15615
15662
|
* generic mechanism that supersedes the dead `auth.listProviders` reader:
|
|
@@ -20796,12 +20843,53 @@ var MediaFileKindEnum = _enum([
|
|
|
20796
20843
|
"keyFrameSmall",
|
|
20797
20844
|
"thumbnailSmall"
|
|
20798
20845
|
]);
|
|
20846
|
+
/**
|
|
20847
|
+
* One media row ON THE WIRE: what it is, how big it is, and WHERE ITS BYTES
|
|
20848
|
+
* ARE — never the bytes themselves.
|
|
20849
|
+
*
|
|
20850
|
+
* ## Why `url` and not `base64`
|
|
20851
|
+
*
|
|
20852
|
+
* Measured on the live hub 2026-08-30: `getTrackMedia {trackId, deviceId}`
|
|
20853
|
+
* with no `kinds` returned 6 rows / **3 597 219 B**, of which `keyFrame` alone
|
|
20854
|
+
* was **2 824 077 B** — one full-resolution frame, base64, so +33 % on the
|
|
20855
|
+
* wire. Forty events is ~144 MB. Every byte of it was read off disk,
|
|
20856
|
+
* base64-encoded, held whole in a unary tRPC envelope, and materialised in
|
|
20857
|
+
* hub-main's heap on the way past — for an `<img>` that would have cached it.
|
|
20858
|
+
*
|
|
20859
|
+
* `url` points at the `event-media` data plane
|
|
20860
|
+
* (`/addon/<addonId>/event-media/<storedKey>`), which serves the same blob
|
|
20861
|
+
* with an ETag and `Cache-Control: immutable`, honours conditional GETs, can
|
|
20862
|
+
* render a `?variant=thumb`, and streams. The hub gate in front of it requires
|
|
20863
|
+
* a bearer or the session cookie (`access: 'authenticated'`), so the bytes are
|
|
20864
|
+
* no less protected than they were inside a `view`-level cap response — see
|
|
20865
|
+
* `data-plane-access.ts` for the rule and the one gap it does not close
|
|
20866
|
+
* (per-device scoping).
|
|
20867
|
+
*
|
|
20868
|
+
* The URL is built from the row's **stored** key, which is not always its
|
|
20869
|
+
* published `kind`: a track's face/plate crop is stored as `crop` under
|
|
20870
|
+
* `('face'|'plate', '<prefix>-<trackId>')` and published as
|
|
20871
|
+
* `faceCrop`/`plateCrop`. `MediaStore.getByKey` knows only the stored key.
|
|
20872
|
+
*
|
|
20873
|
+
* ## `base64` is TRANSITIONAL and is going away
|
|
20874
|
+
*
|
|
20875
|
+
* It is still populated for one reason: the deployed viewer's track-detail
|
|
20876
|
+
* HERO tile reads it (`use-track-media-entry.ts` → `parseMediaFiles`, which
|
|
20877
|
+
* REQUIRES the field), and a row without it parses as a FAILED read — the red
|
|
20878
|
+
* triangle — not as absence. Removing the field before that viewer ships is an
|
|
20879
|
+
* outage, not a cleanup. Once the viewer takes its hero bytes from `url`,
|
|
20880
|
+
* delete this line and the `withBytes` pass-through in
|
|
20881
|
+
* `analytics-query-facade.ts`; nothing else reads it.
|
|
20882
|
+
*/
|
|
20799
20883
|
var MediaFileSchema = object({
|
|
20800
20884
|
key: string(),
|
|
20801
20885
|
kind: MediaFileKindEnum,
|
|
20802
|
-
base64: string(),
|
|
20803
20886
|
sizeBytes: number(),
|
|
20804
20887
|
timestamp: number()
|
|
20888
|
+
}).extend({
|
|
20889
|
+
/** `/addon/<addonId>/event-media/<encoded stored key>`. Always present. */
|
|
20890
|
+
url: string(),
|
|
20891
|
+
/** @deprecated Transitional — see the schema docblock. Use {@link url}. */
|
|
20892
|
+
base64: string()
|
|
20805
20893
|
});
|
|
20806
20894
|
/**
|
|
20807
20895
|
* One media row WITHOUT its bytes.
|
|
@@ -20813,7 +20901,9 @@ var MediaFileSchema = object({
|
|
|
20813
20901
|
* blocks the whole view.
|
|
20814
20902
|
*
|
|
20815
20903
|
* `sizeBytes` is carried because it is what lets a client decide between the
|
|
20816
|
-
* stored blob and a `?variant=thumb` rendering without fetching either
|
|
20904
|
+
* stored blob and a `?variant=thumb` rendering without fetching either, and
|
|
20905
|
+
* `url` because a client that had to build the plane path itself is a second
|
|
20906
|
+
* copy of a route — the embed, the viewer and the admin UI each grew one.
|
|
20817
20907
|
*/
|
|
20818
20908
|
var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
|
|
20819
20909
|
/**
|
|
@@ -21502,6 +21592,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
21502
21592
|
}), array(MediaFileSchema).readonly()), method(object({
|
|
21503
21593
|
trackId: string(),
|
|
21504
21594
|
deviceId: number()
|
|
21595
|
+
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
21596
|
+
eventId: string(),
|
|
21597
|
+
deviceId: number()
|
|
21505
21598
|
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
21506
21599
|
kind: "mutation",
|
|
21507
21600
|
auth: "admin"
|
|
@@ -26073,10 +26166,24 @@ var FaceClusterSchema = object({
|
|
|
26073
26166
|
size: number().int(),
|
|
26074
26167
|
cohesion: number()
|
|
26075
26168
|
});
|
|
26169
|
+
/**
|
|
26170
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
26171
|
+
* are — never the bytes.
|
|
26172
|
+
*
|
|
26173
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
26174
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
26175
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
26176
|
+
* caller is the admin UI's detail modal, which was building
|
|
26177
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
26178
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
26179
|
+
*
|
|
26180
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
26181
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
26182
|
+
*/
|
|
26076
26183
|
var MediaFileLiteSchema$1 = object({
|
|
26077
26184
|
key: string(),
|
|
26078
26185
|
kind: string(),
|
|
26079
|
-
|
|
26186
|
+
url: string(),
|
|
26080
26187
|
sizeBytes: number(),
|
|
26081
26188
|
timestamp: number()
|
|
26082
26189
|
});
|
|
@@ -28328,10 +28435,24 @@ var PlateInfoSchema = object({
|
|
|
28328
28435
|
*/
|
|
28329
28436
|
cropUrl: string().optional()
|
|
28330
28437
|
});
|
|
28438
|
+
/**
|
|
28439
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
28440
|
+
* are — never the bytes.
|
|
28441
|
+
*
|
|
28442
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
28443
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
28444
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
28445
|
+
* caller is the admin UI's detail modal, which was building
|
|
28446
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
28447
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
28448
|
+
*
|
|
28449
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
28450
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
28451
|
+
*/
|
|
28331
28452
|
var MediaFileLiteSchema = object({
|
|
28332
28453
|
key: string(),
|
|
28333
28454
|
kind: string(),
|
|
28334
|
-
|
|
28455
|
+
url: string(),
|
|
28335
28456
|
sizeBytes: number(),
|
|
28336
28457
|
timestamp: number()
|
|
28337
28458
|
});
|
|
@@ -34673,6 +34794,12 @@ Object.freeze({
|
|
|
34673
34794
|
addonId: null,
|
|
34674
34795
|
access: "view"
|
|
34675
34796
|
},
|
|
34797
|
+
"pipelineAnalytics.listEventMedia": {
|
|
34798
|
+
capName: "pipeline-analytics",
|
|
34799
|
+
capScope: "device",
|
|
34800
|
+
addonId: null,
|
|
34801
|
+
access: "view"
|
|
34802
|
+
},
|
|
34676
34803
|
"pipelineAnalytics.listGroups": {
|
|
34677
34804
|
capName: "pipeline-analytics",
|
|
34678
34805
|
capScope: "device",
|
|
@@ -38296,6 +38423,11 @@ Object.freeze({
|
|
|
38296
38423
|
form: "array",
|
|
38297
38424
|
optional: false
|
|
38298
38425
|
}],
|
|
38426
|
+
"pipelineAnalytics.listEventMedia": [{
|
|
38427
|
+
name: "deviceId",
|
|
38428
|
+
form: "single",
|
|
38429
|
+
optional: false
|
|
38430
|
+
}],
|
|
38299
38431
|
"pipelineAnalytics.listGroups": [{
|
|
38300
38432
|
name: "deviceIds",
|
|
38301
38433
|
form: "array",
|