@plune-ai/cairn 0.4.2 → 0.5.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 (110) hide show
  1. package/README.md +49 -261
  2. package/dist/agent/graph.d.ts +24 -0
  3. package/dist/agent/graph.d.ts.map +1 -1
  4. package/dist/agent/graph.js +74 -2
  5. package/dist/agent/graph.js.map +1 -1
  6. package/dist/agent/index.d.ts +12 -0
  7. package/dist/agent/index.d.ts.map +1 -1
  8. package/dist/agent/index.js +101 -3
  9. package/dist/agent/index.js.map +1 -1
  10. package/dist/artifacts/index.d.ts +21 -0
  11. package/dist/artifacts/index.d.ts.map +1 -1
  12. package/dist/artifacts/index.js +58 -1
  13. package/dist/artifacts/index.js.map +1 -1
  14. package/dist/artifacts/report.d.ts +8 -0
  15. package/dist/artifacts/report.d.ts.map +1 -1
  16. package/dist/artifacts/report.js +47 -0
  17. package/dist/artifacts/report.js.map +1 -1
  18. package/dist/browser/backends/playwright-lib.d.ts +12 -0
  19. package/dist/browser/backends/playwright-lib.d.ts.map +1 -1
  20. package/dist/browser/backends/playwright-lib.js +48 -3
  21. package/dist/browser/backends/playwright-lib.js.map +1 -1
  22. package/dist/browser/recovery.d.ts +42 -0
  23. package/dist/browser/recovery.d.ts.map +1 -0
  24. package/dist/browser/recovery.js +62 -0
  25. package/dist/browser/recovery.js.map +1 -0
  26. package/dist/browser/types.d.ts +7 -0
  27. package/dist/browser/types.d.ts.map +1 -1
  28. package/dist/cli/index.d.ts.map +1 -1
  29. package/dist/cli/index.js +20 -0
  30. package/dist/cli/index.js.map +1 -1
  31. package/dist/codegen/journey-setup.d.ts +14 -0
  32. package/dist/codegen/journey-setup.d.ts.map +1 -0
  33. package/dist/codegen/journey-setup.js +69 -0
  34. package/dist/codegen/journey-setup.js.map +1 -0
  35. package/dist/core/modalities/explore.d.ts.map +1 -1
  36. package/dist/core/modalities/explore.js +10 -0
  37. package/dist/core/modalities/explore.js.map +1 -1
  38. package/dist/design/critique.d.ts +86 -0
  39. package/dist/design/critique.d.ts.map +1 -0
  40. package/dist/design/critique.js +62 -0
  41. package/dist/design/critique.js.map +1 -0
  42. package/dist/design/schema.d.ts +74 -0
  43. package/dist/design/schema.d.ts.map +1 -1
  44. package/dist/design/schema.js +22 -0
  45. package/dist/design/schema.js.map +1 -1
  46. package/dist/design/style.d.ts +18 -0
  47. package/dist/design/style.d.ts.map +1 -0
  48. package/dist/design/style.js +34 -0
  49. package/dist/design/style.js.map +1 -0
  50. package/dist/eval/coverage.d.ts +49 -0
  51. package/dist/eval/coverage.d.ts.map +1 -0
  52. package/dist/eval/coverage.js +60 -0
  53. package/dist/eval/coverage.js.map +1 -0
  54. package/dist/eval/gap-cases.d.ts +21 -0
  55. package/dist/eval/gap-cases.d.ts.map +1 -0
  56. package/dist/eval/gap-cases.js +27 -0
  57. package/dist/eval/gap-cases.js.map +1 -0
  58. package/dist/eval/legend.d.ts +3 -3
  59. package/dist/eval/legend.js +3 -3
  60. package/dist/eval/pilot.d.ts +4 -1
  61. package/dist/eval/pilot.d.ts.map +1 -1
  62. package/dist/eval/pilot.js +9 -2
  63. package/dist/eval/pilot.js.map +1 -1
  64. package/dist/flow/crawl.d.ts +66 -0
  65. package/dist/flow/crawl.d.ts.map +1 -0
  66. package/dist/flow/crawl.js +0 -0
  67. package/dist/flow/crawl.js.map +1 -0
  68. package/dist/flow/journey.d.ts +25 -0
  69. package/dist/flow/journey.d.ts.map +1 -0
  70. package/dist/flow/journey.js +51 -0
  71. package/dist/flow/journey.js.map +1 -0
  72. package/dist/flow/setup.d.ts +85 -0
  73. package/dist/flow/setup.d.ts.map +1 -0
  74. package/dist/flow/setup.js +65 -0
  75. package/dist/flow/setup.js.map +1 -0
  76. package/dist/llm/schema-lint.d.ts +9 -0
  77. package/dist/llm/schema-lint.d.ts.map +1 -0
  78. package/dist/llm/schema-lint.js +42 -0
  79. package/dist/llm/schema-lint.js.map +1 -0
  80. package/dist/observe/parse-aria.d.ts.map +1 -1
  81. package/dist/observe/parse-aria.js +11 -2
  82. package/dist/observe/parse-aria.js.map +1 -1
  83. package/dist/prompts/local/index.d.ts.map +1 -1
  84. package/dist/prompts/local/index.js +8 -0
  85. package/dist/prompts/local/index.js.map +1 -1
  86. package/dist/prompts/local/pilot-review.d.ts +1 -1
  87. package/dist/prompts/local/pilot-review.d.ts.map +1 -1
  88. package/dist/prompts/local/pilot-review.js +2 -1
  89. package/dist/prompts/local/pilot-review.js.map +1 -1
  90. package/dist/prompts/local/qa-case-critique.d.ts +8 -0
  91. package/dist/prompts/local/qa-case-critique.d.ts.map +1 -0
  92. package/dist/prompts/local/qa-case-critique.js +34 -0
  93. package/dist/prompts/local/qa-case-critique.js.map +1 -0
  94. package/dist/prompts/local/qa-gap-cases.d.ts +7 -0
  95. package/dist/prompts/local/qa-gap-cases.d.ts.map +1 -0
  96. package/dist/prompts/local/qa-gap-cases.js +22 -0
  97. package/dist/prompts/local/qa-gap-cases.js.map +1 -0
  98. package/dist/prompts/local/qa-journey-from-flow.d.ts +7 -0
  99. package/dist/prompts/local/qa-journey-from-flow.d.ts.map +1 -0
  100. package/dist/prompts/local/qa-journey-from-flow.js +29 -0
  101. package/dist/prompts/local/qa-journey-from-flow.js.map +1 -0
  102. package/dist/prompts/local/qa-setup-planner.d.ts +6 -0
  103. package/dist/prompts/local/qa-setup-planner.d.ts.map +1 -0
  104. package/dist/prompts/local/qa-setup-planner.js +28 -0
  105. package/dist/prompts/local/qa-setup-planner.js.map +1 -0
  106. package/dist/safety/guardrails.d.ts +36 -0
  107. package/dist/safety/guardrails.d.ts.map +1 -0
  108. package/dist/safety/guardrails.js +60 -0
  109. package/dist/safety/guardrails.js.map +1 -0
  110. package/package.json +1 -1
