@ihyeon/flow-qa 0.10.14 → 0.11.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.ko.md +2 -0
- package/README.md +2 -0
- package/dist/src/cli.js +136 -57
- package/dist/src/rerun.js +28 -0
- package/dist/src/ui/server.js +11 -26
- package/docs/releases.md +4 -0
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -80,6 +80,8 @@ CLI에서는 `flow-qa run cases/task-flow.json --target demo --case TC-001 --cas
|
|
|
80
80
|
|
|
81
81
|
CLI에서는 `flow-qa reruns .flowqa/runs/<원본-실행-ID> --workspace my-qa --lang ko`로 원본에서 직접 시작한 재실행의 상태와 저장 폴더를 찾습니다. 목록에 나온 폴더는 같은 `--workspace`의 `flow-qa report`에 넘기거나 원본 폴더와 함께 `flow-qa compare`에 넘길 수 있습니다. 불완전한 기록은 목록에서 제외합니다.
|
|
82
82
|
|
|
83
|
+
`flow-qa rerun .flowqa/runs/<원본-실행-ID> --workspace my-qa --lang ko`를 실행하면 원본에서 실패·실행 오류가 난 케이스만 원래 등록한 대상에 다시 실행합니다. 새 보고서에 원본 실행 ID가 남으므로 `reruns`와 `compare`에서 결과 변화를 볼 수 있습니다. 실패·오류 케이스가 없으면 새 실행을 만들지 않고 안내와 함께 정상 종료합니다. 저장된 케이스·원본 플로우·대상이 바뀌었다면 실행 전에 중단합니다. 각 케이스에는 독립적인 시작 상태가 필요합니다.
|
|
84
|
+
|
|
83
85
|
`0.8.0`부터 **상세 보고서**에서 케이스·오류 내용을 검색하고 상태별로 좁히거나 **실패·오류만** 볼 수 있습니다. **시도 2회 이상만 보기**(0.8.7)를 켜면 여러 번 시도한 케이스만 표시합니다. 표시 건수와 보고서 전체 케이스 수를 구분하며, Markdown·JSON 다운로드와 실패·오류 재실행 준비는 보고서 전체 범위를 유지합니다. 필터에 맞는 ID만 화면 순서대로 저장하려면 **표시된 케이스 ID 다운로드**(0.8.6)를 선택하세요. 자세한 동작은 [보고서 케이스 탐색](docs/ui.md#explore-cases-in-a-report)을 참고하세요.
|
|
84
86
|
|
|
85
87
|
## 실행 결과 비교
|
package/README.md
CHANGED
|
@@ -80,6 +80,8 @@ From an original report, **Find reruns of this run** shows directly linked runs
|
|
|
80
80
|
|
|
81
81
|
In the CLI, `flow-qa reruns .flowqa/runs/<original-run-id> --workspace my-qa` lists direct reruns with their status and saved directory. Pass a listed directory to `flow-qa report` or compare it with the original using `flow-qa compare` and the same `--workspace`. The command checks the saved reports and skips incomplete entries.
|
|
82
82
|
|
|
83
|
+
Run `flow-qa rerun .flowqa/runs/<original-run-id> --workspace my-qa` to execute only its failed and errored cases against the original registered target. The new report records the original run ID, so `reruns` and `compare` can show what changed. A report with no failed or errored cases prints a message and exits successfully without creating another run. If the saved cases, source flow, or target changed, the command stops before starting a run. Each case must establish its own starting state.
|
|
84
|
+
|
|
83
85
|
From `0.8.0`, **Detailed report** supports case/error-text search, status filters, and **Failed/error only**. Use **At least 2 attempts** (0.8.7) to see only cases with multiple recorded attempts. Counts distinguish displayed matches from all recorded cases. Markdown/JSON downloads and failed/error preparation retain the full report scope. To save just the filtered IDs in the displayed order, choose **Download visible case IDs** (0.8.6). See [report case exploration](docs/ui.md#explore-cases-in-a-report).
|
|
84
86
|
|
|
85
87
|
## Compare recorded runs
|
package/dist/src/cli.js
CHANGED
|
@@ -5,13 +5,14 @@ import { resolve, dirname, basename, join } from 'node:path';
|
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
6
|
import { parseArgs } from 'node:util';
|
|
7
7
|
import { localeFromEnv, localized, localizeProductMessage } from "./i18n.js";
|
|
8
|
-
import { configSchema, idSchema, modelSchema, targetSchema } from "./schema.js";
|
|
8
|
+
import { configSchema, idSchema, modelSchema, suiteSchema, targetSchema } from "./schema.js";
|
|
9
9
|
import { initWorkspace, readConfig, readSuite, sha256, verifySuiteSource, withConfigLock, writeConfig, writeJSON } from "./workspace.js";
|
|
10
10
|
import { buildPlanningPrompt, planFlow } from "./planner.js";
|
|
11
11
|
import { compileSuite } from "./compiler.js";
|
|
12
12
|
import { CaseSelectionError, isReportSelectionValid, selectCases } from "./case-selection.js";
|
|
13
13
|
import { runSuite } from "./engine.js";
|
|
14
14
|
import { MAX_SAVED_REPORT_BYTES, RUN_ID, parseArchivedReportEnvelope, renderSavedMarkdown } from "./report.js";
|
|
15
|
+
import { prepareRerunSelection } from "./rerun.js";
|
|
15
16
|
import { registrationTarget, sameReportTarget, targetLabel } from "./targets.js";
|
|
16
17
|
import { compareCaseSteps } from "./step-comparison.js";
|
|
17
18
|
import { createAgentHandoff, reviewAgentHandoff } from "./agent-handoff.js";
|
|
@@ -38,6 +39,7 @@ Usage: flow-qa <command> [arguments] [options]
|
|
|
38
39
|
agent-review <handoff-dir> <result.json>
|
|
39
40
|
Check agent-supplied findings and evidence references
|
|
40
41
|
report <run-directory> View a saved QA report
|
|
42
|
+
rerun <run-directory> Rerun failed/error cases from a saved report
|
|
41
43
|
reruns <run-directory> List runs prepared from a saved report
|
|
42
44
|
compare <run-a> <run-b> Compare case results and authored steps
|
|
43
45
|
ui [--demo] [--port 4310] Start the local QA UI
|
|
@@ -70,6 +72,7 @@ Local example: flow-qa ui --demo
|
|
|
70
72
|
agent-review <handoff-dir> <result.json>
|
|
71
73
|
에이전트 관찰 결과와 증거 파일 참조 검사
|
|
72
74
|
report <run-directory> 저장된 QA 리포트 보기
|
|
75
|
+
rerun <run-directory> 저장된 실행의 실패·오류 케이스 재실행
|
|
73
76
|
reruns <run-directory> 저장된 리포트에서 시작한 재실행 찾기
|
|
74
77
|
compare <run-a> <run-b> 케이스 결과와 원본 단계 비교
|
|
75
78
|
ui [--demo] [--port 4310] 로컬 QA 화면 실행
|
|
@@ -137,6 +140,82 @@ async function chromiumInstalled() {
|
|
|
137
140
|
return false;
|
|
138
141
|
}
|
|
139
142
|
}
|
|
143
|
+
const SAFE_CASE_NAME = /^[A-Za-z0-9][A-Za-z0-9._-]{0,159}$/;
|
|
144
|
+
async function safeWorkspaceDirectory(workspace, parts, message = 'Invalid workspace path.') {
|
|
145
|
+
let directory = workspace;
|
|
146
|
+
for (const part of parts) {
|
|
147
|
+
directory = join(directory, part);
|
|
148
|
+
const info = await lstat(directory);
|
|
149
|
+
if (!info.isDirectory() || info.isSymbolicLink() || await realpath(directory) !== directory) {
|
|
150
|
+
throw new Error(message);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return directory;
|
|
154
|
+
}
|
|
155
|
+
async function readSafeFile(directory, name, limit) {
|
|
156
|
+
const path = join(directory, name);
|
|
157
|
+
const info = await lstat(path);
|
|
158
|
+
if (!info.isFile() || info.isSymbolicLink() || info.size > limit || await realpath(path) !== path) {
|
|
159
|
+
throw new Error('Invalid saved file path or size.');
|
|
160
|
+
}
|
|
161
|
+
const handle = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
162
|
+
try {
|
|
163
|
+
const opened = await handle.stat();
|
|
164
|
+
if (!opened.isFile() || opened.size > limit)
|
|
165
|
+
throw new Error('Invalid saved file path or size.');
|
|
166
|
+
return await handle.readFile('utf8');
|
|
167
|
+
}
|
|
168
|
+
finally {
|
|
169
|
+
await handle.close();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function savedFlowName(suite, roots) {
|
|
173
|
+
if (!suite.source)
|
|
174
|
+
return undefined;
|
|
175
|
+
const file = suite.source.file;
|
|
176
|
+
const relative = /^(?:\.\/)?flows\/([^/\\]+)$/.exec(file);
|
|
177
|
+
const name = relative?.[1] ?? (roots.includes(dirname(file)) ? basename(file) : undefined);
|
|
178
|
+
if (!name || !SAFE_CASE_NAME.test(name) || name.includes('..') || !name.endsWith('.md')) {
|
|
179
|
+
throw new Error('Invalid source flow path.');
|
|
180
|
+
}
|
|
181
|
+
return name;
|
|
182
|
+
}
|
|
183
|
+
async function savedRunPath(workspace, input, locale) {
|
|
184
|
+
const canonicalWorkspace = await realpath(workspace);
|
|
185
|
+
const root = await safeWorkspaceDirectory(canonicalWorkspace, ['.flowqa', 'runs'], localized(locale, 'Invalid workspace run path.', '작업 공간의 실행 경로가 유효하지 않습니다.'));
|
|
186
|
+
const selectedDir = resolve(workspace, required(input, localized(locale, 'Run directory', '실행 폴더'), locale));
|
|
187
|
+
const id = basename(selectedDir);
|
|
188
|
+
const info = await lstat(selectedDir);
|
|
189
|
+
if (!RUN_ID.test(id) || !info.isDirectory() || info.isSymbolicLink() || await realpath(selectedDir) !== join(root, id)) {
|
|
190
|
+
throw new Error(localized(locale, 'Choose a saved run in this workspace.', '이 작업 공간에 저장된 실행을 선택하세요.'));
|
|
191
|
+
}
|
|
192
|
+
return { canonicalWorkspace, root, id };
|
|
193
|
+
}
|
|
194
|
+
async function readArchivedRun(root, id) {
|
|
195
|
+
const directory = join(root, id);
|
|
196
|
+
const info = await lstat(directory);
|
|
197
|
+
if (!info.isDirectory() || info.isSymbolicLink() || await realpath(directory) !== directory)
|
|
198
|
+
return undefined;
|
|
199
|
+
const report = parseArchivedReportEnvelope(JSON.parse(await readSafeFile(directory, 'qa-report.json', MAX_SAVED_REPORT_BYTES)));
|
|
200
|
+
return report?.runId === id ? report : undefined;
|
|
201
|
+
}
|
|
202
|
+
async function executeRun(options, locale, rerun = false) {
|
|
203
|
+
const controller = new AbortController();
|
|
204
|
+
const interrupt = () => controller.abort();
|
|
205
|
+
process.once('SIGINT', interrupt);
|
|
206
|
+
process.once('SIGTERM', interrupt);
|
|
207
|
+
try {
|
|
208
|
+
const { report, runDir } = await runSuite({ ...options, signal: controller.signal });
|
|
209
|
+
if (report.selection)
|
|
210
|
+
console.log(localized(locale, `${rerun ? 'Selected rerun' : 'Selected run'}: ${report.selection.caseIds.length}/${report.selection.totalCases} cases; the full suite was not evaluated.`, `${rerun ? '선택 재실행' : '선택 실행'}: ${report.selection.totalCases}개 중 ${report.selection.caseIds.length}개. 전체 케이스를 검증한 결과가 아닙니다.`));
|
|
211
|
+
console.log(localized(locale, `Run result: ${report.status}\nQA report: ${resolve(runDir, 'qa-report.md')}\nRaw result: ${resolve(runDir, 'qa-report.json')}`, `실행 결과: ${report.status}\nQA 리포트: ${resolve(runDir, 'qa-report.md')}\n원본 결과: ${resolve(runDir, 'qa-report.json')}`));
|
|
212
|
+
process.exitCode = report.status === 'passed' ? 0 : report.status === 'interrupted' ? 130 : 1;
|
|
213
|
+
}
|
|
214
|
+
finally {
|
|
215
|
+
process.off('SIGINT', interrupt);
|
|
216
|
+
process.off('SIGTERM', interrupt);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
140
219
|
export async function main(args) {
|
|
141
220
|
let locale = localeFromEnv();
|
|
142
221
|
try {
|
|
@@ -319,22 +398,8 @@ export async function main(args) {
|
|
|
319
398
|
throw new Error(localizeProductMessage('Select one or more unique cases from this suite.', locale));
|
|
320
399
|
throw error;
|
|
321
400
|
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
process.once('SIGINT', interrupt);
|
|
325
|
-
process.once('SIGTERM', interrupt);
|
|
326
|
-
try {
|
|
327
|
-
const { report, runDir } = await runSuite({ workspace, suite, config, targetName: required(targetName, '--target', locale), signal: controller.signal,
|
|
328
|
-
...(caseIds ? { caseIds } : {}) });
|
|
329
|
-
if (report.selection)
|
|
330
|
-
console.log(localized(locale, `Selected run: ${report.selection.caseIds.length}/${report.selection.totalCases} cases; the full suite was not evaluated.`, `선택 실행: ${report.selection.totalCases}개 중 ${report.selection.caseIds.length}개. 전체 케이스를 검증한 결과가 아닙니다.`));
|
|
331
|
-
console.log(localized(locale, `Run result: ${report.status}\nQA report: ${resolve(runDir, 'qa-report.md')}\nRaw result: ${resolve(runDir, 'qa-report.json')}`, `실행 결과: ${report.status}\nQA 리포트: ${resolve(runDir, 'qa-report.md')}\n원본 결과: ${resolve(runDir, 'qa-report.json')}`));
|
|
332
|
-
process.exitCode = report.status === 'passed' ? 0 : report.status === 'interrupted' ? 130 : 1;
|
|
333
|
-
}
|
|
334
|
-
finally {
|
|
335
|
-
process.off('SIGINT', interrupt);
|
|
336
|
-
process.off('SIGTERM', interrupt);
|
|
337
|
-
}
|
|
401
|
+
await executeRun({ workspace, suite, config, targetName: required(targetName, '--target', locale),
|
|
402
|
+
...(caseIds ? { caseIds } : {}) }, locale);
|
|
338
403
|
return;
|
|
339
404
|
}
|
|
340
405
|
if (command === 'report') {
|
|
@@ -347,52 +412,66 @@ export async function main(args) {
|
|
|
347
412
|
console.log(content.replace(/\u001b/g, ''));
|
|
348
413
|
return;
|
|
349
414
|
}
|
|
350
|
-
if (command === '
|
|
351
|
-
if (
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
throw new Error(localized(locale, 'Invalid workspace run path.', '작업 공간의 실행 경로가 유효하지 않습니다.'));
|
|
360
|
-
}
|
|
415
|
+
if (command === 'rerun') {
|
|
416
|
+
if (positionals.length !== 2 || values.target !== undefined || values.out !== undefined ||
|
|
417
|
+
values.url !== undefined || values.model !== undefined || values['key-env'] !== undefined || values['prompt-only']) {
|
|
418
|
+
throw new Error(localized(locale, 'rerun accepts one run directory and the saved target.', 'rerun에는 실행 폴더 하나와 저장된 대상만 사용할 수 있습니다.'));
|
|
419
|
+
}
|
|
420
|
+
const { canonicalWorkspace, root: runsRoot, id: originalId } = await savedRunPath(workspace, arg, locale);
|
|
421
|
+
let previous;
|
|
422
|
+
try {
|
|
423
|
+
previous = await readArchivedRun(runsRoot, originalId);
|
|
361
424
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
if (!RUN_ID.test(originalId) || selectedInfo.isSymbolicLink() ||
|
|
366
|
-
await realpath(selectedDir) !== join(root, originalId)) {
|
|
367
|
-
throw new Error(localized(locale, 'Choose a saved run in this workspace.', '이 작업 공간에 저장된 실행을 선택하세요.'));
|
|
425
|
+
catch { /* Invalid or unsafe saved run. */ }
|
|
426
|
+
if (!previous || previous.runId !== originalId) {
|
|
427
|
+
throw new Error(localized(locale, 'This is not a valid saved run.', '유효한 저장 실행이 아닙니다.'));
|
|
368
428
|
}
|
|
369
|
-
const
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
const fileInfo = await lstat(file);
|
|
376
|
-
if (!fileInfo.isFile() || fileInfo.isSymbolicLink() || fileInfo.size > MAX_SAVED_REPORT_BYTES ||
|
|
377
|
-
await realpath(file) !== file)
|
|
378
|
-
return undefined;
|
|
379
|
-
const handle = await open(file, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
380
|
-
let contents;
|
|
429
|
+
const casesRoot = await safeWorkspaceDirectory(canonicalWorkspace, ['cases']);
|
|
430
|
+
const matches = [];
|
|
431
|
+
const flowRoots = [join(canonicalWorkspace, 'flows'), join(workspace, 'flows')];
|
|
432
|
+
for (const file of await readdir(casesRoot)) {
|
|
433
|
+
if (!SAFE_CASE_NAME.test(file) || file.includes('..') || !file.endsWith('.json'))
|
|
434
|
+
continue;
|
|
381
435
|
try {
|
|
382
|
-
const
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
436
|
+
const suite = suiteSchema.parse(JSON.parse(await readSafeFile(casesRoot, file, 1024 * 1024)));
|
|
437
|
+
savedFlowName(suite, flowRoots);
|
|
438
|
+
if (suite.id === previous.suiteId)
|
|
439
|
+
matches.push({ file, suite });
|
|
386
440
|
}
|
|
387
|
-
|
|
388
|
-
|
|
441
|
+
catch { /* Invalid or unsafe case files are absent from the saved library. */ }
|
|
442
|
+
}
|
|
443
|
+
if (matches.length !== 1) {
|
|
444
|
+
throw new Error(localized(locale, matches.length ? 'Multiple saved case files match this report.' : 'No saved case file matches this report.', matches.length ? '이 보고서와 일치하는 케이스 파일이 여러 개입니다.' : '이 보고서와 일치하는 케이스 파일이 없습니다.'));
|
|
445
|
+
}
|
|
446
|
+
const suite = matches[0].suite;
|
|
447
|
+
const flowName = savedFlowName(suite, flowRoots);
|
|
448
|
+
if (flowName) {
|
|
449
|
+
const flowRoot = await safeWorkspaceDirectory(canonicalWorkspace, ['flows']);
|
|
450
|
+
const flow = await readSafeFile(flowRoot, flowName, 128 * 1024);
|
|
451
|
+
if (sha256(flow) !== suite.source.sha256) {
|
|
452
|
+
throw new Error(localized(locale, 'The source flow changed. Save the cases again.', '원본 플로우가 변경됐습니다. 케이스를 다시 저장하세요.'));
|
|
389
453
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
454
|
+
}
|
|
455
|
+
const config = configSchema.parse(JSON.parse(await readSafeFile(canonicalWorkspace, 'flowqa.config.json', 256 * 1024)));
|
|
456
|
+
const prepared = prepareRerunSelection(previous, suite, config);
|
|
457
|
+
if (prepared.caseIds.length === 0) {
|
|
458
|
+
console.log(localizeProductMessage('No failed or errored cases are available to rerun.', locale));
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
if (!prepared.targetMatches) {
|
|
462
|
+
throw new Error(localized(locale, 'The selected target changed. Review it again.', '실행 대상 설정이 변경됐습니다. 다시 확인하세요.'));
|
|
463
|
+
}
|
|
464
|
+
await executeRun({ workspace: canonicalWorkspace, suite, config, targetName: prepared.targetName,
|
|
465
|
+
caseIds: prepared.caseIds, parentRunId: originalId }, locale, true);
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
if (command === 'reruns') {
|
|
469
|
+
if (second)
|
|
470
|
+
throw new Error(localized(locale, 'reruns accepts one run directory.', 'reruns에는 실행 폴더 하나만 지정하세요.'));
|
|
471
|
+
const { root, id: originalId } = await savedRunPath(workspace, arg, locale);
|
|
393
472
|
let original;
|
|
394
473
|
try {
|
|
395
|
-
original = await
|
|
474
|
+
original = await readArchivedRun(root, originalId);
|
|
396
475
|
}
|
|
397
476
|
catch { /* Invalid saved run. */ }
|
|
398
477
|
if (!original)
|
|
@@ -402,7 +481,7 @@ export async function main(args) {
|
|
|
402
481
|
if (!RUN_ID.test(id) || id === originalId)
|
|
403
482
|
continue;
|
|
404
483
|
try {
|
|
405
|
-
const report = await
|
|
484
|
+
const report = await readArchivedRun(root, id);
|
|
406
485
|
if (report?.parentRunId !== originalId)
|
|
407
486
|
continue;
|
|
408
487
|
matches.push({ id, status: report.status, mtime: (await lstat(join(root, id))).mtimeMs });
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { isReportSelectionValid } from "./case-selection.js";
|
|
2
|
+
import { targetFingerprint } from "./targets.js";
|
|
3
|
+
import { sha256 } from "./workspace.js";
|
|
4
|
+
/** Keep CLI and UI reruns tied to the same saved suite, cases, and target. */
|
|
5
|
+
export function prepareRerunSelection(previous, suite, settings) {
|
|
6
|
+
if (sha256(`${JSON.stringify(suite, null, 2)}\n`) !== previous.suiteHash) {
|
|
7
|
+
throw new Error('The saved case file changed since this run. Review it before rerunning.');
|
|
8
|
+
}
|
|
9
|
+
const available = new Set(suite.cases.map((item) => item.id));
|
|
10
|
+
if (previous.cases.some((item) => !item.id.trim() || !available.has(item.id)) ||
|
|
11
|
+
new Set(previous.cases.map((item) => item.id)).size !== previous.cases.length ||
|
|
12
|
+
(!previous.selection && previous.cases.length !== suite.cases.length)) {
|
|
13
|
+
throw new Error('The report cases do not match the saved case file.');
|
|
14
|
+
}
|
|
15
|
+
if (previous.selection && (previous.selection.totalCases !== suite.cases.length ||
|
|
16
|
+
!isReportSelectionValid(previous.cases, previous.selection))) {
|
|
17
|
+
throw new Error('The report selection does not match the saved case file.');
|
|
18
|
+
}
|
|
19
|
+
const failing = new Set(previous.cases.filter((item) => item.status === 'failed' || item.status === 'error').map((item) => item.id));
|
|
20
|
+
const caseIds = suite.cases.filter((item) => failing.has(item.id)).map((item) => item.id);
|
|
21
|
+
const targetName = previous.target.name;
|
|
22
|
+
const expectedFingerprint = targetFingerprint(previous.target);
|
|
23
|
+
const currentTarget = Object.hasOwn(settings.targets, targetName) ? settings.targets[targetName] : undefined;
|
|
24
|
+
return { caseIds, targetName, targetFingerprint: expectedFingerprint,
|
|
25
|
+
targetMatches: Boolean(currentTarget &&
|
|
26
|
+
(suite.platform ?? 'web') === (currentTarget.kind === 'mobile' ? 'mobile' : 'web') &&
|
|
27
|
+
targetFingerprint(currentTarget) === expectedFingerprint) };
|
|
28
|
+
}
|
package/dist/src/ui/server.js
CHANGED
|
@@ -15,12 +15,13 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
|
15
15
|
import { z } from 'zod';
|
|
16
16
|
import { chromium } from 'playwright';
|
|
17
17
|
import { compileSuite } from "../compiler.js";
|
|
18
|
-
import { CaseSelectionError,
|
|
18
|
+
import { CaseSelectionError, selectCases } from "../case-selection.js";
|
|
19
19
|
import { runSuite } from "../engine.js";
|
|
20
20
|
import { localeFromAcceptLanguage, localizeProductMessage } from "../i18n.js";
|
|
21
21
|
import { EvidenceError, readEvidence } from "./evidence.js";
|
|
22
22
|
import { buildPlanningPrompt, planFlow, PlannerError } from "../planner.js";
|
|
23
23
|
import { MAX_SAVED_REPORT_BYTES, RUN_ID, parseArchivedReportEnvelope, renderSavedMarkdown } from "../report.js";
|
|
24
|
+
import { prepareRerunSelection } from "../rerun.js";
|
|
24
25
|
import { compareReports, ComparisonError, renderComparisonMarkdown } from "../run-comparison.js";
|
|
25
26
|
import { configSchema, idSchema, modelSchema, suiteSchema, targetSchema } from "../schema.js";
|
|
26
27
|
import { registrationTarget, targetFingerprint } from "../targets.js";
|
|
@@ -444,33 +445,17 @@ export async function startUIServer(options) {
|
|
|
444
445
|
}
|
|
445
446
|
throw error;
|
|
446
447
|
}
|
|
447
|
-
const
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
(!previous.selection && previous.cases.length !== suite.cases.length)) {
|
|
455
|
-
throw new HTTPError(409, 'The report cases do not match the saved case file.');
|
|
448
|
+
const settings = await config();
|
|
449
|
+
try {
|
|
450
|
+
const prepared = prepareRerunSelection(previous, selected.suite, settings);
|
|
451
|
+
if (prepared.caseIds.length === 0)
|
|
452
|
+
throw new Error('No failed or errored cases are available to rerun.');
|
|
453
|
+
return { originRunId: runId, file, ...selected,
|
|
454
|
+
...prepared };
|
|
456
455
|
}
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
throw new HTTPError(409, 'The report selection does not match the saved case file.');
|
|
456
|
+
catch (error) {
|
|
457
|
+
throw new HTTPError(409, error.message);
|
|
460
458
|
}
|
|
461
|
-
const failing = new Set(previous.cases.filter((item) => item.status === 'failed' || item.status === 'error').map((item) => item.id));
|
|
462
|
-
const caseIds = suite.cases.filter((item) => failing.has(item.id)).map((item) => item.id);
|
|
463
|
-
if (caseIds.length === 0)
|
|
464
|
-
throw new HTTPError(409, 'No failed or errored cases are available to rerun.');
|
|
465
|
-
const settings = await config();
|
|
466
|
-
const targetName = previous.target.name;
|
|
467
|
-
const expectedFingerprint = targetFingerprint(previous.target);
|
|
468
|
-
const currentTarget = Object.hasOwn(settings.targets, targetName) ? settings.targets[targetName] : undefined;
|
|
469
|
-
return { originRunId: runId, file, ...selected, caseIds, targetName,
|
|
470
|
-
targetFingerprint: expectedFingerprint,
|
|
471
|
-
targetMatches: Boolean(currentTarget &&
|
|
472
|
-
(suite.platform ?? 'web') === (currentTarget.kind === 'mobile' ? 'mobile' : 'web') &&
|
|
473
|
-
targetFingerprint(currentTarget) === expectedFingerprint) };
|
|
474
459
|
}
|
|
475
460
|
async function runCandidates() {
|
|
476
461
|
const root = await directory(['.flowqa', 'runs']);
|
package/docs/releases.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Releases and verification
|
|
2
2
|
|
|
3
|
+
## 0.11.0 — rerun failed cases from the CLI
|
|
4
|
+
|
|
5
|
+
`flow-qa rerun <saved-run> --workspace <workspace>` runs the failed or errored cases from an original report against its unchanged registered target. It shares the local UI's checks for the saved suite, selected cases, and target identity. The new report retains `parentRunId`, and `reruns` lists it. A report without failed or errored cases exits successfully with an informational message and creates no run. Changed definitions, source flows, targets, and unsafe saved paths stop before execution.
|
|
6
|
+
|
|
3
7
|
## 0.10.8 — Concurrent configuration updates
|
|
4
8
|
|
|
5
9
|
CLI `connect` and `model` commands and the local UI's target and model settings now lock the same canonical configuration file before reading and saving it. Concurrent commands that update different targets or model roles retain every successful change. The lock is stored in the private `.flowqa` directory beside the actual configuration file, including when a CLI workspace uses a symlink to that file. A terminated writer releases its SQLite lock automatically, so another command can retry. Each save still replaces the complete JSON file after it is written.
|