@ihyeon/error-to-test 0.2.7 → 0.2.8

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
@@ -36,6 +36,8 @@ node bin/error-to-test.mjs analyze --input examples/errors.json --profile exampl
36
36
 
37
37
  결과는 `analysis.json`, `report.md`, `flows/error-to-test.md`, `cases/error-to-test.json`, `provenance.json`입니다. 선택된 TC 후보가 없으면 suite를 만들지 않습니다. 출력 폴더는 매번 새 경로를 지정해야 합니다.
38
38
 
39
+ Browser Error Log v1의 현재 이벤트 타입을 모두 지원하며, 0.2.0부터 추가된 `resource` 오류도 JSON·JSONL·프로필·비교·프로필 보완에 사용할 수 있습니다. 리소스 오류를 HTTP 오류로 바꾸거나 응답 상태·재현 동작을 추측하지 않습니다. 리소스 context와 breadcrumbs는 테스트 단계로 변환하지 않습니다. 자체 수집기의 네트워크 상태 `0`도 알 수 없는/불투명 상태로 보존하며 실제 HTTP 응답 코드로 취급하지 않습니다.
40
+
39
41
  `--min-count N`으로 입력에 N건 이상 있는 오류 묶음만 TC 후보로 만들 수 있습니다. 범위는 1~10,000이며 기본값은 1입니다. 중복 제거·날짜 필터 적용 후 건수를 기준으로 고르고, `--top`은 그중 순위가 높은 묶음 수를 제한합니다. 기준 미만의 묶음도 `analysis.json`과 `report.md`에 남으며, 제외가 발생하면 보고서에 선택 기준을 표시합니다. 이 건수는 입력에 포함된 수집 이벤트·제출 보고서 수입니다.
40
42
 
