@ihyeon/error-to-test 0.4.6 → 0.4.7

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
@@ -325,6 +325,8 @@ error-to-test results ./analysis --fail-on failed --fail-on error --fail-on not-
325
325
 
326
326
  전체 보고서를 출력하거나 저장한 뒤 0 또는 2를 반환하고 숫자로 된 판정 요약은 stderr에 씁니다. JSON stdout은 기존 `error-to-test/run-summary-1` 형식이며 판정 필드를 추가하지 않습니다. 출력 오류는 판정 요약 없이 코드 1로 처리하고 기존 파일은 보존합니다.
327
327
 
328
+ 전체 통과를 요구할 때는 `error-to-test results ./analysis --require-pass`를 사용합니다. 선택한 대상의 최신 실행 자체가 통과했고, 내보낸 TC가 하나 이상이며 그 실행에서 모두 통과해야 종료 코드 0입니다. 중단·부분 실행·미실행은 2입니다. 대상이 여럿이거나 대상 정보가 없는 기록이 섞여 있으면 확인하려는 `--target-fingerprint`를 지정하세요. 대상이 없는 기록만 있다면 대상 정보가 있는 보고서가 필요합니다. 잘못된 입력·옵션·출력 오류는 1입니다.
329
+
328
330
  선택한 대상 범위의 최신 실행 하나에 있는 TC 결과만 평가하며 과거 실패나 다른 대상의 결과를 합치거나 실행 전체 상태를 별도 조건으로 삼지 않습니다. 연결 실행이 없으면 선택된 TC는 `not-run`이므로 미실행도 실패시킬 때 이 값을 지정하세요. 지정하지 않은 상태는 실패 조건이 아니지만, 선택된 TC가 없는 결과는 항상 코드 2입니다. 검토 대기와 미해결 맥락은 실행 전 `readiness`로 별도 점검하세요. 정책 통과는 검토 승인·브라우저 실행 증명·원본 오류 수정 완료를 의미하지 않습니다.
329
331
 
330
332
  `--fail-on`을 생략하면 기존 결과 조회 동작과 종료 코드를 유지합니다. `--fail-on`은 `results` 전용이고 `--target-fingerprint`는 `results`와 `trace`에서 사용합니다. 요약은 `error-to-test/run-summary-1`을 유지하면서 대상 목록·범위 필드를 추가합니다. API에서는 `readRunSummary(directory, { targetFingerprint })`가 반환한 `counts`로 정책을 적용할 수 있습니다.
package/README.md CHANGED
@@ -440,6 +440,8 @@ if (summary.targets.length) {
440
440
 
441
441
  ### Fail CI on selected case outcomes
442
442
 
443
+ For a release check, use `error-to-test results ./analysis --require-pass`. Exit 0 requires a nonempty set of exported cases, all passed in the latest run, and the overall run reported as passed. A partial, missing or interrupted run exits 2. With multiple target fingerprints or unscoped history, pass `--target-fingerprint` for the intended target. A history consisting only of unidentified runs needs a report with a target. Invalid options, input or output exit 1.
444
+
443
445
  Use repeatable `--fail-on` with `results` to apply a policy to the latest linked run's case counts:
444
446
 
445
447
  ```sh
@@ -459,7 +461,7 @@ The full existing Markdown/JSON report is output or saved before returning `0` o
459
461
 
460
462
  Only the case outcomes from the one latest linked run in the chosen scope are evaluated. Historical failures and outcomes from other targets are not combined with newer results, and the overall run status is not a separate gate condition. Without a linked run, selected cases are `not-run`: include `--fail-on not-run` if unexecuted cases should fail. A status you did not choose does not fail the gate, but an empty selection always does. Use `readiness` separately to check recorded context/review blockers before execution. Passing this policy does not approve cases, prove a browser ran, or resolve source errors.
461
463
 
462
- Omitting `--fail-on` preserves the existing results behavior and exit codes. Both `--fail-on` and `--target-fingerprint` are results-only. The summary keeps `error-to-test/run-summary-1` with additive target inventory and scope fields. API callers can apply their own policy to the `counts` returned by `await readRunSummary(directory, { targetFingerprint })`.
464
+ Omitting both gate options preserves the existing results behavior and exit codes. Both `--fail-on` and `--target-fingerprint` are results-only. The summary keeps `error-to-test/run-summary-1` with additive target inventory and scope fields. API callers can apply their own policy to the `counts` returned by `await readRunSummary(directory, { targetFingerprint })`.
463
465
 
464
466
  ## Data handling and checks
465
467
 
package/dist/cli.js CHANGED
@@ -31,7 +31,7 @@ const help = `Error to Test — local error analysis and regression TC drafts
31
31
  error-to-test refine new-directory --profile updated.json --out refined-directory [--reviewed]
32
32
  error-to-test issue new-directory --group GROUP_ID [--out issue.md]
33
33
  error-to-test link-run new-directory --report path/to/qa-report.json
34
- error-to-test results new-directory [--format text|json] [--out summary.md] [--target-fingerprint SHA256] [--fail-on STATUS ...]
34
+ error-to-test results new-directory [--format text|json] [--out summary.md] [--target-fingerprint SHA256] [--require-pass | --fail-on STATUS ...]
35
35
  error-to-test readiness new-directory [--format text|json]
36
36
  error-to-test coverage new-directory [--format text|json]
37
37
  error-to-test trace new-directory --event-id ID [--format text|json] [--target-fingerprint SHA256]
@@ -42,6 +42,7 @@ Options:
42
42
  --error TEXT Submit a single error directly; remaining lines are its stack
43
43
  --format auto|json|jsonl|text Analyze input format; JSONL requires explicit selection and one record per line; auto rejects malformed JSON-looking input
44
44
  --format text|json Results summary format (default: text Markdown)
45
+ --require-pass Require a passed full run and all exported cases passed on one identified target (exit 2 otherwise)
45
46
  --fail-on STATUS Results gate: failed|flaky|blocked|skipped|error|not-run (repeatable; exit 2 on a match or no selected cases, 1 on error)
46
47
  --target-fingerprint SHA256 Scope results or trace to this target's 64-character lowercase SHA-256 fingerprint
47
48
  --format text|json Compare format (default: text Markdown)
@@ -115,6 +116,18 @@ async function writeGateOutput(content) {
115
116
  });