@@ -0,0 +1,86 @@
1
+ import { z } from "zod";
2
+ import type { StructuredInvoke } from "../llm/structured.js";
3
+ import type { PromptRegistry } from "../prompts/index.js";
4
+ import { type TestCase } from "./schema.js";
5
+ /** What the critique pass changed — recorded in report.json next to technique_coverage / case_redundancy. */
6
+ export interface CritiqueDelta {
7
+ /** Case count before the pass. */
8
+ before: number;
9
+ /** Case count after the pass (prune + top-up + re-dedup). */
10
+ after: number;
11
+ /** Cases dropped as trivial / contradictory / unverifiable. */
12
+ pruned: number;
13
+ /** Titles of the dropped cases (so the report shows WHAT was pruned). */
14
+ prunedTitles: string[];
15
+ /** New cases the top-up proposed (grounded against real refs). */
16
+ toppedUp: number;
17
+ /** technique_coverage (distinct/6) before the pass. */
18
+ techniqueCoverageBefore: number;
19
+ /** technique_coverage (distinct/6) after the pass. */
20
+ techniqueCoverageAfter: number;
21
+ /** Techniques newly covered by the top-up. */
22
+ techniquesAdded: string[];
23
+ }
24
+ export interface CritiqueInput {
25
+ testCases: TestCase[];
26
+ pageSemantics: string;
27
+ /** Real element refs (count≥1) — top-up cases are grounded against these (anti-hallucination). */
28
+ knownRefs: string[];
29
+ /** Case language (default "English"). */
30
+ language?: string;
31
+ }
32
+ export interface CritiqueDeps {
33
+ invoke: StructuredInvoke;
34
+ prompts: PromptRegistry;
35
+ }
36
+ /** What the worker returns: which cases to drop + which new cases to add. */
37
+ export declare const CritiqueResultSchema: z.ZodObject<{
38
+ drop: z.ZodDefault<z.ZodArray<z.ZodObject<{
39
+ id: z.ZodString;
40
+ reason: z.ZodString;
41
+ }, z.core.$strip>>>;
42
+ add: z.ZodDefault<z.ZodArray<z.ZodObject<{
43
+ title: z.ZodString;
44
+ technique: z.ZodEnum<{
45
+ "equivalence-partitioning": "equivalence-partitioning";
46
+ "boundary-value": "boundary-value";
47
+ "decision-table": "decision-table";
48
+ "state-transition": "state-transition";
49
+ exploratory: "exploratory";
50
+ "error-guessing": "error-guessing";
51
+ }>;
52
+ kind: z.ZodDefault<z.ZodEnum<{
53
+ static: "static";
54
+ active: "active";
55
+ }>>;
56
+ type: z.ZodDefault<z.ZodEnum<{
57
+ Positive: "Positive";
58
+ Negative: "Negative";
59
+ }>>;
60
+ execution: z.ZodDefault<z.ZodEnum<{
61
+ auto: "auto";
62
+ manual: "manual";
63
+ }>>;
64
+ preconditions: z.ZodDefault<z.ZodArray<z.ZodString>>;
65
+ steps: z.ZodArray<z.ZodString>;
66
+ expected: z.ZodString;
67
+ priority: z.ZodEnum<{
68
+ low: "low";
69
+ medium: "medium";
70
+ high: "high";
71
+ critical: "critical";
72
+ }>;
73
+ elementRefs: z.ZodDefault<z.ZodArray<z.ZodString>>;
74
+ }, z.core.$strip>>>;
75
+ }, z.core.$strip>;
76
+ /**
77
+ * #82 — design-time self-critique: ONE cheap worker-tier pass AFTER the first design set and BEFORE
78
+ * finalization. It (a) prunes trivial / contradictory / unverifiable cases and (b) tops up techniques
79
+ * under-represented across the 6 × 29119-4 set. Methodology and assertion-safety rules are unchanged —
80
+ * this only prunes and fills gaps. Top-up refs are grounded exactly like {@link designTestCases}.
81
+ */
82
+ export declare function critiqueCases(input: CritiqueInput, deps: CritiqueDeps): Promise<{
83
+ cases: TestCase[];
84
+ delta: CritiqueDelta;
85
+ }>;
86
+ //# sourceMappingURL=critique.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"critique.d.ts","sourceRoot":"","sources":["../../src/design/critique.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAA2C,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAMrF,6GAA6G;AAC7G,MAAM,WAAW,aAAa;IAC5B,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,uBAAuB,EAAE,MAAM,CAAC;IAChC,sDAAsD;IACtD,sBAAsB,EAAE,MAAM,CAAC;IAC/B,8CAA8C;IAC9C,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,kGAAkG;IAClG,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,gBAAgB,CAAC;IACzB,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,6EAA6E;AAC7E,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG/B,CAAC;AAIH;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,aAAa,EACpB,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC;IAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IAAC,KAAK,EAAE,aAAa,CAAA;CAAE,CAAC,CAgDtD"}
@@ -0,0 +1,62 @@
1
+ import { HumanMessage } from "@langchain/core/messages";
2
+ import { z } from "zod";
3
+ import { DesignedCaseSchema, TestTechniqueSchema } from "./schema.js";
4
+ import { dedupCases } from "./dedup.js";
5
+ /** The 6 × ISO/IEC/IEEE 29119-4 techniques (single source: the schema enum). */
6
+ const ALL_TECHNIQUES = TestTechniqueSchema.options;
7
+ /** What the worker returns: which cases to drop + which new cases to add. */
8
+ export const CritiqueResultSchema = z.object({
9
+ drop: z.array(z.object({ id: z.string(), reason: z.string() })).default([]),
10
+ add: z.array(DesignedCaseSchema).default([]),
11
+ });
12
+ const distinctTechniques = (cases) => new Set(cases.map((c) => c.technique));
13
+ /**
14
+ * #82 — design-time self-critique: ONE cheap worker-tier pass AFTER the first design set and BEFORE
15
+ * finalization. It (a) prunes trivial / contradictory / unverifiable cases and (b) tops up techniques
16
+ * under-represented across the 6 × 29119-4 set. Methodology and assertion-safety rules are unchanged —
17
+ * this only prunes and fills gaps. Top-up refs are grounded exactly like {@link designTestCases}.
18
+ */
19
+ export async function critiqueCases(input, deps) {
20
+ const before = input.testCases;
21
+ const techBefore = distinctTechniques(before);
22
+ const underrepresented = ALL_TECHNIQUES.filter((t) => !techBefore.has(t));
23
+ const casesList = before
24
+ .map((c) => `- ${c.id} [${c.technique}/${c.type}] ${c.title} → expected: ${c.expected}`)
25
+ .join("\n");
26
+ const prompt = await deps.prompts.getPrompt("qa-case-critique", {
27
+ cases: casesList,
28
+ underrepresented: underrepresented.join(", ") || "(none — all 6 techniques already covered)",
29
+ elements: input.knownRefs.join(", "),
30
+ language: input.language ?? "English",
31
+ });
32
+ const result = await deps.invoke(CritiqueResultSchema, [new HumanMessage(prompt.text)]);
33
+ const dropIds = new Set(result.drop.map((d) => d.id));
34
+ const prunedTitles = before.filter((c) => dropIds.has(c.id)).map((c) => c.title);
35
+ const kept = before.filter((c) => !dropIds.has(c.id));
36
+ // Ground top-up refs against real elements (same anti-hallucination rule as designTestCases).
37
+ const known = new Set(input.knownRefs);
38
+ const toppedUpCases = result.add.map((c) => ({
39
+ ...c,
40
+ id: "tc-pending",
41
+ elementRefs: c.elementRefs.filter((r) => known.has(r)),
42
+ }));
43
+ // Re-id + re-dedup the combined set, mirroring designTestCases' tail (one source of truth for dedup).
44
+ const combined = [...kept, ...toppedUpCases].map((c, i) => ({ ...c, id: `tc-${i + 1}` }));
45
+ const after = dedupCases(combined).merged;
46
+ const techAfter = distinctTechniques(after);
47
+ const techniquesAdded = [...techAfter].filter((t) => !techBefore.has(t));
48
+ return {
49
+ cases: after,
50
+ delta: {
51
+ before: before.length,
52
+ after: after.length,
53
+ pruned: prunedTitles.length,
54
+ prunedTitles,
55
+ toppedUp: toppedUpCases.length,
56
+ techniqueCoverageBefore: techBefore.size / ALL_TECHNIQUES.length,
57
+ techniqueCoverageAfter: techAfter.size / ALL_TECHNIQUES.length,
58
+ techniquesAdded,
59
+ },
60
+ };
61
+ }
62
+ //# sourceMappingURL=critique.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"critique.js","sourceRoot":"","sources":["../../src/design/critique.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAiB,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,gFAAgF;AAChF,MAAM,cAAc,GAAG,mBAAmB,CAAC,OAAO,CAAC;AAoCnD,6EAA6E;AAC7E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3E,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CAC7C,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,CAAC,KAAiB,EAAe,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAEtG;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,KAAoB,EACpB,IAAkB;IAElB,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAC/B,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC9C,MAAM,gBAAgB,GAAG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AAc,CAAC,MAAM;YAChE,sBAAsB,EAAE,SAAS,CAAC,IAAI,GAAG,cAAc,CAAC,MAAM;YAC9D,eAAe;SAChB;KACF,CAAC;AACJ,CAAC"}
@@ -106,4 +106,78 @@ export declare const DesignResultSchema: z.ZodObject<{
106
106
  export interface TestCase extends DesignedCase {
107
107
  id: string;
108
108
  }
109
+ /**
110
+ * One step of a multi-page journey (#59): which page it runs on, the action, and the element refs it
111
+ * touches. Refs are grounded PER PAGE (a step only references elements that exist on its own page).
112
+ */
113
+ export declare const JourneyStepSchema: z.ZodObject<{
114
+ page: z.ZodString;
115
+ action: z.ZodString;
116
+ elementRefs: z.ZodDefault<z.ZodArray<z.ZodString>>;
117
+ }, z.core.$strip>;
118
+ export type JourneyStep = z.infer<typeof JourneyStepSchema>;
119
+ /** A user journey that spans ≥2 pages — an ordered list of cross-page steps (#59). */
120
+ export declare const DesignedJourneySchema: z.ZodObject<{
121
+ title: z.ZodString;
122
+ technique: z.ZodEnum<{
123
+ "equivalence-partitioning": "equivalence-partitioning";
124
+ "boundary-value": "boundary-value";
125
+ "decision-table": "decision-table";
126
+ "state-transition": "state-transition";
127
+ exploratory: "exploratory";
128
+ "error-guessing": "error-guessing";
129
+ }>;
130
+ type: z.ZodDefault<z.ZodEnum<{
131
+ Positive: "Positive";
132
+ Negative: "Negative";
133
+ }>>;
134
+ preconditions: z.ZodDefault<z.ZodArray<z.ZodString>>;
135
+ steps: z.ZodArray<z.ZodObject<{
136
+ page: z.ZodString;
137
+ action: z.ZodString;
138
+ elementRefs: z.ZodDefault<z.ZodArray<z.ZodString>>;
139
+ }, z.core.$strip>>;
140
+ expected: z.ZodString;
141
+ priority: z.ZodEnum<{
142
+ low: "low";
143
+ medium: "medium";
144
+ high: "high";
145
+ critical: "critical";
146
+ }>;
147
+ }, z.core.$strip>;
148
+ export type DesignedJourney = z.infer<typeof DesignedJourneySchema>;
149
+ export declare const JourneyResultSchema: z.ZodObject<{
150
+ journeys: z.ZodArray<z.ZodObject<{
151
+ title: z.ZodString;
152
+ technique: z.ZodEnum<{
153
+ "equivalence-partitioning": "equivalence-partitioning";
154
+ "boundary-value": "boundary-value";
155
+ "decision-table": "decision-table";
156
+ "state-transition": "state-transition";
157
+ exploratory: "exploratory";
158
+ "error-guessing": "error-guessing";
159
+ }>;
160
+ type: z.ZodDefault<z.ZodEnum<{
161
+ Positive: "Positive";
162
+ Negative: "Negative";
163
+ }>>;
164
+ preconditions: z.ZodDefault<z.ZodArray<z.ZodString>>;
165
+ steps: z.ZodArray<z.ZodObject<{
166
+ page: z.ZodString;
167
+ action: z.ZodString;
168
+ elementRefs: z.ZodDefault<z.ZodArray<z.ZodString>>;
169
+ }, z.core.$strip>>;
170
+ expected: z.ZodString;
171
+ priority: z.ZodEnum<{
172
+ low: "low";
173
+ medium: "medium";
174
+ high: "high";
175
+ critical: "critical";
176
+ }>;
177
+ }, z.core.$strip>>;
178
+ }, z.core.$strip>;
179
+ /** Final journey case with an assigned id. */
180
+ export interface JourneyCase extends DesignedJourney {
181
+ id: string;
182
+ }
109
183
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/design/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,uCAAuC;AACvC,eAAO,MAAM,mBAAmB;;;;;;;EAO9B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;EAAgD,CAAC;AAEhF,6GAA6G;AAC7G,eAAO,MAAM,cAAc;;;EAA+B,CAAC;AAE3D,6EAA6E;AAC7E,eAAO,MAAM,cAAc;;;EAAmC,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;EAA6B,CAAC;AAE9D,+EAA+E;AAC/E,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK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O,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAyD,CAAC;AAE1F,8CAA8C;AAC9C,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD,EAAE,EAAE,MAAM,CAAC;CACZ"}
@@ -32,4 +32,26 @@ export const DesignedCaseSchema = z.object({
32
32
  elementRefs: z.array(z.string()).default([]),
33
33
  });
34
34
  export const DesignResultSchema = z.object({ testCases: z.array(DesignedCaseSchema) });
35
+ /**
36
+ * One step of a multi-page journey (#59): which page it runs on, the action, and the element refs it
37
+ * touches. Refs are grounded PER PAGE (a step only references elements that exist on its own page).
38
+ */
39
+ export const JourneyStepSchema = z.object({
40
+ /** URL of the page this step runs on (must be one of the graph's node URLs). */
41
+ page: z.string(),
42
+ /** Human-readable step (real element labels). */
43
+ action: z.string(),
44
+ elementRefs: z.array(z.string()).default([]),
45
+ });
46
+ /** A user journey that spans ≥2 pages — an ordered list of cross-page steps (#59). */
47
+ export const DesignedJourneySchema = z.object({
48
+ title: z.string(),
49
+ technique: TestTechniqueSchema,
50
+ type: TestTypeSchema.default("Positive"),
51
+ preconditions: z.array(z.string()).default([]),
52
+ steps: z.array(JourneyStepSchema),
53
+ expected: z.string(),
54
+ priority: TestPrioritySchema,
55
+ });
56
+ export const JourneyResultSchema = z.object({ journeys: z.array(DesignedJourneySchema) });
35
57
  //# sourceMappingURL=schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/design/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,uCAAuC;AACvC,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC;IACxC,0BAA0B;IAC1B,gBAAgB;IAChB,gBAAgB;IAChB,kBAAkB;IAClB,aAAa;IACb,gBAAgB;CACjB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB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G,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ export interface ResolveStyleOptions {
2
+ /** Directory of built-in / user style packs (default ./prompts/styles). */
3
+ stylesDir?: string;
4
+ }
5
+ /**
6
+ * #80 — resolve `--style <value>` into the text for the design prompt's {{style}} slot.
7
+ *
8
+ * Dual behavior, in order:
9
+ * 1. a house-style PACK — `<stylesDir>/<value>.md` (a built-in or user pack), or an explicit
10
+ * `.md` path — loads that file's text verbatim into the slot;
11
+ * 2. otherwise the built-in inline HINT — `happy` / `negative` / `coverage` (via
12
+ * {@link styleDirective}); anything else (incl. `all` / unset) → "" (balanced).
13
+ *
14
+ * Style only fills the {{style}} slot — it never touches the methodology or assertion-safety
15
+ * rules baked into the design prompt.
16
+ */
17
+ export declare function resolveStyleText(value: string | undefined, opts?: ResolveStyleOptions): Promise<string>;
18
+ //# sourceMappingURL=style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../src/design/style.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,mBAAmB;IAClC,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,IAAI,GAAE,mBAAwB,GAC7B,OAAO,CAAC,MAAM,CAAC,CAcjB"}
@@ -0,0 +1,34 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import { styleDirective } from "../checklist/index.js";
4
+ /**
5
+ * #80 — resolve `--style <value>` into the text for the design prompt's {{style}} slot.
6
+ *
7
+ * Dual behavior, in order:
8
+ * 1. a house-style PACK — `<stylesDir>/<value>.md` (a built-in or user pack), or an explicit
9
+ * `.md` path — loads that file's text verbatim into the slot;
10
+ * 2. otherwise the built-in inline HINT — `happy` / `negative` / `coverage` (via
11
+ * {@link styleDirective}); anything else (incl. `all` / unset) → "" (balanced).
12
+ *
13
+ * Style only fills the {{style}} slot — it never touches the methodology or assertion-safety
14
+ * rules baked into the design prompt.
15
+ */
16
+ export async function resolveStyleText(value, opts = {}) {
17
+ if (!value)
18
+ return styleDirective("all"); // "" — balanced
19
+ const stylesDir = opts.stylesDir ?? join("prompts", "styles");
20
+ // a named pack first (the common case), then an explicit path the user passed directly.
21
+ const candidates = [join(stylesDir, `${value}.md`), value];
22
+ for (const p of candidates) {
23
+ try {
24
+ const text = await readFile(p, "utf8");
25
+ if (text.trim())
26
+ return text;
27
+ }
28
+ catch {
29
+ // not a readable file → try the next candidate
30
+ }
31
+ }
32
+ return styleDirective(value); // inline-hint fallback (happy/negative/coverage), else ""
33
+ }
34
+ //# sourceMappingURL=style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/design/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAOvD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,KAAyB,EACzB,OAA4B,EAAE;IAE9B,IAAI,CAAC,KAAK;QAAE,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,gBAAgB;IAC1D,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC9D,wFAAwF;IACxF,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,KAAK,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;IAC3D,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QAC3B,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;YACvC,IAAI,IAAI,CAAC,IAAI,EAAE;gBAAE,OAAO,IAAI,CAAC;QAC/B,CAAC;QAAC,MAAM,CAAC;YACP,+CAA+C;QACjD,CAAC;IACH,CAAC;IACD,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,0DAA0D;AAC1F,CAAC"}
@@ -0,0 +1,49 @@
1
+ import type { VerifiedElement } from "../browser/types.js";
2
+ import type { TestCase, JourneyCase } from "../design/schema.js";
3
+ import type { FlowEdge } from "../flow/crawl.js";
4
+ /** One observed-but-untested interactive element, with a short reason it matters. */
5
+ export interface CoverageGap {
6
+ page: string;
7
+ ref: string;
8
+ role: string;
9
+ name?: string;
10
+ /** Why leaving this untested is a risk (role-derived). */
11
+ why: string;
12
+ }
13
+ export interface PageCoverage {
14
+ url: string;
15
+ observed: number;
16
+ covered: number;
17
+ gaps: CoverageGap[];
18
+ }
19
+ export interface CoverageReport {
20
+ /** Total observed interactive elements across all pages. */
21
+ observed: number;
22
+ /** How many of them are referenced by at least one case/journey. */
23
+ covered: number;
24
+ /** covered / observed (1 when there is nothing to miss). */
25
+ ratio: number;
26
+ byPage: PageCoverage[];
27
+ /** Observed transitions no journey walks end-to-end. */
28
+ untestedEdges: FlowEdge[];
29
+ }
30
+ export interface CoverageInput {
31
+ /** Observed surface per page (verified interactive elements). */
32
+ pages: {
33
+ url: string;
34
+ elements: VerifiedElement[];
35
+ }[];
36
+ /** Observed transitions between pages (#59). */
37
+ edges: FlowEdge[];
38
+ /** Per-page cases (their elementRefs count as coverage). */
39
+ testCases: TestCase[];
40
+ /** Journey cases (their per-step elementRefs + page sequence count as coverage). */
41
+ journeys?: JourneyCase[];
42
+ }
43
+ /**
44
+ * #61 — coverage = observed interactive surface + observed edges MINUS what any case/journey references.
45
+ * Pure set-difference (no LLM, no I/O), grouped by page. `ratio` is 1 when there is nothing observed,
46
+ * so it never produces NaN. Reconciles with the grounding/technique metrics (same verified refs).
47
+ */
48
+ export declare function computeCoverage(input: CoverageInput): CoverageReport;
49
+ //# sourceMappingURL=coverage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coverage.d.ts","sourceRoot":"","sources":["../../src/eval/coverage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qFAAqF;AACrF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,WAAW,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,wDAAwD;IACxD,aAAa,EAAE,QAAQ,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,iEAAiE;IACjE,KAAK,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,eAAe,EAAE,CAAA;KAAE,EAAE,CAAC;IACtD,gDAAgD;IAChD,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,4DAA4D;IAC5D,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,oFAAoF;IACpF,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;CAC1B;AA0BD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,cAAc,CA+BpE"}
@@ -0,0 +1,60 @@
1
+ /** Role-derived "why it matters" for an untested control. */
2
+ function whyMatters(role) {
3
+ switch (role) {
4
+ case "button":
5
+ return "actionable control never exercised — its behavior is untested";
6
+ case "link":
7
+ return "navigation path not covered — a route may be broken and unnoticed";
8
+ case "textbox":
9
+ case "searchbox":
10
+ case "combobox":
11
+ case "spinbutton":
12
+ return "input field never validated — accepts/rejects untested";
13
+ case "checkbox":
14
+ case "radio":
15
+ case "switch":
16
+ return "state toggle not checked — on/off behavior untested";
17
+ case "tab":
18
+ case "menuitem":
19
+ return "view/menu entry not opened — its content is unverified";
20
+ default:
21
+ return "interactive element with no test referencing it";
22
+ }
23
+ }
24
+ /**
25
+ * #61 — coverage = observed interactive surface + observed edges MINUS what any case/journey references.
26
+ * Pure set-difference (no LLM, no I/O), grouped by page. `ratio` is 1 when there is nothing observed,
27
+ * so it never produces NaN. Reconciles with the grounding/technique metrics (same verified refs).
28
+ */
29
+ export function computeCoverage(input) {
30
+ const coveredRefs = new Set([
31
+ ...input.testCases.flatMap((c) => c.elementRefs),
32
+ ...(input.journeys ?? []).flatMap((j) => j.steps.flatMap((s) => s.elementRefs)),
33
+ ]);
34
+ let observed = 0;
35
+ let covered = 0;
36
+ const byPage = input.pages.map((p) => {
37
+ const interactive = p.elements.filter((e) => e.interactive && e.count >= 1);
38
+ const gaps = [];
39
+ let pageCovered = 0;
40
+ for (const e of interactive) {
41
+ if (coveredRefs.has(e.ref))
42
+ pageCovered += 1;
43
+ else
44
+ gaps.push({ page: p.url, ref: e.ref, role: e.role, name: e.name, why: whyMatters(e.role) });
45
+ }
46
+ observed += interactive.length;
47
+ covered += pageCovered;
48
+ return { url: p.url, observed: interactive.length, covered: pageCovered, gaps };
49
+ });
50
+ // An edge is covered when some journey walks from→to on consecutive steps.
51
+ const walked = new Set();
52
+ for (const j of input.journeys ?? []) {
53
+ for (let i = 0; i + 1 < j.steps.length; i += 1) {
54
+ walked.add(`${j.steps[i].page}|${j.steps[i + 1].page}`);
55
+ }
56
+ }
57
+ const untestedEdges = input.edges.filter((e) => !walked.has(`${e.from}|${e.to}`));
58
+ return { observed, covered, ratio: observed === 0 ? 1 : covered / observed, byPage, untestedEdges };
59
+ }
60
+ //# sourceMappingURL=coverage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coverage.js","sourceRoot":"","sources":["../../src/eval/coverage.ts"],"names":[],"mappings":"AA4CA,6DAA6D;AAC7D,SAAS,UAAU,CAAC,IAAY;IAC9B,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,QAAQ;YACX,OAAO,+DAA+D,CAAC;QACzE,KAAK,MAAM;YACT,OAAO,mEAAmE,CAAC;QAC7E,KAAK,SAAS,CAAC;QACf,KAAK,WAAW,CAAC;QACjB,KAAK,UAAU,CAAC;QAChB,KAAK,YAAY;YACf,OAAO,wDAAwD,CAAC;QAClE,KAAK,UAAU,CAAC;QAChB,KAAK,OAAO,CAAC;QACb,KAAK,QAAQ;YACX,OAAO,qDAAqD,CAAC;QAC/D,KAAK,KAAK,CAAC;QACX,KAAK,UAAU;YACb,OAAO,wDAAwD,CAAC;QAClE;YACE,OAAO,iDAAiD,CAAC;IAC7D,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,KAAoB;IAClD,MAAM,WAAW,GAAG,IAAI,GAAG,CAAS;QAClC,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;QAChD,GAAG,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC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AI,EAAE,EAAE,CAAC;QACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/C,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;IACD,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAElF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;AACtG,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { StructuredInvoke } from "../llm/structured.js";
2
+ import type { PromptRegistry } from "../prompts/index.js";
3
+ import { type TestCase } from "../design/schema.js";
4
+ import type { CoverageGap } from "./coverage.js";
5
+ export interface GapCaseInput {
6
+ /** Top untested elements to suggest cases for. */
7
+ gaps: CoverageGap[];
8
+ pageSemantics?: string;
9
+ language?: string;
10
+ }
11
+ export interface GapCaseDeps {
12
+ invoke: StructuredInvoke;
13
+ prompts: PromptRegistry;
14
+ }
15
+ /**
16
+ * #61 — suggest test cases for the top untested surface (worker tier). Returned cases are clearly
17
+ * marked as SUGGESTIONS via a `gap-` id prefix and grounded to the gap refs (anti-hallucination).
18
+ * Returns [] without calling the LLM when there are no gaps.
19
+ */
20
+ export declare function designGapCases(input: GapCaseInput, deps: GapCaseDeps): Promise<TestCase[]>;
21
+ //# sourceMappingURL=gap-cases.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gap-cases.d.ts","sourceRoot":"","sources":["../../src/eval/gap-cases.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAsB,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC3B,kDAAkD;IAClD,IAAI,EAAE,WAAW,EAAE,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,gBAAgB,CAAC;IACzB,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAmBhG"}
@@ -0,0 +1,27 @@
1
+ import { HumanMessage } from "@langchain/core/messages";
2
+ import { DesignResultSchema } from "../design/schema.js";
3
+ /**
4
+ * #61 — suggest test cases for the top untested surface (worker tier). Returned cases are clearly
5
+ * marked as SUGGESTIONS via a `gap-` id prefix and grounded to the gap refs (anti-hallucination).
6
+ * Returns [] without calling the LLM when there are no gaps.
7
+ */
8
+ export async function designGapCases(input, deps) {
9
+ if (input.gaps.length === 0)
10
+ return [];
11
+ const known = new Set(input.gaps.map((g) => g.ref));
12
+ const gapList = input.gaps
13
+ .map((g) => `- ${g.ref} · ${g.role}${g.name ? ` "${g.name}"` : ""} (${g.page}) — ${g.why}`)
14
+ .join("\n");
15
+ const prompt = await deps.prompts.getPrompt("qa-gap-cases", {
16
+ gaps: gapList,
17
+ pageSemantics: input.pageSemantics ?? "",
18
+ language: input.language ?? "English",
19
+ });
20
+ const result = await deps.invoke(DesignResultSchema, [new HumanMessage(prompt.text)]);
21
+ return result.testCases.map((c, i) => ({
22
+ ...c,
23
+ id: `gap-${i + 1}`,
24
+ elementRefs: c.elementRefs.filter((r) => known.has(r)),
25
+ }));
26
+ }
27
+ //# sourceMappingURL=gap-cases.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gap-cases.js","sourceRoot":"","sources":["../../src/eval/gap-cases.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,OAAO,EAAE,kBAAkB,EAAiB,MAAM,qBAAqB,CAAC;AAexE;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,KAAmB,EAAE,IAAiB;IACzE,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACvC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACpD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI;SACvB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC;SAC1F,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,cAAc,EAAE;QAC1D,IAAI,EAAE,OAAO;QACb,aAAa,EAAE,KAAK,CAAC,aAAa,IAAI,EAAE;QACxC,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,SAAS;KACtC,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC,IAAI,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAEtF,OAAO,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACrC,GAAG,CAAC;QACJ,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE;QAClB,WAAW,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KACvD,CAAC,CAAC,CAAC;AACN,CAAC"}
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Single source of truth for metric explanations — used by report.md (`renderReportMd`), the console
3
- * `=== Metrics ===` loops, and the README "Metrics" section, so the three never drift.
3
+ * `=== Metrics ===` loops, and the docs/metrics.md table, so the three never drift.
4
4
  *