41
43
  ```sh
@@ -254,7 +256,11 @@ error-to-test readiness ./review-analysis --format json
254
256
 
255
257
  Flow QA 설치와 실행 대상 설정은 별도로 필요합니다. 위 `flows/`·`cases/` 구조를 기존 검토 화면에서 읽을 수 있습니다. 분석 명령은 브라우저를 실행하거나 외부 모델에 요청하지 않습니다. TC 통과만으로 원래 오류를 수정 완료 처리하지 않습니다.
256
258
 
257
- 실행 후 `node bin/error-to-test.mjs link-run .error-to-test/reviewed --report /path/to/qa-report.json`으로 결과를 원래 오류 묶음에 연결할 수 있습니다. suite 해시와 모든 case ID가 일치해야 하며, 결과는 `results/<runId>.json`에 저장합니다. 원본 e2e 리포트 대신 Flow QA가 정리한 `report-1`을 사용하세요.
259
+ 실행 후 `node bin/error-to-test.mjs link-run .error-to-test/reviewed --report /path/to/qa-report.json`으로 결과를 원래 오류 묶음에 연결할 수 있습니다. suite 해시가 일치해야 하며 전체 실행은 모든 case ID를 포함해야 합니다. 일부 케이스만 실행한 Flow QA 보고서는 `selection.caseIds`가 보고된 케이스와 정확히 일치하고 `selection.totalCases`가 전체 suite 크기와 일치할 때 연결합니다. 알 수 없는·중복된 ID와 선택 선언 없는 누락은 거부합니다. 결과는 `results/<runId>.json`에 저장합니다. 원본 e2e 리포트 대신 Flow QA가 정리한 `report-1`을 사용하세요.
260
+
261
+ 선택 실행 결과에는 `selection: { mode: 'selected', totalCases, selectedCaseIds }`를 기록하며 요약의 최신 실행에도 포함합니다. 기존 전체 실행 결과는 계속 읽을 수 있고, 새 선택 실행 결과는 이 버전 이상의 reader가 필요합니다. 이전 reader는 추가 필드를 거부합니다. 최신 실행에서 빠진 케이스는 과거에 통과했어도 `not-run`이며, 미실행을 CI 실패로 처리하려면 `results --fail-on not-run`을 사용하세요.
262
+
263
+ 보고서에 실행 대상이 있으면 정제한 이름을 `targetName`으로 저장해 최신 실행 요약에 표시합니다. 대상 URL·기기 식별값은 복사하지 않습니다. 대상 이름은 고유 식별자가 아니므로 같은 이름을 다른 환경에 재사용하면 구별할 수 없습니다. 이전 reader는 이 추가 필드도 거부하며, 이름이 없는 기존 결과 파일은 계속 읽을 수 있습니다. 최신 실행은 연결된 전체 실행 중에서 고르므로 대상별 이력이 필요하면 번들을 분리하세요.
258
264
 
259
265
  연결한 결과는 `results`로 오류 묶음별 최신 TC 결과를 모아 볼 수 있습니다.
260
266
 
@@ -297,4 +303,6 @@ error-to-test results ./analysis --fail-on failed --fail-on error --fail-on not-
297
303
 
298
304
  알려진 자격증명·이메일·URL 인증/쿼리 정보는 결과에서 정제합니다. 민감정보가 포함된 실행 단계나 기대 결과는 변경해 통과시키지 않고 질문으로 남깁니다. 모든 개인정보를 제거한다고 보장하지 않으므로 실제 업무 데이터를 입력하기 전에는 별도로 정제하세요. 비공개 오류는 셸 기록에 남는 인자 대신 파일·표준 입력을 사용하세요.
299
305
 
300
- 검증은 `npm run check`, `npm run check:package`입니다. 로컬 SDK·Flow QA와 Chromium이 준비되면 `FLOW_QA_SOURCE=/path/to/flow-qa BROWSER_ERROR_SOURCE=/path/to/browser-error-log npm run smoke:flowqa`로 수정 전 실패·수정 후 통과와 미확인 TC 차단을 확인할 수 있습니다. 자세한 입력 계약과 제한은 [영문 문서](README.md)에 있습니다.
306
+ 검증은 `npm run check`, `npm run check:package`입니다. `npm run smoke:ecosystem`은 현재 소스의 tarball과 공개 Browser Error Log 0.2.10·Flow QA 0.8.8을 새 환경에 설치합니다. Chromium에서 실제 JavaScript·resource 오류 수집, 검토 전 차단, 수정 전 실패·수정 후 통과, 선택 실행 재연결과 미실행 게이트, 설치된 UI·디자인 시스템 연결을 검사합니다. CI 릴리스도 이 검사를 통과해야 합니다. 결과는 `output/ecosystem/verification.json`에 기록하며 운영 서비스·실제 로그인·모델을 호출하지 않습니다.
307
+
308
+ 로컬 소스 조합은 `FLOW_QA_SOURCE=/path/to/flow-qa BROWSER_ERROR_SOURCE=/path/to/browser-error-log npm run smoke:flowqa`로 별도 검사할 수 있습니다. 자세한 입력 계약과 제한은 [영문 문서](README.md)에 있습니다.
package/README.md CHANGED
@@ -59,6 +59,8 @@ Textual expected behavior alone does not establish a runnable assertion. Supply
59
59
 
60
60
  Accepts Browser Error Log v1 `{schemaVersion: 1, partial?: boolean, events: [...]}` exports or arrays of full v1 events. Files are limited to 10 MiB and 10,000 records. Identity duplicates are removed; conflicting payloads with the same project/event ID are rejected. `--from`/`--to` require timezone-qualified ISO timestamps. Undated manual reports are excluded when a date filter is requested.
61
61
 
62
+ All current v1 event types are supported, including `resource` failures from Browser Error Log 0.2.0 and later. Resource events remain distinct from HTTP/network events; their presence does not establish a response status or an executable reproduction. Resource-specific context and breadcrumbs are not converted into test steps. Custom v1 network records may use status `0` (unknown/opaque), which is preserved without treating it as an HTTP response code.
63
+
62
64
  Grouping is deterministic and separates project, environment, release, runtime, page path, error message/name, and source location or HTTP method/path/status. Similar messages do not establish the same root cause. Counts mean **captured events** or **submitted reports**, not actual occurrence rates or affected users. Collection retention is unknown; imported `partial` status is preserved. TC selection defaults to the first 100 ranked groups; all groups remain in the analysis. More than 100 generated cases must be narrowed with `--top` or a smaller profile.
63
65
 
64
66
  Use `--min-count N` (1..10,000; default 1) to generate TCs only for groups with at least N supplied records after deduplication and date filtering. `--top` then limits the remaining ranked groups. Groups below the threshold remain in `analysis.json` and `report.md`; the report explains any exclusions. If no groups qualify, no suite is generated.
@@ -364,7 +366,11 @@ After a Flow QA run, associate its normalized report with the exact exported sui
364
366
  node bin/error-to-test.mjs link-run .error-to-test/reviewed --report /path/to/qa-report.json
365
367
  ```
366
368
 
367
- The run's suite hash and every case ID must match. Safe case results are stored under `results/<runId>.json`, linked to their source groups/events. Unknown, missing, or duplicate cases are rejected; existing results are never overwritten. A raw e2e report is not accepted. Failed, blocked, and passed results remain distinct; no issue is automatically marked fixed.
369
+ The run's suite hash and reported case IDs must match. Safe case results are stored under `results/<runId>.json`, linked to their source groups/events. Full reports must account for every exported case. Flow QA selected runs are accepted only when their explicit `selection.caseIds` exactly matches the reported cases and `selection.totalCases` matches the full exported suite. Unknown, duplicate, or undeclared missing cases are rejected; existing results are never overwritten. A raw e2e report is not accepted. Failed, blocked, and passed results remain distinct; no issue is automatically marked fixed.
370
+
371
+ Selected results add `selection: { mode: 'selected', totalCases, selectedCaseIds }` to `error-to-test/results-1` and the latest run in `error-to-test/run-summary-1`. Older full result files remain supported. Use this version or newer to read selected result files; older readers reject the added selection field. Unselected cases are `not-run`, including when a previous full run passed. Use `results --fail-on not-run` when incomplete execution should fail a CI gate.
372
+
373
+ When a report includes a target, its sanitized name is retained as optional `targetName` and displayed in the latest-run summary. Target URLs and device identifiers are not copied. The name is a reported label, not a unique target identity: reusing one name for different environments does not establish they are equivalent. Older readers also reject the new target field; older files without it remain readable. Latest-run selection still considers all linked runs; use separate bundles when target-specific histories are required.
368
374
 