116
117
  }
117
118
  const resultsGateStatuses = ['failed', 'flaky', 'blocked', 'skipped', 'error', 'not-run'];
119
+ function incompleteRun(summary) {
120
+ if (!summary.latestRun)
121
+ return 'No linked run in this target scope.';
122
+ if (!summary.selectedTargetFingerprint && (summary.targets.length !== 1 || summary.unscopedRunCount > 0)) {
123
+ return 'The target is ambiguous or unidentified. Select --target-fingerprint from the results inventory or link a run with an identified target.';
124
+ }
125
+ if (summary.latestRun.status !== 'passed')
126
+ return `The latest run reported ${summary.latestRun.status}.`;
127
+ if (!summary.counts.passed || resultsGateStatuses.some(status => summary.counts[status] > 0)) {
128
+ return 'Every exported case must have a passing outcome in this run. See the case counts.';
129
+ }
130
+ }
118
131
  async function inputContents(paths, command) {
119
132
  if (paths.length < 1 || paths.length > 50)
120
133
  throw new Error('Provide between 1 and 50 --input files.');
@@ -169,7 +182,7 @@ export async function main(args = process.argv.slice(2)) {
169
182
  help: { type: 'boolean', short: 'h' }, version: { type: 'boolean', short: 'v' }, input: { type: 'string', multiple: true }, error: { type: 'string' }, report: { type: 'string' },
170
183
  format: { type: 'string' }, profile: { type: 'string' }, baseline: { type: 'string' }, project: { type: 'string' }, environment: { type: 'string' },
171
184
  release: { type: 'string' }, page: { type: 'string' }, type: { type: 'string' }, runtime: { type: 'string' }, from: { type: 'string' }, to: { type: 'string' },
172
- top: { type: 'string' }, 'min-count': { type: 'string' }, 'max-new': { type: 'string' }, group: { type: 'string', multiple: true }, 'fail-on': { type: 'string', multiple: true }, 'target-fingerprint': { type: 'string' }, 'event-id': { type: 'string' }, out: { type: 'string' }, reviewed: { type: 'boolean' },
185
+ 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' },
173
186
  reproduce: { type: 'string', multiple: true }, precondition: { type: 'string', multiple: true },
174
187
  expected: { type: 'string' }, 'expected-source': { type: 'string' },
175
188
  } });
