mjolnir-qa 2.0.0 → 2.1.0

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/dist/cli.d.mts CHANGED
@@ -80,7 +80,7 @@ interface RuntimeCorroboration {
80
80
  * constrains TRUE-FLAKE derivation, which lives in the analysis, not
81
81
  * in the provenance label.
82
82
  */
83
- source: "playwright-json" | "junit-xml" | "jest-json" | "vitest-json" | "playwright-trace";
83
+ source: "playwright-json" | "junit-xml" | "jest-json" | "vitest-json" | "playwright-trace" | "har";
84
84
  /** Number of tests executed in the finding's file (any level). */
85
85
  testsExecuted: number;
86
86
  /**
@@ -436,6 +436,13 @@ interface ScanResult {
436
436
  sourceCount: number;
437
437
  findingIds: string[];
438
438
  }>;
439
+ /**
440
+ * Aggregate forensic classifications from the discovered runtime
441
+ * report (plan §10.4, WAVE 5). Present only when a runtime report was
442
+ * ingested and produced ≥1 classified verdict — absent otherwise, so
443
+ * the machine contract's `forensicVerdicts` slot is never fabricated.
444
+ */
445
+ forensicVerdicts?: ForensicVerdictSummary;
439
446
  /**
440
447
  * Dependency graph metadata (ECO-005). Present when a dependency
441
448
  * manifest (package.json, pyproject.toml, pom.xml) was found.
@@ -490,6 +497,21 @@ interface TrustSummary {
490
497
  /** Which incompleteness factors applied (audit trail for the cap). */
491
498
  ceilingReasons: string[];
492
499
  }
500
+ /**
501
+ * Aggregate forensic classifications from a runtime report (plan §10.4,
502
+ * WAVE 5). Present on a ScanResult when a runtime report was ingested
503
+ * and produced at least one classified verdict. `inconclusive` is a
504
+ * first-class outcome — the default when evidence is insufficient — and
505
+ * is also counted inside `byVerdict`.
506
+ */
507
+ interface ForensicVerdictSummary {
508
+ /** Total verdicts carrying a forensic classification. */
509
+ classifications: number;
510
+ /** Classification count per verdict label. */
511
+ byVerdict: Record<string, number>;
512
+ /** INCONCLUSIVE outcome count — a first-class result, not a failure. */
513
+ inconclusive: number;
514
+ }
493
515
  //#endregion
494
516
  //#region src/engine/tier-policy.d.ts
495
517
  type Tier = "core" | "extended" | "quarantine";
@@ -552,6 +574,13 @@ interface TestVerdict {
552
574
  */
553
575
  forensic?: ForensicClassification;
554
576
  }