369
375
  ### Summarize linked runs
370
376
 
@@ -376,7 +382,7 @@ error-to-test results .error-to-test/reviewed --out ./run-summary.md
376
382
  error-to-test results .error-to-test/reviewed --format json --out ./run-summary.json
377
383
  ```
378
384
 
379
- The summary includes the linked run count, latest run ID/status/timestamps, case totals, and each group's cases and reported reasons. `passed`, `failed`, `flaky`, `blocked`, `skipped`, and `error` remain separate. Without any linked runs, selected cases are `not-run`; groups excluded from TC selection are shown without selected cases. An empty selection does not become a passing result.
385
+ The summary includes the linked run count, latest run ID/status/timestamps and selected-run scope, case totals, and each group's cases and reported reasons. `passed`, `failed`, `flaky`, `blocked`, `skipped`, and `error` remain separate. Without any linked runs, or when a case was omitted from the latest selected run, that case is `not-run`; groups excluded from TC selection are shown without selected cases. An empty selection does not become a passing result.
380
386
 
381
387
  Latest means the greatest reported `finishedAt`, then `startedAt`, then lexical run ID for ties. One whole run supplies all displayed case outcomes; earlier successes are never combined with newer runs to manufacture an all-passing result. When runs are linked, pending review and missing candidate context remain visible. These are supplied report outcomes, not review approval, independent execution proof, or evidence that the source issue is resolved.
382
388
 
@@ -422,7 +428,10 @@ Known credential assignments, bearer/recognized token formats, email addresses,
422
428
  ```sh
423
429
  npm run check
424
430
  npm run check:package
431
+ npm run smoke:ecosystem
425
432
  FLOW_QA_SOURCE=/path/to/flow-qa BROWSER_ERROR_SOURCE=/path/to/browser-error-log npm run smoke:flowqa
