@bli-cockpit/telemetry-core 0.1.11 → 0.1.13

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.
@@ -13,6 +13,48 @@ export declare const RAW_EVIDENCE_UPLOAD_MAX_CHUNK_COUNT = 192;
13
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
+ /**
17
+ * Receipt returned by the pre-ledger single-shot upload route. Older
18
+ * dashboards still use this path, so the collector must prove that a 2xx
19
+ * response names the exact durable object it requested.
20
+ */
21
+ export declare const RawEvidenceLegacyUploadResponseSchema: z.ZodObject<{
22
+ ok: z.ZodLiteral<true>;
23
+ bucket: z.ZodString;
24
+ uploaded: z.ZodArray<z.ZodObject<{
25
+ raw_evidence_pointer_id: z.ZodString;
26
+ object_key: z.ZodString;
27
+ content_hash_sha256: z.ZodString;
28
+ byte_size: z.ZodNumber;
29
+ redaction: z.ZodOptional<z.ZodObject<{
30
+ schema_version: z.ZodLiteral<"raw-evidence-redaction.v1">;
31
+ status: z.ZodLiteral<"sanitized">;
32
+ mode: z.ZodLiteral<"deterministic_text_replacement">;
33
+ applied_by: z.ZodArray<z.ZodEnum<{
34
+ local_collector: "local_collector";
35
+ server_commit: "server_commit";
36
+ legacy_upload: "legacy_upload";
37
+ }>>;
38
+ rule_counts: z.ZodArray<z.ZodObject<{
39
+ rule_id: z.ZodString;
40
+ match_count: z.ZodNumber;
41
+ redacted_char_count: z.ZodNumber;
42
+ }, z.core.$strict>>;
43
+ secret_like_match_count: z.ZodNumber;
44
+ redacted_fields: z.ZodDefault<z.ZodArray<z.ZodString>>;
45
+ redacted_ranges: z.ZodDefault<z.ZodArray<z.ZodObject<{
46
+ start: z.ZodNumber;
47
+ end: z.ZodNumber;
48
+ rule_id: z.ZodString;
49
+ }, z.core.$strict>>>;
50
+ original_content_hash_sha256: z.ZodOptional<z.ZodString>;
51
+ sanitized_content_hash_sha256: z.ZodOptional<z.ZodString>;
52
+ original_byte_size: z.ZodOptional<z.ZodNumber>;
53
+ sanitized_byte_size: z.ZodOptional<z.ZodNumber>;
54
+ }, z.core.$strict>>;
55
+ }, z.core.$strict>>;
56
+ }, z.core.$strict>;
57
+ export type RawEvidenceLegacyUploadResponse = z.infer<typeof RawEvidenceLegacyUploadResponseSchema>;
16
58
  export declare const RawEvidenceUploadBeginObjectSchema: z.ZodObject<{
17
59
  pointer: z.ZodObject<{
18
60
  raw_evidence_pointer_id: z.ZodString;
@@ -192,6 +234,7 @@ export declare const RawEvidenceUploadBeginResponseObjectSchema: z.ZodObject<{
192
234
  }>;
193
235
  upload_id: z.ZodOptional<z.ZodString>;
194
236
  received_chunk_indexes: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
237
+ commit_ready: z.ZodOptional<z.ZodBoolean>;
195
238
  reason: z.ZodOptional<z.ZodString>;
196
239
  }, z.core.$strict>;
197
240
  export type RawEvidenceUploadBeginResponseObject = z.infer<typeof RawEvidenceUploadBeginResponseObjectSchema>;
@@ -208,6 +251,7 @@ export declare const RawEvidenceUploadBeginResponseSchema: z.ZodObject<{
208
251
  }>;
209
252
  upload_id: z.ZodOptional<z.ZodString>;
210
253
  received_chunk_indexes: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
254
+ commit_ready: z.ZodOptional<z.ZodBoolean>;
211
255
  reason: z.ZodOptional<z.ZodString>;
212
256
  }, z.core.$strict>>;