577
+ interface NetworkObservation {
578
+ file: string;
579
+ title: string;
580
+ outcome: "succeeded" | "failed" | "unknown";
581
+ durationMs: number;
582
+ errors?: string[];
583
+ }
555
584
  interface ForensicsReport {
556
585
  forensicsSchemaVersion: number;
557
586
  /**
@@ -563,7 +592,7 @@ interface ForensicsReport {
563
592
  * `playwright-trace`: one record per trace artifact (the per-test
564
593
  * trace convention), action-level facts only.
565
594
  */
566
- source: "playwright-json" | "junit-xml" | "jest-json" | "vitest-json" | "playwright-trace";
595
+ source: "playwright-json" | "junit-xml" | "jest-json" | "vitest-json" | "playwright-trace" | "har";
567
596
  totalTests: number;
568
597
  failed: number;
569
598
  skipped: number;
@@ -571,6 +600,9 @@ interface ForensicsReport {
571
600
  flakyTests: number;
572
601
  totalDurationMs: number;
573
602
  verdicts: TestVerdict[];
603
+ totalNetworkObservations?: number;
604
+ failedNetworkObservations?: number;
605
+ networkObservations?: NetworkObservation[];
574
606
  /**
575
607
  * Whether all discovered report files were successfully ingested.
576
608
  * FALSE when any files were skipped due to size limits, parse failures,
@@ -1055,7 +1087,7 @@ declare function loadConfig(root: string, options?: {
1055
1087
  warnings: string[];
1056
1088
  };
1057
1089
  declare namespace scan_pipeline_d_exports {
1058
- export { AssembleScanResultInput, CliArgs, DiscoveryResult, EVIDENCE_OVERRIDES$1 as EVIDENCE_OVERRIDES, FileAnalysisResult, KNOWN_RULE_IDS$1 as KNOWN_RULE_IDS, OVERLAP_META_BY_RULE_ID$1 as OVERLAP_META_BY_RULE_ID, PostScanResult, SUITE_INVALIDATING_RULE_IDS$1 as SUITE_INVALIDATING_RULE_IDS, ScanHooks, applyPostScanProcessing, assembleScanResult, buildUniversalRules$1 as buildUniversalRules, discoverAndParseRuntimeReport$1 as discoverAndParseRuntimeReport, discoverTestFilesPhase, fallbackWorkspace$1 as fallbackWorkspace, isValidFindingRecord$1 as isValidFindingRecord, pathMatchesGlob$1 as pathMatchesGlob, runFileAnalysisPhase, runScan$1 as runScan, selectAdapter };
1090
+ export { AssembleScanResultInput, CliArgs, DiscoveryResult, EVIDENCE_OVERRIDES$1 as EVIDENCE_OVERRIDES, FileAnalysisResult, KNOWN_RULE_IDS$1 as KNOWN_RULE_IDS, OVERLAP_META_BY_RULE_ID$1 as OVERLAP_META_BY_RULE_ID, PostScanResult, SUITE_INVALIDATING_RULE_IDS$1 as SUITE_INVALIDATING_RULE_IDS, ScanHooks, applyPostScanProcessing, assembleScanResult, buildUniversalRules$1 as buildUniversalRules, discoverAndParseRuntimeReport$1 as discoverAndParseRuntimeReport, discoverTestFilesPhase, fallbackWorkspace$1 as fallbackWorkspace, isValidFindingRecord$1 as isValidFindingRecord, pathMatchesGlob$1 as pathMatchesGlob, runFileAnalysisPhase, runScan$1 as runScan, selectAdapter, summarizeForensicVerdicts };
1059
1091
  }
1060
1092
  /** Registered rule IDs — used to warn on unknown severityOverrides keys (M4). */
1061
1093
  declare const KNOWN_RULE_IDS$1: ReadonlySet<string>;
@@ -1194,6 +1226,8 @@ interface ScanHooks {
1194
1226
  * never on the stdout machine contracts.
1195
1227
  */
1196
1228
  onGateNotice?: (notice: string) => void;
1229
+ onTestFilesDiscovered?: (files: readonly string[]) => void;
1230
+ onPreSuppressionFindings?: (findings: readonly Finding[]) => void;
1197
1231
  }
1198
1232
  /**
1199
1233
  * Workspace fallback for targets with no discoverable project root
@@ -1220,11 +1254,11 @@ declare function pathMatchesGlob$1(path: string, glob: string): boolean;
1220
1254
  * Plan §16 + WI-11: locate a runtime run report next to the scan
1221
1255
  * target, using the exact conventions the forensics ingestion already
1222
1256
  * accepts. Zero-config search over conventional artifact names at
1223
- * depth ≤ 2 (src/discovery/evidence-discovery.ts); the FIRST parsable
1224
- * candidate wins (priority: mjolnir-report > playwright-json >
1225
- * test-results-dir > junit-file). Validates each candidate by attempting
1226
- * to parse it and checking that it produces at least one test. Returns
1227
- * the parsed report alongside the path to avoid double-parsing.
1257
+ * depth ≤ 2 (src/discovery/evidence-discovery.ts). The FIRST parsable
1258
+ * candidate with `totalTests > 0` is kept as a fallback; the loop
1259
+ * continues and returns a later candidate when one with
1260
+ * `analysisComplete === true` is found. Returns the parsed report
1261
+ * alongside the path to avoid double-parsing.
1228
1262
  */
1229
1263
  declare function discoverAndParseRuntimeReport$1(scanRoot: string): {
1230
1264
  path: string;
@@ -1272,8 +1306,17 @@ interface PostScanResult {
1272
1306
  suppressionCount: number;
1273
1307
  frameworks: ReturnType<typeof detectFrameworks>;
1274
1308
  runtimeReportPath: string | undefined;
1309
+ /** Aggregate forensic classifications from the ingested runtime report. */
1310
+ forensicVerdicts: ForensicVerdictSummary | undefined;
1275
1311
  config: ReturnType<typeof loadConfig>["config"];
1276
1312
  }
1313
+ /**
1314
+ * Summarize forensic classifications from an ingested runtime report
1315
+ * (plan §10.4, WAVE 5). Returns undefined when no verdict carries a
1316
+ * classification — the machine contract slot stays absent rather than
1317
+ * reporting all-zero counts.
1318
+ */
1319
+ declare function summarizeForensicVerdicts(report: ForensicsReport): ForensicVerdictSummary | undefined;
1277
1320
  declare function applyPostScanProcessing(findings: Finding[], workspace: Workspace, args: CliArgs, hooks: ScanHooks, scanRoot: Workspace, declarationsByFile: Map<string, number>, testDeclarationCount: number, tierByRuleId: Map<string, Tier>, REVISION_BY_RULE_ID: Map<string, number>): PostScanResult;
1278
1321
  interface AssembleScanResultInput {
1279
1322
  findings: Finding[];
@@ -1307,6 +1350,7 @@ interface AssembleScanResultInput {
1307
1350
  suppressionCount: number;
1308
1351
  frameworks: ReturnType<typeof detectFrameworks>;
1309
1352
  runtimeReportPath: string | undefined;
1353
+ forensicVerdicts: ForensicVerdictSummary | undefined;
1310
1354
  config: ReturnType<typeof loadConfig>["config"];
1311
1355
  fileProvenance: Array<{
1312
1356
  path: string;
@@ -1339,7 +1383,7 @@ declare function runScan$1(args: CliArgs, hooks?: ScanHooks): Promise<ScanResult
1339
1383
  * scripts/sync-sarif-version.cjs and guarded by the version-consistency
1340
1384
  * spec. cli.ts re-exports this as CLI_VERSION.
1341
1385
  */
1342
- declare const ENGINE_VERSION = "2.0.0";
1386
+ declare const ENGINE_VERSION = "2.1.0";
1343
1387
  //#endregion
1344
1388
  //#region src/cli-io.d.ts
1345
1389
  /**
@@ -1516,6 +1560,121 @@ export declare function runReleaseTrustCommand(argv: string[], io?: {
1516
1560
  err: Output;
1517
1561
  }): number;
1518
1562
  //#endregion
1563
+ //#region src/commands/business-case.d.ts
1564
+ /**
1565
+ * Entry point for `mjolnir business-case`.
1566
+ *
1567
+ * Flags:
1568
+ * --industry <type> Industry cost profile (default/fintech/healthcare/...)
1569
+ * --history <months> Use git history for the last N months (estimates from
1570
+ * actual scan improvements, not projections)
1571
+ * --projected <months> Show projected savings over N months
1572
+ * --strict Include quarantine-tier findings
1573
+ */
1574
+ export declare function runBusinessCaseCommand(argv: string[], io?: {
1575
+ out: Output;
1576
+ err?: Output;
1577
+ }): Promise<number>;
1578
+ //#endregion
1579
+ //#region src/commands/release-report.d.ts
1580
+ /**
1581
+ * CLI verb: `mjolnir release-report [--since <ref>] [--history <json>] [target]`.
1582
+ */
1583
+ export declare function runReleaseReportCommand(argv: string[], io: {
1584
+ out: Output;
1585
+ err: Output;
1586
+ }): Promise<number>;
1587
+ //#endregion
1588
+ //#region src/commands/report-playwright.d.ts
1589
+ export declare function runReportPlaywrightCommand(argv: string[], io: {
1590
+ out: Output;
1591
+ err: Output;
1592
+ }): Promise<number>;
1593
+ //#endregion
1594
+ //#region src/commands/trend.d.ts
1595
+ export declare function runTrendCommand(argv: string[], io: {
1596
+ out: Output;
1597
+ err: Output;
1598
+ }): Promise<number>;
1599
+ //#endregion
1600
+ //#region src/commands/exec-report.d.ts
1601
+ export declare function runExecReportCommand(argv: string[], io: {
1602
+ out: Output;
1603
+ err: Output;
1604
+ }): Promise<number>;
1605
+ //#endregion
1606
+ //#region src/commands/policy.d.ts
1607
+ export declare function runPolicyCommand(argv: string[], io: {
1608
+ out: Output;
1609
+ err: Output;
1610
+ }): Promise<number>;
1611
+ //#endregion
1612
+ //#region src/commands/quarantine.d.ts
1613
+ export declare function runQuarantineCommand(argv: string[], io: {
1614
+ out: Output;
1615
+ err: Output;
1616
+ }): Promise<number>;
1617
+ //#endregion
1618
+ //#region src/commands/analyze.d.ts
1619
+ export declare function runAnalyzeCommand(argv: string[], io: {
1620
+ out: Output;
1621
+ err: Output;
1622
+ }): number;
1623
+ //#endregion
1624
+ //#region src/commands/ci-adapter.d.ts
1625
+ export declare function runCiAdapterCommand(argv: string[], io: {
1626
+ out: Output;
1627
+ err: Output;
1628
+ }): number;
1629
+ //#endregion
1630
+ //#region src/commands/dashboard.d.ts
1631
+ export declare function runDashboardCommand(argv: string[], io: {
1632
+ out: Output;
1633
+ err: Output;
1634
+ }): Promise<number>;
1635
+ //#endregion
1636
+ //#region src/commands/enterprise.d.ts
1637
+ export declare function runEnterpriseCommand(argv: string[], io: {
1638
+ out: Output;
1639
+ err: Output;
1640
+ }): number;
1641
+ //#endregion
1642
+ //#region src/commands/maturity.d.ts
1643
+ export declare function runMaturityCommand(argv: string[], io: {
1644
+ out: Output;
1645
+ err: Output;
1646
+ }): number;
1647
+ //#endregion
1648
+ //#region src/commands/milestone.d.ts
1649
+ export declare function runFrameworkMaturityCommand(argv: string[], io?: {
1650
+ out: Output;
1651
+ err: Output;
1652
+ }): number;
1653
+ export declare function runSuppressionGateCommand(argv: string[], io?: {
1654
+ out: Output;
1655
+ err: Output;
1656
+ }): Promise<number>;
1657
+ export declare function runCrossFileCommand(argv: string[], io?: {
1658
+ out: Output;
1659
+ err: Output;
1660
+ }): Promise<number>;
1661
+ export declare function runContractVerifyCommand(argv: string[], io?: {
1662
+ out: Output;
1663
+ err: Output;
1664
+ }): Promise<number>;
1665
+ export declare function runTrustTrendCommand(argv: string[], io?: {
1666
+ out: Output;
1667
+ err: Output;
1668
+ }): Promise<number>;
1669
+ export declare function runEvidenceGraphCommand(argv: string[], io?: {
1670
+ out: Output;
1671
+ err: Output;
1672
+ }): Promise<number>;
1673
+ export declare function runCIIntegrityCommand(argv: string[], io?: {
1674
+ out: Output;
1675
+ err: Output;
1676
+ }): Promise<number>;
1677
+ //#endregion
1519
1678
  //#region src/cli.d.ts
1520
1679
  export declare const runScan: typeof runScan$1, buildUniversalRules: typeof buildUniversalRules$1, fallbackWorkspace: typeof fallbackWorkspace$1, pathMatchesGlob: typeof pathMatchesGlob$1, isValidFindingRecord: typeof isValidFindingRecord$1, discoverAndParseRuntimeReport: typeof discoverAndParseRuntimeReport$1, KNOWN_RULE_IDS: ReadonlySet<string>, OVERLAP_META_BY_RULE_ID: ReadonlyMap<string, OverlapMeta>, EVIDENCE_OVERRIDES: ReadonlyMap<string, string>, SUITE_INVALIDATING_RULE_IDS: ReadonlySet<string>;
1521
1680
  /** A usage-error detail: the offending token, when one exists. */
@@ -1568,7 +1727,7 @@ export declare function runSuppressions(io?: {
1568
1727
  out: Output;
1569
1728
  err?: Output;
1570
1729
  }): number;
1571
- export declare function printUsage(print: (s: string) => void): void;
1730
+ export declare function printUsage(print: (s: string) => void, width?: number): void;
1572
1731
  export declare function main(argv?: string[], io?: {
1573
1732
  out: Output;
1574
1733
  err: Output;