5
- * KEEP IN SYNC: the README "Metrics" section mirrors this record (same blurbs + directions). If you
6
- * change a blurb/direction here, update README.md too (and vice-versa). The metric NAMES must match
5
+ * KEEP IN SYNC: docs/metrics.md mirrors this record (same blurbs + directions). If you change a
6
+ * blurb/direction here, update docs/metrics.md too (and vice-versa). The metric NAMES must match
7
7
  * the score names produced by scorers.ts (deterministic) and judge.ts / agent (judge).
8
8
  */
9
9
  export type MetricDir = "up" | "down";
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Single source of truth for metric explanations — used by report.md (`renderReportMd`), the console
3
- * `=== Metrics ===` loops, and the README "Metrics" section, so the three never drift.
3
+ * `=== Metrics ===` loops, and the docs/metrics.md table, so the three never drift.
4
4
  *
5
- * KEEP IN SYNC: the README "Metrics" section mirrors this record (same blurbs + directions). If you
6
- * change a blurb/direction here, update README.md too (and vice-versa). The metric NAMES must match
5
+ * KEEP IN SYNC: docs/metrics.md mirrors this record (same blurbs + directions). If you change a
6
+ * blurb/direction here, update docs/metrics.md too (and vice-versa). The metric NAMES must match
7
7
  * the score names produced by scorers.ts (deterministic) and judge.ts / agent (judge).
