@ihyeon/flow-qa 0.10.6 → 0.10.7
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 +76 -3
- package/dist/src/report.js +2 -1
- package/dist/src/ui/server.js +2 -3
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -78,6 +78,8 @@ CLI에서는 `flow-qa run cases/task-flow.json --target demo --case TC-001 --cas
|
|
|
78
78
|
|
|
79
79
|
원본 보고서의 **이 실행의 재실행 찾기**를 누르면 저장된 전체 기록에서 직접 연결된 재실행을 찾습니다. 오래된 결과는 **더 불러오기**로 열고, **전체 실행 보기**로 연결 조건을 해제할 수 있습니다.
|
|
80
80
|
|
|
81
|
+
CLI에서는 `flow-qa reruns .flowqa/runs/<원본-실행-ID> --workspace my-qa --lang ko`로 원본에서 직접 시작한 재실행의 상태와 저장 폴더를 찾습니다. 목록에 나온 폴더는 같은 `--workspace`의 `flow-qa report`에 넘기거나 원본 폴더와 함께 `flow-qa compare`에 넘길 수 있습니다. 불완전한 기록은 목록에서 제외합니다.
|
|
82
|
+
|
|
81
83
|
`0.8.0`부터 **상세 보고서**에서 케이스·오류 내용을 검색하고 상태별로 좁히거나 **실패·오류만** 볼 수 있습니다. **시도 2회 이상만 보기**(0.8.7)를 켜면 여러 번 시도한 케이스만 표시합니다. 표시 건수와 보고서 전체 케이스 수를 구분하며, Markdown·JSON 다운로드와 실패·오류 재실행 준비는 보고서 전체 범위를 유지합니다. 필터에 맞는 ID만 화면 순서대로 저장하려면 **표시된 케이스 ID 다운로드**(0.8.6)를 선택하세요. 자세한 동작은 [보고서 케이스 탐색](docs/ui.md#explore-cases-in-a-report)을 참고하세요.
|
|
82
84
|
|
|
83
85
|
## 실행 결과 비교
|
package/README.md
CHANGED
|
@@ -78,6 +78,8 @@ When the saved suite, target, and selected cases still match that preparation, t
|
|
|
78
78
|
|
|
79
79
|
From an original report, **Find reruns of this run** shows directly linked runs across the full saved history. Use **Load more** for older matches or **Show all runs** to clear the relation.
|
|
80
80
|
|
|
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
|
+
|
|
81
83
|
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).
|
|
82
84
|
|
|
83
85
|
## Compare recorded runs
|
package/dist/src/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { constants } from 'node:fs';
|
|
2
2
|
import { spawn } from 'node:child_process';
|
|
3
|
-
import { readFile, writeFile, mkdir, access, stat } from 'node:fs/promises';
|
|
4
|
-
import { resolve, dirname, basename } from 'node:path';
|
|
3
|
+
import { readFile, writeFile, mkdir, access, stat, lstat, readdir, realpath, open } from 'node:fs/promises';
|
|
4
|
+
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";
|
|
@@ -11,7 +11,7 @@ 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
|
-
import { renderSavedMarkdown } from "./report.js";
|
|
14
|
+
import { MAX_SAVED_REPORT_BYTES, RUN_ID, parseArchivedReportEnvelope, renderSavedMarkdown } from "./report.js";
|
|
15
15
|
import { registrationTarget, sameReportTarget, targetLabel } from "./targets.js";
|
|
16
16
|
import { compareCaseSteps } from "./step-comparison.js";
|
|
17
17
|
import { createAgentHandoff, reviewAgentHandoff } from "./agent-handoff.js";
|
|
@@ -38,6 +38,7 @@ Usage: flow-qa <command> [arguments] [options]
|
|
|
38
38
|
agent-review <handoff-dir> <result.json>
|
|
39
39
|
Check agent-supplied findings and evidence references
|
|
40
40
|
report <run-directory> View a saved QA report
|
|
41
|
+
reruns <run-directory> List runs prepared from a saved report
|
|
41
42
|
compare <run-a> <run-b> Compare case results and authored steps
|
|
42
43
|
ui [--demo] [--port 4310] Start the local QA UI
|
|
43
44
|
browser install [--with-deps] Install this package's Playwright Chromium
|
|
@@ -69,6 +70,7 @@ Local example: flow-qa ui --demo
|
|
|
69
70
|
agent-review <handoff-dir> <result.json>
|
|
70
71
|
에이전트 관찰 결과와 증거 파일 참조 검사
|
|
71
72
|
report <run-directory> 저장된 QA 리포트 보기
|
|
73
|
+
reruns <run-directory> 저장된 리포트에서 시작한 재실행 찾기
|
|
72
74
|
compare <run-a> <run-b> 케이스 결과와 원본 단계 비교
|
|
73
75
|
ui [--demo] [--port 4310] 로컬 QA 화면 실행
|
|
74
76
|
browser install [--with-deps] 패키지의 Playwright Chromium 설치
|
|
@@ -335,6 +337,77 @@ export async function main(args) {
|
|
|
335
337
|
console.log(content.replace(/\u001b/g, ''));
|
|
336
338
|
return;
|
|
337
339
|
}
|
|
340
|
+
if (command === 'reruns') {
|
|
341
|
+
if (second)
|
|
342
|
+
throw new Error(localized(locale, 'reruns accepts one run directory.', 'reruns에는 실행 폴더 하나만 지정하세요.'));
|
|
343
|
+
const canonicalWorkspace = await realpath(workspace);
|
|
344
|
+
let root = canonicalWorkspace;
|
|
345
|
+
for (const part of ['.flowqa', 'runs']) {
|
|
346
|
+
root = join(root, part);
|
|
347
|
+
const info = await lstat(root);
|
|
348
|
+
if (!info.isDirectory() || info.isSymbolicLink() || await realpath(root) !== root) {
|
|
349
|
+
throw new Error(localized(locale, 'Invalid workspace run path.', '작업 공간의 실행 경로가 유효하지 않습니다.'));
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
const selectedDir = resolve(workspace, required(arg, localized(locale, 'Run directory', '실행 폴더'), locale));
|
|
353
|
+
const originalId = basename(selectedDir);
|
|
354
|
+
const selectedInfo = await lstat(selectedDir);
|
|
355
|
+
if (!RUN_ID.test(originalId) || selectedInfo.isSymbolicLink() ||
|
|
356
|
+
await realpath(selectedDir) !== join(root, originalId)) {
|
|
357
|
+
throw new Error(localized(locale, 'Choose a saved run in this workspace.', '이 작업 공간에 저장된 실행을 선택하세요.'));
|
|
358
|
+
}
|
|
359
|
+
const readReport = async (id) => {
|
|
360
|
+
const dir = join(root, id);
|
|
361
|
+
const dirInfo = await lstat(dir);
|
|
362
|
+
if (!dirInfo.isDirectory() || dirInfo.isSymbolicLink() || await realpath(dir) !== dir)
|
|
363
|
+
return undefined;
|
|
364
|
+
const file = join(dir, 'qa-report.json');
|
|
365
|
+
const fileInfo = await lstat(file);
|
|
366
|
+
if (!fileInfo.isFile() || fileInfo.isSymbolicLink() || fileInfo.size > MAX_SAVED_REPORT_BYTES ||
|
|
367
|
+
await realpath(file) !== file)
|
|
368
|
+
return undefined;
|
|
369
|
+
const handle = await open(file, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
370
|
+
let contents;
|
|
371
|
+
try {
|
|
372
|
+
const opened = await handle.stat();
|
|
373
|
+
if (!opened.isFile() || opened.size > MAX_SAVED_REPORT_BYTES)
|
|
374
|
+
return undefined;
|
|
375
|
+
contents = await handle.readFile('utf8');
|
|
376
|
+
}
|
|
377
|
+
finally {
|
|
378
|
+
await handle.close();
|
|
379
|
+
}
|
|
380
|
+
const report = parseArchivedReportEnvelope(JSON.parse(contents));
|
|
381
|
+
return report?.runId === id ? report : undefined;
|
|
382
|
+
};
|
|
383
|
+
let original;
|
|
384
|
+
try {
|
|
385
|
+
original = await readReport(originalId);
|
|
386
|
+
}
|
|
387
|
+
catch { /* Invalid saved run. */ }
|
|
388
|
+
if (!original)
|
|
389
|
+
throw new Error(localized(locale, 'This is not a valid saved run.', '유효한 저장 실행이 아닙니다.'));
|
|
390
|
+
const matches = [];
|
|
391
|
+
for (const id of await readdir(root)) {
|
|
392
|
+
if (!RUN_ID.test(id) || id === originalId)
|
|
393
|
+
continue;
|
|
394
|
+
try {
|
|
395
|
+
const report = await readReport(id);
|
|
396
|
+
if (report?.parentRunId !== originalId)
|
|
397
|
+
continue;
|
|
398
|
+
matches.push({ id, status: report.status, mtime: (await lstat(join(root, id))).mtimeMs });
|
|
399
|
+
}
|
|
400
|
+
catch { /* Incomplete or unsafe saved run. */ }
|
|
401
|
+
}
|
|
402
|
+
matches.sort((a, b) => b.mtime - a.mtime || a.id.localeCompare(b.id));
|
|
403
|
+
if (!matches.length) {
|
|
404
|
+
console.log(localized(locale, 'No runs were prepared from this report.', '이 리포트에서 시작한 재실행이 없습니다.'));
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
for (const item of matches)
|
|
408
|
+
console.log(`${item.status}\t.flowqa/runs/${item.id}`);
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
338
411
|
if (command === 'compare') {
|
|
339
412
|
const load = async (dir) => {
|
|
340
413
|
const data = JSON.parse(await readFile(resolve(workspace, required(dir, localized(locale, 'Run directory', '실행 폴더'), locale), 'qa-report.json'), 'utf8'));
|
package/dist/src/report.js
CHANGED
|
@@ -6,7 +6,8 @@ import { isReportSelectionValid } from "./case-selection.js";
|
|
|
6
6
|
import { localized, localizeProductMessage } from "./i18n.js";
|
|
7
7
|
import { idSchema } from "./schema.js";
|
|
8
8
|
import { targetLabel } from "./targets.js";
|
|
9
|
-
const RUN_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
9
|
+
export const RUN_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
10
|
+
export const MAX_SAVED_REPORT_BYTES = 2 * 1024 * 1024;
|
|
10
11
|
const archiveEnvelopeSchema = z.object({
|
|
11
12
|
schemaVersion: z.literal('flow-qa/report-1'), runId: z.string().regex(RUN_ID), suiteId: idSchema,
|
|
12
13
|
parentRunId: z.string().regex(RUN_ID).optional(),
|
package/dist/src/ui/server.js
CHANGED
|
@@ -20,7 +20,7 @@ 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
|
-
import { parseArchivedReportEnvelope, renderSavedMarkdown } from "../report.js";
|
|
23
|
+
import { MAX_SAVED_REPORT_BYTES, RUN_ID, parseArchivedReportEnvelope, renderSavedMarkdown } from "../report.js";
|
|
24
24
|
import { compareReports, ComparisonError, renderComparisonMarkdown } from "../run-comparison.js";
|
|
25
25
|
import { configSchema, idSchema, modelSchema, suiteSchema, targetSchema } from "../schema.js";
|
|
26
26
|
import { registrationTarget, targetFingerprint } from "../targets.js";
|
|
@@ -29,12 +29,11 @@ const MAX_BODY = 256 * 1024;
|
|
|
29
29
|
const MAX_FLOW = 128 * 1024;
|
|
30
30
|
const MAX_CONFIG = 256 * 1024;
|
|
31
31
|
const MAX_SUITE = 512 * 1024;
|
|
32
|
-
const MAX_REPORT =
|
|
32
|
+
const MAX_REPORT = MAX_SAVED_REPORT_BYTES;
|
|
33
33
|
const MAX_STATIC = 4 * 1024 * 1024;
|
|
34
34
|
const PLAN_TIMEOUT_MS = 65_000;
|
|
35
35
|
const CLOSE_WAIT_MS = 10_000;
|
|
36
36
|
const BROWSER_INSTALL_COMMAND = 'flow-qa browser install';
|
|
37
|
-
const RUN_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
38
37
|
const RUN_STATUSES = new Set(['passed', 'failed', 'blocked', 'error', 'interrupted']);
|
|
39
38
|
const RUN_HISTORY_LIMIT = 50;
|
|
40
39
|
const RUN_CURSOR_MAX_LENGTH = 512;
|