@open-qa/qa 0.1.0-alpha.3 → 0.1.0-alpha.5
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/THIRD_PARTY.md +5 -0
- package/drizzle/0017_provider_notifications.sql +13 -0
- package/drizzle/0018_classification_registry.sql +39 -0
- package/drizzle/0019_trial_audit.sql +44 -0
- package/drizzle/meta/0017_snapshot.json +2092 -0
- package/drizzle/meta/0018_snapshot.json +2102 -0
- package/drizzle/meta/0019_snapshot.json +2451 -0
- package/drizzle/meta/_journal.json +21 -0
- package/package.json +12 -7
- package/src/access-binding.d.ts +8 -0
- package/src/access-binding.js +26 -0
- package/src/adapters/classification-write.d.ts +87 -0
- package/src/adapters/classification-write.js +64 -0
- package/src/adapters/e2b-executor.js +4 -0
- package/src/adapters/file-run-store.d.ts +186 -41
- package/src/adapters/file-run-store.js +87 -19
- package/src/adapters/file-trial-audit.d.ts +280 -0
- package/src/adapters/file-trial-audit.js +105 -0
- package/src/adapters/pg-classification-store.d.ts +98 -20
- package/src/adapters/pg-classification-store.js +84 -44
- package/src/adapters/pg-run-store.d.ts +1 -0
- package/src/adapters/pg-run-store.js +70 -9
- package/src/adapters/run-metadata.d.ts +2 -0
- package/src/adapters/run-metadata.js +10 -0
- package/src/adapters/secret-manager-credential-resolver.d.ts +1 -1
- package/src/attempt-audit.d.ts +363 -0
- package/src/attempt-audit.js +253 -0
- package/src/audit-command.d.ts +13 -0
- package/src/audit-command.js +77 -0
- package/src/classification-command.d.ts +14 -9
- package/src/classification-command.js +119 -26
- package/src/classification-model.d.ts +10 -3
- package/src/classification-model.js +40 -24
- package/src/classification-notifier.d.ts +4 -3
- package/src/classification-notifier.js +26 -6
- package/src/classify-runs.d.ts +2 -1
- package/src/classify-runs.js +39 -3
- package/src/cli-program.js +54 -8
- package/src/commands.d.ts +1 -0
- package/src/commands.js +2 -0
- package/src/db/database.d.ts +7 -0
- package/src/db/database.js +15 -0
- package/src/db/event-chunks.d.ts +38 -29
- package/src/db/flow-status.d.ts +7 -3
- package/src/db/flow-status.js +240 -16
- package/src/db/queries.d.ts +24 -1
- package/src/db/queries.js +22 -0
- package/src/db/schema.d.ts +333 -4
- package/src/db/schema.js +83 -11
- package/src/db/trial-audit.d.ts +526 -0
- package/src/db/trial-audit.js +84 -0
- package/src/doctor-command.js +2 -1
- package/src/draft-api.d.ts +25 -421
- package/src/draft-api.js +10 -3
- package/src/engine.d.ts +47 -4
- package/src/engine.js +97 -8
- package/src/execution-snapshot.d.ts +1 -1
- package/src/execution-snapshot.js +24 -18
- package/src/export-command.d.ts +6 -0
- package/src/export-command.js +106 -0
- package/src/flow-check.js +1 -1
- package/src/flow-loader.d.ts +72 -6
- package/src/flow-loader.js +76 -12
- package/src/http-stage-client.d.ts +98 -1
- package/src/independent-model.js +53 -6
- package/src/judge-review-store.d.ts +13 -0
- package/src/judge-review-store.js +58 -0
- package/src/local-host-executor.d.ts +3 -1
- package/src/local-host-executor.js +2 -0
- package/src/quarantine-command.d.ts +5 -1
- package/src/quarantine-command.js +56 -13
- package/src/remote-command.js +2 -0
- package/src/report/browser.css +1 -1
- package/src/report/browser.js +41 -41
- package/src/report/ctrf.d.ts +983 -0
- package/src/report/ctrf.js +306 -0
- package/src/report/generate.d.ts +1 -1
- package/src/report/generate.js +29 -6
- package/src/report/load.d.ts +738 -42
- package/src/report/load.js +78 -6
- package/src/result-notifier.js +1 -1
- package/src/result-trace.d.ts +62 -0
- package/src/result-trace.js +81 -0
- package/src/run-command.d.ts +9 -0
- package/src/run-command.js +300 -63
- package/src/run-setup-error.d.ts +11 -0
- package/src/run-setup-error.js +18 -0
- package/src/server/app.js +5 -4
- package/src/server/index.d.ts +2 -0
- package/src/server/index.js +11 -2
- package/src/server/repository.d.ts +166 -29
- package/src/server/repository.js +14 -2
- package/src/studio-command.d.ts +1 -0
- package/src/studio-command.js +11 -0
- package/src/studio-control.d.ts +5 -0
- package/src/studio-control.js +207 -0
- package/src/studio-review.d.ts +24 -0
- package/src/studio-review.js +64 -0
- package/src/studio-worker.d.ts +1 -0
- package/src/studio-worker.js +48 -0
- package/src/system-config.d.ts +2 -2
- package/src/system-config.js +5 -4
- package/src/trial-audit.d.ts +630 -0
- package/src/trial-audit.js +272 -0
- package/src/visual-baseline.d.ts +4 -0
- package/src/visual-baseline.js +42 -0
- package/src/webhook-notification.d.ts +15 -0
- package/src/webhook-notification.js +61 -0
- package/src/worker/execution.d.ts +2 -1
- package/src/worker/execution.js +122 -3
- package/src/worker/index.d.ts +4 -0
- package/src/worker/index.js +10 -1
- package/src/worker/quarantine-notifications.js +2 -2
- package/src/worker/queue.d.ts +6 -2
- package/src/worker/queue.js +80 -19
- package/src/worker/result-notifications.d.ts +10 -2
- package/src/worker/result-notifications.js +120 -23
- package/src/worker/store.js +6 -3
|
@@ -120,6 +120,27 @@
|
|
|
120
120
|
"when": 1795793990890,
|
|
121
121
|
"tag": "0016_open_qa_classification",
|
|
122
122
|
"breakpoints": true
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"idx": 17,
|
|
126
|
+
"version": "7",
|
|
127
|
+
"when": 1796297393163,
|
|
128
|
+
"tag": "0017_provider_notifications",
|
|
129
|
+
"breakpoints": true
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"idx": 18,
|
|
133
|
+
"version": "7",
|
|
134
|
+
"when": 1796316282203,
|
|
135
|
+
"tag": "0018_classification_registry",
|
|
136
|
+
"breakpoints": true
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"idx": 19,
|
|
140
|
+
"version": "7",
|
|
141
|
+
"when": 1796360032574,
|
|
142
|
+
"tag": "0019_trial_audit",
|
|
143
|
+
"breakpoints": true
|
|
123
144
|
}
|
|
124
145
|
]
|
|
125
146
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-qa/qa",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -74,18 +74,23 @@
|
|
|
74
74
|
"types": "./src/flows-api.d.ts",
|
|
75
75
|
"import": "./src/flows-api.js",
|
|
76
76
|
"default": "./src/flows-api.js"
|
|
77
|
+
},
|
|
78
|
+
"./results": {
|
|
79
|
+
"types": "./src/report/ctrf.d.ts",
|
|
80
|
+
"import": "./src/report/ctrf.js",
|
|
81
|
+
"default": "./src/report/ctrf.js"
|
|
77
82
|
}
|
|
78
83
|
},
|
|
79
84
|
"bin": {
|
|
80
85
|
"open-qa": "./src/cli.js"
|
|
81
86
|
},
|
|
82
87
|
"dependencies": {
|
|
83
|
-
"@open-qa/qa-agents": "0.1.0-alpha.
|
|
84
|
-
"@open-qa/qa-engine": "0.1.0-alpha.
|
|
85
|
-
"@open-qa/qa-inspect": "0.1.0-alpha.
|
|
86
|
-
"@open-qa/qa-replay": "0.1.0-alpha.
|
|
87
|
-
"@open-qa/qa-stage": "0.1.0-alpha.
|
|
88
|
-
"@open-qa/qa-studio": "0.1.0-alpha.
|
|
88
|
+
"@open-qa/qa-agents": "0.1.0-alpha.5",
|
|
89
|
+
"@open-qa/qa-engine": "0.1.0-alpha.5",
|
|
90
|
+
"@open-qa/qa-inspect": "0.1.0-alpha.5",
|
|
91
|
+
"@open-qa/qa-replay": "0.1.0-alpha.5",
|
|
92
|
+
"@open-qa/qa-stage": "0.1.0-alpha.5",
|
|
93
|
+
"@open-qa/qa-studio": "0.1.0-alpha.5",
|
|
89
94
|
"@libsql/client": "^0.15.0",
|
|
90
95
|
"commander": "^15.0.0",
|
|
91
96
|
"drizzle-orm": "^0.45.2",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ProviderRegistry } from "@open-qa/qa-engine";
|
|
2
|
+
export declare function resolveAccessBinding(providers: ProviderRegistry, id: string, target: string, url: string, env: NodeJS.ProcessEnv): {
|
|
3
|
+
accessHeaders: {
|
|
4
|
+
origin: string;
|
|
5
|
+
headers: Record<string, string>;
|
|
6
|
+
};
|
|
7
|
+
secrets: string[];
|
|
8
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { accessHeadersSchema } from "@open-qa/qa-engine/protocol";
|
|
2
|
+
import { RunSetupError } from "./run-setup-error.js";
|
|
3
|
+
function resolveAccessBinding(providers, id, target, url, env) {
|
|
4
|
+
const policy = providers.accessPolicy(providers.resolve("access", id, target));
|
|
5
|
+
const origin = new URL(url).origin;
|
|
6
|
+
if (!origin.startsWith("https://"))
|
|
7
|
+
throw new RunSetupError("configuration", `Access policy ${id} requires an HTTPS target`);
|
|
8
|
+
const credentials = /* @__PURE__ */ Object.create(null);
|
|
9
|
+
for (const key of policy.credentialKeys) {
|
|
10
|
+
const value = env[key];
|
|
11
|
+
if (!value) throw new RunSetupError("configuration", `Access policy ${id} requires ${key}`);
|
|
12
|
+
credentials[key] = value;
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
const headers = Object.fromEntries(
|
|
16
|
+
Object.entries(policy.headers(credentials)).map(([key, value]) => [key.toLowerCase(), value])
|
|
17
|
+
);
|
|
18
|
+
const accessHeaders = accessHeadersSchema.parse({ origin, headers });
|
|
19
|
+
return { accessHeaders, secrets: [...Object.values(credentials), ...Object.values(headers)] };
|
|
20
|
+
} catch {
|
|
21
|
+
throw new RunSetupError("configuration", `Invalid headers from access policy ${id}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
resolveAccessBinding
|
|
26
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type ProjectClassificationRegistry } from "@open-qa/qa-engine";
|
|
2
|
+
import { type Classification, type ClassificationCorrection } from "@open-qa/qa-engine/protocol";
|
|
3
|
+
/** Validate a new effective classification and attach identity for callers using the older input shape. */
|
|
4
|
+
export declare function validateClassificationWrite(scope: ProjectClassificationRegistry, value: Classification): {
|
|
5
|
+
category: string | null;
|
|
6
|
+
confidence: number;
|
|
7
|
+
reason: string;
|
|
8
|
+
source: "model" | "rule" | "fallback" | "human";
|
|
9
|
+
origin?: "unknown" | "judge" | "product" | "harness" | "infra" | undefined;
|
|
10
|
+
cause?: string | undefined;
|
|
11
|
+
taxonomy?: {
|
|
12
|
+
project: string;
|
|
13
|
+
version: string;
|
|
14
|
+
} | undefined;
|
|
15
|
+
flakiness?: "unknown" | "observed" | undefined;
|
|
16
|
+
needsReview?: boolean | undefined;
|
|
17
|
+
classifierVersion?: string | undefined;
|
|
18
|
+
rawPrediction?: {
|
|
19
|
+
category: string | null;
|
|
20
|
+
confidence: number;
|
|
21
|
+
reason: string;
|
|
22
|
+
origin?: "unknown" | "judge" | "product" | "harness" | "infra" | undefined;
|
|
23
|
+
cause?: string | undefined;
|
|
24
|
+
modelVersion?: string | undefined;
|
|
25
|
+
} | undefined;
|
|
26
|
+
};
|
|
27
|
+
export declare function classificationCorrection(scope: ProjectClassificationRegistry, input: ClassificationCorrection, predicted: Classification | null): {
|
|
28
|
+
label: {
|
|
29
|
+
reason: string;
|
|
30
|
+
category: string;
|
|
31
|
+
modifiedBy: string;
|
|
32
|
+
modifiedAt: number;
|
|
33
|
+
predicted: {
|
|
34
|
+
category: string | null;
|
|
35
|
+
confidence: number;
|
|
36
|
+
reason: string;
|
|
37
|
+
source: "model" | "rule" | "fallback" | "human";
|
|
38
|
+
origin?: "unknown" | "judge" | "product" | "harness" | "infra" | undefined;
|
|
39
|
+
cause?: string | undefined;
|
|
40
|
+
taxonomy?: {
|
|
41
|
+
project: string;
|
|
42
|
+
version: string;
|
|
43
|
+
} | undefined;
|
|
44
|
+
flakiness?: "unknown" | "observed" | undefined;
|
|
45
|
+
needsReview?: boolean | undefined;
|
|
46
|
+
classifierVersion?: string | undefined;
|
|
47
|
+
rawPrediction?: {
|
|
48
|
+
category: string | null;
|
|
49
|
+
confidence: number;
|
|
50
|
+
reason: string;
|
|
51
|
+
origin?: "unknown" | "judge" | "product" | "harness" | "infra" | undefined;
|
|
52
|
+
cause?: string | undefined;
|
|
53
|
+
modelVersion?: string | undefined;
|
|
54
|
+
} | undefined;
|
|
55
|
+
} | null;
|
|
56
|
+
origin?: "unknown" | "judge" | "product" | "harness" | "infra" | undefined;
|
|
57
|
+
cause?: string | undefined;
|
|
58
|
+
flakiness?: "unknown" | "observed" | undefined;
|
|
59
|
+
taxonomy?: {
|
|
60
|
+
project: string;
|
|
61
|
+
version: string;
|
|
62
|
+
} | undefined;
|
|
63
|
+
};
|
|
64
|
+
classification: {
|
|
65
|
+
category: string | null;
|
|
66
|
+
confidence: number;
|
|
67
|
+
reason: string;
|
|
68
|
+
source: "model" | "rule" | "fallback" | "human";
|
|
69
|
+
origin?: "unknown" | "judge" | "product" | "harness" | "infra" | undefined;
|
|
70
|
+
cause?: string | undefined;
|
|
71
|
+
taxonomy?: {
|
|
72
|
+
project: string;
|
|
73
|
+
version: string;
|
|
74
|
+
} | undefined;
|
|
75
|
+
flakiness?: "unknown" | "observed" | undefined;
|
|
76
|
+
needsReview?: boolean | undefined;
|
|
77
|
+
classifierVersion?: string | undefined;
|
|
78
|
+
rawPrediction?: {
|
|
79
|
+
category: string | null;
|
|
80
|
+
confidence: number;
|
|
81
|
+
reason: string;
|
|
82
|
+
origin?: "unknown" | "judge" | "product" | "harness" | "infra" | undefined;
|
|
83
|
+
cause?: string | undefined;
|
|
84
|
+
modelVersion?: string | undefined;
|
|
85
|
+
} | undefined;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ClassificationRegistryError } from "@open-qa/qa-engine";
|
|
2
|
+
import {
|
|
3
|
+
classificationLabelSchema,
|
|
4
|
+
classificationSchema
|
|
5
|
+
} from "@open-qa/qa-engine/protocol";
|
|
6
|
+
function requireCurrentTaxonomy(scope, identity) {
|
|
7
|
+
if (identity && (identity.project !== scope.project || identity.version !== scope.current.version))
|
|
8
|
+
throw new ClassificationRegistryError(
|
|
9
|
+
"Classification taxonomy does not match the active project and version"
|
|
10
|
+
);
|
|
11
|
+
return { project: scope.project, version: scope.current.version };
|
|
12
|
+
}
|
|
13
|
+
function validateClassificationWrite(scope, value) {
|
|
14
|
+
const parsed = classificationSchema.parse(value);
|
|
15
|
+
const taxonomy = requireCurrentTaxonomy(scope, parsed.taxonomy);
|
|
16
|
+
const category = parsed.category === null ? void 0 : scope.requireCategory(parsed.category, taxonomy);
|
|
17
|
+
if (parsed.source === "human")
|
|
18
|
+
throw new ClassificationRegistryError("Human classifications require an audit label");
|
|
19
|
+
const classifierVersion = parsed.classifierVersion ?? parsed.rawPrediction?.modelVersion ?? "unrecorded";
|
|
20
|
+
const rawPrediction = parsed.rawPrediction ?? (parsed.source === "model" ? {
|
|
21
|
+
category: parsed.category,
|
|
22
|
+
confidence: parsed.confidence,
|
|
23
|
+
reason: parsed.reason,
|
|
24
|
+
origin: parsed.origin,
|
|
25
|
+
cause: parsed.cause,
|
|
26
|
+
modelVersion: classifierVersion
|
|
27
|
+
} : void 0);
|
|
28
|
+
return classificationSchema.parse({
|
|
29
|
+
...parsed,
|
|
30
|
+
taxonomy,
|
|
31
|
+
origin: parsed.origin ?? category?.origin ?? "unknown",
|
|
32
|
+
cause: parsed.cause ?? "unknown",
|
|
33
|
+
flakiness: parsed.flakiness ?? "unknown",
|
|
34
|
+
needsReview: parsed.category === null || (parsed.needsReview ?? false),
|
|
35
|
+
classifierVersion,
|
|
36
|
+
...rawPrediction && { rawPrediction }
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function classificationCorrection(scope, input, predicted) {
|
|
40
|
+
const category = scope.requireCategory(input.category, input.taxonomy);
|
|
41
|
+
const taxonomy = requireCurrentTaxonomy(scope);
|
|
42
|
+
const label = classificationLabelSchema.parse({
|
|
43
|
+
...input,
|
|
44
|
+
taxonomy,
|
|
45
|
+
modifiedAt: Date.now(),
|
|
46
|
+
predicted
|
|
47
|
+
});
|
|
48
|
+
const classification = {
|
|
49
|
+
category: category.id,
|
|
50
|
+
taxonomy,
|
|
51
|
+
reason: label.reason,
|
|
52
|
+
confidence: 1,
|
|
53
|
+
source: "human",
|
|
54
|
+
origin: label.origin ?? category.origin ?? "unknown",
|
|
55
|
+
cause: label.cause ?? "unknown",
|
|
56
|
+
flakiness: label.flakiness ?? predicted?.flakiness ?? "unknown",
|
|
57
|
+
needsReview: false
|
|
58
|
+
};
|
|
59
|
+
return { label, classification };
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
classificationCorrection,
|
|
63
|
+
validateClassificationWrite
|
|
64
|
+
};
|
|
@@ -59,6 +59,8 @@ class E2bExecutor {
|
|
|
59
59
|
if (!qaId.safeParse(spec.runId).success) throw new Error("Invalid QA run ID");
|
|
60
60
|
if (!spec.actors.length || spec.actors.some((actor) => !actor.trim()) || new Set(spec.actors).size !== spec.actors.length)
|
|
61
61
|
throw new Error("At least one unique, nonempty actor is required");
|
|
62
|
+
if (spec.providers?.some((reference) => reference.provider !== "open-qa"))
|
|
63
|
+
throw new Error("Managed E2B image does not support deployment-installed providers");
|
|
62
64
|
if ((spec.views?.length ?? 0) > 6) throw new Error("QA E2B supports at most six views");
|
|
63
65
|
const provisionedAt = performance.now();
|
|
64
66
|
const lifetimeMs = this.options.budgetMs + E2B_FINALIZATION_MS;
|
|
@@ -130,6 +132,7 @@ class E2bExecutor {
|
|
|
130
132
|
{
|
|
131
133
|
host: "0.0.0.0",
|
|
132
134
|
port: 4101,
|
|
135
|
+
providers: spec.providers,
|
|
133
136
|
dir: stageDirectory,
|
|
134
137
|
conductorToken,
|
|
135
138
|
watchToken,
|
|
@@ -151,6 +154,7 @@ class E2bExecutor {
|
|
|
151
154
|
endpoint: sandbox.endpoint,
|
|
152
155
|
...new URL(sandbox.endpoint).protocol === "https:" ? { screenAccess: { url: `${sandbox.endpoint}/watch`, token: watchToken } } : {},
|
|
153
156
|
placement: "e2b",
|
|
157
|
+
image: { template },
|
|
154
158
|
conductorToken,
|
|
155
159
|
actorTokens,
|
|
156
160
|
asyncDispose: dispose
|
|
@@ -1,52 +1,114 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { type ArtifactScan } from "../artifact-scan.js";
|
|
3
|
-
import { type CreateRun, type FinishRun, type RunStore } from "@open-qa/qa-engine";
|
|
4
|
-
import { type Classification, type RunEvent } from "@open-qa/qa-engine/protocol";
|
|
3
|
+
import { type CreateRun, type FinishRun, type ProjectClassificationRegistry, type RunStore } from "@open-qa/qa-engine";
|
|
4
|
+
import { type Classification, type ClassificationCorrection, type RunEvent } from "@open-qa/qa-engine/protocol";
|
|
5
5
|
declare const runSchema: z.ZodObject<{
|
|
6
6
|
classification: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
7
|
-
category: z.
|
|
8
|
-
env: "env";
|
|
9
|
-
agent: "agent";
|
|
10
|
-
"product-bug": "product-bug";
|
|
11
|
-
"test-case": "test-case";
|
|
12
|
-
flaky: "flaky";
|
|
13
|
-
}>;
|
|
7
|
+
category: z.ZodNullable<z.ZodString>;
|
|
14
8
|
confidence: z.ZodNumber;
|
|
15
9
|
reason: z.ZodString;
|
|
10
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
11
|
+
unknown: "unknown";
|
|
12
|
+
judge: "judge";
|
|
13
|
+
product: "product";
|
|
14
|
+
harness: "harness";
|
|
15
|
+
infra: "infra";
|
|
16
|
+
}>>;
|
|
17
|
+
cause: z.ZodOptional<z.ZodString>;
|
|
16
18
|
source: z.ZodEnum<{
|
|
17
19
|
model: "model";
|
|
18
|
-
fallback: "fallback";
|
|
19
20
|
rule: "rule";
|
|
21
|
+
fallback: "fallback";
|
|
20
22
|
human: "human";
|
|
21
23
|
}>;
|
|
24
|
+
taxonomy: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
project: z.ZodString;
|
|
26
|
+
version: z.ZodString;
|
|
27
|
+
}, z.core.$strict>>;
|
|
28
|
+
flakiness: z.ZodOptional<z.ZodEnum<{
|
|
29
|
+
unknown: "unknown";
|
|
30
|
+
observed: "observed";
|
|
31
|
+
}>>;
|
|
32
|
+
needsReview: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
classifierVersion: z.ZodOptional<z.ZodString>;
|
|
34
|
+
rawPrediction: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
category: z.ZodNullable<z.ZodString>;
|
|
36
|
+
confidence: z.ZodNumber;
|
|
37
|
+
reason: z.ZodString;
|
|
38
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
39
|
+
unknown: "unknown";
|
|
40
|
+
judge: "judge";
|
|
41
|
+
product: "product";
|
|
42
|
+
harness: "harness";
|
|
43
|
+
infra: "infra";
|
|
44
|
+
}>>;
|
|
45
|
+
cause: z.ZodOptional<z.ZodString>;
|
|
46
|
+
modelVersion: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strict>>;
|
|
22
48
|
}, z.core.$strict>>>;
|
|
23
49
|
classificationLabels: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
50
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
51
|
+
unknown: "unknown";
|
|
52
|
+
judge: "judge";
|
|
53
|
+
product: "product";
|
|
54
|
+
harness: "harness";
|
|
55
|
+
infra: "infra";
|
|
56
|
+
}>>;
|
|
57
|
+
cause: z.ZodOptional<z.ZodString>;
|
|
58
|
+
flakiness: z.ZodOptional<z.ZodEnum<{
|
|
59
|
+
unknown: "unknown";
|
|
60
|
+
observed: "observed";
|
|
61
|
+
}>>;
|
|
31
62
|
reason: z.ZodString;
|
|
63
|
+
taxonomy: z.ZodOptional<z.ZodObject<{
|
|
64
|
+
project: z.ZodString;
|
|
65
|
+
version: z.ZodString;
|
|
66
|
+
}, z.core.$strict>>;
|
|
67
|
+
category: z.ZodString;
|
|
32
68
|
modifiedBy: z.ZodString;
|
|
33
69
|
modifiedAt: z.ZodNumber;
|
|
34
70
|
predicted: z.ZodNullable<z.ZodObject<{
|
|
35
|
-
category: z.
|
|
36
|
-
env: "env";
|
|
37
|
-
agent: "agent";
|
|
38
|
-
"product-bug": "product-bug";
|
|
39
|
-
"test-case": "test-case";
|
|
40
|
-
flaky: "flaky";
|
|
41
|
-
}>;
|
|
71
|
+
category: z.ZodNullable<z.ZodString>;
|
|
42
72
|
confidence: z.ZodNumber;
|
|
43
73
|
reason: z.ZodString;
|
|
74
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
75
|
+
unknown: "unknown";
|
|
76
|
+
judge: "judge";
|
|
77
|
+
product: "product";
|
|
78
|
+
harness: "harness";
|
|
79
|
+
infra: "infra";
|
|
80
|
+
}>>;
|
|
81
|
+
cause: z.ZodOptional<z.ZodString>;
|
|
44
82
|
source: z.ZodEnum<{
|
|
45
83
|
model: "model";
|
|
46
|
-
fallback: "fallback";
|
|
47
84
|
rule: "rule";
|
|
85
|
+
fallback: "fallback";
|
|
48
86
|
human: "human";
|
|
49
87
|
}>;
|
|
88
|
+
taxonomy: z.ZodOptional<z.ZodObject<{
|
|
89
|
+
project: z.ZodString;
|
|
90
|
+
version: z.ZodString;
|
|
91
|
+
}, z.core.$strict>>;
|
|
92
|
+
flakiness: z.ZodOptional<z.ZodEnum<{
|
|
93
|
+
unknown: "unknown";
|
|
94
|
+
observed: "observed";
|
|
95
|
+
}>>;
|
|
96
|
+
needsReview: z.ZodOptional<z.ZodBoolean>;
|
|
97
|
+
classifierVersion: z.ZodOptional<z.ZodString>;
|
|
98
|
+
rawPrediction: z.ZodOptional<z.ZodObject<{
|
|
99
|
+
category: z.ZodNullable<z.ZodString>;
|
|
100
|
+
confidence: z.ZodNumber;
|
|
101
|
+
reason: z.ZodString;
|
|
102
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
103
|
+
unknown: "unknown";
|
|
104
|
+
judge: "judge";
|
|
105
|
+
product: "product";
|
|
106
|
+
harness: "harness";
|
|
107
|
+
infra: "infra";
|
|
108
|
+
}>>;
|
|
109
|
+
cause: z.ZodOptional<z.ZodString>;
|
|
110
|
+
modelVersion: z.ZodOptional<z.ZodString>;
|
|
111
|
+
}, z.core.$strict>>;
|
|
50
112
|
}, z.core.$strict>>;
|
|
51
113
|
}, z.core.$strict>>>;
|
|
52
114
|
findings: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -103,57 +165,140 @@ declare const runSchema: z.ZodObject<{
|
|
|
103
165
|
}, z.core.$strict>;
|
|
104
166
|
export type FileRun = z.infer<typeof runSchema>;
|
|
105
167
|
export declare class FileRunStore implements RunStore {
|
|
168
|
+
private scope?;
|
|
106
169
|
private readonly qaRoot;
|
|
107
|
-
constructor(qaRoot?: string);
|
|
170
|
+
constructor(qaRoot?: string, scope?: ProjectClassificationRegistry | undefined);
|
|
171
|
+
get classificationScope(): ProjectClassificationRegistry;
|
|
108
172
|
createRun(run: CreateRun): Promise<void>;
|
|
109
173
|
appendEvents(runId: string, events: readonly RunEvent[]): Promise<void>;
|
|
110
174
|
finishRun(runId: string, result: FinishRun): Promise<void>;
|
|
175
|
+
recordClassifierUsage(runId: string, samples: Parameters<NonNullable<RunStore["recordClassifierUsage"]>>[1]): Promise<void>;
|
|
111
176
|
getRun(runId: string): Promise<FileRun | undefined>;
|
|
112
177
|
getClassification(runId: string): Promise<{
|
|
113
178
|
classification: {
|
|
114
|
-
category:
|
|
179
|
+
category: string | null;
|
|
115
180
|
confidence: number;
|
|
116
181
|
reason: string;
|
|
117
|
-
source: "model" | "
|
|
182
|
+
source: "model" | "rule" | "fallback" | "human";
|
|
183
|
+
origin?: "unknown" | "judge" | "product" | "harness" | "infra" | undefined;
|
|
184
|
+
cause?: string | undefined;
|
|
185
|
+
taxonomy?: {
|
|
186
|
+
project: string;
|
|
187
|
+
version: string;
|
|
188
|
+
} | undefined;
|
|
189
|
+
flakiness?: "unknown" | "observed" | undefined;
|
|
190
|
+
needsReview?: boolean | undefined;
|
|
191
|
+
classifierVersion?: string | undefined;
|
|
192
|
+
rawPrediction?: {
|
|
193
|
+
category: string | null;
|
|
194
|
+
confidence: number;
|
|
195
|
+
reason: string;
|
|
196
|
+
origin?: "unknown" | "judge" | "product" | "harness" | "infra" | undefined;
|
|
197
|
+
cause?: string | undefined;
|
|
198
|
+
modelVersion?: string | undefined;
|
|
199
|
+
} | undefined;
|
|
118
200
|
} | null;
|
|
119
201
|
labels: {
|
|
120
|
-
category: "env" | "agent" | "product-bug" | "test-case" | "flaky";
|
|
121
202
|
reason: string;
|
|
203
|
+
category: string;
|
|
122
204
|
modifiedBy: string;
|
|
123
205
|
modifiedAt: number;
|
|
124
206
|
predicted: {
|
|
125
|
-
category:
|
|
207
|
+
category: string | null;
|
|
126
208
|
confidence: number;
|
|
127
209
|
reason: string;
|
|
128
|
-
source: "model" | "
|
|
210
|
+
source: "model" | "rule" | "fallback" | "human";
|
|
211
|
+
origin?: "unknown" | "judge" | "product" | "harness" | "infra" | undefined;
|
|
212
|
+
cause?: string | undefined;
|
|
213
|
+
taxonomy?: {
|
|
214
|
+
project: string;
|
|
215
|
+
version: string;
|
|
216
|
+
} | undefined;
|
|
217
|
+
flakiness?: "unknown" | "observed" | undefined;
|
|
218
|
+
needsReview?: boolean | undefined;
|
|
219
|
+
classifierVersion?: string | undefined;
|
|
220
|
+
rawPrediction?: {
|
|
221
|
+
category: string | null;
|
|
222
|
+
confidence: number;
|
|
223
|
+
reason: string;
|
|
224
|
+
origin?: "unknown" | "judge" | "product" | "harness" | "infra" | undefined;
|
|
225
|
+
cause?: string | undefined;
|
|
226
|
+
modelVersion?: string | undefined;
|
|
227
|
+
} | undefined;
|
|
129
228
|
} | null;
|
|
229
|
+
origin?: "unknown" | "judge" | "product" | "harness" | "infra" | undefined;
|
|
230
|
+
cause?: string | undefined;
|
|
231
|
+
flakiness?: "unknown" | "observed" | undefined;
|
|
232
|
+
taxonomy?: {
|
|
233
|
+
project: string;
|
|
234
|
+
version: string;
|
|
235
|
+
} | undefined;
|
|
130
236
|
}[];
|
|
131
237
|
} | undefined>;
|
|
238
|
+
assertClassificationProject(stored: FileRun): void;
|
|
132
239
|
saveClassification(runId: string, value: Classification): Promise<void>;
|
|
133
|
-
labelClassification(runId: string, input: {
|
|
134
|
-
category: Classification["category"];
|
|
135
|
-
reason: string;
|
|
136
|
-
modifiedBy: string;
|
|
137
|
-
}): Promise<{
|
|
240
|
+
labelClassification(runId: string, input: ClassificationCorrection): Promise<{
|
|
138
241
|
classification: {
|
|
139
|
-
category:
|
|
242
|
+
category: string | null;
|
|
140
243
|
confidence: number;
|
|
141
244
|
reason: string;
|
|
142
|
-
source: "model" | "
|
|
245
|
+
source: "model" | "rule" | "fallback" | "human";
|
|
246
|
+
origin?: "unknown" | "judge" | "product" | "harness" | "infra" | undefined;
|
|
247
|
+
cause?: string | undefined;
|
|
248
|
+
taxonomy?: {
|
|
249
|
+
project: string;
|
|
250
|
+
version: string;
|
|
251
|
+
} | undefined;
|
|
252
|
+
flakiness?: "unknown" | "observed" | undefined;
|
|
253
|
+
needsReview?: boolean | undefined;
|
|
254
|
+
classifierVersion?: string | undefined;
|
|
255
|
+
rawPrediction?: {
|
|
256
|
+
category: string | null;
|
|
257
|
+
confidence: number;
|
|
258
|
+
reason: string;
|
|
259
|
+
origin?: "unknown" | "judge" | "product" | "harness" | "infra" | undefined;
|
|
260
|
+
cause?: string | undefined;
|
|
261
|
+
modelVersion?: string | undefined;
|
|
262
|
+
} | undefined;
|
|
143
263
|
};
|
|
144
264
|
labels: {
|
|
145
|
-
category: "env" | "agent" | "product-bug" | "test-case" | "flaky";
|
|
146
265
|
reason: string;
|
|
266
|
+
category: string;
|
|
147
267
|
modifiedBy: string;
|
|
148
268
|
modifiedAt: number;
|
|
149
269
|
predicted: {
|
|
150
|
-
category:
|
|
270
|
+
category: string | null;
|
|
151
271
|
confidence: number;
|
|
152
272
|
reason: string;
|
|
153
|
-
source: "model" | "
|
|
273
|
+
source: "model" | "rule" | "fallback" | "human";
|
|
274
|
+
origin?: "unknown" | "judge" | "product" | "harness" | "infra" | undefined;
|
|
275
|
+
cause?: string | undefined;
|
|
276
|
+
taxonomy?: {
|
|
277
|
+
project: string;
|
|
278
|
+
version: string;
|
|
279
|
+
} | undefined;
|
|
280
|
+
flakiness?: "unknown" | "observed" | undefined;
|
|
281
|
+
needsReview?: boolean | undefined;
|
|
282
|
+
classifierVersion?: string | undefined;
|
|
283
|
+
rawPrediction?: {
|
|
284
|
+
category: string | null;
|
|
285
|
+
confidence: number;
|
|
286
|
+
reason: string;
|
|
287
|
+
origin?: "unknown" | "judge" | "product" | "harness" | "infra" | undefined;
|
|
288
|
+
cause?: string | undefined;
|
|
289
|
+
modelVersion?: string | undefined;
|
|
290
|
+
} | undefined;
|
|
154
291
|
} | null;
|
|
292
|
+
origin?: "unknown" | "judge" | "product" | "harness" | "infra" | undefined;
|
|
293
|
+
cause?: string | undefined;
|
|
294
|
+
flakiness?: "unknown" | "observed" | undefined;
|
|
295
|
+
taxonomy?: {
|
|
296
|
+
project: string;
|
|
297
|
+
version: string;
|
|
298
|
+
} | undefined;
|
|
155
299
|
}[];
|
|
156
300
|
}>;
|
|
301
|
+
recordQuarantine(runId: string, quarantined: boolean, overdueSince?: number): Promise<void>;
|
|
157
302
|
recordArtifactScan(runId: string, scan: ArtifactScan): Promise<void>;
|
|
158
303
|
readEvents(runId: string, afterSeq?: number): Promise<RunEvent[]>;
|
|
159
304
|
recentUsage(flow: string): Promise<{
|