@bli-cockpit/telemetry-core 0.1.9 → 0.1.11

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.
@@ -7,10 +7,10 @@ import { z } from "zod";
7
7
  * durable per-object ledger so interrupted uploads resume instead of
8
8
  * re-sending bytes, and identical content is acknowledged without re-upload.
9
9
  */
10
- export declare const RAW_EVIDENCE_UPLOAD_MAX_FILE_BYTES: number;
11
10
  export declare const RAW_EVIDENCE_UPLOAD_MAX_CHUNK_BYTES: number;
12
11
  export declare const RAW_EVIDENCE_UPLOAD_DEFAULT_CHUNK_BYTES: number;
13
- export declare const RAW_EVIDENCE_UPLOAD_MAX_CHUNK_COUNT = 64;
12
+ export declare const RAW_EVIDENCE_UPLOAD_MAX_CHUNK_COUNT = 192;
13
+ export declare const RAW_EVIDENCE_UPLOAD_MAX_FILE_BYTES: number;
14
14
  export declare const RAW_EVIDENCE_UPLOAD_MAX_OBJECTS_PER_BEGIN = 25;
15
15
  export declare const CODEX_SESSION_REPORT_MAX_SESSIONS = 200;
16
16
  export declare const RawEvidenceUploadBeginObjectSchema: z.ZodObject<{
@@ -342,13 +342,16 @@ export type RawEvidenceUploadCommitResponse = z.infer<typeof RawEvidenceUploadCo
342
342
  * cwd basename/hash) instead of being duplicated into every repo's evidence
343
343
  * pack or silently dropped. No content-bearing fields are allowed.
344
344
  */
345
+ export declare const CODEX_SESSION_ATTRIBUTION_STATES: readonly ["attributed", "attributed_fallback", "ambiguous", "unattributed", "skipped"];
345
346
  export declare const CodexSessionAttributionStateSchema: z.ZodEnum<{
346
347
  skipped: "skipped";
347
348
  attributed: "attributed";
349
+ attributed_fallback: "attributed_fallback";
348
350
  ambiguous: "ambiguous";
349
351
  unattributed: "unattributed";
350
352
  }>;
351
353
  export type CodexSessionAttributionState = z.infer<typeof CodexSessionAttributionStateSchema>;
354
+ export declare const CODEX_SESSION_ATTRIBUTION_STATE_RANK: Record<CodexSessionAttributionState, number>;
352
355
  export declare const CodexSessionUploadStateSchema: z.ZodEnum<{
353
356
  uploaded: "uploaded";
354
357
  reused_existing: "reused_existing";
@@ -377,6 +380,7 @@ export declare const CodexSessionAttributionSchema: z.ZodObject<{
377
380
  attribution_state: z.ZodEnum<{
378
381
  skipped: "skipped";
379
382
  attributed: "attributed";
383
+ attributed_fallback: "attributed_fallback";
380
384
  ambiguous: "ambiguous";
381
385
  unattributed: "unattributed";
382
386
  }>;
@@ -444,6 +448,7 @@ export declare const CodexSessionAttributionReportRequestSchema: z.ZodObject<{
444
448
  attribution_state: z.ZodEnum<{
445
449
  skipped: "skipped";
446
450
  attributed: "attributed";
451
+ attributed_fallback: "attributed_fallback";
447
452
  ambiguous: "ambiguous";
448
453
  unattributed: "unattributed";
449
454
  }>;
@@ -10,10 +10,17 @@ import { RawEvidenceRedactionMetadataSchema } from "./secret-guards.js";
10
10
  * durable per-object ledger so interrupted uploads resume instead of
11
11
  * re-sending bytes, and identical content is acknowledged without re-upload.
12
12
  */
13
- export const RAW_EVIDENCE_UPLOAD_MAX_FILE_BYTES = 10 * 1024 * 1024;
14
13
  export const RAW_EVIDENCE_UPLOAD_MAX_CHUNK_BYTES = 3 * 1024 * 1024;
15
14
  export const RAW_EVIDENCE_UPLOAD_DEFAULT_CHUNK_BYTES = 2 * 1024 * 1024;
16
- export const RAW_EVIDENCE_UPLOAD_MAX_CHUNK_COUNT = 64;
15
+ // Chunk COUNT is the safe axis for growing the file cap: chunk SIZE is pinned
16
+ // by Vercel's ~4.5MB request-body limit (see header comment). 192 chunks
17
+ // * 3 MiB gives a 576 MiB protocol ceiling above the 512 MiB file cap.
18
+ export const RAW_EVIDENCE_UPLOAD_MAX_CHUNK_COUNT = 192;
19
+ // Final-object cap. 512 MiB captures everything the fleet has ever produced
20
+ // with ~4x headroom over the largest observed session (118 MiB). Watch point:
21
+ // the commit route assembles and redaction-scans the whole object in memory,
22
+ // so objects near this cap are the thing to profile before raising it again.
23
+ export const RAW_EVIDENCE_UPLOAD_MAX_FILE_BYTES = 512 * 1024 * 1024;
17
24
  export const RAW_EVIDENCE_UPLOAD_MAX_OBJECTS_PER_BEGIN = 25;
18
25
  export const CODEX_SESSION_REPORT_MAX_SESSIONS = 200;
19
26
  const SafeLabelSchema = z
@@ -130,12 +137,21 @@ export const RawEvidenceUploadCommitResponseSchema = z
130
137
  * cwd basename/hash) instead of being duplicated into every repo's evidence
131
138
  * pack or silently dropped. No content-bearing fields are allowed.
132
139
  */
133
- export const CodexSessionAttributionStateSchema = z.enum([
140
+ export const CODEX_SESSION_ATTRIBUTION_STATES = [
134
141
  "attributed",
142
+ "attributed_fallback",
135
143
  "ambiguous",
136
144
  "unattributed",
137
145
  "skipped",
138
- ]);
146
+ ];
147
+ export const CodexSessionAttributionStateSchema = z.enum(CODEX_SESSION_ATTRIBUTION_STATES);
148
+ export const CODEX_SESSION_ATTRIBUTION_STATE_RANK = {
149
+ attributed: 4,
150
+ attributed_fallback: 3,
151
+ ambiguous: 2,
152
+ unattributed: 1,
153
+ skipped: 0,
154
+ };
139
155
  export const CodexSessionUploadStateSchema = z.enum([
140
156
  "uploaded",
141
157
  "reused_existing",
package/dist/index.d.ts CHANGED
@@ -9,5 +9,6 @@ export * from "./privacy.js";
9
9
  export * from "./risk-flags.js";
10
10
  export * from "./secret-guards.js";
11
11
  export * from "./source-adapter.js";
12
+ export * from "./ticket-id.js";
12
13
  export * from "./trace-sink.js";
13
14
  export * from "./work-context.js";
package/dist/index.js CHANGED
@@ -9,5 +9,6 @@ export * from "./privacy.js";
9
9
  export * from "./risk-flags.js";
10
10
  export * from "./secret-guards.js";
11
11
  export * from "./source-adapter.js";
12
+ export * from "./ticket-id.js";
12
13
  export * from "./trace-sink.js";
13
14
  export * from "./work-context.js";
@@ -0,0 +1 @@
1
+ export declare function parseTicketIdFromText(value: string): string | null;
@@ -0,0 +1,4 @@
1
+ export function parseTicketIdFromText(value) {
2
+ const match = value.match(/\b[A-Z][A-Z0-9]{1,12}-\d+\b/);
3
+ return match?.[0] ?? null;
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bli-cockpit/telemetry-core",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",