426
433
  ```
427
434
 
428
- The optional integration smoke uses the actual Browser Error Log SDK and Flow QA/e2e in a controlled local Chromium demo: collect errors, generate TCs, observe failures before repair and passes after repair, preserve an unresolved case, and check stale-source rejection. It requires their local source/dependencies and an installed Chromium browser. It does not access production, login, or call a model.
435
+ `smoke:ecosystem` installs the current built tarball alongside published Browser Error Log 0.2.10 and Flow QA 0.8.8 in a fresh temporary consumer. It checks real JavaScript/resource capture, partial export preservation, the review gate, failures before fixture repair and passes after it, selected-run linkage and the not-run gate, and installed UI/design-system assets. CI requires this check before release preparation. Evidence is written to `output/ecosystem/verification.json`. Set `ERROR_TO_TEST_RELEASE_VERSION=X.Y.Z` to test that exact registry release instead of the local tarball. The script installs Chromium and only runs a controlled local fixture, without production access, login, or model calls.
436
+
437
+ The optional `smoke:flowqa` uses local Browser Error Log and Flow QA sources in a controlled Chromium demo. It additionally preserves an unresolved case and checks stale-source rejection. It requires their local source/dependencies and an installed Chromium browser.
@@ -1,7 +1,7 @@
1
1
  import { hash, optionalText, parseWebSteps, record, strings, text } from "./validation.js";
2
2
  import { pagePath, redactText, safeUrl } from "./redact.js";
3
3
  const idPattern = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,79}$/;
4
- const eventTypes = new Set(['javascript', 'promise', 'react', 'console', 'http', 'network', 'manual']);
4
+ const eventTypes = new Set(['javascript', 'promise', 'react', 'console', 'http', 'network', 'resource', 'manual']);
5
5
  const runtimes = new Set(['browser', 'webview-ios', 'webview-android', 'unknown']);
6
6
  function identifier(value, label) {
7
7
  const result = text(value, label);
@@ -130,8 +130,12 @@ function safeFacts(group) {
130
130
  if (group.pagePath)
131
131
  facts.push(`Observed page path: ${redactText(group.pagePath)}`);
132
132
  for (const event of group.evidence) {
133
- if (event.network)
134
- facts.push(`Observed network response: ${event.network.method} ${safeUrl(event.network.url)}${event.network.status === undefined ? '' : ` (${event.network.status})`}.`);
133
+ if (event.network) {
134
+ const { method, url, status } = event.network;
135
+ facts.push(status !== undefined && status < 100
136
+ ? `Observed network outcome: ${method} ${safeUrl(url)} (HTTP status unavailable; recorded value: ${status}).`
137
+ : `Observed network response: ${method} ${safeUrl(url)}${status === undefined ? '' : ` (${status})`}.`);
138
+ }
135
139
  if (event.source === 'manual' && event.expected)
136
140
  facts.push(`Reporter-provided expected behavior: ${redactText(event.expected)}${event.expectedSource ? ` (source: ${redactText(event.expectedSource)})` : ' (source missing)'}.`);
137
141
  }
package/dist/cli.js CHANGED
@@ -47,7 +47,7 @@ Options:
47
47
  --environment NAME Metadata for a manual report
48
48
  --release NAME Metadata for a manual report
49
49
  --page PATH Page reported for a manual error
50
- --type TYPE javascript|promise|react|console|http|network|manual
50
+ --type TYPE javascript|promise|react|console|http|network|resource|manual
51
51
  --runtime RUNTIME browser|webview-ios|webview-android|unknown (manual input)
52
52
  --reproduce TEXT Reported action (--error only; repeatable)
53
53
  --precondition TEXT Reported setup (--error only; repeatable)
@@ -436,7 +436,7 @@ export async function main(args = process.argv.slice(2)) {
436
436
  const format = values.format ?? 'auto';
437
437
  if (format !== 'auto' && format !== 'json' && format !== 'jsonl' && format !== 'text')
438
438
  throw new Error('--format must be auto, json, jsonl, or text.');
439
- const types = ['javascript', 'promise', 'react', 'console', 'http', 'network', 'manual'];
439
+ const types = ['javascript', 'promise', 'react', 'console', 'http', 'network', 'resource', 'manual'];
440
440
  if (values.type !== undefined && !types.includes(values.type))
441
441
  throw new Error('--type is not supported.');
442
442
  if (values.runtime !== undefined && !['browser', 'webview-ios', 'webview-android', 'unknown'].includes(values.runtime))
@@ -3,7 +3,7 @@ import { pagePath, redactText } from "./redact.js";
3
3
  import { hash, record, timestamp } from "./validation.js";
4
4
  const statuses = ['only-current', 'both', 'only-baseline'];
5
5
  const runtimes = ['browser', 'webview-ios', 'webview-android', 'unknown'];
6
- const types = ['javascript', 'promise', 'react', 'console', 'http', 'network', 'manual'];
6
+ const types = ['javascript', 'promise', 'react', 'console', 'http', 'network', 'resource', 'manual'];
7
7
  const kinds = ['browser-error-json', 'browser-error-jsonl', 'manual-json', 'manual-jsonl', 'manual-text'];
8
8
  const normalizedMax = 128 * 1024;
9
9
  const hex64 = /^[0-9a-f]{64}$/;
package/dist/input.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { record, text, optionalText, strings, timestamp, parseWebSteps, hash } from "./validation.js";
2
2
  import { redactText, safeUrl } from "./redact.js";
3
3
  import { inputSource } from "./input-source.js";
4
- const TYPES = new Set(['javascript', 'promise', 'react', 'console', 'http', 'network', 'manual']);
4
+ const TYPES = new Set(['javascript', 'promise', 'react', 'console', 'http', 'network', 'resource', 'manual']);
5
5
  const RUNTIMES = new Set(['browser', 'webview-ios', 'webview-android', 'unknown']);
6
6
  const MAX_RECORDS = 10_000;
7
7
  const LOGGER_PREFIX = /^\[(?:ERROR|WARN|WARNING|INFO|DEBUG|TRACE|FATAL|vite|timestamp|\d{4}-\d{2}-\d{2}(?:[ T]\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}:\d{2})?)?|\d{2}:\d{2}:\d{2})\][ \t]+\S/i;
@@ -96,8 +96,8 @@ function browserEvent(value, index) {
96
96
  let status;
97
97
  if (net.status !== undefined) {
98
98
  status = number(net.status, `${label}.network.status`, true);
99
- if (status < 100 || status > 599)
100
- throw new Error(`${label}.network.status must be 100..599`);
99
+ if (status > 599)
100
+ throw new Error(`${label}.network.status must be 0..599`);
101
101
  }
102
102
  network = { method: redactText(method).toUpperCase(), url: safeUrl(url), durationMs, ...(status === undefined ? {} : { status }) };
103
103
  }
@@ -6,7 +6,7 @@ import { hash, parseWebSteps, record } from "./validation.js";
6
6
  const sha256 = /^[a-f0-9]{64}$/;
7
7
  const groupId = /^group-[a-f0-9]{16}$/;
8
8
  const caseId = /^TC_[a-f0-9]{16}$/;
9
- const eventTypes = new Set(['javascript', 'promise', 'react', 'console', 'http', 'network', 'manual']);
9
+ const eventTypes = new Set(['javascript', 'promise', 'react', 'console', 'http', 'network', 'resource', 'manual']);
10
10
  const runtimes = new Set(['browser', 'webview-ios', 'webview-android', 'unknown']);
11
11
  const kinds = new Set(['browser-error-json', 'manual-json', 'manual-text', 'browser-error-jsonl', 'manual-jsonl']);
12
12
  const refinementNote = 'Refinement: Original input records were not rechecked; group ranking and the existing TC selection were preserved. Candidates were regenerated from the verified snapshot and supplied profile.';
@@ -74,7 +74,7 @@ function observation(value, label) {
74
74
  string(network.method, `${label}.network.method`);
75
75
  string(network.url, `${label}.network.url`);
76
76
  if (network.status !== undefined) {
77
- integer(network.status, `${label}.network.status`, 100);
77
+ integer(network.status, `${label}.network.status`);
78
78
  if (network.status > 599)
79
79
  invalid(`${label}.network.status`);
80
80
  }
@@ -0,0 +1,9 @@
1
+ /** Flow QA reports use caseIds; linked results record an explicit selected-run scope. */
2
+ export interface LinkedSelection {
3
+ mode: 'selected';
4
+ totalCases: number;
5
+ selectedCaseIds: string[];
6
+ }
7
+ /** Keep a reported label without persisting any URL that may carry sensitive path data. */
8
+ export declare function safeReportedTargetName(value: unknown, label: string): string;
9
+ export declare function validateResultSelection(value: unknown, present: boolean, caseIds: readonly string[], expectedIds: ReadonlySet<string>, source: 'Flow QA report' | 'Linked result'): LinkedSelection | undefined;
@@ -0,0 +1,40 @@
1
+ import { redactText } from "./redact.js";
2
+ import { text } from "./validation.js";
3
+ /** Keep a reported label without persisting any URL that may carry sensitive path data. */
4
+ export function safeReportedTargetName(value, label) {
5
+ const name = text(value, label);
6
+ return redactText(name.replace(/[a-z][a-z0-9+.-]*:\/\/[^\s<>"']+|(?<!:)\/\/[^\s<>"']+/gi, '[redacted-url]'));
7
+ }
8
+ export function validateResultSelection(value, present, caseIds, expectedIds, source) {
9
+ if (!present) {
10
+ if (caseIds.length !== expectedIds.size)
11
+ throw new Error(source === 'Flow QA report'
12
+ ? 'The report does not account for every exported case.'
13
+ : 'Linked result has an incomplete case list.');
14
+ return undefined;
15
+ }
16
+ const linked = source === 'Linked result';
17
+ const idKey = linked ? 'selectedCaseIds' : 'caseIds';
18
+ const keys = linked ? ['mode', 'totalCases', idKey] : ['totalCases', idKey];
19
+ if (value === null || typeof value !== 'object' || Array.isArray(value)
20
+ || (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null)
21
+ || Reflect.ownKeys(value).length !== keys.length
22
+ || keys.some(key => !Object.hasOwn(value, key))) {
23
+ throw new Error(`${source} has an invalid selection declaration.`);
24
+ }
25
+ const declaration = value;
26
+ if (linked && declaration.mode !== 'selected')
27
+ throw new Error('Linked result has an invalid selection mode.');
28
+ if (!Number.isSafeInteger(declaration.totalCases) || declaration.totalCases !== expectedIds.size
29
+ || caseIds.length === 0 || caseIds.length >= expectedIds.size) {
30
+ throw new Error(`${source} selection totalCases does not match the exported suite or is not a proper subset.`);
31
+ }
32
+ const selectedCaseIds = declaration[idKey];
33
+ if (!Array.isArray(selectedCaseIds) || selectedCaseIds.length !== caseIds.length
34
+ || selectedCaseIds.some(id => typeof id !== 'string' || !expectedIds.has(id))
35
+ || new Set(selectedCaseIds).size !== selectedCaseIds.length
36
+ || !caseIds.every(id => selectedCaseIds.includes(id))) {
37
+ throw new Error(`${source} selected case IDs do not match the reported cases and exported suite.`);
38
+ }
39
+ return { mode: 'selected', totalCases: expectedIds.size, selectedCaseIds: [...selectedCaseIds] };
40
+ }
package/dist/results.js CHANGED
@@ -3,6 +3,7 @@ import { resolve } from 'node:path';
3
3
  import { jsonText, readVerifiedBundle } from "./artifacts.js";
4
4
  import { record, text, timestamp } from "./validation.js";
5
5
  import { redactText } from "./redact.js";
6
+ import { safeReportedTargetName, validateResultSelection } from "./result-selection.js";
6
7
  const runStatuses = new Set(['passed', 'failed', 'blocked', 'error', 'interrupted']);
7
8
  const caseStatuses = new Set(['passed', 'failed', 'flaky', 'blocked', 'skipped', 'error']);
8
9
  /** Associate a normalized Flow QA report with the exact exported immutable suite. */
@@ -27,29 +28,33 @@ export async function linkFlowQaReport(directory, rawReport) {
27
28
  const mappings = provenance.mappings.map((item, index) => record(item, `mappings[${index}]`));
28
29
  const expected = new Map(mappings.map(item => [item.caseId, item]));
29
30
  const seen = new Set();
31
+ const reportCaseIds = [];
30
32
  const cases = report.cases.map((item, index) => {
31
33
  const original = record(item, `report.cases[${index}]`), id = text(original.id, 'case.id');
32
34
  const mapping = expected.get(id);
33
35
  if (!mapping || seen.has(id))
34
36
  throw new Error('The report contains unknown or duplicate case IDs.');
35
37
  seen.add(id);
38
+ reportCaseIds.push(id);
36
39
  const caseStatus = text(original.status, 'case.status');
37
40
  if (!caseStatuses.has(caseStatus))
38
41
  throw new Error('Invalid Flow QA case status.');
39
42
  return { ...mapping, status: caseStatus, ...(original.reason === undefined ? {} : { reason: redactText(text(original.reason, 'case.reason')) }) };
40
43
  });
41
- if (seen.size !== expected.size)
42
- throw new Error('The report does not account for every exported case.');
44
+ const selection = validateResultSelection(report.selection, Object.hasOwn(report, 'selection'), reportCaseIds, new Set(expected.keys()), 'Flow QA report');
43
45
  if (status === 'passed' && cases.some(item => item.status === 'failed' || item.status === 'error'))
44
46
  throw new Error('The report status contradicts its case results.');
45
47
  const startedAt = timestamp(report.startedAt, 'report.startedAt'), finishedAt = timestamp(report.finishedAt, 'report.finishedAt');
46
48
  if (finishedAt < startedAt)
47
49
  throw new Error('The run finished before its start timestamp.');
50
+ const targetName = report.target === undefined ? undefined
51
+ : safeReportedTargetName(record(report.target, 'report.target').name, 'report.target.name');
48
52
  const output = {
49
53
  schemaVersion: 'error-to-test/results-1', runId,
50
54
  inputSha256: provenance.inputSha256, suiteSha256: provenance.suiteSha256,
51
55
  startedAt, finishedAt,
52
- status, cases,
56
+ status, ...(targetName === undefined ? {} : { targetName }),
57
+ ...(selection === undefined ? {} : { selection }), cases,
53
58
  note: 'These results cover the specified assertions. No source issue was automatically closed.',
54
59
  };
55
60
  const resultsRoot = resolve(root, 'results');
@@ -1,3 +1,4 @@
1
+ import { type LinkedSelection } from './result-selection.ts';
1
2
  export type LinkedRunStatus = 'passed' | 'failed' | 'blocked' | 'error' | 'interrupted';
2
3
  export type LinkedCaseStatus = 'passed' | 'failed' | 'flaky' | 'blocked' | 'skipped' | 'error';
3
4
  type DisplayCaseStatus = LinkedCaseStatus | 'not-run';
@@ -11,6 +12,8 @@ export interface RunSummary {
11
12
  status: LinkedRunStatus;
12
13
  startedAt: string;
13
14
  finishedAt: string;
15
+ targetName?: string;
16
+ selection?: LinkedSelection;
14
17
  };
15
18
  counts: Record<DisplayCaseStatus, number>;
16
19
  groups: {
@@ -4,6 +4,7 @@ import { join, resolve } from 'node:path';
4
4
  import { literal, readVerifiedBundle } from "./artifacts.js";
5
5
  import { redactText } from "./redact.js";
6
6
  import { record, text, timestamp } from "./validation.js";
7
+ import { safeReportedTargetName, validateResultSelection } from "./result-selection.js";
7
8
  const runStatuses = new Set(['passed', 'failed', 'blocked', 'error', 'interrupted']);
8
9
  const caseStatuses = new Set(['passed', 'failed', 'flaky', 'blocked', 'skipped', 'error']);
9
10
  const countStatuses = ['passed', 'failed', 'flaky', 'blocked', 'skipped', 'error', 'not-run'];
@@ -81,7 +82,7 @@ function parseResult(content, name, inputSha256, suiteSha256, expected) {
81
82
  catch {
82
83
  throw new Error(`Linked result ${name} is not a valid JSON object.`);
83
84
  }
84
- exactKeys(raw, ['schemaVersion', 'runId', 'inputSha256', 'suiteSha256', 'startedAt', 'finishedAt', 'status', 'cases', 'note'], [], `Linked result ${name}`);
85
+ exactKeys(raw, ['schemaVersion', 'runId', 'inputSha256', 'suiteSha256', 'startedAt', 'finishedAt', 'status', 'cases', 'note'], ['targetName', 'selection'], `Linked result ${name}`);
85
86
  if (raw.schemaVersion !== 'error-to-test/results-1')
86
87
  throw new Error(`Linked result ${name} uses an unsupported schema.`);
87
88
  const runId = text(raw.runId, `${name}.runId`);
@@ -98,8 +99,9 @@ function parseResult(content, name, inputSha256, suiteSha256, expected) {
98
99
  if (finishedAt < startedAt)
99
100
  throw new Error(`Linked result ${name} finished before it started.`);
100
101
  text(raw.note, `${name}.note`);
101
- if (!Array.isArray(raw.cases) || raw.cases.length !== expected.size)
102
- throw new Error(`Linked result ${name} has an incomplete case list.`);
102
+ const targetName = raw.targetName === undefined ? undefined : safeReportedTargetName(raw.targetName, `${name}.targetName`);
103
+ if (!Array.isArray(raw.cases) || raw.cases.length > expected.size)
104
+ throw new Error(`Linked result ${name} has an invalid case list.`);
103
105
  const seen = new Set();
104
106
  const cases = raw.cases.map((item, index) => {
105
107
  const label = `${name}.cases[${index}]`;
@@ -119,12 +121,12 @@ function parseResult(content, name, inputSha256, suiteSha256, expected) {
119
121
  const reason = entry.reason === undefined ? undefined : redactText(text(entry.reason, `${label}.reason`));
120
122
  return { ...mapping, eventIds: mapping.eventIds.map(redactText), status: caseStatus, ...(reason === undefined ? {} : { reason }) };
121
123
  });
122
- if (seen.size !== expected.size)
123
- throw new Error(`Linked result ${name} does not account for every exported case.`);
124
+ const selection = validateResultSelection(raw.selection, Object.hasOwn(raw, 'selection'), cases.map(item => item.caseId), new Set(expected.keys()), 'Linked result');
124
125
  if (status === 'passed' && cases.some(item => item.status === 'failed' || item.status === 'error')) {
125
126
  throw new Error(`Linked result ${name} contradicts its case results.`);
126
127
  }
127
- return { runId, status: status, startedAt, finishedAt, cases };
128
+ return { runId, status: status, startedAt, finishedAt,
129
+ ...(targetName === undefined ? {} : { targetName }), ...(selection === undefined ? {} : { selection }), cases };
128
130
  }
129
131
  function later(a, b) {
130
132
  if (a.finishedAt !== b.finishedAt)
@@ -227,6 +229,8 @@ export async function readRunSummary(directory) {
227
229
  });
228
230
  }
229
231
  const warnings = ['Counts are the latest reported case outcomes, not proof that any source issue is resolved.'];
232
+ if (latest?.selection)
233
+ warnings.push(`Latest linked run selected ${latest.selection.selectedCaseIds.length} of ${latest.selection.totalCases} exported cases. Unselected cases are not-run even if an earlier run reported outcomes for them.`);
230
234
  if (analysis.warnings !== undefined)
231
235
  warnings.push(...stringList(analysis.warnings, 'analysis.warnings').map(redactText));
232
236
  if (runCount) {
@@ -245,7 +249,9 @@ export async function readRunSummary(directory) {
245
249
  return {
246
250
  schemaVersion: 'error-to-test/run-summary-1', inputSha256,
247
251
  ...(suiteSha256 === undefined ? {} : { suiteSha256 }), runCount,
248
- ...(latest === undefined ? {} : { latestRun: { runId: latest.runId, status: latest.status, startedAt: latest.startedAt, finishedAt: latest.finishedAt } }),
252
+ ...(latest === undefined ? {} : { latestRun: { runId: latest.runId, status: latest.status, startedAt: latest.startedAt, finishedAt: latest.finishedAt,
253
+ ...(latest.targetName === undefined ? {} : { targetName: latest.targetName }),
254
+ ...(latest.selection === undefined ? {} : { selection: latest.selection }) } }),
249
255
  counts, groups, warnings,
250
256
  };
251
257
  }
@@ -259,6 +265,10 @@ export function renderRunSummary(summary) {
259
265
  if (!uuidPattern.test(run.runId) || !runStatuses.has(run.status))
260
266
  throw new Error('Invalid latest run in summary.');
261
267
  lines.push('## Latest linked run', '', `Run ID: ${run.runId}`, `Reported status: ${run.status}`, `Started: ${timestamp(run.startedAt, 'summary.latestRun.startedAt')}`, `Finished: ${timestamp(run.finishedAt, 'summary.latestRun.finishedAt')}`, '');
268
+ if (run.targetName)
269
+ lines.push('Reported target name:', '', literal(safeReportedTargetName(run.targetName, 'summary.latestRun.targetName')), '');
270
+ if (run.selection)
271
+ lines.push(`Selected cases: ${run.selection.selectedCaseIds.length} of ${run.selection.totalCases} exported cases`, '');
262
272
  }
263
273
  else
264
274
  lines.push('No linked runs were found. All selected cases are not-run.', '');
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type EventType = 'javascript' | 'promise' | 'react' | 'console' | 'http' | 'network' | 'manual';
1
+ export type EventType = 'javascript' | 'promise' | 'react' | 'console' | 'http' | 'network' | 'resource' | 'manual';
2
2
  export type Runtime = 'browser' | 'webview-ios' | 'webview-android' | 'unknown';
3
3
  export type Locator = {
4
4
  by: 'role';
package/docs/releases.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  Package: `@ihyeon/error-to-test` · Repository: [hyeonse-swing/error-to-test](https://github.com/hyeonse-swing/error-to-test) · Workflow: `.github/workflows/ci.yml`.
4
4
 
5
+ ## 0.2.8
6
+
7
+ Restores compatibility with Browser Error Log resource events across input, CLI, profiles, comparisons and refinement, and with Flow QA selected-run reports. Valid v1 network status values (0..599) are preserved; values below 100 are described as unavailable HTTP status rather than a response.
8
+
9
+ Selected reports must declare the exact reported case set and the original suite size. Linked results preserve that selection; latest-run summaries leave omitted cases `not-run` even after a previous full pass. Optional sanitized target names survive linking, without target URLs or device identifiers. Existing full results remain readable. New selection/target fields require this reader or newer, because earlier readers reject unknown fields.
10
+
11
+ The new package ecosystem smoke captures real SDK errors in Chromium, exercises review and execution boundaries through installed CLIs, links whole and selected runs, checks the `not-run` gate, and verifies installed UI/design-system assets. It also audits the fresh consumer for known high/critical runtime advisories. Release preparation now depends on this check in CI.
12
+
13
+ Local release-candidate checks on 2026-11-16: 199 tests, type checking, build, isolated package installation and the controlled browser flow. Registry publication and GitHub Actions are separate evidence; their final status is available on the matching release/workflow.
14
+
5
15
  ## 0.2.0
6
16
 
7
17
  JSONL inputs add explicit `--format jsonl`, line-numbered validation, and browser/manual record kinds while preserving original bytes, multi-file provenance, comparison/baseline selection, and review gates. Existing 0.1.x bundles and formats remain supported. Integrations with exhaustive `SourceCoverage.kind` handling should include `browser-error-jsonl` and `manual-jsonl`.
@@ -10,7 +20,7 @@ This minor release sets both package manifests to `0.2.0` before verification. T
10
20
 
11
21
  ## Automatic publication
12
22
 
13
- Pull requests and main pushes verify the package on Ubuntu and macOS. A verified main push then prepares an immutable release source:
23
+ Pull requests and main pushes verify the package on Ubuntu and macOS. An additional Ubuntu job installs the current tarball with published Browser Error Log 0.2.10 and Flow QA 0.8.8, then checks the complete capture/analyze/run/link loop in Chromium. Both jobs must pass before a main push prepares an immutable release source:
14
24
 
15
25
  - The first publication uses the manifest version (`0.1.0`). A new npm package needs one authenticated bootstrap publication before its Trusted Publisher can be configured.
16
26
  - Changes to `src/`, `bin/`, `examples/`, `LICENSE`, `package.json`, `package-lock.json`, or `tsconfig.json` automatically increase patch when the manifest still matches npm latest. The workflow commits the version change as `github-actions[bot]` and publishes that exact commit in the same run.
@@ -27,6 +37,7 @@ Publishing uses npm Trusted Publishing (GitHub Actions OIDC) for `hyeonse-swing/
27
37
  npm ci
