@camstack/addon-pipeline 1.2.152 → 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.
Files changed (38) hide show
  1. package/dist/audio-analyzer/index.js +2 -2
  2. package/dist/audio-analyzer/index.mjs +2 -2
  3. package/dist/detection-pipeline/index.js +5 -5
  4. package/dist/detection-pipeline/index.mjs +4 -4
  5. package/dist/{dist-BpofTthV.js → dist-DnVnWACi.js} +292 -207
  6. package/dist/{dist-DoaR6NDJ.mjs → dist-Dsritt4-.mjs} +292 -207
  7. package/dist/{lazy-sharp-D6sSNL-G.js → lazy-sharp-DZWYKdV2.js} +1 -1
  8. package/dist/{local-frame-registry-4MCvZQ2t.js → local-frame-registry-BpFLRfbw.js} +1 -1
  9. package/dist/{local-frame-registry-Dr8irbU_.mjs → local-frame-registry-Yf-uIxbS.mjs} +1 -1
  10. package/dist/motion-wasm/index.js +2 -2
  11. package/dist/motion-wasm/index.mjs +1 -1
  12. package/dist/{node-DG_kTYFM.js → node-C5xmFvjS.js} +1 -1
  13. package/dist/{node-CeSZTDKV.mjs → node-CNGxkfes.mjs} +1 -1
  14. package/dist/pipeline-runner/index.js +5 -5
  15. package/dist/pipeline-runner/index.mjs +4 -4
  16. package/dist/{process-memory-DglWLA3J.js → process-memory-COT8rA8L.js} +1 -1
  17. package/dist/{process-memory-DJoquJSu.mjs → process-memory-DX_KCfdx.mjs} +1 -1
  18. package/dist/recorder/index.js +2 -2
  19. package/dist/recorder/index.mjs +2 -2
  20. package/dist/{segment-demux-js-Clx6DzLe.mjs → segment-demux-js-CTFSl-b9.mjs} +1 -1
  21. package/dist/{segment-demux-js-DUSMkFTq.js → segment-demux-js-Dwg9Jq5_.js} +1 -1
  22. package/dist/session-decode/decode-worker-child.js +2 -2
  23. package/dist/session-decode/decode-worker-child.mjs +1 -1
  24. package/dist/stream-broker/_stub.js +2 -2
  25. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-BntoKYim.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-ZucA907q.mjs} +3 -3
  26. 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
  27. 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
  28. package/dist/stream-broker/demux-worker-child.js +1 -1
  29. package/dist/stream-broker/demux-worker-child.mjs +1 -1
  30. package/dist/stream-broker/{hostInit--5tl1XaO.mjs → hostInit-BqUcM0Fh.mjs} +3 -3
  31. package/dist/stream-broker/index.js +3 -3
  32. package/dist/stream-broker/index.mjs +3 -3
  33. package/dist/stream-broker/remoteEntry.js +1 -1
  34. package/dist/{worker-protocol-C8bHw-bu.js → worker-protocol-BsvaPb-G.js} +1 -1
  35. package/dist/{worker-protocol-Ar0-GAh5.mjs → worker-protocol-CDBQXOIu.mjs} +1 -1
  36. package/package.json +1 -1
  37. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-C-HJX19g.mjs +0 -26
  38. 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
@@ -2,8 +2,8 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-BpofTthV.js");
6
- const require_process_memory = require("../process-memory-DglWLA3J.js");
5
+ const require_dist = require("../dist-DnVnWACi.js");
6
+ const require_process_memory = require("../process-memory-COT8rA8L.js");
7
7
  let node_fs = require("node:fs");
8
8
  node_fs = require_dist.__toESM(node_fs);
9
9
  let node_path = require("node:path");
@@ -1,6 +1,6 @@
1
1
  import { n as __require } from "../chunk-DnnnRqeS.mjs";
2
- import { A as audioAnalysisCapability, It as hydrateSchema, S as PoolMemoryWatchdog, _t as resolvePoolMemoryPolicy, j as audioAnalyzerCapability, jt as BaseAddon, n as AUDIO_BACKEND_CHOICES, nt as mapAudioLabelToMacro, s as DEFAULT_AUDIO_ANALYZER_CONFIG, v as HF_BASE_URL, wt as errMsg } from "../dist-DoaR6NDJ.mjs";
3
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-DJoquJSu.mjs";
2
+ import { A as audioAnalysisCapability, It as hydrateSchema, S as PoolMemoryWatchdog, _t as resolvePoolMemoryPolicy, j as audioAnalyzerCapability, jt as BaseAddon, n as AUDIO_BACKEND_CHOICES, nt as mapAudioLabelToMacro, s as DEFAULT_AUDIO_ANALYZER_CONFIG, v as HF_BASE_URL, wt as errMsg } from "../dist-Dsritt4-.mjs";
3
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-DX_KCfdx.mjs";
4
4
  import * as fs from "node:fs";
