@ihyeon/error-to-test 0.5.0 → 0.5.2
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 -2
- package/README.md +4 -3
- package/dist/cli.js +7 -4
- package/dist/trace.d.ts +4 -1
- package/dist/trace.js +10 -4
- package/package.json +1 -1
- package/ui/review/app.js +4 -0
package/README.ko.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
SDK에서 내보낸 브라우저 오류 로그 또는 **직접 입력한 오류 메시지·스택**을 분석해 반복 오류 묶음과 회귀 TC 초안으로 만듭니다. 모델이나 수집 서버 없이 로컬에서 사용하며, Flow QA 형식으로 내보냅니다.
|
|
4
4
|
|
|
5
|
-
[English](README.md)
|
|
5
|
+
[English](https://github.com/hyeonse-swing/error-to-test/blob/main/README.md)
|
|
6
6
|
|
|
7
7
|
## AI 도우미용 스킬
|
|
8
8
|
|
|
@@ -294,11 +294,12 @@ SDK가 반환한 오류 ID에서 그룹·TC 후보·검토 차단 사유·최근
|
|
|
294
294
|
|
|
295
295
|
```sh
|
|
296
296
|
error-to-test trace ./review-analysis --event-id "YOUR_EVENT_ID"
|
|
297
|
+
error-to-test trace ./review-analysis --event-id "YOUR_EVENT_ID" --project "YOUR_PROJECT"
|
|
297
298
|
error-to-test trace ./review-analysis --event-id "YOUR_EVENT_ID" --format json
|
|
298
299
|
error-to-test trace ./review-analysis --event-id "YOUR_EVENT_ID" --target-fingerprint "$TARGET_FINGERPRINT"
|
|
299
300
|
```
|
|
300
301
|
|
|
301
|
-
`error-to-test/trace-1`은 여러 프로젝트에서 같은 ID를 썼다면 일치하는 그룹을 모두 반환합니다. 미선택·차단·검토 준비와 최근 실행에서 빠진 TC의 `not-run`을 구분하고, 실행 결과는 `results`와 동일한 대상 범위·최근 실행 규칙을 따릅니다. 오류 메시지나 스택 대신 ID·프로젝트·그룹·TC·상태와 입력 해시, 부분 수집 여부, 보존 범위 미확인 경고를 표시합니다. ID가 저장된 분석 입력에 없으면 `found: false`와 종료 코드 2를 반환합니다. 서비스 전체에서 발생하지 않았다는 뜻은 아닙니다. 잘못된 번들·옵션은 코드 1입니다. 원본 바이트는 필요 시 `verify --input`으로 확인하세요. API는 `readEventTrace(directory, eventId, { targetFingerprint })`와 `renderEventTrace(trace)`입니다.
|
|
302
|
+
`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)`입니다.
|
|
302
303
|
|
|
303
304
|
Flow QA 설치와 실행 대상 설정은 별도로 필요합니다. 위 `flows/`·`cases/` 구조를 기존 검토 화면에서 읽을 수 있습니다. 분석 명령은 브라우저를 실행하거나 외부 모델에 요청하지 않습니다. TC 통과만으로 원래 오류를 수정 완료 처리하지 않습니다.
|
|
304
305
|
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Turn captured browser errors **or a pasted error report** into grouped issues, r
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@ihyeon/error-to-test) [](https://github.com/hyeonse-swing/error-to-test/actions/workflows/ci.yml)
|
|
6
6
|
|
|
7
|
-
[한국어](README.ko.md)
|
|
7
|
+
[한국어](https://github.com/hyeonse-swing/error-to-test/blob/main/README.ko.md)
|
|
8
8
|
|
|
9
9
|
## AI assistant skill
|
|
10
10
|
|
|
@@ -388,13 +388,14 @@ Use the ID shown by Browser Error Log to find its observed groups, selected TC c
|
|
|
388
388
|
|
|
389
389
|
```sh
|
|
390
390
|
error-to-test trace ./analysis --event-id "YOUR_EVENT_ID"
|
|
391
|
+
error-to-test trace ./analysis --event-id "YOUR_EVENT_ID" --project "YOUR_PROJECT"
|
|
391
392
|
error-to-test trace ./analysis --event-id "YOUR_EVENT_ID" --format json
|
|
392
393
|
error-to-test trace ./analysis --event-id "YOUR_EVENT_ID" --target-fingerprint "$TARGET_FINGERPRINT"
|
|
393
394
|
```
|
|
394
395
|
|
|
395
|
-
The read-only `error-to-test/trace-1` result includes all matching groups because two projects can reuse an ID. 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.
|
|
396
|
+
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.
|
|
396
397
|
|
|
397
|
-
The API is `await readEventTrace(directory, eventId, { targetFingerprint })` and `renderEventTrace(trace)`. Omit the options argument to use the latest linked run across all targets. `trace` reads the verified snapshot and writes no files.
|
|
398
|
+
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.
|
|
398
399
|
|
|
399
400
|
## JavaScript API
|
|
400
401
|
|
package/dist/cli.js
CHANGED
|
@@ -37,7 +37,7 @@ const help = `Error to Test — local error analysis and regression TC drafts
|
|
|
37
37
|
error-to-test results new-directory [--format text|json] [--out summary.md] [--target-fingerprint SHA256] [--require-pass | --fail-on STATUS ...]
|
|
38
38
|
error-to-test readiness new-directory [--format text|json]
|
|
39
39
|
error-to-test coverage new-directory [--format text|json]
|
|
40
|
-
error-to-test trace new-directory --event-id ID [--format text|json] [--target-fingerprint SHA256]
|
|
40
|
+
error-to-test trace new-directory --event-id ID [--project NAME] [--format text|json] [--target-fingerprint SHA256]
|
|
41
41
|
error-to-test compare BASELINE CURRENT [--format text|json] [--out comparison.md] [--max-new N]
|
|
42
42
|
|
|
43
43
|
Options:
|
|
@@ -52,6 +52,7 @@ Options:
|
|
|
52
52
|
--format text|json Readiness format (default: text Markdown; exit 0 ready, 2 blocked/empty, 1 on error)
|
|
53
53
|
--format text|json Observed group coverage format (default: text Markdown; read-only, no gate)
|
|
54
54
|
--event-id ID Trace an SDK event ID within one saved analysis (exit 2 when absent)
|
|
55
|
+
--project NAME Scope trace matches to one exact project name
|
|
55
56
|
--target-fingerprint SHA256 Scope trace outcomes to this linked target fingerprint
|
|
56
57
|
--profile FILE Confirmed app scenarios and explicit assertions (analyze/verify); existing profile to extend (init-profile)
|
|
57
58
|
--profile FILE Replacement profile for the bundle's previously selected groups (refine; required)
|
|
@@ -439,13 +440,15 @@ export async function main(args = process.argv.slice(2)) {
|
|
|
439
440
|
if (positionals.length !== 2 || !positionals[1]?.trim() || !values['event-id']?.trim()) {
|
|
440
441
|
throw new Error('trace requires one bundle directory and --event-id ID.');
|
|
441
442
|
}
|
|
442
|
-
if (Object.keys(values).some(key => !['event-id', 'format', 'target-fingerprint', 'help'].includes(key))) {
|
|
443
|
-
throw new Error('Unsupported option for trace. Use only --event-id ID, --format text|json, and --target-fingerprint SHA256.');
|
|
443
|
+
if (Object.keys(values).some(key => !['event-id', 'project', 'format', 'target-fingerprint', 'help'].includes(key))) {
|
|
444
|
+
throw new Error('Unsupported option for trace. Use only --event-id ID, --project NAME, --format text|json, and --target-fingerprint SHA256.');
|
|
444
445
|
}
|
|
445
446
|
const format = values.format ?? 'text';
|
|
446
447
|
if (format !== 'text' && format !== 'json')
|
|
447
448
|
throw new Error('trace --format must be text or json.');
|
|
448
|
-
const trace = await readEventTrace(resolve(positionals[1]), values['event-id'], {
|
|
449
|
+
const trace = await readEventTrace(resolve(positionals[1]), values['event-id'], {
|
|
450
|
+
project: values.project, targetFingerprint: values['target-fingerprint'],
|
|
451
|
+
});
|
|
449
452
|
const content = format === 'json' ? jsonText(trace) : renderEventTrace(trace);
|
|
450
453
|
if (Buffer.byteLength(content) > 64 * 1024 * 1024)
|
|
451
454
|
throw new Error('The event trace exceeds 64 MiB. Narrow the bundle before requesting output.');
|
package/dist/trace.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ type TraceCase = {
|
|
|
13
13
|
export interface EventTrace {
|
|
14
14
|
schemaVersion: 'error-to-test/trace-1';
|
|
15
15
|
eventId: string;
|
|
16
|
+
project?: string;
|
|
16
17
|
found: boolean;
|
|
17
18
|
source: {
|
|
18
19
|
inputSha256: string;
|
|
@@ -41,6 +42,8 @@ export interface EventTrace {
|
|
|
41
42
|
warnings: string[];
|
|
42
43
|
}
|
|
43
44
|
/** Find an event in one verified saved analysis and its latest linked run. */
|
|
44
|
-
export declare function readEventTrace(directory: string, eventId: string, options?: ReadRunSummaryOptions
|
|
45
|
+
export declare function readEventTrace(directory: string, eventId: string, options?: ReadRunSummaryOptions & {
|
|
46
|
+
project?: string;
|
|
47
|
+
}): Promise<EventTrace>;
|
|
45
48
|
export declare function renderEventTrace(trace: EventTrace): string;
|
|
46
49
|
export {};
|
package/dist/trace.js
CHANGED
|
@@ -26,10 +26,13 @@ export async function readEventTrace(directory, eventId, options = {}) {
|
|
|
26
26
|
const requested = text(eventId, 'eventId');
|
|
27
27
|
if (redactText(requested) !== requested)
|
|
28
28
|
throw new Error('eventId contains data that cannot be safely displayed.');
|
|
29
|
+
const project = options.project === undefined ? undefined : text(options.project, 'project');
|
|
30
|
+
if (project !== undefined && redactText(project) !== project)
|
|
31
|
+
throw new Error('project contains data that cannot be safely displayed.');
|
|
29
32
|
const snapshot = await readVerifiedBundle(directory);
|
|
30
33
|
const readiness = summarizeReadiness(snapshot);
|
|
31
34
|
const coverage = summarizeCoverage(snapshot, readiness);
|
|
32
|
-
const runs = await summarizeRunSummary(directory, snapshot, options);
|
|
35
|
+
const runs = await summarizeRunSummary(directory, snapshot, { targetFingerprint: options.targetFingerprint });
|
|
33
36
|
const sourceCoverage = record(snapshot.analysis.coverage, 'analysis.coverage');
|
|
34
37
|
const kind = sourceCoverage.kind;
|
|
35
38
|
if (kind !== 'browser-error-json' && kind !== 'browser-error-jsonl' && kind !== 'manual-json'
|
|
@@ -53,7 +56,7 @@ export async function readEventTrace(directory, eventId, options = {}) {
|
|
|
53
56
|
if (!Array.isArray(ids) || ids.length !== group.count || ids.some(id => typeof id !== 'string' || !id.trim() || id.length > 8192)) {
|
|
54
57
|
throw new Error('STALE_BUNDLE: Observed event IDs are invalid.');
|
|
55
58
|
}
|
|
56
|
-
if (!ids.includes(requested))
|
|
59
|
+
if (!ids.includes(requested) || (project !== undefined && group.project !== project))
|
|
57
60
|
return;
|
|
58
61
|
const covered = coveredGroups.get(groupId);
|
|
59
62
|
const runGroup = runGroups.get(groupId);
|
|
@@ -82,13 +85,15 @@ export async function readEventTrace(directory, eventId, options = {}) {
|
|
|
82
85
|
});
|
|
83
86
|
const warnings = [...new Set([
|
|
84
87
|
...coverage.warnings, ...runs.warnings,
|
|
85
|
-
...(matches.length ? [] : [
|
|
88
|
+
...(matches.length ? [] : [project === undefined
|
|
89
|
+
? 'This event ID was not found in the saved analysis input. This does not establish that it never occurred or was never collected.'
|
|
90
|
+
: 'This event ID was not found for the selected project in the saved analysis input. This does not establish that it never occurred or was never collected.']),
|
|
86
91
|
...(sourceCoverage.partial ? ['The source export was marked partial; other collected events may be outside this saved input.'] : []),
|
|
87
92
|
...(requested.includes('[redacted') ? ['The saved event ID contains redacted data; multiple original IDs may share this displayed value.'] : []),
|
|
88
93
|
...(matches.length > 1 ? ['The same event ID appears in multiple observed groups; use project and group ID to distinguish them.'] : []),
|
|
89
94
|
])];
|
|
90
95
|
return {
|
|
91
|
-
schemaVersion: 'error-to-test/trace-1', eventId: requested, found: matches.length > 0,
|
|
96
|
+
schemaVersion: 'error-to-test/trace-1', eventId: requested, ...(project === undefined ? {} : { project }), found: matches.length > 0,
|
|
92
97
|
source: { inputSha256: coverage.inputSha256, analysisSha256: coverage.analysisSha256,
|
|
93
98
|
...(coverage.suiteSha256 === undefined ? {} : { suiteSha256: coverage.suiteSha256 }),
|
|
94
99
|
kind, frequency: coverage.frequency, partial: sourceCoverage.partial, retention: 'unknown' },
|
|
@@ -110,6 +115,7 @@ export function renderEventTrace(trace) {
|
|
|
110
115
|
throw new Error('Invalid trace run status.');
|
|
111
116
|
}
|
|
112
117
|
const lines = ['# Event trace', '', 'Event ID:', '', literal(text(trace.eventId, 'trace.eventId')),
|
|
118
|
+
...(trace.project === undefined ? [] : ['Project filter:', '', literal(text(trace.project, 'trace.project'))]),
|
|
113
119
|
`Found in saved input: ${trace.found ? 'yes' : 'no'}`,
|
|
114
120
|
`Input SHA-256: ${checked(trace.source.inputSha256, shaPattern, 'trace.source.inputSha256')}`,
|
|
115
121
|
`Analysis SHA-256: ${checked(trace.source.analysisSha256, shaPattern, 'trace.source.analysisSha256')}`,
|
package/package.json
CHANGED
package/ui/review/app.js
CHANGED
|
@@ -158,6 +158,10 @@ function editRule(rule) {
|
|
|
158
158
|
append(panel, heading('Review answers'), paragraph(`Rule ${rule.id}`, 'mono muted'));
|
|
159
159
|
const matched = session.rules.find(item => item.id === rule.id)?.groupIds ?? [];
|
|
160
160
|
append(panel, paragraph(`Applies to ${matched.length} observed group${matched.length === 1 ? '' : 's'}.`, 'muted'), list(matched, 'No observed group matches this rule.'));
|
|
161
|
+
const sourceCandidates = session.candidates.filter(candidate => matched.includes(candidate.groupId)
|
|
162
|
+
&& (candidate.ruleId === rule.id || !candidate.ruleId));
|
|
163
|
+
append(panel, paragraph(`${sourceCandidates.length} source candidate${sourceCandidates.length === 1 ? '' : 's'} in affected selected groups. Preview to see regenerated candidates.`, 'muted'),
|
|
164
|
+
list(sourceCandidates.map(candidate => `${candidate.groupId} · ${candidate.id}`), 'No selected candidate in these groups.'));
|
|
161
165
|
const match = element('details');
|
|
162
166
|
append(match, element('summary', '', 'Rule scope'), element('pre', 'code-block', JSON.stringify(rule.match, null, 2)));
|
|
163
167
|
panel.append(match);
|