@aiquants/enrichment-core 0.1.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -17,7 +17,7 @@ declare abstract class BaseEnrichmentClient {
17
17
  protected readonly fetchFn: typeof fetch;
18
18
  protected readonly timeoutMs: number;
19
19
  constructor(options: EnrichmentClientOptions);
20
- protected request<T>(path: string, method: "GET" | "POST", body?: unknown, query?: Record<string, string | undefined>): Promise<T>;
20
+ protected request<T>(path: string, tenantId: string, body: unknown): Promise<T>;
21
21
  }
22
22
  declare const ModelProviderSchema: z.ZodEnum<[
23
23
  "google_cloud",
@@ -255,14 +255,6 @@ declare const CircuitBreakerStatusSchema: z.ZodEnum<[
255
255
  "HALF_OPEN"
256
256
  ]>;
257
257
  type CircuitBreakerStatus = z.infer<typeof CircuitBreakerStatusSchema>;
258
- declare const QualityTierSchema: z.ZodEnum<[
259
- "FULL_HYBRID",
260
- "VECTOR_ONLY",
261
- "GRAPH_ONLY",
262
- "STANDARD_SEMANTIC",
263
- "DEGRADED_KEYWORD_ONLY"
264
- ]>;
265
- type QualityTier = z.infer<typeof QualityTierSchema>;
266
258
  declare const SearchModeSchema: z.ZodEnum<[
267
259
  "KEYWORD",
268
260
  "SPARSE",
@@ -271,42 +263,26 @@ declare const SearchModeSchema: z.ZodEnum<[
271
263
  "GRAPH_TRAVERSE"
272
264
  ]>;
273
265
  declare const SearchMetadataSchema: z.ZodObject<{
274
- search_mode: z.ZodEnum<[
275
- "KEYWORD",
276
- "SPARSE",
277
- "DENSE",
278
- "HYBRID",
279
- "GRAPH_TRAVERSE"
280
- ]>;
281
- quality_tier: z.ZodEnum<[
282
- "FULL_HYBRID",
283
- "VECTOR_ONLY",
284
- "GRAPH_ONLY",
285
- "STANDARD_SEMANTIC",
286
- "DEGRADED_KEYWORD_ONLY"
287
- ]>;
288
- is_degraded: z.ZodBoolean;
289
- degradation_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
290
- circuit_breaker_status: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<[
291
- "CLOSED",
292
- "OPEN",
293
- "HALF_OPEN"
294
- ]>>>;
266
+ circuit_breaker_status: z.ZodString;
267
+ quality_tier: z.ZodString;
295
268
  latency_ms: z.ZodNumber;
269
+ total_hits: z.ZodNumber;
270
+ fallback_applied: z.ZodBoolean;
271
+ degraded_reason: z.ZodNullable<z.ZodString>;
296
272
  }, "strip", z.ZodTypeAny, {
297
- search_mode: "KEYWORD" | "SPARSE" | "DENSE" | "HYBRID" | "GRAPH_TRAVERSE";
298
- quality_tier: "FULL_HYBRID" | "VECTOR_ONLY" | "GRAPH_ONLY" | "STANDARD_SEMANTIC" | "DEGRADED_KEYWORD_ONLY";
299
- is_degraded: boolean;
273
+ circuit_breaker_status: string;
274
+ quality_tier: string;
300
275
  latency_ms: number;
301
- degradation_reason?: string | null | undefined;
302
- circuit_breaker_status?: Record<string, "CLOSED" | "OPEN" | "HALF_OPEN"> | undefined;
276
+ total_hits: number;
277
+ fallback_applied: boolean;
278
+ degraded_reason: string | null;
303
279
  }, {
304
- search_mode: "KEYWORD" | "SPARSE" | "DENSE" | "HYBRID" | "GRAPH_TRAVERSE";
305
- quality_tier: "FULL_HYBRID" | "VECTOR_ONLY" | "GRAPH_ONLY" | "STANDARD_SEMANTIC" | "DEGRADED_KEYWORD_ONLY";
306
- is_degraded: boolean;
280
+ circuit_breaker_status: string;
281
+ quality_tier: string;
307
282
  latency_ms: number;
308
- degradation_reason?: string | null | undefined;
309
- circuit_breaker_status?: Record<string, "CLOSED" | "OPEN" | "HALF_OPEN"> | undefined;
283
+ total_hits: number;
284
+ fallback_applied: boolean;
285
+ degraded_reason: string | null;
310
286
  }>;
311
287
  type SearchMetadata = z.infer<typeof SearchMetadataSchema>;
312
288
  declare const CanonicalDomainKeySchema: z.ZodEnum<[
@@ -331,222 +307,37 @@ declare const ChunkingStrategySchema: z.ZodEnum<[
331
307
  "multimodal"
332
308
  ]>;
333
309
  type ChunkingStrategy = z.infer<typeof ChunkingStrategySchema>;
334
- declare const FileMetadataResponseSchema: z.ZodObject<{
335
- id: z.ZodNumber;
336
- tenant_id: z.ZodString;
337
- parent_metadata_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
338
- file_uri: z.ZodString;
339
- file_uri_hash: z.ZodString;
340
- revision: z.ZodNumber;
341
- is_current: z.ZodBoolean;
342
- is_deleted: z.ZodBoolean;
343
- is_derived: z.ZodBoolean;
344
- file_name: z.ZodString;
345
- file_path: z.ZodString;
346
- folder_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
347
- confidentiality_level: z.ZodEnum<[
348
- "PUBLIC",
349
- "INTERNAL",
350
- "DEPARTMENT",
351
- "CONFIDENTIAL",
352
- "RESTRICTED"
353
- ]>;
354
- department_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
355
- file_size: z.ZodNumber;
356
- mime_type: z.ZodString;
357
- asset_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
358
- asset_index: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
359
- bounding_box: z.ZodOptional<z.ZodNullable<z.ZodObject<{
360
- page: z.ZodOptional<z.ZodNumber>;
361
- x: z.ZodOptional<z.ZodNumber>;
362
- y: z.ZodOptional<z.ZodNumber>;
363
- width: z.ZodOptional<z.ZodNumber>;
364
- height: z.ZodOptional<z.ZodNumber>;
365
- start_sec: z.ZodOptional<z.ZodNumber>;
366
- end_sec: z.ZodOptional<z.ZodNumber>;
367
- frame_index: z.ZodOptional<z.ZodNumber>;
368
- timestamp_sec: z.ZodOptional<z.ZodNumber>;
369
- scene_confidence: z.ZodOptional<z.ZodNumber>;
370
- }, "strip", z.ZodTypeAny, {
371
- page?: number | undefined;
372
- x?: number | undefined;
373
- y?: number | undefined;
374
- width?: number | undefined;
375
- height?: number | undefined;
376
- start_sec?: number | undefined;
377
- end_sec?: number | undefined;
378
- frame_index?: number | undefined;
379
- timestamp_sec?: number | undefined;
380
- scene_confidence?: number | undefined;
381
- }, {
382
- page?: number | undefined;
383
- x?: number | undefined;
384
- y?: number | undefined;
385
- width?: number | undefined;
386
- height?: number | undefined;
387
- start_sec?: number | undefined;
388
- end_sec?: number | undefined;
389
- frame_index?: number | undefined;
390
- timestamp_sec?: number | undefined;
391
- scene_confidence?: number | undefined;
392
- }>>>;
393
- created_at: z.ZodString;
394
- updated_at: z.ZodString;
395
- }, "strip", z.ZodTypeAny, {
396
- id: number;
397
- tenant_id: string;
398
- file_uri: string;
399
- file_uri_hash: string;
400
- revision: number;
401
- is_current: boolean;
402
- is_deleted: boolean;
403
- is_derived: boolean;
404
- file_name: string;
405
- file_path: string;
406
- confidentiality_level: "PUBLIC" | "INTERNAL" | "DEPARTMENT" | "CONFIDENTIAL" | "RESTRICTED";
407
- file_size: number;
408
- mime_type: string;
409
- created_at: string;
410
- updated_at: string;
411
- parent_metadata_id?: number | null | undefined;
412
- folder_path?: string | null | undefined;
413
- department_id?: number | null | undefined;
414
- asset_type?: string | null | undefined;
415
- asset_index?: number | null | undefined;
416
- bounding_box?: {
417
- page?: number | undefined;
418
- x?: number | undefined;
419
- y?: number | undefined;
420
- width?: number | undefined;
421
- height?: number | undefined;
422
- start_sec?: number | undefined;
423
- end_sec?: number | undefined;
424
- frame_index?: number | undefined;
425
- timestamp_sec?: number | undefined;
426
- scene_confidence?: number | undefined;
427
- } | null | undefined;
428
- }, {
429
- id: number;
430
- tenant_id: string;
431
- file_uri: string;
432
- file_uri_hash: string;
433
- revision: number;
434
- is_current: boolean;
435
- is_deleted: boolean;
436
- is_derived: boolean;
437
- file_name: string;
438
- file_path: string;
439
- confidentiality_level: "PUBLIC" | "INTERNAL" | "DEPARTMENT" | "CONFIDENTIAL" | "RESTRICTED";
440
- file_size: number;
441
- mime_type: string;
442
- created_at: string;
443
- updated_at: string;
444
- parent_metadata_id?: number | null | undefined;
445
- folder_path?: string | null | undefined;
446
- department_id?: number | null | undefined;
447
- asset_type?: string | null | undefined;
448
- asset_index?: number | null | undefined;
449
- bounding_box?: {
450
- page?: number | undefined;
451
- x?: number | undefined;
452
- y?: number | undefined;
453
- width?: number | undefined;
454
- height?: number | undefined;
455
- start_sec?: number | undefined;
456
- end_sec?: number | undefined;
457
- frame_index?: number | undefined;
458
- timestamp_sec?: number | undefined;
459
- scene_confidence?: number | undefined;
460
- } | null | undefined;
461
- }>;
462
- type FileMetadataResponse = z.infer<typeof FileMetadataResponseSchema>;
463
310
  declare const SearchHitSchema: z.ZodObject<{
464
- chunk_uid: z.ZodString;
465
- file_uri: z.ZodString;
466
- score: z.ZodNumber;
467
- content: z.ZodString;
311
+ metadata_id: z.ZodNumber;
468
312
  chunk_index: z.ZodNumber;
469
- clause_identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
470
- authority_tier: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
471
- breadcrumb_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
472
- bounding_box: z.ZodOptional<z.ZodNullable<z.ZodObject<{
473
- page: z.ZodOptional<z.ZodNumber>;
474
- x: z.ZodOptional<z.ZodNumber>;
475
- y: z.ZodOptional<z.ZodNumber>;
476
- width: z.ZodOptional<z.ZodNumber>;
477
- height: z.ZodOptional<z.ZodNumber>;
478
- start_sec: z.ZodOptional<z.ZodNumber>;
479
- end_sec: z.ZodOptional<z.ZodNumber>;
480
- frame_index: z.ZodOptional<z.ZodNumber>;
481
- timestamp_sec: z.ZodOptional<z.ZodNumber>;
482
- scene_confidence: z.ZodOptional<z.ZodNumber>;
483
- }, "strip", z.ZodTypeAny, {
484
- page?: number | undefined;
485
- x?: number | undefined;
486
- y?: number | undefined;
487
- width?: number | undefined;
488
- height?: number | undefined;
489
- start_sec?: number | undefined;
490
- end_sec?: number | undefined;
491
- frame_index?: number | undefined;
492
- timestamp_sec?: number | undefined;
493
- scene_confidence?: number | undefined;
494
- }, {
495
- page?: number | undefined;
496
- x?: number | undefined;
497
- y?: number | undefined;
498
- width?: number | undefined;
499
- height?: number | undefined;
500
- start_sec?: number | undefined;
501
- end_sec?: number | undefined;
502
- frame_index?: number | undefined;
503
- timestamp_sec?: number | undefined;
504
- scene_confidence?: number | undefined;
505
- }>>>;
313
+ text: z.ZodString;
314
+ score: z.ZodNumber;
506
315
  }, "strip", z.ZodTypeAny, {
507
- file_uri: string;
508
- chunk_uid: string;
509
- score: number;
510
- content: string;
316
+ text: string;
317
+ metadata_id: number;
511
318
  chunk_index: number;
512
- bounding_box?: {
513
- page?: number | undefined;
514
- x?: number | undefined;
515
- y?: number | undefined;
516
- width?: number | undefined;
517
- height?: number | undefined;
518
- start_sec?: number | undefined;
519
- end_sec?: number | undefined;
520
- frame_index?: number | undefined;
521
- timestamp_sec?: number | undefined;
522
- scene_confidence?: number | undefined;
523
- } | null | undefined;
524
- clause_identifier?: string | null | undefined;
525
- authority_tier?: number | null | undefined;
526
- breadcrumb_path?: string | null | undefined;
527
- }, {
528
- file_uri: string;
529
- chunk_uid: string;
530
319
  score: number;
531
- content: string;
320
+ }, {
321
+ text: string;
322
+ metadata_id: number;
532
323
  chunk_index: number;
533
- bounding_box?: {
534
- page?: number | undefined;
535
- x?: number | undefined;
536
- y?: number | undefined;
537
- width?: number | undefined;
538
- height?: number | undefined;
539
- start_sec?: number | undefined;
540
- end_sec?: number | undefined;
541
- frame_index?: number | undefined;
542
- timestamp_sec?: number | undefined;
543
- scene_confidence?: number | undefined;
544
- } | null | undefined;
545
- clause_identifier?: string | null | undefined;
546
- authority_tier?: number | null | undefined;
547
- breadcrumb_path?: string | null | undefined;
324
+ score: number;
548
325
  }>;
549
326
  type SearchHit = z.infer<typeof SearchHitSchema>;
327
+ declare const GraphSearchHitSchema: z.ZodObject<{
328
+ metadata_id: z.ZodNumber;
329
+ relation: z.ZodString;
330
+ target_name: z.ZodString;
331
+ }, "strip", z.ZodTypeAny, {
332
+ metadata_id: number;
333
+ relation: string;
334
+ target_name: string;
335
+ }, {
336
+ metadata_id: number;
337
+ relation: string;
338
+ target_name: string;
339
+ }>;
340
+ type GraphSearchHit = z.infer<typeof GraphSearchHitSchema>;
550
341
  declare const SearchRequestSchema: z.ZodObject<{
551
342
  query: z.ZodString;
552
343
  tenant_id: z.ZodString;
@@ -560,277 +351,3293 @@ declare const SearchRequestSchema: z.ZodObject<{
560
351
  "MEDIA_ASSET",
561
352
  "GENERAL_DOCUMENT"
562
353
  ]>>;
563
- limit: z.ZodDefault<z.ZodNumber>;
354
+ limit: z.ZodOptional<z.ZodNumber>;
564
355
  department_id: z.ZodOptional<z.ZodNumber>;
565
- user_roles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
566
- }, "strip", z.ZodTypeAny, {
567
- tenant_id: string;
356
+ search_mode: z.ZodOptional<z.ZodEnum<[
357
+ "KEYWORD",
358
+ "SPARSE",
359
+ "DENSE",
360
+ "HYBRID",
361
+ "GRAPH_TRAVERSE"
362
+ ]>>;
363
+ strategy_id: z.ZodOptional<z.ZodNumber>;
364
+ }, "strict", z.ZodTypeAny, {
568
365
  query: string;
569
- limit: number;
570
- user_roles: string[];
571
- department_id?: number | undefined;
366
+ tenant_id: string;
572
367
  domain_key?: "CONTRACT_LEGAL" | "EMAIL_THREAD" | "DAILY_REPORT" | "FINANCIAL_REPORT" | "TECHNICAL_SPEC" | "MASTER_DATA" | "MEDIA_ASSET" | "GENERAL_DOCUMENT" | undefined;
368
+ limit?: number | undefined;
369
+ department_id?: number | undefined;
370
+ search_mode?: "KEYWORD" | "SPARSE" | "DENSE" | "HYBRID" | "GRAPH_TRAVERSE" | undefined;
371
+ strategy_id?: number | undefined;
573
372
  }, {
574
- tenant_id: string;
575
373
  query: string;
576
- department_id?: number | undefined;
374
+ tenant_id: string;
577
375
  domain_key?: "CONTRACT_LEGAL" | "EMAIL_THREAD" | "DAILY_REPORT" | "FINANCIAL_REPORT" | "TECHNICAL_SPEC" | "MASTER_DATA" | "MEDIA_ASSET" | "GENERAL_DOCUMENT" | undefined;
578
376
  limit?: number | undefined;
579
- user_roles?: string[] | undefined;
377
+ department_id?: number | undefined;
378
+ search_mode?: "KEYWORD" | "SPARSE" | "DENSE" | "HYBRID" | "GRAPH_TRAVERSE" | undefined;
379
+ strategy_id?: number | undefined;
580
380
  }>;
581
381
  type SearchRequestInput = z.input<typeof SearchRequestSchema>;
582
382
  type SearchRequest = z.infer<typeof SearchRequestSchema>;
583
383
  declare const SearchResponseSchema: z.ZodObject<{
584
384
  hits: z.ZodArray<z.ZodObject<{
585
- chunk_uid: z.ZodString;
586
- file_uri: z.ZodString;
587
- score: z.ZodNumber;
588
- content: z.ZodString;
385
+ metadata_id: z.ZodNumber;
589
386
  chunk_index: z.ZodNumber;
590
- clause_identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
591
- authority_tier: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
592
- breadcrumb_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
593
- bounding_box: z.ZodOptional<z.ZodNullable<z.ZodObject<{
594
- page: z.ZodOptional<z.ZodNumber>;
595
- x: z.ZodOptional<z.ZodNumber>;
596
- y: z.ZodOptional<z.ZodNumber>;
597
- width: z.ZodOptional<z.ZodNumber>;
598
- height: z.ZodOptional<z.ZodNumber>;
599
- start_sec: z.ZodOptional<z.ZodNumber>;
600
- end_sec: z.ZodOptional<z.ZodNumber>;
601
- frame_index: z.ZodOptional<z.ZodNumber>;
602
- timestamp_sec: z.ZodOptional<z.ZodNumber>;
603
- scene_confidence: z.ZodOptional<z.ZodNumber>;
604
- }, "strip", z.ZodTypeAny, {
605
- page?: number | undefined;
606
- x?: number | undefined;
607
- y?: number | undefined;
608
- width?: number | undefined;
609
- height?: number | undefined;
610
- start_sec?: number | undefined;
611
- end_sec?: number | undefined;
612
- frame_index?: number | undefined;
613
- timestamp_sec?: number | undefined;
614
- scene_confidence?: number | undefined;
615
- }, {
616
- page?: number | undefined;
617
- x?: number | undefined;
618
- y?: number | undefined;
619
- width?: number | undefined;
620
- height?: number | undefined;
621
- start_sec?: number | undefined;
622
- end_sec?: number | undefined;
623
- frame_index?: number | undefined;
624
- timestamp_sec?: number | undefined;
625
- scene_confidence?: number | undefined;
626
- }>>>;
387
+ text: z.ZodString;
388
+ score: z.ZodNumber;
627
389
  }, "strip", z.ZodTypeAny, {
628
- file_uri: string;
629
- chunk_uid: string;
630
- score: number;
631
- content: string;
390
+ text: string;
391
+ metadata_id: number;
632
392
  chunk_index: number;
633
- bounding_box?: {
634
- page?: number | undefined;
635
- x?: number | undefined;
636
- y?: number | undefined;
637
- width?: number | undefined;
638
- height?: number | undefined;
639
- start_sec?: number | undefined;
640
- end_sec?: number | undefined;
641
- frame_index?: number | undefined;
642
- timestamp_sec?: number | undefined;
643
- scene_confidence?: number | undefined;
644
- } | null | undefined;
645
- clause_identifier?: string | null | undefined;
646
- authority_tier?: number | null | undefined;
647
- breadcrumb_path?: string | null | undefined;
648
- }, {
649
- file_uri: string;
650
- chunk_uid: string;
651
393
  score: number;
652
- content: string;
394
+ }, {
395
+ text: string;
396
+ metadata_id: number;
653
397
  chunk_index: number;
654
- bounding_box?: {
655
- page?: number | undefined;
656
- x?: number | undefined;
657
- y?: number | undefined;
658
- width?: number | undefined;
659
- height?: number | undefined;
660
- start_sec?: number | undefined;
661
- end_sec?: number | undefined;
662
- frame_index?: number | undefined;
663
- timestamp_sec?: number | undefined;
664
- scene_confidence?: number | undefined;
665
- } | null | undefined;
666
- clause_identifier?: string | null | undefined;
667
- authority_tier?: number | null | undefined;
668
- breadcrumb_path?: string | null | undefined;
398
+ score: number;
399
+ }>, "many">;
400
+ graph_hits: z.ZodArray<z.ZodObject<{
401
+ metadata_id: z.ZodNumber;
402
+ relation: z.ZodString;
403
+ target_name: z.ZodString;
404
+ }, "strip", z.ZodTypeAny, {
405
+ metadata_id: number;
406
+ relation: string;
407
+ target_name: string;
408
+ }, {
409
+ metadata_id: number;
410
+ relation: string;
411
+ target_name: string;
669
412
  }>, "many">;
413
+ tiers: z.ZodRecord<z.ZodString, z.ZodBoolean>;
670
414
  metadata: z.ZodObject<{
671
- search_mode: z.ZodEnum<[
672
- "KEYWORD",
673
- "SPARSE",
674
- "DENSE",
675
- "HYBRID",
676
- "GRAPH_TRAVERSE"
677
- ]>;
678
- quality_tier: z.ZodEnum<[
679
- "FULL_HYBRID",
680
- "VECTOR_ONLY",
681
- "GRAPH_ONLY",
682
- "STANDARD_SEMANTIC",
683
- "DEGRADED_KEYWORD_ONLY"
684
- ]>;
685
- is_degraded: z.ZodBoolean;
686
- degradation_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
687
- circuit_breaker_status: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<[
688
- "CLOSED",
689
- "OPEN",
690
- "HALF_OPEN"
691
- ]>>>;
415
+ circuit_breaker_status: z.ZodString;
416
+ quality_tier: z.ZodString;
692
417
  latency_ms: z.ZodNumber;
418
+ total_hits: z.ZodNumber;
419
+ fallback_applied: z.ZodBoolean;
420
+ degraded_reason: z.ZodNullable<z.ZodString>;
693
421
  }, "strip", z.ZodTypeAny, {
694
- search_mode: "KEYWORD" | "SPARSE" | "DENSE" | "HYBRID" | "GRAPH_TRAVERSE";
695
- quality_tier: "FULL_HYBRID" | "VECTOR_ONLY" | "GRAPH_ONLY" | "STANDARD_SEMANTIC" | "DEGRADED_KEYWORD_ONLY";
696
- is_degraded: boolean;
422
+ circuit_breaker_status: string;
423
+ quality_tier: string;
697
424
  latency_ms: number;
698
- degradation_reason?: string | null | undefined;
699
- circuit_breaker_status?: Record<string, "CLOSED" | "OPEN" | "HALF_OPEN"> | undefined;
425
+ total_hits: number;
426
+ fallback_applied: boolean;
427
+ degraded_reason: string | null;
700
428
  }, {
701
- search_mode: "KEYWORD" | "SPARSE" | "DENSE" | "HYBRID" | "GRAPH_TRAVERSE";
702
- quality_tier: "FULL_HYBRID" | "VECTOR_ONLY" | "GRAPH_ONLY" | "STANDARD_SEMANTIC" | "DEGRADED_KEYWORD_ONLY";
703
- is_degraded: boolean;
429
+ circuit_breaker_status: string;
430
+ quality_tier: string;
704
431
  latency_ms: number;
705
- degradation_reason?: string | null | undefined;
706
- circuit_breaker_status?: Record<string, "CLOSED" | "OPEN" | "HALF_OPEN"> | undefined;
432
+ total_hits: number;
433
+ fallback_applied: boolean;
434
+ degraded_reason: string | null;
707
435
  }>;
708
436
  }, "strip", z.ZodTypeAny, {
709
437
  hits: {
710
- file_uri: string;
711
- chunk_uid: string;
712
- score: number;
713
- content: string;
438
+ text: string;
439
+ metadata_id: number;
714
440
  chunk_index: number;
715
- bounding_box?: {
716
- page?: number | undefined;
717
- x?: number | undefined;
718
- y?: number | undefined;
719
- width?: number | undefined;
720
- height?: number | undefined;
721
- start_sec?: number | undefined;
722
- end_sec?: number | undefined;
723
- frame_index?: number | undefined;
724
- timestamp_sec?: number | undefined;
725
- scene_confidence?: number | undefined;
726
- } | null | undefined;
727
- clause_identifier?: string | null | undefined;
728
- authority_tier?: number | null | undefined;
729
- breadcrumb_path?: string | null | undefined;
441
+ score: number;
442
+ }[];
443
+ graph_hits: {
444
+ metadata_id: number;
445
+ relation: string;
446
+ target_name: string;
730
447
  }[];
448
+ tiers: Record<string, boolean>;
731
449
  metadata: {
732
- search_mode: "KEYWORD" | "SPARSE" | "DENSE" | "HYBRID" | "GRAPH_TRAVERSE";
733
- quality_tier: "FULL_HYBRID" | "VECTOR_ONLY" | "GRAPH_ONLY" | "STANDARD_SEMANTIC" | "DEGRADED_KEYWORD_ONLY";
734
- is_degraded: boolean;
450
+ circuit_breaker_status: string;
451
+ quality_tier: string;
735
452
  latency_ms: number;
736
- degradation_reason?: string | null | undefined;
737
- circuit_breaker_status?: Record<string, "CLOSED" | "OPEN" | "HALF_OPEN"> | undefined;
453
+ total_hits: number;
454
+ fallback_applied: boolean;
455
+ degraded_reason: string | null;
738
456
  };
739
457
  }, {
740
458
  hits: {
741
- file_uri: string;
742
- chunk_uid: string;
743
- score: number;
744
- content: string;
459
+ text: string;
460
+ metadata_id: number;
745
461
  chunk_index: number;
746
- bounding_box?: {
747
- page?: number | undefined;
748
- x?: number | undefined;
749
- y?: number | undefined;
750
- width?: number | undefined;
751
- height?: number | undefined;
752
- start_sec?: number | undefined;
753
- end_sec?: number | undefined;
754
- frame_index?: number | undefined;
755
- timestamp_sec?: number | undefined;
756
- scene_confidence?: number | undefined;
757
- } | null | undefined;
758
- clause_identifier?: string | null | undefined;
759
- authority_tier?: number | null | undefined;
760
- breadcrumb_path?: string | null | undefined;
462
+ score: number;
463
+ }[];
464
+ graph_hits: {
465
+ metadata_id: number;
466
+ relation: string;
467
+ target_name: string;
761
468
  }[];
469
+ tiers: Record<string, boolean>;
762
470
  metadata: {
763
- search_mode: "KEYWORD" | "SPARSE" | "DENSE" | "HYBRID" | "GRAPH_TRAVERSE";
764
- quality_tier: "FULL_HYBRID" | "VECTOR_ONLY" | "GRAPH_ONLY" | "STANDARD_SEMANTIC" | "DEGRADED_KEYWORD_ONLY";
765
- is_degraded: boolean;
471
+ circuit_breaker_status: string;
472
+ quality_tier: string;
766
473
  latency_ms: number;
767
- degradation_reason?: string | null | undefined;
768
- circuit_breaker_status?: Record<string, "CLOSED" | "OPEN" | "HALF_OPEN"> | undefined;
474
+ total_hits: number;
475
+ fallback_applied: boolean;
476
+ degraded_reason: string | null;
769
477
  };
770
478
  }>;
771
479
  type SearchResponse = z.infer<typeof SearchResponseSchema>;
772
- declare const ReclassifyRequestSchema: z.ZodObject<{
773
- file_uri: z.ZodString;
774
- tenant_id: z.ZodString;
775
- force: z.ZodDefault<z.ZodBoolean>;
776
- }, "strip", z.ZodTypeAny, {
777
- tenant_id: string;
778
- file_uri: string;
779
- force: boolean;
480
+ declare class EnrichmentClient extends BaseEnrichmentClient {
481
+ search(payload: SearchRequestInput): Promise<SearchResponse>;
482
+ }
483
+ declare const DOCUMENT_KINDS: readonly [
484
+ "email",
485
+ "pdf",
486
+ "office",
487
+ "image",
488
+ "media",
489
+ "text",
490
+ "google_native",
491
+ "other"
492
+ ];
493
+ type DocumentKind = (typeof DOCUMENT_KINDS)[number];
494
+ declare const DOCUMENT_KIND_LABELS: Readonly<Record<DocumentKind, string>>;
495
+ declare const MIME_KIND_RULES: readonly (readonly [
496
+ pattern: string,
497
+ kind: DocumentKind
498
+ ])[];
499
+ declare function classifyDocumentKind(mimeType: string): DocumentKind;
500
+ declare const PIPELINE_STEP_KEYS: readonly [
501
+ "delete_child_assets",
502
+ "extract_text",
503
+ "analyze_media",
504
+ "extract_assets",
505
+ "ocr_children",
506
+ "ocr_document",
507
+ "resolve_body",
508
+ "enrich_document",
509
+ "project_to_indexes"
510
+ ];
511
+ type PipelineStepKey = (typeof PIPELINE_STEP_KEYS)[number];
512
+ declare const PIPELINE_PHASES: readonly [
513
+ "EXTRACTING",
514
+ "ENRICHING",
515
+ "PROJECTING"
516
+ ];
517
+ type PipelinePhase = (typeof PIPELINE_PHASES)[number];
518
+ type PipelineFailureStatus = "FAILED_EXTRACT" | "FAILED_ENRICH" | "FAILED_VECTOR" | "FAILED_GRAPH";
519
+ interface StepGate {
520
+ readonly featureFlagKey: string;
521
+ readonly whenClosed: "skip" | "fail";
522
+ readonly failureStatus: PipelineFailureStatus | null;
523
+ }
524
+ interface PipelineStepDefinition {
525
+ readonly key: PipelineStepKey;
526
+ readonly label: string;
527
+ readonly description: string;
528
+ readonly endpoint: string;
529
+ readonly phase: PipelinePhase;
530
+ readonly failureStatus: PipelineFailureStatus;
531
+ readonly gates: readonly StepGate[];
532
+ readonly capability: string | null;
533
+ readonly fanOut: "children" | null;
534
+ }
535
+ declare const PIPELINE_STEPS: Readonly<Record<PipelineStepKey, PipelineStepDefinition>>;
536
+ type ChunkSource = "rebuild" | "existing";
537
+ interface FlowGatePolicy {
538
+ readonly whenClosed: "fail";
539
+ readonly failureStatus: PipelineFailureStatus;
540
+ }
541
+ interface FlowStep {
542
+ readonly step: PipelineStepKey;
543
+ readonly dependsOn: readonly PipelineStepKey[];
544
+ readonly chunkSource?: ChunkSource;
545
+ readonly gatePolicy?: FlowGatePolicy;
546
+ }
547
+ interface PipelineFlow {
548
+ readonly kind: DocumentKind;
549
+ readonly steps: readonly FlowStep[];
550
+ }
551
+ declare const PIPELINE_FLOWS: Readonly<Record<DocumentKind, PipelineFlow>>;
552
+ declare function flowFor(kind: DocumentKind): PipelineFlow;
553
+ declare function flowStepGates(flowStep: FlowStep): readonly StepGate[];
554
+ declare function orderedSteps(flow: PipelineFlow): readonly FlowStep[];
555
+ declare function comparePhases(a: PipelinePhase, b: PipelinePhase): number;
556
+ declare const isStrictlyEarlier: (earlier: string, later: string) => boolean;
557
+ declare const IntegrityStoreSchema: z.ZodEnum<[
558
+ "QDRANT",
559
+ "NEO4J"
560
+ ]>;
561
+ type IntegrityStore = z.infer<typeof IntegrityStoreSchema>;
562
+ declare const IntegrityScopeRoleSchema: z.ZodEnum<[
563
+ "PRODUCTION",
564
+ "VARIANT",
565
+ "LABEL"
566
+ ]>;
567
+ type IntegrityScopeRole = z.infer<typeof IntegrityScopeRoleSchema>;
568
+ declare const IntegrityItemClassSchema: z.ZodEnum<[
569
+ "EXPECTED",
570
+ "LIVE",
571
+ "HISTORY",
572
+ "TOMBSTONE",
573
+ "AWAITING_SUCCESSOR",
574
+ "IN_FLIGHT",
575
+ "UNPLACED",
576
+ "UNRECORDED",
577
+ "UNREFERENCED",
578
+ "CHANGED_AFTER_START",
579
+ "PIPELINE_FAILED",
580
+ "PROJECTION_REFUSED",
581
+ "ORPHAN",
582
+ "TOMBSTONE_EXPIRED",
583
+ "UNPROPAGATED_DELETE",
584
+ "STALE_REVISION",
585
+ "MISPLACED",
586
+ "UNMARKED_SUPERSEDED",
587
+ "FLAG_DRIFT",
588
+ "DETACHED",
589
+ "UNKEYED",
590
+ "MISSING",
591
+ "COUNT_MISMATCH"
592
+ ]>;
593
+ type IntegrityItemClass = z.infer<typeof IntegrityItemClassSchema>;
594
+ declare const IntegrityFindingItemClassSchema: z.ZodEnum<[
595
+ "TOMBSTONE",
596
+ "AWAITING_SUCCESSOR",
597
+ "IN_FLIGHT",
598
+ "UNPLACED",
599
+ "UNRECORDED",
600
+ "UNREFERENCED",
601
+ "CHANGED_AFTER_START",
602
+ "PIPELINE_FAILED",
603
+ "PROJECTION_REFUSED",
604
+ "ORPHAN",
605
+ "TOMBSTONE_EXPIRED",
606
+ "UNPROPAGATED_DELETE",
607
+ "STALE_REVISION",
608
+ "MISPLACED",
609
+ "UNMARKED_SUPERSEDED",
610
+ "FLAG_DRIFT",
611
+ "DETACHED",
612
+ "UNKEYED",
613
+ "MISSING",
614
+ "COUNT_MISMATCH"
615
+ ]>;
616
+ type IntegrityFindingItemClass = z.infer<typeof IntegrityFindingItemClassSchema>;
617
+ declare const IntegrityUnitSchema: z.ZodEnum<[
618
+ "POINT",
619
+ "NODE",
620
+ "CHUNK",
621
+ "DOCUMENT"
622
+ ]>;
623
+ type IntegrityUnit = z.infer<typeof IntegrityUnitSchema>;
624
+ declare const IntegrityDispositionSchema: z.ZodEnum<[
625
+ "EXPECTED",
626
+ "HEALTHY",
627
+ "RETAINED",
628
+ "INFORMATIONAL",
629
+ "DISCREPANCY"
630
+ ]>;
631
+ type IntegrityDisposition = z.infer<typeof IntegrityDispositionSchema>;
632
+ declare const IntegrityRepairActionSchema: z.ZodEnum<[
633
+ "NONE",
634
+ "PURGE",
635
+ "FLAG",
636
+ "REPROJECT"
637
+ ]>;
638
+ type IntegrityRepairAction = z.infer<typeof IntegrityRepairActionSchema>;
639
+ interface IntegrityClassPolicy {
640
+ readonly disposition: IntegrityDisposition;
641
+ readonly repairAction: IntegrityRepairAction;
642
+ }
643
+ declare const INTEGRITY_CLASS_POLICY: Readonly<Record<IntegrityItemClass, IntegrityClassPolicy>>;
644
+ declare const IntegrityRunModeSchema: z.ZodEnum<[
645
+ "SCAN",
646
+ "REPAIR"
647
+ ]>;
648
+ type IntegrityRunMode = z.infer<typeof IntegrityRunModeSchema>;
649
+ declare const IntegrityRunStatusSchema: z.ZodEnum<[
650
+ "RUNNING",
651
+ "COMPLETED",
652
+ "FAILED",
653
+ "CANCELLED",
654
+ "ABANDONED"
655
+ ]>;
656
+ type IntegrityRunStatus = z.infer<typeof IntegrityRunStatusSchema>;
657
+ declare const IntegrityVerdictSchema: z.ZodEnum<[
658
+ "CONSISTENT",
659
+ "INCONSISTENT",
660
+ "UNDETERMINED"
661
+ ]>;
662
+ type IntegrityVerdict = z.infer<typeof IntegrityVerdictSchema>;
663
+ declare const IntegrityPhaseSchema: z.ZodEnum<[
664
+ "QDRANT",
665
+ "NEO4J",
666
+ "DOCUMENTS"
667
+ ]>;
668
+ type IntegrityPhase = z.infer<typeof IntegrityPhaseSchema>;
669
+ declare const IntegrityRepairOutcomeSchema: z.ZodEnum<[
670
+ "APPLIED",
671
+ "SKIPPED",
672
+ "FAILED"
673
+ ]>;
674
+ type IntegrityRepairOutcome = z.infer<typeof IntegrityRepairOutcomeSchema>;
675
+ declare const IntegrityRepairSkipReasonSchema: z.ZodEnum<[
676
+ "RECLASSIFIED",
677
+ "IN_FLIGHT",
678
+ "DESTINATION_PENDING",
679
+ "BASIS_EXHAUSTED",
680
+ "PROJECTION_REFUSED"
681
+ ]>;
682
+ type IntegrityRepairSkipReason = z.infer<typeof IntegrityRepairSkipReasonSchema>;
683
+ declare const INTEGRITY_FINDINGS_PAGE_LIMIT_MAX = 100;
684
+ declare const IntegrityRunHeaderSchema: z.ZodEffects<z.ZodObject<{
685
+ runUid: z.ZodEffects<z.ZodString, string, string>;
686
+ mode: z.ZodEnum<[
687
+ "SCAN",
688
+ "REPAIR"
689
+ ]>;
690
+ status: z.ZodEnum<[
691
+ "RUNNING",
692
+ "COMPLETED",
693
+ "FAILED",
694
+ "CANCELLED",
695
+ "ABANDONED"
696
+ ]>;
697
+ requestedBy: z.ZodString;
698
+ executor: z.ZodString;
699
+ basisRunUid: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
700
+ storeFingerprint: z.ZodString;
701
+ tombstoneRetentionDays: z.ZodNumber;
702
+ startedAt: z.ZodString;
703
+ finishedAt: z.ZodNullable<z.ZodString>;
704
+ verdict: z.ZodNullable<z.ZodEnum<[
705
+ "CONSISTENT",
706
+ "INCONSISTENT",
707
+ "UNDETERMINED"
708
+ ]>>;
709
+ errorClass: z.ZodNullable<z.ZodString>;
710
+ reprojectDocuments: z.ZodNullable<z.ZodNumber>;
711
+ reprojectRebuildDocuments: z.ZodNullable<z.ZodNumber>;
712
+ }, "strict", z.ZodTypeAny, {
713
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
714
+ mode: "SCAN" | "REPAIR";
715
+ runUid: string;
716
+ requestedBy: string;
717
+ executor: string;
718
+ basisRunUid: string | null;
719
+ storeFingerprint: string;
720
+ tombstoneRetentionDays: number;
721
+ startedAt: string;
722
+ finishedAt: string | null;
723
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
724
+ errorClass: string | null;
725
+ reprojectDocuments: number | null;
726
+ reprojectRebuildDocuments: number | null;
780
727
  }, {
781
- tenant_id: string;
782
- file_uri: string;
783
- force?: boolean | undefined;
728
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
729
+ mode: "SCAN" | "REPAIR";
730
+ runUid: string;
731
+ requestedBy: string;
732
+ executor: string;
733
+ basisRunUid: string | null;
734
+ storeFingerprint: string;
735
+ tombstoneRetentionDays: number;
736
+ startedAt: string;
737
+ finishedAt: string | null;
738
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
739
+ errorClass: string | null;
740
+ reprojectDocuments: number | null;
741
+ reprojectRebuildDocuments: number | null;
742
+ }>, {
743
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
744
+ mode: "SCAN" | "REPAIR";
745
+ runUid: string;
746
+ requestedBy: string;
747
+ executor: string;
748
+ basisRunUid: string | null;
749
+ storeFingerprint: string;
750
+ tombstoneRetentionDays: number;
751
+ startedAt: string;
752
+ finishedAt: string | null;
753
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
754
+ errorClass: string | null;
755
+ reprojectDocuments: number | null;
756
+ reprojectRebuildDocuments: number | null;
757
+ }, {
758
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
759
+ mode: "SCAN" | "REPAIR";
760
+ runUid: string;
761
+ requestedBy: string;
762
+ executor: string;
763
+ basisRunUid: string | null;
764
+ storeFingerprint: string;
765
+ tombstoneRetentionDays: number;
766
+ startedAt: string;
767
+ finishedAt: string | null;
768
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
769
+ errorClass: string | null;
770
+ reprojectDocuments: number | null;
771
+ reprojectRebuildDocuments: number | null;
784
772
  }>;
785
- type ReclassifyRequestInput = z.input<typeof ReclassifyRequestSchema>;
786
- type ReclassifyRequest = z.infer<typeof ReclassifyRequestSchema>;
787
- declare const ReclassifyResponseSchema: z.ZodObject<{
788
- file_uri: z.ZodString;
789
- domain_key: z.ZodEnum<[
790
- "CONTRACT_LEGAL",
791
- "EMAIL_THREAD",
792
- "DAILY_REPORT",
793
- "FINANCIAL_REPORT",
794
- "TECHNICAL_SPEC",
795
- "MASTER_DATA",
796
- "MEDIA_ASSET",
797
- "GENERAL_DOCUMENT"
773
+ type IntegrityRunHeader = z.infer<typeof IntegrityRunHeaderSchema>;
774
+ declare const IntegrityQuantitySchema: z.ZodEffects<z.ZodObject<{
775
+ store: z.ZodEnum<[
776
+ "QDRANT",
777
+ "NEO4J"
778
+ ]>;
779
+ scopeKey: z.ZodString;
780
+ scopeRole: z.ZodEnum<[
781
+ "PRODUCTION",
782
+ "VARIANT",
783
+ "LABEL"
784
+ ]>;
785
+ itemClass: z.ZodEnum<[
786
+ "EXPECTED",
787
+ "LIVE",
788
+ "HISTORY",
789
+ "TOMBSTONE",
790
+ "AWAITING_SUCCESSOR",
791
+ "IN_FLIGHT",
792
+ "UNPLACED",
793
+ "UNRECORDED",
794
+ "UNREFERENCED",
795
+ "CHANGED_AFTER_START",
796
+ "PIPELINE_FAILED",
797
+ "PROJECTION_REFUSED",
798
+ "ORPHAN",
799
+ "TOMBSTONE_EXPIRED",
800
+ "UNPROPAGATED_DELETE",
801
+ "STALE_REVISION",
802
+ "MISPLACED",
803
+ "UNMARKED_SUPERSEDED",
804
+ "FLAG_DRIFT",
805
+ "DETACHED",
806
+ "UNKEYED",
807
+ "MISSING",
808
+ "COUNT_MISMATCH"
809
+ ]>;
810
+ unit: z.ZodEnum<[
811
+ "POINT",
812
+ "NODE",
813
+ "CHUNK",
814
+ "DOCUMENT"
815
+ ]>;
816
+ disposition: z.ZodEnum<[
817
+ "EXPECTED",
818
+ "HEALTHY",
819
+ "RETAINED",
820
+ "INFORMATIONAL",
821
+ "DISCREPANCY"
798
822
  ]>;
799
- strategy_name: z.ZodString;
800
- chunking_strategy: z.ZodOptional<z.ZodEnum<[
801
- "hierarchical",
802
- "conversation",
803
- "section",
804
- "fixed_size",
805
- "table_aware",
806
- "semantic",
807
- "none",
808
- "multimodal"
823
+ repairAction: z.ZodEnum<[
824
+ "NONE",
825
+ "PURGE",
826
+ "FLAG",
827
+ "REPROJECT"
828
+ ]>;
829
+ itemCount: z.ZodNullable<z.ZodNumber>;
830
+ unmeasuredReason: z.ZodNullable<z.ZodString>;
831
+ measuredAt: z.ZodNullable<z.ZodString>;
832
+ repairedCount: z.ZodNullable<z.ZodNumber>;
833
+ repairFailedCount: z.ZodNullable<z.ZodNumber>;
834
+ repairSkippedCount: z.ZodNullable<z.ZodNumber>;
835
+ }, "strict", z.ZodTypeAny, {
836
+ repairedCount: number | null;
837
+ repairFailedCount: number | null;
838
+ repairSkippedCount: number | null;
839
+ store: "QDRANT" | "NEO4J";
840
+ scopeKey: string;
841
+ scopeRole: "PRODUCTION" | "VARIANT" | "LABEL";
842
+ itemClass: "EXPECTED" | "LIVE" | "HISTORY" | "TOMBSTONE" | "AWAITING_SUCCESSOR" | "IN_FLIGHT" | "UNPLACED" | "UNRECORDED" | "UNREFERENCED" | "CHANGED_AFTER_START" | "PIPELINE_FAILED" | "PROJECTION_REFUSED" | "ORPHAN" | "TOMBSTONE_EXPIRED" | "UNPROPAGATED_DELETE" | "STALE_REVISION" | "MISPLACED" | "UNMARKED_SUPERSEDED" | "FLAG_DRIFT" | "DETACHED" | "UNKEYED" | "MISSING" | "COUNT_MISMATCH";
843
+ unit: "POINT" | "NODE" | "CHUNK" | "DOCUMENT";
844
+ disposition: "EXPECTED" | "HEALTHY" | "RETAINED" | "INFORMATIONAL" | "DISCREPANCY";
845
+ repairAction: "NONE" | "PURGE" | "FLAG" | "REPROJECT";
846
+ itemCount: number | null;
847
+ unmeasuredReason: string | null;
848
+ measuredAt: string | null;
849
+ }, {
850
+ repairedCount: number | null;
851
+ repairFailedCount: number | null;
852
+ repairSkippedCount: number | null;
853
+ store: "QDRANT" | "NEO4J";
854
+ scopeKey: string;
855
+ scopeRole: "PRODUCTION" | "VARIANT" | "LABEL";
856
+ itemClass: "EXPECTED" | "LIVE" | "HISTORY" | "TOMBSTONE" | "AWAITING_SUCCESSOR" | "IN_FLIGHT" | "UNPLACED" | "UNRECORDED" | "UNREFERENCED" | "CHANGED_AFTER_START" | "PIPELINE_FAILED" | "PROJECTION_REFUSED" | "ORPHAN" | "TOMBSTONE_EXPIRED" | "UNPROPAGATED_DELETE" | "STALE_REVISION" | "MISPLACED" | "UNMARKED_SUPERSEDED" | "FLAG_DRIFT" | "DETACHED" | "UNKEYED" | "MISSING" | "COUNT_MISMATCH";
857
+ unit: "POINT" | "NODE" | "CHUNK" | "DOCUMENT";
858
+ disposition: "EXPECTED" | "HEALTHY" | "RETAINED" | "INFORMATIONAL" | "DISCREPANCY";
859
+ repairAction: "NONE" | "PURGE" | "FLAG" | "REPROJECT";
860
+ itemCount: number | null;
861
+ unmeasuredReason: string | null;
862
+ measuredAt: string | null;
863
+ }>, {
864
+ repairedCount: number | null;
865
+ repairFailedCount: number | null;
866
+ repairSkippedCount: number | null;
867
+ store: "QDRANT" | "NEO4J";
868
+ scopeKey: string;
869
+ scopeRole: "PRODUCTION" | "VARIANT" | "LABEL";
870
+ itemClass: "EXPECTED" | "LIVE" | "HISTORY" | "TOMBSTONE" | "AWAITING_SUCCESSOR" | "IN_FLIGHT" | "UNPLACED" | "UNRECORDED" | "UNREFERENCED" | "CHANGED_AFTER_START" | "PIPELINE_FAILED" | "PROJECTION_REFUSED" | "ORPHAN" | "TOMBSTONE_EXPIRED" | "UNPROPAGATED_DELETE" | "STALE_REVISION" | "MISPLACED" | "UNMARKED_SUPERSEDED" | "FLAG_DRIFT" | "DETACHED" | "UNKEYED" | "MISSING" | "COUNT_MISMATCH";
871
+ unit: "POINT" | "NODE" | "CHUNK" | "DOCUMENT";
872
+ disposition: "EXPECTED" | "HEALTHY" | "RETAINED" | "INFORMATIONAL" | "DISCREPANCY";
873
+ repairAction: "NONE" | "PURGE" | "FLAG" | "REPROJECT";
874
+ itemCount: number | null;
875
+ unmeasuredReason: string | null;
876
+ measuredAt: string | null;
877
+ }, {
878
+ repairedCount: number | null;
879
+ repairFailedCount: number | null;
880
+ repairSkippedCount: number | null;
881
+ store: "QDRANT" | "NEO4J";
882
+ scopeKey: string;
883
+ scopeRole: "PRODUCTION" | "VARIANT" | "LABEL";
884
+ itemClass: "EXPECTED" | "LIVE" | "HISTORY" | "TOMBSTONE" | "AWAITING_SUCCESSOR" | "IN_FLIGHT" | "UNPLACED" | "UNRECORDED" | "UNREFERENCED" | "CHANGED_AFTER_START" | "PIPELINE_FAILED" | "PROJECTION_REFUSED" | "ORPHAN" | "TOMBSTONE_EXPIRED" | "UNPROPAGATED_DELETE" | "STALE_REVISION" | "MISPLACED" | "UNMARKED_SUPERSEDED" | "FLAG_DRIFT" | "DETACHED" | "UNKEYED" | "MISSING" | "COUNT_MISMATCH";
885
+ unit: "POINT" | "NODE" | "CHUNK" | "DOCUMENT";
886
+ disposition: "EXPECTED" | "HEALTHY" | "RETAINED" | "INFORMATIONAL" | "DISCREPANCY";
887
+ repairAction: "NONE" | "PURGE" | "FLAG" | "REPROJECT";
888
+ itemCount: number | null;
889
+ unmeasuredReason: string | null;
890
+ measuredAt: string | null;
891
+ }>;
892
+ type IntegrityQuantity = z.infer<typeof IntegrityQuantitySchema>;
893
+ declare const IntegrityActiveRunSchema: z.ZodEffects<z.ZodObject<{
894
+ run: z.ZodEffects<z.ZodObject<{
895
+ runUid: z.ZodEffects<z.ZodString, string, string>;
896
+ mode: z.ZodEnum<[
897
+ "SCAN",
898
+ "REPAIR"
899
+ ]>;
900
+ status: z.ZodEnum<[
901
+ "RUNNING",
902
+ "COMPLETED",
903
+ "FAILED",
904
+ "CANCELLED",
905
+ "ABANDONED"
906
+ ]>;
907
+ requestedBy: z.ZodString;
908
+ executor: z.ZodString;
909
+ basisRunUid: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
910
+ storeFingerprint: z.ZodString;
911
+ tombstoneRetentionDays: z.ZodNumber;
912
+ startedAt: z.ZodString;
913
+ finishedAt: z.ZodNullable<z.ZodString>;
914
+ verdict: z.ZodNullable<z.ZodEnum<[
915
+ "CONSISTENT",
916
+ "INCONSISTENT",
917
+ "UNDETERMINED"
918
+ ]>>;
919
+ errorClass: z.ZodNullable<z.ZodString>;
920
+ reprojectDocuments: z.ZodNullable<z.ZodNumber>;
921
+ reprojectRebuildDocuments: z.ZodNullable<z.ZodNumber>;
922
+ }, "strict", z.ZodTypeAny, {
923
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
924
+ mode: "SCAN" | "REPAIR";
925
+ runUid: string;
926
+ requestedBy: string;
927
+ executor: string;
928
+ basisRunUid: string | null;
929
+ storeFingerprint: string;
930
+ tombstoneRetentionDays: number;
931
+ startedAt: string;
932
+ finishedAt: string | null;
933
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
934
+ errorClass: string | null;
935
+ reprojectDocuments: number | null;
936
+ reprojectRebuildDocuments: number | null;
937
+ }, {
938
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
939
+ mode: "SCAN" | "REPAIR";
940
+ runUid: string;
941
+ requestedBy: string;
942
+ executor: string;
943
+ basisRunUid: string | null;
944
+ storeFingerprint: string;
945
+ tombstoneRetentionDays: number;
946
+ startedAt: string;
947
+ finishedAt: string | null;
948
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
949
+ errorClass: string | null;
950
+ reprojectDocuments: number | null;
951
+ reprojectRebuildDocuments: number | null;
952
+ }>, {
953
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
954
+ mode: "SCAN" | "REPAIR";
955
+ runUid: string;
956
+ requestedBy: string;
957
+ executor: string;
958
+ basisRunUid: string | null;
959
+ storeFingerprint: string;
960
+ tombstoneRetentionDays: number;
961
+ startedAt: string;
962
+ finishedAt: string | null;
963
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
964
+ errorClass: string | null;
965
+ reprojectDocuments: number | null;
966
+ reprojectRebuildDocuments: number | null;
967
+ }, {
968
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
969
+ mode: "SCAN" | "REPAIR";
970
+ runUid: string;
971
+ requestedBy: string;
972
+ executor: string;
973
+ basisRunUid: string | null;
974
+ storeFingerprint: string;
975
+ tombstoneRetentionDays: number;
976
+ startedAt: string;
977
+ finishedAt: string | null;
978
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
979
+ errorClass: string | null;
980
+ reprojectDocuments: number | null;
981
+ reprojectRebuildDocuments: number | null;
982
+ }>;
983
+ phase: z.ZodNullable<z.ZodEnum<[
984
+ "QDRANT",
985
+ "NEO4J",
986
+ "DOCUMENTS"
809
987
  ]>>;
810
- applied_rule_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
811
- assigned_department_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
812
- }, "strip", z.ZodTypeAny, {
813
- file_uri: string;
814
- domain_key: "CONTRACT_LEGAL" | "EMAIL_THREAD" | "DAILY_REPORT" | "FINANCIAL_REPORT" | "TECHNICAL_SPEC" | "MASTER_DATA" | "MEDIA_ASSET" | "GENERAL_DOCUMENT";
815
- strategy_name: string;
816
- chunking_strategy?: "hierarchical" | "conversation" | "section" | "fixed_size" | "table_aware" | "semantic" | "none" | "multimodal" | undefined;
817
- applied_rule_name?: string | null | undefined;
818
- assigned_department_id?: number | null | undefined;
819
- }, {
820
- file_uri: string;
821
- domain_key: "CONTRACT_LEGAL" | "EMAIL_THREAD" | "DAILY_REPORT" | "FINANCIAL_REPORT" | "TECHNICAL_SPEC" | "MASTER_DATA" | "MEDIA_ASSET" | "GENERAL_DOCUMENT";
822
- strategy_name: string;
823
- chunking_strategy?: "hierarchical" | "conversation" | "section" | "fixed_size" | "table_aware" | "semantic" | "none" | "multimodal" | undefined;
824
- applied_rule_name?: string | null | undefined;
825
- assigned_department_id?: number | null | undefined;
988
+ phaseScope: z.ZodNullable<z.ZodString>;
989
+ phaseDone: z.ZodNullable<z.ZodNumber>;
990
+ phaseTotal: z.ZodNullable<z.ZodNumber>;
991
+ heartbeatAt: z.ZodString;
992
+ isStale: z.ZodBoolean;
993
+ cancelRequestedAt: z.ZodNullable<z.ZodString>;
994
+ }, "strict", z.ZodTypeAny, {
995
+ run: {
996
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
997
+ mode: "SCAN" | "REPAIR";
998
+ runUid: string;
999
+ requestedBy: string;
1000
+ executor: string;
1001
+ basisRunUid: string | null;
1002
+ storeFingerprint: string;
1003
+ tombstoneRetentionDays: number;
1004
+ startedAt: string;
1005
+ finishedAt: string | null;
1006
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1007
+ errorClass: string | null;
1008
+ reprojectDocuments: number | null;
1009
+ reprojectRebuildDocuments: number | null;
1010
+ };
1011
+ phase: "QDRANT" | "NEO4J" | "DOCUMENTS" | null;
1012
+ phaseScope: string | null;
1013
+ phaseDone: number | null;
1014
+ phaseTotal: number | null;
1015
+ heartbeatAt: string;
1016
+ isStale: boolean;
1017
+ cancelRequestedAt: string | null;
1018
+ }, {
1019
+ run: {
1020
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1021
+ mode: "SCAN" | "REPAIR";
1022
+ runUid: string;
1023
+ requestedBy: string;
1024
+ executor: string;
1025
+ basisRunUid: string | null;
1026
+ storeFingerprint: string;
1027
+ tombstoneRetentionDays: number;
1028
+ startedAt: string;
1029
+ finishedAt: string | null;
1030
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1031
+ errorClass: string | null;
1032
+ reprojectDocuments: number | null;
1033
+ reprojectRebuildDocuments: number | null;
1034
+ };
1035
+ phase: "QDRANT" | "NEO4J" | "DOCUMENTS" | null;
1036
+ phaseScope: string | null;
1037
+ phaseDone: number | null;
1038
+ phaseTotal: number | null;
1039
+ heartbeatAt: string;
1040
+ isStale: boolean;
1041
+ cancelRequestedAt: string | null;
1042
+ }>, {
1043
+ run: {
1044
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1045
+ mode: "SCAN" | "REPAIR";
1046
+ runUid: string;
1047
+ requestedBy: string;
1048
+ executor: string;
1049
+ basisRunUid: string | null;
1050
+ storeFingerprint: string;
1051
+ tombstoneRetentionDays: number;
1052
+ startedAt: string;
1053
+ finishedAt: string | null;
1054
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1055
+ errorClass: string | null;
1056
+ reprojectDocuments: number | null;
1057
+ reprojectRebuildDocuments: number | null;
1058
+ };
1059
+ phase: "QDRANT" | "NEO4J" | "DOCUMENTS" | null;
1060
+ phaseScope: string | null;
1061
+ phaseDone: number | null;
1062
+ phaseTotal: number | null;
1063
+ heartbeatAt: string;
1064
+ isStale: boolean;
1065
+ cancelRequestedAt: string | null;
1066
+ }, {
1067
+ run: {
1068
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1069
+ mode: "SCAN" | "REPAIR";
1070
+ runUid: string;
1071
+ requestedBy: string;
1072
+ executor: string;
1073
+ basisRunUid: string | null;
1074
+ storeFingerprint: string;
1075
+ tombstoneRetentionDays: number;
1076
+ startedAt: string;
1077
+ finishedAt: string | null;
1078
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1079
+ errorClass: string | null;
1080
+ reprojectDocuments: number | null;
1081
+ reprojectRebuildDocuments: number | null;
1082
+ };
1083
+ phase: "QDRANT" | "NEO4J" | "DOCUMENTS" | null;
1084
+ phaseScope: string | null;
1085
+ phaseDone: number | null;
1086
+ phaseTotal: number | null;
1087
+ heartbeatAt: string;
1088
+ isStale: boolean;
1089
+ cancelRequestedAt: string | null;
826
1090
  }>;
827
- type ReclassifyResponse = z.infer<typeof ReclassifyResponseSchema>;
828
- declare class EnrichmentClient extends BaseEnrichmentClient {
829
- search(payload: SearchRequestInput): Promise<SearchResponse>;
830
- reclassify(payload: ReclassifyRequestInput): Promise<ReclassifyResponse>;
831
- getFileMetadata(fileUri: string, tenantId: string): Promise<FileMetadataResponse>;
832
- getMetadata(fileUri: string, tenantId: string): Promise<FileMetadataResponse>;
833
- }
1091
+ type IntegrityActiveRun = z.infer<typeof IntegrityActiveRunSchema>;
1092
+ declare const IntegrityAuditOverviewSchema: z.ZodObject<{
1093
+ readAt: z.ZodString;
1094
+ lastCompleted: z.ZodNullable<z.ZodEffects<z.ZodObject<{
1095
+ run: z.ZodEffects<z.ZodObject<{
1096
+ runUid: z.ZodEffects<z.ZodString, string, string>;
1097
+ mode: z.ZodEnum<[
1098
+ "SCAN",
1099
+ "REPAIR"
1100
+ ]>;
1101
+ status: z.ZodEnum<[
1102
+ "RUNNING",
1103
+ "COMPLETED",
1104
+ "FAILED",
1105
+ "CANCELLED",
1106
+ "ABANDONED"
1107
+ ]>;
1108
+ requestedBy: z.ZodString;
1109
+ executor: z.ZodString;
1110
+ basisRunUid: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
1111
+ storeFingerprint: z.ZodString;
1112
+ tombstoneRetentionDays: z.ZodNumber;
1113
+ startedAt: z.ZodString;
1114
+ finishedAt: z.ZodNullable<z.ZodString>;
1115
+ verdict: z.ZodNullable<z.ZodEnum<[
1116
+ "CONSISTENT",
1117
+ "INCONSISTENT",
1118
+ "UNDETERMINED"
1119
+ ]>>;
1120
+ errorClass: z.ZodNullable<z.ZodString>;
1121
+ reprojectDocuments: z.ZodNullable<z.ZodNumber>;
1122
+ reprojectRebuildDocuments: z.ZodNullable<z.ZodNumber>;
1123
+ }, "strict", z.ZodTypeAny, {
1124
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1125
+ mode: "SCAN" | "REPAIR";
1126
+ runUid: string;
1127
+ requestedBy: string;
1128
+ executor: string;
1129
+ basisRunUid: string | null;
1130
+ storeFingerprint: string;
1131
+ tombstoneRetentionDays: number;
1132
+ startedAt: string;
1133
+ finishedAt: string | null;
1134
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1135
+ errorClass: string | null;
1136
+ reprojectDocuments: number | null;
1137
+ reprojectRebuildDocuments: number | null;
1138
+ }, {
1139
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1140
+ mode: "SCAN" | "REPAIR";
1141
+ runUid: string;
1142
+ requestedBy: string;
1143
+ executor: string;
1144
+ basisRunUid: string | null;
1145
+ storeFingerprint: string;
1146
+ tombstoneRetentionDays: number;
1147
+ startedAt: string;
1148
+ finishedAt: string | null;
1149
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1150
+ errorClass: string | null;
1151
+ reprojectDocuments: number | null;
1152
+ reprojectRebuildDocuments: number | null;
1153
+ }>, {
1154
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1155
+ mode: "SCAN" | "REPAIR";
1156
+ runUid: string;
1157
+ requestedBy: string;
1158
+ executor: string;
1159
+ basisRunUid: string | null;
1160
+ storeFingerprint: string;
1161
+ tombstoneRetentionDays: number;
1162
+ startedAt: string;
1163
+ finishedAt: string | null;
1164
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1165
+ errorClass: string | null;
1166
+ reprojectDocuments: number | null;
1167
+ reprojectRebuildDocuments: number | null;
1168
+ }, {
1169
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1170
+ mode: "SCAN" | "REPAIR";
1171
+ runUid: string;
1172
+ requestedBy: string;
1173
+ executor: string;
1174
+ basisRunUid: string | null;
1175
+ storeFingerprint: string;
1176
+ tombstoneRetentionDays: number;
1177
+ startedAt: string;
1178
+ finishedAt: string | null;
1179
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1180
+ errorClass: string | null;
1181
+ reprojectDocuments: number | null;
1182
+ reprojectRebuildDocuments: number | null;
1183
+ }>;
1184
+ quantities: z.ZodArray<z.ZodEffects<z.ZodObject<{
1185
+ store: z.ZodEnum<[
1186
+ "QDRANT",
1187
+ "NEO4J"
1188
+ ]>;
1189
+ scopeKey: z.ZodString;
1190
+ scopeRole: z.ZodEnum<[
1191
+ "PRODUCTION",
1192
+ "VARIANT",
1193
+ "LABEL"
1194
+ ]>;
1195
+ itemClass: z.ZodEnum<[
1196
+ "EXPECTED",
1197
+ "LIVE",
1198
+ "HISTORY",
1199
+ "TOMBSTONE",
1200
+ "AWAITING_SUCCESSOR",
1201
+ "IN_FLIGHT",
1202
+ "UNPLACED",
1203
+ "UNRECORDED",
1204
+ "UNREFERENCED",
1205
+ "CHANGED_AFTER_START",
1206
+ "PIPELINE_FAILED",
1207
+ "PROJECTION_REFUSED",
1208
+ "ORPHAN",
1209
+ "TOMBSTONE_EXPIRED",
1210
+ "UNPROPAGATED_DELETE",
1211
+ "STALE_REVISION",
1212
+ "MISPLACED",
1213
+ "UNMARKED_SUPERSEDED",
1214
+ "FLAG_DRIFT",
1215
+ "DETACHED",
1216
+ "UNKEYED",
1217
+ "MISSING",
1218
+ "COUNT_MISMATCH"
1219
+ ]>;
1220
+ unit: z.ZodEnum<[
1221
+ "POINT",
1222
+ "NODE",
1223
+ "CHUNK",
1224
+ "DOCUMENT"
1225
+ ]>;
1226
+ disposition: z.ZodEnum<[
1227
+ "EXPECTED",
1228
+ "HEALTHY",
1229
+ "RETAINED",
1230
+ "INFORMATIONAL",
1231
+ "DISCREPANCY"
1232
+ ]>;
1233
+ repairAction: z.ZodEnum<[
1234
+ "NONE",
1235
+ "PURGE",
1236
+ "FLAG",
1237
+ "REPROJECT"
1238
+ ]>;
1239
+ itemCount: z.ZodNullable<z.ZodNumber>;
1240
+ unmeasuredReason: z.ZodNullable<z.ZodString>;
1241
+ measuredAt: z.ZodNullable<z.ZodString>;
1242
+ repairedCount: z.ZodNullable<z.ZodNumber>;
1243
+ repairFailedCount: z.ZodNullable<z.ZodNumber>;
1244
+ repairSkippedCount: z.ZodNullable<z.ZodNumber>;
1245
+ }, "strict", z.ZodTypeAny, {
1246
+ repairedCount: number | null;
1247
+ repairFailedCount: number | null;
1248
+ repairSkippedCount: number | null;
1249
+ store: "QDRANT" | "NEO4J";
1250
+ scopeKey: string;
1251
+ scopeRole: "PRODUCTION" | "VARIANT" | "LABEL";
1252
+ itemClass: "EXPECTED" | "LIVE" | "HISTORY" | "TOMBSTONE" | "AWAITING_SUCCESSOR" | "IN_FLIGHT" | "UNPLACED" | "UNRECORDED" | "UNREFERENCED" | "CHANGED_AFTER_START" | "PIPELINE_FAILED" | "PROJECTION_REFUSED" | "ORPHAN" | "TOMBSTONE_EXPIRED" | "UNPROPAGATED_DELETE" | "STALE_REVISION" | "MISPLACED" | "UNMARKED_SUPERSEDED" | "FLAG_DRIFT" | "DETACHED" | "UNKEYED" | "MISSING" | "COUNT_MISMATCH";
1253
+ unit: "POINT" | "NODE" | "CHUNK" | "DOCUMENT";
1254
+ disposition: "EXPECTED" | "HEALTHY" | "RETAINED" | "INFORMATIONAL" | "DISCREPANCY";
1255
+ repairAction: "NONE" | "PURGE" | "FLAG" | "REPROJECT";
1256
+ itemCount: number | null;
1257
+ unmeasuredReason: string | null;
1258
+ measuredAt: string | null;
1259
+ }, {
1260
+ repairedCount: number | null;
1261
+ repairFailedCount: number | null;
1262
+ repairSkippedCount: number | null;
1263
+ store: "QDRANT" | "NEO4J";
1264
+ scopeKey: string;
1265
+ scopeRole: "PRODUCTION" | "VARIANT" | "LABEL";
1266
+ itemClass: "EXPECTED" | "LIVE" | "HISTORY" | "TOMBSTONE" | "AWAITING_SUCCESSOR" | "IN_FLIGHT" | "UNPLACED" | "UNRECORDED" | "UNREFERENCED" | "CHANGED_AFTER_START" | "PIPELINE_FAILED" | "PROJECTION_REFUSED" | "ORPHAN" | "TOMBSTONE_EXPIRED" | "UNPROPAGATED_DELETE" | "STALE_REVISION" | "MISPLACED" | "UNMARKED_SUPERSEDED" | "FLAG_DRIFT" | "DETACHED" | "UNKEYED" | "MISSING" | "COUNT_MISMATCH";
1267
+ unit: "POINT" | "NODE" | "CHUNK" | "DOCUMENT";
1268
+ disposition: "EXPECTED" | "HEALTHY" | "RETAINED" | "INFORMATIONAL" | "DISCREPANCY";
1269
+ repairAction: "NONE" | "PURGE" | "FLAG" | "REPROJECT";
1270
+ itemCount: number | null;
1271
+ unmeasuredReason: string | null;
1272
+ measuredAt: string | null;
1273
+ }>, {
1274
+ repairedCount: number | null;
1275
+ repairFailedCount: number | null;
1276
+ repairSkippedCount: number | null;
1277
+ store: "QDRANT" | "NEO4J";
1278
+ scopeKey: string;
1279
+ scopeRole: "PRODUCTION" | "VARIANT" | "LABEL";
1280
+ itemClass: "EXPECTED" | "LIVE" | "HISTORY" | "TOMBSTONE" | "AWAITING_SUCCESSOR" | "IN_FLIGHT" | "UNPLACED" | "UNRECORDED" | "UNREFERENCED" | "CHANGED_AFTER_START" | "PIPELINE_FAILED" | "PROJECTION_REFUSED" | "ORPHAN" | "TOMBSTONE_EXPIRED" | "UNPROPAGATED_DELETE" | "STALE_REVISION" | "MISPLACED" | "UNMARKED_SUPERSEDED" | "FLAG_DRIFT" | "DETACHED" | "UNKEYED" | "MISSING" | "COUNT_MISMATCH";
1281
+ unit: "POINT" | "NODE" | "CHUNK" | "DOCUMENT";
1282
+ disposition: "EXPECTED" | "HEALTHY" | "RETAINED" | "INFORMATIONAL" | "DISCREPANCY";
1283
+ repairAction: "NONE" | "PURGE" | "FLAG" | "REPROJECT";
1284
+ itemCount: number | null;
1285
+ unmeasuredReason: string | null;
1286
+ measuredAt: string | null;
1287
+ }, {
1288
+ repairedCount: number | null;
1289
+ repairFailedCount: number | null;
1290
+ repairSkippedCount: number | null;
1291
+ store: "QDRANT" | "NEO4J";
1292
+ scopeKey: string;
1293
+ scopeRole: "PRODUCTION" | "VARIANT" | "LABEL";
1294
+ itemClass: "EXPECTED" | "LIVE" | "HISTORY" | "TOMBSTONE" | "AWAITING_SUCCESSOR" | "IN_FLIGHT" | "UNPLACED" | "UNRECORDED" | "UNREFERENCED" | "CHANGED_AFTER_START" | "PIPELINE_FAILED" | "PROJECTION_REFUSED" | "ORPHAN" | "TOMBSTONE_EXPIRED" | "UNPROPAGATED_DELETE" | "STALE_REVISION" | "MISPLACED" | "UNMARKED_SUPERSEDED" | "FLAG_DRIFT" | "DETACHED" | "UNKEYED" | "MISSING" | "COUNT_MISMATCH";
1295
+ unit: "POINT" | "NODE" | "CHUNK" | "DOCUMENT";
1296
+ disposition: "EXPECTED" | "HEALTHY" | "RETAINED" | "INFORMATIONAL" | "DISCREPANCY";
1297
+ repairAction: "NONE" | "PURGE" | "FLAG" | "REPROJECT";
1298
+ itemCount: number | null;
1299
+ unmeasuredReason: string | null;
1300
+ measuredAt: string | null;
1301
+ }>, "many">;
1302
+ previousStoreFingerprint: z.ZodNullable<z.ZodString>;
1303
+ }, "strict", z.ZodTypeAny, {
1304
+ run: {
1305
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1306
+ mode: "SCAN" | "REPAIR";
1307
+ runUid: string;
1308
+ requestedBy: string;
1309
+ executor: string;
1310
+ basisRunUid: string | null;
1311
+ storeFingerprint: string;
1312
+ tombstoneRetentionDays: number;
1313
+ startedAt: string;
1314
+ finishedAt: string | null;
1315
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1316
+ errorClass: string | null;
1317
+ reprojectDocuments: number | null;
1318
+ reprojectRebuildDocuments: number | null;
1319
+ };
1320
+ quantities: {
1321
+ repairedCount: number | null;
1322
+ repairFailedCount: number | null;
1323
+ repairSkippedCount: number | null;
1324
+ store: "QDRANT" | "NEO4J";
1325
+ scopeKey: string;
1326
+ scopeRole: "PRODUCTION" | "VARIANT" | "LABEL";
1327
+ itemClass: "EXPECTED" | "LIVE" | "HISTORY" | "TOMBSTONE" | "AWAITING_SUCCESSOR" | "IN_FLIGHT" | "UNPLACED" | "UNRECORDED" | "UNREFERENCED" | "CHANGED_AFTER_START" | "PIPELINE_FAILED" | "PROJECTION_REFUSED" | "ORPHAN" | "TOMBSTONE_EXPIRED" | "UNPROPAGATED_DELETE" | "STALE_REVISION" | "MISPLACED" | "UNMARKED_SUPERSEDED" | "FLAG_DRIFT" | "DETACHED" | "UNKEYED" | "MISSING" | "COUNT_MISMATCH";
1328
+ unit: "POINT" | "NODE" | "CHUNK" | "DOCUMENT";
1329
+ disposition: "EXPECTED" | "HEALTHY" | "RETAINED" | "INFORMATIONAL" | "DISCREPANCY";
1330
+ repairAction: "NONE" | "PURGE" | "FLAG" | "REPROJECT";
1331
+ itemCount: number | null;
1332
+ unmeasuredReason: string | null;
1333
+ measuredAt: string | null;
1334
+ }[];
1335
+ previousStoreFingerprint: string | null;
1336
+ }, {
1337
+ run: {
1338
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1339
+ mode: "SCAN" | "REPAIR";
1340
+ runUid: string;
1341
+ requestedBy: string;
1342
+ executor: string;
1343
+ basisRunUid: string | null;
1344
+ storeFingerprint: string;
1345
+ tombstoneRetentionDays: number;
1346
+ startedAt: string;
1347
+ finishedAt: string | null;
1348
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1349
+ errorClass: string | null;
1350
+ reprojectDocuments: number | null;
1351
+ reprojectRebuildDocuments: number | null;
1352
+ };
1353
+ quantities: {
1354
+ repairedCount: number | null;
1355
+ repairFailedCount: number | null;
1356
+ repairSkippedCount: number | null;
1357
+ store: "QDRANT" | "NEO4J";
1358
+ scopeKey: string;
1359
+ scopeRole: "PRODUCTION" | "VARIANT" | "LABEL";
1360
+ itemClass: "EXPECTED" | "LIVE" | "HISTORY" | "TOMBSTONE" | "AWAITING_SUCCESSOR" | "IN_FLIGHT" | "UNPLACED" | "UNRECORDED" | "UNREFERENCED" | "CHANGED_AFTER_START" | "PIPELINE_FAILED" | "PROJECTION_REFUSED" | "ORPHAN" | "TOMBSTONE_EXPIRED" | "UNPROPAGATED_DELETE" | "STALE_REVISION" | "MISPLACED" | "UNMARKED_SUPERSEDED" | "FLAG_DRIFT" | "DETACHED" | "UNKEYED" | "MISSING" | "COUNT_MISMATCH";
1361
+ unit: "POINT" | "NODE" | "CHUNK" | "DOCUMENT";
1362
+ disposition: "EXPECTED" | "HEALTHY" | "RETAINED" | "INFORMATIONAL" | "DISCREPANCY";
1363
+ repairAction: "NONE" | "PURGE" | "FLAG" | "REPROJECT";
1364
+ itemCount: number | null;
1365
+ unmeasuredReason: string | null;
1366
+ measuredAt: string | null;
1367
+ }[];
1368
+ previousStoreFingerprint: string | null;
1369
+ }>, {
1370
+ run: {
1371
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1372
+ mode: "SCAN" | "REPAIR";
1373
+ runUid: string;
1374
+ requestedBy: string;
1375
+ executor: string;
1376
+ basisRunUid: string | null;
1377
+ storeFingerprint: string;
1378
+ tombstoneRetentionDays: number;
1379
+ startedAt: string;
1380
+ finishedAt: string | null;
1381
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1382
+ errorClass: string | null;
1383
+ reprojectDocuments: number | null;
1384
+ reprojectRebuildDocuments: number | null;
1385
+ };
1386
+ quantities: {
1387
+ repairedCount: number | null;
1388
+ repairFailedCount: number | null;
1389
+ repairSkippedCount: number | null;
1390
+ store: "QDRANT" | "NEO4J";
1391
+ scopeKey: string;
1392
+ scopeRole: "PRODUCTION" | "VARIANT" | "LABEL";
1393
+ itemClass: "EXPECTED" | "LIVE" | "HISTORY" | "TOMBSTONE" | "AWAITING_SUCCESSOR" | "IN_FLIGHT" | "UNPLACED" | "UNRECORDED" | "UNREFERENCED" | "CHANGED_AFTER_START" | "PIPELINE_FAILED" | "PROJECTION_REFUSED" | "ORPHAN" | "TOMBSTONE_EXPIRED" | "UNPROPAGATED_DELETE" | "STALE_REVISION" | "MISPLACED" | "UNMARKED_SUPERSEDED" | "FLAG_DRIFT" | "DETACHED" | "UNKEYED" | "MISSING" | "COUNT_MISMATCH";
1394
+ unit: "POINT" | "NODE" | "CHUNK" | "DOCUMENT";
1395
+ disposition: "EXPECTED" | "HEALTHY" | "RETAINED" | "INFORMATIONAL" | "DISCREPANCY";
1396
+ repairAction: "NONE" | "PURGE" | "FLAG" | "REPROJECT";
1397
+ itemCount: number | null;
1398
+ unmeasuredReason: string | null;
1399
+ measuredAt: string | null;
1400
+ }[];
1401
+ previousStoreFingerprint: string | null;
1402
+ }, {
1403
+ run: {
1404
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1405
+ mode: "SCAN" | "REPAIR";
1406
+ runUid: string;
1407
+ requestedBy: string;
1408
+ executor: string;
1409
+ basisRunUid: string | null;
1410
+ storeFingerprint: string;
1411
+ tombstoneRetentionDays: number;
1412
+ startedAt: string;
1413
+ finishedAt: string | null;
1414
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1415
+ errorClass: string | null;
1416
+ reprojectDocuments: number | null;
1417
+ reprojectRebuildDocuments: number | null;
1418
+ };
1419
+ quantities: {
1420
+ repairedCount: number | null;
1421
+ repairFailedCount: number | null;
1422
+ repairSkippedCount: number | null;
1423
+ store: "QDRANT" | "NEO4J";
1424
+ scopeKey: string;
1425
+ scopeRole: "PRODUCTION" | "VARIANT" | "LABEL";
1426
+ itemClass: "EXPECTED" | "LIVE" | "HISTORY" | "TOMBSTONE" | "AWAITING_SUCCESSOR" | "IN_FLIGHT" | "UNPLACED" | "UNRECORDED" | "UNREFERENCED" | "CHANGED_AFTER_START" | "PIPELINE_FAILED" | "PROJECTION_REFUSED" | "ORPHAN" | "TOMBSTONE_EXPIRED" | "UNPROPAGATED_DELETE" | "STALE_REVISION" | "MISPLACED" | "UNMARKED_SUPERSEDED" | "FLAG_DRIFT" | "DETACHED" | "UNKEYED" | "MISSING" | "COUNT_MISMATCH";
1427
+ unit: "POINT" | "NODE" | "CHUNK" | "DOCUMENT";
1428
+ disposition: "EXPECTED" | "HEALTHY" | "RETAINED" | "INFORMATIONAL" | "DISCREPANCY";
1429
+ repairAction: "NONE" | "PURGE" | "FLAG" | "REPROJECT";
1430
+ itemCount: number | null;
1431
+ unmeasuredReason: string | null;
1432
+ measuredAt: string | null;
1433
+ }[];
1434
+ previousStoreFingerprint: string | null;
1435
+ }>>;
1436
+ active: z.ZodNullable<z.ZodEffects<z.ZodObject<{
1437
+ run: z.ZodEffects<z.ZodObject<{
1438
+ runUid: z.ZodEffects<z.ZodString, string, string>;
1439
+ mode: z.ZodEnum<[
1440
+ "SCAN",
1441
+ "REPAIR"
1442
+ ]>;
1443
+ status: z.ZodEnum<[
1444
+ "RUNNING",
1445
+ "COMPLETED",
1446
+ "FAILED",
1447
+ "CANCELLED",
1448
+ "ABANDONED"
1449
+ ]>;
1450
+ requestedBy: z.ZodString;
1451
+ executor: z.ZodString;
1452
+ basisRunUid: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
1453
+ storeFingerprint: z.ZodString;
1454
+ tombstoneRetentionDays: z.ZodNumber;
1455
+ startedAt: z.ZodString;
1456
+ finishedAt: z.ZodNullable<z.ZodString>;
1457
+ verdict: z.ZodNullable<z.ZodEnum<[
1458
+ "CONSISTENT",
1459
+ "INCONSISTENT",
1460
+ "UNDETERMINED"
1461
+ ]>>;
1462
+ errorClass: z.ZodNullable<z.ZodString>;
1463
+ reprojectDocuments: z.ZodNullable<z.ZodNumber>;
1464
+ reprojectRebuildDocuments: z.ZodNullable<z.ZodNumber>;
1465
+ }, "strict", z.ZodTypeAny, {
1466
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1467
+ mode: "SCAN" | "REPAIR";
1468
+ runUid: string;
1469
+ requestedBy: string;
1470
+ executor: string;
1471
+ basisRunUid: string | null;
1472
+ storeFingerprint: string;
1473
+ tombstoneRetentionDays: number;
1474
+ startedAt: string;
1475
+ finishedAt: string | null;
1476
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1477
+ errorClass: string | null;
1478
+ reprojectDocuments: number | null;
1479
+ reprojectRebuildDocuments: number | null;
1480
+ }, {
1481
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1482
+ mode: "SCAN" | "REPAIR";
1483
+ runUid: string;
1484
+ requestedBy: string;
1485
+ executor: string;
1486
+ basisRunUid: string | null;
1487
+ storeFingerprint: string;
1488
+ tombstoneRetentionDays: number;
1489
+ startedAt: string;
1490
+ finishedAt: string | null;
1491
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1492
+ errorClass: string | null;
1493
+ reprojectDocuments: number | null;
1494
+ reprojectRebuildDocuments: number | null;
1495
+ }>, {
1496
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1497
+ mode: "SCAN" | "REPAIR";
1498
+ runUid: string;
1499
+ requestedBy: string;
1500
+ executor: string;
1501
+ basisRunUid: string | null;
1502
+ storeFingerprint: string;
1503
+ tombstoneRetentionDays: number;
1504
+ startedAt: string;
1505
+ finishedAt: string | null;
1506
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1507
+ errorClass: string | null;
1508
+ reprojectDocuments: number | null;
1509
+ reprojectRebuildDocuments: number | null;
1510
+ }, {
1511
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1512
+ mode: "SCAN" | "REPAIR";
1513
+ runUid: string;
1514
+ requestedBy: string;
1515
+ executor: string;
1516
+ basisRunUid: string | null;
1517
+ storeFingerprint: string;
1518
+ tombstoneRetentionDays: number;
1519
+ startedAt: string;
1520
+ finishedAt: string | null;
1521
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1522
+ errorClass: string | null;
1523
+ reprojectDocuments: number | null;
1524
+ reprojectRebuildDocuments: number | null;
1525
+ }>;
1526
+ phase: z.ZodNullable<z.ZodEnum<[
1527
+ "QDRANT",
1528
+ "NEO4J",
1529
+ "DOCUMENTS"
1530
+ ]>>;
1531
+ phaseScope: z.ZodNullable<z.ZodString>;
1532
+ phaseDone: z.ZodNullable<z.ZodNumber>;
1533
+ phaseTotal: z.ZodNullable<z.ZodNumber>;
1534
+ heartbeatAt: z.ZodString;
1535
+ isStale: z.ZodBoolean;
1536
+ cancelRequestedAt: z.ZodNullable<z.ZodString>;
1537
+ }, "strict", z.ZodTypeAny, {
1538
+ run: {
1539
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1540
+ mode: "SCAN" | "REPAIR";
1541
+ runUid: string;
1542
+ requestedBy: string;
1543
+ executor: string;
1544
+ basisRunUid: string | null;
1545
+ storeFingerprint: string;
1546
+ tombstoneRetentionDays: number;
1547
+ startedAt: string;
1548
+ finishedAt: string | null;
1549
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1550
+ errorClass: string | null;
1551
+ reprojectDocuments: number | null;
1552
+ reprojectRebuildDocuments: number | null;
1553
+ };
1554
+ phase: "QDRANT" | "NEO4J" | "DOCUMENTS" | null;
1555
+ phaseScope: string | null;
1556
+ phaseDone: number | null;
1557
+ phaseTotal: number | null;
1558
+ heartbeatAt: string;
1559
+ isStale: boolean;
1560
+ cancelRequestedAt: string | null;
1561
+ }, {
1562
+ run: {
1563
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1564
+ mode: "SCAN" | "REPAIR";
1565
+ runUid: string;
1566
+ requestedBy: string;
1567
+ executor: string;
1568
+ basisRunUid: string | null;
1569
+ storeFingerprint: string;
1570
+ tombstoneRetentionDays: number;
1571
+ startedAt: string;
1572
+ finishedAt: string | null;
1573
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1574
+ errorClass: string | null;
1575
+ reprojectDocuments: number | null;
1576
+ reprojectRebuildDocuments: number | null;
1577
+ };
1578
+ phase: "QDRANT" | "NEO4J" | "DOCUMENTS" | null;
1579
+ phaseScope: string | null;
1580
+ phaseDone: number | null;
1581
+ phaseTotal: number | null;
1582
+ heartbeatAt: string;
1583
+ isStale: boolean;
1584
+ cancelRequestedAt: string | null;
1585
+ }>, {
1586
+ run: {
1587
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1588
+ mode: "SCAN" | "REPAIR";
1589
+ runUid: string;
1590
+ requestedBy: string;
1591
+ executor: string;
1592
+ basisRunUid: string | null;
1593
+ storeFingerprint: string;
1594
+ tombstoneRetentionDays: number;
1595
+ startedAt: string;
1596
+ finishedAt: string | null;
1597
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1598
+ errorClass: string | null;
1599
+ reprojectDocuments: number | null;
1600
+ reprojectRebuildDocuments: number | null;
1601
+ };
1602
+ phase: "QDRANT" | "NEO4J" | "DOCUMENTS" | null;
1603
+ phaseScope: string | null;
1604
+ phaseDone: number | null;
1605
+ phaseTotal: number | null;
1606
+ heartbeatAt: string;
1607
+ isStale: boolean;
1608
+ cancelRequestedAt: string | null;
1609
+ }, {
1610
+ run: {
1611
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1612
+ mode: "SCAN" | "REPAIR";
1613
+ runUid: string;
1614
+ requestedBy: string;
1615
+ executor: string;
1616
+ basisRunUid: string | null;
1617
+ storeFingerprint: string;
1618
+ tombstoneRetentionDays: number;
1619
+ startedAt: string;
1620
+ finishedAt: string | null;
1621
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1622
+ errorClass: string | null;
1623
+ reprojectDocuments: number | null;
1624
+ reprojectRebuildDocuments: number | null;
1625
+ };
1626
+ phase: "QDRANT" | "NEO4J" | "DOCUMENTS" | null;
1627
+ phaseScope: string | null;
1628
+ phaseDone: number | null;
1629
+ phaseTotal: number | null;
1630
+ heartbeatAt: string;
1631
+ isStale: boolean;
1632
+ cancelRequestedAt: string | null;
1633
+ }>>;
1634
+ newerUnsuccessful: z.ZodNullable<z.ZodEffects<z.ZodObject<{
1635
+ run: z.ZodEffects<z.ZodObject<{
1636
+ runUid: z.ZodEffects<z.ZodString, string, string>;
1637
+ mode: z.ZodEnum<[
1638
+ "SCAN",
1639
+ "REPAIR"
1640
+ ]>;
1641
+ status: z.ZodEnum<[
1642
+ "RUNNING",
1643
+ "COMPLETED",
1644
+ "FAILED",
1645
+ "CANCELLED",
1646
+ "ABANDONED"
1647
+ ]>;
1648
+ requestedBy: z.ZodString;
1649
+ executor: z.ZodString;
1650
+ basisRunUid: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
1651
+ storeFingerprint: z.ZodString;
1652
+ tombstoneRetentionDays: z.ZodNumber;
1653
+ startedAt: z.ZodString;
1654
+ finishedAt: z.ZodNullable<z.ZodString>;
1655
+ verdict: z.ZodNullable<z.ZodEnum<[
1656
+ "CONSISTENT",
1657
+ "INCONSISTENT",
1658
+ "UNDETERMINED"
1659
+ ]>>;
1660
+ errorClass: z.ZodNullable<z.ZodString>;
1661
+ reprojectDocuments: z.ZodNullable<z.ZodNumber>;
1662
+ reprojectRebuildDocuments: z.ZodNullable<z.ZodNumber>;
1663
+ }, "strict", z.ZodTypeAny, {
1664
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1665
+ mode: "SCAN" | "REPAIR";
1666
+ runUid: string;
1667
+ requestedBy: string;
1668
+ executor: string;
1669
+ basisRunUid: string | null;
1670
+ storeFingerprint: string;
1671
+ tombstoneRetentionDays: number;
1672
+ startedAt: string;
1673
+ finishedAt: string | null;
1674
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1675
+ errorClass: string | null;
1676
+ reprojectDocuments: number | null;
1677
+ reprojectRebuildDocuments: number | null;
1678
+ }, {
1679
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1680
+ mode: "SCAN" | "REPAIR";
1681
+ runUid: string;
1682
+ requestedBy: string;
1683
+ executor: string;
1684
+ basisRunUid: string | null;
1685
+ storeFingerprint: string;
1686
+ tombstoneRetentionDays: number;
1687
+ startedAt: string;
1688
+ finishedAt: string | null;
1689
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1690
+ errorClass: string | null;
1691
+ reprojectDocuments: number | null;
1692
+ reprojectRebuildDocuments: number | null;
1693
+ }>, {
1694
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1695
+ mode: "SCAN" | "REPAIR";
1696
+ runUid: string;
1697
+ requestedBy: string;
1698
+ executor: string;
1699
+ basisRunUid: string | null;
1700
+ storeFingerprint: string;
1701
+ tombstoneRetentionDays: number;
1702
+ startedAt: string;
1703
+ finishedAt: string | null;
1704
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1705
+ errorClass: string | null;
1706
+ reprojectDocuments: number | null;
1707
+ reprojectRebuildDocuments: number | null;
1708
+ }, {
1709
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1710
+ mode: "SCAN" | "REPAIR";
1711
+ runUid: string;
1712
+ requestedBy: string;
1713
+ executor: string;
1714
+ basisRunUid: string | null;
1715
+ storeFingerprint: string;
1716
+ tombstoneRetentionDays: number;
1717
+ startedAt: string;
1718
+ finishedAt: string | null;
1719
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1720
+ errorClass: string | null;
1721
+ reprojectDocuments: number | null;
1722
+ reprojectRebuildDocuments: number | null;
1723
+ }>;
1724
+ repairAppliedItems: z.ZodNullable<z.ZodNumber>;
1725
+ hasNewerRepair: z.ZodBoolean;
1726
+ }, "strict", z.ZodTypeAny, {
1727
+ run: {
1728
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1729
+ mode: "SCAN" | "REPAIR";
1730
+ runUid: string;
1731
+ requestedBy: string;
1732
+ executor: string;
1733
+ basisRunUid: string | null;
1734
+ storeFingerprint: string;
1735
+ tombstoneRetentionDays: number;
1736
+ startedAt: string;
1737
+ finishedAt: string | null;
1738
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1739
+ errorClass: string | null;
1740
+ reprojectDocuments: number | null;
1741
+ reprojectRebuildDocuments: number | null;
1742
+ };
1743
+ repairAppliedItems: number | null;
1744
+ hasNewerRepair: boolean;
1745
+ }, {
1746
+ run: {
1747
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1748
+ mode: "SCAN" | "REPAIR";
1749
+ runUid: string;
1750
+ requestedBy: string;
1751
+ executor: string;
1752
+ basisRunUid: string | null;
1753
+ storeFingerprint: string;
1754
+ tombstoneRetentionDays: number;
1755
+ startedAt: string;
1756
+ finishedAt: string | null;
1757
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1758
+ errorClass: string | null;
1759
+ reprojectDocuments: number | null;
1760
+ reprojectRebuildDocuments: number | null;
1761
+ };
1762
+ repairAppliedItems: number | null;
1763
+ hasNewerRepair: boolean;
1764
+ }>, {
1765
+ run: {
1766
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1767
+ mode: "SCAN" | "REPAIR";
1768
+ runUid: string;
1769
+ requestedBy: string;
1770
+ executor: string;
1771
+ basisRunUid: string | null;
1772
+ storeFingerprint: string;
1773
+ tombstoneRetentionDays: number;
1774
+ startedAt: string;
1775
+ finishedAt: string | null;
1776
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1777
+ errorClass: string | null;
1778
+ reprojectDocuments: number | null;
1779
+ reprojectRebuildDocuments: number | null;
1780
+ };
1781
+ repairAppliedItems: number | null;
1782
+ hasNewerRepair: boolean;
1783
+ }, {
1784
+ run: {
1785
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1786
+ mode: "SCAN" | "REPAIR";
1787
+ runUid: string;
1788
+ requestedBy: string;
1789
+ executor: string;
1790
+ basisRunUid: string | null;
1791
+ storeFingerprint: string;
1792
+ tombstoneRetentionDays: number;
1793
+ startedAt: string;
1794
+ finishedAt: string | null;
1795
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1796
+ errorClass: string | null;
1797
+ reprojectDocuments: number | null;
1798
+ reprojectRebuildDocuments: number | null;
1799
+ };
1800
+ repairAppliedItems: number | null;
1801
+ hasNewerRepair: boolean;
1802
+ }>>;
1803
+ }, "strict", z.ZodTypeAny, {
1804
+ readAt: string;
1805
+ lastCompleted: {
1806
+ run: {
1807
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1808
+ mode: "SCAN" | "REPAIR";
1809
+ runUid: string;
1810
+ requestedBy: string;
1811
+ executor: string;
1812
+ basisRunUid: string | null;
1813
+ storeFingerprint: string;
1814
+ tombstoneRetentionDays: number;
1815
+ startedAt: string;
1816
+ finishedAt: string | null;
1817
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1818
+ errorClass: string | null;
1819
+ reprojectDocuments: number | null;
1820
+ reprojectRebuildDocuments: number | null;
1821
+ };
1822
+ quantities: {
1823
+ repairedCount: number | null;
1824
+ repairFailedCount: number | null;
1825
+ repairSkippedCount: number | null;
1826
+ store: "QDRANT" | "NEO4J";
1827
+ scopeKey: string;
1828
+ scopeRole: "PRODUCTION" | "VARIANT" | "LABEL";
1829
+ itemClass: "EXPECTED" | "LIVE" | "HISTORY" | "TOMBSTONE" | "AWAITING_SUCCESSOR" | "IN_FLIGHT" | "UNPLACED" | "UNRECORDED" | "UNREFERENCED" | "CHANGED_AFTER_START" | "PIPELINE_FAILED" | "PROJECTION_REFUSED" | "ORPHAN" | "TOMBSTONE_EXPIRED" | "UNPROPAGATED_DELETE" | "STALE_REVISION" | "MISPLACED" | "UNMARKED_SUPERSEDED" | "FLAG_DRIFT" | "DETACHED" | "UNKEYED" | "MISSING" | "COUNT_MISMATCH";
1830
+ unit: "POINT" | "NODE" | "CHUNK" | "DOCUMENT";
1831
+ disposition: "EXPECTED" | "HEALTHY" | "RETAINED" | "INFORMATIONAL" | "DISCREPANCY";
1832
+ repairAction: "NONE" | "PURGE" | "FLAG" | "REPROJECT";
1833
+ itemCount: number | null;
1834
+ unmeasuredReason: string | null;
1835
+ measuredAt: string | null;
1836
+ }[];
1837
+ previousStoreFingerprint: string | null;
1838
+ } | null;
1839
+ active: {
1840
+ run: {
1841
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1842
+ mode: "SCAN" | "REPAIR";
1843
+ runUid: string;
1844
+ requestedBy: string;
1845
+ executor: string;
1846
+ basisRunUid: string | null;
1847
+ storeFingerprint: string;
1848
+ tombstoneRetentionDays: number;
1849
+ startedAt: string;
1850
+ finishedAt: string | null;
1851
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1852
+ errorClass: string | null;
1853
+ reprojectDocuments: number | null;
1854
+ reprojectRebuildDocuments: number | null;
1855
+ };
1856
+ phase: "QDRANT" | "NEO4J" | "DOCUMENTS" | null;
1857
+ phaseScope: string | null;
1858
+ phaseDone: number | null;
1859
+ phaseTotal: number | null;
1860
+ heartbeatAt: string;
1861
+ isStale: boolean;
1862
+ cancelRequestedAt: string | null;
1863
+ } | null;
1864
+ newerUnsuccessful: {
1865
+ run: {
1866
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1867
+ mode: "SCAN" | "REPAIR";
1868
+ runUid: string;
1869
+ requestedBy: string;
1870
+ executor: string;
1871
+ basisRunUid: string | null;
1872
+ storeFingerprint: string;
1873
+ tombstoneRetentionDays: number;
1874
+ startedAt: string;
1875
+ finishedAt: string | null;
1876
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1877
+ errorClass: string | null;
1878
+ reprojectDocuments: number | null;
1879
+ reprojectRebuildDocuments: number | null;
1880
+ };
1881
+ repairAppliedItems: number | null;
1882
+ hasNewerRepair: boolean;
1883
+ } | null;
1884
+ }, {
1885
+ readAt: string;
1886
+ lastCompleted: {
1887
+ run: {
1888
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1889
+ mode: "SCAN" | "REPAIR";
1890
+ runUid: string;
1891
+ requestedBy: string;
1892
+ executor: string;
1893
+ basisRunUid: string | null;
1894
+ storeFingerprint: string;
1895
+ tombstoneRetentionDays: number;
1896
+ startedAt: string;
1897
+ finishedAt: string | null;
1898
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1899
+ errorClass: string | null;
1900
+ reprojectDocuments: number | null;
1901
+ reprojectRebuildDocuments: number | null;
1902
+ };
1903
+ quantities: {
1904
+ repairedCount: number | null;
1905
+ repairFailedCount: number | null;
1906
+ repairSkippedCount: number | null;
1907
+ store: "QDRANT" | "NEO4J";
1908
+ scopeKey: string;
1909
+ scopeRole: "PRODUCTION" | "VARIANT" | "LABEL";
1910
+ itemClass: "EXPECTED" | "LIVE" | "HISTORY" | "TOMBSTONE" | "AWAITING_SUCCESSOR" | "IN_FLIGHT" | "UNPLACED" | "UNRECORDED" | "UNREFERENCED" | "CHANGED_AFTER_START" | "PIPELINE_FAILED" | "PROJECTION_REFUSED" | "ORPHAN" | "TOMBSTONE_EXPIRED" | "UNPROPAGATED_DELETE" | "STALE_REVISION" | "MISPLACED" | "UNMARKED_SUPERSEDED" | "FLAG_DRIFT" | "DETACHED" | "UNKEYED" | "MISSING" | "COUNT_MISMATCH";
1911
+ unit: "POINT" | "NODE" | "CHUNK" | "DOCUMENT";
1912
+ disposition: "EXPECTED" | "HEALTHY" | "RETAINED" | "INFORMATIONAL" | "DISCREPANCY";
1913
+ repairAction: "NONE" | "PURGE" | "FLAG" | "REPROJECT";
1914
+ itemCount: number | null;
1915
+ unmeasuredReason: string | null;
1916
+ measuredAt: string | null;
1917
+ }[];
1918
+ previousStoreFingerprint: string | null;
1919
+ } | null;
1920
+ active: {
1921
+ run: {
1922
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1923
+ mode: "SCAN" | "REPAIR";
1924
+ runUid: string;
1925
+ requestedBy: string;
1926
+ executor: string;
1927
+ basisRunUid: string | null;
1928
+ storeFingerprint: string;
1929
+ tombstoneRetentionDays: number;
1930
+ startedAt: string;
1931
+ finishedAt: string | null;
1932
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1933
+ errorClass: string | null;
1934
+ reprojectDocuments: number | null;
1935
+ reprojectRebuildDocuments: number | null;
1936
+ };
1937
+ phase: "QDRANT" | "NEO4J" | "DOCUMENTS" | null;
1938
+ phaseScope: string | null;
1939
+ phaseDone: number | null;
1940
+ phaseTotal: number | null;
1941
+ heartbeatAt: string;
1942
+ isStale: boolean;
1943
+ cancelRequestedAt: string | null;
1944
+ } | null;
1945
+ newerUnsuccessful: {
1946
+ run: {
1947
+ status: "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ABANDONED";
1948
+ mode: "SCAN" | "REPAIR";
1949
+ runUid: string;
1950
+ requestedBy: string;
1951
+ executor: string;
1952
+ basisRunUid: string | null;
1953
+ storeFingerprint: string;
1954
+ tombstoneRetentionDays: number;
1955
+ startedAt: string;
1956
+ finishedAt: string | null;
1957
+ verdict: "CONSISTENT" | "INCONSISTENT" | "UNDETERMINED" | null;
1958
+ errorClass: string | null;
1959
+ reprojectDocuments: number | null;
1960
+ reprojectRebuildDocuments: number | null;
1961
+ };
1962
+ repairAppliedItems: number | null;
1963
+ hasNewerRepair: boolean;
1964
+ } | null;
1965
+ }>;
1966
+ type IntegrityAuditOverview = z.infer<typeof IntegrityAuditOverviewSchema>;
1967
+ declare const IntegrityFindingSchema: z.ZodEffects<z.ZodObject<{
1968
+ sequence: z.ZodNumber;
1969
+ itemKey: z.ZodString;
1970
+ metadataId: z.ZodNullable<z.ZodNumber>;
1971
+ fileUri: z.ZodNullable<z.ZodString>;
1972
+ revision: z.ZodNullable<z.ZodNumber>;
1973
+ observed: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1974
+ repairOutcome: z.ZodNullable<z.ZodEnum<[
1975
+ "APPLIED",
1976
+ "SKIPPED",
1977
+ "FAILED"
1978
+ ]>>;
1979
+ repairErrorClass: z.ZodNullable<z.ZodString>;
1980
+ repairSkipReason: z.ZodNullable<z.ZodEnum<[
1981
+ "RECLASSIFIED",
1982
+ "IN_FLIGHT",
1983
+ "DESTINATION_PENDING",
1984
+ "BASIS_EXHAUSTED",
1985
+ "PROJECTION_REFUSED"
1986
+ ]>>;
1987
+ }, "strict", z.ZodTypeAny, {
1988
+ sequence: number;
1989
+ itemKey: string;
1990
+ metadataId: number | null;
1991
+ fileUri: string | null;
1992
+ revision: number | null;
1993
+ observed: Record<string, unknown>;
1994
+ repairOutcome: "FAILED" | "APPLIED" | "SKIPPED" | null;
1995
+ repairErrorClass: string | null;
1996
+ repairSkipReason: "IN_FLIGHT" | "PROJECTION_REFUSED" | "RECLASSIFIED" | "DESTINATION_PENDING" | "BASIS_EXHAUSTED" | null;
1997
+ }, {
1998
+ sequence: number;
1999
+ itemKey: string;
2000
+ metadataId: number | null;
2001
+ fileUri: string | null;
2002
+ revision: number | null;
2003
+ observed: Record<string, unknown>;
2004
+ repairOutcome: "FAILED" | "APPLIED" | "SKIPPED" | null;
2005
+ repairErrorClass: string | null;
2006
+ repairSkipReason: "IN_FLIGHT" | "PROJECTION_REFUSED" | "RECLASSIFIED" | "DESTINATION_PENDING" | "BASIS_EXHAUSTED" | null;
2007
+ }>, {
2008
+ sequence: number;
2009
+ itemKey: string;
2010
+ metadataId: number | null;
2011
+ fileUri: string | null;
2012
+ revision: number | null;
2013
+ observed: Record<string, unknown>;
2014
+ repairOutcome: "FAILED" | "APPLIED" | "SKIPPED" | null;
2015
+ repairErrorClass: string | null;
2016
+ repairSkipReason: "IN_FLIGHT" | "PROJECTION_REFUSED" | "RECLASSIFIED" | "DESTINATION_PENDING" | "BASIS_EXHAUSTED" | null;
2017
+ }, {
2018
+ sequence: number;
2019
+ itemKey: string;
2020
+ metadataId: number | null;
2021
+ fileUri: string | null;
2022
+ revision: number | null;
2023
+ observed: Record<string, unknown>;
2024
+ repairOutcome: "FAILED" | "APPLIED" | "SKIPPED" | null;
2025
+ repairErrorClass: string | null;
2026
+ repairSkipReason: "IN_FLIGHT" | "PROJECTION_REFUSED" | "RECLASSIFIED" | "DESTINATION_PENDING" | "BASIS_EXHAUSTED" | null;
2027
+ }>;
2028
+ type IntegrityFinding = z.infer<typeof IntegrityFindingSchema>;
2029
+ declare const IntegrityFindingPageSchema: z.ZodEffects<z.ZodObject<{
2030
+ rows: z.ZodArray<z.ZodEffects<z.ZodObject<{
2031
+ sequence: z.ZodNumber;
2032
+ itemKey: z.ZodString;
2033
+ metadataId: z.ZodNullable<z.ZodNumber>;
2034
+ fileUri: z.ZodNullable<z.ZodString>;
2035
+ revision: z.ZodNullable<z.ZodNumber>;
2036
+ observed: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2037
+ repairOutcome: z.ZodNullable<z.ZodEnum<[
2038
+ "APPLIED",
2039
+ "SKIPPED",
2040
+ "FAILED"
2041
+ ]>>;
2042
+ repairErrorClass: z.ZodNullable<z.ZodString>;
2043
+ repairSkipReason: z.ZodNullable<z.ZodEnum<[
2044
+ "RECLASSIFIED",
2045
+ "IN_FLIGHT",
2046
+ "DESTINATION_PENDING",
2047
+ "BASIS_EXHAUSTED",
2048
+ "PROJECTION_REFUSED"
2049
+ ]>>;
2050
+ }, "strict", z.ZodTypeAny, {
2051
+ sequence: number;
2052
+ itemKey: string;
2053
+ metadataId: number | null;
2054
+ fileUri: string | null;
2055
+ revision: number | null;
2056
+ observed: Record<string, unknown>;
2057
+ repairOutcome: "FAILED" | "APPLIED" | "SKIPPED" | null;
2058
+ repairErrorClass: string | null;
2059
+ repairSkipReason: "IN_FLIGHT" | "PROJECTION_REFUSED" | "RECLASSIFIED" | "DESTINATION_PENDING" | "BASIS_EXHAUSTED" | null;
2060
+ }, {
2061
+ sequence: number;
2062
+ itemKey: string;
2063
+ metadataId: number | null;
2064
+ fileUri: string | null;
2065
+ revision: number | null;
2066
+ observed: Record<string, unknown>;
2067
+ repairOutcome: "FAILED" | "APPLIED" | "SKIPPED" | null;
2068
+ repairErrorClass: string | null;
2069
+ repairSkipReason: "IN_FLIGHT" | "PROJECTION_REFUSED" | "RECLASSIFIED" | "DESTINATION_PENDING" | "BASIS_EXHAUSTED" | null;
2070
+ }>, {
2071
+ sequence: number;
2072
+ itemKey: string;
2073
+ metadataId: number | null;
2074
+ fileUri: string | null;
2075
+ revision: number | null;
2076
+ observed: Record<string, unknown>;
2077
+ repairOutcome: "FAILED" | "APPLIED" | "SKIPPED" | null;
2078
+ repairErrorClass: string | null;
2079
+ repairSkipReason: "IN_FLIGHT" | "PROJECTION_REFUSED" | "RECLASSIFIED" | "DESTINATION_PENDING" | "BASIS_EXHAUSTED" | null;
2080
+ }, {
2081
+ sequence: number;
2082
+ itemKey: string;
2083
+ metadataId: number | null;
2084
+ fileUri: string | null;
2085
+ revision: number | null;
2086
+ observed: Record<string, unknown>;
2087
+ repairOutcome: "FAILED" | "APPLIED" | "SKIPPED" | null;
2088
+ repairErrorClass: string | null;
2089
+ repairSkipReason: "IN_FLIGHT" | "PROJECTION_REFUSED" | "RECLASSIFIED" | "DESTINATION_PENDING" | "BASIS_EXHAUSTED" | null;
2090
+ }>, "many">;
2091
+ nextAfter: z.ZodNullable<z.ZodNumber>;
2092
+ recordedCount: z.ZodNumber;
2093
+ totalCount: z.ZodNullable<z.ZodNumber>;
2094
+ }, "strict", z.ZodTypeAny, {
2095
+ rows: {
2096
+ sequence: number;
2097
+ itemKey: string;
2098
+ metadataId: number | null;
2099
+ fileUri: string | null;
2100
+ revision: number | null;
2101
+ observed: Record<string, unknown>;
2102
+ repairOutcome: "FAILED" | "APPLIED" | "SKIPPED" | null;
2103
+ repairErrorClass: string | null;
2104
+ repairSkipReason: "IN_FLIGHT" | "PROJECTION_REFUSED" | "RECLASSIFIED" | "DESTINATION_PENDING" | "BASIS_EXHAUSTED" | null;
2105
+ }[];
2106
+ nextAfter: number | null;
2107
+ recordedCount: number;
2108
+ totalCount: number | null;
2109
+ }, {
2110
+ rows: {
2111
+ sequence: number;
2112
+ itemKey: string;
2113
+ metadataId: number | null;
2114
+ fileUri: string | null;
2115
+ revision: number | null;
2116
+ observed: Record<string, unknown>;
2117
+ repairOutcome: "FAILED" | "APPLIED" | "SKIPPED" | null;
2118
+ repairErrorClass: string | null;
2119
+ repairSkipReason: "IN_FLIGHT" | "PROJECTION_REFUSED" | "RECLASSIFIED" | "DESTINATION_PENDING" | "BASIS_EXHAUSTED" | null;
2120
+ }[];
2121
+ nextAfter: number | null;
2122
+ recordedCount: number;
2123
+ totalCount: number | null;
2124
+ }>, {
2125
+ rows: {
2126
+ sequence: number;
2127
+ itemKey: string;
2128
+ metadataId: number | null;
2129
+ fileUri: string | null;
2130
+ revision: number | null;
2131
+ observed: Record<string, unknown>;
2132
+ repairOutcome: "FAILED" | "APPLIED" | "SKIPPED" | null;
2133
+ repairErrorClass: string | null;
2134
+ repairSkipReason: "IN_FLIGHT" | "PROJECTION_REFUSED" | "RECLASSIFIED" | "DESTINATION_PENDING" | "BASIS_EXHAUSTED" | null;
2135
+ }[];
2136
+ nextAfter: number | null;
2137
+ recordedCount: number;
2138
+ totalCount: number | null;
2139
+ }, {
2140
+ rows: {
2141
+ sequence: number;
2142
+ itemKey: string;
2143
+ metadataId: number | null;
2144
+ fileUri: string | null;
2145
+ revision: number | null;
2146
+ observed: Record<string, unknown>;
2147
+ repairOutcome: "FAILED" | "APPLIED" | "SKIPPED" | null;
2148
+ repairErrorClass: string | null;
2149
+ repairSkipReason: "IN_FLIGHT" | "PROJECTION_REFUSED" | "RECLASSIFIED" | "DESTINATION_PENDING" | "BASIS_EXHAUSTED" | null;
2150
+ }[];
2151
+ nextAfter: number | null;
2152
+ recordedCount: number;
2153
+ totalCount: number | null;
2154
+ }>;
2155
+ type IntegrityFindingPage = z.infer<typeof IntegrityFindingPageSchema>;
2156
+ declare const IntegrityFindingsQuerySchema: z.ZodObject<{
2157
+ runUid: z.ZodEffects<z.ZodString, string, string>;
2158
+ store: z.ZodEnum<[
2159
+ "QDRANT",
2160
+ "NEO4J"
2161
+ ]>;
2162
+ scopeKey: z.ZodString;
2163
+ itemClass: z.ZodEnum<[
2164
+ "TOMBSTONE",
2165
+ "AWAITING_SUCCESSOR",
2166
+ "IN_FLIGHT",
2167
+ "UNPLACED",
2168
+ "UNRECORDED",
2169
+ "UNREFERENCED",
2170
+ "CHANGED_AFTER_START",
2171
+ "PIPELINE_FAILED",
2172
+ "PROJECTION_REFUSED",
2173
+ "ORPHAN",
2174
+ "TOMBSTONE_EXPIRED",
2175
+ "UNPROPAGATED_DELETE",
2176
+ "STALE_REVISION",
2177
+ "MISPLACED",
2178
+ "UNMARKED_SUPERSEDED",
2179
+ "FLAG_DRIFT",
2180
+ "DETACHED",
2181
+ "UNKEYED",
2182
+ "MISSING",
2183
+ "COUNT_MISMATCH"
2184
+ ]>;
2185
+ after: z.ZodOptional<z.ZodNumber>;
2186
+ limit: z.ZodNumber;
2187
+ }, "strict", z.ZodTypeAny, {
2188
+ limit: number;
2189
+ runUid: string;
2190
+ store: "QDRANT" | "NEO4J";
2191
+ scopeKey: string;
2192
+ itemClass: "TOMBSTONE" | "AWAITING_SUCCESSOR" | "IN_FLIGHT" | "UNPLACED" | "UNRECORDED" | "UNREFERENCED" | "CHANGED_AFTER_START" | "PIPELINE_FAILED" | "PROJECTION_REFUSED" | "ORPHAN" | "TOMBSTONE_EXPIRED" | "UNPROPAGATED_DELETE" | "STALE_REVISION" | "MISPLACED" | "UNMARKED_SUPERSEDED" | "FLAG_DRIFT" | "DETACHED" | "UNKEYED" | "MISSING" | "COUNT_MISMATCH";
2193
+ after?: number | undefined;
2194
+ }, {
2195
+ limit: number;
2196
+ runUid: string;
2197
+ store: "QDRANT" | "NEO4J";
2198
+ scopeKey: string;
2199
+ itemClass: "TOMBSTONE" | "AWAITING_SUCCESSOR" | "IN_FLIGHT" | "UNPLACED" | "UNRECORDED" | "UNREFERENCED" | "CHANGED_AFTER_START" | "PIPELINE_FAILED" | "PROJECTION_REFUSED" | "ORPHAN" | "TOMBSTONE_EXPIRED" | "UNPROPAGATED_DELETE" | "STALE_REVISION" | "MISPLACED" | "UNMARKED_SUPERSEDED" | "FLAG_DRIFT" | "DETACHED" | "UNKEYED" | "MISSING" | "COUNT_MISMATCH";
2200
+ after?: number | undefined;
2201
+ }>;
2202
+ type IntegrityFindingsQuery = z.infer<typeof IntegrityFindingsQuerySchema>;
2203
+ declare const IntegrityCommandFailureCodeSchema: z.ZodEnum<[
2204
+ "DEPLOYMENT_DISABLED",
2205
+ "RUN_ALREADY_ACTIVE",
2206
+ "BASIS_INVALID",
2207
+ "RUN_ALREADY_FINISHED",
2208
+ "FORBIDDEN",
2209
+ "UPSTREAM_FAILED"
2210
+ ]>;
2211
+ type IntegrityCommandFailureCode = z.infer<typeof IntegrityCommandFailureCodeSchema>;
2212
+ declare const IntegrityCommandSchema: z.ZodEnum<[
2213
+ "start",
2214
+ "cancel"
2215
+ ]>;
2216
+ type IntegrityCommand = z.infer<typeof IntegrityCommandSchema>;
2217
+ declare const IntegrityStartFailureCodeSchema: z.ZodEnum<[
2218
+ "DEPLOYMENT_DISABLED",
2219
+ "RUN_ALREADY_ACTIVE",
2220
+ "BASIS_INVALID",
2221
+ "FORBIDDEN",
2222
+ "UPSTREAM_FAILED"
2223
+ ]>;
2224
+ type IntegrityStartFailureCode = z.infer<typeof IntegrityStartFailureCodeSchema>;
2225
+ declare const IntegrityCancelFailureCodeSchema: z.ZodEnum<[
2226
+ "DEPLOYMENT_DISABLED",
2227
+ "RUN_ALREADY_FINISHED",
2228
+ "FORBIDDEN",
2229
+ "UPSTREAM_FAILED"
2230
+ ]>;
2231
+ type IntegrityCancelFailureCode = z.infer<typeof IntegrityCancelFailureCodeSchema>;
2232
+ declare const FAILURE_CODES_OF_COMMAND: {
2233
+ readonly start: z.ZodEnum<[
2234
+ "DEPLOYMENT_DISABLED",
2235
+ "RUN_ALREADY_ACTIVE",
2236
+ "BASIS_INVALID",
2237
+ "FORBIDDEN",
2238
+ "UPSTREAM_FAILED"
2239
+ ]>;
2240
+ readonly cancel: z.ZodEnum<[
2241
+ "DEPLOYMENT_DISABLED",
2242
+ "RUN_ALREADY_FINISHED",
2243
+ "FORBIDDEN",
2244
+ "UPSTREAM_FAILED"
2245
+ ]>;
2246
+ };
2247
+ type IntegrityCommandFailureCodeFor<Command extends IntegrityCommand> = z.infer<(typeof FAILURE_CODES_OF_COMMAND)[Command]>;
2248
+ declare const IntegrityCommandCodeRowSchema: z.ZodObject<{
2249
+ code: z.ZodEnum<[
2250
+ "DEPLOYMENT_DISABLED",
2251
+ "RUN_ALREADY_ACTIVE",
2252
+ "BASIS_INVALID",
2253
+ "RUN_ALREADY_FINISHED",
2254
+ "FORBIDDEN"
2255
+ ]>;
2256
+ status: z.ZodNumber;
2257
+ errorCode: z.ZodNullable<z.ZodNumber>;
2258
+ }, "strict", z.ZodTypeAny, {
2259
+ code: "DEPLOYMENT_DISABLED" | "RUN_ALREADY_ACTIVE" | "BASIS_INVALID" | "RUN_ALREADY_FINISHED" | "FORBIDDEN";
2260
+ status: number;
2261
+ errorCode: number | null;
2262
+ }, {
2263
+ code: "DEPLOYMENT_DISABLED" | "RUN_ALREADY_ACTIVE" | "BASIS_INVALID" | "RUN_ALREADY_FINISHED" | "FORBIDDEN";
2264
+ status: number;
2265
+ errorCode: number | null;
2266
+ }>;
2267
+ type IntegrityCommandCodeRow = Readonly<z.infer<typeof IntegrityCommandCodeRowSchema>>;
2268
+ declare const INTEGRITY_COMMAND_CODES: readonly IntegrityCommandCodeRow[];
2269
+ declare const IntegrityCommandFailureSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"command", [
2270
+ z.ZodObject<{
2271
+ command: z.ZodEnum<[
2272
+ "start"
2273
+ ]>;
2274
+ code: z.ZodEnum<[
2275
+ "DEPLOYMENT_DISABLED",
2276
+ "RUN_ALREADY_ACTIVE",
2277
+ "BASIS_INVALID",
2278
+ "FORBIDDEN",
2279
+ "UPSTREAM_FAILED"
2280
+ ]>;
2281
+ status: z.ZodNullable<z.ZodNumber>;
2282
+ }, "strict", z.ZodTypeAny, {
2283
+ code: "DEPLOYMENT_DISABLED" | "RUN_ALREADY_ACTIVE" | "BASIS_INVALID" | "FORBIDDEN" | "UPSTREAM_FAILED";
2284
+ status: number | null;
2285
+ command: "start";
2286
+ }, {
2287
+ code: "DEPLOYMENT_DISABLED" | "RUN_ALREADY_ACTIVE" | "BASIS_INVALID" | "FORBIDDEN" | "UPSTREAM_FAILED";
2288
+ status: number | null;
2289
+ command: "start";
2290
+ }>,
2291
+ z.ZodObject<{
2292
+ command: z.ZodEnum<[
2293
+ "cancel"
2294
+ ]>;
2295
+ code: z.ZodEnum<[
2296
+ "DEPLOYMENT_DISABLED",
2297
+ "RUN_ALREADY_FINISHED",
2298
+ "FORBIDDEN",
2299
+ "UPSTREAM_FAILED"
2300
+ ]>;
2301
+ status: z.ZodNullable<z.ZodNumber>;
2302
+ }, "strict", z.ZodTypeAny, {
2303
+ code: "DEPLOYMENT_DISABLED" | "RUN_ALREADY_FINISHED" | "FORBIDDEN" | "UPSTREAM_FAILED";
2304
+ status: number | null;
2305
+ command: "cancel";
2306
+ }, {
2307
+ code: "DEPLOYMENT_DISABLED" | "RUN_ALREADY_FINISHED" | "FORBIDDEN" | "UPSTREAM_FAILED";
2308
+ status: number | null;
2309
+ command: "cancel";
2310
+ }>
2311
+ ]>, {
2312
+ code: "DEPLOYMENT_DISABLED" | "RUN_ALREADY_ACTIVE" | "BASIS_INVALID" | "FORBIDDEN" | "UPSTREAM_FAILED";
2313
+ status: number | null;
2314
+ command: "start";
2315
+ } | {
2316
+ code: "DEPLOYMENT_DISABLED" | "RUN_ALREADY_FINISHED" | "FORBIDDEN" | "UPSTREAM_FAILED";
2317
+ status: number | null;
2318
+ command: "cancel";
2319
+ }, {
2320
+ code: "DEPLOYMENT_DISABLED" | "RUN_ALREADY_ACTIVE" | "BASIS_INVALID" | "FORBIDDEN" | "UPSTREAM_FAILED";
2321
+ status: number | null;
2322
+ command: "start";
2323
+ } | {
2324
+ code: "DEPLOYMENT_DISABLED" | "RUN_ALREADY_FINISHED" | "FORBIDDEN" | "UPSTREAM_FAILED";
2325
+ status: number | null;
2326
+ command: "cancel";
2327
+ }>;
2328
+ type IntegrityCommandFailure = z.infer<typeof IntegrityCommandFailureSchema>;
2329
+ declare const integrityCommandFailureCodeOf: <Command extends IntegrityCommand>(command: Command, status: number, errorCode: number | null) => IntegrityCommandFailureCodeFor<Command>;
2330
+ declare const IntegrityCommandReplySchema: z.ZodDiscriminatedUnion<"ok", [
2331
+ z.ZodObject<{
2332
+ ok: z.ZodLiteral<true>;
2333
+ runUid: z.ZodEffects<z.ZodString, string, string>;
2334
+ }, "strict", z.ZodTypeAny, {
2335
+ runUid: string;
2336
+ ok: true;
2337
+ }, {
2338
+ runUid: string;
2339
+ ok: true;
2340
+ }>,
2341
+ z.ZodObject<{
2342
+ ok: z.ZodLiteral<false>;
2343
+ status: z.ZodNumber;
2344
+ errorCode: z.ZodNullable<z.ZodNumber>;
2345
+ }, "strict", z.ZodTypeAny, {
2346
+ status: number;
2347
+ errorCode: number | null;
2348
+ ok: false;
2349
+ }, {
2350
+ status: number;
2351
+ errorCode: number | null;
2352
+ ok: false;
2353
+ }>
2354
+ ]>;
2355
+ type IntegrityCommandReply = z.infer<typeof IntegrityCommandReplySchema>;
2356
+ declare const DocumentKindSchema: z.ZodEnum<[
2357
+ "email",
2358
+ "pdf",
2359
+ "office",
2360
+ "image",
2361
+ "media",
2362
+ "text",
2363
+ "google_native",
2364
+ "other"
2365
+ ]>;
2366
+ declare const PipelineStepKeySchema: z.ZodEnum<[
2367
+ "delete_child_assets",
2368
+ "extract_text",
2369
+ "analyze_media",
2370
+ "extract_assets",
2371
+ "ocr_children",
2372
+ "ocr_document",
2373
+ "resolve_body",
2374
+ "enrich_document",
2375
+ "project_to_indexes"
2376
+ ]>;
2377
+ declare const PipelineRunStatusSchema: z.ZodEnum<[
2378
+ "RUNNING",
2379
+ "SUCCEEDED",
2380
+ "FAILED"
2381
+ ]>;
2382
+ type PipelineRunStatus = z.infer<typeof PipelineRunStatusSchema>;
2383
+ declare const PipelineStepStatusSchema: z.ZodEnum<[
2384
+ "RUNNING",
2385
+ "SUCCEEDED",
2386
+ "SKIPPED",
2387
+ "FAILED"
2388
+ ]>;
2389
+ type PipelineStepStatus = z.infer<typeof PipelineStepStatusSchema>;
2390
+ declare const PipelineTriggerSchema: z.ZodEnum<[
2391
+ "ingest",
2392
+ "retry",
2393
+ "resync"
2394
+ ]>;
2395
+ type PipelineTrigger = z.infer<typeof PipelineTriggerSchema>;
2396
+ declare const BodySourceSchema: z.ZodEnum<[
2397
+ "text_layer",
2398
+ "ocr",
2399
+ "transcript"
2400
+ ]>;
2401
+ type BodySource = z.infer<typeof BodySourceSchema>;
2402
+ declare const StageProvenanceSchema: z.ZodObject<{
2403
+ provider: z.ZodNullable<z.ZodString>;
2404
+ model: z.ZodNullable<z.ZodString>;
2405
+ engine: z.ZodNullable<z.ZodString>;
2406
+ prompt_key: z.ZodNullable<z.ZodString>;
2407
+ prompt_version: z.ZodNullable<z.ZodNumber>;
2408
+ duration_ms: z.ZodNullable<z.ZodNumber>;
2409
+ input_chars: z.ZodNullable<z.ZodNumber>;
2410
+ output_chars: z.ZodNullable<z.ZodNumber>;
2411
+ pages_read: z.ZodNullable<z.ZodNumber>;
2412
+ pages_total: z.ZodNullable<z.ZodNumber>;
2413
+ chunk_count: z.ZodNullable<z.ZodNumber>;
2414
+ points_upserted: z.ZodNullable<z.ZodNumber>;
2415
+ collection: z.ZodNullable<z.ZodString>;
2416
+ embedding_model: z.ZodNullable<z.ZodString>;
2417
+ strategy_id: z.ZodNullable<z.ZodNumber>;
2418
+ graph_nodes: z.ZodNullable<z.ZodNumber>;
2419
+ body_source: z.ZodNullable<z.ZodEnum<[
2420
+ "text_layer",
2421
+ "ocr",
2422
+ "transcript"
2423
+ ]>>;
2424
+ detail: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2425
+ }, "strict", z.ZodTypeAny, {
2426
+ strategy_id: number | null;
2427
+ provider: string | null;
2428
+ model: string | null;
2429
+ engine: string | null;
2430
+ prompt_key: string | null;
2431
+ prompt_version: number | null;
2432
+ duration_ms: number | null;
2433
+ input_chars: number | null;
2434
+ output_chars: number | null;
2435
+ pages_read: number | null;
2436
+ pages_total: number | null;
2437
+ chunk_count: number | null;
2438
+ points_upserted: number | null;
2439
+ collection: string | null;
2440
+ embedding_model: string | null;
2441
+ graph_nodes: number | null;
2442
+ body_source: "ocr" | "text_layer" | "transcript" | null;
2443
+ detail: Record<string, unknown>;
2444
+ }, {
2445
+ strategy_id: number | null;
2446
+ provider: string | null;
2447
+ model: string | null;
2448
+ engine: string | null;
2449
+ prompt_key: string | null;
2450
+ prompt_version: number | null;
2451
+ duration_ms: number | null;
2452
+ input_chars: number | null;
2453
+ output_chars: number | null;
2454
+ pages_read: number | null;
2455
+ pages_total: number | null;
2456
+ chunk_count: number | null;
2457
+ points_upserted: number | null;
2458
+ collection: string | null;
2459
+ embedding_model: string | null;
2460
+ graph_nodes: number | null;
2461
+ body_source: "ocr" | "text_layer" | "transcript" | null;
2462
+ detail: Record<string, unknown>;
2463
+ }>;
2464
+ type StageProvenance = z.infer<typeof StageProvenanceSchema>;
2465
+ declare const NOTHING_TO_READ_TOKENS: readonly [
2466
+ "no_pages",
2467
+ "no_pages_rendered"
2468
+ ];
2469
+ declare const NothingToReadTokenSchema: z.ZodEnum<[
2470
+ "no_pages",
2471
+ "no_pages_rendered"
2472
+ ]>;
2473
+ type NothingToReadToken = z.infer<typeof NothingToReadTokenSchema>;
2474
+ type SkipReason = {
2475
+ readonly kind: "gate_closed";
2476
+ readonly featureFlagKey: string;
2477
+ } | {
2478
+ readonly kind: "no_children";
2479
+ } | {
2480
+ readonly kind: "source_skipped";
2481
+ readonly stepKey: PipelineStepKey;
2482
+ } | {
2483
+ readonly kind: "nothing_to_read";
2484
+ readonly token: NothingToReadToken;
2485
+ };
2486
+ declare function parseSkipReason(text: string): SkipReason | null;
2487
+ declare function formatSkipReason(reason: SkipReason): string;
2488
+ declare const PipelineStepRecordSchema: z.ZodEffects<z.ZodObject<{
2489
+ id: z.ZodNumber;
2490
+ runId: z.ZodNumber;
2491
+ sequence: z.ZodNumber;
2492
+ stepKey: z.ZodEnum<[
2493
+ "delete_child_assets",
2494
+ "extract_text",
2495
+ "analyze_media",
2496
+ "extract_assets",
2497
+ "ocr_children",
2498
+ "ocr_document",
2499
+ "resolve_body",
2500
+ "enrich_document",
2501
+ "project_to_indexes"
2502
+ ]>;
2503
+ targetMetadataId: z.ZodNumber;
2504
+ status: z.ZodEnum<[
2505
+ "RUNNING",
2506
+ "SUCCEEDED",
2507
+ "SKIPPED",
2508
+ "FAILED"
2509
+ ]>;
2510
+ skipReason: z.ZodNullable<z.ZodString>;
2511
+ provenance: z.ZodNullable<z.ZodObject<{
2512
+ provider: z.ZodNullable<z.ZodString>;
2513
+ model: z.ZodNullable<z.ZodString>;
2514
+ engine: z.ZodNullable<z.ZodString>;
2515
+ prompt_key: z.ZodNullable<z.ZodString>;
2516
+ prompt_version: z.ZodNullable<z.ZodNumber>;
2517
+ duration_ms: z.ZodNullable<z.ZodNumber>;
2518
+ input_chars: z.ZodNullable<z.ZodNumber>;
2519
+ output_chars: z.ZodNullable<z.ZodNumber>;
2520
+ pages_read: z.ZodNullable<z.ZodNumber>;
2521
+ pages_total: z.ZodNullable<z.ZodNumber>;
2522
+ chunk_count: z.ZodNullable<z.ZodNumber>;
2523
+ points_upserted: z.ZodNullable<z.ZodNumber>;
2524
+ collection: z.ZodNullable<z.ZodString>;
2525
+ embedding_model: z.ZodNullable<z.ZodString>;
2526
+ strategy_id: z.ZodNullable<z.ZodNumber>;
2527
+ graph_nodes: z.ZodNullable<z.ZodNumber>;
2528
+ body_source: z.ZodNullable<z.ZodEnum<[
2529
+ "text_layer",
2530
+ "ocr",
2531
+ "transcript"
2532
+ ]>>;
2533
+ detail: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2534
+ }, "strict", z.ZodTypeAny, {
2535
+ strategy_id: number | null;
2536
+ provider: string | null;
2537
+ model: string | null;
2538
+ engine: string | null;
2539
+ prompt_key: string | null;
2540
+ prompt_version: number | null;
2541
+ duration_ms: number | null;
2542
+ input_chars: number | null;
2543
+ output_chars: number | null;
2544
+ pages_read: number | null;
2545
+ pages_total: number | null;
2546
+ chunk_count: number | null;
2547
+ points_upserted: number | null;
2548
+ collection: string | null;
2549
+ embedding_model: string | null;
2550
+ graph_nodes: number | null;
2551
+ body_source: "ocr" | "text_layer" | "transcript" | null;
2552
+ detail: Record<string, unknown>;
2553
+ }, {
2554
+ strategy_id: number | null;
2555
+ provider: string | null;
2556
+ model: string | null;
2557
+ engine: string | null;
2558
+ prompt_key: string | null;
2559
+ prompt_version: number | null;
2560
+ duration_ms: number | null;
2561
+ input_chars: number | null;
2562
+ output_chars: number | null;
2563
+ pages_read: number | null;
2564
+ pages_total: number | null;
2565
+ chunk_count: number | null;
2566
+ points_upserted: number | null;
2567
+ collection: string | null;
2568
+ embedding_model: string | null;
2569
+ graph_nodes: number | null;
2570
+ body_source: "ocr" | "text_layer" | "transcript" | null;
2571
+ detail: Record<string, unknown>;
2572
+ }>>;
2573
+ strategyId: z.ZodNullable<z.ZodNumber>;
2574
+ httpStatus: z.ZodNullable<z.ZodNumber>;
2575
+ errorCode: z.ZodNullable<z.ZodString>;
2576
+ errorMessage: z.ZodNullable<z.ZodString>;
2577
+ startedAt: z.ZodString;
2578
+ finishedAt: z.ZodNullable<z.ZodString>;
2579
+ durationMs: z.ZodNullable<z.ZodNumber>;
2580
+ }, "strict", z.ZodTypeAny, {
2581
+ status: "RUNNING" | "FAILED" | "SKIPPED" | "SUCCEEDED";
2582
+ startedAt: string;
2583
+ finishedAt: string | null;
2584
+ sequence: number;
2585
+ errorCode: string | null;
2586
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
2587
+ id: number;
2588
+ runId: number;
2589
+ targetMetadataId: number;
2590
+ skipReason: string | null;
2591
+ provenance: {
2592
+ strategy_id: number | null;
2593
+ provider: string | null;
2594
+ model: string | null;
2595
+ engine: string | null;
2596
+ prompt_key: string | null;
2597
+ prompt_version: number | null;
2598
+ duration_ms: number | null;
2599
+ input_chars: number | null;
2600
+ output_chars: number | null;
2601
+ pages_read: number | null;
2602
+ pages_total: number | null;
2603
+ chunk_count: number | null;
2604
+ points_upserted: number | null;
2605
+ collection: string | null;
2606
+ embedding_model: string | null;
2607
+ graph_nodes: number | null;
2608
+ body_source: "ocr" | "text_layer" | "transcript" | null;
2609
+ detail: Record<string, unknown>;
2610
+ } | null;
2611
+ strategyId: number | null;
2612
+ httpStatus: number | null;
2613
+ errorMessage: string | null;
2614
+ durationMs: number | null;
2615
+ }, {
2616
+ status: "RUNNING" | "FAILED" | "SKIPPED" | "SUCCEEDED";
2617
+ startedAt: string;
2618
+ finishedAt: string | null;
2619
+ sequence: number;
2620
+ errorCode: string | null;
2621
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
2622
+ id: number;
2623
+ runId: number;
2624
+ targetMetadataId: number;
2625
+ skipReason: string | null;
2626
+ provenance: {
2627
+ strategy_id: number | null;
2628
+ provider: string | null;
2629
+ model: string | null;
2630
+ engine: string | null;
2631
+ prompt_key: string | null;
2632
+ prompt_version: number | null;
2633
+ duration_ms: number | null;
2634
+ input_chars: number | null;
2635
+ output_chars: number | null;
2636
+ pages_read: number | null;
2637
+ pages_total: number | null;
2638
+ chunk_count: number | null;
2639
+ points_upserted: number | null;
2640
+ collection: string | null;
2641
+ embedding_model: string | null;
2642
+ graph_nodes: number | null;
2643
+ body_source: "ocr" | "text_layer" | "transcript" | null;
2644
+ detail: Record<string, unknown>;
2645
+ } | null;
2646
+ strategyId: number | null;
2647
+ httpStatus: number | null;
2648
+ errorMessage: string | null;
2649
+ durationMs: number | null;
2650
+ }>, {
2651
+ status: "RUNNING" | "FAILED" | "SKIPPED" | "SUCCEEDED";
2652
+ startedAt: string;
2653
+ finishedAt: string | null;
2654
+ sequence: number;
2655
+ errorCode: string | null;
2656
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
2657
+ id: number;
2658
+ runId: number;
2659
+ targetMetadataId: number;
2660
+ skipReason: string | null;
2661
+ provenance: {
2662
+ strategy_id: number | null;
2663
+ provider: string | null;
2664
+ model: string | null;
2665
+ engine: string | null;
2666
+ prompt_key: string | null;
2667
+ prompt_version: number | null;
2668
+ duration_ms: number | null;
2669
+ input_chars: number | null;
2670
+ output_chars: number | null;
2671
+ pages_read: number | null;
2672
+ pages_total: number | null;
2673
+ chunk_count: number | null;
2674
+ points_upserted: number | null;
2675
+ collection: string | null;
2676
+ embedding_model: string | null;
2677
+ graph_nodes: number | null;
2678
+ body_source: "ocr" | "text_layer" | "transcript" | null;
2679
+ detail: Record<string, unknown>;
2680
+ } | null;
2681
+ strategyId: number | null;
2682
+ httpStatus: number | null;
2683
+ errorMessage: string | null;
2684
+ durationMs: number | null;
2685
+ }, {
2686
+ status: "RUNNING" | "FAILED" | "SKIPPED" | "SUCCEEDED";
2687
+ startedAt: string;
2688
+ finishedAt: string | null;
2689
+ sequence: number;
2690
+ errorCode: string | null;
2691
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
2692
+ id: number;
2693
+ runId: number;
2694
+ targetMetadataId: number;
2695
+ skipReason: string | null;
2696
+ provenance: {
2697
+ strategy_id: number | null;
2698
+ provider: string | null;
2699
+ model: string | null;
2700
+ engine: string | null;
2701
+ prompt_key: string | null;
2702
+ prompt_version: number | null;
2703
+ duration_ms: number | null;
2704
+ input_chars: number | null;
2705
+ output_chars: number | null;
2706
+ pages_read: number | null;
2707
+ pages_total: number | null;
2708
+ chunk_count: number | null;
2709
+ points_upserted: number | null;
2710
+ collection: string | null;
2711
+ embedding_model: string | null;
2712
+ graph_nodes: number | null;
2713
+ body_source: "ocr" | "text_layer" | "transcript" | null;
2714
+ detail: Record<string, unknown>;
2715
+ } | null;
2716
+ strategyId: number | null;
2717
+ httpStatus: number | null;
2718
+ errorMessage: string | null;
2719
+ durationMs: number | null;
2720
+ }>;
2721
+ type PipelineStepRecord = z.infer<typeof PipelineStepRecordSchema>;
2722
+ declare const PipelineRunRecordSchema: z.ZodEffects<z.ZodObject<{
2723
+ id: z.ZodNumber;
2724
+ tenantId: z.ZodString;
2725
+ metadataId: z.ZodNumber;
2726
+ revision: z.ZodNumber;
2727
+ runUid: z.ZodString;
2728
+ jobId: z.ZodString;
2729
+ attempt: z.ZodNumber;
2730
+ trigger: z.ZodEnum<[
2731
+ "ingest",
2732
+ "retry",
2733
+ "resync"
2734
+ ]>;
2735
+ documentKind: z.ZodEnum<[
2736
+ "email",
2737
+ "pdf",
2738
+ "office",
2739
+ "image",
2740
+ "media",
2741
+ "text",
2742
+ "google_native",
2743
+ "other"
2744
+ ]>;
2745
+ flowKey: z.ZodString;
2746
+ status: z.ZodEnum<[
2747
+ "RUNNING",
2748
+ "SUCCEEDED",
2749
+ "FAILED"
2750
+ ]>;
2751
+ retryScheduled: z.ZodBoolean;
2752
+ failedStepKey: z.ZodNullable<z.ZodEnum<[
2753
+ "delete_child_assets",
2754
+ "extract_text",
2755
+ "analyze_media",
2756
+ "extract_assets",
2757
+ "ocr_children",
2758
+ "ocr_document",
2759
+ "resolve_body",
2760
+ "enrich_document",
2761
+ "project_to_indexes"
2762
+ ]>>;
2763
+ errorMessage: z.ZodNullable<z.ZodString>;
2764
+ requestedBy: z.ZodString;
2765
+ startedAt: z.ZodString;
2766
+ finishedAt: z.ZodNullable<z.ZodString>;
2767
+ steps: z.ZodArray<z.ZodEffects<z.ZodObject<{
2768
+ id: z.ZodNumber;
2769
+ runId: z.ZodNumber;
2770
+ sequence: z.ZodNumber;
2771
+ stepKey: z.ZodEnum<[
2772
+ "delete_child_assets",
2773
+ "extract_text",
2774
+ "analyze_media",
2775
+ "extract_assets",
2776
+ "ocr_children",
2777
+ "ocr_document",
2778
+ "resolve_body",
2779
+ "enrich_document",
2780
+ "project_to_indexes"
2781
+ ]>;
2782
+ targetMetadataId: z.ZodNumber;
2783
+ status: z.ZodEnum<[
2784
+ "RUNNING",
2785
+ "SUCCEEDED",
2786
+ "SKIPPED",
2787
+ "FAILED"
2788
+ ]>;
2789
+ skipReason: z.ZodNullable<z.ZodString>;
2790
+ provenance: z.ZodNullable<z.ZodObject<{
2791
+ provider: z.ZodNullable<z.ZodString>;
2792
+ model: z.ZodNullable<z.ZodString>;
2793
+ engine: z.ZodNullable<z.ZodString>;
2794
+ prompt_key: z.ZodNullable<z.ZodString>;
2795
+ prompt_version: z.ZodNullable<z.ZodNumber>;
2796
+ duration_ms: z.ZodNullable<z.ZodNumber>;
2797
+ input_chars: z.ZodNullable<z.ZodNumber>;
2798
+ output_chars: z.ZodNullable<z.ZodNumber>;
2799
+ pages_read: z.ZodNullable<z.ZodNumber>;
2800
+ pages_total: z.ZodNullable<z.ZodNumber>;
2801
+ chunk_count: z.ZodNullable<z.ZodNumber>;
2802
+ points_upserted: z.ZodNullable<z.ZodNumber>;
2803
+ collection: z.ZodNullable<z.ZodString>;
2804
+ embedding_model: z.ZodNullable<z.ZodString>;
2805
+ strategy_id: z.ZodNullable<z.ZodNumber>;
2806
+ graph_nodes: z.ZodNullable<z.ZodNumber>;
2807
+ body_source: z.ZodNullable<z.ZodEnum<[
2808
+ "text_layer",
2809
+ "ocr",
2810
+ "transcript"
2811
+ ]>>;
2812
+ detail: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2813
+ }, "strict", z.ZodTypeAny, {
2814
+ strategy_id: number | null;
2815
+ provider: string | null;
2816
+ model: string | null;
2817
+ engine: string | null;
2818
+ prompt_key: string | null;
2819
+ prompt_version: number | null;
2820
+ duration_ms: number | null;
2821
+ input_chars: number | null;
2822
+ output_chars: number | null;
2823
+ pages_read: number | null;
2824
+ pages_total: number | null;
2825
+ chunk_count: number | null;
2826
+ points_upserted: number | null;
2827
+ collection: string | null;
2828
+ embedding_model: string | null;
2829
+ graph_nodes: number | null;
2830
+ body_source: "ocr" | "text_layer" | "transcript" | null;
2831
+ detail: Record<string, unknown>;
2832
+ }, {
2833
+ strategy_id: number | null;
2834
+ provider: string | null;
2835
+ model: string | null;
2836
+ engine: string | null;
2837
+ prompt_key: string | null;
2838
+ prompt_version: number | null;
2839
+ duration_ms: number | null;
2840
+ input_chars: number | null;
2841
+ output_chars: number | null;
2842
+ pages_read: number | null;
2843
+ pages_total: number | null;
2844
+ chunk_count: number | null;
2845
+ points_upserted: number | null;
2846
+ collection: string | null;
2847
+ embedding_model: string | null;
2848
+ graph_nodes: number | null;
2849
+ body_source: "ocr" | "text_layer" | "transcript" | null;
2850
+ detail: Record<string, unknown>;
2851
+ }>>;
2852
+ strategyId: z.ZodNullable<z.ZodNumber>;
2853
+ httpStatus: z.ZodNullable<z.ZodNumber>;
2854
+ errorCode: z.ZodNullable<z.ZodString>;
2855
+ errorMessage: z.ZodNullable<z.ZodString>;
2856
+ startedAt: z.ZodString;
2857
+ finishedAt: z.ZodNullable<z.ZodString>;
2858
+ durationMs: z.ZodNullable<z.ZodNumber>;
2859
+ }, "strict", z.ZodTypeAny, {
2860
+ status: "RUNNING" | "FAILED" | "SKIPPED" | "SUCCEEDED";
2861
+ startedAt: string;
2862
+ finishedAt: string | null;
2863
+ sequence: number;
2864
+ errorCode: string | null;
2865
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
2866
+ id: number;
2867
+ runId: number;
2868
+ targetMetadataId: number;
2869
+ skipReason: string | null;
2870
+ provenance: {
2871
+ strategy_id: number | null;
2872
+ provider: string | null;
2873
+ model: string | null;
2874
+ engine: string | null;
2875
+ prompt_key: string | null;
2876
+ prompt_version: number | null;
2877
+ duration_ms: number | null;
2878
+ input_chars: number | null;
2879
+ output_chars: number | null;
2880
+ pages_read: number | null;
2881
+ pages_total: number | null;
2882
+ chunk_count: number | null;
2883
+ points_upserted: number | null;
2884
+ collection: string | null;
2885
+ embedding_model: string | null;
2886
+ graph_nodes: number | null;
2887
+ body_source: "ocr" | "text_layer" | "transcript" | null;
2888
+ detail: Record<string, unknown>;
2889
+ } | null;
2890
+ strategyId: number | null;
2891
+ httpStatus: number | null;
2892
+ errorMessage: string | null;
2893
+ durationMs: number | null;
2894
+ }, {
2895
+ status: "RUNNING" | "FAILED" | "SKIPPED" | "SUCCEEDED";
2896
+ startedAt: string;
2897
+ finishedAt: string | null;
2898
+ sequence: number;
2899
+ errorCode: string | null;
2900
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
2901
+ id: number;
2902
+ runId: number;
2903
+ targetMetadataId: number;
2904
+ skipReason: string | null;
2905
+ provenance: {
2906
+ strategy_id: number | null;
2907
+ provider: string | null;
2908
+ model: string | null;
2909
+ engine: string | null;
2910
+ prompt_key: string | null;
2911
+ prompt_version: number | null;
2912
+ duration_ms: number | null;
2913
+ input_chars: number | null;
2914
+ output_chars: number | null;
2915
+ pages_read: number | null;
2916
+ pages_total: number | null;
2917
+ chunk_count: number | null;
2918
+ points_upserted: number | null;
2919
+ collection: string | null;
2920
+ embedding_model: string | null;
2921
+ graph_nodes: number | null;
2922
+ body_source: "ocr" | "text_layer" | "transcript" | null;
2923
+ detail: Record<string, unknown>;
2924
+ } | null;
2925
+ strategyId: number | null;
2926
+ httpStatus: number | null;
2927
+ errorMessage: string | null;
2928
+ durationMs: number | null;
2929
+ }>, {
2930
+ status: "RUNNING" | "FAILED" | "SKIPPED" | "SUCCEEDED";
2931
+ startedAt: string;
2932
+ finishedAt: string | null;
2933
+ sequence: number;
2934
+ errorCode: string | null;
2935
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
2936
+ id: number;
2937
+ runId: number;
2938
+ targetMetadataId: number;
2939
+ skipReason: string | null;
2940
+ provenance: {
2941
+ strategy_id: number | null;
2942
+ provider: string | null;
2943
+ model: string | null;
2944
+ engine: string | null;
2945
+ prompt_key: string | null;
2946
+ prompt_version: number | null;
2947
+ duration_ms: number | null;
2948
+ input_chars: number | null;
2949
+ output_chars: number | null;
2950
+ pages_read: number | null;
2951
+ pages_total: number | null;
2952
+ chunk_count: number | null;
2953
+ points_upserted: number | null;
2954
+ collection: string | null;
2955
+ embedding_model: string | null;
2956
+ graph_nodes: number | null;
2957
+ body_source: "ocr" | "text_layer" | "transcript" | null;
2958
+ detail: Record<string, unknown>;
2959
+ } | null;
2960
+ strategyId: number | null;
2961
+ httpStatus: number | null;
2962
+ errorMessage: string | null;
2963
+ durationMs: number | null;
2964
+ }, {
2965
+ status: "RUNNING" | "FAILED" | "SKIPPED" | "SUCCEEDED";
2966
+ startedAt: string;
2967
+ finishedAt: string | null;
2968
+ sequence: number;
2969
+ errorCode: string | null;
2970
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
2971
+ id: number;
2972
+ runId: number;
2973
+ targetMetadataId: number;
2974
+ skipReason: string | null;
2975
+ provenance: {
2976
+ strategy_id: number | null;
2977
+ provider: string | null;
2978
+ model: string | null;
2979
+ engine: string | null;
2980
+ prompt_key: string | null;
2981
+ prompt_version: number | null;
2982
+ duration_ms: number | null;
2983
+ input_chars: number | null;
2984
+ output_chars: number | null;
2985
+ pages_read: number | null;
2986
+ pages_total: number | null;
2987
+ chunk_count: number | null;
2988
+ points_upserted: number | null;
2989
+ collection: string | null;
2990
+ embedding_model: string | null;
2991
+ graph_nodes: number | null;
2992
+ body_source: "ocr" | "text_layer" | "transcript" | null;
2993
+ detail: Record<string, unknown>;
2994
+ } | null;
2995
+ strategyId: number | null;
2996
+ httpStatus: number | null;
2997
+ errorMessage: string | null;
2998
+ durationMs: number | null;
2999
+ }>, "many">;
3000
+ }, "strict", z.ZodTypeAny, {
3001
+ status: "RUNNING" | "FAILED" | "SUCCEEDED";
3002
+ runUid: string;
3003
+ requestedBy: string;
3004
+ startedAt: string;
3005
+ finishedAt: string | null;
3006
+ metadataId: number;
3007
+ revision: number;
3008
+ id: number;
3009
+ errorMessage: string | null;
3010
+ tenantId: string;
3011
+ jobId: string;
3012
+ attempt: number;
3013
+ trigger: "ingest" | "retry" | "resync";
3014
+ documentKind: "text" | "email" | "pdf" | "office" | "image" | "media" | "google_native" | "other";
3015
+ flowKey: string;
3016
+ retryScheduled: boolean;
3017
+ failedStepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes" | null;
3018
+ steps: {
3019
+ status: "RUNNING" | "FAILED" | "SKIPPED" | "SUCCEEDED";
3020
+ startedAt: string;
3021
+ finishedAt: string | null;
3022
+ sequence: number;
3023
+ errorCode: string | null;
3024
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
3025
+ id: number;
3026
+ runId: number;
3027
+ targetMetadataId: number;
3028
+ skipReason: string | null;
3029
+ provenance: {
3030
+ strategy_id: number | null;
3031
+ provider: string | null;
3032
+ model: string | null;
3033
+ engine: string | null;
3034
+ prompt_key: string | null;
3035
+ prompt_version: number | null;
3036
+ duration_ms: number | null;
3037
+ input_chars: number | null;
3038
+ output_chars: number | null;
3039
+ pages_read: number | null;
3040
+ pages_total: number | null;
3041
+ chunk_count: number | null;
3042
+ points_upserted: number | null;
3043
+ collection: string | null;
3044
+ embedding_model: string | null;
3045
+ graph_nodes: number | null;
3046
+ body_source: "ocr" | "text_layer" | "transcript" | null;
3047
+ detail: Record<string, unknown>;
3048
+ } | null;
3049
+ strategyId: number | null;
3050
+ httpStatus: number | null;
3051
+ errorMessage: string | null;
3052
+ durationMs: number | null;
3053
+ }[];
3054
+ }, {
3055
+ status: "RUNNING" | "FAILED" | "SUCCEEDED";
3056
+ runUid: string;
3057
+ requestedBy: string;
3058
+ startedAt: string;
3059
+ finishedAt: string | null;
3060
+ metadataId: number;
3061
+ revision: number;
3062
+ id: number;
3063
+ errorMessage: string | null;
3064
+ tenantId: string;
3065
+ jobId: string;
3066
+ attempt: number;
3067
+ trigger: "ingest" | "retry" | "resync";
3068
+ documentKind: "text" | "email" | "pdf" | "office" | "image" | "media" | "google_native" | "other";
3069
+ flowKey: string;
3070
+ retryScheduled: boolean;
3071
+ failedStepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes" | null;
3072
+ steps: {
3073
+ status: "RUNNING" | "FAILED" | "SKIPPED" | "SUCCEEDED";
3074
+ startedAt: string;
3075
+ finishedAt: string | null;
3076
+ sequence: number;
3077
+ errorCode: string | null;
3078
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
3079
+ id: number;
3080
+ runId: number;
3081
+ targetMetadataId: number;
3082
+ skipReason: string | null;
3083
+ provenance: {
3084
+ strategy_id: number | null;
3085
+ provider: string | null;
3086
+ model: string | null;
3087
+ engine: string | null;
3088
+ prompt_key: string | null;
3089
+ prompt_version: number | null;
3090
+ duration_ms: number | null;
3091
+ input_chars: number | null;
3092
+ output_chars: number | null;
3093
+ pages_read: number | null;
3094
+ pages_total: number | null;
3095
+ chunk_count: number | null;
3096
+ points_upserted: number | null;
3097
+ collection: string | null;
3098
+ embedding_model: string | null;
3099
+ graph_nodes: number | null;
3100
+ body_source: "ocr" | "text_layer" | "transcript" | null;
3101
+ detail: Record<string, unknown>;
3102
+ } | null;
3103
+ strategyId: number | null;
3104
+ httpStatus: number | null;
3105
+ errorMessage: string | null;
3106
+ durationMs: number | null;
3107
+ }[];
3108
+ }>, {
3109
+ status: "RUNNING" | "FAILED" | "SUCCEEDED";
3110
+ runUid: string;
3111
+ requestedBy: string;
3112
+ startedAt: string;
3113
+ finishedAt: string | null;
3114
+ metadataId: number;
3115
+ revision: number;
3116
+ id: number;
3117
+ errorMessage: string | null;
3118
+ tenantId: string;
3119
+ jobId: string;
3120
+ attempt: number;
3121
+ trigger: "ingest" | "retry" | "resync";
3122
+ documentKind: "text" | "email" | "pdf" | "office" | "image" | "media" | "google_native" | "other";
3123
+ flowKey: string;
3124
+ retryScheduled: boolean;
3125
+ failedStepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes" | null;
3126
+ steps: {
3127
+ status: "RUNNING" | "FAILED" | "SKIPPED" | "SUCCEEDED";
3128
+ startedAt: string;
3129
+ finishedAt: string | null;
3130
+ sequence: number;
3131
+ errorCode: string | null;
3132
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
3133
+ id: number;
3134
+ runId: number;
3135
+ targetMetadataId: number;
3136
+ skipReason: string | null;
3137
+ provenance: {
3138
+ strategy_id: number | null;
3139
+ provider: string | null;
3140
+ model: string | null;
3141
+ engine: string | null;
3142
+ prompt_key: string | null;
3143
+ prompt_version: number | null;
3144
+ duration_ms: number | null;
3145
+ input_chars: number | null;
3146
+ output_chars: number | null;
3147
+ pages_read: number | null;
3148
+ pages_total: number | null;
3149
+ chunk_count: number | null;
3150
+ points_upserted: number | null;
3151
+ collection: string | null;
3152
+ embedding_model: string | null;
3153
+ graph_nodes: number | null;
3154
+ body_source: "ocr" | "text_layer" | "transcript" | null;
3155
+ detail: Record<string, unknown>;
3156
+ } | null;
3157
+ strategyId: number | null;
3158
+ httpStatus: number | null;
3159
+ errorMessage: string | null;
3160
+ durationMs: number | null;
3161
+ }[];
3162
+ }, {
3163
+ status: "RUNNING" | "FAILED" | "SUCCEEDED";
3164
+ runUid: string;
3165
+ requestedBy: string;
3166
+ startedAt: string;
3167
+ finishedAt: string | null;
3168
+ metadataId: number;
3169
+ revision: number;
3170
+ id: number;
3171
+ errorMessage: string | null;
3172
+ tenantId: string;
3173
+ jobId: string;
3174
+ attempt: number;
3175
+ trigger: "ingest" | "retry" | "resync";
3176
+ documentKind: "text" | "email" | "pdf" | "office" | "image" | "media" | "google_native" | "other";
3177
+ flowKey: string;
3178
+ retryScheduled: boolean;
3179
+ failedStepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes" | null;
3180
+ steps: {
3181
+ status: "RUNNING" | "FAILED" | "SKIPPED" | "SUCCEEDED";
3182
+ startedAt: string;
3183
+ finishedAt: string | null;
3184
+ sequence: number;
3185
+ errorCode: string | null;
3186
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
3187
+ id: number;
3188
+ runId: number;
3189
+ targetMetadataId: number;
3190
+ skipReason: string | null;
3191
+ provenance: {
3192
+ strategy_id: number | null;
3193
+ provider: string | null;
3194
+ model: string | null;
3195
+ engine: string | null;
3196
+ prompt_key: string | null;
3197
+ prompt_version: number | null;
3198
+ duration_ms: number | null;
3199
+ input_chars: number | null;
3200
+ output_chars: number | null;
3201
+ pages_read: number | null;
3202
+ pages_total: number | null;
3203
+ chunk_count: number | null;
3204
+ points_upserted: number | null;
3205
+ collection: string | null;
3206
+ embedding_model: string | null;
3207
+ graph_nodes: number | null;
3208
+ body_source: "ocr" | "text_layer" | "transcript" | null;
3209
+ detail: Record<string, unknown>;
3210
+ } | null;
3211
+ strategyId: number | null;
3212
+ httpStatus: number | null;
3213
+ errorMessage: string | null;
3214
+ durationMs: number | null;
3215
+ }[];
3216
+ }>;
3217
+ type PipelineRunRecord = z.infer<typeof PipelineRunRecordSchema>;
3218
+ declare const PipelineRunSummarySchema: z.ZodEffects<z.ZodObject<Omit<{
3219
+ id: z.ZodNumber;
3220
+ tenantId: z.ZodString;
3221
+ metadataId: z.ZodNumber;
3222
+ revision: z.ZodNumber;
3223
+ runUid: z.ZodString;
3224
+ jobId: z.ZodString;
3225
+ attempt: z.ZodNumber;
3226
+ trigger: z.ZodEnum<[
3227
+ "ingest",
3228
+ "retry",
3229
+ "resync"
3230
+ ]>;
3231
+ documentKind: z.ZodEnum<[
3232
+ "email",
3233
+ "pdf",
3234
+ "office",
3235
+ "image",
3236
+ "media",
3237
+ "text",
3238
+ "google_native",
3239
+ "other"
3240
+ ]>;
3241
+ flowKey: z.ZodString;
3242
+ status: z.ZodEnum<[
3243
+ "RUNNING",
3244
+ "SUCCEEDED",
3245
+ "FAILED"
3246
+ ]>;
3247
+ retryScheduled: z.ZodBoolean;
3248
+ failedStepKey: z.ZodNullable<z.ZodEnum<[
3249
+ "delete_child_assets",
3250
+ "extract_text",
3251
+ "analyze_media",
3252
+ "extract_assets",
3253
+ "ocr_children",
3254
+ "ocr_document",
3255
+ "resolve_body",
3256
+ "enrich_document",
3257
+ "project_to_indexes"
3258
+ ]>>;
3259
+ errorMessage: z.ZodNullable<z.ZodString>;
3260
+ requestedBy: z.ZodString;
3261
+ startedAt: z.ZodString;
3262
+ finishedAt: z.ZodNullable<z.ZodString>;
3263
+ steps: z.ZodArray<z.ZodEffects<z.ZodObject<{
3264
+ id: z.ZodNumber;
3265
+ runId: z.ZodNumber;
3266
+ sequence: z.ZodNumber;
3267
+ stepKey: z.ZodEnum<[
3268
+ "delete_child_assets",
3269
+ "extract_text",
3270
+ "analyze_media",
3271
+ "extract_assets",
3272
+ "ocr_children",
3273
+ "ocr_document",
3274
+ "resolve_body",
3275
+ "enrich_document",
3276
+ "project_to_indexes"
3277
+ ]>;
3278
+ targetMetadataId: z.ZodNumber;
3279
+ status: z.ZodEnum<[
3280
+ "RUNNING",
3281
+ "SUCCEEDED",
3282
+ "SKIPPED",
3283
+ "FAILED"
3284
+ ]>;
3285
+ skipReason: z.ZodNullable<z.ZodString>;
3286
+ provenance: z.ZodNullable<z.ZodObject<{
3287
+ provider: z.ZodNullable<z.ZodString>;
3288
+ model: z.ZodNullable<z.ZodString>;
3289
+ engine: z.ZodNullable<z.ZodString>;
3290
+ prompt_key: z.ZodNullable<z.ZodString>;
3291
+ prompt_version: z.ZodNullable<z.ZodNumber>;
3292
+ duration_ms: z.ZodNullable<z.ZodNumber>;
3293
+ input_chars: z.ZodNullable<z.ZodNumber>;
3294
+ output_chars: z.ZodNullable<z.ZodNumber>;
3295
+ pages_read: z.ZodNullable<z.ZodNumber>;
3296
+ pages_total: z.ZodNullable<z.ZodNumber>;
3297
+ chunk_count: z.ZodNullable<z.ZodNumber>;
3298
+ points_upserted: z.ZodNullable<z.ZodNumber>;
3299
+ collection: z.ZodNullable<z.ZodString>;
3300
+ embedding_model: z.ZodNullable<z.ZodString>;
3301
+ strategy_id: z.ZodNullable<z.ZodNumber>;
3302
+ graph_nodes: z.ZodNullable<z.ZodNumber>;
3303
+ body_source: z.ZodNullable<z.ZodEnum<[
3304
+ "text_layer",
3305
+ "ocr",
3306
+ "transcript"
3307
+ ]>>;
3308
+ detail: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3309
+ }, "strict", z.ZodTypeAny, {
3310
+ strategy_id: number | null;
3311
+ provider: string | null;
3312
+ model: string | null;
3313
+ engine: string | null;
3314
+ prompt_key: string | null;
3315
+ prompt_version: number | null;
3316
+ duration_ms: number | null;
3317
+ input_chars: number | null;
3318
+ output_chars: number | null;
3319
+ pages_read: number | null;
3320
+ pages_total: number | null;
3321
+ chunk_count: number | null;
3322
+ points_upserted: number | null;
3323
+ collection: string | null;
3324
+ embedding_model: string | null;
3325
+ graph_nodes: number | null;
3326
+ body_source: "ocr" | "text_layer" | "transcript" | null;
3327
+ detail: Record<string, unknown>;
3328
+ }, {
3329
+ strategy_id: number | null;
3330
+ provider: string | null;
3331
+ model: string | null;
3332
+ engine: string | null;
3333
+ prompt_key: string | null;
3334
+ prompt_version: number | null;
3335
+ duration_ms: number | null;
3336
+ input_chars: number | null;
3337
+ output_chars: number | null;
3338
+ pages_read: number | null;
3339
+ pages_total: number | null;
3340
+ chunk_count: number | null;
3341
+ points_upserted: number | null;
3342
+ collection: string | null;
3343
+ embedding_model: string | null;
3344
+ graph_nodes: number | null;
3345
+ body_source: "ocr" | "text_layer" | "transcript" | null;
3346
+ detail: Record<string, unknown>;
3347
+ }>>;
3348
+ strategyId: z.ZodNullable<z.ZodNumber>;
3349
+ httpStatus: z.ZodNullable<z.ZodNumber>;
3350
+ errorCode: z.ZodNullable<z.ZodString>;
3351
+ errorMessage: z.ZodNullable<z.ZodString>;
3352
+ startedAt: z.ZodString;
3353
+ finishedAt: z.ZodNullable<z.ZodString>;
3354
+ durationMs: z.ZodNullable<z.ZodNumber>;
3355
+ }, "strict", z.ZodTypeAny, {
3356
+ status: "RUNNING" | "FAILED" | "SKIPPED" | "SUCCEEDED";
3357
+ startedAt: string;
3358
+ finishedAt: string | null;
3359
+ sequence: number;
3360
+ errorCode: string | null;
3361
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
3362
+ id: number;
3363
+ runId: number;
3364
+ targetMetadataId: number;
3365
+ skipReason: string | null;
3366
+ provenance: {
3367
+ strategy_id: number | null;
3368
+ provider: string | null;
3369
+ model: string | null;
3370
+ engine: string | null;
3371
+ prompt_key: string | null;
3372
+ prompt_version: number | null;
3373
+ duration_ms: number | null;
3374
+ input_chars: number | null;
3375
+ output_chars: number | null;
3376
+ pages_read: number | null;
3377
+ pages_total: number | null;
3378
+ chunk_count: number | null;
3379
+ points_upserted: number | null;
3380
+ collection: string | null;
3381
+ embedding_model: string | null;
3382
+ graph_nodes: number | null;
3383
+ body_source: "ocr" | "text_layer" | "transcript" | null;
3384
+ detail: Record<string, unknown>;
3385
+ } | null;
3386
+ strategyId: number | null;
3387
+ httpStatus: number | null;
3388
+ errorMessage: string | null;
3389
+ durationMs: number | null;
3390
+ }, {
3391
+ status: "RUNNING" | "FAILED" | "SKIPPED" | "SUCCEEDED";
3392
+ startedAt: string;
3393
+ finishedAt: string | null;
3394
+ sequence: number;
3395
+ errorCode: string | null;
3396
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
3397
+ id: number;
3398
+ runId: number;
3399
+ targetMetadataId: number;
3400
+ skipReason: string | null;
3401
+ provenance: {
3402
+ strategy_id: number | null;
3403
+ provider: string | null;
3404
+ model: string | null;
3405
+ engine: string | null;
3406
+ prompt_key: string | null;
3407
+ prompt_version: number | null;
3408
+ duration_ms: number | null;
3409
+ input_chars: number | null;
3410
+ output_chars: number | null;
3411
+ pages_read: number | null;
3412
+ pages_total: number | null;
3413
+ chunk_count: number | null;
3414
+ points_upserted: number | null;
3415
+ collection: string | null;
3416
+ embedding_model: string | null;
3417
+ graph_nodes: number | null;
3418
+ body_source: "ocr" | "text_layer" | "transcript" | null;
3419
+ detail: Record<string, unknown>;
3420
+ } | null;
3421
+ strategyId: number | null;
3422
+ httpStatus: number | null;
3423
+ errorMessage: string | null;
3424
+ durationMs: number | null;
3425
+ }>, {
3426
+ status: "RUNNING" | "FAILED" | "SKIPPED" | "SUCCEEDED";
3427
+ startedAt: string;
3428
+ finishedAt: string | null;
3429
+ sequence: number;
3430
+ errorCode: string | null;
3431
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
3432
+ id: number;
3433
+ runId: number;
3434
+ targetMetadataId: number;
3435
+ skipReason: string | null;
3436
+ provenance: {
3437
+ strategy_id: number | null;
3438
+ provider: string | null;
3439
+ model: string | null;
3440
+ engine: string | null;
3441
+ prompt_key: string | null;
3442
+ prompt_version: number | null;
3443
+ duration_ms: number | null;
3444
+ input_chars: number | null;
3445
+ output_chars: number | null;
3446
+ pages_read: number | null;
3447
+ pages_total: number | null;
3448
+ chunk_count: number | null;
3449
+ points_upserted: number | null;
3450
+ collection: string | null;
3451
+ embedding_model: string | null;
3452
+ graph_nodes: number | null;
3453
+ body_source: "ocr" | "text_layer" | "transcript" | null;
3454
+ detail: Record<string, unknown>;
3455
+ } | null;
3456
+ strategyId: number | null;
3457
+ httpStatus: number | null;
3458
+ errorMessage: string | null;
3459
+ durationMs: number | null;
3460
+ }, {
3461
+ status: "RUNNING" | "FAILED" | "SKIPPED" | "SUCCEEDED";
3462
+ startedAt: string;
3463
+ finishedAt: string | null;
3464
+ sequence: number;
3465
+ errorCode: string | null;
3466
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
3467
+ id: number;
3468
+ runId: number;
3469
+ targetMetadataId: number;
3470
+ skipReason: string | null;
3471
+ provenance: {
3472
+ strategy_id: number | null;
3473
+ provider: string | null;
3474
+ model: string | null;
3475
+ engine: string | null;
3476
+ prompt_key: string | null;
3477
+ prompt_version: number | null;
3478
+ duration_ms: number | null;
3479
+ input_chars: number | null;
3480
+ output_chars: number | null;
3481
+ pages_read: number | null;
3482
+ pages_total: number | null;
3483
+ chunk_count: number | null;
3484
+ points_upserted: number | null;
3485
+ collection: string | null;
3486
+ embedding_model: string | null;
3487
+ graph_nodes: number | null;
3488
+ body_source: "ocr" | "text_layer" | "transcript" | null;
3489
+ detail: Record<string, unknown>;
3490
+ } | null;
3491
+ strategyId: number | null;
3492
+ httpStatus: number | null;
3493
+ errorMessage: string | null;
3494
+ durationMs: number | null;
3495
+ }>, "many">;
3496
+ }, "steps">, "strict", z.ZodTypeAny, {
3497
+ status: "RUNNING" | "FAILED" | "SUCCEEDED";
3498
+ runUid: string;
3499
+ requestedBy: string;
3500
+ startedAt: string;
3501
+ finishedAt: string | null;
3502
+ metadataId: number;
3503
+ revision: number;
3504
+ id: number;
3505
+ errorMessage: string | null;
3506
+ tenantId: string;
3507
+ jobId: string;
3508
+ attempt: number;
3509
+ trigger: "ingest" | "retry" | "resync";
3510
+ documentKind: "text" | "email" | "pdf" | "office" | "image" | "media" | "google_native" | "other";
3511
+ flowKey: string;
3512
+ retryScheduled: boolean;
3513
+ failedStepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes" | null;
3514
+ }, {
3515
+ status: "RUNNING" | "FAILED" | "SUCCEEDED";
3516
+ runUid: string;
3517
+ requestedBy: string;
3518
+ startedAt: string;
3519
+ finishedAt: string | null;
3520
+ metadataId: number;
3521
+ revision: number;
3522
+ id: number;
3523
+ errorMessage: string | null;
3524
+ tenantId: string;
3525
+ jobId: string;
3526
+ attempt: number;
3527
+ trigger: "ingest" | "retry" | "resync";
3528
+ documentKind: "text" | "email" | "pdf" | "office" | "image" | "media" | "google_native" | "other";
3529
+ flowKey: string;
3530
+ retryScheduled: boolean;
3531
+ failedStepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes" | null;
3532
+ }>, {
3533
+ status: "RUNNING" | "FAILED" | "SUCCEEDED";
3534
+ runUid: string;
3535
+ requestedBy: string;
3536
+ startedAt: string;
3537
+ finishedAt: string | null;
3538
+ metadataId: number;
3539
+ revision: number;
3540
+ id: number;
3541
+ errorMessage: string | null;
3542
+ tenantId: string;
3543
+ jobId: string;
3544
+ attempt: number;
3545
+ trigger: "ingest" | "retry" | "resync";
3546
+ documentKind: "text" | "email" | "pdf" | "office" | "image" | "media" | "google_native" | "other";
3547
+ flowKey: string;
3548
+ retryScheduled: boolean;
3549
+ failedStepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes" | null;
3550
+ }, {
3551
+ status: "RUNNING" | "FAILED" | "SUCCEEDED";
3552
+ runUid: string;
3553
+ requestedBy: string;
3554
+ startedAt: string;
3555
+ finishedAt: string | null;
3556
+ metadataId: number;
3557
+ revision: number;
3558
+ id: number;
3559
+ errorMessage: string | null;
3560
+ tenantId: string;
3561
+ jobId: string;
3562
+ attempt: number;
3563
+ trigger: "ingest" | "retry" | "resync";
3564
+ documentKind: "text" | "email" | "pdf" | "office" | "image" | "media" | "google_native" | "other";
3565
+ flowKey: string;
3566
+ retryScheduled: boolean;
3567
+ failedStepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes" | null;
3568
+ }>;
3569
+ type PipelineRunSummary = z.infer<typeof PipelineRunSummarySchema>;
3570
+ declare const PipelineStepMetricSchema: z.ZodEffects<z.ZodObject<{
3571
+ documentKind: z.ZodEnum<[
3572
+ "email",
3573
+ "pdf",
3574
+ "office",
3575
+ "image",
3576
+ "media",
3577
+ "text",
3578
+ "google_native",
3579
+ "other"
3580
+ ]>;
3581
+ stepKey: z.ZodEnum<[
3582
+ "delete_child_assets",
3583
+ "extract_text",
3584
+ "analyze_media",
3585
+ "extract_assets",
3586
+ "ocr_children",
3587
+ "ocr_document",
3588
+ "resolve_body",
3589
+ "enrich_document",
3590
+ "project_to_indexes"
3591
+ ]>;
3592
+ sampleCount: z.ZodNumber;
3593
+ succeeded: z.ZodNumber;
3594
+ failed: z.ZodNumber;
3595
+ skipped: z.ZodNumber;
3596
+ durationP50Ms: z.ZodNullable<z.ZodNumber>;
3597
+ durationP95Ms: z.ZodNullable<z.ZodNumber>;
3598
+ lastStartedAt: z.ZodNullable<z.ZodString>;
3599
+ }, "strict", z.ZodTypeAny, {
3600
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
3601
+ documentKind: "text" | "email" | "pdf" | "office" | "image" | "media" | "google_native" | "other";
3602
+ durationP50Ms: number | null;
3603
+ durationP95Ms: number | null;
3604
+ sampleCount: number;
3605
+ succeeded: number;
3606
+ failed: number;
3607
+ skipped: number;
3608
+ lastStartedAt: string | null;
3609
+ }, {
3610
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
3611
+ documentKind: "text" | "email" | "pdf" | "office" | "image" | "media" | "google_native" | "other";
3612
+ durationP50Ms: number | null;
3613
+ durationP95Ms: number | null;
3614
+ sampleCount: number;
3615
+ succeeded: number;
3616
+ failed: number;
3617
+ skipped: number;
3618
+ lastStartedAt: string | null;
3619
+ }>, {
3620
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
3621
+ documentKind: "text" | "email" | "pdf" | "office" | "image" | "media" | "google_native" | "other";
3622
+ durationP50Ms: number | null;
3623
+ durationP95Ms: number | null;
3624
+ sampleCount: number;
3625
+ succeeded: number;
3626
+ failed: number;
3627
+ skipped: number;
3628
+ lastStartedAt: string | null;
3629
+ }, {
3630
+ stepKey: "delete_child_assets" | "extract_text" | "analyze_media" | "extract_assets" | "ocr_children" | "ocr_document" | "resolve_body" | "enrich_document" | "project_to_indexes";
3631
+ documentKind: "text" | "email" | "pdf" | "office" | "image" | "media" | "google_native" | "other";
3632
+ durationP50Ms: number | null;
3633
+ durationP95Ms: number | null;
3634
+ sampleCount: number;
3635
+ succeeded: number;
3636
+ failed: number;
3637
+ skipped: number;
3638
+ lastStartedAt: string | null;
3639
+ }>;
3640
+ type PipelineStepMetric = z.infer<typeof PipelineStepMetricSchema>;
834
3641
  declare const SEARCH_PARAM_LIMITS: {
835
3642
  readonly rrfK: {
836
3643
  readonly min: 1;
@@ -881,6 +3688,39 @@ declare function narrowModeToAllowedTiers(requested: SearchMode, allowed: {
881
3688
  discardGraph: boolean;
882
3689
  } | null;
883
3690
  declare function modeFusesRankings(mode: SearchMode): boolean;
3691
+ declare const CIRCUIT_BREAKER_SERVICES: readonly [
3692
+ "vector",
3693
+ "graph"
3694
+ ];
3695
+ type CircuitBreakerService = (typeof CIRCUIT_BREAKER_SERVICES)[number];
3696
+ declare const LOCAL_DEGRADATION_REASONS: readonly [
3697
+ "empty_query",
3698
+ "caller_token_unavailable",
3699
+ "time_window_unsupported"
3700
+ ];
3701
+ declare const REMOTE_DEGRADATION_REASONS: readonly [
3702
+ "vector_tier_not_configured",
3703
+ "graph_tier_not_configured",
3704
+ "no_active_vector_collection",
3705
+ "vector_collections_missing"
3706
+ ];
3707
+ declare const DISPATCH_DEGRADATION_REASONS: readonly [
3708
+ "remote_tiers_unavailable",
3709
+ "remote_tiers_timed_out",
3710
+ "remote_tiers_refused_caller",
3711
+ "remote_tiers_rejected_request",
3712
+ "remote_tiers_failed",
3713
+ "remote_tiers_not_executed",
3714
+ "vector_search_disabled",
3715
+ "graph_search_disabled"
3716
+ ];
3717
+ type RemoteSearchFailureReason = Extract<DispatchDegradationReason, "remote_tiers_unavailable" | "remote_tiers_timed_out" | "remote_tiers_refused_caller" | "remote_tiers_rejected_request" | "remote_tiers_failed">;
3718
+ type LocalDegradationReason = (typeof LOCAL_DEGRADATION_REASONS)[number];
3719
+ type RemoteDegradationReason = (typeof REMOTE_DEGRADATION_REASONS)[number];
3720
+ type DispatchDegradationReason = (typeof DISPATCH_DEGRADATION_REASONS)[number];
3721
+ type CircuitBreakerOpenReason = `circuit_breaker_open:${CircuitBreakerService}`;
3722
+ type SearchDegradationReason = LocalDegradationReason | RemoteDegradationReason | DispatchDegradationReason | CircuitBreakerOpenReason;
3723
+ declare const SEARCH_DEGRADATION_REASONS: readonly SearchDegradationReason[];
884
3724
  interface EnrichmentStage {
885
3725
  readonly key: EnrichmentStageKey;
886
3726
  readonly featureFlagKey: string | null;
@@ -902,10 +3742,39 @@ declare const GRAPH_INDEX_LIMITS: {
902
3742
  readonly default: 24;
903
3743
  };
904
3744
  };
3745
+ interface SystemParameterRange {
3746
+ readonly min: number;
3747
+ readonly max: number;
3748
+ }
3749
+ declare const SYSTEM_PARAMETER_RANGES: {
3750
+ readonly INTEGRITY_TOMBSTONE_RETENTION_DAYS: Readonly<{
3751
+ min: number;
3752
+ max: number;
3753
+ }>;
3754
+ readonly INTEGRITY_FINDING_SAMPLE_LIMIT: Readonly<{
3755
+ min: number;
3756
+ max: number;
3757
+ }>;
3758
+ readonly INTEGRITY_RUN_HEARTBEAT_TIMEOUT_SECONDS: Readonly<{
3759
+ min: number;
3760
+ max: number;
3761
+ }>;
3762
+ readonly INTEGRITY_RUN_RETENTION_COUNT: Readonly<{
3763
+ min: number;
3764
+ max: number;
3765
+ }>;
3766
+ readonly POLICY_CONFLICT_MAX_TIE_GROUP_SIZE: Readonly<{
3767
+ min: number;
3768
+ max: number;
3769
+ }>;
3770
+ };
3771
+ type SystemParameterRangeKey = keyof typeof SYSTEM_PARAMETER_RANGES;
3772
+ declare const assertSystemParameterInRange: (key: string, value: number) => void;
3773
+ declare const assertBoundedSystemParameter: (key: SystemParameterRangeKey, value: number) => void;
905
3774
  type UuidV7 = string & {
906
3775
  readonly __brand: unique symbol;
907
3776
  };
908
3777
  declare function isValidUuidV7(uuid: string): uuid is UuidV7;
909
3778
  declare function generateUuidV7(): UuidV7;
910
3779
  declare function uuidv7ToDate(uuid: string): Date;
911
- export { type AmountEntry, AmountEntrySchema, BaseEnrichmentClient, type BoundingBox, BoundingBoxSchema, type CanonicalDomainKey, CanonicalDomainKeySchema, type ChapterSegment, ChapterSegmentSchema, type ChunkingStrategy, ChunkingStrategySchema, type CircuitBreakerStatus, CircuitBreakerStatusSchema, type ConfidentialityLevel, ConfidentialityLevelSchema, type DocumentStructuredData, DocumentStructuredDataSchema, ENRICHMENT_STAGES, EnrichmentClient, EnrichmentClientError, type EnrichmentClientOptions, type EnrichmentStage, type EnrichmentStageKey, type EnrichmentSyncStatus, EnrichmentSyncStatusSchema, FILTERABLE_CONFIDENTIALITY_LEVELS, type FileMetadataResponse, FileMetadataResponseSchema, type FileUri, FileUriSchema, type FilterableConfidentialityLevel, GRAPH_INDEX_LIMITS, MODE_TIERS, type ModelProvider, ModelProviderSchema, QUARANTINED_CONFIDENTIALITY_LEVEL, type QualityTier, QualityTierSchema, type ReclassifyRequest, type ReclassifyRequestInput, ReclassifyRequestSchema, type ReclassifyResponse, ReclassifyResponseSchema, SEARCH_MODES, SEARCH_PARAM_LIMITS, type SearchHit, SearchHitSchema, type SearchMetadata, SearchMetadataSchema, type SearchMode, SearchModeSchema, type SearchRequest, type SearchRequestInput, SearchRequestSchema, type SearchResponse, SearchResponseSchema, type TenantId, TenantIdSchema, type TranscriptSegment, TranscriptSegmentSchema, type UuidV7, enrichmentStage, generateUuidV7, isEnrichmentStageKey, isValidUuidV7, modeFusesRankings, modeNeedsRemoteTiers, modeScoreIsSimilarity, narrowModeToAllowedTiers, uuidv7ToDate };
3780
+ export { type AmountEntry, AmountEntrySchema, BaseEnrichmentClient, type BodySource, BodySourceSchema, type BoundingBox, BoundingBoxSchema, CIRCUIT_BREAKER_SERVICES, type CanonicalDomainKey, CanonicalDomainKeySchema, type ChapterSegment, ChapterSegmentSchema, type ChunkSource, type ChunkingStrategy, ChunkingStrategySchema, type CircuitBreakerOpenReason, type CircuitBreakerService, type CircuitBreakerStatus, CircuitBreakerStatusSchema, type ConfidentialityLevel, ConfidentialityLevelSchema, DISPATCH_DEGRADATION_REASONS, DOCUMENT_KINDS, DOCUMENT_KIND_LABELS, type DispatchDegradationReason, type DocumentKind, DocumentKindSchema, type DocumentStructuredData, DocumentStructuredDataSchema, ENRICHMENT_STAGES, EnrichmentClient, EnrichmentClientError, type EnrichmentClientOptions, type EnrichmentStage, type EnrichmentStageKey, type EnrichmentSyncStatus, EnrichmentSyncStatusSchema, FILTERABLE_CONFIDENTIALITY_LEVELS, type FileUri, FileUriSchema, type FilterableConfidentialityLevel, type FlowGatePolicy, type FlowStep, GRAPH_INDEX_LIMITS, type GraphSearchHit, GraphSearchHitSchema, INTEGRITY_CLASS_POLICY, INTEGRITY_COMMAND_CODES, INTEGRITY_FINDINGS_PAGE_LIMIT_MAX, type IntegrityActiveRun, IntegrityActiveRunSchema, type IntegrityAuditOverview, IntegrityAuditOverviewSchema, type IntegrityCancelFailureCode, IntegrityCancelFailureCodeSchema, type IntegrityClassPolicy, type IntegrityCommand, type IntegrityCommandFailure, type IntegrityCommandFailureCode, type IntegrityCommandFailureCodeFor, IntegrityCommandFailureCodeSchema, IntegrityCommandFailureSchema, type IntegrityCommandReply, IntegrityCommandReplySchema, IntegrityCommandSchema, type IntegrityDisposition, IntegrityDispositionSchema, type IntegrityFinding, type IntegrityFindingItemClass, IntegrityFindingItemClassSchema, type IntegrityFindingPage, IntegrityFindingPageSchema, IntegrityFindingSchema, type IntegrityFindingsQuery, IntegrityFindingsQuerySchema, type IntegrityItemClass, IntegrityItemClassSchema, type IntegrityPhase, IntegrityPhaseSchema, type IntegrityQuantity, IntegrityQuantitySchema, type IntegrityRepairAction, IntegrityRepairActionSchema, type IntegrityRepairOutcome, IntegrityRepairOutcomeSchema, type IntegrityRepairSkipReason, IntegrityRepairSkipReasonSchema, type IntegrityRunHeader, IntegrityRunHeaderSchema, type IntegrityRunMode, IntegrityRunModeSchema, type IntegrityRunStatus, IntegrityRunStatusSchema, type IntegrityScopeRole, IntegrityScopeRoleSchema, type IntegrityStartFailureCode, IntegrityStartFailureCodeSchema, type IntegrityStore, IntegrityStoreSchema, type IntegrityUnit, IntegrityUnitSchema, type IntegrityVerdict, IntegrityVerdictSchema, LOCAL_DEGRADATION_REASONS, type LocalDegradationReason, MIME_KIND_RULES, MODE_TIERS, type ModelProvider, ModelProviderSchema, NOTHING_TO_READ_TOKENS, type NothingToReadToken, NothingToReadTokenSchema, PIPELINE_FLOWS, PIPELINE_PHASES, PIPELINE_STEPS, PIPELINE_STEP_KEYS, type PipelineFailureStatus, type PipelineFlow, type PipelinePhase, type PipelineRunRecord, PipelineRunRecordSchema, type PipelineRunStatus, PipelineRunStatusSchema, type PipelineRunSummary, PipelineRunSummarySchema, type PipelineStepDefinition, type PipelineStepKey, PipelineStepKeySchema, type PipelineStepMetric, PipelineStepMetricSchema, type PipelineStepRecord, PipelineStepRecordSchema, type PipelineStepStatus, PipelineStepStatusSchema, type PipelineTrigger, PipelineTriggerSchema, QUARANTINED_CONFIDENTIALITY_LEVEL, REMOTE_DEGRADATION_REASONS, type RemoteDegradationReason, type RemoteSearchFailureReason, SEARCH_DEGRADATION_REASONS, SEARCH_MODES, SEARCH_PARAM_LIMITS, SYSTEM_PARAMETER_RANGES, type SearchDegradationReason, type SearchHit, SearchHitSchema, type SearchMetadata, SearchMetadataSchema, type SearchMode, SearchModeSchema, type SearchRequest, type SearchRequestInput, SearchRequestSchema, type SearchResponse, SearchResponseSchema, type SkipReason, type StageProvenance, StageProvenanceSchema, type StepGate, type SystemParameterRange, type SystemParameterRangeKey, type TenantId, TenantIdSchema, type TranscriptSegment, TranscriptSegmentSchema, type UuidV7, assertBoundedSystemParameter, assertSystemParameterInRange, classifyDocumentKind, comparePhases, enrichmentStage, flowFor, flowStepGates, formatSkipReason, generateUuidV7, integrityCommandFailureCodeOf, isEnrichmentStageKey, isStrictlyEarlier, isValidUuidV7, modeFusesRankings, modeNeedsRemoteTiers, modeScoreIsSimilarity, narrowModeToAllowedTiers, orderedSteps, parseSkipReason, uuidv7ToDate };