qualiow-exploratory-testing 2.2.1 → 2.3.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/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.env.example +6 -0
- package/CHANGELOG.md +183 -0
- package/README.md +110 -27
- package/agents/qa-bug-judge.md +115 -0
- package/agents/qa-diff-indexer-agent.md +1 -1
- package/agents/qa-gather-agent.md +1 -1
- package/agents/qa-reporting-agent.md +15 -4
- package/bin/mobile-cli.mjs +74 -26
- package/bin/qualiow +7 -2
- package/bin/wk-ios +60 -6
- package/bin/wkeval.mjs +7 -2
- package/data/security/SECURITY-POLICY.md +17 -1
- package/data/templates/bug-report.md +11 -0
- package/data/templates/session-report.md +12 -4
- package/dist/cli/index.js +1660 -85
- package/dist/index.d.ts +623 -2
- package/dist/index.js +1626 -47
- package/docs/GETTING-STARTED.md +44 -12
- package/docs/MOBILE-SETUP.md +31 -0
- package/hooks/hooks.json +12 -2
- package/hooks/scripts/bash-guard.mjs +242 -0
- package/hooks/scripts/secret-patterns.d.mts +4 -1
- package/hooks/scripts/secret-patterns.mjs +126 -34
- package/hooks/scripts/write-guard.mjs +70 -15
- package/package.json +2 -2
- package/skills/qa-explore/SKILL.md +9 -5
- package/skills/qa-explore/phases/00-setup.md +9 -1
- package/skills/qa-explore/phases/07-reporting.md +186 -11
- package/skills/qa-explore/references/delegation-rules.md +21 -2
- package/skills/qa-explore/references/evidence-triage.md +213 -0
- package/skills/qa-explore/references/output-contract.md +41 -8
- package/skills/qa-explore/references/security-rules.md +31 -2
- package/skills/qa-explore-cleanup/SKILL.md +1 -1
- package/skills/qa-explore-mobile/SKILL.md +13 -3
- package/skills/qa-explore-mobile/references/mobile-edges.md +3 -1
- package/skills/qa-explore-quick/SKILL.md +1 -1
- package/skills/qa-explore-report/SKILL.md +4 -2
- package/skills/qa-gather/SKILL.md +1 -1
- package/skills/qa-knowledge-add/SKILL.md +1 -1
- package/skills/qa-knowledge-list/SKILL.md +1 -1
- package/skills/qa-verify-backend/SKILL.md +1 -1
- package/skills/qa-verify-backend/phases/05-reporting.md +2 -1
|
@@ -1,18 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Secret detection for the write-guard hook.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Carries the same rules as `src/utils/redact.ts`, regex for regex and in the
|
|
5
|
+
* same order (`tests/unit/redact-hardening.test.ts` compares the sources), so a
|
|
6
|
+
* hook denial matches what `qualiow session finalize --redact` would flag on
|
|
7
|
+
* the same text. Kept as a standalone, dependency-free ES module (Node
|
|
8
|
+
* built-ins only, no TS import) because a git-sourced plugin install has
|
|
9
|
+
* neither `dist/` nor `node_modules` to pull the real util from.
|
|
10
|
+
*
|
|
11
|
+
* Every pattern must stay linear on adversarial input: the hook has a timeout,
|
|
12
|
+
* and a hook that times out fails open.
|
|
9
13
|
*
|
|
10
14
|
* `findSecretCategories` never returns the matched text itself — only
|
|
11
15
|
* category names — so the hook that calls it can safely put the result in a
|
|
12
16
|
* denial reason without leaking the secret it found.
|
|
13
17
|
*/
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
// Documentation domains only, matched exactly: `x@corp.example.com` is flagged.
|
|
20
|
+
const EMAIL_ALLOW = /@(?:example\.(?:com|org|net)|localhost)$/i;
|
|
21
|
+
|
|
22
|
+
// A value that is nothing but a redaction placeholder (optionally quoted, optionally
|
|
23
|
+
// after an auth scheme) is already clean; anything more than that is not.
|
|
24
|
+
const REDACTED_VALUE =
|
|
25
|
+
/^\s*\\?["']?(?:(?:bearer|basic|token|digest)\s+)?\[[A-Z0-9_]*REDACTED\]\\?["']?\s*$/i;
|
|
26
|
+
const JSON_LITERAL = /^(?:null|true|false)$/i;
|
|
27
|
+
|
|
28
|
+
const QUOTED = String.raw`\\"[^"\\\n]{1,4096}\\"|"(?:[^"\\\n]|\\.){1,4096}"|'(?:[^'\\\n]|\\.){1,4096}'`;
|
|
29
|
+
const LOOSE = String.raw`["']?[^\s,}"']+`;
|
|
30
|
+
const TOKENISH = String.raw`["']?[^\s,;}"'|]{8,}`;
|
|
31
|
+
const LINE_REST = String.raw`[^\s|](?:[^\r\n|]*[^\s|])?`;
|
|
32
|
+
|
|
33
|
+
function kv(keys, value, sepOps = ':=') {
|
|
34
|
+
return new RegExp(
|
|
35
|
+
String.raw`(${keys})((?:\\?["']|\*\*)?[ \t]*[${sepOps}][ \t]*(?:\*\*[ \t]*)?)(${QUOTED}|${value})`,
|
|
36
|
+
'gi',
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const PEM_HEAD = String.raw`-----BEGIN (?:[A-Z0-9]{1,20} ){0,3}PRIVATE KEY(?: BLOCK)?-----`;
|
|
41
|
+
const PEM_TAIL = String.raw`-----END (?:[A-Z0-9]{1,20} ){0,3}PRIVATE KEY(?: BLOCK)?-----`;
|
|
42
|
+
const NL = String.raw`(?:\r?\n|\\n)`;
|
|
43
|
+
const PEM_BODY = String.raw`(?:${NL}[ \t]*(?:(?:Proc-Type|DEK-Info|Version|Comment|Hash|Charset): [^\r\n]{0,256}|[A-Za-z0-9+/=]+(?:\.{2,}|…)?[ \t]*(?=${NL}|$|["'])|(?=${NL}|$)))*`;
|
|
16
44
|
|
|
17
45
|
function luhnValid(digits) {
|
|
18
46
|
let sum = 0;
|
|
@@ -31,29 +59,46 @@ function luhnValid(digits) {
|
|
|
31
59
|
return sum % 10 === 0;
|
|
32
60
|
}
|
|
33
61
|
|
|
62
|
+
// Key/value rules: the third group is the value; one that is already a placeholder is clean.
|
|
63
|
+
const keyValueFilter = (_match, _key, _sep, value) =>
|
|
64
|
+
!REDACTED_VALUE.test(value) && !JSON_LITERAL.test(value);
|
|
65
|
+
|
|
34
66
|
/**
|
|
35
67
|
* category: name surfaced in denial reasons (never the matched text).
|
|
36
|
-
* re: detection pattern (
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
68
|
+
* re: detection pattern (identical to the redact.ts rule of the same name).
|
|
69
|
+
* filter(match, ...groups): optional extra check a raw regex match can't
|
|
70
|
+
* express (Luhn validity, the example.com allow-list, a value that is
|
|
71
|
+
* already a redaction placeholder).
|
|
40
72
|
*/
|
|
41
73
|
export const SECRET_PATTERNS = [
|
|
42
74
|
{
|
|
43
75
|
category: 'Private key',
|
|
44
|
-
re:
|
|
76
|
+
re: new RegExp(
|
|
77
|
+
String.raw`${PEM_HEAD}(?:(?:(?!-----BEGIN )[\s\S]){0,16384}?${PEM_TAIL}|${PEM_BODY})`,
|
|
78
|
+
'g',
|
|
79
|
+
),
|
|
45
80
|
},
|
|
46
81
|
{
|
|
47
82
|
category: 'JWT',
|
|
48
|
-
re:
|
|
83
|
+
re: /(?<![A-Za-z0-9_-])eyJ[A-Za-z0-9_-]{8,}\.(?:[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{6,}|eyJ[A-Za-z0-9_-]{6,}(?:\.[A-Za-z0-9_-]*)?)/g,
|
|
49
84
|
},
|
|
50
85
|
{
|
|
51
86
|
category: 'Authorization header',
|
|
52
|
-
re:
|
|
87
|
+
re: kv('authorization', LINE_REST),
|
|
88
|
+
filter: keyValueFilter,
|
|
53
89
|
},
|
|
54
90
|
{
|
|
55
91
|
category: 'Cookie header',
|
|
56
|
-
re:
|
|
92
|
+
re: kv('set-cookie|cookie', String.raw`[^\s|=]{1,256}=(?:[^\r\n|]*[^\s|])?`, ':=|'),
|
|
93
|
+
filter: keyValueFilter,
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
category: 'Bearer token',
|
|
97
|
+
re: /\b(bearer|basic)([ \t]+)(?:(?=[A-Za-z._~+/-]*[0-9=])[A-Za-z0-9._~+/=-]{8,}|[A-Za-z0-9._~+/=-]{24,})/gi,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
category: 'AWS secret access key',
|
|
101
|
+
re: /(\b(?:AKIA|ASIA)[0-9A-Z]{16}\b|\[AWS_KEY_REDACTED\])([\s,;:|"'=]{1,8})[A-Za-z0-9/+]{40}(?![A-Za-z0-9/+=])/g,
|
|
57
102
|
},
|
|
58
103
|
{
|
|
59
104
|
category: 'AWS access key id',
|
|
@@ -61,45 +106,77 @@ export const SECRET_PATTERNS = [
|
|
|
61
106
|
},
|
|
62
107
|
{
|
|
63
108
|
category: 'AWS secret access key',
|
|
64
|
-
re:
|
|
109
|
+
re: kv(String.raw`aws_secret_access_key|secret_?access_?key`, String.raw`["']?[^\s,;}"']+`),
|
|
110
|
+
filter: keyValueFilter,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
category: 'AWS session token',
|
|
114
|
+
re: kv(
|
|
115
|
+
String.raw`aws_session_token|session_?token|x-amz-security-token|security_?token`,
|
|
116
|
+
String.raw`["']?[^\s,;}"']+`,
|
|
117
|
+
),
|
|
118
|
+
filter: keyValueFilter,
|
|
65
119
|
},
|
|
66
120
|
{
|
|
67
121
|
category: 'OpenAI-style key',
|
|
68
|
-
re:
|
|
122
|
+
re: /(?<![A-Za-z0-9_-])sk-(?:proj-)?[A-Za-z0-9_-]{20,}/g,
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
category: 'Stripe key',
|
|
126
|
+
re: /(?<![A-Za-z0-9_])(?:(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{10,}|whsec_[A-Za-z0-9+/=]{16,})/g,
|
|
69
127
|
},
|
|
70
128
|
{
|
|
71
129
|
category: 'GitHub token',
|
|
72
130
|
re: /\b(?:gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,})\b/g,
|
|
73
131
|
},
|
|
132
|
+
{
|
|
133
|
+
category: 'GitLab token',
|
|
134
|
+
re: /(?<![A-Za-z0-9_-])glpat-[A-Za-z0-9_-]{20,}/g,
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
category: 'npm token',
|
|
138
|
+
re: /\bnpm_[A-Za-z0-9]{36}\b/g,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
category: 'Google API key',
|
|
142
|
+
re: /\bAIza[0-9A-Za-z_-]{35}/g,
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
category: 'Google OAuth token',
|
|
146
|
+
re: /\bya29\.[0-9A-Za-z_-]{20,}/g,
|
|
147
|
+
},
|
|
74
148
|
{
|
|
75
149
|
category: 'Slack token',
|
|
76
|
-
re:
|
|
150
|
+
re: /(?<![A-Za-z0-9-])xox[abposre](?:\.xox[a-z])?-[A-Za-z0-9-]{10,}/g,
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
category: 'Slack webhook',
|
|
154
|
+
re: /(?:(?:https?:\/\/)?hooks\.slack\.com)?\/services\/T[A-Z0-9]{6,}\/B[A-Z0-9]{6,}\/[A-Za-z0-9]{16,}/g,
|
|
77
155
|
},
|
|
78
156
|
{
|
|
79
157
|
category: 'API key',
|
|
80
|
-
re:
|
|
158
|
+
re: kv(String.raw`x-api-key|api[_-]?key`, TOKENISH),
|
|
159
|
+
filter: keyValueFilter,
|
|
81
160
|
},
|
|
82
161
|
{
|
|
83
162
|
category: 'Password',
|
|
84
|
-
re:
|
|
163
|
+
re: kv('password|passwd|pwd', LOOSE),
|
|
164
|
+
filter: keyValueFilter,
|
|
85
165
|
},
|
|
86
166
|
{
|
|
87
167
|
category: 'Token',
|
|
88
|
-
re:
|
|
168
|
+
re: kv(String.raw`access[_-]?token|refresh[_-]?token|token`, TOKENISH),
|
|
169
|
+
filter: keyValueFilter,
|
|
89
170
|
},
|
|
90
171
|
{
|
|
91
172
|
category: 'Secret',
|
|
92
|
-
re:
|
|
173
|
+
re: kv(String.raw`secret(?:[_-]?(?:key|token|value))?`, LOOSE),
|
|
174
|
+
filter: keyValueFilter,
|
|
93
175
|
},
|
|
94
176
|
{
|
|
95
177
|
category: 'SSN',
|
|
96
178
|
re: /\b\d{3}-\d{2}-\d{4}\b/g,
|
|
97
179
|
},
|
|
98
|
-
{
|
|
99
|
-
category: 'Email',
|
|
100
|
-
re: /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g,
|
|
101
|
-
filter: (match) => !EMAIL_ALLOW.test(match),
|
|
102
|
-
},
|
|
103
180
|
{
|
|
104
181
|
category: 'Credit card number',
|
|
105
182
|
re: /\b\d(?:[ -]?\d){12,18}\b/g,
|
|
@@ -110,26 +187,41 @@ export const SECRET_PATTERNS = [
|
|
|
110
187
|
return luhnValid(digits);
|
|
111
188
|
},
|
|
112
189
|
},
|
|
190
|
+
{
|
|
191
|
+
category: 'Email',
|
|
192
|
+
re: /(?<![A-Za-z0-9._%+-])[A-Za-z0-9._%+-]{1,64}@(?:[A-Za-z0-9-]{1,63}\.){1,8}[A-Za-z]{2,24}\b/g,
|
|
193
|
+
filter: (match) => !EMAIL_ALLOW.test(match),
|
|
194
|
+
},
|
|
113
195
|
];
|
|
114
196
|
|
|
197
|
+
/** Number of secret-shaped matches per category in `text`; never the matched text. */
|
|
198
|
+
export function countSecrets(text) {
|
|
199
|
+
const counts = new Map();
|
|
200
|
+
for (const { category, re, filter } of SECRET_PATTERNS) {
|
|
201
|
+
re.lastIndex = 0;
|
|
202
|
+
let match;
|
|
203
|
+
while ((match = re.exec(text)) !== null) {
|
|
204
|
+
if (match[0].length === 0) re.lastIndex += 1;
|
|
205
|
+
if (filter && !filter(...match)) continue;
|
|
206
|
+
counts.set(category, (counts.get(category) || 0) + 1);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return counts;
|
|
210
|
+
}
|
|
211
|
+
|
|
115
212
|
/** Returns the category names of every secret-shaped pattern found in `text`. */
|
|
116
213
|
export function findSecretCategories(text) {
|
|
117
214
|
const found = new Set();
|
|
118
215
|
for (const { category, re, filter } of SECRET_PATTERNS) {
|
|
216
|
+
if (found.has(category)) continue;
|
|
119
217
|
re.lastIndex = 0;
|
|
120
218
|
let match;
|
|
121
219
|
while ((match = re.exec(text)) !== null) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
if (/REDACTED\]/.test(match[0])) {
|
|
125
|
-
if (match[0].length === 0) re.lastIndex += 1;
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
if (!filter || filter(match[0])) {
|
|
220
|
+
if (match[0].length === 0) re.lastIndex += 1;
|
|
221
|
+
if (!filter || filter(...match)) {
|
|
129
222
|
found.add(category);
|
|
130
223
|
break;
|
|
131
224
|
}
|
|
132
|
-
if (match[0].length === 0) re.lastIndex += 1;
|
|
133
225
|
}
|
|
134
226
|
}
|
|
135
227
|
return [...found];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* PreToolUse hook (matcher: Write|Edit|MultiEdit).
|
|
3
|
+
* PreToolUse hook (matcher: Write|Edit|MultiEdit|NotebookEdit).
|
|
4
4
|
*
|
|
5
5
|
* Denies writing a secret-shaped string into anything under `output/`
|
|
6
6
|
* (excluding `output/**\/snapshots/`, which never ships a report and is
|
|
@@ -8,15 +8,25 @@
|
|
|
8
8
|
* excludes it). Mechanises security rule 3 (redact before disk) instead of
|
|
9
9
|
* relying on the model remembering it.
|
|
10
10
|
*
|
|
11
|
+
* The path is resolved against the hook's `cwd` first, so `snapshots/../bugs/`
|
|
12
|
+
* cannot borrow the snapshots exemption, and `output/` matches in any case
|
|
13
|
+
* (macOS file systems are case-insensitive). An Edit or MultiEdit is judged on
|
|
14
|
+
* the file as it would read afterwards, so a secret assembled across the edit
|
|
15
|
+
* boundary is caught; edits that only remove or keep secrets already there
|
|
16
|
+
* pass, so a file can be cleaned up one value at a time.
|
|
17
|
+
*
|
|
11
18
|
* Node built-ins only, plus the sibling `secret-patterns.mjs` — a
|
|
12
19
|
* git-sourced plugin install has neither `dist/` nor `node_modules`. Never
|
|
13
20
|
* throws and never echoes the matched text back: the denial reason names
|
|
14
21
|
* categories only.
|
|
15
22
|
*/
|
|
16
|
-
import { readFileSync } from 'node:fs';
|
|
17
|
-
import {
|
|
23
|
+
import { readFileSync, statSync } from 'node:fs';
|
|
24
|
+
import { resolve } from 'node:path';
|
|
25
|
+
import { countSecrets, findSecretCategories } from './secret-patterns.mjs';
|
|
18
26
|
|
|
19
|
-
const WRITE_TOOLS = new Set(['Write', 'Edit', 'MultiEdit']);
|
|
27
|
+
const WRITE_TOOLS = new Set(['Write', 'Edit', 'MultiEdit', 'NotebookEdit']);
|
|
28
|
+
// Larger files are judged on the inserted text alone.
|
|
29
|
+
const MAX_POST_EDIT_BYTES = 5 * 1024 * 1024;
|
|
20
30
|
|
|
21
31
|
function deny(reason) {
|
|
22
32
|
process.stdout.write(
|
|
@@ -30,8 +40,8 @@ function deny(reason) {
|
|
|
30
40
|
);
|
|
31
41
|
}
|
|
32
42
|
|
|
33
|
-
|
|
34
|
-
|
|
43
|
+
/** The text the tool inserts, on its own. */
|
|
44
|
+
function insertedText(toolName, toolInput) {
|
|
35
45
|
if (toolName === 'Write') {
|
|
36
46
|
return typeof toolInput.content === 'string' ? toolInput.content : '';
|
|
37
47
|
}
|
|
@@ -44,9 +54,51 @@ function collectText(toolName, toolInput) {
|
|
|
44
54
|
.map((e) => (e && typeof e.new_string === 'string' ? e.new_string : ''))
|
|
45
55
|
.join('\n');
|
|
46
56
|
}
|
|
57
|
+
if (toolName === 'NotebookEdit') {
|
|
58
|
+
return typeof toolInput.new_source === 'string' ? toolInput.new_source : '';
|
|
59
|
+
}
|
|
47
60
|
return '';
|
|
48
61
|
}
|
|
49
62
|
|
|
63
|
+
function applyEdit(content, edit) {
|
|
64
|
+
if (!edit || typeof edit.old_string !== 'string' || typeof edit.new_string !== 'string') {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
if (!edit.old_string || !content.includes(edit.old_string)) return null;
|
|
68
|
+
return edit.replace_all
|
|
69
|
+
? content.split(edit.old_string).join(edit.new_string)
|
|
70
|
+
: content.replace(edit.old_string, () => edit.new_string);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** [before, after] for an Edit/MultiEdit, or null when the file can't be read or an edit won't apply. */
|
|
74
|
+
function postEditContent(toolName, toolInput, absPath) {
|
|
75
|
+
if (toolName !== 'Edit' && toolName !== 'MultiEdit') return null;
|
|
76
|
+
let before;
|
|
77
|
+
try {
|
|
78
|
+
if (statSync(absPath).size > MAX_POST_EDIT_BYTES) return null;
|
|
79
|
+
before = readFileSync(absPath, 'utf-8');
|
|
80
|
+
} catch {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
const edits = toolName === 'Edit' ? [toolInput] : Array.isArray(toolInput.edits) ? toolInput.edits : [];
|
|
84
|
+
let after = before;
|
|
85
|
+
for (const edit of edits) {
|
|
86
|
+
after = applyEdit(after, edit);
|
|
87
|
+
if (after === null) return null;
|
|
88
|
+
}
|
|
89
|
+
return [before, after];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Categories whose match count the edit raises. */
|
|
93
|
+
function introducedCategories(before, after) {
|
|
94
|
+
const was = countSecrets(before);
|
|
95
|
+
const out = [];
|
|
96
|
+
for (const [category, n] of countSecrets(after)) {
|
|
97
|
+
if (n > (was.get(category) || 0)) out.push(category);
|
|
98
|
+
}
|
|
99
|
+
return out;
|
|
100
|
+
}
|
|
101
|
+
|
|
50
102
|
try {
|
|
51
103
|
if (process.env.QUALIOW_HOOKS === 'off') process.exit(0);
|
|
52
104
|
|
|
@@ -62,20 +114,23 @@ try {
|
|
|
62
114
|
if (!WRITE_TOOLS.has(input.tool_name)) process.exit(0);
|
|
63
115
|
|
|
64
116
|
const toolInput = input.tool_input || {};
|
|
65
|
-
const filePath = toolInput.file_path;
|
|
117
|
+
const filePath = input.tool_name === 'NotebookEdit' ? toolInput.notebook_path : toolInput.file_path;
|
|
66
118
|
if (!filePath || typeof filePath !== 'string') process.exit(0);
|
|
67
119
|
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
120
|
+
const cwd = typeof input.cwd === 'string' && input.cwd ? input.cwd : process.cwd();
|
|
121
|
+
const absPath = resolve(cwd, filePath);
|
|
122
|
+
const normalized = absPath.split('\\').join('/');
|
|
123
|
+
const outputAt = normalized.search(/(^|\/)output\//i);
|
|
124
|
+
if (outputAt === -1) process.exit(0);
|
|
125
|
+
if (normalized.slice(outputAt).includes('/snapshots/')) process.exit(0);
|
|
71
126
|
|
|
72
|
-
const
|
|
73
|
-
|
|
127
|
+
const found = new Set(findSecretCategories(insertedText(input.tool_name, toolInput)));
|
|
128
|
+
const edited = postEditContent(input.tool_name, toolInput, absPath);
|
|
129
|
+
if (edited) introducedCategories(edited[0], edited[1]).forEach((c) => found.add(c));
|
|
74
130
|
|
|
75
|
-
|
|
76
|
-
if (categories.length > 0) {
|
|
131
|
+
if (found.size > 0) {
|
|
77
132
|
deny(
|
|
78
|
-
`Refusing to write ${filePath}: it contains ${
|
|
133
|
+
`Refusing to write ${filePath}: it contains ${[...found].join(', ')}. ` +
|
|
79
134
|
'Redact per security-rules.md ([REDACTED]) before writing; ' +
|
|
80
135
|
'qualiow session finalize --redact rewrites an existing file. ' +
|
|
81
136
|
'Set QUALIOW_HOOKS=off to disable.',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qualiow-exploratory-testing",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "qualiow — AI-powered exploratory testing skills for Claude Code: web via playwright-cli, iOS/Android simulators via Maestro/mobile-cli, and backend/API acceptance-criteria verification",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -104,6 +104,6 @@
|
|
|
104
104
|
"@types/node": "^26.1.1",
|
|
105
105
|
"tsup": "^8.4.0",
|
|
106
106
|
"typescript": "^5.9.3",
|
|
107
|
-
"vitest": "^
|
|
107
|
+
"vitest": "^5.0.0"
|
|
108
108
|
}
|
|
109
109
|
}
|
|
@@ -7,8 +7,8 @@ description: >
|
|
|
7
7
|
and writes bug reports that executives act on.
|
|
8
8
|
Use when user says: "explore", "test this site", "find bugs", "QA check", "exploratory session",
|
|
9
9
|
or provides a URL to test.
|
|
10
|
-
argument-hint: "<url> [--target <id>] [--context <file>] [--focus <area>] [--session <dir>]"
|
|
11
|
-
allowed-tools: Bash(playwright-cli:*), Bash(npx playwright-cli:*), Bash(npx playwright:*), Bash(qualiow:*), Bash(npx:*), Bash(wc:*), Bash(diff:*), Read, Write, Glob, Grep
|
|
10
|
+
argument-hint: "<url> [--target <id>] [--context <file>] [--focus <area>] [--session <dir>] [--no-judge]"
|
|
11
|
+
allowed-tools: Bash(playwright-cli:*), Bash(npx playwright-cli:*), Bash(npx playwright:*), Bash(qualiow:*), Bash(npx -y -p qualiow-exploratory-testing qualiow:*), Bash(wc:*), Bash(diff:*), Read, Write, Glob, Grep
|
|
12
12
|
---
|
|
13
13
|
|
|
14
14
|
# Exploratory Testing Session
|
|
@@ -41,6 +41,9 @@ You are a **Principal QA Engineer** with 20+ years of experience. You don't just
|
|
|
41
41
|
# With a saved target config, or reusing a `qualiow explore` pre-flight directory
|
|
42
42
|
/qa-explore --target company-staging --context output/context/SI-2305-context.md
|
|
43
43
|
/qa-explore https://example.com --session output/sessions/2026-09-08-1420-explore-example-com
|
|
44
|
+
|
|
45
|
+
# Skip the phase-7 bug judge for this run (a target can set verification.mode: off instead)
|
|
46
|
+
/qa-explore https://example.com --no-judge
|
|
44
47
|
```
|
|
45
48
|
|
|
46
49
|
## Before You Start
|
|
@@ -51,7 +54,7 @@ You are a **Principal QA Engineer** with 20+ years of experience. You don't just
|
|
|
51
54
|
|
|
52
55
|
## Session Phases
|
|
53
56
|
|
|
54
|
-
Execute each phase in order. Read and follow the linked file. The budget sums to 45 minutes; write to disk after each phase and carry only summaries in context.
|
|
57
|
+
Execute each phase in order. Read and follow the linked file. The budget sums to 45 minutes, plus up to 15 minutes of bug verification in phase 7; write to disk after each phase and carry only summaries in context.
|
|
55
58
|
|
|
56
59
|
| Phase | File | Budget | Summary |
|
|
57
60
|
|-------|------|--------|---------|
|
|
@@ -62,7 +65,7 @@ Execute each phase in order. Read and follow the linked file. The budget sums to
|
|
|
62
65
|
| **Journeys** | `${CLAUDE_SKILL_DIR}/phases/04-journeys.md` | 10 min | End-to-end user journeys, data-integrity verification, cross-page consistency |
|
|
63
66
|
| **Features** | `${CLAUDE_SKILL_DIR}/phases/05-features.md` | 10 min | Deep feature testing with SFDIPOT, business-logic stress, negative space, FEW HICCUPPS |
|
|
64
67
|
| **Edge Cases** | `${CLAUDE_SKILL_DIR}/phases/06-edge-cases.md` | 6 min | Input attacks, race conditions, state manipulation, security, accessibility, empty states |
|
|
65
|
-
| **Reporting** | `${CLAUDE_SKILL_DIR}/phases/07-reporting.md` | 4 min | Stop recording, reflect,
|
|
68
|
+
| **Reporting** | `${CLAUDE_SKILL_DIR}/phases/07-reporting.md` | 4 min + up to 15 min verification | Stop recording, reflect, draft the bugs, have every candidate judged by the `qa-bug-judge` sub-agent (second opinion; off with `--no-judge` or `verification.mode: off`), ship the verified bugs with business impact, session report with a refuted appendix, stats, close the browser session |
|
|
66
69
|
|
|
67
70
|
## References
|
|
68
71
|
|
|
@@ -73,6 +76,7 @@ Consult these as needed throughout the session:
|
|
|
73
76
|
- **`${CLAUDE_SKILL_DIR}/references/security-rules.md`** — prompt-injection resistance, production rule, redaction list, session isolation, output classification
|
|
74
77
|
- **`${CLAUDE_SKILL_DIR}/references/severity-guide.md`** — severity definitions, the "when in doubt go LOWER" rule, risk matrix, priority table
|
|
75
78
|
- **`${CLAUDE_SKILL_DIR}/references/session-rules.md`** — 20 testing-discipline rules: 45-min cap, one bug one report, evidence, risk-proportional time, adapt mid-session, log WHY, AI-bias avoidance
|
|
76
|
-
- **`${CLAUDE_SKILL_DIR}/references/delegation-rules.md`** — what the `qualiow` CLI does instead of you, the never-delegate list (severity, impact, bug reports, verdicts, reflection) and the read thresholds
|
|
79
|
+
- **`${CLAUDE_SKILL_DIR}/references/delegation-rules.md`** — what the `qualiow` CLI does instead of you, the never-delegate list (severity, impact, bug reports, AC verdicts, reflection), the one bounded exception (`qa-bug-judge` rules on whether a claim reproduces) and the read thresholds
|
|
80
|
+
- **`${CLAUDE_SKILL_DIR}/references/evidence-triage.md`** — opt-in, advisory decision-model triage recorded beside the judge's verdict (`verification.mode: triage-shadow`): the `qualiow judge triage` command, providers, what is sent, the `JEV-NNN` / `LAYA-NNN` files, stats
|
|
77
81
|
- **`${CLAUDE_SKILL_DIR}/references/context-integration.md`** — how `--context` changes the session (context file, inline context, blind mode)
|
|
78
82
|
- **`${CLAUDE_SKILL_DIR}/references/playwright-agents-integration.md`** — opt-in handoff to Playwright Test Agents (planner / generator / healer, Playwright 1.56+) when a reproducible bug should become a regression test; requires the optional `@playwright/test` peer dependency
|
|
@@ -8,6 +8,7 @@ Extract from the user message:
|
|
|
8
8
|
- **--context <file>** or inline context text (optional)
|
|
9
9
|
- **--focus <area>**: a specific area or feature (optional)
|
|
10
10
|
- **--session <dir>**: an existing pre-flight directory created by `qualiow explore` (optional)
|
|
11
|
+
- **--no-judge**: skip the adversarial bug judge in phase 7 for this run (optional)
|
|
11
12
|
- **domain**: domain type (optional; auto-detect from the app if not given)
|
|
12
13
|
- **time_box**: 45 min (default and maximum)
|
|
13
14
|
|
|
@@ -22,6 +23,13 @@ Apply the **production rule** from `${CLAUDE_SKILL_DIR}/references/security-rule
|
|
|
22
23
|
resolved hostname now. If it fires, log `[SAFETY] Production detected -- running in read-only mode`
|
|
23
24
|
and carry read-only mode through every later phase.
|
|
24
25
|
|
|
26
|
+
Resolve the **verification mode** for phase 7 the same way: `off` when the run carries
|
|
27
|
+
`--no-judge` or the target sets `verification.mode: off`, otherwise `judge` (a target without
|
|
28
|
+
a `verification` block means `judge`). Either source turns the judge off; nothing on the
|
|
29
|
+
command line turns it back on for a target that set `off`. A target with
|
|
30
|
+
`verification.mode: triage-shadow` resolves to `judge` plus the advisory triage in phase 7
|
|
31
|
+
(`${CLAUDE_SKILL_DIR}/references/evidence-triage.md`); `--no-judge` turns both off.
|
|
32
|
+
|
|
25
33
|
## Step 2: Load Context (if provided)
|
|
26
34
|
|
|
27
35
|
**If `--context <file>` provided:** read the file. It may be a `/qa-gather` context file
|
|
@@ -116,7 +124,7 @@ Write `output/sessions/<session-dir>/progress.json`:
|
|
|
116
124
|
|
|
117
125
|
Append to `session-log.md`:
|
|
118
126
|
```
|
|
119
|
-
[<timestamp>] [PHASE] Setup complete — session <session-dir>, sid <sid>, read_only: <true|false>
|
|
127
|
+
[<timestamp>] [PHASE] Setup complete — session <session-dir>, sid <sid>, read_only: <true|false>, verification: <judge|off|triage-shadow>
|
|
120
128
|
```
|
|
121
129
|
|
|
122
130
|
## Step 6: Optional — Bootstrap Playwright Test Agents (opt-in)
|