@cat-factory/contracts 0.52.0 → 0.53.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/entities.d.ts +353 -23
- package/dist/entities.d.ts.map +1 -1
- package/dist/entities.js +69 -9
- package/dist/entities.js.map +1 -1
- package/dist/routes/agent-runs.d.ts +148 -6
- package/dist/routes/agent-runs.d.ts.map +1 -1
- package/dist/routes/execution.d.ts +592 -24
- package/dist/routes/execution.d.ts.map +1 -1
- package/dist/routes/human-review.d.ts +74 -3
- package/dist/routes/human-review.d.ts.map +1 -1
- package/dist/routes/human-test.d.ts +370 -15
- package/dist/routes/human-test.d.ts.map +1 -1
- package/dist/routes/visual-confirm.d.ts +222 -9
- package/dist/routes/visual-confirm.d.ts.map +1 -1
- package/dist/routes/workspaces.d.ts +148 -6
- package/dist/routes/workspaces.d.ts.map +1 -1
- package/dist/snapshot.d.ts +74 -3
- package/dist/snapshot.d.ts.map +1 -1
- package/dist/testing.d.ts +71 -7
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +19 -1
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
package/dist/testing.d.ts
CHANGED
|
@@ -52,13 +52,13 @@ export declare const testScreenshotSchema: v.ObjectSchema<{
|
|
|
52
52
|
}, undefined>;
|
|
53
53
|
export type TestScreenshot = v.InferOutput<typeof testScreenshotSchema>;
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
55
|
+
* Enforce the `abort ⇒ greenlight === false` invariant at the schema boundary so it can't
|
|
56
|
+
* depend on every caller getting the ordering right: a report that signals `abort` is never
|
|
57
|
+
* release-ready, so normalise `greenlight` to false whenever an `abort` reason is present.
|
|
58
|
+
* (The container executor's `coerceTestReport` already forces this on the dispatch path; the
|
|
59
|
+
* transform makes it hold for every parse — e.g. re-validating persisted step state too.)
|
|
60
60
|
*/
|
|
61
|
-
export declare const testReportSchema: v.ObjectSchema<{
|
|
61
|
+
export declare const testReportSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
62
62
|
/** The gate verdict: release-ready (true) or needs fixing (false). */
|
|
63
63
|
readonly greenlight: v.BooleanSchema<undefined>;
|
|
64
64
|
/** Plain-prose overall summary of the testing session. */
|
|
@@ -106,7 +106,71 @@ export declare const testReportSchema: v.ObjectSchema<{
|
|
|
106
106
|
/** The matching reference design image's artifact id, when one was supplied. */
|
|
107
107
|
readonly referenceArtifactId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
108
108
|
}, undefined>, undefined>, undefined>;
|
|
109
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Set when the Tester could NOT run a meaningful test at all and the run must STOP for a
|
|
111
|
+
* human rather than loop the fixer — e.g. the ephemeral environment it was configured to
|
|
112
|
+
* use never came up, a required dependency was unavailable, or the change simply can't be
|
|
113
|
+
* exercised in this setup. The engine then blocks the task (retryable) and raises a
|
|
114
|
+
* notification WITHOUT dispatching the `fixer` (which can't fix missing infrastructure).
|
|
115
|
+
* This is distinct from a withheld greenlight (bugs were found → loop the fixer); when
|
|
116
|
+
* `abort` is set, `greenlight` MUST be false. The `reason` is shown to the human verbatim.
|
|
117
|
+
*/
|
|
118
|
+
readonly abort: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
119
|
+
readonly reason: v.StringSchema<undefined>;
|
|
120
|
+
}, undefined>, undefined>, undefined>;
|
|
121
|
+
}, undefined>, v.TransformAction<{
|
|
122
|
+
greenlight: boolean;
|
|
123
|
+
summary: string;
|
|
124
|
+
tested: string[];
|
|
125
|
+
outcomes: {
|
|
126
|
+
name: string;
|
|
127
|
+
status: "failed" | "passed" | "skipped";
|
|
128
|
+
detail?: string | undefined;
|
|
129
|
+
}[];
|
|
130
|
+
concerns: {
|
|
131
|
+
title: string;
|
|
132
|
+
detail: string;
|
|
133
|
+
severity: "critical" | "high" | "low" | "medium";
|
|
134
|
+
}[];
|
|
135
|
+
environment?: "ephemeral" | "local" | undefined;
|
|
136
|
+
screenshots?: {
|
|
137
|
+
view: string;
|
|
138
|
+
artifactId: string;
|
|
139
|
+
hash?: string | undefined;
|
|
140
|
+
width?: number | undefined;
|
|
141
|
+
height?: number | undefined;
|
|
142
|
+
referenceArtifactId?: string | undefined;
|
|
143
|
+
}[] | undefined;
|
|
144
|
+
abort?: {
|
|
145
|
+
reason: string;
|
|
146
|
+
} | null | undefined;
|
|
147
|
+
}, {
|
|
148
|
+
greenlight: boolean;
|
|
149
|
+
summary: string;
|
|
150
|
+
tested: string[];
|
|
151
|
+
outcomes: {
|
|
152
|
+
name: string;
|
|
153
|
+
status: "failed" | "passed" | "skipped";
|
|
154
|
+
detail?: string | undefined;
|
|
155
|
+
}[];
|
|
156
|
+
concerns: {
|
|
157
|
+
title: string;
|
|
158
|
+
detail: string;
|
|
159
|
+
severity: "critical" | "high" | "low" | "medium";
|
|
160
|
+
}[];
|
|
161
|
+
environment?: "ephemeral" | "local" | undefined;
|
|
162
|
+
screenshots?: {
|
|
163
|
+
view: string;
|
|
164
|
+
artifactId: string;
|
|
165
|
+
hash?: string | undefined;
|
|
166
|
+
width?: number | undefined;
|
|
167
|
+
height?: number | undefined;
|
|
168
|
+
referenceArtifactId?: string | undefined;
|
|
169
|
+
}[] | undefined;
|
|
170
|
+
abort?: {
|
|
171
|
+
reason: string;
|
|
172
|
+
} | null | undefined;
|
|
173
|
+
}>]>;
|
|
110
174
|
export type TestReport = v.InferOutput<typeof testReportSchema>;
|
|
111
175
|
/** Parse-or-throw a test report payload an agent returned (the engine validates it). */
|
|
112
176
|
export declare function parseTestReport(value: unknown): TestReport;
|
package/dist/testing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAgB5B;;;;;GAKG;AACH,eAAO,MA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ema = v.object({
|
|
|
66
66
|
* requirements plus best-judgement regression of related ones); `outcomes` are the
|
|
67
67
|
* per-area results; `concerns` are the bugs/risks to fix before re-testing.
|
|
68
68
|
*/
|
|
69
|
-
|
|
69
|
+
const testReportObjectSchema = v.object({
|
|
70
70
|
/** The gate verdict: release-ready (true) or needs fixing (false). */
|
|
71
71
|
greenlight: v.boolean(),
|
|
72
72
|
/** Plain-prose overall summary of the testing session. */
|
|
@@ -89,7 +89,25 @@ export const testReportSchema = v.object({
|
|
|
89
89
|
* the visual-confirmation gate's actual-vs-reference review.
|
|
90
90
|
*/
|
|
91
91
|
screenshots: v.optional(v.array(testScreenshotSchema)),
|
|
92
|
+
/**
|
|
93
|
+
* Set when the Tester could NOT run a meaningful test at all and the run must STOP for a
|
|
94
|
+
* human rather than loop the fixer — e.g. the ephemeral environment it was configured to
|
|
95
|
+
* use never came up, a required dependency was unavailable, or the change simply can't be
|
|
96
|
+
* exercised in this setup. The engine then blocks the task (retryable) and raises a
|
|
97
|
+
* notification WITHOUT dispatching the `fixer` (which can't fix missing infrastructure).
|
|
98
|
+
* This is distinct from a withheld greenlight (bugs were found → loop the fixer); when
|
|
99
|
+
* `abort` is set, `greenlight` MUST be false. The `reason` is shown to the human verbatim.
|
|
100
|
+
*/
|
|
101
|
+
abort: v.optional(v.nullable(v.object({ reason: v.string() }))),
|
|
92
102
|
});
|
|
103
|
+
/**
|
|
104
|
+
* Enforce the `abort ⇒ greenlight === false` invariant at the schema boundary so it can't
|
|
105
|
+
* depend on every caller getting the ordering right: a report that signals `abort` is never
|
|
106
|
+
* release-ready, so normalise `greenlight` to false whenever an `abort` reason is present.
|
|
107
|
+
* (The container executor's `coerceTestReport` already forces this on the dispatch path; the
|
|
108
|
+
* transform makes it hold for every parse — e.g. re-validating persisted step state too.)
|
|
109
|
+
*/
|
|
110
|
+
export const testReportSchema = v.pipe(testReportObjectSchema, v.transform((report) => (report.abort?.reason ? { ...report, greenlight: false } : report)));
|
|
93
111
|
/** Parse-or-throw a test report payload an agent returned (the engine validates it). */
|
|
94
112
|
export function parseTestReport(value) {
|
|
95
113
|
return v.parse(testReportSchema, value);
|
package/dist/testing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,8EAA8E;AAC9E,iCAAiC;AACjC,EAAE;AACF,6EAA6E;AAC7E,gFAAgF;AAChF,kFAAkF;AAClF,6EAA6E;AAC7E,2EAA2E;AAC3E,+EAA+E;AAC/E,gFAAgF;AAChF,iFAAiF;AACjF,mDAAmD;AACnD,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAA;AAGvE,oDAAoD;AACpD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;AAG1F,yFAAyF;AACzF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,oCAAoC;IACpC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,oDAAoD;IACpD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,uDAAuD;IACvD,QAAQ,EAAE,yBAAyB;CACpC,CAAC,CAAA;AAGF,8DAA8D;AAC9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,4DAA4D;IAC5D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,sDAAsD;IACtD,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IACnD,uEAAuE;IACvE,MAAM,EAA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