8
8
  */
9
9
  export const METRIC_LEGEND = {
@@ -11,11 +11,14 @@ export declare const PilotSchema: z.ZodObject<{
11
11
  }>;
12
12
  reason: z.ZodString;
13
13
  guidance: z.ZodString;
14
+ entity: z.ZodString;
14
15
  }, z.core.$strip>;
15
16
  export type PilotVerdict = z.infer<typeof PilotSchema>;
16
17
  /**
17
18
  * Pilot supervisor (idea from explorbot): a holistic run verdict (pass/needs-work/fail) + guidance.
18
19
  * Complements the per-metric judge with a single decision on "whether the run is good enough".
19
20
  */
20
- export declare function pilotReview(pageSemantics: string, validation: ValidationReport | undefined, testCases: TestCase[], invoke: StructuredInvoke, prompts: PromptRegistry): Promise<PilotVerdict>;
21
+ export declare function pilotReview(pageSemantics: string, validation: ValidationReport | undefined, testCases: TestCase[], invoke: StructuredInvoke, prompts: PromptRegistry,
22
+ /** What the run actually touched (case titles/steps, observed element names) — for the #91 provenance check. */
23
+ sessionLog?: string[]): Promise<PilotVerdict>;
21
24
  //# sourceMappingURL=pilot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pilot.d.ts","sourceRoot":"","sources":["../../src/eval/pilot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,eAAO,MAAM,WAAW;;;;;;;;iBAItB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEvD;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,gBAAgB,GAAG,SAAS,EACxC,SAAS,EAAE,QAAQ,EAAE,EACrB,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,YAAY,CAAC,CAWvB"}
