sniff-qa 0.8.1 → 0.9.1
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/.claude-plugin/icon.png +0 -0
- package/.claude-plugin/plugin.json +9 -2
- package/CHANGELOG.md +73 -0
- package/NOTICE +7 -4
- package/README.md +169 -102
- package/THIRD-PARTY-NOTICES.md +1800 -0
- package/dist/{accessibility-JXRMWF5Y.js → accessibility-42JOUOGH.js} +8 -2
- package/dist/{anthropic-api-ZR3UEB3Z.js → anthropic-api-VSG2X6FS.js} +7 -5
- package/dist/assert-budget-WG4BRCLX.js +10 -0
- package/dist/{caps-G3ZGJI7B.js → caps-YZPFNPIN.js} +3 -2
- package/dist/{chunk-VEI2O6AK.js → chunk-33JL2AB5.js} +14 -6
- package/dist/{chunk-7ZOFYET5.js → chunk-3E4W4H6S.js} +36 -16
- package/dist/{chunk-EGANHIIE.js → chunk-3NR2K5B3.js} +49 -5
- package/dist/chunk-3ROWRVZE.js +422 -0
- package/dist/{chunk-MYWWSM3V.js → chunk-3YFE3H23.js} +2 -1
- package/dist/{chunk-MMISGY2Q.js → chunk-4F6ZXOPE.js} +2 -1
- package/dist/chunk-A4TTASVS.js +27862 -0
- package/dist/{chunk-IXDUD2UG.js → chunk-AA744N7E.js} +2 -1
- package/dist/chunk-DZMX3VT2.js +267 -0
- package/dist/{chunk-NG2IGCAK.js → chunk-FR5QCJLH.js} +2 -1
- package/dist/{chunk-GV27IOMC.js → chunk-GC47B6MM.js} +2 -1
- package/dist/chunk-HP4TY3UY.js +80 -0
- package/dist/chunk-LZAPYYNR.js +4595 -0
- package/dist/{chunk-ZM6MGWO4.js → chunk-NBJLMLDA.js} +2 -1
- package/dist/chunk-RAGYZ54R.js +15480 -0
- package/dist/{chunk-GX36BPK7.js → chunk-RSGFFRXQ.js} +2 -2
- package/dist/chunk-SOBWDC35.js +38 -0
- package/dist/{chunk-CZKMOAXU.js → chunk-US4HFUCH.js} +3 -2
- package/dist/chunk-YM22FEIA.js +5807 -0
- package/dist/{ci-ISCWZJD3.js → ci-F6FUXT3O.js} +5 -3
- package/dist/{classifier-MWQMQ727.js → classifier-5FQ2FBTO.js} +3 -1
- package/dist/{claude-code-ZFTBQXY4.js → claude-code-J43C22IR.js} +7 -5
- package/dist/{claude-exploration-provider-QJH6IPYU.js → claude-exploration-provider-EWQNNE7D.js} +4 -3
- package/dist/cli/index.js +87 -35
- package/dist/compiler-sfc.cjs-JX56AWNS.js +48568 -0
- package/dist/crawl-KN7SW753.js +26 -0
- package/dist/{crawl-command-RDWGHZC4.js → crawl-command-Y45FIXNK.js} +14 -9
- package/dist/{cross-reference-MHNPSLEN.js → cross-reference-XOOBW6UZ.js} +3 -1
- package/dist/{dev-server-detector-XQ5AYPDT.js → dev-server-detector-FMFVKDJR.js} +3 -1
- package/dist/{discover-QKGMYPHK.js → discover-HA63UA4K.js} +20 -18
- package/dist/dist-3CYER35S.js +8 -0
- package/dist/{domain-UQ34YE4B.js → domain-FU3WIW64.js} +45 -30
- package/dist/{edge-cases-ZADKDZHL.js → edge-cases-B6IV3IKK.js} +3 -1
- package/dist/{element-extractor-OZTFBVKZ.js → element-extractor-QAG4MRUO.js} +18 -6
- package/dist/engine-AXB5O4ZH.js +39 -0
- package/dist/ensure-browsers-TNMHMLRS.js +147 -0
- package/dist/errors-NWB25P4K.js +8 -0
- package/dist/esm-IMWPYLSN.js +3469 -0
- package/dist/{fix-R33D34NP.js → fix-IXOEHAOS.js} +12 -5
- package/dist/{flakiness-OLJAY7CS.js → flakiness-7SSSM4SW.js} +3 -2
- package/dist/flakiness-CBKV4U54.js +12 -0
- package/dist/formatter-N4CC7SCM.js +176 -0
- package/dist/{framework-detector-ISSM2Q2I.js → framework-detector-4ZVHNT7N.js} +3 -1
- package/dist/generator-GGJYWYI2.js +8 -0
- package/dist/index.d.ts +15 -5
- package/dist/index.js +9 -6
- package/dist/{init-IQKT4ANC.js → init-POX5ZJ6V.js} +4 -2
- package/dist/json-4VOVHDQG.js +10 -0
- package/dist/{junit-GL44ATRR.js → junit-V24COOSR.js} +3 -1
- package/dist/{llm-VJAI6H6G.js → llm-TZ2WZGRZ.js} +3 -1
- package/dist/{loader-Z2DUGG5Z.js → loader-AMM63AOJ.js} +12 -3
- package/dist/mcp/server.js +13049 -73
- package/dist/{model-SP6HJN6J.js → model-BL2AID5Q.js} +6 -5
- package/dist/page-hooks-SECSGZR6.js +14 -0
- package/dist/{page-state-extractor-GYYLYRFR.js → page-state-extractor-AP4FQVLY.js} +3 -1
- package/dist/{performance-7HWKY5O2.js → performance-JVEYVBTV.js} +9 -3
- package/dist/{persistence-XLFJ5EY4.js → persistence-SHKJVSIS.js} +5 -4
- package/dist/{persistence-KTCRIGHU.js → persistence-SQ6QT3HP.js} +3 -1
- package/dist/picocolors-3W2AX5TJ.js +6 -0
- package/dist/pixelmatch-GATIVDQX.js +188 -0
- package/dist/png-HTC2G4ZG.js +2093 -0
- package/dist/{prompt-builder-D3FBH534.js → prompt-builder-EI2BFKLZ.js} +4 -2
- package/dist/{provider-BCKFVPTN.js → provider-O3UOALQH.js} +14 -12
- package/dist/{quality-run-YAURB242.js → quality-run-CTLX5YA5.js} +12 -10
- package/dist/{redaction-CHAIVPCF.js → redaction-QNBV5QZ3.js} +4 -3
- package/dist/{registry-5XCXUAYJ.js → registry-JBBTSD7I.js} +3 -1
- package/dist/{repo-analyzer-4OURSITY.js → repo-analyzer-4XITIIAF.js} +6 -4
- package/dist/{report-SDZWX25B.js → report-4UVJL7QV.js} +3 -1
- package/dist/{report-7FQFH4HW.js → report-BOVSPRCR.js} +8 -6
- package/dist/{response-parser-PUGNWF7S.js → response-parser-GHVJSYXQ.js} +3 -2
- package/dist/{route-discoverer-QBZCRQLJ.js → route-discoverer-ZXYJQIYE.js} +15 -8
- package/dist/{runner-RDVVIGBU.js → runner-DOLCFA3S.js} +10 -5
- package/dist/{runner-QHSYX7J2.js → runner-MCSDHFLN.js} +12 -7
- package/dist/{runner-AXZXNWYH.js → runner-MUBXHOIG.js} +10 -4
- package/dist/{scenarios-I7YYVTD2.js → scenarios-T2U6ZDRL.js} +3 -1
- package/dist/sdk-FQKA5HSQ.js +7184 -0
- package/dist/{source-5LS2B7TN.js → source-T5MHBY5G.js} +14 -7
- package/dist/{tiebreak-L5UFNKU2.js → tiebreak-SXBXPT7B.js} +3 -1
- package/dist/{unified-YSOTPG5B.js → unified-NUR2X5JV.js} +23 -21
- package/dist/{update-baselines-JYKUUIZG.js → update-baselines-TMERPIDV.js} +4 -2
- package/dist/version-FEHABGAH.js +10 -0
- package/dist/{visual-EUZG2STF.js → visual-XHFPFQFX.js} +5 -3
- package/dist/{workflow-template-6DADGPHA.js → workflow-template-7C5CCK67.js} +13 -7
- package/dist/{write-report-6RJWN54I.js → write-report-6Q4MXBYD.js} +5 -4
- package/package.json +21 -14
- package/dist/accessibility-JXRMWF5Y.js.map +0 -1
- package/dist/anthropic-api-ZR3UEB3Z.js.map +0 -1
- package/dist/assert-budget-NBF3JYM7.js +0 -9
- package/dist/assert-budget-NBF3JYM7.js.map +0 -1
- package/dist/caps-G3ZGJI7B.js.map +0 -1
- package/dist/chunk-7ZOFYET5.js.map +0 -1
- package/dist/chunk-CZKMOAXU.js.map +0 -1
- package/dist/chunk-EGANHIIE.js.map +0 -1
- package/dist/chunk-GV27IOMC.js.map +0 -1
- package/dist/chunk-GX36BPK7.js.map +0 -1
- package/dist/chunk-IXDUD2UG.js.map +0 -1
- package/dist/chunk-MMISGY2Q.js.map +0 -1
- package/dist/chunk-MYWWSM3V.js.map +0 -1
- package/dist/chunk-NG2IGCAK.js.map +0 -1
- package/dist/chunk-VEI2O6AK.js.map +0 -1
- package/dist/chunk-ZM6MGWO4.js.map +0 -1
- package/dist/ci-ISCWZJD3.js.map +0 -1
- package/dist/classifier-MWQMQ727.js.map +0 -1
- package/dist/claude-code-ZFTBQXY4.js.map +0 -1
- package/dist/claude-exploration-provider-QJH6IPYU.js.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/crawl-ZXZRF4Q7.js +0 -15
- package/dist/crawl-ZXZRF4Q7.js.map +0 -1
- package/dist/crawl-command-RDWGHZC4.js.map +0 -1
- package/dist/cross-reference-MHNPSLEN.js.map +0 -1
- package/dist/dev-server-detector-XQ5AYPDT.js.map +0 -1
- package/dist/discover-QKGMYPHK.js.map +0 -1
- package/dist/domain-UQ34YE4B.js.map +0 -1
- package/dist/edge-cases-ZADKDZHL.js.map +0 -1
- package/dist/element-extractor-OZTFBVKZ.js.map +0 -1
- package/dist/ensure-browsers-AYKMLUHV.js +0 -86
- package/dist/ensure-browsers-AYKMLUHV.js.map +0 -1
- package/dist/errors-RFEOR527.js +0 -7
- package/dist/errors-RFEOR527.js.map +0 -1
- package/dist/fix-R33D34NP.js.map +0 -1
- package/dist/flakiness-OLJAY7CS.js.map +0 -1
- package/dist/flakiness-OVC7KGN2.js +0 -11
- package/dist/flakiness-OVC7KGN2.js.map +0 -1
- package/dist/formatter-HC3LT3VH.js +0 -146
- package/dist/formatter-HC3LT3VH.js.map +0 -1
- package/dist/framework-detector-ISSM2Q2I.js.map +0 -1
- package/dist/generator-HIFV67NI.js +0 -7
- package/dist/generator-HIFV67NI.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/init-IQKT4ANC.js.map +0 -1
- package/dist/json-YDWEB33Q.js +0 -8
- package/dist/json-YDWEB33Q.js.map +0 -1
- package/dist/junit-GL44ATRR.js.map +0 -1
- package/dist/llm-VJAI6H6G.js.map +0 -1
- package/dist/loader-Z2DUGG5Z.js.map +0 -1
- package/dist/mcp/server.js.map +0 -1
- package/dist/model-SP6HJN6J.js.map +0 -1
- package/dist/page-hooks-6RALVZB5.js +0 -13
- package/dist/page-hooks-6RALVZB5.js.map +0 -1
- package/dist/page-state-extractor-GYYLYRFR.js.map +0 -1
- package/dist/performance-7HWKY5O2.js.map +0 -1
- package/dist/persistence-KTCRIGHU.js.map +0 -1
- package/dist/persistence-XLFJ5EY4.js.map +0 -1
- package/dist/prompt-builder-D3FBH534.js.map +0 -1
- package/dist/provider-BCKFVPTN.js.map +0 -1
- package/dist/quality-run-YAURB242.js.map +0 -1
- package/dist/redaction-CHAIVPCF.js.map +0 -1
- package/dist/registry-5XCXUAYJ.js.map +0 -1
- package/dist/repo-analyzer-4OURSITY.js.map +0 -1
- package/dist/report-7FQFH4HW.js.map +0 -1
- package/dist/report-SDZWX25B.js.map +0 -1
- package/dist/response-parser-PUGNWF7S.js.map +0 -1
- package/dist/route-discoverer-QBZCRQLJ.js.map +0 -1
- package/dist/runner-AXZXNWYH.js.map +0 -1
- package/dist/runner-QHSYX7J2.js.map +0 -1
- package/dist/runner-RDVVIGBU.js.map +0 -1
- package/dist/scenarios-I7YYVTD2.js.map +0 -1
- package/dist/source-5LS2B7TN.js.map +0 -1
- package/dist/tiebreak-L5UFNKU2.js.map +0 -1
- package/dist/unified-YSOTPG5B.js.map +0 -1
- package/dist/update-baselines-JYKUUIZG.js.map +0 -1
- package/dist/version-FLE7ZHDX.js +0 -7
- package/dist/version-FLE7ZHDX.js.map +0 -1
- package/dist/visual-EUZG2STF.js.map +0 -1
- package/dist/workflow-template-6DADGPHA.js.map +0 -1
- package/dist/write-report-6RJWN54I.js.map +0 -1
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import { createRequire as __sniffCreateRequire } from 'node:module'; const require = __sniffCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
loadEngine
|
|
4
|
+
} from "./chunk-DZMX3VT2.js";
|
|
5
|
+
import "./chunk-33JL2AB5.js";
|
|
6
|
+
import "./chunk-SOBWDC35.js";
|
|
7
|
+
|
|
1
8
|
// src/scanners/accessibility/index.ts
|
|
2
9
|
import { performance } from "perf_hooks";
|
|
3
10
|
function mapAxeImpact(impact) {
|
|
@@ -42,7 +49,7 @@ var AccessibilityScanner = class {
|
|
|
42
49
|
metadata: { skipped: true }
|
|
43
50
|
};
|
|
44
51
|
}
|
|
45
|
-
const { AxeBuilder } = await import("@axe-core/playwright");
|
|
52
|
+
const { AxeBuilder } = await loadEngine("@axe-core/playwright", () => import("@axe-core/playwright"));
|
|
46
53
|
const a11yConfig = ctx.config.accessibility;
|
|
47
54
|
const standard = a11yConfig?.standard ?? "wcag21aa";
|
|
48
55
|
let tags;
|
|
@@ -99,4 +106,3 @@ var AccessibilityScanner = class {
|
|
|
99
106
|
export {
|
|
100
107
|
AccessibilityScanner
|
|
101
108
|
};
|
|
102
|
-
//# sourceMappingURL=accessibility-JXRMWF5Y.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { createRequire as __sniffCreateRequire } from 'node:module'; const require = __sniffCreateRequire(import.meta.url);
|
|
2
|
+
import "./chunk-SOBWDC35.js";
|
|
3
|
+
|
|
1
4
|
// src/ai/anthropic-api.ts
|
|
2
5
|
var AnthropicAPIProvider = class {
|
|
3
6
|
name = "anthropic-api";
|
|
@@ -8,9 +11,9 @@ var AnthropicAPIProvider = class {
|
|
|
8
11
|
this.model = model;
|
|
9
12
|
}
|
|
10
13
|
async generateTests(context) {
|
|
11
|
-
const { buildSystemPrompt, buildUserPrompt } = await import("./prompt-builder-
|
|
12
|
-
const { parseGeneratedTest } = await import("./response-parser-
|
|
13
|
-
const { default: Anthropic } = await import("
|
|
14
|
+
const { buildSystemPrompt, buildUserPrompt } = await import("./prompt-builder-EI2BFKLZ.js");
|
|
15
|
+
const { parseGeneratedTest } = await import("./response-parser-GHVJSYXQ.js");
|
|
16
|
+
const { default: Anthropic } = await import("./sdk-FQKA5HSQ.js");
|
|
14
17
|
const client = new Anthropic({ apiKey: this.apiKey });
|
|
15
18
|
const systemPrompt = buildSystemPrompt();
|
|
16
19
|
const userPrompt = buildUserPrompt(context);
|
|
@@ -24,7 +27,7 @@ var AnthropicAPIProvider = class {
|
|
|
24
27
|
const rawContent = message.content.filter((block) => block.type === "text").map((block) => block.text).join("\n");
|
|
25
28
|
return parseGeneratedTest(rawContent, context.route.path);
|
|
26
29
|
} catch (err) {
|
|
27
|
-
const { SniffError } = await import("./errors-
|
|
30
|
+
const { SniffError } = await import("./errors-NWB25P4K.js");
|
|
28
31
|
throw new SniffError("ANTHROPIC_API_ERROR", `Anthropic API failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
29
32
|
}
|
|
30
33
|
}
|
|
@@ -32,4 +35,3 @@ var AnthropicAPIProvider = class {
|
|
|
32
35
|
export {
|
|
33
36
|
AnthropicAPIProvider
|
|
34
37
|
};
|
|
35
|
-
//# sourceMappingURL=anthropic-api-ZR3UEB3Z.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire as __sniffCreateRequire } from 'node:module'; const require = __sniffCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
evaluateSeverityBudget,
|
|
4
|
+
printBudgetViolations
|
|
5
|
+
} from "./chunk-FR5QCJLH.js";
|
|
6
|
+
import "./chunk-SOBWDC35.js";
|
|
7
|
+
export {
|
|
8
|
+
evaluateSeverityBudget,
|
|
9
|
+
printBudgetViolations
|
|
10
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRequire as __sniffCreateRequire } from 'node:module'; const require = __sniffCreateRequire(import.meta.url);
|
|
1
2
|
import {
|
|
2
3
|
CAPABILITIES,
|
|
3
4
|
CAPABILITY_TOOL,
|
|
@@ -7,7 +8,8 @@ import {
|
|
|
7
8
|
expandCaps,
|
|
8
9
|
parseCaps,
|
|
9
10
|
resolveTools
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GC47B6MM.js";
|
|
12
|
+
import "./chunk-SOBWDC35.js";
|
|
11
13
|
export {
|
|
12
14
|
CAPABILITIES,
|
|
13
15
|
CAPABILITY_TOOL,
|
|
@@ -18,4 +20,3 @@ export {
|
|
|
18
20
|
parseCaps,
|
|
19
21
|
resolveTools
|
|
20
22
|
};
|
|
21
|
-
//# sourceMappingURL=caps-G3ZGJI7B.js.map
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import { createRequire as __sniffCreateRequire } from 'node:module'; const require = __sniffCreateRequire(import.meta.url);
|
|
2
|
+
|
|
1
3
|
// src/version.ts
|
|
2
4
|
import { readFileSync } from "fs";
|
|
3
5
|
import { join, dirname } from "path";
|
|
4
6
|
import { fileURLToPath } from "url";
|
|
5
7
|
var _version = "";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
var _pkg;
|
|
9
|
+
function getPackageJson() {
|
|
10
|
+
if (_pkg !== void 0) return _pkg;
|
|
11
|
+
_pkg = null;
|
|
8
12
|
try {
|
|
9
13
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
14
|
const paths = [
|
|
@@ -15,8 +19,8 @@ function getVersion() {
|
|
|
15
19
|
try {
|
|
16
20
|
const pkg = JSON.parse(readFileSync(p, "utf-8"));
|
|
17
21
|
if (pkg.version) {
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
_pkg = pkg;
|
|
23
|
+
break;
|
|
20
24
|
}
|
|
21
25
|
} catch {
|
|
22
26
|
continue;
|
|
@@ -24,11 +28,15 @@ function getVersion() {
|
|
|
24
28
|
}
|
|
25
29
|
} catch {
|
|
26
30
|
}
|
|
27
|
-
|
|
31
|
+
return _pkg;
|
|
32
|
+
}
|
|
33
|
+
function getVersion() {
|
|
34
|
+
if (_version) return _version;
|
|
35
|
+
_version = getPackageJson()?.version ?? "0.0.0";
|
|
28
36
|
return _version;
|
|
29
37
|
}
|
|
30
38
|
|
|
31
39
|
export {
|
|
40
|
+
getPackageJson,
|
|
32
41
|
getVersion
|
|
33
42
|
};
|
|
34
|
-
//# sourceMappingURL=chunk-VEI2O6AK.js.map
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
import { createRequire as __sniffCreateRequire } from 'node:module'; const require = __sniffCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
SEV_ORDER,
|
|
4
|
+
fixFirst,
|
|
5
|
+
verdictLine
|
|
6
|
+
} from "./chunk-3NR2K5B3.js";
|
|
7
|
+
import {
|
|
8
|
+
loadEngine
|
|
9
|
+
} from "./chunk-DZMX3VT2.js";
|
|
1
10
|
import {
|
|
2
11
|
redactText,
|
|
3
12
|
redactValue,
|
|
4
13
|
useStorageState
|
|
5
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-RSGFFRXQ.js";
|
|
6
15
|
|
|
7
16
|
// src/crawl/engine.ts
|
|
8
17
|
import { join } from "path";
|
|
@@ -259,7 +268,7 @@ var pageHealthDetector = async (ctx) => {
|
|
|
259
268
|
severity: "high",
|
|
260
269
|
confidence: "likely",
|
|
261
270
|
steps: [`Navigate to ${ctx.route}`, "The page loaded (HTTP 2xx) but rendered no visible content"],
|
|
262
|
-
suggestedFix: "A 200 response rendered an empty document
|
|
271
|
+
suggestedFix: "A 200 response rendered an empty document, likely a client-side render crash or missing data. Check the console for errors and verify the page mounts.",
|
|
263
272
|
dedupeKey: "blank"
|
|
264
273
|
});
|
|
265
274
|
}
|
|
@@ -421,7 +430,7 @@ function issueClassFor(axeId) {
|
|
|
421
430
|
var a11yDetector = async (ctx) => {
|
|
422
431
|
let AxeBuilder;
|
|
423
432
|
try {
|
|
424
|
-
({ AxeBuilder } = await import("@axe-core/playwright"));
|
|
433
|
+
({ AxeBuilder } = await loadEngine("@axe-core/playwright", () => import("@axe-core/playwright")));
|
|
425
434
|
} catch {
|
|
426
435
|
return [];
|
|
427
436
|
}
|
|
@@ -745,7 +754,7 @@ var loadingStateDetector = async (ctx) => {
|
|
|
745
754
|
title: "Failed request shows no error state to the user",
|
|
746
755
|
severity: "medium",
|
|
747
756
|
confidence: "likely",
|
|
748
|
-
steps: [`Navigate to ${ctx.route}`, `A request failed (${f.method} ${f.url} \u2192 ${f.status})`, "The page shows no error message, retry, or fallback
|
|
757
|
+
steps: [`Navigate to ${ctx.route}`, `A request failed (${f.method} ${f.url} \u2192 ${f.status})`, "The page shows no error message, retry, or fallback, so the failure is silent"],
|
|
749
758
|
suggestedFix: "Render a visible error state when a request fails (message + retry), instead of swallowing the error.",
|
|
750
759
|
networkExcerpt: ctx.evidence.networkExcerpt(),
|
|
751
760
|
dedupeKey: "missing-error-state"
|
|
@@ -808,7 +817,7 @@ var flowDetector = async (ctx) => {
|
|
|
808
817
|
title: "Multi-step flow dead-ends (no enabled way forward)",
|
|
809
818
|
severity: "high",
|
|
810
819
|
confidence: "likely",
|
|
811
|
-
steps: [`Navigate to ${ctx.route}`, "Advance past the first step", "Fill the step inputs", "The only forward/finish control stays disabled
|
|
820
|
+
steps: [`Navigate to ${ctx.route}`, "Advance past the first step", "Fill the step inputs", "The only forward/finish control stays disabled, so the flow cannot be completed"],
|
|
812
821
|
suggestedFix: "Enable the forward/finish control when the step is valid, or provide another way to complete the flow.",
|
|
813
822
|
dedupeKey: "dead-end"
|
|
814
823
|
});
|
|
@@ -906,7 +915,7 @@ async function runCrawl(opts) {
|
|
|
906
915
|
});
|
|
907
916
|
const storageState = opts.storageState ? await useStorageState(opts.storageState) : void 0;
|
|
908
917
|
const authOption = storageState ? { storageState } : {};
|
|
909
|
-
const playwright = await import("playwright");
|
|
918
|
+
const playwright = await loadEngine("playwright", () => import("playwright"));
|
|
910
919
|
const browser = await playwright.chromium.launch({ headless });
|
|
911
920
|
const raw = [];
|
|
912
921
|
const visited = [];
|
|
@@ -1123,20 +1132,32 @@ function sevRank(s) {
|
|
|
1123
1132
|
}
|
|
1124
1133
|
|
|
1125
1134
|
// src/crawl/index.ts
|
|
1126
|
-
|
|
1135
|
+
import { relative, isAbsolute } from "path";
|
|
1136
|
+
function displayPath(path, cwd) {
|
|
1137
|
+
if (!cwd || !isAbsolute(path)) return path;
|
|
1138
|
+
const rel = relative(cwd, path);
|
|
1139
|
+
return rel && !rel.startsWith("..") && !isAbsolute(rel) ? rel : path;
|
|
1140
|
+
}
|
|
1127
1141
|
function formatReportText(report, opts = {}) {
|
|
1128
1142
|
const shown = report.findings.filter((f) => opts.all || f.confidence !== "uncertain");
|
|
1129
1143
|
const hidden = report.findings.length - shown.length;
|
|
1144
|
+
const { pagesVisited, linksChecked, durationMs } = report.stats;
|
|
1130
1145
|
const lines = [];
|
|
1131
1146
|
lines.push("");
|
|
1132
|
-
lines.push(`
|
|
1133
|
-
lines.push(
|
|
1147
|
+
lines.push(` VERDICT ${verdictLine(shown, opts.failed)}`);
|
|
1148
|
+
lines.push(
|
|
1149
|
+
` Walked ${pagesVisited} page${pagesVisited === 1 ? "" : "s"}, checked ${linksChecked} link${linksChecked === 1 ? "" : "s"}, in ${(durationMs / 1e3).toFixed(1)}s.` + (hidden > 0 ? ` ${hidden} low-confidence finding${hidden === 1 ? "" : "s"} hidden, show with --all.` : "")
|
|
1150
|
+
);
|
|
1151
|
+
lines.push("");
|
|
1152
|
+
if (shown.length === 0) return lines.join("\n");
|
|
1153
|
+
const first = fixFirst(shown);
|
|
1154
|
+
lines.push(first.length === shown.length ? " Fix these:" : " Fix these first:");
|
|
1155
|
+
first.forEach((f, i) => {
|
|
1156
|
+
lines.push(` ${i + 1}. ${f.title} on ${f.reproduction.route} [${f.severity}]`);
|
|
1157
|
+
});
|
|
1158
|
+
lines.push("");
|
|
1159
|
+
lines.push(" Every finding, with the steps that reproduce it:");
|
|
1134
1160
|
lines.push("");
|
|
1135
|
-
if (shown.length === 0) {
|
|
1136
|
-
lines.push(" No issues found. \u2713");
|
|
1137
|
-
lines.push("");
|
|
1138
|
-
return lines.join("\n");
|
|
1139
|
-
}
|
|
1140
1161
|
const bySev = /* @__PURE__ */ new Map();
|
|
1141
1162
|
for (const f of shown) {
|
|
1142
1163
|
const arr = bySev.get(f.severity) ?? [];
|
|
@@ -1153,7 +1174,7 @@ function formatReportText(report, opts = {}) {
|
|
|
1153
1174
|
for (const s of f.reproduction.steps) lines.push(` - ${s}`);
|
|
1154
1175
|
lines.push(` fix: ${f.suggestedFix}`);
|
|
1155
1176
|
if (f.needsOutOfBandVerification) lines.push(` note: needs out-of-band verification (e.g. confirm the email/job actually completed)`);
|
|
1156
|
-
if (f.reproduction.screenshotPath) lines.push(` shot: ${f.reproduction.screenshotPath}`);
|
|
1177
|
+
if (f.reproduction.screenshotPath) lines.push(` shot: ${displayPath(f.reproduction.screenshotPath, opts.cwd)}`);
|
|
1157
1178
|
lines.push("");
|
|
1158
1179
|
}
|
|
1159
1180
|
}
|
|
@@ -1164,4 +1185,3 @@ export {
|
|
|
1164
1185
|
runCrawl,
|
|
1165
1186
|
formatReportText
|
|
1166
1187
|
};
|
|
1167
|
-
//# sourceMappingURL=chunk-7ZOFYET5.js.map
|
|
@@ -1,5 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
import { createRequire as __sniffCreateRequire } from 'node:module'; const require = __sniffCreateRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/crawl/verdict.ts
|
|
2
4
|
var SEV_ORDER = ["critical", "high", "medium", "low", "info"];
|
|
5
|
+
var CONF_ORDER = ["confirmed", "likely", "uncertain"];
|
|
6
|
+
var DEFAULT_FAIL_ON = ["critical", "high"];
|
|
7
|
+
function rank(order, value) {
|
|
8
|
+
const i = order.indexOf(value);
|
|
9
|
+
return i === -1 ? order.length : i;
|
|
10
|
+
}
|
|
11
|
+
function severityCounts(findings) {
|
|
12
|
+
const parts = [];
|
|
13
|
+
for (const sev of SEV_ORDER) {
|
|
14
|
+
const n = findings.filter((f) => f.severity === sev).length;
|
|
15
|
+
if (n > 0) parts.push(`${n} ${sev}`);
|
|
16
|
+
}
|
|
17
|
+
return parts.join(", ");
|
|
18
|
+
}
|
|
19
|
+
function fixFirst(findings, limit = 3) {
|
|
20
|
+
return [...findings].sort(
|
|
21
|
+
(a, b) => rank(SEV_ORDER, a.severity) - rank(SEV_ORDER, b.severity) || rank(CONF_ORDER, a.confidence) - rank(CONF_ORDER, b.confidence)
|
|
22
|
+
).slice(0, limit);
|
|
23
|
+
}
|
|
24
|
+
function isFailing(findings, failed) {
|
|
25
|
+
return failed ?? findings.some((f) => DEFAULT_FAIL_ON.includes(f.severity));
|
|
26
|
+
}
|
|
27
|
+
function verdictLine(findings, failed) {
|
|
28
|
+
const n = findings.length;
|
|
29
|
+
if (n === 0) return "PASS: no findings";
|
|
30
|
+
const word = isFailing(findings, failed) ? "FAIL" : "PASS";
|
|
31
|
+
const gate = word === "PASS" ? ", none at a failing severity" : "";
|
|
32
|
+
return `${word}: ${n} finding${n === 1 ? "" : "s"} (${severityCounts(findings)})${gate}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// src/crawl/report-html.ts
|
|
3
36
|
var SEV_COLOR = {
|
|
4
37
|
critical: "#ff5c7a",
|
|
5
38
|
high: "#ff8a5c",
|
|
@@ -39,7 +72,10 @@ function renderHtmlReport(report, opts = {}) {
|
|
|
39
72
|
const shown = report.findings;
|
|
40
73
|
const counts = SEV_ORDER.map((s) => ({ s, n: report.summary.bySeverity[s] ?? 0 })).filter((x) => x.n > 0);
|
|
41
74
|
const chips = counts.map((c) => `<span class="chip" style="--c:${SEV_COLOR[c.s]}">${c.n} ${c.s}</span>`).join("");
|
|
42
|
-
const cards = shown.length ? SEV_ORDER.flatMap((sev) => shown.filter((f) => f.severity === sev)).map(findingCard).join("") :
|
|
75
|
+
const cards = shown.length ? SEV_ORDER.flatMap((sev) => shown.filter((f) => f.severity === sev)).map(findingCard).join("") : "";
|
|
76
|
+
const failing = isFailing(shown);
|
|
77
|
+
const first = fixFirst(shown);
|
|
78
|
+
const firstList = first.length ? `<section class="first"><h2>${first.length === shown.length ? "Fix these" : "Fix these first"}</h2><ol>${first.map((f) => `<li>${esc(f.title)} on <span class="route">${esc(f.reproduction.route)}</span> <span class="rule">${esc(f.severity)}</span></li>`).join("")}</ol></section>` : "";
|
|
43
79
|
return `<!doctype html>
|
|
44
80
|
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
|
|
45
81
|
<title>${esc(title)}</title>
|
|
@@ -67,12 +103,16 @@ function renderHtmlReport(report, opts = {}) {
|
|
|
67
103
|
.fix{margin:10px 0 0;color:#cbd5e1;font-size:14px}
|
|
68
104
|
.oob{color:#fbbf24;font-size:13px;margin:8px 0 0}
|
|
69
105
|
.shot{display:inline-block;margin-top:8px;color:#34d399;font-size:13px}
|
|
70
|
-
.
|
|
106
|
+
.verdict{font-size:18px;font-weight:700;margin:0 0 14px;padding:12px 16px;border-radius:10px;color:var(--c);border:1px solid color-mix(in srgb,var(--c) 50%,transparent);background:color-mix(in srgb,var(--c) 10%,transparent)}
|
|
107
|
+
.first{margin:0 0 28px} .first h2{font-size:15px;margin:0 0 6px;color:#aab2c5} .first ol{margin:0}
|
|
108
|
+
.all{font-size:15px;margin:0 0 4px;color:#aab2c5}
|
|
71
109
|
footer{margin-top:40px;color:#5b6275;font-size:12px;text-align:center}
|
|
72
110
|
</style></head>
|
|
73
111
|
<body><div class="wrap">
|
|
74
112
|
<h1>${esc(title)}</h1>
|
|
75
113
|
<p class="sub">Autonomous QA scan of <code>${esc(report.stats.startUrl)}</code></p>
|
|
114
|
+
<p class="verdict" style="--c:${failing ? "#ff5c7a" : "#34d399"}">${esc(verdictLine(shown))}</p>
|
|
115
|
+
${firstList}
|
|
76
116
|
<div>
|
|
77
117
|
<span class="stat">${report.stats.pagesVisited} pages</span>
|
|
78
118
|
<span class="stat">${report.stats.linksChecked} links checked</span>
|
|
@@ -80,12 +120,16 @@ function renderHtmlReport(report, opts = {}) {
|
|
|
80
120
|
<span class="stat">${(report.stats.durationMs / 1e3).toFixed(1)}s</span>
|
|
81
121
|
</div>
|
|
82
122
|
<div class="chips">${chips || '<span class="chip" style="--c:#34d399">0 issues</span>'}</div>
|
|
83
|
-
${cards}
|
|
123
|
+
${cards ? `<h2 class="all">Every finding, with the steps that reproduce it</h2>${cards}` : ""}
|
|
84
124
|
<footer>Generated by sniff \xB7 ${esc(report.runAt)}</footer>
|
|
85
125
|
</div></body></html>`;
|
|
86
126
|
}
|
|
87
127
|
|
|
88
128
|
export {
|
|
129
|
+
SEV_ORDER,
|
|
130
|
+
severityCounts,
|
|
131
|
+
fixFirst,
|
|
132
|
+
isFailing,
|
|
133
|
+
verdictLine,
|
|
89
134
|
renderHtmlReport
|
|
90
135
|
};
|
|
91
|
-
//# sourceMappingURL=chunk-EGANHIIE.js.map
|