@tangle-network/sdk-telemetry 0.60.78-develop.20261026103900.8d71e95 → 0.60.78-develop.20261026104149.cd2c53b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,485 @@
1
+ const CREATE_ACCOUNTING_SPEC = {
2
+ totalOperation: "orchestrator.ready",
3
+ postReadyOperations: new Set([
4
+ "orchestrator.container_lookup",
5
+ "orchestrator.snapshot_restore_check",
6
+ "orchestrator.provision_finalize"
7
+ ]),
8
+ prepUmbrella: { operation: "orchestrator.provision_prep" }
9
+ };
10
+ const RESUME_ACCOUNTING_SPEC = {
11
+ totalOperation: "orchestrator.ready",
12
+ postReadyOperations: new Set(["orchestrator.connection_build", "orchestrator.metering_restart"])
13
+ };
14
+ const STOP_ACCOUNTING_SPEC = { totalOperation: "orchestrator.stop_complete" };
15
+ const DELETE_ACCOUNTING_SPEC = { totalOperation: "orchestrator.delete_complete" };
16
+ /**
17
+ * A flat `{name: ms}` ledger read as the tree its names describe.
18
+ *
19
+ * Every producer in this repo emits nested stages FLAT, with the containment
20
+ * in the name: `capture.<hostPhase>` and `capture.restic_<phase>` inside
21
+ * `capture` (snapshot-helpers.ts), `materialize.parentRead|precreate|
22
+ * branchComplete|host.*|child.*|residual` inside `materialize` (branch.ts),
23
+ * `delete.<hostPhase>` inside `delete` and `restore_workspace.<phase>` inside
24
+ * `restore_workspace` (snapshots.ts). Summing every entry as a sibling counts
25
+ * the children inside their parent a second time and reports a wall the
26
+ * orchestrator never spent.
27
+ *
28
+ * So a dotted name is NEVER top-level. It attaches to the longest prefix that
29
+ * exists as a stage; when no prefix exists — the restore job's `host.<phase>`,
30
+ * which the queue records inside `restore_workspace` without naming it
31
+ * (snapshot-job-queue.ts:394) — it is still excluded from the top-level sum
32
+ * and reported as a child of the ledger at large. Excluding it can only leave
33
+ * MORE time unnamed, never fabricate a reconciliation.
34
+ */
35
+ function stageTree(stages) {
36
+ const present = new Set(Object.keys(stages));
37
+ const parentOf = (name) => {
38
+ let cut = name.lastIndexOf(".");
39
+ while (cut > 0) {
40
+ const candidate = name.slice(0, cut);
41
+ if (present.has(candidate)) return candidate;
42
+ cut = candidate.lastIndexOf(".");
43
+ }
44
+ return name.includes(".") ? "" : null;
45
+ };
46
+ const nodes = Object.entries(stages).map(([name, ms]) => ({
47
+ name,
48
+ ms,
49
+ parent: parentOf(name)
50
+ }));
51
+ const topLevel = nodes.filter((node) => node.parent === null);
52
+ return {
53
+ nodes,
54
+ topLevel,
55
+ /** Children whose declared parent is not in the ledger; never summed. */
56
+ orphans: nodes.filter((node) => node.parent === ""),
57
+ topLevelMs: topLevel.reduce((sum, node) => sum + node.ms, 0)
58
+ };
59
+ }
60
+ /**
61
+ * Hops that describe the SHAPE of the request rather than a slice of it: the
62
+ * three nested walls, the transport the walls imply, and the retry counter.
63
+ * They are the terms of the summary line, so ranking them again as sub-stages
64
+ * would print the same milliseconds twice under a second name. `preHandler`
65
+ * joins them because it is the umbrella over the `mw.*` own-times, which ARE
66
+ * ranked.
67
+ */
68
+ const SHAPE_HOPS = new Set([
69
+ "preHandler",
70
+ "total",
71
+ "serverWall",
72
+ "orchestrator",
73
+ "orchestratorServer",
74
+ "transportMarkup",
75
+ "orchestratorRetries"
76
+ ]);
77
+ /** Parent operations contain their descendants and are never counted as leaves. */
78
+ function parentOperations(operations) {
79
+ return new Set(operations.flatMap((op) => typeof op.parent === "string" ? [op.parent] : []));
80
+ }
81
+ /**
82
+ * The measured leaves of one response's span tree, per the flow's own spec.
83
+ *
84
+ * Identical rule to the orchestrator's `computeFlowAccountingResiduals`: drop
85
+ * the total span (it is the window), drop the spans stamped after it closes,
86
+ * and drop any span another span names as its parent (a parent re-measures its
87
+ * children). What is left sums to the window minus its named residual.
88
+ */
89
+ function leafOperations(operations, excluded = /* @__PURE__ */ new Set(), parents = parentOperations(operations)) {
90
+ return operations.filter((op) => !excluded.has(op.operation) && !parents.has(op.operation) && typeof op.durationMs === "number" && Number.isFinite(op.durationMs));
91
+ }
92
+ function operationLeafDurations(operations, excluded = /* @__PURE__ */ new Set()) {
93
+ const leaves = /* @__PURE__ */ new Map();
94
+ for (const op of leafOperations(operations, excluded)) leaves.set(op.operation, (leaves.get(op.operation) ?? 0) + op.durationMs);
95
+ return leaves;
96
+ }
97
+ const difference = (a, b) => a === null || b === null ? null : a - b;
98
+ const positiveDifference = (a, b) => {
99
+ const value = difference(a, b);
100
+ return value === null ? null : Math.max(0, value);
101
+ };
102
+ /**
103
+ * Partition one input before aggregation: null is unavailable; a negative
104
+ * residual is overlapping evidence, never an instruction to publish zero.
105
+ * Callers retain their population grouping, medians and display labels.
106
+ */
107
+ function partitionLifecycleWalls(sample, flow) {
108
+ const present = (value) => typeof value === "number" && Number.isFinite(value) ? value : null;
109
+ const finiteStages = (values) => Object.fromEntries(Object.entries(values ?? {}).filter(([, ms]) => Number.isFinite(ms)));
110
+ const hops = sample.hops ?? {};
111
+ const hop = (key) => Number.isFinite(hops[key]) ? hops[key] : null;
112
+ const handler = hop(flow.workerTotalHop);
113
+ const preHandler = hop("preHandler");
114
+ const hold = flow.settleHop ? hop(flow.settleHop) ?? 0 : 0;
115
+ const workerWallMs = handler === null ? null : Math.max(0, handler - hold) + (flow.addPreHandler ? preHandler ?? 0 : 0);
116
+ const roundTripMs = hop("orchestrator");
117
+ const orchServerMs = hop("orchestratorServer");
118
+ const orchWall = roundTripMs ?? orchServerMs;
119
+ const terms = {
120
+ edge: positiveDifference(sample.httpMs, workerWallMs),
121
+ worker: positiveDifference(workerWallMs, orchWall ?? 0),
122
+ transport: positiveDifference(roundTripMs, orchServerMs),
123
+ orch: orchServerMs ?? roundTripMs,
124
+ job: present(sample.jobMs),
125
+ settle: present(sample.settleMs),
126
+ dark: 0
127
+ };
128
+ terms.dark = sample.wallMs - Object.values(terms).reduce((sum, ms) => sum + (ms ?? 0), 0);
129
+ const postReady = flow.postReadyOperations ?? /* @__PURE__ */ new Set();
130
+ const rawLeaves = sample.spanLeaves ?? Object.fromEntries(operationLeafDurations(sample.spanOps ?? []));
131
+ const spanLeaves = Object.fromEntries(Object.entries(rawLeaves).filter(([name, ms]) => name !== flow.totalOperation && !postReady.has(name) && Number.isFinite(ms)));
132
+ /**
133
+ * The Worker's own handler stages: its ledger minus the three nested walls,
134
+ * the transport they imply and the middleware own-times, which are ranked
135
+ * separately because they run OUTSIDE the handler's `total`.
136
+ */
137
+ const workerStages = Object.fromEntries(Object.entries(hops).filter(([name]) => Number.isFinite(hops[name]) && !SHAPE_HOPS.has(name) && name !== flow.settleHop && !name.startsWith("orch.") && !name.startsWith("mw.")));
138
+ const orchTree = stageTree(finiteStages(sample.orchStages));
139
+ const jobTree = stageTree(finiteStages(sample.jobPhases));
140
+ const spanSum = Object.values(spanLeaves).reduce((sum, ms) => sum + ms, 0);
141
+ const workerNamed = (flow.addPreHandler ? preHandler ?? 0 : 0) + (flow.workerNamedHops ? flow.workerNamedHops.reduce((sum, key) => sum + (hop(key) ?? 0), 0) : stageTree(workerStages).topLevelMs);
142
+ const workerUnattributedMs = difference(terms.worker, workerNamed);
143
+ const orchNamed = orchTree.topLevel.length ? orchTree.topLevelMs : spanSum > 0 ? spanSum : 0;
144
+ const orchUnattributedMs = difference(terms.orch, orchNamed);
145
+ const jobUnattributedMs = difference(terms.job, jobTree.topLevelMs);
146
+ const unnamedMs = Math.max(0, workerUnattributedMs ?? terms.worker ?? 0) + Math.max(0, orchUnattributedMs ?? terms.orch ?? 0) + Math.max(0, jobUnattributedMs ?? terms.job ?? 0) + Math.max(0, terms.dark);
147
+ const measuredTotal = (sample.spanOps ?? []).find((op) => op.operation === flow.totalOperation)?.durationMs;
148
+ const spanTotalMs = present(sample.spanTotalMs ?? measuredTotal);
149
+ const readySum = sample.spanAccountedMs ?? spanSum;
150
+ const readyTerm = spanTotalMs ?? readySum;
151
+ const orchTerm = roundTripMs ?? orchServerMs ?? readyTerm;
152
+ let clampedMs = 0;
153
+ const diff = (a, b) => {
154
+ const delta = difference(a, b);
155
+ if (delta === null) return null;
156
+ clampedMs += Math.max(0, -delta);
157
+ return Math.max(0, delta);
158
+ };
159
+ const transportMs = diff(roundTripMs, orchServerMs);
160
+ const afterSpanMs = diff(orchServerMs, spanTotalMs);
161
+ const pathSum = workerNamed + orchTerm;
162
+ const window = {
163
+ transportMs,
164
+ afterSpanMs,
165
+ outerMs: workerWallMs === null ? diff(sample.wallMs - readyTerm, workerNamed + (transportMs ?? 0) + (afterSpanMs ?? 0)) : diff(sample.wallMs, workerWallMs),
166
+ workerUnattributedMs: positiveDifference(workerWallMs, pathSum),
167
+ workerOwnMs: positiveDifference(workerWallMs, orchTerm),
168
+ gaps: {
169
+ overlapMs: positiveDifference(readySum, spanTotalMs) ?? 0,
170
+ underTileMs: positiveDifference(spanTotalMs, readySum) ?? 0,
171
+ workerOverlapMs: positiveDifference(pathSum, workerWallMs) ?? 0,
172
+ unrowedMs: workerWallMs === null ? 0 : Math.max(0, orchTerm - readyTerm - (transportMs ?? 0) - (afterSpanMs ?? 0)),
173
+ clampedMs
174
+ }
175
+ };
176
+ return {
177
+ wallMs: sample.wallMs,
178
+ httpMs: sample.httpMs,
179
+ workerWallMs,
180
+ roundTripMs,
181
+ orchServerMs,
182
+ orchIncludesTransport: orchServerMs === null && roundTripMs !== null,
183
+ workerIncludesTransport: roundTripMs === null && orchServerMs !== null,
184
+ terms,
185
+ workerUnattributedMs,
186
+ orchUnattributedMs,
187
+ jobUnattributedMs,
188
+ unnamedMs,
189
+ unnamedShare: sample.wallMs > 0 ? unnamedMs / sample.wallMs : 0,
190
+ overcountMs: Math.max(0, -terms.dark),
191
+ spanLeaves,
192
+ workerStages,
193
+ orchTree,
194
+ jobTree,
195
+ spanTotalMs,
196
+ window
197
+ };
198
+ }
199
+ //#endregion
200
+ //#region src/create-wall.ts
201
+ /** Exclusive create-request wall phases; nested service spans are a separate view. */
202
+ const CREATE_WALL_PHASES = [
203
+ "middleware",
204
+ "identity",
205
+ "preflight",
206
+ "tenantCoordination",
207
+ "configuration",
208
+ "leaseSelection",
209
+ "credentialJournal",
210
+ "quotaReservation",
211
+ "orchestrator",
212
+ "provisionResponse",
213
+ "responseBody",
214
+ "credentialAllocation",
215
+ "postCreate",
216
+ "response"
217
+ ];
218
+ const REQUIRED_PHASES = CREATE_WALL_PHASES.filter((phase) => phase !== "middleware" && phase !== "leaseSelection" && phase !== "tenantCoordination");
219
+ /** The original other-Worker + post-create budget, including auth/middleware. */
220
+ function createBookkeepingPostWall(phases) {
221
+ return CREATE_WALL_PHASES.reduce((sum, phase) => sum + (phase === "preflight" || phase === "orchestrator" ? 0 : phases[phase]), 0);
222
+ }
223
+ /**
224
+ * One cursor owned by the sequential request path. Parallel operations keep
225
+ * their own spans and never transition this cursor from their callbacks.
226
+ * Invalid clocks or missing caller hooks withhold a complete measurement.
227
+ */
228
+ function createWallTiming(startedAt) {
229
+ const phases = Object.fromEntries(CREATE_WALL_PHASES.map((phase) => [phase, 0]));
230
+ const visited = new Set(["identity"]);
231
+ let current = "identity";
232
+ let cursor = startedAt;
233
+ let valid = Number.isFinite(startedAt);
234
+ let finished = false;
235
+ return {
236
+ phase(name, at) {
237
+ if (finished || !Number.isFinite(at) || at < cursor) {
238
+ valid = false;
239
+ return;
240
+ }
241
+ phases[current] += at - cursor;
242
+ cursor = at;
243
+ current = name;
244
+ visited.add(name);
245
+ },
246
+ finish(receivedAt, respondedAt) {
247
+ if (finished || !valid || !Number.isFinite(receivedAt) || !Number.isFinite(respondedAt) || receivedAt > startedAt || respondedAt < cursor || REQUIRED_PHASES.some((phase) => !visited.has(phase))) {
248
+ finished = true;
249
+ return null;
250
+ }
251
+ finished = true;
252
+ phases[current] += respondedAt - cursor;
253
+ phases.middleware = startedAt - receivedAt;
254
+ const totalMs = respondedAt - receivedAt;
255
+ if (Object.values(phases).reduce((sum, ms) => sum + ms, 0) !== totalMs) return null;
256
+ return {
257
+ phases: { ...phases },
258
+ totalMs,
259
+ bookkeepingPostCreateMs: createBookkeepingPostWall(phases)
260
+ };
261
+ }
262
+ };
263
+ }
264
+ /** Read the already-parsed header. Historical/incomplete/overlapping rows stay unknown. */
265
+ function readCreateWallTiming(stages) {
266
+ const totalMs = stages["createWall.total"];
267
+ if (!Number.isFinite(totalMs) || totalMs < 0 || totalMs !== stages.outerWall) return null;
268
+ const phases = {};
269
+ for (const phase of CREATE_WALL_PHASES) {
270
+ const value = stages[`createWall.${phase}`];
271
+ if (!Number.isFinite(value) || value < 0) return null;
272
+ phases[phase] = value;
273
+ }
274
+ if (Object.values(phases).reduce((sum, ms) => sum + ms, 0) !== totalMs) return null;
275
+ return {
276
+ phases,
277
+ totalMs,
278
+ bookkeepingPostCreateMs: createBookkeepingPostWall(phases)
279
+ };
280
+ }
281
+ //#endregion
282
+ //#region src/server-timing-parser.mjs
283
+ function splitHeader(value, separator) {
284
+ const parts = [];
285
+ let start = 0;
286
+ let quoted = false;
287
+ for (let i = 0; i < value.length; i++) if (quoted && value[i] === "\\") i++;
288
+ else if (value[i] === "\"") quoted = !quoted;
289
+ else if (!quoted && value[i] === separator) {
290
+ parts.push(value.slice(start, i));
291
+ start = i + 1;
292
+ }
293
+ parts.push(value.slice(start));
294
+ return parts;
295
+ }
296
+ /** Missing or malformed durations remain unmeasured, never zero. */
297
+ function parseServerTiming(header) {
298
+ if (!header) return [];
299
+ const entries = [];
300
+ for (const metric of splitHeader(header, ",")) {
301
+ const [rawName, ...params] = splitHeader(metric, ";");
302
+ const name = rawName.trim();
303
+ if (!/^[!#$%&'*+.^_`|~\w-]+$/.test(name)) continue;
304
+ const entry = { name };
305
+ const seen = /* @__PURE__ */ new Set();
306
+ for (const param of params) {
307
+ const eq = param.indexOf("=");
308
+ const key = (eq < 0 ? param : param.slice(0, eq)).trim().toLowerCase();
309
+ if (seen.has(key)) continue;
310
+ seen.add(key);
311
+ if (eq < 0) continue;
312
+ let value = param.slice(eq + 1).trim();
313
+ if (value.startsWith("\"")) {
314
+ if (!/^"(?:[^"\\]|\\[\s\S])*"$/.test(value)) continue;
315
+ value = value.slice(1, -1).replace(/\\([\s\S])/g, "$1");
316
+ }
317
+ if (key === "desc") entry.desc = value;
318
+ else if (key === "dur" && /^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i.test(value)) {
319
+ const duration = Number(value);
320
+ if (Number.isFinite(duration)) entry.dur = duration;
321
+ }
322
+ }
323
+ entries.push(entry);
324
+ }
325
+ return entries;
326
+ }
327
+ /** A stage ledger retains only duration-bearing entries; later metrics win. */
328
+ function parseServerTimingDurations(header) {
329
+ return Object.fromEntries(parseServerTiming(header).filter((entry) => entry.dur !== void 0).map(({ name, dur }) => [name, dur]));
330
+ }
331
+ /** Closed wire observations; these names carry no credential or authority values. */
332
+ const PLATFORM_VERDICT_REUSE_REASONS = Object.freeze([
333
+ "entry_changed",
334
+ "refusal_observed",
335
+ "current_compliance",
336
+ "negative_age",
337
+ "retention_elapsed",
338
+ "key_expired",
339
+ "feed_missing",
340
+ "feed_stale",
341
+ "feed_generation",
342
+ "dependencies_empty",
343
+ "dependency_revision",
344
+ "dependency_floor",
345
+ "grant_missing",
346
+ "grant_unreadable",
347
+ "grant_shape",
348
+ "grant_negative_age",
349
+ "grant_retention_elapsed",
350
+ "shared_refusal_observed",
351
+ "shared_refusal_unreadable",
352
+ "shared_read_unavailable",
353
+ "grant_invalid",
354
+ "grant_validation",
355
+ "verification_inflight",
356
+ "feed_contradiction",
357
+ "current_required",
358
+ "lkg_retention_elapsed"
359
+ ]);
360
+ /** Closed request-phase wire vocabulary, shared by producer and safe consumers. */
361
+ const HTTP_REQUEST_PHASE_NAMES = Object.freeze([
362
+ "external.provision",
363
+ "benchmarks.records.load",
364
+ "benchmarks.records.build",
365
+ "benchmarks.records.page",
366
+ "benchmarks.records.json",
367
+ "admission.host.list",
368
+ "host.records.ready",
369
+ "host.records.scan",
370
+ "host.records.read",
371
+ "host.records.metadata",
372
+ "host.records.project",
373
+ "host.records.retry",
374
+ "admission.metadata",
375
+ "admission.json",
376
+ "observability.refresh.wait",
377
+ "fleet.sidecars",
378
+ "native-export.snapshot.wait",
379
+ "native-export.prepare.wait",
380
+ "native-export.collect.wait",
381
+ "scorecard.fleet.wait",
382
+ "scorecard.capacity.wait",
383
+ "scorecard.coverage.wait",
384
+ "scorecard.compose",
385
+ "scorecard.json",
386
+ "proxy.model_refresh",
387
+ "proxy.hub.lock_wait",
388
+ "proxy.hub.refresh",
389
+ "proxy.hub.state",
390
+ "proxy.hub.proof",
391
+ "proxy.hub.delivery",
392
+ "proxy.runtime_token",
393
+ "snapshot.delete.lock",
394
+ "snapshot.delete.credentials",
395
+ "snapshot.delete.list",
396
+ "snapshot.delete.generation"
397
+ ]);
398
+ function httpRequestPhaseFromTimingName(name) {
399
+ const prefix = name.startsWith("orch.phase.") ? "orch.phase." : "phase.";
400
+ if (!name.startsWith(prefix)) return void 0;
401
+ const phase = name.slice(prefix.length);
402
+ return HTTP_REQUEST_PHASE_NAMES.includes(phase) ? phase : void 0;
403
+ }
404
+ const PLATFORM_VERDICT_SCOPE_CLASSES = Object.freeze([
405
+ "key",
406
+ "identity",
407
+ "owner_user",
408
+ "owner_team",
409
+ "lineage",
410
+ "other"
411
+ ]);
412
+ const PLATFORM_VERDICT_EVIDENCE_ORDERS = Object.freeze([
413
+ "feed_before_observation",
414
+ "feed_at_observation",
415
+ "feed_after_observation",
416
+ "unknown"
417
+ ]);
418
+ /** Bounded, closed-schema origin phase projection for the two Worker ledgers.
419
+ * Duplicate observations remain separate; different origins/attempts cannot be summed.
420
+ */
421
+ const HTTP_PHASE_COVERAGE_FIELDS = Object.freeze([
422
+ "stored",
423
+ "emitted",
424
+ "omitted",
425
+ "invalid",
426
+ "collisions",
427
+ "headerDropped"
428
+ ]);
429
+ function createUpstreamHttpPhaseProjection() {
430
+ const entries = [];
431
+ let bytes = 0;
432
+ let dropped = 0;
433
+ let rejectedInputs = 0;
434
+ const fields = HTTP_PHASE_COVERAGE_FIELDS;
435
+ const byteLength = (value) => new TextEncoder().encode(value).length;
436
+ const keep = (entry) => {
437
+ const size = byteLength(entry) + 2;
438
+ if (entries.length >= 31 || bytes + size > 3900) {
439
+ dropped++;
440
+ return;
441
+ }
442
+ entries.push(entry);
443
+ bytes += size;
444
+ };
445
+ return {
446
+ absorb(header) {
447
+ if (header == null) return;
448
+ if (typeof header !== "string" || header.length > 4096 || byteLength(header) > 4096) {
449
+ rejectedInputs++;
450
+ return;
451
+ }
452
+ for (const entry of parseServerTiming(header)) if (entry.name === "phase.coverage") {
453
+ const counts = {};
454
+ const parts = (entry.desc ?? "").split(",");
455
+ if (parts.length !== fields.length) {
456
+ dropped++;
457
+ continue;
458
+ }
459
+ for (const part of parts) {
460
+ const [key, value, ...extra] = part.split("=");
461
+ if (extra.length || !fields.includes(key) || Object.hasOwn(counts, key) || !/^(?:0|[1-9]\d*)$/.test(value ?? "") || !Number.isSafeInteger(Number(value))) break;
462
+ counts[key] = Number(value);
463
+ }
464
+ if (Object.keys(counts).length !== fields.length) {
465
+ dropped++;
466
+ continue;
467
+ }
468
+ keep(`orch.phase.coverage;desc="${fields.map((key) => `${key}=${counts[key]}`).join(",")}"`);
469
+ } else if (entry.name.startsWith("phase.")) {
470
+ if (!httpRequestPhaseFromTimingName(entry.name) || !Number.isFinite(entry.dur) || entry.dur < 0 || !/^outcome=(?:completed|error)$/.test(entry.desc ?? "")) {
471
+ dropped++;
472
+ continue;
473
+ }
474
+ keep(`orch.${entry.name};dur=${Math.round(entry.dur)};desc="${entry.desc}"`);
475
+ }
476
+ },
477
+ entries() {
478
+ return [...entries, ...dropped || rejectedInputs ? [`orch.phase.forwarding;desc="dropped=${dropped},rejectedInputs=${rejectedInputs}"`] : []];
479
+ }
480
+ };
481
+ }
482
+ //#endregion
483
+ export { stageTree as S, STOP_ACCOUNTING_SPEC as _, PLATFORM_VERDICT_SCOPE_CLASSES as a, parentOperations as b, parseServerTiming as c, createBookkeepingPostWall as d, createWallTiming as f, RESUME_ACCOUNTING_SPEC as g, DELETE_ACCOUNTING_SPEC as h, PLATFORM_VERDICT_REUSE_REASONS as i, parseServerTimingDurations as l, CREATE_ACCOUNTING_SPEC as m, HTTP_REQUEST_PHASE_NAMES as n, createUpstreamHttpPhaseProjection as o, readCreateWallTiming as p, PLATFORM_VERDICT_EVIDENCE_ORDERS as r, httpRequestPhaseFromTimingName as s, HTTP_PHASE_COVERAGE_FIELDS as t, CREATE_WALL_PHASES as u, leafOperations as v, partitionLifecycleWalls as x, operationLeafDurations as y };
484
+
485
+ //# sourceMappingURL=server-timing-HI-hXI39.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-timing-HI-hXI39.mjs","names":[],"sources":["../src/lifecycle-wall.ts","../src/create-wall.ts","../src/server-timing-parser.mjs"],"sourcesContent":["/**\n * The `ready` span carries the end-to-end create wall (caller start → the end\n * of createSidecar). These operations run AFTER `ready` is stamped, so they sit\n * OUTSIDE the ready window and must never be summed into the leaf total or the\n * residual goes negative.\n */\nconst CREATE_POST_READY_OPERATIONS = new Set([\n \"orchestrator.container_lookup\",\n \"orchestrator.snapshot_restore_check\",\n \"orchestrator.provision_finalize\",\n]);\n\n/**\n * Per-flow shape of the accounting window. `totalOperation` is the span whose\n * wall the named leaves must tile; `postReadyOperations` run AFTER it is\n * stamped (excluded from the leaf sum); `prepUmbrella` is the optional\n * create-style split of an entry umbrella minus its measured leaf children. Absent\n * `prepUmbrella` ⇒ `prepUnaccountedMs` is always 0 and the whole dark falls\n * into `unaccountedMs` (the shape every non-create flow uses).\n */\nexport type FlowAccountingSpec = {\n totalOperation: string;\n postReadyOperations?: ReadonlySet<string>;\n prepUmbrella?: { operation: string };\n};\n\nexport const CREATE_ACCOUNTING_SPEC: FlowAccountingSpec = {\n totalOperation: \"orchestrator.ready\",\n postReadyOperations: CREATE_POST_READY_OPERATIONS,\n prepUmbrella: {\n operation: \"orchestrator.provision_prep\",\n },\n};\n\nexport const RESUME_ACCOUNTING_SPEC: FlowAccountingSpec = {\n // resumeSidecar (and the reprovision fallback assembly in resume()) stamps\n // `orchestrator.ready` from the route's startupStartedAt — the resume total\n // span. `sidecar_resume` brackets that stamp and is the parent of every\n // host-side span, so the leaf rule already excludes it; `connection_build`\n // and `metering_restart` run after resumeSidecar returns, hence after the\n // stamp, and are excluded here.\n totalOperation: \"orchestrator.ready\",\n postReadyOperations: new Set([\n \"orchestrator.connection_build\",\n \"orchestrator.metering_restart\",\n ]),\n};\n\nexport const STOP_ACCOUNTING_SPEC: FlowAccountingSpec = {\n totalOperation: \"orchestrator.stop_complete\",\n};\n\nexport const DELETE_ACCOUNTING_SPEC: FlowAccountingSpec = {\n totalOperation: \"orchestrator.delete_complete\",\n};\n\nexport interface LifecycleStageTiming {\n operation: string;\n durationMs?: number;\n parent?: string | null;\n}\ntype Values = Readonly<Record<string, number>>;\nexport interface LifecycleWallSample {\n wallMs: number;\n httpMs: number;\n hops?: Values;\n spanOps?: readonly LifecycleStageTiming[];\n spanLeaves?: Values;\n spanTotalMs?: number | null;\n orchStages?: Values | null;\n jobPhases?: Values | null;\n jobMs?: number | null;\n settleMs?: number | null;\n spanAccountedMs?: number;\n}\nexport interface LifecycleWallFlow extends Partial<FlowAccountingSpec> {\n workerTotalHop: string;\n addPreHandler: boolean;\n settleHop?: string;\n workerNamedHops?: readonly string[];\n}\n\n/**\n * A flat `{name: ms}` ledger read as the tree its names describe.\n *\n * Every producer in this repo emits nested stages FLAT, with the containment\n * in the name: `capture.<hostPhase>` and `capture.restic_<phase>` inside\n * `capture` (snapshot-helpers.ts), `materialize.parentRead|precreate|\n * branchComplete|host.*|child.*|residual` inside `materialize` (branch.ts),\n * `delete.<hostPhase>` inside `delete` and `restore_workspace.<phase>` inside\n * `restore_workspace` (snapshots.ts). Summing every entry as a sibling counts\n * the children inside their parent a second time and reports a wall the\n * orchestrator never spent.\n *\n * So a dotted name is NEVER top-level. It attaches to the longest prefix that\n * exists as a stage; when no prefix exists — the restore job's `host.<phase>`,\n * which the queue records inside `restore_workspace` without naming it\n * (snapshot-job-queue.ts:394) — it is still excluded from the top-level sum\n * and reported as a child of the ledger at large. Excluding it can only leave\n * MORE time unnamed, never fabricate a reconciliation.\n */\nexport function stageTree(stages: Readonly<Record<string, number>>) {\n const present = new Set(Object.keys(stages));\n const parentOf = (name: string) => {\n let cut = name.lastIndexOf(\".\");\n while (cut > 0) {\n const candidate = name.slice(0, cut);\n if (present.has(candidate)) return candidate;\n cut = candidate.lastIndexOf(\".\");\n }\n return name.includes(\".\") ? \"\" : null;\n };\n const nodes = Object.entries(stages).map(([name, ms]) => ({\n name,\n ms,\n parent: parentOf(name),\n }));\n const topLevel = nodes.filter((node) => node.parent === null);\n return {\n nodes,\n topLevel,\n /** Children whose declared parent is not in the ledger; never summed. */\n orphans: nodes.filter((node) => node.parent === \"\"),\n topLevelMs: topLevel.reduce((sum, node) => sum + node.ms, 0),\n };\n}\n\n/**\n * Hops that describe the SHAPE of the request rather than a slice of it: the\n * three nested walls, the transport the walls imply, and the retry counter.\n * They are the terms of the summary line, so ranking them again as sub-stages\n * would print the same milliseconds twice under a second name. `preHandler`\n * joins them because it is the umbrella over the `mw.*` own-times, which ARE\n * ranked.\n */\nconst SHAPE_HOPS = new Set([\n \"preHandler\",\n \"total\",\n \"serverWall\",\n \"orchestrator\",\n \"orchestratorServer\",\n \"transportMarkup\",\n \"orchestratorRetries\",\n]);\n\n/** Parent operations contain their descendants and are never counted as leaves. */\nexport function parentOperations(\n operations: readonly LifecycleStageTiming[],\n): ReadonlySet<string> {\n return new Set(\n operations.flatMap((op) =>\n typeof op.parent === \"string\" ? [op.parent] : [],\n ),\n );\n}\n\n/**\n * The measured leaves of one response's span tree, per the flow's own spec.\n *\n * Identical rule to the orchestrator's `computeFlowAccountingResiduals`: drop\n * the total span (it is the window), drop the spans stamped after it closes,\n * and drop any span another span names as its parent (a parent re-measures its\n * children). What is left sums to the window minus its named residual.\n */\nexport function leafOperations<T extends LifecycleStageTiming>(\n operations: readonly T[],\n excluded: ReadonlySet<string> = new Set(),\n parents = parentOperations(operations),\n) {\n return operations.filter(\n (op): op is T & { durationMs: number } =>\n !excluded.has(op.operation) &&\n !parents.has(op.operation) &&\n typeof op.durationMs === \"number\" &&\n Number.isFinite(op.durationMs),\n );\n}\n\nexport function operationLeafDurations(\n operations: readonly LifecycleStageTiming[],\n excluded: ReadonlySet<string> = new Set(),\n) {\n const leaves = new Map<string, number>();\n for (const op of leafOperations(operations, excluded))\n leaves.set(op.operation, (leaves.get(op.operation) ?? 0) + op.durationMs);\n return leaves;\n}\n\nconst difference = (a: number | null, b: number | null) =>\n a === null || b === null ? null : a - b;\nconst positiveDifference = (a: number | null, b: number | null) => {\n const value = difference(a, b);\n return value === null ? null : Math.max(0, value);\n};\n\n/**\n * Partition one input before aggregation: null is unavailable; a negative\n * residual is overlapping evidence, never an instruction to publish zero.\n * Callers retain their population grouping, medians and display labels.\n */\nexport function partitionLifecycleWalls(\n sample: LifecycleWallSample,\n flow: LifecycleWallFlow,\n) {\n const present = (value: number | null | undefined) =>\n typeof value === \"number\" && Number.isFinite(value) ? value : null;\n const finiteStages = (values?: Values | null) =>\n Object.fromEntries(\n Object.entries(values ?? {}).filter(([, ms]) => Number.isFinite(ms)),\n );\n const hops = sample.hops ?? {};\n const hop = (key: string) => (Number.isFinite(hops[key]) ? hops[key] : null);\n const handler = hop(flow.workerTotalHop);\n const preHandler = hop(\"preHandler\");\n const hold = flow.settleHop ? (hop(flow.settleHop) ?? 0) : 0;\n const workerWallMs =\n handler === null\n ? null\n : Math.max(0, handler - hold) +\n (flow.addPreHandler ? (preHandler ?? 0) : 0);\n const roundTripMs = hop(\"orchestrator\");\n const orchServerMs = hop(\"orchestratorServer\");\n const orchWall = roundTripMs ?? orchServerMs;\n const terms = {\n edge: positiveDifference(sample.httpMs, workerWallMs),\n worker: positiveDifference(workerWallMs, orchWall ?? 0),\n transport: positiveDifference(roundTripMs, orchServerMs),\n orch: orchServerMs ?? roundTripMs,\n job: present(sample.jobMs),\n settle: present(sample.settleMs),\n dark: 0,\n };\n terms.dark =\n sample.wallMs -\n Object.values(terms).reduce<number>((sum, ms) => sum + (ms ?? 0), 0);\n const postReady = flow.postReadyOperations ?? new Set();\n const rawLeaves =\n sample.spanLeaves ??\n Object.fromEntries(operationLeafDurations(sample.spanOps ?? []));\n const spanLeaves = Object.fromEntries(\n Object.entries(rawLeaves).filter(\n ([name, ms]) =>\n name !== flow.totalOperation &&\n !postReady.has(name) &&\n Number.isFinite(ms),\n ),\n );\n /**\n * The Worker's own handler stages: its ledger minus the three nested walls,\n * the transport they imply and the middleware own-times, which are ranked\n * separately because they run OUTSIDE the handler's `total`.\n */\n const workerStages = Object.fromEntries(\n Object.entries(hops).filter(\n ([name]) =>\n Number.isFinite(hops[name]) &&\n !SHAPE_HOPS.has(name) &&\n name !== flow.settleHop &&\n !name.startsWith(\"orch.\") &&\n !name.startsWith(\"mw.\"),\n ),\n );\n const orchTree = stageTree(finiteStages(sample.orchStages));\n const jobTree = stageTree(finiteStages(sample.jobPhases));\n const spanSum = Object.values(spanLeaves).reduce((sum, ms) => sum + ms, 0);\n const workerNamed =\n (flow.addPreHandler ? (preHandler ?? 0) : 0) +\n (flow.workerNamedHops\n ? flow.workerNamedHops.reduce((sum, key) => sum + (hop(key) ?? 0), 0)\n : stageTree(workerStages).topLevelMs);\n const workerUnattributedMs = difference(terms.worker, workerNamed);\n const orchNamed = orchTree.topLevel.length\n ? orchTree.topLevelMs\n : spanSum > 0\n ? spanSum\n : 0;\n const orchUnattributedMs = difference(terms.orch, orchNamed);\n const jobUnattributedMs = difference(terms.job, jobTree.topLevelMs);\n const unnamedMs =\n Math.max(0, workerUnattributedMs ?? terms.worker ?? 0) +\n Math.max(0, orchUnattributedMs ?? terms.orch ?? 0) +\n Math.max(0, jobUnattributedMs ?? terms.job ?? 0) +\n Math.max(0, terms.dark);\n const measuredTotal = (sample.spanOps ?? []).find(\n (op) => op.operation === flow.totalOperation,\n )?.durationMs;\n const spanTotalMs = present(sample.spanTotalMs ?? measuredTotal);\n const readySum = sample.spanAccountedMs ?? spanSum;\n const readyTerm = spanTotalMs ?? readySum;\n const orchTerm = roundTripMs ?? orchServerMs ?? readyTerm;\n let clampedMs = 0;\n const diff = (a: number | null, b: number | null) => {\n const delta = difference(a, b);\n if (delta === null) return null;\n clampedMs += Math.max(0, -delta);\n return Math.max(0, delta);\n };\n const transportMs = diff(roundTripMs, orchServerMs);\n const afterSpanMs = diff(orchServerMs, spanTotalMs);\n const pathSum = workerNamed + orchTerm;\n const outerMs =\n workerWallMs === null\n ? diff(\n sample.wallMs - readyTerm,\n workerNamed + (transportMs ?? 0) + (afterSpanMs ?? 0),\n )\n : diff(sample.wallMs, workerWallMs);\n const window = {\n transportMs,\n afterSpanMs,\n outerMs,\n workerUnattributedMs: positiveDifference(workerWallMs, pathSum),\n workerOwnMs: positiveDifference(workerWallMs, orchTerm),\n gaps: {\n overlapMs: positiveDifference(readySum, spanTotalMs) ?? 0,\n underTileMs: positiveDifference(spanTotalMs, readySum) ?? 0,\n workerOverlapMs: positiveDifference(pathSum, workerWallMs) ?? 0,\n unrowedMs:\n workerWallMs === null\n ? 0\n : Math.max(\n 0,\n orchTerm - readyTerm - (transportMs ?? 0) - (afterSpanMs ?? 0),\n ),\n clampedMs,\n },\n };\n return {\n wallMs: sample.wallMs,\n httpMs: sample.httpMs,\n workerWallMs,\n roundTripMs,\n orchServerMs,\n orchIncludesTransport: orchServerMs === null && roundTripMs !== null,\n workerIncludesTransport: roundTripMs === null && orchServerMs !== null,\n terms,\n workerUnattributedMs,\n orchUnattributedMs,\n jobUnattributedMs,\n unnamedMs,\n unnamedShare: sample.wallMs > 0 ? unnamedMs / sample.wallMs : 0,\n overcountMs: Math.max(0, -terms.dark),\n spanLeaves,\n workerStages,\n orchTree,\n jobTree,\n spanTotalMs,\n window,\n };\n}\n","/** Exclusive create-request wall phases; nested service spans are a separate view. */\nexport const CREATE_WALL_PHASES = [\n \"middleware\",\n \"identity\",\n \"preflight\",\n \"tenantCoordination\",\n \"configuration\",\n \"leaseSelection\",\n \"credentialJournal\",\n \"quotaReservation\",\n \"orchestrator\",\n \"provisionResponse\",\n \"responseBody\",\n \"credentialAllocation\",\n \"postCreate\",\n \"response\",\n] as const;\n\nexport type CreateWallPhase = (typeof CREATE_WALL_PHASES)[number];\nexport type CreateWallPhases = Record<CreateWallPhase, number>;\nexport interface CreateWallMeasurement {\n phases: CreateWallPhases;\n totalMs: number;\n /** Includes middleware/auth, preserving the original bookkeeping + post budget. */\n bookkeepingPostCreateMs: number;\n}\n\nconst REQUIRED_PHASES = CREATE_WALL_PHASES.filter(\n (phase) =>\n phase !== \"middleware\" &&\n phase !== \"leaseSelection\" &&\n phase !== \"tenantCoordination\",\n);\n\n/** The original other-Worker + post-create budget, including auth/middleware. */\nexport function createBookkeepingPostWall(phases: CreateWallPhases): number {\n return CREATE_WALL_PHASES.reduce(\n (sum, phase) =>\n sum +\n (phase === \"preflight\" || phase === \"orchestrator\" ? 0 : phases[phase]),\n 0,\n );\n}\n\n/**\n * One cursor owned by the sequential request path. Parallel operations keep\n * their own spans and never transition this cursor from their callbacks.\n * Invalid clocks or missing caller hooks withhold a complete measurement.\n */\nexport function createWallTiming(startedAt: number) {\n const phases = Object.fromEntries(\n CREATE_WALL_PHASES.map((phase) => [phase, 0]),\n ) as CreateWallPhases;\n const visited = new Set<CreateWallPhase>([\"identity\"]);\n let current: CreateWallPhase = \"identity\";\n let cursor = startedAt;\n let valid = Number.isFinite(startedAt);\n let finished = false;\n return {\n phase(name: CreateWallPhase, at: number): void {\n if (finished || !Number.isFinite(at) || at < cursor) {\n valid = false;\n return;\n }\n phases[current] += at - cursor;\n cursor = at;\n current = name;\n visited.add(name);\n },\n finish(\n receivedAt: number,\n respondedAt: number,\n ): CreateWallMeasurement | null {\n if (\n finished ||\n !valid ||\n !Number.isFinite(receivedAt) ||\n !Number.isFinite(respondedAt) ||\n receivedAt > startedAt ||\n respondedAt < cursor ||\n REQUIRED_PHASES.some((phase) => !visited.has(phase))\n ) {\n finished = true;\n return null;\n }\n finished = true;\n phases[current] += respondedAt - cursor;\n phases.middleware = startedAt - receivedAt;\n const totalMs = respondedAt - receivedAt;\n if (Object.values(phases).reduce((sum, ms) => sum + ms, 0) !== totalMs)\n return null;\n return {\n phases: { ...phases },\n totalMs,\n bookkeepingPostCreateMs: createBookkeepingPostWall(phases),\n };\n },\n };\n}\n\n/** Read the already-parsed header. Historical/incomplete/overlapping rows stay unknown. */\nexport function readCreateWallTiming(\n stages: Readonly<Record<string, number>>,\n): CreateWallMeasurement | null {\n const totalMs = stages[\"createWall.total\"];\n if (!Number.isFinite(totalMs) || totalMs < 0 || totalMs !== stages.outerWall)\n return null;\n const phases = {} as CreateWallPhases;\n for (const phase of CREATE_WALL_PHASES) {\n const value = stages[`createWall.${phase}`];\n if (!Number.isFinite(value) || value < 0) return null;\n phases[phase] = value;\n }\n if (Object.values(phases).reduce((sum, ms) => sum + ms, 0) !== totalMs)\n return null;\n return {\n phases,\n totalMs,\n bookkeepingPostCreateMs: createBookkeepingPostWall(phases),\n };\n}\n","// HTTP quoted strings can contain both separators and escaped quotes.\nfunction splitHeader(value, separator) {\n const parts = [];\n let start = 0;\n let quoted = false;\n for (let i = 0; i < value.length; i++) {\n if (quoted && value[i] === \"\\\\\") i++;\n else if (value[i] === '\"') quoted = !quoted;\n else if (!quoted && value[i] === separator) {\n parts.push(value.slice(start, i));\n start = i + 1;\n }\n }\n parts.push(value.slice(start));\n return parts;\n}\n\n/** Missing or malformed durations remain unmeasured, never zero. */\nexport function parseServerTiming(header) {\n if (!header) return [];\n const entries = [];\n for (const metric of splitHeader(header, \",\")) {\n const [rawName, ...params] = splitHeader(metric, \";\");\n const name = rawName.trim();\n if (!/^[!#$%&'*+.^_`|~\\w-]+$/.test(name)) continue;\n const entry = { name };\n const seen = new Set();\n for (const param of params) {\n const eq = param.indexOf(\"=\");\n const key = (eq < 0 ? param : param.slice(0, eq)).trim().toLowerCase();\n if (seen.has(key)) continue;\n seen.add(key);\n if (eq < 0) continue;\n let value = param.slice(eq + 1).trim();\n if (value.startsWith('\"')) {\n if (!/^\"(?:[^\"\\\\]|\\\\[\\s\\S])*\"$/.test(value)) continue;\n value = value.slice(1, -1).replace(/\\\\([\\s\\S])/g, \"$1\");\n }\n if (key === \"desc\") entry.desc = value;\n else if (\n key === \"dur\" &&\n /^[+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[+-]?\\d+)?$/i.test(value)\n ) {\n const duration = Number(value);\n if (Number.isFinite(duration)) entry.dur = duration;\n }\n }\n entries.push(entry);\n }\n return entries;\n}\n\n/** A stage ledger retains only duration-bearing entries; later metrics win. */\nexport function parseServerTimingDurations(header) {\n return Object.fromEntries(\n parseServerTiming(header)\n .filter((entry) => entry.dur !== undefined)\n .map(({ name, dur }) => [name, dur]),\n );\n}\n\n/** Closed wire observations; these names carry no credential or authority values. */\nexport const PLATFORM_VERDICT_REUSE_REASONS = Object.freeze([\n \"entry_changed\",\n \"refusal_observed\",\n \"current_compliance\",\n \"negative_age\",\n \"retention_elapsed\",\n \"key_expired\",\n \"feed_missing\",\n \"feed_stale\",\n \"feed_generation\",\n \"dependencies_empty\",\n \"dependency_revision\",\n \"dependency_floor\",\n \"grant_missing\",\n \"grant_unreadable\",\n \"grant_shape\",\n \"grant_negative_age\",\n \"grant_retention_elapsed\",\n \"shared_refusal_observed\",\n \"shared_refusal_unreadable\",\n \"shared_read_unavailable\",\n \"grant_invalid\",\n \"grant_validation\",\n \"verification_inflight\",\n \"feed_contradiction\",\n \"current_required\",\n \"lkg_retention_elapsed\",\n]);\n\n/** Closed request-phase wire vocabulary, shared by producer and safe consumers. */\nexport const HTTP_REQUEST_PHASE_NAMES = Object.freeze([\n \"external.provision\",\n \"benchmarks.records.load\",\n \"benchmarks.records.build\",\n \"benchmarks.records.page\",\n \"benchmarks.records.json\",\n \"admission.host.list\",\n \"host.records.ready\",\n \"host.records.scan\",\n \"host.records.read\",\n \"host.records.metadata\",\n \"host.records.project\",\n \"host.records.retry\",\n \"admission.metadata\",\n \"admission.json\",\n \"observability.refresh.wait\",\n \"fleet.sidecars\",\n \"native-export.snapshot.wait\",\n \"native-export.prepare.wait\",\n \"native-export.collect.wait\",\n \"scorecard.fleet.wait\",\n \"scorecard.capacity.wait\",\n \"scorecard.coverage.wait\",\n \"scorecard.compose\",\n \"scorecard.json\",\n \"proxy.model_refresh\",\n \"proxy.hub.lock_wait\",\n \"proxy.hub.refresh\",\n \"proxy.hub.state\",\n \"proxy.hub.proof\",\n \"proxy.hub.delivery\",\n \"proxy.runtime_token\",\n \"snapshot.delete.lock\",\n \"snapshot.delete.credentials\",\n \"snapshot.delete.list\",\n \"snapshot.delete.generation\",\n]);\n\nexport function httpRequestPhaseFromTimingName(name) {\n const prefix = name.startsWith(\"orch.phase.\") ? \"orch.phase.\" : \"phase.\";\n if (!name.startsWith(prefix)) return undefined;\n const phase = name.slice(prefix.length);\n return HTTP_REQUEST_PHASE_NAMES.includes(phase) ? phase : undefined;\n}\n\nexport const PLATFORM_VERDICT_SCOPE_CLASSES = Object.freeze([\n \"key\",\n \"identity\",\n \"owner_user\",\n \"owner_team\",\n \"lineage\",\n \"other\",\n]);\nexport const PLATFORM_VERDICT_EVIDENCE_ORDERS = Object.freeze([\n \"feed_before_observation\",\n \"feed_at_observation\",\n \"feed_after_observation\",\n \"unknown\",\n]);\n\n/** Bounded, closed-schema origin phase projection for the two Worker ledgers.\n * Duplicate observations remain separate; different origins/attempts cannot be summed.\n */\nexport const HTTP_PHASE_COVERAGE_FIELDS = Object.freeze([\n \"stored\",\n \"emitted\",\n \"omitted\",\n \"invalid\",\n \"collisions\",\n \"headerDropped\",\n]);\n\nexport function createUpstreamHttpPhaseProjection() {\n const entries = [];\n let bytes = 0;\n let dropped = 0;\n let rejectedInputs = 0;\n const fields = HTTP_PHASE_COVERAGE_FIELDS;\n const byteLength = (value) => new TextEncoder().encode(value).length;\n const keep = (entry) => {\n // Reserve a bounded forwarding-coverage entry inside this component's 4 KiB.\n const size = byteLength(entry) + 2;\n if (entries.length >= 31 || bytes + size > 3900) {\n dropped++;\n return;\n }\n entries.push(entry);\n bytes += size;\n };\n return {\n absorb(header) {\n if (header == null) return;\n if (\n typeof header !== \"string\" ||\n header.length > 4096 ||\n byteLength(header) > 4096\n ) {\n rejectedInputs++;\n return;\n }\n for (const entry of parseServerTiming(header)) {\n // Only direct origin names enter this fold; never prefix orch. twice.\n if (entry.name === \"phase.coverage\") {\n const counts = {};\n const parts = (entry.desc ?? \"\").split(\",\");\n if (parts.length !== fields.length) {\n dropped++;\n continue;\n }\n for (const part of parts) {\n const [key, value, ...extra] = part.split(\"=\");\n if (\n extra.length ||\n !fields.includes(key) ||\n Object.hasOwn(counts, key) ||\n !/^(?:0|[1-9]\\d*)$/.test(value ?? \"\") ||\n !Number.isSafeInteger(Number(value))\n )\n break;\n counts[key] = Number(value);\n }\n if (Object.keys(counts).length !== fields.length) {\n dropped++;\n continue;\n }\n keep(\n `orch.phase.coverage;desc=\"${fields.map((key) => `${key}=${counts[key]}`).join(\",\")}\"`,\n );\n } else if (entry.name.startsWith(\"phase.\")) {\n if (\n !httpRequestPhaseFromTimingName(entry.name) ||\n !Number.isFinite(entry.dur) ||\n entry.dur < 0 ||\n !/^outcome=(?:completed|error)$/.test(entry.desc ?? \"\")\n ) {\n dropped++;\n continue;\n }\n keep(\n `orch.${entry.name};dur=${Math.round(entry.dur)};desc=\"${entry.desc}\"`,\n );\n }\n }\n },\n entries() {\n return [\n ...entries,\n ...(dropped || rejectedInputs\n ? [\n `orch.phase.forwarding;desc=\"dropped=${dropped},rejectedInputs=${rejectedInputs}\"`,\n ]\n : []),\n ];\n },\n };\n}\n"],"mappings":"AA0BA,MAAa,yBAA6C;CACxD,gBAAgB;CAChB,qBAAqB,IAtBkB,IAAI;EAC3C;EACA;EACA;EACD,CAkBsB;CACrB,cAAc,EACZ,WAAW,+BACZ;CACF;AAED,MAAa,yBAA6C;CAOxD,gBAAgB;CAChB,qBAAqB,IAAI,IAAI,CAC3B,iCACA,gCACD,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AAQ,OAAO;KACxB,MAAM,CAAC,KAAK,OAAO,GAAG,SAAS,KAAK,MAAM,IAAI;AAC9C,SACE,MAAM,UACN,CAAC,OAAO,SAAS,IAAI,IACrB,OAAO,OAAO,QAAQ,IAAI,IAC1B,CAAC,mBAAmB,KAAK,SAAS,GAAG,IACrC,CAAC,OAAO,cAAc,OAAO,MAAM,CAAC,CAEpC;AACF,YAAO,OAAO,OAAO,MAAM;;AAE7B,QAAI,OAAO,KAAK,OAAO,CAAC,WAAW,OAAO,QAAQ;AAChD;AACA;;AAEF,SACE,6BAA6B,OAAO,KAAK,QAAQ,GAAG,IAAI,GAAG,OAAO,OAAO,CAAC,KAAK,IAAI,CAAC,GACrF;cACQ,MAAM,KAAK,WAAW,SAAS,EAAE;AAC1C,QACE,CAAC,+BAA+B,MAAM,KAAK,IAC3C,CAAC,OAAO,SAAS,MAAM,IAAI,IAC3B,MAAM,MAAM,KACZ,CAAC,gCAAgC,KAAK,MAAM,QAAQ,GAAG,EACvD;AACA;AACA;;AAEF,SACE,QAAQ,MAAM,KAAK,OAAO,KAAK,MAAM,MAAM,IAAI,CAAC,SAAS,MAAM,KAAK,GACrE;;;EAIP,UAAU;AACR,UAAO,CACL,GAAG,SACH,GAAI,WAAW,iBACX,CACE,uCAAuC,QAAQ,kBAAkB,eAAe,GACjF,GACD,EAAE,CACP;;EAEJ"}
@@ -1,2 +1,2 @@
1
- import { _ as CreateWallPhases, a as PLATFORM_VERDICT_REUSE_REASONS, b as readCreateWallTiming, c as PlatformVerdictReuseRejection, d as httpRequestPhaseFromTimingName, f as parseServerTiming, g as CreateWallPhase, h as CreateWallMeasurement, i as PLATFORM_VERDICT_EVIDENCE_ORDERS, l as ServerTimingEntry, m as CREATE_WALL_PHASES, n as HTTP_REQUEST_PHASE_NAMES, o as PLATFORM_VERDICT_SCOPE_CLASSES, p as parseServerTimingDurations, r as HttpRequestPhaseName, s as PlatformVerdictDependencyMismatch, t as HTTP_PHASE_COVERAGE_FIELDS, u as createUpstreamHttpPhaseProjection, v as createBookkeepingPostWall, y as createWallTiming } from "./server-timing-BScGLvfx.mjs";
2
- export { CREATE_WALL_PHASES, CreateWallMeasurement, CreateWallPhase, CreateWallPhases, HTTP_PHASE_COVERAGE_FIELDS, HTTP_REQUEST_PHASE_NAMES, HttpRequestPhaseName, PLATFORM_VERDICT_EVIDENCE_ORDERS, PLATFORM_VERDICT_REUSE_REASONS, PLATFORM_VERDICT_SCOPE_CLASSES, PlatformVerdictDependencyMismatch, PlatformVerdictReuseRejection, ServerTimingEntry, createBookkeepingPostWall, createUpstreamHttpPhaseProjection, createWallTiming, httpRequestPhaseFromTimingName, parseServerTiming, parseServerTimingDurations, readCreateWallTiming };
1
+ import { T as LifecycleWallSample, _ as CreateWallPhases, a as PLATFORM_VERDICT_REUSE_REASONS, b as readCreateWallTiming, c as PlatformVerdictReuseRejection, d as httpRequestPhaseFromTimingName, f as parseServerTiming, g as CreateWallPhase, h as CreateWallMeasurement, i as PLATFORM_VERDICT_EVIDENCE_ORDERS, j as partitionLifecycleWalls, l as ServerTimingEntry, m as CREATE_WALL_PHASES, n as HTTP_REQUEST_PHASE_NAMES, o as PLATFORM_VERDICT_SCOPE_CLASSES, p as parseServerTimingDurations, r as HttpRequestPhaseName, s as PlatformVerdictDependencyMismatch, t as HTTP_PHASE_COVERAGE_FIELDS, u as createUpstreamHttpPhaseProjection, v as createBookkeepingPostWall, w as LifecycleWallFlow, y as createWallTiming } from "./server-timing-CE4vurML.mjs";
2
+ export { CREATE_WALL_PHASES, CreateWallMeasurement, CreateWallPhase, CreateWallPhases, HTTP_PHASE_COVERAGE_FIELDS, HTTP_REQUEST_PHASE_NAMES, HttpRequestPhaseName, LifecycleWallFlow, LifecycleWallSample, PLATFORM_VERDICT_EVIDENCE_ORDERS, PLATFORM_VERDICT_REUSE_REASONS, PLATFORM_VERDICT_SCOPE_CLASSES, PlatformVerdictDependencyMismatch, PlatformVerdictReuseRejection, ServerTimingEntry, createBookkeepingPostWall, createUpstreamHttpPhaseProjection, createWallTiming, httpRequestPhaseFromTimingName, parseServerTiming, parseServerTimingDurations, partitionLifecycleWalls, readCreateWallTiming };
@@ -1,2 +1,2 @@
1
- import { a as PLATFORM_VERDICT_SCOPE_CLASSES, c as parseServerTiming, d as createBookkeepingPostWall, f as createWallTiming, i as PLATFORM_VERDICT_REUSE_REASONS, l as parseServerTimingDurations, n as HTTP_REQUEST_PHASE_NAMES, o as createUpstreamHttpPhaseProjection, p as readCreateWallTiming, r as PLATFORM_VERDICT_EVIDENCE_ORDERS, s as httpRequestPhaseFromTimingName, t as HTTP_PHASE_COVERAGE_FIELDS, u as CREATE_WALL_PHASES } from "./server-timing-CTGu_pos.mjs";
2
- export { CREATE_WALL_PHASES, HTTP_PHASE_COVERAGE_FIELDS, HTTP_REQUEST_PHASE_NAMES, PLATFORM_VERDICT_EVIDENCE_ORDERS, PLATFORM_VERDICT_REUSE_REASONS, PLATFORM_VERDICT_SCOPE_CLASSES, createBookkeepingPostWall, createUpstreamHttpPhaseProjection, createWallTiming, httpRequestPhaseFromTimingName, parseServerTiming, parseServerTimingDurations, readCreateWallTiming };
1
+ import { a as PLATFORM_VERDICT_SCOPE_CLASSES, c as parseServerTiming, d as createBookkeepingPostWall, f as createWallTiming, i as PLATFORM_VERDICT_REUSE_REASONS, l as parseServerTimingDurations, n as HTTP_REQUEST_PHASE_NAMES, o as createUpstreamHttpPhaseProjection, p as readCreateWallTiming, r as PLATFORM_VERDICT_EVIDENCE_ORDERS, s as httpRequestPhaseFromTimingName, t as HTTP_PHASE_COVERAGE_FIELDS, u as CREATE_WALL_PHASES, x as partitionLifecycleWalls } from "./server-timing-HI-hXI39.mjs";
2
+ export { CREATE_WALL_PHASES, HTTP_PHASE_COVERAGE_FIELDS, HTTP_REQUEST_PHASE_NAMES, PLATFORM_VERDICT_EVIDENCE_ORDERS, PLATFORM_VERDICT_REUSE_REASONS, PLATFORM_VERDICT_SCOPE_CLASSES, createBookkeepingPostWall, createUpstreamHttpPhaseProjection, createWallTiming, httpRequestPhaseFromTimingName, parseServerTiming, parseServerTimingDurations, partitionLifecycleWalls, readCreateWallTiming };
@@ -1,4 +1,4 @@
1
- import { f as parseServerTiming, l as ServerTimingEntry } from "./server-timing-BScGLvfx.mjs";
1
+ import { A as parentOperations, C as FlowAccountingSpec, D as STOP_ACCOUNTING_SPEC, E as RESUME_ACCOUNTING_SPEC, M as stageTree, O as leafOperations, S as DELETE_ACCOUNTING_SPEC, f as parseServerTiming, k as operationLeafDurations, l as ServerTimingEntry, x as CREATE_ACCOUNTING_SPEC } from "./server-timing-CE4vurML.mjs";
2
2
 
3
3
  //#region src/stage-span.d.ts
4
4
  /**
@@ -127,5 +127,5 @@ declare class SpanRecorder {
127
127
  }): string;
128
128
  }
129
129
  //#endregion
130
- export { LifecycleOp, ORCHESTRATOR_HOP_ID_HEADER, PROVISION_TRACE_ID_HEADER, PTID_PREFIX, RecordOptions, type ServerTimingEntry, SpanComponent, SpanRecorder, SpanStatus, StageSpan, StageSpanInput, isAdoptablePtid, mintPtid, monotonicNs, parseServerTiming, readOrMintPtid, spanDurationMs };
130
+ export { CREATE_ACCOUNTING_SPEC, DELETE_ACCOUNTING_SPEC, type FlowAccountingSpec, LifecycleOp, ORCHESTRATOR_HOP_ID_HEADER, PROVISION_TRACE_ID_HEADER, PTID_PREFIX, RESUME_ACCOUNTING_SPEC, RecordOptions, STOP_ACCOUNTING_SPEC, type ServerTimingEntry, SpanComponent, SpanRecorder, SpanStatus, StageSpan, StageSpanInput, isAdoptablePtid, leafOperations, mintPtid, monotonicNs, operationLeafDurations, parentOperations, parseServerTiming, readOrMintPtid, spanDurationMs, stageTree };
131
131
  //# sourceMappingURL=stage-span.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stage-span.d.mts","names":[],"sources":["../src/stage-span.ts"],"mappings":";;;;;;AAkBA;;;;;AAGA;;;;;AAGA;;;;cANa,yBAAA;AAQb;AAAA,cALa,0BAAA;;cAGA,WAAA;AAAA,KAED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AlGZ;;;;;AAoBF;;EAyFE,SAAA,CAAU,KAAA;IACR,KAAA;IACA,SAAA;IACA,QAAA;IACA,MAAA,EAAQ,KAAA;MAAQ,KAAA;MAAe,GAAA;IAAA;EAAA;EAnEtB;EAoFX,MAAA,CAAA;EAxDa;;;;;;;;EA2Eb,cAAA,CAAe,IAAA;IAAS,KAAA;IAAgB,WAAA;EAAA;AAAA"}
@@ -1,4 +1,4 @@
1
- import { c as parseServerTiming } from "./server-timing-CTGu_pos.mjs";
1
+ import { S as stageTree, _ as STOP_ACCOUNTING_SPEC, b as parentOperations, c as parseServerTiming, g as RESUME_ACCOUNTING_SPEC, h as DELETE_ACCOUNTING_SPEC, m as CREATE_ACCOUNTING_SPEC, v as leafOperations, y as operationLeafDurations } from "./server-timing-HI-hXI39.mjs";
2
2
  //#region src/stage-span.ts
3
3
  /**
4
4
  * One span shape for every lifecycle-op stage across every hop.
@@ -188,6 +188,6 @@ var SpanRecorder = class {
188
188
  }
189
189
  };
190
190
  //#endregion
191
- export { ORCHESTRATOR_HOP_ID_HEADER, PROVISION_TRACE_ID_HEADER, PTID_PREFIX, SpanRecorder, isAdoptablePtid, mintPtid, monotonicNs, parseServerTiming, readOrMintPtid, spanDurationMs };
191
+ export { CREATE_ACCOUNTING_SPEC, DELETE_ACCOUNTING_SPEC, ORCHESTRATOR_HOP_ID_HEADER, PROVISION_TRACE_ID_HEADER, PTID_PREFIX, RESUME_ACCOUNTING_SPEC, STOP_ACCOUNTING_SPEC, SpanRecorder, isAdoptablePtid, leafOperations, mintPtid, monotonicNs, operationLeafDurations, parentOperations, parseServerTiming, readOrMintPtid, spanDurationMs, stageTree };
192
192
 
193
193
  //# sourceMappingURL=stage-span.mjs.map