@plune-ai/cairn 0.4.1 → 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.
- package/README.md +49 -256
- package/dist/agent/graph.d.ts +24 -0
- package/dist/agent/graph.d.ts.map +1 -1
- package/dist/agent/graph.js +74 -2
- package/dist/agent/graph.js.map +1 -1
- package/dist/agent/index.d.ts +15 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +110 -10
- package/dist/agent/index.js.map +1 -1
- package/dist/artifacts/index.d.ts +21 -0
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +58 -1
- package/dist/artifacts/index.js.map +1 -1
- package/dist/artifacts/report.d.ts +8 -0
- package/dist/artifacts/report.d.ts.map +1 -1
- package/dist/artifacts/report.js +47 -0
- package/dist/artifacts/report.js.map +1 -1
- package/dist/browser/backends/playwright-lib.d.ts +12 -0
- package/dist/browser/backends/playwright-lib.d.ts.map +1 -1
- package/dist/browser/backends/playwright-lib.js +48 -3
- package/dist/browser/backends/playwright-lib.js.map +1 -1
- package/dist/browser/recovery.d.ts +42 -0
- package/dist/browser/recovery.d.ts.map +1 -0
- package/dist/browser/recovery.js +62 -0
- package/dist/browser/recovery.js.map +1 -0
- package/dist/browser/types.d.ts +7 -0
- package/dist/browser/types.d.ts.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +34 -12
- package/dist/cli/index.js.map +1 -1
- package/dist/codegen/journey-setup.d.ts +14 -0
- package/dist/codegen/journey-setup.d.ts.map +1 -0
- package/dist/codegen/journey-setup.js +69 -0
- package/dist/codegen/journey-setup.js.map +1 -0
- package/dist/core/modalities/explore.d.ts.map +1 -1
- package/dist/core/modalities/explore.js +12 -2
- package/dist/core/modalities/explore.js.map +1 -1
- package/dist/design/critique.d.ts +86 -0
- package/dist/design/critique.d.ts.map +1 -0
- package/dist/design/critique.js +62 -0
- package/dist/design/critique.js.map +1 -0
- package/dist/design/schema.d.ts +74 -0
- package/dist/design/schema.d.ts.map +1 -1
- package/dist/design/schema.js +22 -0
- package/dist/design/schema.js.map +1 -1
- package/dist/design/style.d.ts +18 -0
- package/dist/design/style.d.ts.map +1 -0
- package/dist/design/style.js +34 -0
- package/dist/design/style.js.map +1 -0
- package/dist/eval/coverage.d.ts +49 -0
- package/dist/eval/coverage.d.ts.map +1 -0
- package/dist/eval/coverage.js +60 -0
- package/dist/eval/coverage.js.map +1 -0
- package/dist/eval/gap-cases.d.ts +21 -0
- package/dist/eval/gap-cases.d.ts.map +1 -0
- package/dist/eval/gap-cases.js +27 -0
- package/dist/eval/gap-cases.js.map +1 -0
- package/dist/eval/legend.d.ts +3 -3
- package/dist/eval/legend.js +3 -3
- package/dist/eval/pilot.d.ts +4 -1
- package/dist/eval/pilot.d.ts.map +1 -1
- package/dist/eval/pilot.js +9 -2
- package/dist/eval/pilot.js.map +1 -1
- package/dist/flow/crawl.d.ts +66 -0
- package/dist/flow/crawl.d.ts.map +1 -0
- package/dist/flow/crawl.js +0 -0
- package/dist/flow/crawl.js.map +1 -0
- package/dist/flow/journey.d.ts +25 -0
- package/dist/flow/journey.d.ts.map +1 -0
- package/dist/flow/journey.js +51 -0
- package/dist/flow/journey.js.map +1 -0
- package/dist/flow/setup.d.ts +85 -0
- package/dist/flow/setup.d.ts.map +1 -0
- package/dist/flow/setup.js +65 -0
- package/dist/flow/setup.js.map +1 -0
- package/dist/fs/run-dir.d.ts +29 -0
- package/dist/fs/run-dir.d.ts.map +1 -0
- package/dist/fs/run-dir.js +113 -0
- package/dist/fs/run-dir.js.map +1 -0
- package/dist/llm/schema-lint.d.ts +9 -0
- package/dist/llm/schema-lint.d.ts.map +1 -0
- package/dist/llm/schema-lint.js +42 -0
- package/dist/llm/schema-lint.js.map +1 -0
- package/dist/observe/parse-aria.d.ts.map +1 -1
- package/dist/observe/parse-aria.js +11 -2
- package/dist/observe/parse-aria.js.map +1 -1
- package/dist/prompts/local/index.d.ts.map +1 -1
- package/dist/prompts/local/index.js +8 -0
- package/dist/prompts/local/index.js.map +1 -1
- package/dist/prompts/local/pilot-review.d.ts +1 -1
- package/dist/prompts/local/pilot-review.d.ts.map +1 -1
- package/dist/prompts/local/pilot-review.js +2 -1
- package/dist/prompts/local/pilot-review.js.map +1 -1
- package/dist/prompts/local/qa-case-critique.d.ts +8 -0
- package/dist/prompts/local/qa-case-critique.d.ts.map +1 -0
- package/dist/prompts/local/qa-case-critique.js +34 -0
- package/dist/prompts/local/qa-case-critique.js.map +1 -0
- package/dist/prompts/local/qa-gap-cases.d.ts +7 -0
- package/dist/prompts/local/qa-gap-cases.d.ts.map +1 -0
- package/dist/prompts/local/qa-gap-cases.js +22 -0
- package/dist/prompts/local/qa-gap-cases.js.map +1 -0
- package/dist/prompts/local/qa-journey-from-flow.d.ts +7 -0
- package/dist/prompts/local/qa-journey-from-flow.d.ts.map +1 -0
- package/dist/prompts/local/qa-journey-from-flow.js +29 -0
- package/dist/prompts/local/qa-journey-from-flow.js.map +1 -0
- package/dist/prompts/local/qa-setup-planner.d.ts +6 -0
- package/dist/prompts/local/qa-setup-planner.d.ts.map +1 -0
- package/dist/prompts/local/qa-setup-planner.js +28 -0
- package/dist/prompts/local/qa-setup-planner.js.map +1 -0
- package/dist/safety/guardrails.d.ts +36 -0
- package/dist/safety/guardrails.d.ts.map +1 -0
- package/dist/safety/guardrails.js +60 -0
- package/dist/safety/guardrails.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FileBlob, GeneratedSuite } from "./schema.js";
|
|
2
|
+
import type { JourneyCase } from "../design/schema.js";
|
|
3
|
+
import type { FlowGraph } from "../flow/crawl.js";
|
|
4
|
+
import type { SetupPlan } from "../flow/setup.js";
|
|
5
|
+
/**
|
|
6
|
+
* #60 — render a runnable @playwright/test spec for one journey, with its SETUP established before the
|
|
7
|
+
* steps. Pure + deterministic (no LLM): the setup shape is fixed per strategy, so we emit it directly
|
|
8
|
+
* rather than asking a model. Step assertions are read-only (toBeVisible), refs resolved PER PAGE from
|
|
9
|
+
* the flow graph. Manual preconditions are documented and the test is skipped (clean fallback).
|
|
10
|
+
*/
|
|
11
|
+
export declare function renderJourneySetup(journey: JourneyCase, plan: SetupPlan, graph: FlowGraph, baseUrl: string): FileBlob;
|
|
12
|
+
/** Map journeys + their setup plans → a @playwright/test suite (one spec per journey). */
|
|
13
|
+
export declare function buildJourneySetupSuite(journeys: JourneyCase[], plans: SetupPlan[], graph: FlowGraph, baseUrl: string): GeneratedSuite;
|
|
14
|
+
//# sourceMappingURL=journey-setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey-setup.d.ts","sourceRoot":"","sources":["../../src/codegen/journey-setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGlD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,MAAM,GACd,QAAQ,CA2DV;AAED,0FAA0F;AAC1F,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,WAAW,EAAE,EACvB,KAAK,EAAE,SAAS,EAAE,EAClB,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,MAAM,GACd,cAAc,CAIhB"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { locatorFor } from "../artifacts/report.js";
|
|
2
|
+
/**
|
|
3
|
+
* #60 — render a runnable @playwright/test spec for one journey, with its SETUP established before the
|
|
4
|
+
* steps. Pure + deterministic (no LLM): the setup shape is fixed per strategy, so we emit it directly
|
|
5
|
+
* rather than asking a model. Step assertions are read-only (toBeVisible), refs resolved PER PAGE from
|
|
6
|
+
* the flow graph. Manual preconditions are documented and the test is skipped (clean fallback).
|
|
7
|
+
*/
|
|
8
|
+
export function renderJourneySetup(journey, plan, graph, baseUrl) {
|
|
9
|
+
// ref → locator, resolved within the page the ref belongs to (per-page grounding from #59).
|
|
10
|
+
const byPage = new Map(graph.nodes.map((n) => [n.url, new Map(n.verified.map((v) => [v.ref, v]))]));
|
|
11
|
+
const locator = (page, ref) => {
|
|
12
|
+
const el = byPage.get(page)?.get(ref);
|
|
13
|
+
return el ? locatorFor(el) : null;
|
|
14
|
+
};
|
|
15
|
+
const esc = (s) => s.replace(/'/g, "");
|
|
16
|
+
const sessions = plan.preconditions.filter((p) => p.strategy === "session");
|
|
17
|
+
const fixtures = plan.preconditions.filter((p) => p.strategy === "fixture");
|
|
18
|
+
const seeds = plan.preconditions.filter((p) => p.strategy === "api-seed");
|
|
19
|
+
const manual = plan.preconditions.filter((p) => p.strategy === "manual");
|
|
20
|
+
const L = ["import { test, expect } from '@playwright/test';", ""];
|
|
21
|
+
L.push(`// Journey: ${journey.title}`);
|
|
22
|
+
for (const p of plan.preconditions)
|
|
23
|
+
L.push(`// precondition [${p.strategy}]: ${p.description}`);
|
|
24
|
+
for (const s of sessions)
|
|
25
|
+
L.push(`// "${s.description}" — satisfied by the captured session (storageState).`);
|
|
26
|
+
L.push("");
|
|
27
|
+
// fixture + api-seed → a beforeEach that establishes the starting state.
|
|
28
|
+
if (fixtures.length > 0 || seeds.length > 0) {
|
|
29
|
+
L.push("test.beforeEach(async ({ page, request }) => {");
|
|
30
|
+
for (const f of fixtures) {
|
|
31
|
+
L.push(` // setup (fixture): ${f.description}`);
|
|
32
|
+
L.push(` await page.goto('${baseUrl}');`);
|
|
33
|
+
}
|
|
34
|
+
for (const sd of seeds) {
|
|
35
|
+
const method = (sd.method ?? "POST").toLowerCase();
|
|
36
|
+
L.push(` // setup (api-seed): ${sd.description}`);
|
|
37
|
+
L.push(` await request.${method}('${sd.endpoint ?? ""}');`);
|
|
38
|
+
}
|
|
39
|
+
L.push("});", "");
|
|
40
|
+
}
|
|
41
|
+
// Manual preconditions can't be created safely → skip the test, documenting what a human must set up.
|
|
42
|
+
const skip = manual.length > 0
|
|
43
|
+
? `\n test.skip(true, 'MANUAL precondition(s): ${esc(manual.map((m) => m.description).join("; "))}');`
|
|
44
|
+
: "";
|
|
45
|
+
L.push(`test('${esc(journey.title)}', async ({ page }) => {${skip}`);
|
|
46
|
+
let prevPage = "";
|
|
47
|
+
for (const step of journey.steps) {
|
|
48
|
+
L.push(` await test.step(${JSON.stringify(step.action)}, async () => {`);
|
|
49
|
+
if (step.page !== prevPage) {
|
|
50
|
+
L.push(` await page.goto('${step.page}');`);
|
|
51
|
+
prevPage = step.page;
|
|
52
|
+
}
|
|
53
|
+
for (const ref of step.elementRefs) {
|
|
54
|
+
const loc = locator(step.page, ref);
|
|
55
|
+
if (loc)
|
|
56
|
+
L.push(` await expect(${loc}).toBeVisible();`); // read-only across the whole journey
|
|
57
|
+
}
|
|
58
|
+
L.push(" });");
|
|
59
|
+
}
|
|
60
|
+
L.push("});", "");
|
|
61
|
+
return { path: `journeys/${journey.id}.spec.ts`, content: L.join("\n") };
|
|
62
|
+
}
|
|
63
|
+
/** Map journeys + their setup plans → a @playwright/test suite (one spec per journey). */
|
|
64
|
+
export function buildJourneySetupSuite(journeys, plans, graph, baseUrl) {
|
|
65
|
+
return {
|
|
66
|
+
files: journeys.map((j, i) => renderJourneySetup(j, plans[i] ?? { preconditions: [] }, graph, baseUrl)),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=journey-setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey-setup.js","sourceRoot":"","sources":["../../src/codegen/journey-setup.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AA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AAU,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAC3E,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,sBAAsB,CACpC,QAAuB,EACvB,KAAkB,EAClB,KAAgB,EAChB,OAAe;IAEf,OAAO;QACL,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;KACxG,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explore.d.ts","sourceRoot":"","sources":["../../../src/core/modalities/explore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"explore.d.ts","sourceRoot":"","sources":["../../../src/core/modalities/explore.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AAqBhE,eAAO,MAAM,eAAe,EAAE,QAwF7B,CAAC"}
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* printCost + renderRunSummary). The CLI `explore` command is now a thin delegate to this `run`,
|
|
6
6
|
* so its output is identical to the pre-extraction inline action (locked by the C1-02 parity test).
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { readInputFile } from "../../fs/run-dir.js";
|
|
9
9
|
import { runExploration } from "../../agent/index.js";
|
|
10
|
+
import { resolveStyleText } from "../../design/style.js";
|
|
10
11
|
import { renderRunSummary, displayPath } from "../../agent/summary.js";
|
|
11
12
|
import { resolveConfig } from "../config.js";
|
|
12
13
|
import { printCost } from "../reporting.js";
|
|
@@ -20,7 +21,10 @@ export const exploreModality = {
|
|
|
20
21
|
// commander hands the action untyped options; the command's option defs guarantee this shape.
|
|
21
22
|
const opts = ctx.flags;
|
|
22
23
|
const config = resolveConfig({ backend: opts.backend, routing: opts.routing, channel: opts.channel });
|
|
23
|
-
const checklistText = opts.checklist ? await
|
|
24
|
+
const checklistText = opts.checklist ? await readInputFile(opts.checklist, "Checklist") : undefined;
|
|
25
|
+
// #80: --style resolves to a house-style pack (prompts/styles/<v>.md or a path) → {{style}} slot,
|
|
26
|
+
// else the built-in inline hint. Methodology / assertion-safety are never touched.
|
|
27
|
+
const styleText = await resolveStyleText(opts.style);
|
|
24
28
|
ctx.err(`▸ Exploring ${opts.url}${opts.session ? ` (session: ${opts.session})` : ""}${opts.checklist ? ` (checklist: ${opts.checklist})` : ""}…\n`);
|
|
25
29
|
// Progress UX: animate the current step in a TTY (long LLM steps emit no events for ~a minute, so the
|
|
26
30
|
// CLI looked frozen). In a pipe/CI this falls back to one plain ` ▸ <event>` line per event.
|
|
@@ -33,7 +37,13 @@ export const exploreModality = {
|
|
|
33
37
|
headed: opts.headed,
|
|
34
38
|
checklistText,
|
|
35
39
|
style: opts.style,
|
|
40
|
+
styleText,
|
|
36
41
|
fresh: opts.fresh,
|
|
42
|
+
critique: opts.critique,
|
|
43
|
+
flow: opts.flow,
|
|
44
|
+
maxPages: opts.flow ? Number(opts.maxPages) || 3 : undefined,
|
|
45
|
+
setup: opts.setup,
|
|
46
|
+
gaps: opts.gaps,
|
|
37
47
|
onProgress: progress.event,
|
|
38
48
|
}).finally(() => progress.stop());
|
|
39
49
|
ctx.out(`\n=== Exploration of ${result.study.url} (run ${result.runId}) ===\n`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explore.js","sourceRoot":"","sources":["../../../src/core/modalities/explore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"explore.js","sourceRoot":"","sources":["../../../src/core/modalities/explore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cA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ACvB,CAAC;QACD,iGAAiG;QACjG,IAAI,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpC,GAAG,CAAC,GAAG,CAAC,0BAA0B,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QAC/E,CAAC;QACD,GAAG,CAAC,GAAG,CACL,4FAA4F,CAC7F,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -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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C,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzE,OAAO;QACL,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE;YACL,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,KAAK,EAAE,KAAK,CAAC,MAAM;YACnB,MAAM,EAAE,YAAY,CAAC,MAAM;YAC3B,YAAY;YACZ,QAAQ,EAAE,aAAa,CAAC,MAAM;YAC9B,uBAAuB,EAAE,UAAU,CAAC,IAAI,GAAG,cAAc,CAAC,MAAM;YAChE,sBAAsB,EAAE,SAAS,CAAC,IAAI,GAAG,cAAc,CAAC,MAAM;YAC9D,eAAe;SAChB;KACF,CAAC;AACJ,CAAC"}
|
package/dist/design/schema.d.ts
CHANGED
|
@@ -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,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAuD,CAAC;AAEvF,2CAA2C;AAC3C,MAAM,WAAW,QAAS,SAAQ,YAAY;IAC5C,EAAE,EAAE,MAAM,CAAC;CACZ"}
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/design/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAA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
});
|
|
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,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU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AAqB,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
|