mjolnir-qa 0.5.2 → 0.5.3

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.uk.md CHANGED
@@ -63,7 +63,7 @@ npx mjolnir-qa@latest
63
63
  отримаєте:
64
64
 
65
65
  ```text
66
- ▚▞ QA-CI-001 — continue-on-error masks a failing verification gate
66
+ QA-CI-001 — continue-on-error masks a failing verification gate
67
67
 
68
68
  Severity: error
69
69
  Confidence: high
@@ -376,7 +376,7 @@ OSS-коді** (по ≥ 10 вручну класифікованих знахі
376
376
  Головна метрика для Playwright-с'ютів — наскільки стійкі ваші локатори:
377
377
 
378
378
  ```text
379
- ▚▞ SELECTOR HEALTH — e2e/checkout.spec.ts
379
+ SELECTOR HEALTH — e2e/checkout.spec.ts
380
380
 
381
381
  [█████████████████░░░] 83 / 100
382
382
  role/text: 2 · testid: 1 · css-chains: 1 ⚠ · xpath: 0
@@ -399,7 +399,7 @@ mjolnir forensics ./test-results/
399
399
  ```
400
400
 
401
401
  ```text
402
- ▚▞ FLAKINESS LEADERBOARD
402
+ FLAKINESS LEADERBOARD
403
403
 
404
404
  3 tests · 1 failed · 1 flaky · 1 retried
405
405
 
package/README.vi.md CHANGED
@@ -62,7 +62,7 @@ Chạy `mjolnir explain QA-CI-001` trên finding đầu tiên ở trên và bạ
62
62
  được:
63
63
 
64
64
  ```text
65
- ▚▞ QA-CI-001 — continue-on-error masks a failing verification gate
65
+ QA-CI-001 — continue-on-error masks a failing verification gate
66
66
 
67
67
  Severity: error
68
68
  Confidence: high
@@ -374,7 +374,7 @@ Repo rỗng chấm `null`, không bao giờ 100 giả — xem
374
374
  Chỉ số tiêu đề cho suite Playwright — locator của bạn bền bao nhiêu:
375
375
 
376
376
  ```text
377
- ▚▞ SELECTOR HEALTH — e2e/checkout.spec.ts
377
+ SELECTOR HEALTH — e2e/checkout.spec.ts
378
378
 
379
379
  [█████████████████░░░] 83 / 100
380
380
  role/text: 2 · testid: 1 · css-chains: 1 ⚠ · xpath: 0
@@ -396,7 +396,7 @@ mjolnir forensics ./test-results/
396
396
  ```
397
397
 
398
398
  ```text
399
- ▚▞ FLAKINESS LEADERBOARD
399
+ FLAKINESS LEADERBOARD
400
400
 
401
401
  3 tests · 1 failed · 1 flaky · 1 retried
402
402
 
package/README.zh.md CHANGED
@@ -59,7 +59,7 @@ reporter 渲染——无任何删减。通过 `npm run docs:demo` 重新生成
59
59
  对上面第一条发现运行 `mjolnir explain QA-CI-001`,你会得到:
60
60
 
61
61
  ```text
62
- ▚▞ QA-CI-001 — continue-on-error masks a failing verification gate
62
+ QA-CI-001 — continue-on-error masks a failing verification gate
63
63
 
64
64
  Severity: error
65
65
  Confidence: high
@@ -363,7 +363,7 @@ TypeScript 与 Python 拥有最广的实测覆盖。Java 与 C# 已发布、有
363
363
  Playwright 套件的头号指标——你的定位器有多抗造:
364
364
 
365
365
  ```text
366
- ▚▞ SELECTOR HEALTH — e2e/checkout.spec.ts
366
+ SELECTOR HEALTH — e2e/checkout.spec.ts
367
367
 
368
368
  [█████████████████░░░] 83 / 100
369
369
  role/text: 2 · testid: 1 · css-chains: 1 ⚠ · xpath: 0