28
38
  npm run check
29
39
  npm run check:package
40
+ npm run smoke:ecosystem
30
41
  ```
31
42
 
32
43
  To test real error capture and browser execution, supply local checked-out SDK/Flow QA sources and an installed Chromium browser:
@@ -47,4 +58,4 @@ The browser integration was verified on 2026-10-13 with a controlled local appli
47
58
  | Report linkage | Before/after reports linked to the exact suite and source groups |
48
59
  | Changed source | Stale flow and bundle rejected |
49
60
 
50
- An unresolved case means the overall QA run can remain `blocked` even when the two runnable cases pass. This integration check is separate from standalone CI and requires the sibling packages; CI does not fetch company repositories or application data. Live service authentication, native devices, and production behavior are outside this proof.
61
+ An unresolved case means the overall QA run can remain `blocked` even when the two runnable cases pass. This historical source integration check requires sibling repositories. The newer `smoke:ecosystem` check runs in CI using public packages and a local fixture; neither check fetches company repositories or application data. Live service authentication, native devices, and production behavior are outside this proof.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ihyeon/error-to-test",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Turn captured browser errors and pasted error reports into traceable regression test candidates.",
5
5
  "license": "MIT",
6
6
  "author": "Hyeonse Im",
@@ -54,6 +54,7 @@
54
54
  "prepack": "npm run build",
55
55
  "check:package": "npm run build && node scripts/package-smoke.mjs",
56
56
  "smoke:flowqa": "node scripts/flowqa-smoke.ts",
57
+ "smoke:ecosystem": "npm run build && node scripts/ecosystem-smoke.mjs",
57
58
  "demo": "node bin/error-to-test.mjs analyze --input examples/errors.json --profile examples/profile.json"
58
59
  },
59
60
  "devDependencies": {