@restormel/testing-core 0.1.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.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/dist/assertion.d.ts +31 -0
  3. package/dist/assertion.d.ts.map +1 -0
  4. package/dist/assertion.js +2 -0
  5. package/dist/assertion.js.map +1 -0
  6. package/dist/environment.d.ts +16 -0
  7. package/dist/environment.d.ts.map +1 -0
  8. package/dist/environment.js +2 -0
  9. package/dist/environment.js.map +1 -0
  10. package/dist/goal.d.ts +15 -0
  11. package/dist/goal.d.ts.map +1 -0
  12. package/dist/goal.js +2 -0
  13. package/dist/goal.js.map +1 -0
  14. package/dist/guards.d.ts +9 -0
  15. package/dist/guards.d.ts.map +1 -0
  16. package/dist/guards.js +81 -0
  17. package/dist/guards.js.map +1 -0
  18. package/dist/index.d.ts +20 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +8 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/normalize.d.ts +5 -0
  23. package/dist/normalize.d.ts.map +1 -0
  24. package/dist/normalize.js +29 -0
  25. package/dist/normalize.js.map +1 -0
  26. package/dist/policies.d.ts +13 -0
  27. package/dist/policies.d.ts.map +1 -0
  28. package/dist/policies.js +2 -0
  29. package/dist/policies.js.map +1 -0
  30. package/dist/report.d.ts +22 -0
  31. package/dist/report.d.ts.map +1 -0
  32. package/dist/report.js +2 -0
  33. package/dist/report.js.map +1 -0
  34. package/dist/run.d.ts +86 -0
  35. package/dist/run.d.ts.map +1 -0
  36. package/dist/run.js +2 -0
  37. package/dist/run.js.map +1 -0
  38. package/dist/success-criteria.d.ts +33 -0
  39. package/dist/success-criteria.d.ts.map +1 -0
  40. package/dist/success-criteria.js +2 -0
  41. package/dist/success-criteria.js.map +1 -0
  42. package/dist/suite.d.ts +15 -0
  43. package/dist/suite.d.ts.map +1 -0
  44. package/dist/suite.js +2 -0
  45. package/dist/suite.js.map +1 -0
  46. package/dist/verdict.d.ts +4 -0
  47. package/dist/verdict.d.ts.map +1 -0
  48. package/dist/verdict.js +5 -0
  49. package/dist/verdict.js.map +1 -0
  50. package/package.json +40 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Allotment Technology Ltd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,31 @@