@@ -384,7 +384,7 @@ mjolnir forensics ./test-results/
384
384
  ```
385
385
 
386
386
  ```text
387
- ▚▞ FLAKINESS LEADERBOARD
387
+ FLAKINESS LEADERBOARD
388
388
 
389
389
  3 tests · 1 failed · 1 flaky · 1 retried
390
390
 
package/README.zht.md CHANGED
@@ -59,7 +59,7 @@ reporter 渲染——毫無刪減。以 `npm run docs:demo` 重新產生;
59
59
  對上面第一項發現執行 `mjolnir explain QA-CI-001`,你會得到:
60
60
 
61
61
  ```text
62
- ▚▞ QA-CI-001 — continue-on-error masks a failing verification gate
62
+ QA-CI-001 — continue-on-error masks a failing verification gate
63
63
 
64
64
  Severity: error
65
65
  Confidence: high
@@ -363,7 +363,7 @@ TypeScript 與 Python 擁有最廣的實測涵蓋。Java 與 C# 已發布、有
363
363
  Playwright 套件的首要指標——你的定位器有多耐操:
364
364
 
365
365
  ```text
366
- ▚▞ SELECTOR HEALTH — e2e/checkout.spec.ts
366
+ SELECTOR HEALTH — e2e/checkout.spec.ts
367
367
 
368
368
  [█████████████████░░░] 83 / 100
369
369
  role/text: 2 · testid: 1 · css-chains: 1 ⚠ · xpath: 0
@@ -384,7 +384,7 @@ mjolnir forensics ./test-results/
384
384
  ```
385
385
 
386
386
  ```text
387
- ▚▞ FLAKINESS LEADERBOARD
387
+ FLAKINESS LEADERBOARD
388
388
 
389
389
  3 tests · 1 failed · 1 flaky · 1 retried
390
390
 