5
5
  import * as path$1 from "node:path";
6
6
  import { downloadFile } from "@camstack/system/addon-utils";
@@ -2,12 +2,12 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-BpofTthV.js");
6
- const require_node = require("../node-DG_kTYFM.js");
7
- const require_local_frame_registry = require("../local-frame-registry-4MCvZQ2t.js");
8
- const require_lazy_sharp = require("../lazy-sharp-D6sSNL-G.js");
5
+ const require_dist = require("../dist-DnVnWACi.js");
6
+ const require_node = require("../node-C5xmFvjS.js");
7
+ const require_local_frame_registry = require("../local-frame-registry-BpFLRfbw.js");
8
+ const require_lazy_sharp = require("../lazy-sharp-DZWYKdV2.js");
9
9
  const require_event_loop_stall_monitor = require("../event-loop-stall-monitor-DaUBcb13.js");
10
- const require_process_memory = require("../process-memory-DglWLA3J.js");
10
+ const require_process_memory = require("../process-memory-COT8rA8L.js");
11
11
  let node_fs = require("node:fs");
12
12
  node_fs = require_dist.__toESM(node_fs);
13
13
  let node_path = require("node:path");
@@ -1,10 +1,10 @@
1
1
  import { n as __require } from "../chunk-DnnnRqeS.mjs";
2
- import { Bt as nodePin, Ft as createEvent, It as hydrateSchema, Kt as array, O as YAMNET_TO_MACRO, Q as inferModelProvider, Qt as object, S as PoolMemoryWatchdog, St as supportedRuntimes$1, Vt as parseJsonUnknown, W as detectionPipelineCapability, Wt as sleep, Y as evaluateZoneRules, _t as resolvePoolMemoryPolicy, at as overlayClusterStepSettings, c as DEFAULT_CLUSTER_STEP_MODELS, ct as pickClusterStepSettings, dt as pipelineExecutorCapability, en as string, et as loadContributionCapability, ht as resolveClusterStepModelId, jt as BaseAddon, l as DEFAULT_CLUSTER_STEP_SETTINGS, m as DEVICE_BACKEND_TO_FORMAT, nn as EventCategory, q as enumerateInferenceDevices, st as pickClusterStepModels, t as APPLE_SA_TO_MACRO, tn as union, wt as errMsg, yt as runtimeDevices$1, z as defaultDeviceFor$1 } from "../dist-DoaR6NDJ.mjs";
3
- import { a as readProcessCost } from "../node-CeSZTDKV.mjs";
4
- import { a as getDefaultModelForFormat, c as getStepDefinition, i as ALL_STEPS, l as resolveModelForFormat, o as getDefaultModelForFormatFromDef, r as ALL_PIPELINE_STEPS, s as getStep, t as localFrameRegistry, u as landmarkPrecisionVerdict } from "../local-frame-registry-Dr8irbU_.mjs";
2
+ import { Bt as nodePin, Ft as createEvent, It as hydrateSchema, Kt as array, O as YAMNET_TO_MACRO, Q as inferModelProvider, Qt as object, S as PoolMemoryWatchdog, St as supportedRuntimes$1, Vt as parseJsonUnknown, W as detectionPipelineCapability, Wt as sleep, Y as evaluateZoneRules, _t as resolvePoolMemoryPolicy, at as overlayClusterStepSettings, c as DEFAULT_CLUSTER_STEP_MODELS, ct as pickClusterStepSettings, dt as pipelineExecutorCapability, en as string, et as loadContributionCapability, ht as resolveClusterStepModelId, jt as BaseAddon, l as DEFAULT_CLUSTER_STEP_SETTINGS, m as DEVICE_BACKEND_TO_FORMAT, nn as EventCategory, q as enumerateInferenceDevices, st as pickClusterStepModels, t as APPLE_SA_TO_MACRO, tn as union, wt as errMsg, yt as runtimeDevices$1, z as defaultDeviceFor$1 } from "../dist-Dsritt4-.mjs";
3
+ import { a as readProcessCost } from "../node-CNGxkfes.mjs";
4
+ import { a as getDefaultModelForFormat, c as getStepDefinition, i as ALL_STEPS, l as resolveModelForFormat, o as getDefaultModelForFormatFromDef, r as ALL_PIPELINE_STEPS, s as getStep, t as localFrameRegistry, u as landmarkPrecisionVerdict } from "../local-frame-registry-Yf-uIxbS.mjs";
5
5
  import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
