@ihyeon/flow-qa 0.10.5 → 0.10.6
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/ui/public/app.js +28 -5
- package/dist/src/ui/public/i18n.js +5 -0
- package/dist/src/ui/server.js +13 -7
- package/docs/ui.md +2 -0
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -76,6 +76,8 @@ CLI에서는 `flow-qa run cases/task-flow.json --target demo --case TC-001 --cas
|
|
|
76
76
|
|
|
77
77
|
준비한 케이스 정의·대상·선택 케이스 그대로 실행하면 새 보고서에 원본 실행 ID가 남습니다. 상세 보고서에서 원본을 열거나 두 결과를 바로 비교할 수 있습니다. 이 조건을 변경해 실행하면 독립 실행으로 저장합니다. 원본 보고서가 삭제돼도 새 보고서는 읽을 수 있으며 원본이 없다는 상태를 표시합니다.
|
|
78
78
|
|
|
79
|
+
원본 보고서의 **이 실행의 재실행 찾기**를 누르면 저장된 전체 기록에서 직접 연결된 재실행을 찾습니다. 오래된 결과는 **더 불러오기**로 열고, **전체 실행 보기**로 연결 조건을 해제할 수 있습니다.
|
|
80
|
+
|
|
79
81
|
`0.8.0`부터 **상세 보고서**에서 케이스·오류 내용을 검색하고 상태별로 좁히거나 **실패·오류만** 볼 수 있습니다. **시도 2회 이상만 보기**(0.8.7)를 켜면 여러 번 시도한 케이스만 표시합니다. 표시 건수와 보고서 전체 케이스 수를 구분하며, Markdown·JSON 다운로드와 실패·오류 재실행 준비는 보고서 전체 범위를 유지합니다. 필터에 맞는 ID만 화면 순서대로 저장하려면 **표시된 케이스 ID 다운로드**(0.8.6)를 선택하세요. 자세한 동작은 [보고서 케이스 탐색](docs/ui.md#explore-cases-in-a-report)을 참고하세요.
|
|
80
82
|
|
|
81
83
|
## 실행 결과 비교
|
package/README.md
CHANGED
|
@@ -76,6 +76,8 @@ From `0.5.0`, open a detailed report and choose **Prepare failed/error cases** t
|
|
|
76
76
|
|
|
77
77
|
When the saved suite, target, and selected cases still match that preparation, the new report records the original run ID. Open or compare the original from the detailed report. If you change those inputs, the new result is saved as an independent run. An unavailable original is identified without hiding the new report.
|
|
78
78
|
|
|
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
|
+
|
|
79
81
|
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).
|
|
80
82
|
|
|
81
83
|
## Compare recorded runs
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
const t = i18n.t;
|
|
6
6
|
const names = { scenario: 'nav.scenario', library: 'nav.library', history: 'nav.history', settings: 'nav.settings' };
|
|
7
7
|
const defaultReportFilter = () => ({ search: '', status: 'all', sort: 'recorded', repeatedOnly: false });
|
|
8
|
-
const app = { state: null, connected: false, displayTargets: [], draft: null, selectedCaseIds: new Set(), script: '', neutralScript: '', scriptRevision: 0, savedFile: '', savedHash: '', origin: 'none', sourceFlow: '', boundSource: null, stale: false, dirty: false, busy: false, planning: false, planRequest: 0, stopping: false, report: null, reportParent: null, reportMarkdown: '', selectedRun: '', reportFilter: defaultReportFilter(), rerunOrigin: null, rerunTargetMismatch: false, navigationVersion: 0, comparison: null, comparisonRequest: 0, comparisonBusy: false, comparisonStatus: 'comparison.selectBoth', comparisonPins: { baseline: null, current: null }, comparisonSelectionGeneration: 0, comparisonValidation: null, history: { runs: [], nextCursor: null, pagesLoaded: 0, loaded: false, loading: false, request: 0, debounce: null, kind: null, error: null, updatesAvailable: false, pendingRecentUpdate: false }, view: 'scenario' };
|
|
8
|
+
const app = { state: null, connected: false, displayTargets: [], draft: null, selectedCaseIds: new Set(), script: '', neutralScript: '', scriptRevision: 0, savedFile: '', savedHash: '', origin: 'none', sourceFlow: '', boundSource: null, stale: false, dirty: false, busy: false, planning: false, planRequest: 0, stopping: false, report: null, reportParent: null, reportMarkdown: '', selectedRun: '', reportFilter: defaultReportFilter(), rerunOrigin: null, rerunTargetMismatch: false, navigationVersion: 0, comparison: null, comparisonRequest: 0, comparisonBusy: false, comparisonStatus: 'comparison.selectBoth', comparisonPins: { baseline: null, current: null }, comparisonSelectionGeneration: 0, comparisonValidation: null, history: { runs: [], nextCursor: null, pagesLoaded: 0, loaded: false, loading: false, request: 0, debounce: null, kind: null, error: null, updatesAvailable: false, pendingRecentUpdate: false, parentRunId: '' }, view: 'scenario' };
|
|
9
9
|
|
|
10
10
|
function el(tag, className, value) {
|
|
11
11
|
const node = document.createElement(tag);
|
|
@@ -303,23 +303,33 @@
|
|
|
303
303
|
const button = el('button', 'button', t('app.load')); button.type = 'button'; button.addEventListener('click', () => loadSuite(suite.file)); row.append(copy, button); host.append(row);
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
function historyFilters() { return { query: $('history-search').value.trim(), status: $('history-status-filter').value }; }
|
|
306
|
+
function historyFilters() { return { query: $('history-search').value.trim(), status: $('history-status-filter').value, parentRunId: app.history.parentRunId }; }
|
|
307
307
|
function renderHistory() {
|
|
308
308
|
const history = app.history;
|
|
309
309
|
const host = $('history-list'); replace(host);
|
|
310
310
|
host.setAttribute('aria-busy', String(history.loading));
|
|
311
311
|
if (!history.runs.length) {
|
|
312
|
-
const { query, status } = historyFilters();
|
|
312
|
+
const { query, status, parentRunId } = historyFilters();
|
|
313
313
|
const key = history.loading ? 'history.loading' : history.error && !history.loaded ? 'history.loadError'
|
|
314
|
-
:
|
|
314
|
+
: parentRunId && status ? 'history.noRerunsWithStatus'
|
|
315
|
+
: parentRunId ? 'history.noReruns' : query ? 'app.historyNoSearchMatches' : status ? 'app.historyNoStatusMatches'
|
|
315
316
|
: app.state?.active ? 'app.historyActiveEmpty' : 'app.historyEmpty';
|
|
316
317
|
host.append(el('p', 'empty', t(key)));
|
|
317
318
|
}
|
|
319
|
+
if (history.parentRunId) {
|
|
320
|
+
const relation = el('div', 'actions');
|
|
321
|
+
relation.append(el('p', 'hint', t('history.relatedTo', { runId: history.parentRunId })));
|
|
322
|
+
const clear = el('button', 'button quiet', t('history.showAllRuns'));
|
|
323
|
+
clear.type = 'button'; clear.dataset.action = 'clear-related-runs';
|
|
324
|
+
clear.addEventListener('click', () => { history.parentRunId = ''; refreshHistory(); });
|
|
325
|
+
relation.append(clear); host.prepend(relation);
|
|
326
|
+
}
|
|
318
327
|
const pair = comparisonPair();
|
|
319
328
|
for (const run of history.runs) {
|
|
320
329
|
const row = el('div', 'list-row history-run-row'); row.dataset.runId = run.runId;
|
|
321
330
|
const copy = el('div'); copy.append(el('strong', '', `${run.suiteId} · ${i18n.status(run.status)}`), el('small', '', t('app.runMeta', { date: formatDate(run.startedAt), target: targetDisplay(run.target), passed: run.passedCount ?? 0, total: run.caseCount ?? 0, id: run.runId })));
|
|
322
331
|
const scope = selectionScope(run.selection); if (scope) copy.append(el('small', 'selection-scope', scope));
|
|
332
|
+
if (run.parentRunId) copy.append(el('small', 'hint', t('history.parentRun', { runId: run.parentRunId })));
|
|
323
333
|
const actions = el('div', 'run-row-actions');
|
|
324
334
|
const button = el('button', 'button', t('app.viewReport')); button.type = 'button'; button.dataset.action = 'view-report'; button.disabled = run.status === 'running' || run.status === 'stopping'; button.addEventListener('click', () => loadReport(run.runId)); actions.append(button);
|
|
325
335
|
for (const [role, label] of [['baseline', 'comparison.useBaseline'], ['current', 'comparison.useCurrent']]) {
|
|
@@ -347,6 +357,7 @@
|
|
|
347
357
|
const history = app.history;
|
|
348
358
|
const append = cursor !== null;
|
|
349
359
|
const params = new URLSearchParams({ query: filters.query, status: filters.status, limit: '50' });
|
|
360
|
+
if (filters.parentRunId) params.set('parentRunId', filters.parentRunId);
|
|
350
361
|
if (append) params.set('cursor', cursor);
|
|
351
362
|
try {
|
|
352
363
|
const result = await api(`/api/runs?${params}`);
|
|
@@ -398,6 +409,14 @@
|
|
|
398
409
|
renderHistory();
|
|
399
410
|
void fetchHistoryPage(request, historyFilters(), history.nextCursor);
|
|
400
411
|
}
|
|
412
|
+
function showRelatedRuns(runId) {
|
|
413
|
+
app.history.parentRunId = runId;
|
|
414
|
+
$('history-search').value = '';
|
|
415
|
+
$('history-status-filter').value = '';
|
|
416
|
+
view('history');
|
|
417
|
+
refreshHistory();
|
|
418
|
+
$('history-list').scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
419
|
+
}
|
|
401
420
|
function recentRunsChanged() {
|
|
402
421
|
const history = app.history;
|
|
403
422
|
if (history.loading) { history.pendingRecentUpdate = true; return; }
|
|
@@ -915,6 +934,10 @@
|
|
|
915
934
|
}
|
|
916
935
|
host.append(parent);
|
|
917
936
|
}
|
|
937
|
+
const related = el('button', 'button quiet', t('history.findReruns'));
|
|
938
|
+
related.type = 'button'; related.dataset.action = 'find-reruns';
|
|
939
|
+
related.addEventListener('click', () => showRelatedRuns(report.runId));
|
|
940
|
+
host.append(related);
|
|
918
941
|
if (report.usage) host.append(el('p', 'hint', t('app.usage', { tokens: report.usage.modelTokens ?? t('app.unavailable'), cost: typeof report.usage.estimatedCostUsd === 'number' ? `$${report.usage.estimatedCostUsd.toFixed(4)}` : t('app.unavailable') })));
|
|
919
942
|
if (report.errors?.length) host.append(el('p', 'report-errors', report.errors.join('\n')));
|
|
920
943
|
const caseList = el('div'); caseList.id = 'report-case-list'; host.append(caseList);
|
|
@@ -954,7 +977,7 @@
|
|
|
954
977
|
window.addEventListener('beforeunload', warnBeforeUnload);
|
|
955
978
|
document.querySelectorAll('[data-view]').forEach((button) => button.addEventListener('click', () => view(button.dataset.view)));
|
|
956
979
|
$('library-search').addEventListener('input', renderLibrary);
|
|
957
|
-
$('history-search').addEventListener('input', () => refreshHistory(150));
|
|
980
|
+
$('history-search').addEventListener('input', () => { app.history.parentRunId = ''; refreshHistory(150); });
|
|
958
981
|
$('history-status-filter').addEventListener('change', () => refreshHistory());
|
|
959
982
|
$('history-refresh').addEventListener('click', () => refreshHistory());
|
|
960
983
|
$('history-load-more').addEventListener('click', loadMoreHistory);
|
|
@@ -99,6 +99,11 @@
|
|
|
99
99
|
'history.loadError': ['Could not load run history. Try Refresh history.', '실행 기록을 불러오지 못했습니다. 실행 기록 새로고침을 눌러 다시 시도하세요.'],
|
|
100
100
|
'history.loadMoreError': ['Could not load more runs. Retry loading more.', '실행 기록을 더 불러오지 못했습니다. 다시 시도하세요.'],
|
|
101
101
|
'history.updatesAvailable': ['Recent runs changed. Refresh history to update this list.', '최근 실행 기록이 변경됐습니다. 실행 기록을 새로고침해 목록을 갱신하세요.'],
|
|
102
|
+
'history.findReruns': ['Find reruns of this run', '이 실행의 재실행 찾기'],
|
|
103
|
+
'history.relatedTo': ['Reruns of {runId}', '실행 {runId}의 재실행'],
|
|
104
|
+
'history.noReruns': ['No linked reruns match these filters.', '조건에 맞는 연결된 재실행이 없습니다.'],
|
|
105
|
+
'history.noRerunsWithStatus': ['No linked reruns have this status. Choose another status or All statuses.', '이 상태에 해당하는 연결된 재실행이 없습니다. 다른 상태나 전체 상태를 선택하세요.'],
|
|
106
|
+
'history.showAllRuns': ['Show all runs', '전체 실행 보기'],
|
|
102
107
|
'comparison.title': ['Compare two runs', '실행 2건 비교'],
|
|
103
108
|
'comparison.help': ['Select a baseline and current run from history or the lists below. Inspect detailed reports for evidence.', '실행 기록이나 아래 목록에서 기준 실행과 현재 실행을 선택하세요. 증거는 상세 보고서에서 확인하세요.'],
|
|
104
109
|
'comparison.baseline': ['Baseline run', '기준 실행'],
|
package/dist/src/ui/server.js
CHANGED
|
@@ -79,8 +79,8 @@ class HTTPError extends Error {
|
|
|
79
79
|
}
|
|
80
80
|
function invalid(message = 'Invalid input.') { throw new HTTPError(400, message); }
|
|
81
81
|
function notFound() { throw new HTTPError(404, 'The requested item was not found.'); }
|
|
82
|
-
function runFilterHash(query, status) {
|
|
83
|
-
return sha256(JSON.stringify([query, status]));
|
|
82
|
+
function runFilterHash(query, status, parentRunId) {
|
|
83
|
+
return sha256(JSON.stringify(parentRunId ? [query, status, parentRunId] : [query, status]));
|
|
84
84
|
}
|
|
85
85
|
// The cursor is independent of page size, so clients may change limit between pages.
|
|
86
86
|
function encodeRunCursor(candidate, filterHash) {
|
|
@@ -489,15 +489,18 @@ export async function startUIServer(options) {
|
|
|
489
489
|
return { runId: item.runId, suiteId: item.suiteId, status: item.status, startedAt: item.startedAt,
|
|
490
490
|
finishedAt: item.finishedAt, caseCount: item.cases.length,
|
|
491
491
|
passedCount: item.cases.filter((entry) => entry.status === 'passed' || entry.status === 'flaky').length,
|
|
492
|
-
target: item.target, ...(item.selection ? { selection: item.selection } : {})
|
|
492
|
+
target: item.target, ...(item.selection ? { selection: item.selection } : {}),
|
|
493
|
+
...(item.parentRunId ? { parentRunId: item.parentRunId } : {}) };
|
|
493
494
|
}
|
|
494
|
-
async function runSummaries(limit, query = '', status = '', after) {
|
|
495
|
+
async function runSummaries(limit, query = '', status = '', after, parentRunId = '') {
|
|
495
496
|
const history = [];
|
|
496
497
|
for (const candidate of await runCandidates()) {
|
|
497
498
|
if (after && (candidate.mtime > after.mtime || (candidate.mtime === after.mtime && candidate.id <= after.id)))
|
|
498
499
|
continue;
|
|
499
500
|
try {
|
|
500
501
|
const { report: item } = await report(candidate.id, false);
|
|
502
|
+
if (parentRunId && item.parentRunId !== parentRunId)
|
|
503
|
+
continue;
|
|
501
504
|
if (status && item.status !== status)
|
|
502
505
|
continue;
|
|
503
506
|
if (query && ![item.suiteId, item.runId, item.target.name].some((field) => field.toLowerCase().includes(query)))
|
|
@@ -560,7 +563,7 @@ export async function startUIServer(options) {
|
|
|
560
563
|
return;
|
|
561
564
|
}
|
|
562
565
|
if (url.pathname === '/api/runs') {
|
|
563
|
-
for (const key of ['query', 'status', 'limit', 'cursor']) {
|
|
566
|
+
for (const key of ['query', 'status', 'limit', 'cursor', 'parentRunId']) {
|
|
564
567
|
if (url.searchParams.getAll(key).length > 1)
|
|
565
568
|
invalid();
|
|
566
569
|
}
|
|
@@ -571,14 +574,17 @@ export async function startUIServer(options) {
|
|
|
571
574
|
const status = url.searchParams.get('status') ?? '';
|
|
572
575
|
if (status && !RUN_STATUSES.has(status))
|
|
573
576
|
invalid('Invalid run status.');
|
|
577
|
+
const parentRunId = url.searchParams.get('parentRunId') ?? '';
|
|
578
|
+
if (parentRunId && !RUN_ID.test(parentRunId))
|
|
579
|
+
invalid('Invalid parent run ID.');
|
|
574
580
|
const rawLimit = url.searchParams.get('limit');
|
|
575
581
|
if (rawLimit !== null && !/^(?:[1-9]|[1-4][0-9]|50)$/.test(rawLimit))
|
|
576
582
|
invalid('Invalid run limit.');
|
|
577
583
|
const limit = rawLimit === null ? RUN_HISTORY_LIMIT : Number(rawLimit);
|
|
578
|
-
const filterHash = runFilterHash(normalizedQuery, status);
|
|
584
|
+
const filterHash = runFilterHash(normalizedQuery, status, parentRunId);
|
|
579
585
|
const rawCursor = url.searchParams.get('cursor');
|
|
580
586
|
const after = rawCursor === null ? undefined : decodeRunCursor(rawCursor, filterHash);
|
|
581
|
-
const rows = await runSummaries(limit + 1, normalizedQuery, status, after);
|
|
587
|
+
const rows = await runSummaries(limit + 1, normalizedQuery, status, after, parentRunId);
|
|
582
588
|
const runs = rows.slice(0, limit);
|
|
583
589
|
sendJSON(response, 200, { runs: runs.map(({ summary }) => summary),
|
|
584
590
|
nextCursor: rows.length > limit ? encodeRunCursor(runs.at(-1).candidate, filterHash) : null });
|
package/docs/ui.md
CHANGED
|
@@ -72,6 +72,8 @@ From version `0.2.6`, **Case library** filters saved suites as you type in **Sea
|
|
|
72
72
|
|
|
73
73
|
**Run history → Search runs** matches part of a suite ID, run ID, or target name. Matching ignores letter case and surrounding whitespace, and supports Korean target names. Search combines with **Run status**; clear the search to return to the selected status. From `0.6.0`, search covers all valid saved reports, including older records. Target URLs and individual case content are not searched. Queries are limited to 200 characters.
|
|
74
74
|
|
|
75
|
+
**Find reruns of this run** in a detailed report opens Run history filtered by the exact original run ID recorded in each child. The list can be paginated and narrowed by status. **Show all runs** clears the relation, and typing in Search runs switches back to the ordinary text search.
|
|
76
|
+
|
|
75
77
|
Results load 50 at a time, newest first by run-directory modification time, with run ID as a stable tie-breaker. **Load more** appends older matches. The displayed count describes loaded matches, not a global total. End-of-results, loading, and retry guidance distinguish an empty result from an unavailable request. A failed page request preserves loaded rows so you can retry.
|
|
76
78
|
|
|
77
79
|
Changing search or status restarts at the first page. The query, status, and loaded pages stay through navigation and language changes, and reset on page reload. The open report, its downloads, and scenario draft stay intact. A delayed response from an older query cannot replace newer results. Older reports support the same report downloads and failed/error-case preparation.
|