package/dist/cli.d.mts CHANGED
@@ -491,7 +491,7 @@ interface UniversalRule {
491
491
  * `scripts/sync-sarif-version.cjs` on release and guarded by
492
492
  * `tests/version-consistency.spec.ts` locally.
493
493
  */
494
- declare const CLI_VERSION = "0.5.2";
494
+ declare const CLI_VERSION = "0.5.3";
495
495
  declare function buildUniversalRules(root: string, strict?: boolean): Promise<{
496
496
  rules: UniversalRule[];
497
497
  pluginErrors: string[];
@@ -530,13 +530,48 @@ interface CliArgs {
530
530
  * under an unchanged rule set. Local-only, never leaves the machine.
531
531
  */
532
532
  cache?: boolean;
533
+ /**
534
+ * --no-progress: never render the live scan-progress line, even on an
535
+ * interactive TTY (plan M3, additive flag). Progress is stderr-only
536
+ * and auto-disabled in CI/machine formats; this flag is the manual off.
537
+ */
538
+ noProgress?: boolean;
539
+ }
540
+ /** A usage-error detail: the offending token, when one exists. */
541
+ interface UsageErrorDetail {
542
+ /** The unknown flag or rejected value (e.g. `--nope`, `loud`). */
543
+ token?: string | undefined;
544
+ /** The flag whose value was rejected (`--tone` for `--tone loud`). */
545
+ flag?: string | undefined;
533
546
  }
534
- declare function parseArgs(argv: string[]): CliArgs | null;
547
+ declare function parseArgs(argv: string[], onError?: (detail: UsageErrorDetail) => void): CliArgs | null;
548
+ /** Hand-rolled Levenshtein distance (plan M2: no new dependencies). */
549
+ declare function levenshtein(a: string, b: string): number;
550
+ /** Nearest known flags within distance ≤ 2, nearest first. */
551
+ declare function nearestFlags(flag: string, max?: number): string[];
552
+ /**
553
+ * Friendly usage error (plan M2, exit 10 preserved): nearest-flag
554
+ * suggestion, the valid neighbors, and the exact help command. Printed
555
+ * to stderr; findings/usage stay on their documented streams.
556
+ */
557
+ declare function usageErrorMessage(detail: UsageErrorDetail): string;
535
558
  interface ScanHooks {
536
559
  /** Invoked when a rule throws on a file (audit R-9). */
537
560
  onRuleCrash?: (ruleId: string, file: string, error: unknown) => void;
538
561
  /** Invoked for non-fatal config warnings (bug-audit M4). */
539
562
  onConfigWarning?: (message: string) => void;
563
+ /**
564
+ * Live-progress feed (plan M3, additive). Fired from the per-file
565
+ * parse+rules loop and the phase boundaries. Render-on-event only —
566
+ * the scan never waits on a timer, and output contracts are
567
+ * unchanged when the hook is absent.
568
+ */
569
+ onProgress?: (e: {
570
+ phase: "discover" | "parse" | "rules" | "score";
571
+ done?: number | undefined;
572
+ total?: number | undefined;
573
+ detail?: string | undefined;
574
+ }) => void;
540
575
  }
541
576
  /**
542
577
  * Workspace fallback for targets with no discoverable project root
@@ -675,7 +710,29 @@ declare function runPwReportCommand(argv: string[], io?: {
675
710
  out: Output;
676
711
  err: Output;
677
712
  }): number;
678
- declare function main(argv?: string[]): Promise<number>;
713
+ declare function main(argv?: string[], io?: {
714
+ out: Output;
715
+ err: Output;
716
+ }): Promise<number>;
717
+ /**
718
+ * `mjolnir help` / `mjolnir help <verb>` (plan M2). `--help`/`-h` and
719
+ * `<verb> --help` route here too. Exit 0 — help answers a question.
720
+ * Two-word verbs (`ci install`) are resolved first via the join of the
721
+ * leading non-flag tokens, then the single-word form.
722
+ */
723
+ declare function runHelpCommand(argv: string[], io?: {
724
+ out: Output;
725
+ err: Output;
726
+ }): number;
727
+ /**
728
+ * Friendly exit-20 path (plan M2): the crash says it's Mjölnir's bug,
729
+ * not the user's repo, carries the underlying message for a report, and
730
+ * prints the stack ONLY when `debug` is set (uniform across
731
+ * subcommands — they don't parse scan flags). Tests pin
732
+ * /internal error/i. Exported so the --debug stack arm is directly
733
+ * spec-coverable (spawning a real crash under --debug would be flaky).
734
+ */
735
+ declare function internalErrorMessage(err: unknown, emit: (s: string) => void, debug: boolean): void;
679
736
  declare function isEntryPoint(): boolean;
680
737
  //#endregion
681
- export { CLI_VERSION, Output, ScanHooks, buildUniversalRules, exitForFindings, fallbackWorkspace, isEntryPoint, main, parseArgs, pathMatchesGlob, runBadgeCommand, runBaselineCommand, runCiInstall, runCreateRuleCommand, runDebtCommand, runDiffCommand, runDoctorCommand, runDoctorPlaywright, runExplainCommand, runFixCommand, runForensicsCommand, runHandoverCommand, runImpactCommand, runInitCommand, runPrCommentCommand, runPwReportCommand, runRulesCommand, runScan, runScanCommand, runStatsCommand, runSuppressions, runTriageCommand };
738
+ export { CLI_VERSION, Output, ScanHooks, UsageErrorDetail, buildUniversalRules, exitForFindings, fallbackWorkspace, internalErrorMessage, isEntryPoint, levenshtein, main, nearestFlags, parseArgs, pathMatchesGlob, runBadgeCommand, runBaselineCommand, runCiInstall, runCreateRuleCommand, runDebtCommand, runDiffCommand, runDoctorCommand, runDoctorPlaywright, runExplainCommand, runFixCommand, runForensicsCommand, runHandoverCommand, runHelpCommand, runImpactCommand, runInitCommand, runPrCommentCommand, runPwReportCommand, runRulesCommand, runScan, runScanCommand, runStatsCommand, runSuppressions, runTriageCommand, usageErrorMessage };