@ihyeon/flow-qa 0.9.1 → 0.9.2
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.
|
@@ -22,20 +22,24 @@ export const agentHandoffRequestSchema = z.object({
|
|
|
22
22
|
selection: z.object({ caseIds: z.array(idSchema).min(1).max(100), totalCases: z.number().int().min(2).max(100) }).strict().optional(),
|
|
23
23
|
suite: suiteSchema,
|
|
24
24
|
}).strict();
|
|
25
|
+
const observationSchema = z.object({
|
|
26
|
+
stepIndex: z.number().int().min(0).max(99),
|
|
27
|
+
outcome: z.enum(['matched', 'mismatch']),
|
|
28
|
+
detail: safeDetail,
|
|
29
|
+
evidence: evidencePath,
|
|
30
|
+
}).strict();
|
|
31
|
+
const emptyObservations = z.array(observationSchema).length(0);
|
|
32
|
+
const observedAssertions = z.array(observationSchema).min(1).max(100);
|
|
33
|
+
const agentResultCaseSchema = z.discriminatedUnion('status', [
|
|
34
|
+
z.object({ id: idSchema, status: z.literal('unverified'), observations: emptyObservations }).strict(),
|
|
35
|
+
z.object({ id: idSchema, status: z.literal('blocked'), reason: safeDetail, observations: emptyObservations }).strict(),
|
|
36
|
+
z.object({ id: idSchema, status: z.literal('observed-passed'), observations: observedAssertions }).strict(),
|
|
37
|
+
z.object({ id: idSchema, status: z.literal('observed-failed'), observations: observedAssertions }).strict(),
|
|
38
|
+
]);
|
|
25
39
|
export const agentResultSchema = z.object({
|
|
26
40
|
schemaVersion: z.literal('flow-qa/agent-result-1'),
|
|
27
41
|
requestSha256: hash,
|
|
28
|
-
cases: z.array(
|
|
29
|
-
id: idSchema,
|
|
30
|
-
status: z.enum(['unverified', 'blocked', 'observed-passed', 'observed-failed']),
|
|
31
|
-
reason: safeDetail.optional(),
|
|
32
|
-
observations: z.array(z.object({
|
|
33
|
-
stepIndex: z.number().int().min(0).max(99),
|
|
34
|
-
outcome: z.enum(['matched', 'mismatch']),
|
|
35
|
-
detail: safeDetail,
|
|
36
|
-
evidence: evidencePath,
|
|
37
|
-
}).strict()).max(100),
|
|
38
|
-
}).strict()).min(1).max(100),
|
|
42
|
+
cases: z.array(agentResultCaseSchema).min(1).max(100),
|
|
39
43
|
}).strict();
|
|
40
44
|
function within(parent, child) {
|
|
41
45
|
return child.startsWith(`${parent}${path.sep}`);
|
|
@@ -94,7 +98,7 @@ The registered target URL in \`request.json\` has no credentials, query, or frag
|
|
|
94
98
|
|
|
95
99
|
For a web case, execute steps in order: \`open\` navigates to the target origin plus its app-relative path (a leading \`/\` replaces any base URL path, matching the built-in runner); if the first step is not \`open\`, start at the target origin's \`/\`. \`click\` and \`fill\` use the specified role/name, label, text, or test ID; \`act\` is a natural-language browser action within the target; \`assertVisible\` checks the requested visibility; \`assertText\` checks exact or contained text; \`assertUrl\` checks the expected URL; \`assertAgent\` requires a reasoned observation of its stated condition. If a locator, prerequisite, or expected outcome is unclear, mark that case \`blocked\` and explain why. Stop a case on the first mismatch or blocked prerequisite. Do not invent missing setup or mark a step passed from an action alone.
|
|
96
100
|
|
|
97
|
-
Copy \`agent-result.template.json\` to a new \`agent-result.json\` and fill every selected case ID. Keep \`requestSha256\` unchanged. Use \`unverified\` for cases you did not inspect
|
|
101
|
+
Copy \`agent-result.template.json\` to a new \`agent-result.json\` and fill every selected case ID. Keep \`requestSha256\` unchanged. Use \`unverified\` for cases you did not inspect: omit \`reason\` and leave \`observations\` empty. Use \`blocked\` for cases that cannot be evaluated: include a concrete \`reason\` and leave \`observations\` empty. Use \`observed-passed\` only when every assertion was observed to match, and \`observed-failed\` when an assertion mismatch was observed. For either observed status, omit \`reason\` and record the mismatch explanation in the assertion's \`detail\`. List evaluated assertions in step order; for a failure, stop after the first mismatch. For each evaluated assertion, add its zero-based \`stepIndex\`, \`outcome\`, a concrete \`detail\` describing what appeared, and a file path such as \`evidence/TC-001-step-3.png\` or \`evidence/TC-001-step-3.txt\`. Create the referenced screenshot or text note under this folder's \`evidence/\` directory. Redact secrets and personal data before saving evidence. Do not claim a product defect from one observation; describe the observed mismatch and conditions.
|
|
98
102
|
|
|
99
103
|
Run \`flow-qa agent-review <this-folder> <this-folder>/agent-result.json\` on the reviewer's machine to check completeness and evidence references. The review is an agent-supplied analysis, not an engine-verified \`qa-report.json\` or proof that the agent truly executed the case.
|
|
100
104
|
`;
|
|
@@ -152,17 +156,11 @@ function validateAgentResult(request, result) {
|
|
|
152
156
|
if (testCase.questions.length && item.status !== 'blocked' && item.status !== 'unverified')
|
|
153
157
|
throw new Error(`Case ${item.id} has open questions and cannot be reported as observed.`);
|
|
154
158
|
if (item.status === 'blocked') {
|
|
155
|
-
if (!item.reason || item.observations.length)
|
|
156
|
-
throw new Error(`Case ${item.id} needs a block reason and no observations.`);
|
|
157
159
|
continue;
|
|
158
160
|
}
|
|
159
161
|
if (item.status === 'unverified') {
|
|
160
|
-
if (item.reason || item.observations.length)
|
|
161
|
-
throw new Error(`Case ${item.id} is unverified but contains findings.`);
|
|
162
162
|
continue;
|
|
163
163
|
}
|
|
164
|
-
if (item.reason || !item.observations.length)
|
|
165
|
-
throw new Error(`Case ${item.id} needs assertion observations and no block reason.`);
|
|
166
164
|
for (const [observationIndex, observation] of item.observations.entries()) {
|
|
167
165
|
if (observation.stepIndex !== assertionIndexes[observationIndex])
|
|
168
166
|
throw new Error(`Case ${item.id} has an invalid, duplicate, or out-of-order assertion step index.`);
|
|
@@ -226,7 +224,7 @@ export async function reviewAgentHandoff(directoryPath, resultPath) {
|
|
|
226
224
|
`Observed passed: ${counts['observed-passed']} · observed failed: ${counts['observed-failed']} · blocked: ${counts.blocked} · unverified: ${counts.unverified}`, '',
|
|
227
225
|
...result.cases.flatMap((item) => [
|
|
228
226
|
`## ${safeLine(item.id)} — ${safeLine(item.status)}`,
|
|
229
|
-
...(item.
|
|
227
|
+
...(item.status === 'blocked' ? [`Reason: ${markdownLiteral(item.reason)}`] : []),
|
|
230
228
|
...item.observations.map((observation) => `- Assertion step ${observation.stepIndex}: ${observation.outcome}; ${markdownLiteral(observation.detail)} [${observation.evidence}]`),
|
|
231
229
|
'',
|
|
232
230
|
]),
|
package/docs/releases.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Releases and verification
|
|
2
2
|
|
|
3
|
+
## 0.9.2 — copied-skill installation and agent result contract
|
|
4
|
+
|
|
5
|
+
An independent agent used a generated handoff to observe a real browser failure, then returned an observed-failed case with an explanatory `reason`. The exported JSON Schema allowed that field while `agent-review` already rejected it. Generated schemas and prompts now describe the existing per-status rules: observed outcomes put the explanation in assertion observations and omit the blocking reason; blocked and unverified outcomes retain their distinct reason/observation limits. The result schema version and runtime interpretation are unchanged.
|
|
6
|
+
|
|
7
|
+
The portable skill also identifies the scoped npm package `@ihyeon/flow-qa` and local CLI invocation so a new project does not try to install the binary name as an unscoped package. Focused status-contract regression checks, the full 124-test check, type/UI checks, package checks, and installed-package smoke passed locally. Public package and end-to-end evidence are verified separately for this source.
|
|
8
|
+
|
|
3
9
|
## 0.9.1 — portable AI integration guidance
|
|
4
10
|
|
|
5
11
|
The npm package now includes `skills/flow-qa/` with a self-contained integration skill and workflow reference, `docs/ai.md`, and `llms.txt`. A consumer can copy the whole skill folder from the installed package into a project-local agent directory, without global installation or a new model API. Instructions use the installed CLI and distinguish planning, case review, external agent observations, and native runner reports. Runtime behavior and public result formats are unchanged.
|
package/package.json
CHANGED
package/skills/flow-qa/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: Use Flow QA to turn a user flow into reviewed cases, run a register
|
|
|
5
5
|
|
|
6
6
|
# Flow QA
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Install the CLI in the current project with `npm install --save-dev @ihyeon/flow-qa` if needed. Invoke the project-local CLI as `npx --no-install flow-qa` (for example, `npx --no-install flow-qa init my-qa`). Read [the workflow reference](references/workflow.md) for actual command forms and the choice between a local run and an external agent handoff. This reference travels with this skill when copied out of the npm package.
|
|
9
9
|
|
|
10
10
|
Before execution, review the flow, proposed cases, target, and side effects with the user when their authorization does not already cover them. Keep unknown expected results in case `questions`; never convert an observation or assumed product behavior into a passing assertion. Verify the selected case IDs and target identity before a run or handoff.
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Flow QA CLI workflow
|
|
2
2
|
|
|
3
|
-
Run `flow-qa --help`
|
|
3
|
+
Install `@ihyeon/flow-qa` in the project with `npm install --save-dev @ihyeon/flow-qa` if needed. Run the local CLI with `npx --no-install flow-qa`; prefix each example below with `npx --no-install` when using a project-local install. Run `npx --no-install flow-qa --help` to inspect the installed version. Paths to flows and cases below are relative to `--workspace`; `flow-qa init my-qa` creates a local example and configuration without replacing existing files.
|
|
4
4
|
|
|
5
5
|
## Design and review
|
|
6
6
|
|