1
+ import type { JudgeRubric, StructuredCheck } from "./success-criteria.js";
2
+ /**
3
+ * One atomic expectation (for traces, reports, or normalised criteria).
4
+ * Config YAML may use the flatter `SuccessCriteria` shape instead.
5
+ */
6
+ export type Assertion = UrlAssertion | DomAssertion | TextPresentAssertion | TextAbsentAssertion | StructuredAssertion | JudgeAssertion;
7
+ export interface UrlAssertion {
8
+ kind: "url";
9
+ patterns: string[];
10
+ }
11
+ export interface DomAssertion {
12
+ kind: "dom";
13
+ selectors: string[];
14
+ }
15
+ export interface TextPresentAssertion {
16
+ kind: "text_present";
17
+ substrings: string[];
18
+ }
19
+ export interface TextAbsentAssertion {
20
+ kind: "text_absent";
21
+ substrings: string[];
22
+ }
23
+ export interface StructuredAssertion {
24
+ kind: "structured";
25
+ check: StructuredCheck;
26
+ }
27
+ export interface JudgeAssertion {
28
+ kind: "judge";
29
+ rubric: JudgeRubric;
30
+ }
31
+ //# sourceMappingURL=assertion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertion.d.ts","sourceRoot":"","sources":["../src/assertion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE1E;;;GAGG;AACH,MAAM,MAAM,SAAS,GACjB,YAAY,GACZ,YAAY,GACZ,oBAAoB,GACpB,mBAAmB,GACnB,mBAAmB,GACnB,cAAc,CAAC;AAEnB,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,KAAK,CAAC;IACZ,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,KAAK,CAAC;IACZ,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,cAAc,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,eAAe,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,WAAW,CAAC;CACrB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=assertion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertion.js","sourceRoot":"","sources":["../src/assertion.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ /** Named target environment: local, preview, staging, or custom ids. */
2
+ export interface EnvironmentProfile {
3
+ id: string;
4
+ baseUrl: string;
5
+ /** How session/auth is supplied; values are runner-specific. */
6
+ authMode?: "none" | "cookie_jar" | "storage_state";
7
+ /**
8
+ * Opaque path or env key name for auth material — never inline secrets.
9
+ */
10
+ authRef?: string;
11
+ /**
12
+ * Logical Keys refs by slot name, e.g. llm_primary → ref:restormel-keys:...
13
+ */
14
+ keys?: Record<string, string>;
15
+ }
16
+ //# sourceMappingURL=environment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,eAAe,CAAC;IACnD;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=environment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":""}
package/dist/goal.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ import type { SuccessCriteria } from "./success-criteria.js";
2
+ export type GoalType = "browser" | "performance" | "native";
3
+ /** Opaque hook identifier (script id, npm script name, etc.). */
4
+ export type HookRef = string;
5
+ export interface TestGoal {
6
+ id: string;
7
+ type: GoalType;
8
+ description: string;
9
+ successCriteria: SuccessCriteria;
10
+ preconditions?: HookRef[];
11
+ cleanup?: HookRef[];
12
+ exclusiveWith?: string[];
13
+ tags?: string[];
14
+ }
15
+ //# sourceMappingURL=goal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"goal.d.ts","sourceRoot":"","sources":["../src/goal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,aAAa,GAAG,QAAQ,CAAC;AAE5D,iEAAiE;AACjE,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,eAAe,CAAC;IACjC,aAAa,CAAC,EAAE,OAAO,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB"}
package/dist/goal.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=goal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"goal.js","sourceRoot":"","sources":["../src/goal.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import type { GoalRunRecord } from "./run.js";
2
+ import type { Report } from "./report.js";
3
+ import type { RunRecord } from "./run.js";
4
+ import type { TraceEvent } from "./run.js";
5
+ export declare function isGoalRunRecord(value: unknown): value is GoalRunRecord;
6
+ export declare function isRunRecord(value: unknown): value is RunRecord;
7
+ export declare function isTraceEvent(value: unknown): value is TraceEvent;
8
+ export declare function isReport(value: unknown): value is Report;
9
+ //# sourceMappingURL=guards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../src/guards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAYtE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAa9D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAsBhE;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CA0BxD"}
package/dist/guards.js ADDED
@@ -0,0 +1,81 @@
1
+ import { isVerdict } from "./verdict.js";
2
+ export function isGoalRunRecord(value) {
3
+ if (value === null || typeof value !== "object")
4
+ return false;
5
+ const g = value;
6
+ return (typeof g.goalId === "string" &&
7
+ isVerdict(g.verdict) &&
8
+ typeof g.reasonCode === "string" &&
9
+ typeof g.summary === "string" &&
10
+ typeof g.retriesUsed === "number" &&
11
+ Array.isArray(g.evidenceRefs) &&
12
+ g.evidenceRefs.every((x) => typeof x === "string"));
13
+ }
14
+ export function isRunRecord(value) {
15
+ if (value === null || typeof value !== "object")
16
+ return false;
17
+ const r = value;
18
+ return (typeof r.id === "string" &&
19
+ typeof r.suiteId === "string" &&
20
+ typeof r.environmentId === "string" &&
21
+ (r.trigger === "local" || r.trigger === "ci") &&
22
+ typeof r.startedAt === "string" &&
23
+ isVerdict(r.verdict) &&
24
+ Array.isArray(r.goalRuns) &&
25
+ r.goalRuns.every(isGoalRunRecord));
26
+ }
27
+ export function isTraceEvent(value) {
28
+ if (value === null || typeof value !== "object")
29
+ return false;
30
+ const t = value;
31
+ const kinds = [
32
+ "navigation",
33
+ "action",
34
+ "assertion",
35
+ "model_call",
36
+ "tool_call",
37
+ "observation",
38
+ "error",
39
+ ];
40
+ return (typeof t.id === "string" &&
41
+ typeof t.runId === "string" &&
42
+ typeof t.goalId === "string" &&
43
+ typeof t.stepIndex === "number" &&
44
+ typeof t.kind === "string" &&
45
+ kinds.includes(t.kind) &&
46
+ typeof t.timestamp === "string" &&
47
+ typeof t.summary === "string");
48
+ }
49
+ export function isReport(value) {
50
+ if (value === null || typeof value !== "object")
51
+ return false;
52
+ const p = value;
53
+ if (!isRunRecord(p.run))
54
+ return false;
55
+ if (!Array.isArray(p.highlights) || !p.highlights.every((x) => typeof x === "string")) {
56
+ return false;
57
+ }
58
+ if (!Array.isArray(p.artifacts))
59
+ return false;
60
+ for (const a of p.artifacts) {
61
+ if (a === null || typeof a !== "object")
62
+ return false;
63
+ const ar = a;
64
+ const kinds = [
65
+ "screenshot",
66
+ "trace",
67
+ "log",
68
+ "network",
69
+ "console",
70
+ "report",
71
+ "other",
72
+ ];
73
+ if (typeof ar.kind !== "string" || !kinds.includes(ar.kind)) {
74
+ return false;
75
+ }
76
+ if (typeof ar.path !== "string")
77
+ return false;
78
+ }
79
+ return true;
80
+ }
81
+ //# sourceMappingURL=guards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.js","sourceRoot":"","sources":["../src/guards.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,CAAC,GAAG,KAAgC,CAAC;IAC3C,OAAO,CACL,OAAO,CAAC,CAAC,MAAM,KAAK,QAAQ;QAC5B,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;QACpB,OAAO,CAAC,CAAC,UAAU,KAAK,QAAQ;QAChC,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ;QAC7B,OAAO,CAAC,CAAC,WAAW,KAAK,QAAQ;QACjC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC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IAAI,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;IAChD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @restormel/testing-core — canonical domain contracts for Restormel / Testing (MVP).
3
+ */
4
+ export declare const testingCorePackage: "@restormel/testing-core";
5
+ export { isGoalRunRecord, isReport, isRunRecord, isTraceEvent, } from "./guards.js";
6
+ export { isVerdict, VERDICTS } from "./verdict.js";
7
+ export { successCriteriaToAssertions } from "./normalize.js";
8
+ export type { Assertion } from "./assertion.js";
9
+ export type { DomAssertion, JudgeAssertion, StructuredAssertion, TextAbsentAssertion, TextPresentAssertion, UrlAssertion, } from "./assertion.js";
10
+ export type { EnvironmentProfile } from "./environment.js";
11
+ export type { GoalType, HookRef, TestGoal } from "./goal.js";
12
+ export type { ArtifactPolicy, RetryPolicy } from "./policies.js";
13
+ export type { ArtifactRef, ReproductionHint, Report, RunReport, } from "./report.js";
14
+ export type { CostEstimate, GoalRunRecord, KeysModelMeta, RunRecord, RunRequest, RunTrigger, SuiteReportSlice, TraceEvent, TraceEventKind, } from "./run.js";
15
+ export type { JudgeRubric, StructuredCheck, SuccessCriteria } from "./success-criteria.js";
16
+ export type { TestSuite } from "./suite.js";
17
+ export type { Verdict } from "./verdict.js";
18
+ /** Doc-aligned alias for `RunRecord`. */
19
+ export type TestRun = import("./run.js").RunRecord;
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAG,yBAAkC,CAAC;AAErE,OAAO,EACL,eAAe,EACf,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAE7D,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,YAAY,EACV,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC7D,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjE,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,MAAM,EACN,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,YAAY,EACZ,aAAa,EACb,aAAa,EACb,SAAS,EACT,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,cAAc,GACf,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC3F,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,yCAAyC;AACzC,MAAM,MAAM,OAAO,GAAG,OAAO,UAAU,EAAE,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @restormel/testing-core — canonical domain contracts for Restormel / Testing (MVP).
3
+ */
4
+ export const testingCorePackage = "@restormel/testing-core";
5
+ export { isGoalRunRecord, isReport, isRunRecord, isTraceEvent, } from "./guards.js";
6
+ export { isVerdict, VERDICTS } from "./verdict.js";
7
+ export { successCriteriaToAssertions } from "./normalize.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,yBAAkC,CAAC;AAErE,OAAO,EACL,eAAe,EACf,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { Assertion } from "./assertion.js";
2
+ import type { SuccessCriteria } from "./success-criteria.js";
3
+ /** Flattens repo-config `SuccessCriteria` into discrete assertions for runners or traces. */
4
+ export declare function successCriteriaToAssertions(criteria: SuccessCriteria): Assertion[];
5
+ //# sourceMappingURL=normalize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../src/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,6FAA6F;AAC7F,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,EAAE,CA0BlF"}
@@ -0,0 +1,29 @@
1
+ /** Flattens repo-config `SuccessCriteria` into discrete assertions for runners or traces. */
2
+ export function successCriteriaToAssertions(criteria) {
3
+ const out = [];
4
+ if (criteria.urlMatches != null) {
5
+ const patterns = Array.isArray(criteria.urlMatches)
6
+ ? criteria.urlMatches
7
+ : [criteria.urlMatches];
8
+ if (patterns.length > 0) {
9
+ out.push({ kind: "url", patterns: [...patterns] });
10
+ }
11
+ }
12
+ if (criteria.domSignals != null && criteria.domSignals.length > 0) {
13
+ out.push({ kind: "dom", selectors: [...criteria.domSignals] });
14
+ }
15
+ if (criteria.textPresent != null && criteria.textPresent.length > 0) {
16
+ out.push({ kind: "text_present", substrings: [...criteria.textPresent] });
17
+ }
18
+ if (criteria.textAbsent != null && criteria.textAbsent.length > 0) {
19
+ out.push({ kind: "text_absent", substrings: [...criteria.textAbsent] });
20
+ }
21
+ for (const check of criteria.structuredChecks ?? []) {
22
+ out.push({ kind: "structured", check });
23
+ }
24
+ if (criteria.judgeRubric != null) {
25
+ out.push({ kind: "judge", rubric: criteria.judgeRubric });
26
+ }
27
+ return out;
28
+ }
29
+ //# sourceMappingURL=normalize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize.js","sourceRoot":"","sources":["../src/normalize.ts"],"names":[],"mappings":"AAGA,6FAA6F;AAC7F,MAAM,UAAU,2BAA2B,CAAC,QAAyB;IACnE,MAAM,GAAG,GAAgB,EAAE,CAAC;IAC5B,IAAI,QAAQ,CAAC,UAAU,IAAI,IAAI,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;YACjD,CAAC,CAAC,QAAQ,CAAC,UAAU;YACrB,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QAC1B,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IACD,IAAI,QAAQ,CAAC,UAAU,IAAI,IAAI,IAAI,QAAQ,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;IACD,IAAI,QAAQ,CAAC,WAAW,IAAI,IAAI,IAAI,QAAQ,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpE,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAC5E,CAAC;IACD,IAAI,QAAQ,CAAC,UAAU,IAAI,IAAI,IAAI,QAAQ,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC1E,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,gBAAgB,IAAI,EAAE,EAAE,CAAC;QACpD,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1C,CAAC;IACD,IAAI,QAAQ,CAAC,WAAW,IAAI,IAAI,EAAE,CAAC;QACjC,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,13 @@
1
+ /** Retries and backoff are interpreted by the runner; suite may override defaults. */
2
+ export interface RetryPolicy {
3
+ maxRetries: number;
4
+ /** Delay between attempts (ms); omit for runner default. */
5
+ backoffMs?: number;
6
+ }
7
+ /** What to capture to disk or CI artefacts (no remote retention implied). */
8
+ export interface ArtifactPolicy {
9
+ screenshots: "never" | "on_failure" | "always";
10
+ browserTrace: "never" | "on_failure" | "always";
11
+ console: boolean;
12
+ }
13
+ //# sourceMappingURL=policies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policies.d.ts","sourceRoot":"","sources":["../src/policies.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,OAAO,GAAG,YAAY,GAAG,QAAQ,CAAC;IAC/C,YAAY,EAAE,OAAO,GAAG,YAAY,GAAG,QAAQ,CAAC;IAChD,OAAO,EAAE,OAAO,CAAC;CAClB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=policies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policies.js","sourceRoot":"","sources":["../src/policies.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ import type { RunRecord } from "./run.js";
2
+ export interface ArtifactRef {
3
+ kind: "screenshot" | "trace" | "log" | "network" | "console" | "report" | "other";
4
+ /** Relative to run artefact directory or workspace-relative path. */
5
+ path: string;
6
+ mimeType?: string;
7
+ }
8
+ export interface ReproductionHint {
9
+ argv: string[];
10
+ cwd?: string;
11
+ notes?: string;
12
+ }
13
+ /** Human-facing bundle over a completed run (local files + summary). */
14
+ export interface Report {
15
+ run: RunRecord;
16
+ highlights: string[];
17
+ artifacts: ArtifactRef[];
18
+ reproduction?: ReproductionHint;
19
+ }
20
+ /** Alias aligned with architecture docs. */
21
+ export type RunReport = Report;
22
+ //# sourceMappingURL=report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,YAAY,GAAG,OAAO,GAAG,KAAK,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;IAClF,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wEAAwE;AACxE,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,SAAS,CAAC;IACf,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE,WAAW,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,gBAAgB,CAAC;CACjC;AAED,4CAA4C;AAC5C,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC"}
package/dist/report.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.js","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":""}
package/dist/run.d.ts ADDED
@@ -0,0 +1,86 @@
1
+ import type { Verdict } from "./verdict.js";
2
+ export type RunTrigger = "local" | "ci";
3
+ /** Input to execute a suite (or subset) in local or CI. */
4
+ export interface RunRequest {
5
+ suiteId: string;
6
+ environmentId: string;
7
+ trigger: RunTrigger;
8
+ /** Run only these goals; omit for full suite. */
9
+ goalIds?: string[];
10
+ commitSha?: string;
11
+ /** Repository slug for CI context (e.g. org/name). */
12
+ repository?: string;
13
+ gitRef?: string;
14
+ }
15
+ /** Provider/model resolution as observed during the run (no secrets). */
16
+ export interface KeysModelMeta {
17
+ logicalRef: string;
18
+ provider?: string;
19
+ model?: string;
20
+ invocationCount?: number;
21
+ /** Populated by the keys-adapter: Keys path vs documented env fallback. */
22
+ resolutionSource?: "keys" | "env_fallback";
23
+ }
24
+ export interface CostEstimate {
25
+ /** ISO currency when known */
26
+ currency?: string;
27
+ total?: number;
28
+ /**
29
+ * MVP rough scale only — **not** billing-grade or provider-reported usage.
30
+ * Prefer `RunRecord.judgeInvocationCount` for a factual rubric call count.
31
+ */
32
+ tokenEstimate?: {
33
+ input?: number;
34
+ output?: number;
35
+ };
36
+ }
37
+ /** Suite context embedded in reports (no secrets). */
38
+ export interface SuiteReportSlice {
39
+ id: string;
40
+ description?: string;
41
+ tags?: string[];
42
+ environmentId: string;
43
+ goalCount: number;
44
+ }
45
+ export interface GoalRunRecord {
46
+ goalId: string;
47
+ verdict: Verdict;
48
+ /** Stable machine code for automation (e.g. ASSERTION_FAILED, FLAKE_TIMEOUT). */
49
+ reasonCode: string;
50
+ summary: string;
51
+ retriesUsed: number;
52
+ /** Paths or ids relative to the run artefact root. */
53
+ evidenceRefs: string[];
54
+ }
55
+ export interface RunRecord {
56
+ id: string;
57
+ suiteId: string;
58
+ environmentId: string;
59
+ trigger: RunTrigger;
60
+ commitSha?: string;
61
+ repository?: string;
62
+ startedAt: string;
63
+ endedAt?: string;
64
+ verdict: Verdict;
65
+ goalRuns: GoalRunRecord[];
66
+ /** Models touched via Keys for this run. */
67
+ keysModelMeta?: KeysModelMeta[];
68
+ /**
69
+ * Total judge / `judge_rubric` model invocations in this run (sum of `keysModelMeta` invocation counts).
70
+ * Factual; use this instead of inferring cost from {@link costEstimate}.
71
+ */
72
+ judgeInvocationCount?: number;
73
+ costEstimate?: CostEstimate;
74
+ }
75
+ export type TraceEventKind = "navigation" | "action" | "assertion" | "model_call" | "tool_call" | "observation" | "error";
76
+ export interface TraceEvent {
77
+ id: string;
78
+ runId: string;
79
+ goalId: string;
80
+ stepIndex: number;
81
+ kind: TraceEventKind;
82
+ timestamp: string;
83
+ summary: string;
84
+ metadata?: Record<string, unknown>;
85
+ }
86
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,IAAI,CAAC;AAExC,2DAA2D;AAC3D,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,UAAU,CAAC;IACpB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,SA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AAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,4CAA4C;IAC5C,aAAa,CAAC,EAAE,aAAa,EAAE,CAAC;IAChC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED,MAAM,MAAM,cAAc,GACtB,YAAY,GACZ,QAAQ,GACR,WAAW,GACX,YAAY,GACZ,WAAW,GACX,aAAa,GACb,OAAO,CAAC;AAEZ,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC"}
package/dist/run.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":""}
@@ -0,0 +1,33 @@
1
+ /** Lightweight extraction + expectation (e.g. JSON path or DOM snapshot handle). */
2
+ export interface StructuredCheck {
3
+ id?: string;
4
+ /** Runner-defined path or selector language; keep opaque at contract level. */
5
+ path: string;
6
+ expect?: unknown;
7
+ }
8
+ /** Keys-backed rubric / judge step; no prompts or secrets inline. */
9
+ export interface JudgeRubric {
10
+ id: string;
11
+ /** Logical model ref (Keys slot), e.g. same convention as EnvironmentProfile.keys */
12
+ modelRef?: string;
13
+ /** Short label for reports; full prompts live outside the contract. */
14
+ summary?: string;
15
+ /**
16
+ * Optional CSS selector; judge sees innerText of first match only (smaller, less PII than full body).
17
+ * When omitted, runner prefers `main` then falls back to `body` with a strict character cap.
18
+ */
19
+ contextSelector?: string;
20
+ }
21
+ /**
22
+ * Success criteria as loaded from repo config (MVP shapes).
23
+ * See `successCriteriaToAssertions` to normalise to `Assertion[]`.
24
+ */
25
+ export interface SuccessCriteria {
26
+ urlMatches?: string | string[];
27
+ domSignals?: string[];
28
+ textPresent?: string[];
29
+ textAbsent?: string[];
30
+ structuredChecks?: StructuredCheck[];
31
+ judgeRubric?: JudgeRubric;
32
+ }
33
+ //# sourceMappingURL=success-criteria.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"success-criteria.d.ts","sourceRoot":"","sources":["../src/success-criteria.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,+EAA+E;IAC/E,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,qEAAqE;AACrE,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;IACrC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=success-criteria.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"success-criteria.js","sourceRoot":"","sources":["../src/success-criteria.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import type { ArtifactPolicy, RetryPolicy } from "./policies.js";
2
+ import type { TestGoal } from "./goal.js";
3
+ export interface TestSuite {
4
+ id: string;
5
+ description?: string;
6
+ /** Id of an `EnvironmentProfile` in resolved config. */
7
+ environment: string;
8
+ goals: TestGoal[];
9
+ tags?: string[];
10
+ retryPolicy?: RetryPolicy;
11
+ /** Default per-goal timeout (ms) when not overridden by the runner. */
12
+ defaultTimeoutMs?: number;
13
+ artifactPolicy?: ArtifactPolicy;
14
+ }
15
+ //# sourceMappingURL=suite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suite.d.ts","sourceRoot":"","sources":["../src/suite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC"}
package/dist/suite.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=suite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suite.js","sourceRoot":"","sources":["../src/suite.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export declare const VERDICTS: readonly ["passed", "failed", "indeterminate"];
2
+ export type Verdict = (typeof VERDICTS)[number];
3
+ export declare function isVerdict(value: unknown): value is Verdict;
4
+ //# sourceMappingURL=verdict.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verdict.d.ts","sourceRoot":"","sources":["../src/verdict.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,gDAAiD,CAAC;AAEvE,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhD,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAE1D"}
@@ -0,0 +1,5 @@
1
+ export const VERDICTS = ["passed", "failed", "indeterminate"];
2
+ export function isVerdict(value) {
3
+ return typeof value === "string" && VERDICTS.includes(value);
4
+ }
5
+ //# sourceMappingURL=verdict.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verdict.js","sourceRoot":"","sources":["../src/verdict.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,eAAe,CAAU,CAAC;AAIvE,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,QAA8B,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACtF,CAAC"}
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@restormel/testing-core",
3
+ "version": "0.1.0",
4
+ "description": "Contracts, run/verdict types, and shared primitives (scaffold).",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/Allotment-Technology-Ltd/restormel-testing.git",
9
+ "directory": "packages/core"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/Allotment-Technology-Ltd/restormel-testing/issues"
13
+ },
14
+ "homepage": "https://github.com/Allotment-Technology-Ltd/restormel-testing/tree/main/packages/core#readme",
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "type": "module",
19
+ "main": "./dist/index.js",
20
+ "types": "./dist/index.d.ts",
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "import": "./dist/index.js"
25
+ }
26
+ },
27
+ "files": [
28
+ "dist"
29
+ ],
30
+ "engines": {
31
+ "node": ">=20"
32
+ },
33
+ "devDependencies": {
34
+ "typescript": "^5.7.0"
35
+ },
36
+ "scripts": {
37
+ "build": "tsc -b tsconfig.json",
38
+ "typecheck": "tsc -b tsconfig.json"
39
+ }
40
+ }