213
257
  }, z.core.$strict>;
@@ -11,16 +11,19 @@ import { RawEvidenceRedactionMetadataSchema } from "./secret-guards.js";
11
11
  * re-sending bytes, and identical content is acknowledged without re-upload.
12
12
  */
13
13
  export const RAW_EVIDENCE_UPLOAD_MAX_CHUNK_BYTES = 3 * 1024 * 1024;
14
- export const RAW_EVIDENCE_UPLOAD_DEFAULT_CHUNK_BYTES = 2 * 1024 * 1024;
14
+ // The normal collector does not override this value. Keep the default large
15
+ // enough that the advertised file cap fits within the maximum chunk count,
16
+ // while the base64 JSON request remains below Vercel's 4.5 MB body limit.
17
+ export const RAW_EVIDENCE_UPLOAD_DEFAULT_CHUNK_BYTES = RAW_EVIDENCE_UPLOAD_MAX_CHUNK_BYTES;
15
18
  // Chunk COUNT is the safe axis for growing the file cap: chunk SIZE is pinned
16
19
  // 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.
20
+ // * 3 MiB gives a 576 MiB protocol ceiling above the current file cap.
18
21
  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;
22
+ // Final-object cap. The commit route still assembles and redaction-scans text
23
+ // in memory, so keep this below V8's string ceiling with practical headroom for
24
+ // buffers and redaction copies. 256 MiB covers the largest observed fleet
25
+ // session (118 MiB) with >2x headroom. Raising it requires a streaming commit.
26
+ export const RAW_EVIDENCE_UPLOAD_MAX_FILE_BYTES = 256 * 1024 * 1024;
24
27
  export const RAW_EVIDENCE_UPLOAD_MAX_OBJECTS_PER_BEGIN = 25;
25
28
  export const CODEX_SESSION_REPORT_MAX_SESSIONS = 200;
26
29
  const SafeLabelSchema = z
@@ -35,6 +38,26 @@ const BasenameSchema = z
35
38
  .min(1)
36
39
  .max(160)
37
40
  .regex(/^[^/\\]+$/);
41
+ /**
42
+ * Receipt returned by the pre-ledger single-shot upload route. Older
43
+ * dashboards still use this path, so the collector must prove that a 2xx
44
+ * response names the exact durable object it requested.
45
+ */
46
+ export const RawEvidenceLegacyUploadResponseSchema = z
47
+ .object({
48
+ ok: z.literal(true),
49
+ bucket: NonEmptyStringSchema,
50
+ uploaded: z.array(z
51
+ .object({
52
+ raw_evidence_pointer_id: NonEmptyStringSchema,
53
+ object_key: NonEmptyStringSchema,
54
+ content_hash_sha256: Sha256Schema,
55
+ byte_size: z.number().int().nonnegative(),
56
+ redaction: RawEvidenceRedactionMetadataSchema.optional(),
57
+ })
58
+ .strict()),
59
+ })
60
+ .strict();
38
61
  export const RawEvidenceUploadBeginObjectSchema = z
39
62
  .object({
40
63
  pointer: RawEvidencePointerSchema,
@@ -74,6 +97,9 @@ export const RawEvidenceUploadBeginResponseObjectSchema = z
74
97
  disposition: RawEvidenceUploadDispositionSchema,
75
98
  upload_id: NonEmptyStringSchema.optional(),
76
99
  received_chunk_indexes: z.array(z.number().int().nonnegative()).default([]),
100
+ // A completed staged plan may use a chunk layout from an older collector.
101
+ // The client must commit it directly instead of mixing in its current plan.
102
+ commit_ready: z.boolean().optional(),
77
103
  reason: SafeLabelSchema.optional(),
78
104
  })
79
105
  .strict();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bli-cockpit/telemetry-core",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",