@ihyeon/error-to-test 0.5.4 → 0.5.5
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 +3 -0
- package/README.md +3 -0
- package/dist/cli.js +39 -8
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -308,10 +308,13 @@ SDK가 반환한 오류 ID에서 그룹·TC 후보·검토 차단 사유·최근
|
|
|
308
308
|
```sh
|
|
309
309
|
error-to-test trace ./review-analysis --event-id "YOUR_EVENT_ID"
|
|
310
310
|
error-to-test trace ./review-analysis --event-id "YOUR_EVENT_ID" --project "YOUR_PROJECT"
|
|
311
|
+
error-to-test trace ./review-analysis --reference '{"project":"YOUR_PROJECT","eventId":"YOUR_EVENT_ID"}'
|
|
311
312
|
error-to-test trace ./review-analysis --event-id "YOUR_EVENT_ID" --format json
|
|
312
313
|
error-to-test trace ./review-analysis --event-id "YOUR_EVENT_ID" --target-fingerprint "$TARGET_FINGERPRINT"
|
|
313
314
|
```
|
|
314
315
|
|
|
316
|
+
Browser Error Log에서 복사한 JSON을 `--reference`에 붙여 넣으면 공백이나 따옴표가 포함된 프로젝트 이름과 오류 ID까지 그대로 조회합니다. `--reference`와 개별 ID·프로젝트 옵션은 함께 사용하지 않습니다.
|
|
317
|
+
|
|
315
318
|
`error-to-test/trace-1`은 여러 프로젝트에서 같은 ID를 썼다면 일치하는 그룹을 모두 반환합니다. `--project`로 프로젝트 이름을 정확히 지정하면 그 프로젝트만 조회하며, ID가 다른 프로젝트에만 있으면 `found: false`와 종료 코드 2를 반환합니다. 미선택·차단·검토 준비와 최근 실행에서 빠진 TC의 `not-run`을 구분하고, 실행 결과는 `results`와 동일한 대상 범위·최근 실행 규칙을 따릅니다. 오류 메시지나 스택 대신 ID·프로젝트·그룹·TC·상태와 입력 해시, 부분 수집 여부, 보존 범위 미확인 경고를 표시합니다. ID가 저장된 분석 입력에 없으면 `found: false`와 종료 코드 2를 반환합니다. 서비스 전체에서 발생하지 않았다는 뜻은 아닙니다. 잘못된 번들·옵션은 코드 1입니다. 원본 바이트는 필요 시 `verify --input`으로 확인하세요. API는 `readEventTrace(directory, eventId, { project, targetFingerprint })`와 `renderEventTrace(trace)`입니다.
|
|
316
319
|
|
|
317
320
|
Flow QA 설치와 실행 대상 설정은 별도로 필요합니다. 위 `flows/`·`cases/` 구조를 기존 검토 화면에서 읽을 수 있습니다. 분석 명령은 브라우저를 실행하거나 외부 모델에 요청하지 않습니다. TC 통과만으로 원래 오류를 수정 완료 처리하지 않습니다.
|
package/README.md
CHANGED
|
@@ -402,10 +402,13 @@ Use the ID shown by Browser Error Log to find its observed groups, selected TC c
|
|
|
402
402
|
```sh
|
|
403
403
|
error-to-test trace ./analysis --event-id "YOUR_EVENT_ID"
|
|
404
404
|
error-to-test trace ./analysis --event-id "YOUR_EVENT_ID" --project "YOUR_PROJECT"
|
|
405
|
+
error-to-test trace ./analysis --reference '{"project":"YOUR_PROJECT","eventId":"YOUR_EVENT_ID"}'
|
|
405
406
|
error-to-test trace ./analysis --event-id "YOUR_EVENT_ID" --format json
|
|
406
407
|
error-to-test trace ./analysis --event-id "YOUR_EVENT_ID" --target-fingerprint "$TARGET_FINGERPRINT"
|
|
407
408
|
```
|
|
408
409
|
|
|
410
|
+
Paste the JSON copied from Browser Error Log into `--reference` to match its exact project and event ID, including spaces and quotes. Use `--reference` or the separate ID and project options.
|
|
411
|
+
|
|
409
412
|
The read-only `error-to-test/trace-1` result includes all matching groups because two projects can reuse an ID. Pass `--project` to match one exact project name; an ID found only in other projects then yields `found: false` and exit `2`. It retains `unselected`, `blocked`, and `review-ready` states; a selected case omitted from the latest linked run is `not-run`. Linked results use the same latest-run and target-scope rules as `results`. Output includes source hashes, partial-export status, and unknown retention without copying error messages or stacks. An ID missing from the saved input yields `found: false` and CLI exit `2`; it does not establish that the event never occurred or was never collected. Invalid bundles, linked results, or options exit `1`. Original input bytes can be rechecked with `verify --input` when available.
|
|
410
413
|
|
|
411
414
|
The API is `await readEventTrace(directory, eventId, { project, targetFingerprint })` and `renderEventTrace(trace)`. Omit the options argument to use all projects and the latest linked run across all targets. `trace` reads the verified snapshot and writes no files.
|
package/dist/cli.js
CHANGED
|
@@ -38,7 +38,7 @@ const help = `Error to Test — local error analysis and regression TC drafts
|
|
|
38
38
|
error-to-test results new-directory [--format text|json] [--out summary.md] [--target-fingerprint SHA256] [--require-pass | --fail-on STATUS ...]
|
|
39
39
|
error-to-test readiness new-directory [--format text|json]
|
|
40
40
|
error-to-test coverage new-directory [--format text|json]
|
|
41
|
-
error-to-test trace new-directory --event-id ID [--project NAME] [--format text|json] [--target-fingerprint SHA256]
|
|
41
|
+
error-to-test trace new-directory (--event-id ID [--project NAME] | --reference JSON) [--format text|json] [--target-fingerprint SHA256]
|
|
42
42
|
error-to-test compare BASELINE CURRENT [--format text|json] [--out comparison.md] [--max-new N]
|
|
43
43
|
|
|
44
44
|
Options:
|
|
@@ -53,6 +53,7 @@ Options:
|
|
|
53
53
|
--format text|json Readiness format (default: text Markdown; exit 0 ready, 2 blocked/empty, 1 on error)
|
|
54
54
|
--format text|json Observed group coverage format (default: text Markdown; read-only, no gate)
|
|
55
55
|
--event-id ID Trace an SDK event ID within one saved analysis (exit 2 when absent)
|
|
56
|
+
--reference JSON Trace a copied Browser Error Log {project,eventId} reference
|
|
56
57
|
--project NAME Scope trace matches to one exact project name
|
|
57
58
|
--target-fingerprint SHA256 Scope trace outcomes to this linked target fingerprint
|
|
58
59
|
--profile FILE Confirmed app scenarios and explicit assertions (analyze/verify); existing profile to extend (init-profile)
|
|
@@ -189,7 +190,7 @@ export async function main(args = process.argv.slice(2)) {
|
|
|
189
190
|
help: { type: 'boolean', short: 'h' }, version: { type: 'boolean', short: 'v' }, input: { type: 'string', multiple: true }, error: { type: 'string' }, report: { type: 'string' },
|
|
190
191
|
format: { type: 'string' }, profile: { type: 'string' }, baseline: { type: 'string' }, project: { type: 'string' }, environment: { type: 'string' },
|
|
191
192
|
release: { type: 'string' }, page: { type: 'string' }, type: { type: 'string' }, runtime: { type: 'string' }, from: { type: 'string' }, to: { type: 'string' },
|
|
192
|
-
top: { type: 'string' }, 'min-count': { type: 'string' }, 'max-new': { type: 'string' }, group: { type: 'string', multiple: true }, 'fail-on': { type: 'string', multiple: true }, 'require-pass': { type: 'boolean' }, 'target-fingerprint': { type: 'string' }, 'event-id': { type: 'string' }, out: { type: 'string' }, reviewed: { type: 'boolean' },
|
|
193
|
+
top: { type: 'string' }, 'min-count': { type: 'string' }, 'max-new': { type: 'string' }, group: { type: 'string', multiple: true }, 'fail-on': { type: 'string', multiple: true }, 'require-pass': { type: 'boolean' }, 'target-fingerprint': { type: 'string' }, 'event-id': { type: 'string' }, reference: { type: 'string' }, out: { type: 'string' }, reviewed: { type: 'boolean' },
|
|
193
194
|
draft: { type: 'string' }, port: { type: 'string' },
|
|
194
195
|
reproduce: { type: 'string', multiple: true }, precondition: { type: 'string', multiple: true },
|
|
195
196
|
expected: { type: 'string' }, 'expected-source': { type: 'string' },
|
|
@@ -458,17 +459,45 @@ export async function main(args = process.argv.slice(2)) {
|
|
|
458
459
|
return;
|
|
459
460
|
}
|
|
460
461
|
if (command === 'trace') {
|
|
461
|
-
if (positionals.length !== 2 || !positionals[1]?.trim() ||
|
|
462
|
-
|
|
462
|
+
if (positionals.length !== 2 || !positionals[1]?.trim() ||
|
|
463
|
+
(values['event-id'] === undefined) === (values.reference === undefined)) {
|
|
464
|
+
throw new Error('trace requires one bundle directory and exactly one of --event-id ID or --reference JSON.');
|
|
463
465
|
}
|
|
464
|
-
if (Object.keys(values).some(key => !['event-id', 'project', 'format', 'target-fingerprint', 'help'].includes(key))) {
|
|
465
|
-
throw new Error('Unsupported option for trace. Use only --event-id ID, --project NAME, --format text|json, and --target-fingerprint SHA256.');
|
|
466
|
+
if (Object.keys(values).some(key => !['event-id', 'reference', 'project', 'format', 'target-fingerprint', 'help'].includes(key))) {
|
|
467
|
+
throw new Error('Unsupported option for trace. Use only --event-id ID, --reference JSON, --project NAME, --format text|json, and --target-fingerprint SHA256.');
|
|
466
468
|
}
|
|
467
469
|
const format = values.format ?? 'text';
|
|
468
470
|
if (format !== 'text' && format !== 'json')
|
|
469
471
|
throw new Error('trace --format must be text or json.');
|
|
470
|
-
|
|
471
|
-
|
|
472
|
+
if (values.reference !== undefined && values.project !== undefined) {
|
|
473
|
+
throw new Error('Use --reference on its own; it already contains the project and event ID.');
|
|
474
|
+
}
|
|
475
|
+
let eventId = values['event-id'];
|
|
476
|
+
let project = values.project;
|
|
477
|
+
if (values.reference !== undefined) {
|
|
478
|
+
if (Buffer.byteLength(values.reference, 'utf8') > 64 * 1024) {
|
|
479
|
+
throw new Error('--reference JSON must be 64 KiB or smaller.');
|
|
480
|
+
}
|
|
481
|
+
let parsed;
|
|
482
|
+
try {
|
|
483
|
+
parsed = JSON.parse(values.reference);
|
|
484
|
+
}
|
|
485
|
+
catch {
|
|
486
|
+
throw new Error('--reference requires a JSON object with project and eventId strings.');
|
|
487
|
+
}
|
|
488
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
489
|
+
throw new Error('--reference requires a JSON object with project and eventId strings.');
|
|
490
|
+
}
|
|
491
|
+
const candidate = parsed;
|
|
492
|
+
if (typeof candidate.project !== 'string' || !candidate.project.trim() ||
|
|
493
|
+
typeof candidate.eventId !== 'string' || !candidate.eventId.trim()) {
|
|
494
|
+
throw new Error('--reference requires a JSON object with project and eventId strings.');
|
|
495
|
+
}
|
|
496
|
+
eventId = candidate.eventId;
|
|
497
|
+
project = candidate.project;
|
|
498
|
+
}
|
|
499
|
+
const trace = await readEventTrace(resolve(positionals[1]), eventId, {
|
|
500
|
+
project, targetFingerprint: values['target-fingerprint'],
|
|
472
501
|
});
|
|
473
502
|
const content = format === 'json' ? jsonText(trace) : renderEventTrace(trace);
|
|
474
503
|
if (Buffer.byteLength(content) > 64 * 1024 * 1024)
|
|
@@ -583,6 +612,8 @@ export async function main(args = process.argv.slice(2)) {
|
|
|
583
612
|
throw new Error('--target-fingerprint applies to results only.');
|
|
584
613
|
if (values['event-id'] !== undefined)
|
|
585
614
|
throw new Error('--event-id applies to trace only.');
|
|
615
|
+
if (values.reference !== undefined)
|
|
616
|
+
throw new Error('--reference applies to trace only.');
|
|
586
617
|
if (values['max-new'] !== undefined)
|
|
587
618
|
throw new Error('--max-new applies to compare only.');
|
|
588
619
|
if (values.baseline !== undefined && values.baseline.trim() === '')
|
package/package.json
CHANGED