ccqa 1.8.3 → 1.10.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/README.md +226 -68
- package/dist/bin/ccqa.mjs +6529 -3655
- package/dist/hub-client/index.d.mts +248 -35
- package/dist/hub-client/index.mjs +25 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -39,11 +39,19 @@ declare const RunSchema: z.ZodObject<{
|
|
|
39
39
|
drift: "drift";
|
|
40
40
|
}>>;
|
|
41
41
|
drift: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
specs: z.ZodNumber;
|
|
43
|
+
testDrift: z.ZodNumber;
|
|
44
|
+
specChange: z.ZodNumber;
|
|
45
|
+
unknown: z.ZodNumber;
|
|
46
46
|
}, z.core.$strip>>>;
|
|
47
|
+
gradedDrift: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
specs: z.ZodNumber;
|
|
49
|
+
testDrift: z.ZodNumber;
|
|
50
|
+
specChange: z.ZodNumber;
|
|
51
|
+
unknown: z.ZodNumber;
|
|
52
|
+
noDrift: z.ZodNumber;
|
|
53
|
+
graded: z.ZodNumber;
|
|
54
|
+
}, z.core.$strip>>;
|
|
47
55
|
specs: z.ZodObject<{
|
|
48
56
|
total: z.ZodNumber;
|
|
49
57
|
passed: z.ZodNumber;
|
|
@@ -55,6 +63,12 @@ declare const RunSchema: z.ZodObject<{
|
|
|
55
63
|
runUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
64
|
reportCreatedAt: z.ZodString;
|
|
57
65
|
createdAt: z.ZodString;
|
|
66
|
+
deployedSha: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
|
+
deployedShaSource: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
68
|
+
"hub-deploy-log": "hub-deploy-log";
|
|
69
|
+
client: "client";
|
|
70
|
+
}>>>;
|
|
71
|
+
deployedShaAmbiguous: z.ZodOptional<z.ZodBoolean>;
|
|
58
72
|
}, z.core.$strip>;
|
|
59
73
|
type Run = z.infer<typeof RunSchema>;
|
|
60
74
|
/**
|
|
@@ -82,6 +96,7 @@ declare const TriageCaseSchema: z.ZodObject<{
|
|
|
82
96
|
TEST_DRIFT: "TEST_DRIFT";
|
|
83
97
|
SPEC_CHANGE: "SPEC_CHANGE";
|
|
84
98
|
PRODUCT_BUG: "PRODUCT_BUG";
|
|
99
|
+
NO_DRIFT: "NO_DRIFT";
|
|
85
100
|
}>;
|
|
86
101
|
note: z.ZodOptional<z.ZodString>;
|
|
87
102
|
recordedAt: z.ZodString;
|
|
@@ -111,6 +126,7 @@ declare const RunTriageSchema: z.ZodObject<{
|
|
|
111
126
|
TEST_DRIFT: "TEST_DRIFT";
|
|
112
127
|
SPEC_CHANGE: "SPEC_CHANGE";
|
|
113
128
|
PRODUCT_BUG: "PRODUCT_BUG";
|
|
129
|
+
NO_DRIFT: "NO_DRIFT";
|
|
114
130
|
}>;
|
|
115
131
|
note: z.ZodOptional<z.ZodString>;
|
|
116
132
|
recordedAt: z.ZodString;
|
|
@@ -125,6 +141,7 @@ declare const PutActualCauseRequestSchema: z.ZodObject<{
|
|
|
125
141
|
TEST_DRIFT: "TEST_DRIFT";
|
|
126
142
|
SPEC_CHANGE: "SPEC_CHANGE";
|
|
127
143
|
PRODUCT_BUG: "PRODUCT_BUG";
|
|
144
|
+
NO_DRIFT: "NO_DRIFT";
|
|
128
145
|
}>;
|
|
129
146
|
note: z.ZodOptional<z.ZodString>;
|
|
130
147
|
}, z.core.$strip>;
|
|
@@ -143,6 +160,133 @@ declare const LastGreenEntrySchema: z.ZodObject<{
|
|
|
143
160
|
at: z.ZodString;
|
|
144
161
|
}, z.core.$strip>;
|
|
145
162
|
type LastGreenEntry = z.infer<typeof LastGreenEntrySchema>;
|
|
163
|
+
/** One deploy, as the consumer's deploy job reported it (ADR-0010). */
|
|
164
|
+
declare const DeployEntrySchema: z.ZodObject<{
|
|
165
|
+
index: z.ZodNumber;
|
|
166
|
+
sha: z.ZodString;
|
|
167
|
+
previousSha: z.ZodNullable<z.ZodString>;
|
|
168
|
+
at: z.ZodString;
|
|
169
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
170
|
+
runUrl: z.ZodOptional<z.ZodString>;
|
|
171
|
+
changedPaths: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
172
|
+
hasSelection: z.ZodDefault<z.ZodBoolean>;
|
|
173
|
+
gapBefore: z.ZodDefault<z.ZodBoolean>;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
type DeployEntry = z.infer<typeof DeployEntrySchema>;
|
|
176
|
+
/** Body of `GET /projects/:project/rerun?profile=`: one verdict per spec in the perspectives document. */
|
|
177
|
+
declare const RerunReportSchema: z.ZodObject<{
|
|
178
|
+
project: z.ZodString;
|
|
179
|
+
profile: z.ZodString;
|
|
180
|
+
deployHead: z.ZodNullable<z.ZodObject<{
|
|
181
|
+
index: z.ZodNumber;
|
|
182
|
+
sha: z.ZodString;
|
|
183
|
+
at: z.ZodString;
|
|
184
|
+
}, z.core.$strip>>;
|
|
185
|
+
specs: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
186
|
+
state: z.ZodEnum<{
|
|
187
|
+
unknown: "unknown";
|
|
188
|
+
needed: "needed";
|
|
189
|
+
notNeeded: "notNeeded";
|
|
190
|
+
neverRun: "neverRun";
|
|
191
|
+
notEvaluated: "notEvaluated";
|
|
192
|
+
}>;
|
|
193
|
+
reason: z.ZodOptional<z.ZodEnum<{
|
|
194
|
+
noSelectionInRange: "noSelectionInRange";
|
|
195
|
+
selectionUnknown: "selectionUnknown";
|
|
196
|
+
noDeployLog: "noDeployLog";
|
|
197
|
+
unknownDeployedSha: "unknownDeployedSha";
|
|
198
|
+
ambiguousDeployedSha: "ambiguousDeployedSha";
|
|
199
|
+
deployedShaNotInLog: "deployedShaNotInLog";
|
|
200
|
+
gapInRange: "gapInRange";
|
|
201
|
+
}>>;
|
|
202
|
+
lastRun: z.ZodNullable<z.ZodObject<{
|
|
203
|
+
gitHead: z.ZodString;
|
|
204
|
+
runId: z.ZodString;
|
|
205
|
+
at: z.ZodString;
|
|
206
|
+
deployedSha: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
207
|
+
deployedShaAmbiguous: z.ZodOptional<z.ZodBoolean>;
|
|
208
|
+
}, z.core.$strip>>;
|
|
209
|
+
lastGreen: z.ZodNullable<z.ZodObject<{
|
|
210
|
+
gitHead: z.ZodString;
|
|
211
|
+
runId: z.ZodString;
|
|
212
|
+
at: z.ZodString;
|
|
213
|
+
deployedSha: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
214
|
+
deployedShaAmbiguous: z.ZodOptional<z.ZodBoolean>;
|
|
215
|
+
}, z.core.$strip>>;
|
|
216
|
+
lastRed: z.ZodNullable<z.ZodObject<{
|
|
217
|
+
gitHead: z.ZodString;
|
|
218
|
+
runId: z.ZodString;
|
|
219
|
+
at: z.ZodString;
|
|
220
|
+
deployedSha: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
221
|
+
deployedShaAmbiguous: z.ZodOptional<z.ZodBoolean>;
|
|
222
|
+
}, z.core.$strip>>;
|
|
223
|
+
touchedBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
224
|
+
touchedByDeploy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
225
|
+
index: z.ZodNumber;
|
|
226
|
+
sha: z.ZodString;
|
|
227
|
+
at: z.ZodString;
|
|
228
|
+
}, z.core.$strip>>>;
|
|
229
|
+
}, z.core.$strip>>;
|
|
230
|
+
}, z.core.$strip>;
|
|
231
|
+
type RerunReport = z.infer<typeof RerunReportSchema>;
|
|
232
|
+
/** Body of `POST /projects/:project/deploys?profile=` — what the deploy job shipped. */
|
|
233
|
+
declare const RecordDeployRequestSchema: z.ZodObject<{
|
|
234
|
+
sha: z.ZodString;
|
|
235
|
+
previousSha: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
236
|
+
changedPaths: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
237
|
+
selection: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
238
|
+
verdict: z.ZodEnum<{
|
|
239
|
+
unknown: "unknown";
|
|
240
|
+
needed: "needed";
|
|
241
|
+
notNeeded: "notNeeded";
|
|
242
|
+
}>;
|
|
243
|
+
reason: z.ZodString;
|
|
244
|
+
touchedBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
245
|
+
}, z.core.$strip>>>;
|
|
246
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
247
|
+
runUrl: z.ZodOptional<z.ZodString>;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
type RecordDeployRequest = z.infer<typeof RecordDeployRequestSchema>;
|
|
250
|
+
/** Body of `GET /projects/:project/deploys?profile=` — newest last, as stored. */
|
|
251
|
+
declare const DeployLogResponseSchema: z.ZodObject<{
|
|
252
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
253
|
+
index: z.ZodNumber;
|
|
254
|
+
sha: z.ZodString;
|
|
255
|
+
previousSha: z.ZodNullable<z.ZodString>;
|
|
256
|
+
at: z.ZodString;
|
|
257
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
258
|
+
runUrl: z.ZodOptional<z.ZodString>;
|
|
259
|
+
changedPaths: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
260
|
+
hasSelection: z.ZodDefault<z.ZodBoolean>;
|
|
261
|
+
gapBefore: z.ZodDefault<z.ZodBoolean>;
|
|
262
|
+
}, z.core.$strip>>;
|
|
263
|
+
nextIndex: z.ZodNumber;
|
|
264
|
+
}, z.core.$strip>;
|
|
265
|
+
type DeployLogResponse = z.infer<typeof DeployLogResponseSchema>;
|
|
266
|
+
/**
|
|
267
|
+
* Body of `GET /projects/:project/drift`. No `?profile=` — see `SpecDriftEntrySchema`.
|
|
268
|
+
*/
|
|
269
|
+
declare const DriftLedgerResponseSchema: z.ZodObject<{
|
|
270
|
+
project: z.ZodString;
|
|
271
|
+
specs: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
272
|
+
label: z.ZodNullable<z.ZodEnum<{
|
|
273
|
+
TEST_DRIFT: "TEST_DRIFT";
|
|
274
|
+
SPEC_CHANGE: "SPEC_CHANGE";
|
|
275
|
+
UNKNOWN: "UNKNOWN";
|
|
276
|
+
}>>;
|
|
277
|
+
surface: z.ZodOptional<z.ZodEnum<{
|
|
278
|
+
spec: "spec";
|
|
279
|
+
generated: "generated";
|
|
280
|
+
}>>;
|
|
281
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
282
|
+
headline: z.ZodOptional<z.ZodString>;
|
|
283
|
+
gitHead: z.ZodString;
|
|
284
|
+
runId: z.ZodString;
|
|
285
|
+
at: z.ZodString;
|
|
286
|
+
graded: z.ZodOptional<z.ZodBoolean>;
|
|
287
|
+
}, z.core.$strip>>;
|
|
288
|
+
}, z.core.$strip>;
|
|
289
|
+
type DriftLedgerResponse = z.infer<typeof DriftLedgerResponseSchema>;
|
|
146
290
|
//#endregion
|
|
147
291
|
//#region src/prompts/prompt-names.d.ts
|
|
148
292
|
/**
|
|
@@ -173,6 +317,10 @@ declare const ReportSpecResultSchema: z.ZodObject<{
|
|
|
173
317
|
spec: z.ZodString;
|
|
174
318
|
title: z.ZodNullable<z.ZodString>;
|
|
175
319
|
target: z.ZodOptional<z.ZodString>;
|
|
320
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
321
|
+
live: "live";
|
|
322
|
+
deterministic: "deterministic";
|
|
323
|
+
}>>;
|
|
176
324
|
status: z.ZodEnum<{
|
|
177
325
|
passed: "passed";
|
|
178
326
|
failed: "failed";
|
|
@@ -216,6 +364,10 @@ declare const ReportSpecResultSchema: z.ZodObject<{
|
|
|
216
364
|
detail: z.ZodString;
|
|
217
365
|
}, z.core.$strip>>;
|
|
218
366
|
reasoning: z.ZodString;
|
|
367
|
+
surface: z.ZodOptional<z.ZodEnum<{
|
|
368
|
+
spec: "spec";
|
|
369
|
+
generated: "generated";
|
|
370
|
+
}>>;
|
|
219
371
|
}, z.core.$strip>>;
|
|
220
372
|
analysisSkipped: z.ZodNullable<z.ZodString>;
|
|
221
373
|
customPromptVersion: z.ZodOptional<z.ZodString>;
|
|
@@ -223,22 +375,30 @@ declare const ReportSpecResultSchema: z.ZodObject<{
|
|
|
223
375
|
ref: z.ZodString;
|
|
224
376
|
sha: z.ZodString;
|
|
225
377
|
}, z.core.$strip>>>;
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}>;
|
|
232
|
-
category: z.ZodEnum<{
|
|
233
|
-
assertable: "assertable";
|
|
234
|
-
blocks: "blocks";
|
|
235
|
-
granularity: "granularity";
|
|
236
|
-
unimplemented: "unimplemented";
|
|
378
|
+
driftAudit: z.ZodNullable<z.ZodObject<{
|
|
379
|
+
label: z.ZodEnum<{
|
|
380
|
+
TEST_DRIFT: "TEST_DRIFT";
|
|
381
|
+
SPEC_CHANGE: "SPEC_CHANGE";
|
|
382
|
+
UNKNOWN: "UNKNOWN";
|
|
237
383
|
}>;
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
384
|
+
confidence: z.ZodNumber;
|
|
385
|
+
surface: z.ZodDefault<z.ZodEnum<{
|
|
386
|
+
spec: "spec";
|
|
387
|
+
generated: "generated";
|
|
388
|
+
}>>;
|
|
389
|
+
subDiagnosis: z.ZodDefault<z.ZodEnum<{
|
|
390
|
+
OVER_ASSERTION: "OVER_ASSERTION";
|
|
391
|
+
SELECTOR_DRIFT: "SELECTOR_DRIFT";
|
|
392
|
+
NONE: "NONE";
|
|
393
|
+
}>>;
|
|
394
|
+
headline: z.ZodString;
|
|
395
|
+
recommendation: z.ZodDefault<z.ZodString>;
|
|
396
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
397
|
+
file: z.ZodOptional<z.ZodString>;
|
|
398
|
+
detail: z.ZodString;
|
|
399
|
+
}, z.core.$strip>>;
|
|
400
|
+
reasoning: z.ZodDefault<z.ZodString>;
|
|
401
|
+
}, z.core.$strip>>;
|
|
242
402
|
failureLogExcerpt: z.ZodNullable<z.ZodString>;
|
|
243
403
|
diffExcerpt: z.ZodNullable<z.ZodString>;
|
|
244
404
|
specYaml: z.ZodNullable<z.ZodString>;
|
|
@@ -337,11 +497,16 @@ declare const RunReportDataSchema: z.ZodObject<{
|
|
|
337
497
|
promptVersion: z.ZodString;
|
|
338
498
|
customPromptVersion: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
339
499
|
triageUserPromptHash: z.ZodOptional<z.ZodString>;
|
|
500
|
+
deployedSha: z.ZodOptional<z.ZodString>;
|
|
340
501
|
results: z.ZodArray<z.ZodObject<{
|
|
341
502
|
feature: z.ZodString;
|
|
342
503
|
spec: z.ZodString;
|
|
343
504
|
title: z.ZodNullable<z.ZodString>;
|
|
344
505
|
target: z.ZodOptional<z.ZodString>;
|
|
506
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
507
|
+
live: "live";
|
|
508
|
+
deterministic: "deterministic";
|
|
509
|
+
}>>;
|
|
345
510
|
status: z.ZodEnum<{
|
|
346
511
|
passed: "passed";
|
|
347
512
|
failed: "failed";
|
|
@@ -385,6 +550,10 @@ declare const RunReportDataSchema: z.ZodObject<{
|
|
|
385
550
|
detail: z.ZodString;
|
|
386
551
|
}, z.core.$strip>>;
|
|
387
552
|
reasoning: z.ZodString;
|
|
553
|
+
surface: z.ZodOptional<z.ZodEnum<{
|
|
554
|
+
spec: "spec";
|
|
555
|
+
generated: "generated";
|
|
556
|
+
}>>;
|
|
388
557
|
}, z.core.$strip>>;
|
|
389
558
|
analysisSkipped: z.ZodNullable<z.ZodString>;
|
|
390
559
|
customPromptVersion: z.ZodOptional<z.ZodString>;
|
|
@@ -392,22 +561,30 @@ declare const RunReportDataSchema: z.ZodObject<{
|
|
|
392
561
|
ref: z.ZodString;
|
|
393
562
|
sha: z.ZodString;
|
|
394
563
|
}, z.core.$strip>>>;
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
}>;
|
|
401
|
-
category: z.ZodEnum<{
|
|
402
|
-
assertable: "assertable";
|
|
403
|
-
blocks: "blocks";
|
|
404
|
-
granularity: "granularity";
|
|
405
|
-
unimplemented: "unimplemented";
|
|
564
|
+
driftAudit: z.ZodNullable<z.ZodObject<{
|
|
565
|
+
label: z.ZodEnum<{
|
|
566
|
+
TEST_DRIFT: "TEST_DRIFT";
|
|
567
|
+
SPEC_CHANGE: "SPEC_CHANGE";
|
|
568
|
+
UNKNOWN: "UNKNOWN";
|
|
406
569
|
}>;
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
570
|
+
confidence: z.ZodNumber;
|
|
571
|
+
surface: z.ZodDefault<z.ZodEnum<{
|
|
572
|
+
spec: "spec";
|
|
573
|
+
generated: "generated";
|
|
574
|
+
}>>;
|
|
575
|
+
subDiagnosis: z.ZodDefault<z.ZodEnum<{
|
|
576
|
+
OVER_ASSERTION: "OVER_ASSERTION";
|
|
577
|
+
SELECTOR_DRIFT: "SELECTOR_DRIFT";
|
|
578
|
+
NONE: "NONE";
|
|
579
|
+
}>>;
|
|
580
|
+
headline: z.ZodString;
|
|
581
|
+
recommendation: z.ZodDefault<z.ZodString>;
|
|
582
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
583
|
+
file: z.ZodOptional<z.ZodString>;
|
|
584
|
+
detail: z.ZodString;
|
|
585
|
+
}, z.core.$strip>>;
|
|
586
|
+
reasoning: z.ZodDefault<z.ZodString>;
|
|
587
|
+
}, z.core.$strip>>;
|
|
411
588
|
failureLogExcerpt: z.ZodNullable<z.ZodString>;
|
|
412
589
|
diffExcerpt: z.ZodNullable<z.ZodString>;
|
|
413
590
|
specYaml: z.ZodNullable<z.ZodString>;
|
|
@@ -568,12 +745,20 @@ interface HubPromptMeta {
|
|
|
568
745
|
meta: Record<string, unknown>;
|
|
569
746
|
}
|
|
570
747
|
interface HubClient {
|
|
571
|
-
/**
|
|
748
|
+
/**
|
|
749
|
+
* Push a report directory (as a tar.gz) for an already-finished `ccqa run`.
|
|
750
|
+
*
|
|
751
|
+
* `deployedSha` asserts the commit the environment was running *when the run
|
|
752
|
+
* started*. Without it the hub falls back to its deploy-log head, which by
|
|
753
|
+
* push time is the head after the run — a deploy that landed mid-run would
|
|
754
|
+
* then read as that run's baseline.
|
|
755
|
+
*/
|
|
572
756
|
pushRun(archive: Uint8Array, meta: {
|
|
573
757
|
project: string;
|
|
574
758
|
branch?: string;
|
|
575
759
|
profile?: string;
|
|
576
760
|
kind?: "run" | "drift";
|
|
761
|
+
deployedSha?: string;
|
|
577
762
|
}): Promise<Run>;
|
|
578
763
|
/**
|
|
579
764
|
* Open a `running` run to push results into incrementally. Returns the new
|
|
@@ -581,6 +766,10 @@ interface HubClient {
|
|
|
581
766
|
* would leave a second open run); callers degrade to local-only on failure.
|
|
582
767
|
* `gitHead` stamps the run's commit at open time, so even a run that dies
|
|
583
768
|
* before its final reconcile patch is attributable to a commit.
|
|
769
|
+
*
|
|
770
|
+
* `deployedSha` does the same for the environment's commit. The hub would
|
|
771
|
+
* otherwise read its own deploy-log head here, and the open happens after
|
|
772
|
+
* the deterministic phase, not before the first spec.
|
|
584
773
|
*/
|
|
585
774
|
openRun(meta: {
|
|
586
775
|
project: string;
|
|
@@ -588,6 +777,7 @@ interface HubClient {
|
|
|
588
777
|
profile?: string;
|
|
589
778
|
kind?: "run" | "drift";
|
|
590
779
|
gitHead?: string;
|
|
780
|
+
deployedSha?: string;
|
|
591
781
|
/** CI run id (GITHUB_RUN_ID) and its run URL, stamped at open time so an
|
|
592
782
|
* interrupted incremental run still links back to its CI run. */
|
|
593
783
|
ciRunId?: string;
|
|
@@ -628,6 +818,29 @@ interface HubClient {
|
|
|
628
818
|
branch: string;
|
|
629
819
|
fallbackBranch?: string;
|
|
630
820
|
}): Promise<Record<string, LastGreenEntry>>;
|
|
821
|
+
/**
|
|
822
|
+
* Per spec of one project/profile: is its last result still trustworthy?
|
|
823
|
+
* Answers `ccqa run --changed=last-run`. 404 when the project has no
|
|
824
|
+
* perspectives document — there is then no spec registered to compare
|
|
825
|
+
* against a deploy, which the caller must report rather than read as
|
|
826
|
+
* "nothing to run".
|
|
827
|
+
*/
|
|
828
|
+
getRerun(project: string, q: {
|
|
829
|
+
profile: string;
|
|
830
|
+
}): Promise<RerunReport>;
|
|
831
|
+
/**
|
|
832
|
+
* Every spec's last `ccqa drift --push` audit, keyed by "feature/spec". No
|
|
833
|
+
* profile — drift asks whether a spec still describes the code, not
|
|
834
|
+
* whether an environment is stale.
|
|
835
|
+
*/
|
|
836
|
+
getDriftLedger(project: string): Promise<DriftLedgerResponse>;
|
|
837
|
+
/** Tell the hub what a deploy shipped (`ccqa hub deploy record`). */
|
|
838
|
+
recordDeploy(project: string, profile: string, body: RecordDeployRequest): Promise<DeployEntry>;
|
|
839
|
+
/** The profile's retained deploy log, oldest first; `limit` keeps the newest N. */
|
|
840
|
+
getDeployLog(project: string, q: {
|
|
841
|
+
profile: string;
|
|
842
|
+
limit?: number;
|
|
843
|
+
}): Promise<DeployLogResponse>;
|
|
631
844
|
putSession(project: string, profile: string, name: string, storageState: unknown): Promise<void>;
|
|
632
845
|
getSession(project: string, profile: string, name: string): Promise<unknown>;
|
|
633
846
|
listSessions(project: string, profile: string): Promise<{
|
|
@@ -98,6 +98,7 @@ function createHubClient(opts) {
|
|
|
98
98
|
if (meta.branch) params.set("branch", meta.branch);
|
|
99
99
|
if (meta.profile) params.set("profile", meta.profile);
|
|
100
100
|
if (meta.kind) params.set("kind", meta.kind);
|
|
101
|
+
if (meta.deployedSha) params.set("deployedSha", meta.deployedSha);
|
|
101
102
|
return json(`/api/v1/runs?${params}`, {
|
|
102
103
|
method: "POST",
|
|
103
104
|
headers: { "Content-Type": "application/gzip" },
|
|
@@ -110,6 +111,7 @@ function createHubClient(opts) {
|
|
|
110
111
|
if (meta.profile) params.set("profile", meta.profile);
|
|
111
112
|
if (meta.kind) params.set("kind", meta.kind);
|
|
112
113
|
if (meta.gitHead) params.set("gitHead", meta.gitHead);
|
|
114
|
+
if (meta.deployedSha) params.set("deployedSha", meta.deployedSha);
|
|
113
115
|
if (meta.ciRunId) params.set("ciRunId", meta.ciRunId);
|
|
114
116
|
if (meta.runUrl) params.set("runUrl", meta.runUrl);
|
|
115
117
|
return json(`/api/v1/runs/open?${params}`, { method: "POST" });
|
|
@@ -163,6 +165,25 @@ function createHubClient(opts) {
|
|
|
163
165
|
const { entries } = await json(`/api/v1/projects/${encodeURIComponent(project)}/last-green?${params}`);
|
|
164
166
|
return entries;
|
|
165
167
|
},
|
|
168
|
+
getRerun(project, q) {
|
|
169
|
+
return json(`/api/v1/projects/${encodeURIComponent(project)}/rerun?${queryString({ profile: q.profile })}`);
|
|
170
|
+
},
|
|
171
|
+
getDriftLedger(project) {
|
|
172
|
+
return json(`/api/v1/projects/${encodeURIComponent(project)}/drift`);
|
|
173
|
+
},
|
|
174
|
+
recordDeploy(project, profile, body) {
|
|
175
|
+
return json(`${deploysPath(project)}?${queryString({ profile })}`, {
|
|
176
|
+
method: "POST",
|
|
177
|
+
headers: { "Content-Type": "application/json" },
|
|
178
|
+
body: JSON.stringify(body)
|
|
179
|
+
});
|
|
180
|
+
},
|
|
181
|
+
getDeployLog(project, q) {
|
|
182
|
+
return json(`${deploysPath(project)}?${queryString({
|
|
183
|
+
profile: q.profile,
|
|
184
|
+
limit: q.limit
|
|
185
|
+
})}`);
|
|
186
|
+
},
|
|
166
187
|
async listProjects() {
|
|
167
188
|
const { projects } = await json("/api/v1/projects");
|
|
168
189
|
return projects;
|
|
@@ -244,6 +265,10 @@ function scopePath(project, kind, profile) {
|
|
|
244
265
|
function promptsPath(project) {
|
|
245
266
|
return `/api/v1/projects/${encodeURIComponent(project)}/prompts`;
|
|
246
267
|
}
|
|
268
|
+
/** The deploy log is per project, selected by a `?profile=` query param: `/api/v1/projects/<project>/deploys`. */
|
|
269
|
+
function deploysPath(project) {
|
|
270
|
+
return `/api/v1/projects/${encodeURIComponent(project)}/deploys`;
|
|
271
|
+
}
|
|
247
272
|
/** Perspectives are one document per project: `/api/v1/projects/<project>/perspectives`. */
|
|
248
273
|
function perspectivesPath(project) {
|
|
249
274
|
return `/api/v1/projects/${encodeURIComponent(project)}/perspectives`;
|
package/dist/package.json
CHANGED