6
6
  import { n as startEventLoopStallMonitor } from "../event-loop-stall-monitor-DXLNBMkY.mjs";
7
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-DJoquJSu.mjs";
7
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-DX_KCfdx.mjs";
8
8
  import * as fs from "node:fs";
9
9
  import * as path$1 from "node:path";
10
10
  import { spawn } from "node:child_process";
@@ -14836,6 +14836,133 @@ method(object({
14836
14836
  height: number()
14837
14837
  }), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
14838
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
+ /**
14839
14966
  * filesystem-browse — per-node capability for browsing the node's local
14840
14967
  * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
14841
14968
  * are sandboxed to operator-configured allowed roots (D115). Used by the
@@ -15357,6 +15484,82 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
15357
15484
  kind: "mutation",
15358
15485
  auth: "admin"
15359
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
+ };
15360
15563
  /**
15361
15564
  * `log-channels` — the capability an addon DECLARES its diagnostic channels
15362
15565
  * through. It stores nothing.
@@ -15454,209 +15657,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
15454
15657
  tags: record(string(), string()).optional()
15455
15658
  }), array(LogEntrySchema).readonly());
15456
15659
  /**
15457
- * `failure-contribution` — the capability an addon reports its OWN losses
15458
- * through, per camera, with the denominator attached. It stores nothing.
15459
- *
15460
- * ## The twin of `load-contribution`, and why it is a twin and not a field
15461
- *
15462
- * `load-contribution` answers *what did this camera COST*. This answers *what
15463
- * did this camera LOSE*. The reporting discipline is identical and deliberately
15464
- * copied: the contributor reports what it already knows, hub-main adds only
15465
- * `addonId`, nothing needs global knowledge, and there is no central list for
15466
- * somebody to forget to edit.
15467
- *
15468
- * They are not merged, because their invariants are opposites:
15469
- *
15470
- * - a `load-contribution` measurement is **absent, never zero** — a zero would
15471
- * claim a camera cost nothing, which is a measurement nobody made;
15472
- * - a `failure-contribution` zero is the **most valuable value on the
15473
- * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
15474
- * and it is exactly what an absent entry cannot say.
15475
- *
15476
- * Putting a loss counter on a cost entry would also break the reconciliation
15477
- * that gives `load-contribution` its point: contributions are subtracted from
15478
- * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
15479
- * has no process.
15480
- *
15481
- * ## Why not a log line, since the counters already exist
15482
- *
15483
- * Several of these paths already counted themselves — `CaptureScheduler`'s
15484
- * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
15485
- * ends in a log line, and a log line is the thing the operator asked to stop
15486
- * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
15487
- * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
15488
- * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
15489
- * media blackout were both diagnosed. The counters stay; this is where they can
15490
- * be READ.
15491
- *
15492
- * ## The rate is served with its denominator or not at all
15493
- *
15494
- * Every entry carries `attempts` and `succeeded`. A miss count alone is
15495
- * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
15496
- * than yesterday" and was **flat across twelve hours** once divided by the
15497
- * successes on the same path. A surface that publishes only the numerator
15498
- * reproduces that mistake on every read.
15499
- *
15500
- * ## Shape
15501
- *
15502
- * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
15503
- * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
15504
- * generated hooks, while `addons.listCapabilityProviders` still enumerates it
15505
- * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
15506
- * a forked runner's entries reach hub-main over transport that already exists.
15507
- * No new UDS message, no second registry (D3). The operator reads the assembled
15508
- * result through `system.getFailureContributions`.
15509
- */
15510
- var FailureReasonCountSchema = object({
15511
- /**
15512
- * Why the attempt did not land, in the contributor's own vocabulary —
15513
- * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
15514
- * strings that already appear in this repo's logs and, where one exists, the
15515
- * same string the per-track `previewMissReason` records (D276): a second
15516
- * vocabulary for the same loss would make the row and the counter
15517
- * un-joinable.
15518
- */
15519
- reason: string(),
15520
- count: number().int().nonnegative()
15521
- });
15522
- var FailureContributionSchema = object({
15523
- /**
15524
- * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
15525
- * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
15526
- * `unit` free: the families are owned by different addons and a shared enum
15527
- * is a central list that rots invisibly.
15528
- */
15529
- family: string(),
15530
- /**
15531
- * The NUMERIC device id — the same value every log line carries as
15532
- * `tags.deviceId`. Never nullable and never absent: a contributor that
15533
- * cannot name the camera must not emit the entry, because a fleet total
15534
- * cannot answer the only question anybody asks of this surface.
15535
- */
15536
- deviceId: number().int().positive(),
15537
- /**
15538
- * A second dimension inside the family: the model / step id for an inference
15539
- * timeout, so "which camera AND which model" is one read. Absent when the
15540
- * family has a single variant.
15541
- */
15542
- variant: string().optional(),
15543
- /**
15544
- * Epoch ms this counter started — the INCARNATION MARKER. A consumer
15545
- * differencing two reads must drop the interval when it changes, because the
15546
- * counter restarted from zero in a respawned runner. Same discipline as
15547
- * `LoadContribution.startedAtMs`.
15548
- */
15549
- sinceMs: number(),
15550
- /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
15551
- atMs: number(),
15552
- /**
15553
- * THE DENOMINATOR — every attempt on this path for this camera in the
15554
- * window. A failure count published without it is the mistake this schema
15555
- * exists to make impossible.
15556
- */
15557
- attempts: number().int().nonnegative(),
15558
- /** Attempts that landed. `attempts - succeeded` is the loss. */
15559
- succeeded: number().int().nonnegative(),
15560
- /** The loss, partitioned. Sums to `attempts - succeeded`. */
15561
- reasons: array(FailureReasonCountSchema).readonly()
15562
- });
15563
- var failureContributionCapability = {
15564
- name: "failure-contribution",
15565
- scope: "system",
15566
- mode: "collection",
15567
- internal: true,
15568
- methods: {
15569
- /**
15570
- * This addon's per-camera failure counters, read live from bounded in-RAM
15571
- * state it already keeps. Inert: no persistence, no sampling, no timer.
15572
- *
15573
- * READING NEVER RESETS. The counters are CUMULATIVE since `sinceMs`, and a
15574
- * consumer that wants a rate differences two reads. A draining read would
15575
- * make two operators with the page open each destroy half of the other's
15576
- * numbers, and `load-contribution` already settled the same question the
15577
- * same way for `cpuSeconds`.
15578
- */
15579
- list: method(_void(), array(FailureContributionSchema).readonly()) },
15580
- /** In-process only — enumerated through `addons.listCapabilityProviders`. */
15581
- mount: { kind: "skip" }
15582
- };
15583
- var LoadContributionSchema = object({
15584
- role: _enum([
15585
- "decode",
15586
- "transcode",
15587
- "recording",
15588
- "streaming",
15589
- "detection"
15590
- ]),
15591
- /**
15592
- * The NUMERIC device id — the same value every log line carries as
15593
- * `tags.deviceId`. `null` means this cost genuinely belongs to no single
15594
- * camera (a shared pool), NOT that the contributor forgot to look it up: a
15595
- * contributor that cannot name its camera must not emit the entry at all,
15596
- * because an unnamed per-camera entry is indistinguishable from a shared one
15597
- * and would quietly turn one camera's cost into everybody's.
15598
- */
15599
- deviceId: number().int().positive().nullable(),
15600
- attribution: _enum([
15601
- "measured",
15602
- "accounted",
15603
- "unattributable"
15604
- ]),
15605
- /**
15606
- * What ONE entry is, in the contributor's own words — `615/high`,
15607
- * `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
15608
- * family and inventing a common one would lose the only information that
15609
- * makes two entries for the same camera distinguishable.
15610
- */
15611
- unit: string(),
15612
- /**
15613
- * The OS process this cost lives in, when there is one. Present so a
15614
- * consumer can (a) tell two generations of the same unit apart across a
15615
- * restart, and (b) subtract claimed processes from the node's process
15616
- * snapshot to see what NOBODY claimed. Absent for an entry that owns no
15617
- * process of its own.
15618
- */
15619
- pid: number().int().positive().optional(),
15620
- /**
15621
- * When this generation started. The pid's incarnation marker: a consumer
15622
- * differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
15623
- * window when this changes, because the counter restarted from zero in a new
15624
- * process.
15625
- */
15626
- startedAtMs: number().optional(),
15627
- /**
15628
- * CUMULATIVE CPU seconds this unit has consumed since it started — user +
15629
- * system, read from the child's own `/proc/<pid>/stat` at the moment the
15630
- * contribution is asked for.
15631
- *
15632
- * Cumulative and not a rate on purpose: a rate needs a window, a window
15633
- * needs a sampler, and a new per-node sampler is the defect half of
15634
- * `docs/architecture/load-ledger.md` documents. A counter can be differenced
15635
- * by whoever already keeps a history; a rate cannot be un-averaged.
15636
- *
15637
- * Absent — never zero — on a node with no `/proc`, on a read failure, and on
15638
- * an entry with no process.
15639
- */
15640
- cpuSeconds: number().optional(),
15641
- /** Resident bytes of this unit's process, same source and same rules. */
15642
- rssBytes: number().optional()
15643
- });
15644
- var loadContributionCapability = {
15645
- name: "load-contribution",
15646
- scope: "system",
15647
- mode: "collection",
15648
- internal: true,
15649
- methods: {
15650
- /**
15651
- * This addon's own cost entries, computed live from state it already
15652
- * holds. Inert: no persistence, no sampling, no timer. It is answered on
15653
- * whatever beat the caller already has.
15654
- */
15655
- list: method(_void(), array(LoadContributionSchema).readonly()) },
15656
- /** In-process only — enumerated through `addons.listCapabilityProviders`. */
15657
- mount: { kind: "skip" }
15658
- };
15659
- /**
15660
15660
  * `login-method` — collection cap through which auth addons contribute
15661
15661
  * their pre-auth login surfaces to the login page. This is the SINGLE,
15662
15662
  * generic mechanism that supersedes the dead `auth.listProviders` reader:
@@ -20843,12 +20843,53 @@ var MediaFileKindEnum = _enum([
20843
20843
  "keyFrameSmall",
20844
20844
  "thumbnailSmall"
20845
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
+ */
20846
20883
  var MediaFileSchema = object({
20847
20884
  key: string(),
20848
20885
  kind: MediaFileKindEnum,
20849
- base64: string(),
20850
20886
  sizeBytes: number(),
20851
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()
20852
20893
  });
20853
20894
  /**
20854
20895
  * One media row WITHOUT its bytes.
@@ -20860,7 +20901,9 @@ var MediaFileSchema = object({
20860
20901
  * blocks the whole view.
20861
20902
  *
20862
20903
  * `sizeBytes` is carried because it is what lets a client decide between the
20863
- * 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.
20864
20907
  */
20865
20908
  var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
20866
20909
  /**
@@ -21549,6 +21592,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
21549
21592
  }), array(MediaFileSchema).readonly()), method(object({
21550
21593
  trackId: string(),
21551
21594
  deviceId: number()
21595
+ }), array(MediaFileInfoSchema).readonly()), method(object({
21596
+ eventId: string(),
21597
+ deviceId: number()
21552
21598
  }), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
21553
21599
  kind: "mutation",
21554
21600
  auth: "admin"
@@ -26120,10 +26166,24 @@ var FaceClusterSchema = object({
26120
26166
  size: number().int(),
26121
26167
  cohesion: number()
26122
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
+ */
26123
26183
  var MediaFileLiteSchema$1 = object({
26124
26184
  key: string(),
26125
26185
  kind: string(),
26126
- base64: string(),
26186
+ url: string(),
26127
26187
  sizeBytes: number(),
26128
26188
  timestamp: number()
26129
26189
  });
@@ -28375,10 +28435,24 @@ var PlateInfoSchema = object({
28375
28435
  */
28376
28436
  cropUrl: string().optional()
28377
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
+ */
28378
28452
  var MediaFileLiteSchema = object({
28379
28453
  key: string(),
28380
28454
  kind: string(),
28381
- base64: string(),
28455
+ url: string(),
28382
28456
  sizeBytes: number(),
28383
28457
  timestamp: number()
28384
28458
  });
@@ -34720,6 +34794,12 @@ Object.freeze({
34720
34794
  addonId: null,
34721
34795
  access: "view"
34722
34796
  },
34797
+ "pipelineAnalytics.listEventMedia": {
34798
+ capName: "pipeline-analytics",
34799
+ capScope: "device",
34800
+ addonId: null,
34801
+ access: "view"
34802
+ },
34723
34803
  "pipelineAnalytics.listGroups": {
34724
34804
  capName: "pipeline-analytics",
34725
34805
  capScope: "device",
@@ -38343,6 +38423,11 @@ Object.freeze({
38343
38423
  form: "array",
38344
38424
  optional: false
38345
38425
  }],
38426
+ "pipelineAnalytics.listEventMedia": [{
38427
+ name: "deviceId",
38428
+ form: "single",
38429
+ optional: false
38430
+ }],
38346
38431
  "pipelineAnalytics.listGroups": [{
38347
38432
  name: "deviceIds",
38348
38433
  form: "array",