audit-tools 0.34.26 → 0.34.27
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/audit/cli/dispatch/packetFilter.d.ts +1 -1
- package/dist/audit/cli/dispatch.d.ts +9 -0
- package/dist/audit/cli/dispatch.d.ts.map +1 -1
- package/dist/audit/cli/dispatch.js +16 -0
- package/dist/audit/cli/dispatch.js.map +1 -1
- package/dist/audit/cli/dispatchAttempted.d.ts +28 -0
- package/dist/audit/cli/dispatchAttempted.d.ts.map +1 -0
- package/dist/audit/cli/dispatchAttempted.js +71 -0
- package/dist/audit/cli/dispatchAttempted.js.map +1 -0
- package/dist/audit/cli/mergeAndIngestCommand.d.ts +55 -9
- package/dist/audit/cli/mergeAndIngestCommand.d.ts.map +1 -1
- package/dist/audit/cli/mergeAndIngestCommand.js +117 -32
- package/dist/audit/cli/mergeAndIngestCommand.js.map +1 -1
- package/dist/audit/cli/rollingAuditDispatch.d.ts.map +1 -1
- package/dist/audit/cli/rollingAuditDispatch.js +13 -1
- package/dist/audit/cli/rollingAuditDispatch.js.map +1 -1
- package/dist/audit/contracts/workerSchemas.d.ts +14 -14
- package/dist/audit/orchestrator/requeueCommand.d.ts +1 -1
- package/dist/audit/types/reviewPlanning.d.ts +2 -2
- package/dist/audit/types.d.ts +12 -12
- package/dist/shared/loopCorePaths.d.ts.map +1 -1
- package/dist/shared/loopCorePaths.js +1 -0
- package/dist/shared/loopCorePaths.js.map +1 -1
- package/dist/shared/providers/openAiCompatibleProvider.d.ts +7 -1
- package/dist/shared/providers/openAiCompatibleProvider.d.ts.map +1 -1
- package/dist/shared/providers/openAiCompatibleProvider.js +48 -4
- package/dist/shared/providers/openAiCompatibleProvider.js.map +1 -1
- package/package.json +2 -1
|
@@ -291,6 +291,7 @@ export declare const WorkerAuditTaskSchema: z.ZodObject<{
|
|
|
291
291
|
file_paths: string[];
|
|
292
292
|
status?: "complete" | "pending" | undefined;
|
|
293
293
|
completed_at?: string | undefined;
|
|
294
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
294
295
|
file_line_counts?: Record<string, number> | undefined;
|
|
295
296
|
line_ranges?: {
|
|
296
297
|
path: string;
|
|
@@ -298,7 +299,6 @@ export declare const WorkerAuditTaskSchema: z.ZodObject<{
|
|
|
298
299
|
start: number;
|
|
299
300
|
}[] | undefined;
|
|
300
301
|
inputs?: Record<string, string> | undefined;
|
|
301
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
302
302
|
token_estimate?: number | undefined;
|
|
303
303
|
risk_estimate?: number | undefined;
|
|
304
304
|
tags?: string[] | undefined;
|
|
@@ -312,6 +312,7 @@ export declare const WorkerAuditTaskSchema: z.ZodObject<{
|
|
|
312
312
|
file_paths: string[];
|
|
313
313
|
status?: "complete" | "pending" | undefined;
|
|
314
314
|
completed_at?: string | undefined;
|
|
315
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
315
316
|
file_line_counts?: Record<string, number> | undefined;
|
|
316
317
|
line_ranges?: {
|
|
317
318
|
path: string;
|
|
@@ -319,7 +320,6 @@ export declare const WorkerAuditTaskSchema: z.ZodObject<{
|
|
|
319
320
|
start: number;
|
|
320
321
|
}[] | undefined;
|
|
321
322
|
inputs?: Record<string, string> | undefined;
|
|
322
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
323
323
|
token_estimate?: number | undefined;
|
|
324
324
|
risk_estimate?: number | undefined;
|
|
325
325
|
tags?: string[] | undefined;
|
|
@@ -635,6 +635,7 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
|
|
|
635
635
|
file_paths: string[];
|
|
636
636
|
status?: "complete" | "pending" | undefined;
|
|
637
637
|
completed_at?: string | undefined;
|
|
638
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
638
639
|
file_line_counts?: Record<string, number> | undefined;
|
|
639
640
|
line_ranges?: {
|
|
640
641
|
path: string;
|
|
@@ -642,7 +643,6 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
|
|
|
642
643
|
start: number;
|
|
643
644
|
}[] | undefined;
|
|
644
645
|
inputs?: Record<string, string> | undefined;
|
|
645
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
646
646
|
token_estimate?: number | undefined;
|
|
647
647
|
risk_estimate?: number | undefined;
|
|
648
648
|
tags?: string[] | undefined;
|
|
@@ -656,6 +656,7 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
|
|
|
656
656
|
file_paths: string[];
|
|
657
657
|
status?: "complete" | "pending" | undefined;
|
|
658
658
|
completed_at?: string | undefined;
|
|
659
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
659
660
|
file_line_counts?: Record<string, number> | undefined;
|
|
660
661
|
line_ranges?: {
|
|
661
662
|
path: string;
|
|
@@ -663,7 +664,6 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
|
|
|
663
664
|
start: number;
|
|
664
665
|
}[] | undefined;
|
|
665
666
|
inputs?: Record<string, string> | undefined;
|
|
666
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
667
667
|
token_estimate?: number | undefined;
|
|
668
668
|
risk_estimate?: number | undefined;
|
|
669
669
|
tags?: string[] | undefined;
|
|
@@ -684,6 +684,7 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
|
|
|
684
684
|
file_paths: string[];
|
|
685
685
|
status?: "complete" | "pending" | undefined;
|
|
686
686
|
completed_at?: string | undefined;
|
|
687
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
687
688
|
file_line_counts?: Record<string, number> | undefined;
|
|
688
689
|
line_ranges?: {
|
|
689
690
|
path: string;
|
|
@@ -691,7 +692,6 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
|
|
|
691
692
|
start: number;
|
|
692
693
|
}[] | undefined;
|
|
693
694
|
inputs?: Record<string, string> | undefined;
|
|
694
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
695
695
|
token_estimate?: number | undefined;
|
|
696
696
|
risk_estimate?: number | undefined;
|
|
697
697
|
tags?: string[] | undefined;
|
|
@@ -712,6 +712,7 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
|
|
|
712
712
|
file_paths: string[];
|
|
713
713
|
status?: "complete" | "pending" | undefined;
|
|
714
714
|
completed_at?: string | undefined;
|
|
715
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
715
716
|
file_line_counts?: Record<string, number> | undefined;
|
|
716
717
|
line_ranges?: {
|
|
717
718
|
path: string;
|
|
@@ -719,7 +720,6 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
|
|
|
719
720
|
start: number;
|
|
720
721
|
}[] | undefined;
|
|
721
722
|
inputs?: Record<string, string> | undefined;
|
|
722
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
723
723
|
token_estimate?: number | undefined;
|
|
724
724
|
risk_estimate?: number | undefined;
|
|
725
725
|
tags?: string[] | undefined;
|
|
@@ -803,6 +803,7 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
|
|
|
803
803
|
file_paths: string[];
|
|
804
804
|
status?: "complete" | "pending" | undefined;
|
|
805
805
|
completed_at?: string | undefined;
|
|
806
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
806
807
|
file_line_counts?: Record<string, number> | undefined;
|
|
807
808
|
line_ranges?: {
|
|
808
809
|
path: string;
|
|
@@ -810,7 +811,6 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
|
|
|
810
811
|
start: number;
|
|
811
812
|
}[] | undefined;
|
|
812
813
|
inputs?: Record<string, string> | undefined;
|
|
813
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
814
814
|
token_estimate?: number | undefined;
|
|
815
815
|
risk_estimate?: number | undefined;
|
|
816
816
|
tags?: string[] | undefined;
|
|
@@ -905,6 +905,7 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
|
|
|
905
905
|
file_paths: string[];
|
|
906
906
|
status?: "complete" | "pending" | undefined;
|
|
907
907
|
completed_at?: string | undefined;
|
|
908
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
908
909
|
file_line_counts?: Record<string, number> | undefined;
|
|
909
910
|
line_ranges?: {
|
|
910
911
|
path: string;
|
|
@@ -912,7 +913,6 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
|
|
|
912
913
|
start: number;
|
|
913
914
|
}[] | undefined;
|
|
914
915
|
inputs?: Record<string, string> | undefined;
|
|
915
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
916
916
|
token_estimate?: number | undefined;
|
|
917
917
|
risk_estimate?: number | undefined;
|
|
918
918
|
tags?: string[] | undefined;
|
|
@@ -1238,6 +1238,7 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
|
|
|
1238
1238
|
file_paths: string[];
|
|
1239
1239
|
status?: "complete" | "pending" | undefined;
|
|
1240
1240
|
completed_at?: string | undefined;
|
|
1241
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
1241
1242
|
file_line_counts?: Record<string, number> | undefined;
|
|
1242
1243
|
line_ranges?: {
|
|
1243
1244
|
path: string;
|
|
@@ -1245,7 +1246,6 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
|
|
|
1245
1246
|
start: number;
|
|
1246
1247
|
}[] | undefined;
|
|
1247
1248
|
inputs?: Record<string, string> | undefined;
|
|
1248
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
1249
1249
|
token_estimate?: number | undefined;
|
|
1250
1250
|
risk_estimate?: number | undefined;
|
|
1251
1251
|
tags?: string[] | undefined;
|
|
@@ -1259,6 +1259,7 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
|
|
|
1259
1259
|
file_paths: string[];
|
|
1260
1260
|
status?: "complete" | "pending" | undefined;
|
|
1261
1261
|
completed_at?: string | undefined;
|
|
1262
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
1262
1263
|
file_line_counts?: Record<string, number> | undefined;
|
|
1263
1264
|
line_ranges?: {
|
|
1264
1265
|
path: string;
|
|
@@ -1266,7 +1267,6 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
|
|
|
1266
1267
|
start: number;
|
|
1267
1268
|
}[] | undefined;
|
|
1268
1269
|
inputs?: Record<string, string> | undefined;
|
|
1269
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
1270
1270
|
token_estimate?: number | undefined;
|
|
1271
1271
|
risk_estimate?: number | undefined;
|
|
1272
1272
|
tags?: string[] | undefined;
|
|
@@ -1287,6 +1287,7 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
|
|
|
1287
1287
|
file_paths: string[];
|
|
1288
1288
|
status?: "complete" | "pending" | undefined;
|
|
1289
1289
|
completed_at?: string | undefined;
|
|
1290
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
1290
1291
|
file_line_counts?: Record<string, number> | undefined;
|
|
1291
1292
|
line_ranges?: {
|
|
1292
1293
|
path: string;
|
|
@@ -1294,7 +1295,6 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
|
|
|
1294
1295
|
start: number;
|
|
1295
1296
|
}[] | undefined;
|
|
1296
1297
|
inputs?: Record<string, string> | undefined;
|
|
1297
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
1298
1298
|
token_estimate?: number | undefined;
|
|
1299
1299
|
risk_estimate?: number | undefined;
|
|
1300
1300
|
tags?: string[] | undefined;
|
|
@@ -1315,6 +1315,7 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
|
|
|
1315
1315
|
file_paths: string[];
|
|
1316
1316
|
status?: "complete" | "pending" | undefined;
|
|
1317
1317
|
completed_at?: string | undefined;
|
|
1318
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
1318
1319
|
file_line_counts?: Record<string, number> | undefined;
|
|
1319
1320
|
line_ranges?: {
|
|
1320
1321
|
path: string;
|
|
@@ -1322,7 +1323,6 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
|
|
|
1322
1323
|
start: number;
|
|
1323
1324
|
}[] | undefined;
|
|
1324
1325
|
inputs?: Record<string, string> | undefined;
|
|
1325
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
1326
1326
|
token_estimate?: number | undefined;
|
|
1327
1327
|
risk_estimate?: number | undefined;
|
|
1328
1328
|
tags?: string[] | undefined;
|
|
@@ -1406,6 +1406,7 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
|
|
|
1406
1406
|
file_paths: string[];
|
|
1407
1407
|
status?: "complete" | "pending" | undefined;
|
|
1408
1408
|
completed_at?: string | undefined;
|
|
1409
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
1409
1410
|
file_line_counts?: Record<string, number> | undefined;
|
|
1410
1411
|
line_ranges?: {
|
|
1411
1412
|
path: string;
|
|
@@ -1413,7 +1414,6 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
|
|
|
1413
1414
|
start: number;
|
|
1414
1415
|
}[] | undefined;
|
|
1415
1416
|
inputs?: Record<string, string> | undefined;
|
|
1416
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
1417
1417
|
token_estimate?: number | undefined;
|
|
1418
1418
|
risk_estimate?: number | undefined;
|
|
1419
1419
|
tags?: string[] | undefined;
|
|
@@ -1508,6 +1508,7 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
|
|
|
1508
1508
|
file_paths: string[];
|
|
1509
1509
|
status?: "complete" | "pending" | undefined;
|
|
1510
1510
|
completed_at?: string | undefined;
|
|
1511
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
1511
1512
|
file_line_counts?: Record<string, number> | undefined;
|
|
1512
1513
|
line_ranges?: {
|
|
1513
1514
|
path: string;
|
|
@@ -1515,7 +1516,6 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
|
|
|
1515
1516
|
start: number;
|
|
1516
1517
|
}[] | undefined;
|
|
1517
1518
|
inputs?: Record<string, string> | undefined;
|
|
1518
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
1519
1519
|
token_estimate?: number | undefined;
|
|
1520
1520
|
risk_estimate?: number | undefined;
|
|
1521
1521
|
tags?: string[] | undefined;
|
|
@@ -15,6 +15,7 @@ export declare function buildRequeuePayload(matrix: CoverageMatrix, criticalFlow
|
|
|
15
15
|
file_paths: string[];
|
|
16
16
|
status?: "complete" | "pending" | undefined;
|
|
17
17
|
completed_at?: string | undefined;
|
|
18
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
18
19
|
file_line_counts?: Record<string, number> | undefined;
|
|
19
20
|
line_ranges?: {
|
|
20
21
|
path: string;
|
|
@@ -22,7 +23,6 @@ export declare function buildRequeuePayload(matrix: CoverageMatrix, criticalFlow
|
|
|
22
23
|
start: number;
|
|
23
24
|
}[] | undefined;
|
|
24
25
|
inputs?: Record<string, string> | undefined;
|
|
25
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
26
26
|
token_estimate?: number | undefined;
|
|
27
27
|
risk_estimate?: number | undefined;
|
|
28
28
|
tags?: string[] | undefined;
|
|
@@ -128,11 +128,11 @@ export declare const ReviewPacketSchema: z.ZodObject<{
|
|
|
128
128
|
lenses: string[];
|
|
129
129
|
unit_ids: string[];
|
|
130
130
|
rationale: string;
|
|
131
|
+
priority: "high" | "low" | "medium";
|
|
131
132
|
packet_id: string;
|
|
132
133
|
task_ids: string[];
|
|
133
134
|
file_paths: string[];
|
|
134
135
|
file_line_counts: Record<string, number>;
|
|
135
|
-
priority: "high" | "low" | "medium";
|
|
136
136
|
total_lines: number;
|
|
137
137
|
pass_ids: string[];
|
|
138
138
|
quality: {
|
|
@@ -157,11 +157,11 @@ export declare const ReviewPacketSchema: z.ZodObject<{
|
|
|
157
157
|
lenses: string[];
|
|
158
158
|
unit_ids: string[];
|
|
159
159
|
rationale: string;
|
|
160
|
+
priority: "high" | "low" | "medium";
|
|
160
161
|
packet_id: string;
|
|
161
162
|
task_ids: string[];
|
|
162
163
|
file_paths: string[];
|
|
163
164
|
file_line_counts: Record<string, number>;
|
|
164
|
-
priority: "high" | "low" | "medium";
|
|
165
165
|
total_lines: number;
|
|
166
166
|
pass_ids: string[];
|
|
167
167
|
quality: {
|
package/dist/audit/types.d.ts
CHANGED
|
@@ -319,6 +319,7 @@ export declare const AuditTaskSchema: z.ZodObject<{
|
|
|
319
319
|
file_paths: string[];
|
|
320
320
|
status?: "complete" | "pending" | undefined;
|
|
321
321
|
completed_at?: string | undefined;
|
|
322
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
322
323
|
file_line_counts?: Record<string, number> | undefined;
|
|
323
324
|
line_ranges?: {
|
|
324
325
|
path: string;
|
|
@@ -326,7 +327,6 @@ export declare const AuditTaskSchema: z.ZodObject<{
|
|
|
326
327
|
start: number;
|
|
327
328
|
}[] | undefined;
|
|
328
329
|
inputs?: Record<string, string> | undefined;
|
|
329
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
330
330
|
token_estimate?: number | undefined;
|
|
331
331
|
risk_estimate?: number | undefined;
|
|
332
332
|
tags?: string[] | undefined;
|
|
@@ -340,6 +340,7 @@ export declare const AuditTaskSchema: z.ZodObject<{
|
|
|
340
340
|
file_paths: string[];
|
|
341
341
|
status?: "complete" | "pending" | undefined;
|
|
342
342
|
completed_at?: string | undefined;
|
|
343
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
343
344
|
file_line_counts?: Record<string, number> | undefined;
|
|
344
345
|
line_ranges?: {
|
|
345
346
|
path: string;
|
|
@@ -347,7 +348,6 @@ export declare const AuditTaskSchema: z.ZodObject<{
|
|
|
347
348
|
start: number;
|
|
348
349
|
}[] | undefined;
|
|
349
350
|
inputs?: Record<string, string> | undefined;
|
|
350
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
351
351
|
token_estimate?: number | undefined;
|
|
352
352
|
risk_estimate?: number | undefined;
|
|
353
353
|
tags?: string[] | undefined;
|
|
@@ -412,6 +412,7 @@ export declare const AuditVerificationSchema: z.ZodObject<{
|
|
|
412
412
|
file_paths: string[];
|
|
413
413
|
status?: "complete" | "pending" | undefined;
|
|
414
414
|
completed_at?: string | undefined;
|
|
415
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
415
416
|
file_line_counts?: Record<string, number> | undefined;
|
|
416
417
|
line_ranges?: {
|
|
417
418
|
path: string;
|
|
@@ -419,7 +420,6 @@ export declare const AuditVerificationSchema: z.ZodObject<{
|
|
|
419
420
|
start: number;
|
|
420
421
|
}[] | undefined;
|
|
421
422
|
inputs?: Record<string, string> | undefined;
|
|
422
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
423
423
|
token_estimate?: number | undefined;
|
|
424
424
|
risk_estimate?: number | undefined;
|
|
425
425
|
tags?: string[] | undefined;
|
|
@@ -433,6 +433,7 @@ export declare const AuditVerificationSchema: z.ZodObject<{
|
|
|
433
433
|
file_paths: string[];
|
|
434
434
|
status?: "complete" | "pending" | undefined;
|
|
435
435
|
completed_at?: string | undefined;
|
|
436
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
436
437
|
file_line_counts?: Record<string, number> | undefined;
|
|
437
438
|
line_ranges?: {
|
|
438
439
|
path: string;
|
|
@@ -440,7 +441,6 @@ export declare const AuditVerificationSchema: z.ZodObject<{
|
|
|
440
441
|
start: number;
|
|
441
442
|
}[] | undefined;
|
|
442
443
|
inputs?: Record<string, string> | undefined;
|
|
443
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
444
444
|
token_estimate?: number | undefined;
|
|
445
445
|
risk_estimate?: number | undefined;
|
|
446
446
|
tags?: string[] | undefined;
|
|
@@ -461,6 +461,7 @@ export declare const AuditVerificationSchema: z.ZodObject<{
|
|
|
461
461
|
file_paths: string[];
|
|
462
462
|
status?: "complete" | "pending" | undefined;
|
|
463
463
|
completed_at?: string | undefined;
|
|
464
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
464
465
|
file_line_counts?: Record<string, number> | undefined;
|
|
465
466
|
line_ranges?: {
|
|
466
467
|
path: string;
|
|
@@ -468,7 +469,6 @@ export declare const AuditVerificationSchema: z.ZodObject<{
|
|
|
468
469
|
start: number;
|
|
469
470
|
}[] | undefined;
|
|
470
471
|
inputs?: Record<string, string> | undefined;
|
|
471
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
472
472
|
token_estimate?: number | undefined;
|
|
473
473
|
risk_estimate?: number | undefined;
|
|
474
474
|
tags?: string[] | undefined;
|
|
@@ -489,6 +489,7 @@ export declare const AuditVerificationSchema: z.ZodObject<{
|
|
|
489
489
|
file_paths: string[];
|
|
490
490
|
status?: "complete" | "pending" | undefined;
|
|
491
491
|
completed_at?: string | undefined;
|
|
492
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
492
493
|
file_line_counts?: Record<string, number> | undefined;
|
|
493
494
|
line_ranges?: {
|
|
494
495
|
path: string;
|
|
@@ -496,7 +497,6 @@ export declare const AuditVerificationSchema: z.ZodObject<{
|
|
|
496
497
|
start: number;
|
|
497
498
|
}[] | undefined;
|
|
498
499
|
inputs?: Record<string, string> | undefined;
|
|
499
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
500
500
|
token_estimate?: number | undefined;
|
|
501
501
|
risk_estimate?: number | undefined;
|
|
502
502
|
tags?: string[] | undefined;
|
|
@@ -792,6 +792,7 @@ export declare const AuditResultSchema: z.ZodObject<{
|
|
|
792
792
|
file_paths: string[];
|
|
793
793
|
status?: "complete" | "pending" | undefined;
|
|
794
794
|
completed_at?: string | undefined;
|
|
795
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
795
796
|
file_line_counts?: Record<string, number> | undefined;
|
|
796
797
|
line_ranges?: {
|
|
797
798
|
path: string;
|
|
@@ -799,7 +800,6 @@ export declare const AuditResultSchema: z.ZodObject<{
|
|
|
799
800
|
start: number;
|
|
800
801
|
}[] | undefined;
|
|
801
802
|
inputs?: Record<string, string> | undefined;
|
|
802
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
803
803
|
token_estimate?: number | undefined;
|
|
804
804
|
risk_estimate?: number | undefined;
|
|
805
805
|
tags?: string[] | undefined;
|
|
@@ -813,6 +813,7 @@ export declare const AuditResultSchema: z.ZodObject<{
|
|
|
813
813
|
file_paths: string[];
|
|
814
814
|
status?: "complete" | "pending" | undefined;
|
|
815
815
|
completed_at?: string | undefined;
|
|
816
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
816
817
|
file_line_counts?: Record<string, number> | undefined;
|
|
817
818
|
line_ranges?: {
|
|
818
819
|
path: string;
|
|
@@ -820,7 +821,6 @@ export declare const AuditResultSchema: z.ZodObject<{
|
|
|
820
821
|
start: number;
|
|
821
822
|
}[] | undefined;
|
|
822
823
|
inputs?: Record<string, string> | undefined;
|
|
823
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
824
824
|
token_estimate?: number | undefined;
|
|
825
825
|
risk_estimate?: number | undefined;
|
|
826
826
|
tags?: string[] | undefined;
|
|
@@ -841,6 +841,7 @@ export declare const AuditResultSchema: z.ZodObject<{
|
|
|
841
841
|
file_paths: string[];
|
|
842
842
|
status?: "complete" | "pending" | undefined;
|
|
843
843
|
completed_at?: string | undefined;
|
|
844
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
844
845
|
file_line_counts?: Record<string, number> | undefined;
|
|
845
846
|
line_ranges?: {
|
|
846
847
|
path: string;
|
|
@@ -848,7 +849,6 @@ export declare const AuditResultSchema: z.ZodObject<{
|
|
|
848
849
|
start: number;
|
|
849
850
|
}[] | undefined;
|
|
850
851
|
inputs?: Record<string, string> | undefined;
|
|
851
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
852
852
|
token_estimate?: number | undefined;
|
|
853
853
|
risk_estimate?: number | undefined;
|
|
854
854
|
tags?: string[] | undefined;
|
|
@@ -869,6 +869,7 @@ export declare const AuditResultSchema: z.ZodObject<{
|
|
|
869
869
|
file_paths: string[];
|
|
870
870
|
status?: "complete" | "pending" | undefined;
|
|
871
871
|
completed_at?: string | undefined;
|
|
872
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
872
873
|
file_line_counts?: Record<string, number> | undefined;
|
|
873
874
|
line_ranges?: {
|
|
874
875
|
path: string;
|
|
@@ -876,7 +877,6 @@ export declare const AuditResultSchema: z.ZodObject<{
|
|
|
876
877
|
start: number;
|
|
877
878
|
}[] | undefined;
|
|
878
879
|
inputs?: Record<string, string> | undefined;
|
|
879
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
880
880
|
token_estimate?: number | undefined;
|
|
881
881
|
risk_estimate?: number | undefined;
|
|
882
882
|
tags?: string[] | undefined;
|
|
@@ -988,6 +988,7 @@ export declare const AuditResultSchema: z.ZodObject<{
|
|
|
988
988
|
file_paths: string[];
|
|
989
989
|
status?: "complete" | "pending" | undefined;
|
|
990
990
|
completed_at?: string | undefined;
|
|
991
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
991
992
|
file_line_counts?: Record<string, number> | undefined;
|
|
992
993
|
line_ranges?: {
|
|
993
994
|
path: string;
|
|
@@ -995,7 +996,6 @@ export declare const AuditResultSchema: z.ZodObject<{
|
|
|
995
996
|
start: number;
|
|
996
997
|
}[] | undefined;
|
|
997
998
|
inputs?: Record<string, string> | undefined;
|
|
998
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
999
999
|
token_estimate?: number | undefined;
|
|
1000
1000
|
risk_estimate?: number | undefined;
|
|
1001
1001
|
tags?: string[] | undefined;
|
|
@@ -1090,6 +1090,7 @@ export declare const AuditResultSchema: z.ZodObject<{
|
|
|
1090
1090
|
file_paths: string[];
|
|
1091
1091
|
status?: "complete" | "pending" | undefined;
|
|
1092
1092
|
completed_at?: string | undefined;
|
|
1093
|
+
priority?: "high" | "low" | "medium" | undefined;
|
|
1093
1094
|
file_line_counts?: Record<string, number> | undefined;
|
|
1094
1095
|
line_ranges?: {
|
|
1095
1096
|
path: string;
|
|
@@ -1097,7 +1098,6 @@ export declare const AuditResultSchema: z.ZodObject<{
|
|
|
1097
1098
|
start: number;
|
|
1098
1099
|
}[] | undefined;
|
|
1099
1100
|
inputs?: Record<string, string> | undefined;
|
|
1100
|
-
priority?: "high" | "low" | "medium" | undefined;
|
|
1101
1101
|
token_estimate?: number | undefined;
|
|
1102
1102
|
risk_estimate?: number | undefined;
|
|
1103
1103
|
tags?: string[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loopCorePaths.d.ts","sourceRoot":"","sources":["../../src/shared/loopCorePaths.ts"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"loopCorePaths.d.ts","sourceRoot":"","sources":["../../src/shared/loopCorePaths.ts"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAsB/C,CAAC;AAOF;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAUpD"}
|
|
@@ -30,6 +30,7 @@ export const LOOP_CORE_PATTERNS = [
|
|
|
30
30
|
// • shared dispatch / admission / rolling / quota / engine substrate
|
|
31
31
|
"src/audit/cli/dispatch.ts",
|
|
32
32
|
"src/audit/cli/dispatch/",
|
|
33
|
+
"src/audit/cli/dispatchAttempted.ts",
|
|
33
34
|
"src/audit/cli/mergeAndIngestCommand.ts",
|
|
34
35
|
"src/audit/cli/ownerTokens.ts",
|
|
35
36
|
"src/audit/cli/rollingAuditDispatch.ts",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loopCorePaths.js","sourceRoot":"","sources":["../../src/shared/loopCorePaths.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,+EAA+E;AAC/E,gFAAgF;AAChF,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,mBAAmB;AACnB,EAAE;AACF,4EAA4E;AAC5E,2EAA2E;AAC3E,kFAAkF;AAClF,kFAAkF;AAClF,iDAAiD;AACjD,EAAE;AACF,kFAAkF;AAClF,iFAAiF;AACjF,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,8EAA8E;IAC9E,uEAAuE;IACvE,6DAA6D;IAC7D,yEAAyE;IACzE,uEAAuE;IACvE,2BAA2B;IAC3B,yBAAyB;IACzB,wCAAwC;IACxC,8BAA8B;IAC9B,uCAAuC;IACvC,yBAAyB;IACzB,6BAA6B;IAC7B,yCAAyC;IACzC,+BAA+B;IAC/B,iCAAiC;IACjC,uCAAuC;IACvC,sBAAsB;IACtB,oBAAoB;IACpB,mBAAmB;IACnB,qBAAqB;CACtB,CAAC;AAEF,0EAA0E;AAC1E,SAAS,oBAAoB,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,MAAM,CAAC,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IACrC,KAAK,MAAM,OAAO,IAAI,kBAAkB,EAAE,CAAC;QACzC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC;gBAAE,OAAO,IAAI,CAAC;QACzC,CAAC;aAAM,IAAI,CAAC,KAAK,OAAO,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
1
|
+
{"version":3,"file":"loopCorePaths.js","sourceRoot":"","sources":["../../src/shared/loopCorePaths.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,+EAA+E;AAC/E,gFAAgF;AAChF,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,mBAAmB;AACnB,EAAE;AACF,4EAA4E;AAC5E,2EAA2E;AAC3E,kFAAkF;AAClF,kFAAkF;AAClF,iDAAiD;AACjD,EAAE;AACF,kFAAkF;AAClF,iFAAiF;AACjF,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,8EAA8E;IAC9E,uEAAuE;IACvE,6DAA6D;IAC7D,yEAAyE;IACzE,uEAAuE;IACvE,2BAA2B;IAC3B,yBAAyB;IACzB,oCAAoC;IACpC,wCAAwC;IACxC,8BAA8B;IAC9B,uCAAuC;IACvC,yBAAyB;IACzB,6BAA6B;IAC7B,yCAAyC;IACzC,+BAA+B;IAC/B,iCAAiC;IACjC,uCAAuC;IACvC,sBAAsB;IACtB,oBAAoB;IACpB,mBAAmB;IACnB,qBAAqB;CACtB,CAAC;AAEF,0EAA0E;AAC1E,SAAS,oBAAoB,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,MAAM,CAAC,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IACrC,KAAK,MAAM,OAAO,IAAI,kBAAkB,EAAE,CAAC;QACzC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC;gBAAE,OAAO,IAAI,CAAC;QACzC,CAAC;aAAM,IAAI,CAAC,KAAK,OAAO,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -3,7 +3,12 @@ import type { OpenAiCompatibleConfig } from "../types/sessionConfig.js";
|
|
|
3
3
|
export declare const OPENAI_COMPATIBLE_PROVIDER_NAME: "openai-compatible";
|
|
4
4
|
type FetchFn = typeof fetch;
|
|
5
5
|
export interface OpenAiCompatibleProviderDeps {
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Injectable fetch for tests. When absent, each launch builds its own
|
|
8
|
+
* transport bound to that launch's declared `timeoutMs`
|
|
9
|
+
* (see {@link deadlineBoundFetch}) — the global fetch is NOT used, because its
|
|
10
|
+
* default headers timeout silently overrides the declared deadline.
|
|
11
|
+
*/
|
|
7
12
|
fetchFn?: FetchFn;
|
|
8
13
|
/** Injectable env for key resolution; defaults to process.env. */
|
|
9
14
|
env?: NodeJS.ProcessEnv;
|
|
@@ -43,6 +48,7 @@ export interface OpenAiCompatibleProviderDeps {
|
|
|
43
48
|
export declare class OpenAiCompatibleProvider implements FreshSessionProvider {
|
|
44
49
|
name: "openai-compatible";
|
|
45
50
|
private readonly config;
|
|
51
|
+
/** Test-injected transport; null ⇒ build a deadline-bound one per launch. */
|
|
46
52
|
private readonly fetchFn;
|
|
47
53
|
private readonly env;
|
|
48
54
|
private readonly retryBackoffMs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openAiCompatibleProvider.d.ts","sourceRoot":"","sources":["../../../src/shared/providers/openAiCompatibleProvider.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAIxE,eAAO,MAAM,+BAA+B,EAAG,mBAA4B,CAAC;AA4C5E,KAAK,OAAO,GAAG,OAAO,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"openAiCompatibleProvider.d.ts","sourceRoot":"","sources":["../../../src/shared/providers/openAiCompatibleProvider.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAIxE,eAAO,MAAM,+BAA+B,EAAG,mBAA4B,CAAC;AA4C5E,KAAK,OAAO,GAAG,OAAO,KAAK,CAAC;AAsC5B,MAAM,WAAW,4BAA4B;IAC3C;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kEAAkE;IAClE,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AASD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,wBAAyB,YAAW,oBAAoB;IACnE,IAAI,sBAAmC;IACvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyB;IAChD,6EAA6E;IAC7E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IACzC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAoB;IACxC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;gBAGtC,MAAM,GAAE,sBAA2B,EACnC,IAAI,GAAE,4BAAiC;IAQnC,MAAM,CACV,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,wBAAwB,CAAC;IA2VpC;;;;;;;;;;;;;;;;;;;;;OAqBG;YACW,qBAAqB;YAmHrB,YAAY;YAQZ,YAAY;CAO3B;AAuCD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAClD,GAAG,MAAM,GAAG,SAAS,CAYrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,KAAK,CAAC,EAAE;QACN,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,qBAAqB,CAAC,EAAE;YAAE,aAAa,CAAC,EAAE,OAAO,CAAA;SAAE,CAAC;QACpD,uBAAuB,CAAC,EAAE,OAAO,CAAC;QAClC,2BAA2B,CAAC,EAAE,OAAO,CAAC;KACvC,CAAC;CACH,GAAG;IACF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,GAAG,SAAS,CA6BZ;AAqED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAuBpD"}
|
|
@@ -20,6 +20,39 @@ const DEFAULT_MAX_OUTPUT_TOKENS = 8192;
|
|
|
20
20
|
* result still lands via the `result` channel / resultPath.
|
|
21
21
|
*/
|
|
22
22
|
const CONTROL_PLANE_DIR = AUDIT_TOOLS_DIRNAME;
|
|
23
|
+
// Undici is Node's own fetch implementation; imported explicitly so the request
|
|
24
|
+
// can carry a dispatcher whose header/body timeouts follow the DECLARED deadline
|
|
25
|
+
// (the global fetch hardcodes ~5 min and cannot be told otherwise).
|
|
26
|
+
import { Agent, fetch as undiciFetch } from "undici";
|
|
27
|
+
/**
|
|
28
|
+
* A fetch bound to `timeoutMs` at the TRANSPORT layer, not just via AbortController.
|
|
29
|
+
*
|
|
30
|
+
* The launch already wraps the request in an AbortController set to the declared
|
|
31
|
+
* `input.timeoutMs` (30 min on the audit path), but `globalThis.fetch` rides
|
|
32
|
+
* undici's default `headersTimeout` of ~5 minutes — measured to the FIRST byte.
|
|
33
|
+
* A big model reasoning over a large packet with `stream:false` regularly exceeds
|
|
34
|
+
* that before it emits anything, so the request died `UND_ERR_HEADERS_TIMEOUT`,
|
|
35
|
+
* was classified transient, retried, and died the same way each attempt: the lane
|
|
36
|
+
* read DEAD at ~15 minutes despite a 30-minute declared budget, and the failure
|
|
37
|
+
* looked like a sick endpoint rather than a timeout we imposed on ourselves.
|
|
38
|
+
* (Same root cause, same fix, as the offload helper's `UND_ERR_HEADERS_TIMEOUT`
|
|
39
|
+
* storm — there the caller's transport was blamed on model health for weeks.)
|
|
40
|
+
*
|
|
41
|
+
* Aligning `headersTimeout`/`bodyTimeout` with the declared deadline leaves
|
|
42
|
+
* exactly ONE timeout in play: the one the caller asked for.
|
|
43
|
+
*
|
|
44
|
+
* Undici is imported rather than hand-rolling a `node:http` transport — it IS
|
|
45
|
+
* Node's fetch implementation, pure JS (no native build, so OS-agnostic), and
|
|
46
|
+
* HTTP transport is correctness-sensitive enough to acquire rather than own.
|
|
47
|
+
*/
|
|
48
|
+
function deadlineBoundFetch(timeoutMs) {
|
|
49
|
+
const agent = new Agent({ headersTimeout: timeoutMs, bodyTimeout: timeoutMs });
|
|
50
|
+
const fetchFn = ((input, init) => undiciFetch(input, {
|
|
51
|
+
...init,
|
|
52
|
+
dispatcher: agent,
|
|
53
|
+
}));
|
|
54
|
+
return { fetchFn, dispose: () => agent.close() };
|
|
55
|
+
}
|
|
23
56
|
/** HTTP statuses treated as transient (retried with backoff): rate-limit + 5xx/CDN. */
|
|
24
57
|
const TRANSIENT_STATUSES = new Set([429, 500, 502, 503, 504, 524]);
|
|
25
58
|
/** Total request attempts on a transient failure (1 initial + retries). */
|
|
@@ -54,12 +87,13 @@ const DEFAULT_RETRY_BACKOFF_MS = 500;
|
|
|
54
87
|
export class OpenAiCompatibleProvider {
|
|
55
88
|
name = OPENAI_COMPATIBLE_PROVIDER_NAME;
|
|
56
89
|
config;
|
|
90
|
+
/** Test-injected transport; null ⇒ build a deadline-bound one per launch. */
|
|
57
91
|
fetchFn;
|
|
58
92
|
env;
|
|
59
93
|
retryBackoffMs;
|
|
60
94
|
constructor(config = {}, deps = {}) {
|
|
61
95
|
this.config = config;
|
|
62
|
-
this.fetchFn = deps.fetchFn ??
|
|
96
|
+
this.fetchFn = deps.fetchFn ?? null;
|
|
63
97
|
this.env = deps.env ?? process.env;
|
|
64
98
|
this.retryBackoffMs = positiveOr(deps.retryBackoffMs, DEFAULT_RETRY_BACKOFF_MS);
|
|
65
99
|
}
|
|
@@ -82,8 +116,8 @@ export class OpenAiCompatibleProvider {
|
|
|
82
116
|
if (!apiKey) {
|
|
83
117
|
return fail(`openai-compatible provider has no API key — set openai_compatible.api_key_env to a populated env var (e.g. NVIDIA_API_KEY)${this.config.api_key_env ? ` (env "${this.config.api_key_env}" is empty)` : ""}.`);
|
|
84
118
|
}
|
|
85
|
-
if (typeof this.fetchFn !== "function") {
|
|
86
|
-
return fail("openai-compatible provider:
|
|
119
|
+
if (this.fetchFn !== null && typeof this.fetchFn !== "function") {
|
|
120
|
+
return fail("openai-compatible provider: injected fetchFn is not callable.");
|
|
87
121
|
}
|
|
88
122
|
let messages;
|
|
89
123
|
let referenced;
|
|
@@ -118,6 +152,13 @@ export class OpenAiCompatibleProvider {
|
|
|
118
152
|
}
|
|
119
153
|
const controller = new AbortController();
|
|
120
154
|
const timer = setTimeout(() => controller.abort(), input.timeoutMs);
|
|
155
|
+
// Transport bound to the SAME deadline as the abort above, so the declared
|
|
156
|
+
// timeout is the only one that can fire (see `deadlineBoundFetch`). An
|
|
157
|
+
// injected fetch is used verbatim — a test fake carries no transport timeout.
|
|
158
|
+
const transport = this.fetchFn !== null
|
|
159
|
+
? { fetchFn: this.fetchFn, dispose: async () => { } }
|
|
160
|
+
: deadlineBoundFetch(input.timeoutMs);
|
|
161
|
+
const doFetch = transport.fetchFn;
|
|
121
162
|
// Emit-time constraint ladder (strongest → weakest), each degrading to the next
|
|
122
163
|
// on an endpoint rejection (HTTP 400/422) so leaving the levers on is safe for
|
|
123
164
|
// ANY endpoint:
|
|
@@ -179,7 +220,7 @@ export class OpenAiCompatibleProvider {
|
|
|
179
220
|
}
|
|
180
221
|
return JSON.stringify(body);
|
|
181
222
|
};
|
|
182
|
-
const post = (mode) =>
|
|
223
|
+
const post = (mode) => doFetch(`${baseUrl}/chat/completions`, {
|
|
183
224
|
method: "POST",
|
|
184
225
|
headers,
|
|
185
226
|
body: buildBody(mode),
|
|
@@ -257,6 +298,9 @@ export class OpenAiCompatibleProvider {
|
|
|
257
298
|
}
|
|
258
299
|
finally {
|
|
259
300
|
clearTimeout(timer);
|
|
301
|
+
// Release the per-launch connection pool. Best-effort: a transport we could
|
|
302
|
+
// not close must never turn a completed launch into a failure.
|
|
303
|
+
await transport.dispose().catch(() => { });
|
|
260
304
|
}
|
|
261
305
|
// Persist the raw completion for run-correlated observability (parallels the
|
|
262
306
|
// spawn providers' stdout log).
|