@ihyeon/flow-qa 0.4.0 → 0.5.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 CHANGED
@@ -68,6 +68,8 @@ flow-qa plan flows/my-flow.md --workspace my-qa
68
68
 
69
69
  CLI에서는 `flow-qa run cases/task-flow.json --target demo --case TC-001 --case TC-003`처럼 ID를 반복합니다. `--case`를 생략하면 전체를 실행합니다. 부분 실행의 통과는 선택한 케이스에만 해당하며, 보고서와 비교 화면에도 선택 범위를 표시합니다. 자세한 동작은 [UI 가이드](docs/ui.md#run-selected-cases)를 참고하세요.
70
70
 
71
+ `0.5.0`부터 상세 보고서에서 **실패·오류 케이스 준비**를 누르면 실행 당시와 같은 저장된 케이스를 불러와 `실패`와 `실행 오류`만 선택합니다. 준비 후 케이스와 대상을 다시 검토하고 직접 실행하세요. 케이스·원본 파일이 없거나 바뀌었으면 준비를 중단하며, 실행 대상이 없거나 바뀌었으면 다시 선택해야 합니다. 자세한 동작은 [실패 케이스 준비](docs/ui.md#prepare-failed-cases)를 참고하세요.
72
+
71
73
  ## 실행 결과 비교
72
74
 
73
75
  **실행 기록 → 실행 2건 비교**에서 같은 스위트와 대상의 두 기록을 선택하면 통과→실패, 실패→통과, 그 외 상태 변경, 동일 상태, 추가·누락 케이스를 확인할 수 있습니다. 분류별로 보거나 전체 비교를 Markdown·JSON으로 내려받으세요. 테스트 내용 변경과 불완전한 실행은 별도로 표시하며, 상태 변화만으로 제품 버그의 발생·해결을 확정하지 않습니다. 자세한 동작은 [UI 가이드](docs/ui.md#compare-two-runs)를 참고하세요.
package/README.md CHANGED
@@ -68,6 +68,8 @@ From `0.4.0`, choose cases under **Scenario → Review, then run → Cases to ru
68
68
 
69
69
  The CLI supports repeated IDs: `flow-qa run cases/task-flow.json --target demo --case TC-001 --case TC-003`. Omit `--case` to run the complete suite. Reports and comparisons label partial runs explicitly; a selected-run pass does not evaluate omitted cases. See the [UI guide](docs/ui.md#run-selected-cases).
70
70
 
71
+ From `0.5.0`, open a detailed report and choose **Prepare failed/error cases** to load its unchanged saved suite with only `failed` and `error` cases selected. Preparation never starts a run: review the cases and target, then run explicitly. Changed or missing case/source files block preparation; a changed or missing target must be selected again. See [preparing failed cases](docs/ui.md#prepare-failed-cases).
72
+
71
73
  ## Compare recorded runs
72
74
 
73
75
  In **Run history → Compare two runs**, select two reports from the same suite and target to see passed-to-failed, failed-to-passed, other status changes, unchanged, added, and missing cases. Filter the comparison or download all results as Markdown/JSON. Changed test definitions and incomplete runs carry explicit warnings; observed status changes do not prove a product defect was introduced or fixed. See the [UI guide](docs/ui.md#compare-two-runs).
package/dist/src/i18n.js CHANGED
@@ -70,6 +70,14 @@ const koreanMessages = {
70
70
  'Both reports need unique, non-empty case IDs.': '두 리포트의 케이스 ID는 비어 있지 않고 중복되지 않아야 합니다.',
71
71
  'The report selection does not match its recorded cases.': '보고서의 선택 범위가 기록된 케이스와 일치하지 않습니다.',
72
72
  'Select one or more unique cases from this suite.': '이 케이스 모음에서 중복 없이 하나 이상의 케이스를 선택하세요.',
73
+ 'No failed or errored cases are available to rerun.': '다시 실행할 실패 또는 실행 오류 케이스가 없습니다.',
74
+ 'No saved case file matches this report.': '이 보고서에 해당하는 저장된 케이스 파일이 없습니다.',
75
+ 'Multiple saved case files match this report.': '이 보고서에 해당하는 케이스 파일이 여러 개입니다. 보관함에서 사용할 파일을 직접 선택하세요.',
76
+ 'The saved case file or source flow was not found.': '저장된 케이스 파일 또는 원본 플로우를 찾을 수 없습니다.',
77
+ 'The saved case file or source flow is invalid.': '저장된 케이스 파일 또는 원본 플로우가 올바르지 않습니다.',
78
+ 'The saved case file changed since this run. Review it before rerunning.': '실행 이후 케이스 파일이 변경됐습니다. 보관함에서 다시 열어 검토하세요.',
79
+ 'The report cases do not match the saved case file.': '보고서의 케이스가 저장된 케이스 파일과 일치하지 않습니다.',
80
+ 'The report selection does not match the saved case file.': '보고서의 선택 범위가 저장된 케이스 파일과 일치하지 않습니다.',
73
81
  'Invalid evidence selection.': '증거 파일 선택이 올바르지 않습니다.',
74
82
  'The request is not allowed.': '허용되지 않은 요청입니다.',
75
83
  'Invalid request token.': '요청 토큰이 올바르지 않습니다.',
@@ -4,7 +4,7 @@
4
4
  const i18n = window.FlowQAI18n;
5
5
  const t = i18n.t;
6
6
  const names = { scenario: 'nav.scenario', library: 'nav.library', history: 'nav.history', settings: 'nav.settings' };
7
- const app = { state: null, connected: false, displayTargets: [], draft: null, selectedCaseIds: new Set(), script: '', savedFile: '', savedHash: '', origin: 'none', sourceFlow: '', boundSource: null, stale: false, dirty: false, busy: false, planning: false, planRequest: 0, stopping: false, report: null, reportMarkdown: '', selectedRun: '', comparison: null, comparisonRequest: 0, comparisonBusy: false, comparisonStatus: 'comparison.selectBoth', view: 'scenario' };
7
+ const app = { state: null, connected: false, displayTargets: [], draft: null, selectedCaseIds: new Set(), script: '', savedFile: '', savedHash: '', origin: 'none', sourceFlow: '', boundSource: null, stale: false, dirty: false, busy: false, planning: false, planRequest: 0, stopping: false, report: null, reportMarkdown: '', selectedRun: '', rerunOrigin: null, rerunTargetMismatch: false, navigationVersion: 0, comparison: null, comparisonRequest: 0, comparisonBusy: false, comparisonStatus: 'comparison.selectBoth', view: 'scenario' };
8
8
 
9
9
  function el(tag, className, value) {
10
10
  const node = document.createElement(tag);
@@ -44,6 +44,7 @@
44
44
  return result;
45
45
  }
46
46
  function view(name) {
47
+ app.navigationVersion += 1;
47
48
  app.view = name;
48
49
  for (const key of Object.keys(names)) $('view-' + key).hidden = key !== name;
49
50
  document.querySelectorAll('[data-view]').forEach((button) => {
@@ -120,6 +121,9 @@
120
121
  $('suite-editor').disabled = app.busy;
121
122
  $('prompt-btn').disabled = app.busy;
122
123
  $('scenario-platform').disabled = app.busy;
124
+ $('target-select').disabled = app.busy;
125
+ $('review-checkbox').disabled = app.busy;
126
+ $('report-rerun').disabled = !app.connected || !!active || app.busy || !app.selectedRun || !(app.report?.cases || []).some((item) => item.status === 'failed' || item.status === 'error');
123
127
  $('mobile-setup-hint').hidden = suitePlatform() !== 'mobile' && $('scenario-platform').value !== 'mobile';
124
128
  $('run-readiness').textContent = t(!app.connected ? 'app.connectionRequired'
125
129
  : active ? (active.status === 'stopping' ? 'app.stopping' : active.kind === 'plan' ? 'app.planning' : 'app.running')
@@ -198,6 +202,7 @@
198
202
  }
199
203
  }
200
204
  function setDraft(suite, script, origin, sourceFlow = '', savedFile = '', savedHash = '') {
205
+ app.rerunOrigin = null; app.rerunTargetMismatch = false; renderRerunHints();
201
206
  app.draft = suite; app.script = script; app.origin = origin; app.sourceFlow = sourceFlow; app.boundSource = suite.source ? { ...suite.source } : null; app.savedFile = savedFile; app.savedHash = savedHash; app.stale = false; app.dirty = false;
202
207
  $('suite-editor').value = JSON.stringify(suite, null, 2);
203
208
  $('scenario-platform').value = suite.platform || 'web';
@@ -219,6 +224,12 @@
219
224
  for (const target of app.state?.targets || []) { const row = el('div', 'settings-entry'); row.append(el('strong', '', target.name), document.createTextNode(` · ${targetLabel(target)}${target.description ? ` · ${target.description}` : ''}`)); list.append(row); }
220
225
  }
221
226
  function targetDescription() { const target = selectedTarget(); $('target-description').textContent = target ? `${targetLabel(target)}${target.description ? ` · ${target.description}` : ''}` : t('scenario.targetHint'); readiness(); }
227
+ function renderRerunHints() {
228
+ $('rerun-origin-hint').hidden = !app.rerunOrigin;
229
+ if (app.rerunOrigin) $('rerun-origin-hint').textContent = t('app.rerunPrepared', app.rerunOrigin);
230
+ $('rerun-target-hint').hidden = !app.rerunTargetMismatch;
231
+ if (app.rerunTargetMismatch) $('rerun-target-hint').textContent = t('app.rerunTargetMismatch');
232
+ }
222
233
  function modelDescription(role) {
223
234
  const model = app.state?.models?.[role] || {};
224
235
  const explanation = t(role === 'planner' ? 'app.modelPlannerHelp' : 'app.modelAgentHelp');
@@ -467,7 +478,31 @@
467
478
  catch (error) { showError(error); }
468
479
  finally { app.stopping = false; readiness(); }
469
480
  }
470
- async function loadReport(runId) { await work(async () => { const result = await api(`/api/report?runId=${encodeURIComponent(runId)}`); app.report = result.report; app.reportMarkdown = result.markdown; app.selectedRun = runId; renderReport(); $('report-panel').hidden = false; $('report-panel').scrollIntoView({ behavior: 'smooth', block: 'start' }); }); }
481
+ async function loadReport(runId) { await work(async () => { const result = await api(`/api/report?runId=${encodeURIComponent(runId)}`); app.report = result.report; app.reportMarkdown = result.markdown; app.selectedRun = runId; renderReport(); readiness(); $('report-panel').hidden = false; $('report-panel').scrollIntoView({ behavior: 'smooth', block: 'start' }); }); }
482
+ async function prepareFailedCases() { await work(async () => {
483
+ const runId = app.selectedRun;
484
+ const report = app.report;
485
+ const navigationVersion = app.navigationVersion;
486
+ if (!app.connected || app.state?.active || !runId || !report?.cases?.some((item) => item.status === 'failed' || item.status === 'error')) return;
487
+ const result = await api(`/api/rerun?runId=${encodeURIComponent(runId)}`);
488
+ if (app.selectedRun !== runId || app.report !== report || app.view !== 'history' || app.navigationVersion !== navigationVersion) return;
489
+ await refresh(false);
490
+ if (app.selectedRun !== runId || app.report !== report || app.view !== 'history' || app.navigationVersion !== navigationVersion || !app.connected || app.state?.active) return;
491
+ if (!confirmScenarioReplacement('app.confirmReplaceDraft')) return;
492
+ targetOptions();
493
+ $('flow-input').value = result.flow || '';
494
+ setDraft(result.suite, result.script, 'library', result.flow || '', result.file, result.suiteHash);
495
+ app.selectedCaseIds = new Set(result.caseIds);
496
+ renderCaseSelection();
497
+ const target = app.displayTargets.find((item) => item.name === result.targetName);
498
+ const sameTarget = result.targetMatches === true && target?.targetFingerprint === result.targetFingerprint;
499
+ $('target-select').value = sameTarget ? target.name : '';
500
+ app.rerunTargetMismatch = !sameTarget;
501
+ app.rerunOrigin = { runId: result.originRunId, count: result.caseIds.length };
502
+ renderRerunHints(); targetDescription();
503
+ noticeKey(sameTarget ? 'app.rerunPrepared' : 'app.rerunPreparedTarget', app.rerunOrigin);
504
+ view('scenario');
505
+ }); }
471
506
  async function downloadReportMarkdown() {
472
507
  const runId = app.selectedRun; const locale = i18n.locale();
473
508
  if (!runId || !app.report) return;
@@ -533,7 +568,7 @@
533
568
  if (input) { input.focus(); if (Number.isInteger(focus.start)) input.setSelectionRange(focus.start, focus.end); }
534
569
  }
535
570
  summarize(app.draft, true); renderCaseSelection();
536
- renderActive(); targetDescription(); renderLibrary(); renderHistory(); renderComparisonOptions(); renderComparison(); renderReport();
571
+ renderActive(); targetDescription(); renderRerunHints(); renderLibrary(); renderHistory(); renderComparisonOptions(); renderComparison(); renderReport();
537
572
  if (app.comparisonStatus) comparisonStatus(app.comparisonStatus, app.comparisonStatusParams || {}, app.comparisonStatus === 'comparison.error');
538
573
  app.reportMarkdown = '';
539
574
  if (app.notice) $('notice').textContent = t(app.notice.key, app.notice.params);
@@ -561,7 +596,7 @@
561
596
  const unsavedJson = json.trim() && (!app.savedFile || json !== JSON.stringify(app.draft, null, 2));
562
597
  if (unsavedJson && !confirmScenarioReplacement('app.confirmNewDraft')) return;
563
598
  app.draft = null; app.selectedCaseIds = new Set(); app.script = ''; app.savedFile = ''; app.savedHash = '';
564
- app.origin = 'none'; app.sourceFlow = ''; app.boundSource = null; app.stale = false; app.dirty = false;
599
+ app.origin = 'none'; app.sourceFlow = ''; app.boundSource = null; app.stale = false; app.dirty = false; app.rerunOrigin = null; app.rerunTargetMismatch = false; renderRerunHints();
565
600
  $('suite-editor').value = ''; $('review-checkbox').checked = false;
566
601
  summarize(null); renderCaseSelection(); readiness();
567
602
  noticeKey('app.newDraftNotice');
@@ -570,7 +605,7 @@
570
605
  $('flow-input').addEventListener('input', () => { if (app.origin === 'imported' ? $('flow-input').value !== editableFlow(app.sourceFlow) : (app.sourceFlow || app.boundSource) && $('flow-input').value.trim() !== editableFlow(app.sourceFlow).trim()) { app.stale = true; app.savedHash = ''; $('review-checkbox').checked = false; } readiness(); });
571
606
  $('scenario-platform').addEventListener('change', () => { app.planRequest += 1; if (app.draft) { app.stale = true; app.savedHash = ''; } $('review-checkbox').checked = false; readiness(); });
572
607
  $('suite-editor').addEventListener('input', () => { app.dirty = true; app.script = ''; app.savedFile = ''; app.savedHash = ''; if (app.origin === 'none') app.origin = 'manual'; $('review-checkbox').checked = false; summarize(null); readiness(); });
573
- $('review-checkbox').addEventListener('change', readiness); $('target-select').addEventListener('change', () => { $('review-checkbox').checked = false; targetDescription(); });
608
+ $('review-checkbox').addEventListener('change', readiness); $('target-select').addEventListener('change', () => { $('review-checkbox').checked = false; if ($('target-select').value) { app.rerunTargetMismatch = false; renderRerunHints(); } targetDescription(); });
574
609
  $('case-selection-list').addEventListener('change', (event) => { const input = event.target.closest('input[data-case-id]'); if (!input) return; const next = new Set(app.selectedCaseIds); if (input.checked) next.add(input.dataset.caseId); else next.delete(input.dataset.caseId); changeCaseSelection(next); });
575
610
  $('select-all-cases').addEventListener('click', () => changeCaseSelection((app.draft?.cases || []).map((item) => item.id)));
576
611
  $('clear-case-selection').addEventListener('click', () => changeCaseSelection([]));
@@ -583,6 +618,7 @@
583
618
  $('script-download').addEventListener('click', () => { if (app.draft && !app.dirty && !app.stale) download(`${app.draft.id || 'flow-qa'}.test.mjs`, app.script, 'text/javascript'); });
584
619
  $('report-md').addEventListener('click', downloadReportMarkdown);
585
620
  $('report-json').addEventListener('click', () => { if (app.report) download(`${app.selectedRun}.json`, JSON.stringify(app.report, null, 2), 'application/json'); });
621
+ $('report-rerun').addEventListener('click', prepareFailedCases);
586
622
  $('target-form').addEventListener('submit', saveTarget);
587
623
  $('target-kind').addEventListener('change', targetFields); targetFields();
588
624
  $('language-select').addEventListener('change', (event) => i18n.setLocale(event.currentTarget.value));
@@ -131,6 +131,8 @@
131
131
  'comparison.error': ['Comparison failed: {message}', '비교 실패: {message}'],
132
132
  'comparison.runLabel': ['{date} · {suite} · {shortId} · {target} · {status} · {id}', '{date} · {suite} · {shortId} · {target} · {status} · {id}'],
133
133
  'history.report': ['Detailed report', '상세 보고서'],
134
+ 'history.prepareFailed': ['Prepare failed/error cases', '실패·오류 케이스 준비'],
135
+ 'history.prepareHint': ['Only failed and error cases are selected. Passed, flaky, blocked, and skipped cases are excluded. Preparation never starts a run.', '실패·오류 케이스만 선택합니다. 통과·간헐 실패·차단·건너뜀 케이스는 제외됩니다. 준비만으로 실행은 시작되지 않습니다.'],
134
136
  'history.downloadMarkdown': ['Download Markdown', 'Markdown 다운로드'],
135
137
  'history.downloadJson': ['Download JSON', 'JSON 다운로드'],
136
138
  'history.evidenceHint': ['The report summarizes results. Open or download screenshots and recordings from each attempt. Evidence files are not included in report downloads.', '보고서는 결과 요약입니다. 스크린샷·화면 기록은 각 시도에서 열거나 개별 다운로드하세요. 증거 파일은 보고서 다운로드에 포함되지 않습니다.'],
@@ -306,6 +308,9 @@
306
308
  'app.savedSuite': ['Cases saved to a separate file: {file}. Review them again before running.', '케이스를 별도 파일로 저장했습니다: {file}. 실행 전 내용을 다시 검토하세요.'],
307
309
  'app.runNotReady': ['Save or reload cases, select a target, and review the contents before running.', '케이스 저장 또는 다시 불러오기, 대상 선택, 직접 검토가 필요합니다.'],
308
310
  'app.runStarted': ['Run started. Task ID: {id}', '실행을 시작했습니다. 작업 ID: {id}'],
311
+ 'app.rerunPrepared': ['Prepared {count} failed/error cases from run {runId}. Review the cases and target before starting a new run.', '실행 {runId}의 실패·오류 케이스 {count}개를 준비했습니다. 새 실행 전 케이스와 대상을 검토하세요.'],
312
+ 'app.rerunPreparedTarget': ['Prepared {count} failed/error cases from run {runId}. The target changed or is unavailable. Select and review a target before starting a new run.', '실행 {runId}의 실패·오류 케이스 {count}개를 준비했습니다. 대상이 변경되었거나 없습니다. 새 실행 전 대상을 선택하고 검토하세요.'],
313
+ 'app.rerunTargetMismatch': ['The report target changed or is unavailable. Select a current target and review it before running.', '보고서의 대상이 변경되었거나 없습니다. 현재 대상을 선택하고 검토한 뒤 실행하세요.'],
309
314
  'app.stopRequested': ['Stop request sent. Checking the final state.', '중지 요청을 보냈습니다. 실제 종료 상태를 확인 중입니다.'],
310
315
  'app.reportStatus': ['Status {status}', '상태 {status}'],
311
316
  'app.reportTarget': ['Target {target}', '대상 {target}'],
@@ -81,8 +81,8 @@
81
81
  <section class="execution-section" aria-labelledby="run-title">
82
82
  <div class="section-head"><span class="section-number">03</span><div><h2 id="run-title" data-i18n="scenario.runTitle">Review, then run</h2><p data-i18n="scenario.runHelp">Select a target and confirm you have reviewed the cases.</p></div></div>
83
83
  <div class="execution-grid">
84
- <div class="target-field"><label for="target-select" class="field-label" data-i18n="scenario.target">Run target</label><select id="target-select"><option value="" data-i18n="scenario.selectTarget">Select a target</option></select><p id="target-description" class="hint" data-i18n="scenario.targetHint">You can add a target in Connections.</p><p id="mobile-setup-hint" class="hint" hidden data-i18n="scenario.mobileSetup">For iOS, prepare Xcode, a simulator or signed device, and app signing. For Android, prepare the Android SDK and an emulator or authorized device. Configuration alone does not verify device access.</p></div>
85
- <div class="execution-confirm"><div class="case-selection"><div class="case-selection-head"><h3 id="case-selection-title" data-i18n="scenario.selectionTitle">Cases to run</h3><span id="case-selection-summary" role="status" aria-live="polite"></span></div><p class="hint" data-i18n="scenario.selectionHint">Each selected case must establish its own starting state. Excluded cases are not assessed.</p><div class="actions"><button type="button" id="select-all-cases" class="button quiet" data-i18n="scenario.selectAllCases">Select all</button><button type="button" id="clear-case-selection" class="button quiet" data-i18n="scenario.clearSelection">Clear selection</button></div><div id="case-selection-list" role="group" aria-labelledby="case-selection-title"></div></div><p id="case-readiness" class="hint"></p><label class="review-line"><input type="checkbox" id="review-checkbox"><span data-i18n="scenario.reviewConfirm">I have reviewed the requirements, case steps, and expected results.</span></label><div class="run-bar"><span id="run-readiness" data-i18n="scenario.runInitial">Validated cases and a run target are required.</span><div class="actions"><button type="button" id="stop-btn" class="button quiet" hidden data-i18n="scenario.stop">Stop run</button><button type="button" id="run-btn" class="button primary" disabled><span data-i18n="scenario.run">Run QA</span><span aria-hidden="true">→</span></button></div></div></div>
84
+ <div class="target-field"><label for="target-select" class="field-label" data-i18n="scenario.target">Run target</label><select id="target-select"><option value="" data-i18n="scenario.selectTarget">Select a target</option></select><p id="target-description" class="hint" data-i18n="scenario.targetHint">You can add a target in Connections.</p><p id="rerun-target-hint" class="hint" hidden></p><p id="mobile-setup-hint" class="hint" hidden data-i18n="scenario.mobileSetup">For iOS, prepare Xcode, a simulator or signed device, and app signing. For Android, prepare the Android SDK and an emulator or authorized device. Configuration alone does not verify device access.</p></div>
85
+ <div class="execution-confirm"><div class="case-selection"><div class="case-selection-head"><h3 id="case-selection-title" data-i18n="scenario.selectionTitle">Cases to run</h3><span id="case-selection-summary" role="status" aria-live="polite"></span></div><p id="rerun-origin-hint" class="hint" hidden></p><p class="hint" data-i18n="scenario.selectionHint">Each selected case must establish its own starting state. Excluded cases are not assessed.</p><div class="actions"><button type="button" id="select-all-cases" class="button quiet" data-i18n="scenario.selectAllCases">Select all</button><button type="button" id="clear-case-selection" class="button quiet" data-i18n="scenario.clearSelection">Clear selection</button></div><div id="case-selection-list" role="group" aria-labelledby="case-selection-title"></div></div><p id="case-readiness" class="hint"></p><label class="review-line"><input type="checkbox" id="review-checkbox"><span data-i18n="scenario.reviewConfirm">I have reviewed the requirements, case steps, and expected results.</span></label><div class="run-bar"><span id="run-readiness" data-i18n="scenario.runInitial">Validated cases and a run target are required.</span><div class="actions"><button type="button" id="stop-btn" class="button quiet" hidden data-i18n="scenario.stop">Stop run</button><button type="button" id="run-btn" class="button primary" disabled><span data-i18n="scenario.run">Run QA</span><span aria-hidden="true">→</span></button></div></div></div>
86
86
  </div>
87
87
  </section>
88
88
  </div>
@@ -104,7 +104,7 @@
104
104
  <div id="comparison-results" hidden><div id="comparison-warnings"></div><div id="comparison-summary"></div><div class="comparison-filter-row"><label for="comparison-filter" data-i18n="comparison.filter">Show cases</label><select id="comparison-filter" aria-controls="comparison-content"><option value="" data-i18n="comparison.all">All categories</option><option value="newly-failed" data-i18n="comparison.newlyFailed">Newly failed</option><option value="now-passed" data-i18n="comparison.nowPassed">Now passed</option><option value="changed" data-i18n="comparison.changed">Changed status</option><option value="unchanged" data-i18n="comparison.unchanged">Same status</option><option value="added" data-i18n="comparison.added">Added to current</option><option value="missing" data-i18n="comparison.missing">Missing from current</option></select></div><div class="actions comparison-actions"><button type="button" id="comparison-md" class="button" data-i18n="comparison.downloadMarkdown" disabled>Download comparison Markdown</button><button type="button" id="comparison-json" class="button quiet" data-i18n="comparison.downloadJson" disabled>Download comparison JSON</button><button type="button" id="compare-open-baseline" class="button quiet" data-i18n="comparison.openBaseline" disabled>View baseline report</button><button type="button" id="compare-open-current" class="button quiet" data-i18n="comparison.openCurrent" disabled>View current report</button></div><div id="comparison-content"></div></div>
105
105
  </div>
106
106
  </section>
107
- <section id="report-panel" class="report-panel" hidden><div class="section-head"><span class="section-number">03</span><div><h2 data-i18n="history.report">Detailed report</h2><p id="report-heading"></p></div></div><div class="section-body"><div class="actions"><button type="button" id="report-md" class="button" data-i18n="history.downloadMarkdown">Download Markdown</button><button type="button" id="report-json" class="button quiet" data-i18n="history.downloadJson">Download JSON</button></div><p class="hint" data-i18n="history.evidenceHint">The report summarizes results. Open or download screenshots and recordings from each attempt. Evidence files are not included in report downloads.</p><div id="report-content"></div></div></section>
107
+ <section id="report-panel" class="report-panel" hidden><div class="section-head"><span class="section-number">03</span><div><h2 data-i18n="history.report">Detailed report</h2><p id="report-heading"></p></div></div><div class="section-body"><div class="actions"><button type="button" id="report-md" class="button" data-i18n="history.downloadMarkdown">Download Markdown</button><button type="button" id="report-json" class="button quiet" data-i18n="history.downloadJson">Download JSON</button><button type="button" id="report-rerun" class="button primary" disabled data-i18n="history.prepareFailed">Prepare failed/error cases</button></div><p class="hint" data-i18n="history.prepareHint">Passed, flaky, blocked, and skipped cases are excluded. Preparation does not start a run.</p><p class="hint" data-i18n="history.evidenceHint">The report summarizes results. Open or download screenshots and recordings from each attempt. Evidence files are not included in report downloads.</p><div id="report-content"></div></div></section>
108
108
  </section>
109
109
  <section id="view-settings" class="view" hidden>
110
110
  <div class="page-heading"><p class="eyebrow" data-i18n="settings.eyebrow">04 / CONNECTIONS</p><h1 data-i18n="nav.settings">Connections</h1><p data-i18n="settings.intro">Configure run targets and models separately. Key values are read only from server environment variables.</p></div>
@@ -471,6 +471,59 @@ export async function startUIServer(options) {
471
471
  sendJSON(response, 200, await report(runId, true, locale));
472
472
  return;
473
473
  }
474
+ if (url.pathname === '/api/rerun') {
475
+ const runId = url.searchParams.get('runId');
476
+ if (!runId)
477
+ invalid('A run ID is required.');
478
+ const { report: previous } = await report(runId, false);
479
+ const matches = (await suites()).filter((item) => item.id === previous.suiteId);
480
+ if (matches.length === 0)
481
+ throw new HTTPError(409, 'No saved case file matches this report.');
482
+ if (matches.length > 1)
483
+ throw new HTTPError(409, 'Multiple saved case files match this report.');
484
+ const file = matches[0].file;
485
+ let selected;
486
+ try {
487
+ selected = await getSuite(file, true);
488
+ }
489
+ catch (error) {
490
+ if (error instanceof HTTPError && error.status === 404) {
491
+ throw new HTTPError(409, 'The saved case file or source flow was not found.');
492
+ }
493
+ if (error instanceof HTTPError && error.status === 400) {
494
+ throw new HTTPError(409, 'The saved case file or source flow is invalid.');
495
+ }
496
+ throw error;
497
+ }
498
+ const { suite } = selected;
499
+ if (sha256(`${JSON.stringify(suite, null, 2)}\n`) !== previous.suiteHash) {
500
+ throw new HTTPError(409, 'The saved case file changed since this run. Review it before rerunning.');
501
+ }
502
+ const available = new Set(suite.cases.map((item) => item.id));
503
+ if (previous.cases.some((item) => !item.id.trim() || !available.has(item.id)) ||
504
+ new Set(previous.cases.map((item) => item.id)).size !== previous.cases.length ||
505
+ (!previous.selection && previous.cases.length !== suite.cases.length)) {
506
+ throw new HTTPError(409, 'The report cases do not match the saved case file.');
507
+ }
508
+ if (previous.selection && (previous.selection.totalCases !== suite.cases.length ||
509
+ !isReportSelectionValid(previous.cases, previous.selection))) {
510
+ throw new HTTPError(409, 'The report selection does not match the saved case file.');
511
+ }
512
+ const failing = new Set(previous.cases.filter((item) => item.status === 'failed' || item.status === 'error').map((item) => item.id));
513
+ const caseIds = suite.cases.filter((item) => failing.has(item.id)).map((item) => item.id);
514
+ if (caseIds.length === 0)
515
+ throw new HTTPError(409, 'No failed or errored cases are available to rerun.');
516
+ const settings = await config();
517
+ const targetName = previous.target.name;
518
+ const expectedFingerprint = targetFingerprint(previous.target);
519
+ const currentTarget = Object.hasOwn(settings.targets, targetName) ? settings.targets[targetName] : undefined;
520
+ sendJSON(response, 200, { originRunId: runId, file, ...selected, caseIds, targetName,
521
+ targetFingerprint: expectedFingerprint,
522
+ targetMatches: Boolean(currentTarget &&
523
+ (suite.platform ?? 'web') === (currentTarget.kind === 'mobile' ? 'mobile' : 'web') &&
524
+ targetFingerprint(currentTarget) === expectedFingerprint) });
525
+ return;
526
+ }
474
527
  if (url.pathname === '/api/comparison') {
475
528
  const baseline = url.searchParams.get('baseline');
476
529
  const current = url.searchParams.get('current');
package/docs/releases.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  The alpha entries below are historical release records. They document earlier package versions and checks.
4
4
 
5
+ ## 0.5.0: prepare failed cases from a report
6
+
7
+ Adds **Prepare failed/error cases** to detailed reports. It loads the unchanged saved suite, selects only recorded `failed` and `error` cases in suite order, and opens Scenario with a fresh review requirement. Passed, flaky, blocked, and skipped cases are excluded. Preparation is read-only and never starts a run or calls a model. Unsaved drafts require confirmation; failed preparation and late responses after navigation preserve the draft.
8
+
9
+ Preparation requires one matching saved suite, the exact parsed suite snapshot hash, a valid linked source, and coherent full/partial report IDs. Missing, changed, or ambiguous inputs stop preparation with guidance. A changed or missing target is cleared for explicit selection; even a matching target requires renewed review. Existing execution-time checks remain in force. The next run writes its own ordinary selected-scope report; the original report remains unchanged, and no persistent parent-run link is added.
10
+
11
+ Locally verified on macOS with Node.js 24.22.1 on 2026-11-03: 117 tests, type checking, UI syntax and design-system audit, and demo/UI checks passed. The dedicated Chromium smoke covered all six case statuses, unsaved-draft acceptance/cancellation, changed suite and target, navigation during a delayed response, English/Korean, and a 390px layout. It executed two prepared cases successfully with zero requests from the excluded sentinel. A fresh tarball installation prepared a synthetic failed report and ran that selection in a real browser, alongside full-run/comparison checks (seven passing browser cases). The existing import smoke now waits for save completion before asserting download readiness. No model calls, external logins, or native-device runs were used.
12
+
13
+ - Package: [`@ihyeon/flow-qa@0.5.0`](https://www.npmjs.com/package/@ihyeon/flow-qa/v/0.5.0)
14
+ - Release: [GitHub 0.5.0](https://github.com/hyeonse-swing/flow-qa/releases/tag/v0.5.0)
15
+
5
16
  ## 0.4.0: run selected cases
6
17
 
7
18
  Adds case selection to the execution panel and repeated `--case <id>` flags to CLI runs. Selecting or clearing cases resets UI review, and execution still requires the reviewed file and target fingerprints. Unknown, duplicate, and empty selections are rejected. Selection is preserved across navigation, language changes, and polling, while a new draft starts with all cases selected.
@@ -122,7 +133,7 @@ Locally verified on macOS with Node.js 24.14.1 on 2026-10-12: 89 tests, type che
122
133
 
123
134
  A push to `main` publishes only when `package.json` changes to a new plain `X.Y.Z` version. Pull requests and pushes without a version change run verification without publishing. The package and lockfile versions must agree; the version must increase, and registry errors stop the release. Rerunning a successful publication skips the existing immutable npm version.
124
135
 
125
- The `publish` job in [ci.yml](../.github/workflows/ci.yml) waits for the full verification matrix on Ubuntu and macOS, then publishes through npm trusted publishing (OIDC). It uses the `latest` tag, requires the registry's `gitHead` to match the workflow commit, and checks the published package with a fresh consumer installation, two full Chromium demo runs plus a one-case selected run (seven cases), and comparison of their saved reports. The commit check also applies when retrying an already published version. No npm token is stored in GitHub secrets. After the published package passes its consumer smoke check, a separate job creates the matching GitHub tag and release at the exact verified commit. It preserves existing releases and rejects a tag pointing to another commit. Rerunning an older release does not replace a newer latest release.
136
+ The `publish` job in [ci.yml](../.github/workflows/ci.yml) waits for the full verification matrix on Ubuntu and macOS, then publishes through npm trusted publishing (OIDC). It uses the `latest` tag, requires the registry's `gitHead` to match the workflow commit, and checks the published package with a fresh consumer installation, two full Chromium demo runs plus a one-case selected run prepared from a synthetic failed report (seven cases), and comparison of their saved reports. The commit check also applies when retrying an already published version. No npm token is stored in GitHub secrets. After the published package passes its consumer smoke check, a separate job creates the matching GitHub tag and release at the exact verified commit. It preserves existing releases and rejects a tag pointing to another commit. Rerunning an older release does not replace a newer latest release.
126
137
 
127
138
  For the next release, update the release notes and current installation examples, then bump the version before committing and pushing:
128
139
 
package/docs/ui.md CHANGED
@@ -72,6 +72,16 @@ From version `0.2.7`, **Run history → Run status** filters the loaded reports
72
72
 
73
73
  From version `0.2.9`, **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. The query stays through navigation, language changes, and automatic report updates, and resets on page reload. Search covers the most recent 50 reports loaded by the UI, not older records, target URLs, or individual case content. Changing the query keeps the open report and its downloads available.
74
74
 
75
+ ### Prepare failed cases
76
+
77
+ From `0.5.0`, open **Run history → Detailed report → Prepare failed/error cases**. Only cases whose recorded status is `failed` or `error` are selected; `passed`, `flaky`, `blocked`, and `skipped` are excluded. The button is unavailable when no eligible cases exist or an operation is active. Preparation does not execute tests, call a model, or change files.
78
+
79
+ The UI finds exactly one saved case file with the report's suite ID, verifies its complete parsed content against the run's snapshot hash, and verifies its linked source Markdown. Missing, changed, ambiguous, or unreadable inputs stop preparation without replacing your draft. Open the current case file from the library and review it manually when the test definition has changed. An unsaved draft requires confirmation before replacement.
80
+
81
+ Successful preparation opens Scenario with the original source and failed/error selection. The prior target is selected only when its current name and settings still match the recorded target. Otherwise the target is cleared for explicit selection. Review confirmation is always cleared; inspect the selected cases and target before pressing **Run QA**. The normal execution-time file, source, and target checks still apply. Each selected case must establish its own starting state. Mobile target matching compares configured selectors, not physical device identity.
82
+
83
+ The preparation notice identifies the original run. The next execution creates a separate ordinary report with its selected scope; it does not overwrite the original report or store a persistent parent-run link. Selection stays through navigation, language changes, and polling, but resets on page reload.
84
+
75
85
  ### Compare two runs
76
86
 
77
87
  From version `0.3.0`, open **Run history → Compare two runs**, choose a **Baseline run** and **Current run**, then compare. Both selectors use the most recent 50 loaded reports, independently of the history search and status filter. The reports must belong to the same suite ID and recorded target settings: a matching web URL, or mobile platform, app ID, and device. Target display names may differ. Mobile reports record the configured device selector, which can be a name; all mobile comparisons warn that matching selectors do not establish that the same physical device was used. Comparing does not run tests, call a model, or change case review.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ihyeon/flow-qa",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "license": "MIT",
5
5
  "author": "Hyeonse Im",
6
6
  "repository": {
@@ -57,7 +57,7 @@
57
57
  "check:ui": "node --check src/ui/public/app.js && node --check src/ui/public/display.js && node --check src/ui/public/i18n.js && hds-audit .",
58
58
  "demo:serve": "node examples/demo/server.ts",
59
59
  "demo:smoke": "node scripts/demo-smoke.ts",
60
- "smoke:ui": "node scripts/ui-i18n-smoke.mjs && node scripts/ui-comparison-smoke.mjs && node scripts/ui-selection-smoke.mjs"
60
+ "smoke:ui": "node scripts/ui-i18n-smoke.mjs && node scripts/ui-comparison-smoke.mjs && node scripts/ui-selection-smoke.mjs && node scripts/ui-rerun-smoke.mjs"
61
61
  },
62
62
  "dependencies": {
63
63
  "@ai-sdk/openai-compatible": "3.0.53",