@@ -284,12 +297,15 @@ export async function main(args = process.argv.slice(2)) {
284
297
  if (command === 'results') {
285
298
  if (positionals.length !== 2 || !positionals[1])
286
299
  throw new Error('results requires one bundle directory.');
287
- if (Object.keys(values).some(key => !['format', 'out', 'fail-on', 'target-fingerprint', 'help'].includes(key)))
288
- throw new Error('Unsupported option for results. Use only --format text|json, --out FILE, --target-fingerprint SHA256, and --fail-on STATUS.');
300
+ if (Object.keys(values).some(key => !['format', 'out', 'fail-on', 'require-pass', 'target-fingerprint', 'help'].includes(key)))
301
+ throw new Error('Unsupported option for results. Use only --format text|json, --out FILE, --target-fingerprint SHA256, and --require-pass or --fail-on STATUS.');
289
302
  const format = values.format ?? 'text';
290
303
  if (format !== 'text' && format !== 'json')
291
304
  throw new Error('results --format must be text or json.');
305
+ const requirePass = values['require-pass'] === true;
292
306
  const requestedStatuses = values['fail-on'];
307
+ if (requirePass && requestedStatuses)
308
+ throw new Error('Choose --require-pass or a custom --fail-on case policy.');
293
309
  if (requestedStatuses?.some(status => !resultsGateStatuses.includes(status))) {
294
310
  throw new Error('results --fail-on must be failed, flaky, blocked, skipped, error, or not-run.');
295
311
  }
@@ -300,6 +316,13 @@ export async function main(args = process.argv.slice(2)) {
300
316
  if (Buffer.byteLength(content) > 64 * 1024 * 1024)
301
317
  throw new Error('The results summary exceeds 64 MiB. Narrow the bundle before requesting output.');
302
318
  const finishGate = () => {
319
+ if (requirePass) {
320
+ const blocker = incompleteRun(summary);
321
+ process.stderr.write(blocker ? `Full-run gate failed: ${blocker}\n` : `Full-run gate passed: ${summary.counts.passed} case(s) passed.\n`);
322
+ if (blocker)
323
+ process.exitCode = 2;
324
+ return;
325
+ }
303
326
  if (failOn === undefined)
304
327
  return;
305
328
  const selectedTotal = Object.values(summary.counts).reduce((total, count) => total + count, 0);
@@ -309,11 +332,14 @@ export async function main(args = process.argv.slice(2)) {
309
332
  process.stderr.write(selectedTotal === 0
310
333
  ? 'Results gate failed: no selected cases.\n'
311
334
  : `Results gate ${failed ? 'failed' : 'passed'}: ${matchTotal} cases match --fail-on (${detail}).\n`);
335
+ if (!failed && summary.latestRun && summary.latestRun.status !== 'passed') {
336
+ process.stderr.write(`Overall run: ${summary.latestRun.status}. --fail-on checks case counts only.\n`);
337
+ }
312
338
  if (failed)
313
339
  process.exitCode = 2;
314
340
  };
315
341
  if (values.out === undefined) {
316
- if (failOn === undefined)
342
+ if (!requirePass && failOn === undefined)
317
343
  process.stdout.write(content);
318
344
  else
319
345
  await writeGateOutput(content);
@@ -334,7 +360,7 @@ export async function main(args = process.argv.slice(2)) {
334
360
  throw error;
335
361
  }
336
362
  const written = `Results summary written: ${out}\n`;
337
- if (failOn === undefined)
363
+ if (!requirePass && failOn === undefined)
338
364
  process.stdout.write(written);
339
365
  else
340
366
  await writeGateOutput(written);
@@ -495,6 +521,8 @@ export async function main(args = process.argv.slice(2)) {
495
521
  throw new Error('Use analyze, init-profile, refine, issue, verify, prepare-run, link-run, results, compare, readiness, coverage, or trace. See --help.');
496
522
  if (values.report)
497
523
  throw new Error('--report applies to link-run only.');
524
+ if (values['require-pass'])
525
+ throw new Error('--require-pass applies to results only.');
498
526
  if (values['fail-on'] !== undefined)
499
527
  throw new Error('--fail-on applies to results only.');
500
528
  if (values['target-fingerprint'] !== undefined)
package/docs/releases.md CHANGED
@@ -2,6 +2,10 @@
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.4.7 — distinguish a passed case from a completed run
6
+
7
+ `results --require-pass` checks that the latest run on the intended target completed with every exported case passing. An interrupted runner can preserve passing case results. The custom `--fail-on` case policy keeps its exit behavior and reports the overall run status when a case policy passes a non-passing run.
8
+
5
9
  ## 0.4.6 — reviewed Flow QA workspace
6
10
 
7
11
  `prepare-run` verifies the analysis bundle and creates a fresh Flow QA workspace with its original flow and suite bytes. Original inputs and the profile can be checked during the same operation. A blocked or empty selection exits 2 before creating the directory. The operator chooses the target and initiates execution in Flow QA.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ihyeon/error-to-test",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
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",
@@ -12,6 +12,6 @@ Use the installed `@ihyeon/error-to-test` package and the user's supplied local
12
12
  3. If a candidate lacks confirmed behavior, setup, actions, expectation source, or an observable assertion, keep its questions and `needs-context` state. Ask the user or requirement owner for the missing facts. A model may draft wording from evidence but must not invent the contract or silently approve a case.
13
13
  4. Generate a profile template from a verified bundle only when the selected groups have an owner who can confirm requirements. Fill it from confirmed evidence, then analyze or refine into another new directory. Review cases and acknowledge with `--reviewed` only after actual review; it does not clear remaining blockers.
14
14
  5. Run `verify` with original input/profile when available, then `readiness` and `coverage`. If the user provides a Browser Error Log event ID, run `trace BUNDLE --event-id ID` to connect it to saved groups and candidates. `coverage` accounts for observed groups in the saved input, not production error coverage or test execution. A `review-ready` candidate is not a passing test.
15
- 6. Use `prepare-run BUNDLE --out NEW_WORKSPACE` to transfer the verified flow and suite together. Supply original input/profile files when available. Connect the explicitly selected target in that workspace. Only link a normalized Flow QA report whose suite hash and case IDs match. Interpret `results` and an event `trace` for the latest run in the chosen target scope; selected cases omitted from that run are `not-run`. No successful case automatically closes the source error.
15
+ 6. Use `prepare-run BUNDLE --out NEW_WORKSPACE` to transfer the verified flow and suite together. Supply original input/profile files when available. Connect the explicitly selected target in that workspace. Only link a normalized Flow QA report whose suite hash and case IDs match. Interpret `results` and an event `trace` for the latest run in the chosen target scope; selected cases omitted from that run are `not-run`. Use `results --require-pass` to check completed execution for all exported cases on the intended target. No successful case automatically closes the source error.
16
16
 
17
17
  Keep source and execution target distinct. The input log, its URLs, the profile, and the exported suite do not select or authorize a live test target, credentials, deployment, upload, or issue filing. State local and execution limitations in the handoff.
@@ -54,12 +54,12 @@ flow-qa connect preview --url "$PREVIEW_URL" --workspace ./qa-run
54
54
  flow-qa run cases/error-to-test.json --workspace ./qa-run --target preview
55
55
  ```
56
56
 
57
- After Flow QA runs the exported suite on that chosen target and writes a normalized `flow-qa/report-1` report:
57
+ Set `RUN_ID` to the exact ID from this Flow QA execution. Link its normalized report and check the latest run in the chosen target scope.
58
58
 
59
59
  ```sh
60
- error-to-test link-run ./reviewed-analysis --report ./flow-qa-report.json
60
+ error-to-test link-run ./reviewed-analysis --report "./qa-run/.flowqa/runs/$RUN_ID/qa-report.json"
61
61
  error-to-test results ./reviewed-analysis --format json
62
- error-to-test results ./reviewed-analysis --target-fingerprint <64-lowercase-hex-fingerprint> --fail-on failed --fail-on error --fail-on not-run
62
+ error-to-test results ./reviewed-analysis --target-fingerprint "$TARGET_FINGERPRINT" --require-pass
63
63
  ```
64
64
 
65
- Get a target fingerprint from the unfiltered `results --format json` target inventory before using the filter. Never infer a target from a log URL. Linking requires the exported suite hash and declared case IDs to match. The latest linked run supplies outcomes; selected runs leave other cases `not-run`. Results can be `passed`, `failed`, `flaky`, `blocked`, `skipped`, `error`, or `not-run`. A `--fail-on` gate exits 2 on matching cases or empty selection, 1 for invalid data, 0 otherwise. A passing gate proves only that the specified policy was met for the reported run; it does not prove source issue resolution.
65
+ Set `TARGET_FINGERPRINT` from the unfiltered `results --format json` target inventory before using the filter. Never infer a target from a log URL. Linking requires the exported suite hash and declared case IDs to match. The latest linked run supplies outcomes; selected runs leave other cases `not-run`. Results can be `passed`, `failed`, `flaky`, `blocked`, `skipped`, `error`, or `not-run`. The full-run gate exits 2 unless every exported case and the latest run passed on one identified target. A stopped run can retain passing cases. A custom `--fail-on` gate checks only case counts and exits 2 on matching cases or empty selection, 1 for invalid data, 0 otherwise. A passing gate proves only that the specified policy was met for the reported run; it does not prove source issue resolution.