1
+ {"version":3,"file":"pilot.d.ts","sourceRoot":"","sources":["../../src/eval/pilot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAG7D,eAAO,MAAM,WAAW;;;;;;;;;iBAMtB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEvD;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,gBAAgB,GAAG,SAAS,EACxC,SAAS,EAAE,QAAQ,EAAE,EACrB,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,cAAc;AACvB,gHAAgH;AAChH,UAAU,GAAE,MAAM,EAAO,GACxB,OAAO,CAAC,YAAY,CAAC,CAavB"}
@@ -1,15 +1,20 @@
1
1
  import { z } from "zod";
2
2
  import { HumanMessage } from "@langchain/core/messages";
3
+ import { checkProvenance } from "../safety/guardrails.js";
3
4
  export const PilotSchema = z.object({
4
5
  verdict: z.enum(["pass", "needs-work", "fail"]),
5
6
  reason: z.string(),
6
7
  guidance: z.string(),
8
+ /** Name of the entity this run created/edited (for the provenance check) — "" if read-only (#91). */
9
+ entity: z.string(),
7
10
  });
8
11
  /**
9
12
  * Pilot supervisor (idea from explorbot): a holistic run verdict (pass/needs-work/fail) + guidance.
10
13
  * Complements the per-metric judge with a single decision on "whether the run is good enough".
11
14
  */
12
- export async function pilotReview(pageSemantics, validation, testCases, invoke, prompts) {
15
+ export async function pilotReview(pageSemantics, validation, testCases, invoke, prompts,
16
+ /** What the run actually touched (case titles/steps, observed element names) — for the #91 provenance check. */
17
+ sessionLog = []) {
13
18
  const validationText = validation
14
19
  ? `${Math.round(validation.greenRatio * 100)}% green (${validation.results.length} tests, flaky: ${validation.flakyCount})`
15
20
  : "(no validation — case design only)";
@@ -19,6 +24,8 @@ export async function pilotReview(pageSemantics, validation, testCases, invoke,
19
24
  validation: validationText,
20
25
  cases,
21
26
  });
22
- return invoke(PilotSchema, [new HumanMessage(prompt.text)]);
27
+ const verdict = await invoke(PilotSchema, [new HumanMessage(prompt.text)]);
28
+ // #91: a "pass" that names an entity is only trusted when that entity appears in the session log.
29
+ return checkProvenance(verdict, sessionLog);
23
30
  }
24
31
  //# sourceMappingURL=pilot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pilot.js","sourceRoot":"","sources":["../../src/eval/pilot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAMxD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;IAC/C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AAGH;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,aAAqB,EACrB,UAA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