ccqa 1.60.2 → 1.60.3
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/bin/ccqa.mjs +31 -22
- package/dist/hub-client/index.d.cts +2 -2
- package/dist/hub-client/index.d.mts +2 -2
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/bin/ccqa.mjs
CHANGED
|
@@ -9344,8 +9344,12 @@ const ViolationsSchema = z.object({ ruleViolations: z.array(z.unknown()) });
|
|
|
9344
9344
|
* treats it as one it could not obtain.
|
|
9345
9345
|
*/
|
|
9346
9346
|
const MAX_REVIEW_TURNS = 80;
|
|
9347
|
-
/**
|
|
9348
|
-
|
|
9347
|
+
/**
|
|
9348
|
+
* A wedged call, not a slow one. A review of a real suite reads the test, its
|
|
9349
|
+
* page objects and many of the suite's files to count conventions, which runs
|
|
9350
|
+
* past ten minutes; one that is still going after twenty is stuck.
|
|
9351
|
+
*/
|
|
9352
|
+
const REVIEW_TIMEOUT_MS = 20 * 6e4;
|
|
9349
9353
|
/** Read-only: a reviewer reads the repository and changes nothing in it. */
|
|
9350
9354
|
const REVIEW_TOOLS = [
|
|
9351
9355
|
"Read",
|
|
@@ -14788,7 +14792,7 @@ const LLM_GEN_ALLOWED_TOOLS = [
|
|
|
14788
14792
|
const LlmFileSchema = z.object({
|
|
14789
14793
|
path: z.string().min(1),
|
|
14790
14794
|
contents: z.string(),
|
|
14791
|
-
kind: z.string().
|
|
14795
|
+
kind: z.string().optional()
|
|
14792
14796
|
});
|
|
14793
14797
|
const LlmOutputSchema = z.object({
|
|
14794
14798
|
files: z.array(LlmFileSchema),
|
|
@@ -14820,21 +14824,29 @@ function parseLlmGenOutput(raw) {
|
|
|
14820
14824
|
const issues = res.error.issues.map((i) => `${i.path.join(".") || "(root)"}: ${i.message}`);
|
|
14821
14825
|
throw new Error(`reply JSON does not match {files:[{path,contents,kind}],summary}: ${issues.join("; ")}`);
|
|
14822
14826
|
}
|
|
14823
|
-
const kindWarnings = [];
|
|
14824
14827
|
return {
|
|
14825
|
-
files: res.data.files.map((f) => {
|
|
14826
|
-
|
|
14827
|
-
|
|
14828
|
-
|
|
14829
|
-
|
|
14830
|
-
|
|
14831
|
-
|
|
14832
|
-
|
|
14833
|
-
|
|
14834
|
-
|
|
14835
|
-
|
|
14836
|
-
|
|
14837
|
-
|
|
14828
|
+
files: res.data.files.map((f) => ({
|
|
14829
|
+
path: f.path,
|
|
14830
|
+
contents: f.contents,
|
|
14831
|
+
kind: f.kind === "support" ? "support" : "test"
|
|
14832
|
+
})),
|
|
14833
|
+
summary: res.data.summary
|
|
14834
|
+
};
|
|
14835
|
+
}
|
|
14836
|
+
/**
|
|
14837
|
+
* The file at the configured test path is the test and every other file is
|
|
14838
|
+
* support — whatever the reply labelled them. The path already says which one
|
|
14839
|
+
* a file is, and a model that labels a page object "test" would otherwise fail
|
|
14840
|
+
* the whole generation over a word.
|
|
14841
|
+
*/
|
|
14842
|
+
function kindByPath(output, policy) {
|
|
14843
|
+
const testAbs = resolve(policy.cwd, policy.testPath);
|
|
14844
|
+
return {
|
|
14845
|
+
...output,
|
|
14846
|
+
files: output.files.map((f) => ({
|
|
14847
|
+
...f,
|
|
14848
|
+
kind: resolve(policy.cwd, f.path) === testAbs ? "test" : "support"
|
|
14849
|
+
}))
|
|
14838
14850
|
};
|
|
14839
14851
|
}
|
|
14840
14852
|
/**
|
|
@@ -14994,7 +15006,6 @@ async function generateWithLlmEngine(req) {
|
|
|
14994
15006
|
requireTestFile: true,
|
|
14995
15007
|
allowEmpty: false
|
|
14996
15008
|
}), "run");
|
|
14997
|
-
warnings.push(...output.kindWarnings);
|
|
14998
15009
|
return finalizeAndVerify({
|
|
14999
15010
|
ctx,
|
|
15000
15011
|
target: req.target,
|
|
@@ -15559,8 +15570,7 @@ async function invokeForFiles(p) {
|
|
|
15559
15570
|
model: p.ctx.model
|
|
15560
15571
|
}, () => {});
|
|
15561
15572
|
if (isError) throw new Error(`Claude invocation failed: ${tail(result)}`);
|
|
15562
|
-
const output = parseLlmGenOutput(result);
|
|
15563
|
-
for (const w of output.kindWarnings) warn(w);
|
|
15573
|
+
const output = kindByPath(parseLlmGenOutput(result), p.policy);
|
|
15564
15574
|
const errors = validateOutput(output, p);
|
|
15565
15575
|
if (errors.length > 0) throw new Error(errors.join("; "));
|
|
15566
15576
|
return output;
|
|
@@ -15603,8 +15613,7 @@ function validateOutput(output, p) {
|
|
|
15603
15613
|
if (fileError) errors.push(fileError);
|
|
15604
15614
|
}
|
|
15605
15615
|
const tests = output.files.filter((f) => f.kind === "test");
|
|
15606
|
-
if (p.requireTestFile && tests.length === 0) errors.push(
|
|
15607
|
-
if (tests.length > 1) errors.push(`output contains ${tests.length} "kind": "test" files; a spec has exactly one`);
|
|
15616
|
+
if (p.requireTestFile && tests.length === 0) errors.push(`the test file must be written to ${p.policy.testPath}; the reply has no file there`);
|
|
15608
15617
|
return errors;
|
|
15609
15618
|
}
|
|
15610
15619
|
function toPromptResource(r) {
|
|
@@ -35,9 +35,9 @@ declare const RunSchema: z.ZodObject<{
|
|
|
35
35
|
running: "running";
|
|
36
36
|
}>;
|
|
37
37
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
38
|
+
record: "record";
|
|
38
39
|
run: "run";
|
|
39
40
|
drift: "drift";
|
|
40
|
-
record: "record";
|
|
41
41
|
}>>;
|
|
42
42
|
drift: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
43
43
|
specs: z.ZodNumber;
|
|
@@ -831,9 +831,9 @@ type ReportSpecResult = z.infer<typeof ReportSpecResultSchema>;
|
|
|
831
831
|
declare const RunReportDataSchema: z.ZodObject<{
|
|
832
832
|
schemaVersion: z.ZodLiteral<1>;
|
|
833
833
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
834
|
+
record: "record";
|
|
834
835
|
run: "run";
|
|
835
836
|
drift: "drift";
|
|
836
|
-
record: "record";
|
|
837
837
|
}>>;
|
|
838
838
|
createdAt: z.ZodString;
|
|
839
839
|
runId: z.ZodNullable<z.ZodString>;
|
|
@@ -35,9 +35,9 @@ declare const RunSchema: z.ZodObject<{
|
|
|
35
35
|
running: "running";
|
|
36
36
|
}>;
|
|
37
37
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
38
|
+
record: "record";
|
|
38
39
|
run: "run";
|
|
39
40
|
drift: "drift";
|
|
40
|
-
record: "record";
|
|
41
41
|
}>>;
|
|
42
42
|
drift: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
43
43
|
specs: z.ZodNumber;
|
|
@@ -831,9 +831,9 @@ type ReportSpecResult = z.infer<typeof ReportSpecResultSchema>;
|
|
|
831
831
|
declare const RunReportDataSchema: z.ZodObject<{
|
|
832
832
|
schemaVersion: z.ZodLiteral<1>;
|
|
833
833
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
834
|
+
record: "record";
|
|
834
835
|
run: "run";
|
|
835
836
|
drift: "drift";
|
|
836
|
-
record: "record";
|
|
837
837
|
}>>;
|
|
838
838
|
createdAt: z.ZodString;
|
|
839
839
|
runId: z.ZodNullable<z.ZodString>;
|
package/dist/package.json
CHANGED