slopbrick 0.31.0 → 0.33.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/index.cjs CHANGED
@@ -36,7 +36,7 @@ var VERSION;
36
36
  var init_header = __esm({
37
37
  "src/types/_header.ts"() {
38
38
  "use strict";
39
- VERSION = "0.31.0";
39
+ VERSION = "0.33.0";
40
40
  }
41
41
  });
42
42
 
@@ -36609,6 +36609,24 @@ function parseSource(source, filePath) {
36609
36609
  // sufficient for the v9 calibration goal.
36610
36610
  case "kt":
36611
36611
  case "kts":
36612
+ // v0.32.0: Swift files get the same parseBlankModule path.
36613
+ // All 5 `swift/*` rules (force-unwrap, print-debug, fatal-error-
36614
+ // thrown, implicitly-unwrapped-optional, strong-self-capture)
36615
+ // are regex-based and gate themselves on `/\.swift$/i.test(filePath)`
36616
+ // inside their `analyze()`. Same trade-off as Java/Kotlin.
36617
+ case "swift":
36618
+ // v0.33.0: C++ files get the same parseBlankModule path.
36619
+ // All 5 `cpp/*` rules (using-namespace-std, raw-new-delete,
36620
+ // c-style-cast, printf-debug, magic-numbers) are regex-based
36621
+ // and gate themselves on `/\.c(c|pp|xx)?$|^\.h(pp|xx)?$/i.test(filePath)`
36622
+ // inside their `analyze()`. Same trade-off as Java/Kotlin/Swift.
36623
+ case "cpp":
36624
+ case "cc":
36625
+ case "cxx":
36626
+ case "c":
36627
+ case "h":
36628
+ case "hpp":
36629
+ case "hxx":
36612
36630
  return parseBlankModule(source);
36613
36631
  default:
36614
36632
  return parseWithSwc(source, filePath);
@@ -51638,13 +51656,13 @@ var init_signal_strength = __esm({
51638
51656
  defaultOff: true
51639
51657
  },
51640
51658
  "swift/force-unwrap": {
51641
- recall: 0,
51642
- fpRate: 0,
51643
- ratio: 1,
51644
- precision: 0,
51645
- lastCalibratedAt: "2026-07-02T00:00:00Z",
51659
+ recall: 0.10211,
51660
+ fpRate: 0.21462,
51661
+ ratio: 0.48,
51662
+ precision: 0.1721,
51663
+ lastCalibratedAt: "2026-07-03T00:00:00Z",
51646
51664
  verdict: "DORMANT",
51647
- _calibrationNote: "v0.24: new rule (Swift force-unwrap \u2014 `as!`, `try!`, `var!.prop` in production). DORMANT until v9 Swift corpus calibration.",
51665
+ _calibrationNote: "v0.32: v9 Swift calibration (1300 neg, 568 pos). Per-file unique measurement: 58 TP files, 279 FP files, ratio=0.48. Era-confounded: pre-2022 Swift used ! freely (the only way to unwrap); modern Swift uses guard let / if let / try?. Same direction as kotlin/force-unwrap (0.35) and kotlin/runblocking-misuse (0.50). INSUFFICIENT_DATA: pos arm 568 files (below 10k floor).",
51648
51666
  aiSpecific: true,
51649
51667
  _v7Verdict: "DORMANT",
51650
51668
  _v7Lift: 1,
@@ -51653,16 +51671,21 @@ var init_signal_strength = __esm({
51653
51671
  _v7Precision: 0,
51654
51672
  _v8Verdict: "DORMANT",
51655
51673
  _v8Lift: 1,
51674
+ _v9Verdict: "DORMANT",
51675
+ _v9Lift: 0.48,
51676
+ _v9Recall: 0.10211,
51677
+ _v9FpRate: 0.21462,
51678
+ _v9Precision: 0.1721,
51656
51679
  defaultOff: true
51657
51680
  },
51658
51681
  "swift/print-debug": {
51659
- recall: 0,
51660
- fpRate: 0,
51661
- ratio: 1,
51662
- precision: 0,
51663
- lastCalibratedAt: "2026-07-02T00:00:00Z",
51664
- verdict: "DORMANT",
51665
- _calibrationNote: "v0.24: new rule (multi-print in Swift source \u2014 use Logger / os.log). DORMANT until v9 Swift corpus calibration.",
51682
+ recall: 0.06866,
51683
+ fpRate: 0.06077,
51684
+ ratio: 1.13,
51685
+ precision: 0.3305,
51686
+ lastCalibratedAt: "2026-07-03T00:00:00Z",
51687
+ verdict: "OK",
51688
+ _calibrationNote: "v0.32: v9 Swift calibration (1300 neg, 568 pos). Per-file unique: 39 TP files, 79 FP files, ratio=1.13 (\u22651.0, OK). Total-fires measurement was ratio=1.78 (1.6x higher) but per-file is more conservative. precision=33.05% (below 50% USEFUL threshold); verdict=OK. The direction is positive: post-2024 Swift (especially AI-generated examples in OpenAI Swift, WhisperKit) uses print() for output; pre-2022 production Swift (Alamofire, Vapor, Moya) uses os.Logger / OSLog. Same direction as kotlin/println-as-log (1.84) and java/system-out-println (1.73 refined, 3.29 unrefined). INSUFFICIENT_DATA: pos arm 568 files (below 10k floor).",
51666
51689
  aiSpecific: true,
51667
51690
  _v7Verdict: "DORMANT",
51668
51691
  _v7Lift: 1,
@@ -51671,16 +51694,21 @@ var init_signal_strength = __esm({
51671
51694
  _v7Precision: 0,
51672
51695
  _v8Verdict: "DORMANT",
51673
51696
  _v8Lift: 1,
51697
+ _v9Verdict: "OK",
51698
+ _v9Lift: 1.13,
51699
+ _v9Recall: 0.06866,
51700
+ _v9FpRate: 0.06077,
51701
+ _v9Precision: 0.3305,
51674
51702
  defaultOff: true
51675
51703
  },
51676
51704
  "swift/fatal-error-thrown": {
51677
- recall: 0,
51678
- fpRate: 0,
51679
- ratio: 1,
51680
- precision: 0,
51681
- lastCalibratedAt: "2026-07-02T00:00:00Z",
51705
+ recall: 0.06514,
51706
+ fpRate: 0.11462,
51707
+ ratio: 0.57,
51708
+ precision: 0.1989,
51709
+ lastCalibratedAt: "2026-07-03T00:00:00Z",
51682
51710
  verdict: "DORMANT",
51683
- _calibrationNote: "v0.24: new rule (`fatalError` / `preconditionFailure` in production Swift \u2014 replaces with typed default). DORMANT until v9 Swift corpus calibration.",
51711
+ _calibrationNote: "v0.32: v9 Swift calibration (1300 neg, 568 pos). Per-file unique: 37 TP files, 149 FP files, ratio=0.57. Era-confounded: pre-2022 Swift used fatalError liberally for unrecoverable states; modern Swift uses typed errors (throws) and Result types. INSUFFICIENT_DATA: pos arm 568 files.",
51684
51712
  aiSpecific: true,
51685
51713
  _v7Verdict: "DORMANT",
51686
51714
  _v7Lift: 1,
@@ -51689,16 +51717,21 @@ var init_signal_strength = __esm({
51689
51717
  _v7Precision: 0,
51690
51718
  _v8Verdict: "DORMANT",
51691
51719
  _v8Lift: 1,
51720
+ _v9Verdict: "DORMANT",
51721
+ _v9Lift: 0.57,
51722
+ _v9Recall: 0.06514,
51723
+ _v9FpRate: 0.11462,
51724
+ _v9Precision: 0.1989,
51692
51725
  defaultOff: true
51693
51726
  },
51694
51727
  "swift/implicitly-unwrapped-optional": {
51695
- recall: 0,
51696
- fpRate: 0,
51697
- ratio: 1,
51698
- precision: 0,
51699
- lastCalibratedAt: "2026-07-02T00:00:00Z",
51728
+ recall: 0.01937,
51729
+ fpRate: 0.10692,
51730
+ ratio: 0.18,
51731
+ precision: 0.0733,
51732
+ lastCalibratedAt: "2026-07-03T00:00:00Z",
51700
51733
  verdict: "DORMANT",
51701
- _calibrationNote: "v0.24: new rule (Swift implicitly unwrapped optional \u2014 declare as Type? and unwrap with guard let). DORMANT until v9 Swift corpus calibration.",
51734
+ _calibrationNote: "v0.32: v9 Swift calibration (1300 neg, 568 pos). Per-file unique: 11 TP files, 139 FP files, ratio=0.18 \u2014 strong era-confound. Pre-2022 Swift used `var foo: Bar!` for IBOutlets and delegates; modern Swift uses `weak var` or declares as `Bar?` and unwraps with guard let. Same magnitude as kotlin/coroutine-global-scope (0.09) \u2014 strongest era-confound in v9 history. INSUFFICIENT_DATA: pos arm 568 files.",
51702
51735
  aiSpecific: true,
51703
51736
  _v7Verdict: "DORMANT",
51704
51737
  _v7Lift: 1,
@@ -51707,16 +51740,21 @@ var init_signal_strength = __esm({
51707
51740
  _v7Precision: 0,
51708
51741
  _v8Verdict: "DORMANT",
51709
51742
  _v8Lift: 1,
51743
+ _v9Verdict: "DORMANT",
51744
+ _v9Lift: 0.18,
51745
+ _v9Recall: 0.01937,
51746
+ _v9FpRate: 0.10692,
51747
+ _v9Precision: 0.0733,
51710
51748
  defaultOff: true
51711
51749
  },
51712
51750
  "swift/strong-self-capture": {
51713
- recall: 0,
51714
- fpRate: 0,
51715
- ratio: 1,
51716
- precision: 0,
51717
- lastCalibratedAt: "2026-07-02T00:00:00Z",
51751
+ recall: 0.24824,
51752
+ fpRate: 0.44308,
51753
+ ratio: 0.56,
51754
+ precision: 0.1967,
51755
+ lastCalibratedAt: "2026-07-03T00:00:00Z",
51718
51756
  verdict: "DORMANT",
51719
- _calibrationNote: "v0.24: new rule (Swift closure captures `self` strongly \u2014 retain cycle. Use [weak self] / [unowned self]). DORMANT until v9 Swift corpus calibration.",
51757
+ _calibrationNote: "v0.32: v9 Swift calibration (1300 neg, 568 pos). Per-file unique: 141 TP files, 576 FP files, ratio=0.56. Era-confounded: pre-2022 Swift closures defaulted to strong self capture; modern Swift (Swift 5.7+) emits a warning for implicit self capture in escaping closures. The rule fires multiple times per file (multiple closures) \u2014 total fires were 2316 TP, 8913 FP, but per-file is 141 TP, 576 FP. INSUFFICIENT_DATA: pos arm 568 files.",
51720
51758
  aiSpecific: true,
51721
51759
  _v7Verdict: "DORMANT",
51722
51760
  _v7Lift: 1,
@@ -51725,16 +51763,21 @@ var init_signal_strength = __esm({
51725
51763
  _v7Precision: 0,
51726
51764
  _v8Verdict: "DORMANT",
51727
51765
  _v8Lift: 1,
51766
+ _v9Verdict: "DORMANT",
51767
+ _v9Lift: 0.56,
51768
+ _v9Recall: 0.24824,
51769
+ _v9FpRate: 0.44308,
51770
+ _v9Precision: 0.1967,
51728
51771
  defaultOff: true
51729
51772
  },
51730
51773
  "cpp/using-namespace-std": {
51731
51774
  recall: 0,
51732
- fpRate: 0,
51733
- ratio: 1,
51775
+ fpRate: 2e-4,
51776
+ ratio: 0,
51734
51777
  precision: 0,
51735
- lastCalibratedAt: "2026-07-02T00:00:00Z",
51778
+ lastCalibratedAt: "2026-07-03T00:00:00Z",
51736
51779
  verdict: "DORMANT",
51737
- _calibrationNote: "v0.24: new rule (`using namespace std;` in C++ header \u2014 pollutes every consumer). DORMANT until v9 C++ corpus calibration.",
51780
+ _calibrationNote: "v0.33: v9 C++ calibration (5107 neg, 1655 pos). 1 fire total (in neg). Pre-2022 C++ used `using namespace std;` extensively (it's idiomatic in tutorials); modern C++ deprecated it. INSUFFICIENT_DATA: pos arm 1655 files (below 10k floor).",
51738
51781
  aiSpecific: true,
51739
51782
  _v7Verdict: "DORMANT",
51740
51783
  _v7Lift: 1,
@@ -51743,16 +51786,21 @@ var init_signal_strength = __esm({
51743
51786
  _v7Precision: 0,
51744
51787
  _v8Verdict: "DORMANT",
51745
51788
  _v8Lift: 1,
51789
+ _v9Verdict: "DORMANT",
51790
+ _v9Lift: 0,
51791
+ _v9Recall: 0,
51792
+ _v9FpRate: 2e-4,
51793
+ _v9Precision: 0,
51746
51794
  defaultOff: true
51747
51795
  },
51748
51796
  "cpp/raw-new-delete": {
51749
- recall: 0,
51750
- fpRate: 0,
51751
- ratio: 1,
51752
- precision: 0,
51753
- lastCalibratedAt: "2026-07-02T00:00:00Z",
51797
+ recall: 967e-5,
51798
+ fpRate: 0.01077,
51799
+ ratio: 0.9,
51800
+ precision: 0.2254,
51801
+ lastCalibratedAt: "2026-07-03T00:00:00Z",
51754
51802
  verdict: "DORMANT",
51755
- _calibrationNote: "v0.24: new rule (manual `new` / `delete` pairing in C++ \u2014 use std::make_unique / std::unique_ptr). DORMANT until v9 C++ corpus calibration.",
51803
+ _calibrationNote: "v0.33: v9 C++ calibration (5107 neg, 1655 pos). Per-file unique: 16 TP, 55 FP, ratio=0.90. Era-confounded: pre-2022 C++ used raw new/delete extensively; modern C++ uses std::make_unique. INSUFFICIENT_DATA: pos arm 1655 files.",
51756
51804
  aiSpecific: true,
51757
51805
  _v7Verdict: "DORMANT",
51758
51806
  _v7Lift: 1,
@@ -51761,16 +51809,21 @@ var init_signal_strength = __esm({
51761
51809
  _v7Precision: 0,
51762
51810
  _v8Verdict: "DORMANT",
51763
51811
  _v8Lift: 1,
51812
+ _v9Verdict: "DORMANT",
51813
+ _v9Lift: 0.9,
51814
+ _v9Recall: 967e-5,
51815
+ _v9FpRate: 0.01077,
51816
+ _v9Precision: 0.2254,
51764
51817
  defaultOff: true
51765
51818
  },
51766
51819
  "cpp/c-style-cast": {
51767
- recall: 0,
51768
- fpRate: 0,
51769
- ratio: 1,
51770
- precision: 0,
51771
- lastCalibratedAt: "2026-07-02T00:00:00Z",
51820
+ recall: 0.5281,
51821
+ fpRate: 0.56491,
51822
+ ratio: 0.93,
51823
+ precision: 0.2325,
51824
+ lastCalibratedAt: "2026-07-03T00:00:00Z",
51772
51825
  verdict: "DORMANT",
51773
- _calibrationNote: "v0.24: new rule (C-style cast `(int)x` in C++ \u2014 use static_cast / reinterpret_cast / const_cast). DORMANT until v9 C++ corpus calibration.",
51826
+ _calibrationNote: "v0.33: v9 C++ calibration (5107 neg, 1655 pos). Per-file unique: 874 TP, 2885 FP, ratio=0.93. Total fires were 32265 TP, 39954 FP \u2014 the regex is too broad and fires on every C-style cast including static_cast in template code. The per-file measurement (874/1655 = 53%) is more meaningful \u2014 both arms have similar proportions of files using C-style casts. INSUFFICIENT_DATA: pos arm 1655 files.",
51774
51827
  aiSpecific: true,
51775
51828
  _v7Verdict: "DORMANT",
51776
51829
  _v7Lift: 1,
@@ -51779,16 +51832,21 @@ var init_signal_strength = __esm({
51779
51832
  _v7Precision: 0,
51780
51833
  _v8Verdict: "DORMANT",
51781
51834
  _v8Lift: 1,
51835
+ _v9Verdict: "DORMANT",
51836
+ _v9Lift: 0.93,
51837
+ _v9Recall: 0.5281,
51838
+ _v9FpRate: 0.56491,
51839
+ _v9Precision: 0.2325,
51782
51840
  defaultOff: true
51783
51841
  },
51784
51842
  "cpp/printf-debug": {
51785
- recall: 0,
51786
- fpRate: 0,
51787
- ratio: 1,
51788
- precision: 0,
51789
- lastCalibratedAt: "2026-07-02T00:00:00Z",
51790
- verdict: "DORMANT",
51791
- _calibrationNote: "v0.24: new rule (printf family / std::cout debug printing in C++ \u2014 use spdlog / glog / AbslLog). DORMANT until v9 C++ corpus calibration.",
51843
+ recall: 0.09426,
51844
+ fpRate: 0.03877,
51845
+ ratio: 2.43,
51846
+ precision: 0.4407,
51847
+ lastCalibratedAt: "2026-07-03T00:00:00Z",
51848
+ verdict: "OK",
51849
+ _calibrationNote: "v0.33: v9 C++ calibration (5107 neg, 1655 pos). Per-file unique: 156 TP files, 198 FP files, ratio=2.43 (\u22651.5) \u2014 fourth positive-signal rule in v9 history (and the strongest ratio so far). precision=44.07% (just below 50% USEFUL threshold); verdict=OK. Total fires: 182 TP, 198 FP. The signal is real: post-2024 C++ (mostly AI-generated demos in llama.cpp, whisper.cpp, openai-cpp) uses printf/cout for output; pre-2022 production C++ (folly, protobuf, abseil) uses spdlog / glog / AbslLog. Same direction as kotlin/println-as-log (1.84), java/system-out-println (1.73 refined), swift/print-debug (1.13). INSUFFICIENT_DATA: pos arm 1655 files (below 10k floor).",
51792
51850
  aiSpecific: true,
51793
51851
  _v7Verdict: "DORMANT",
51794
51852
  _v7Lift: 1,
@@ -51797,16 +51855,21 @@ var init_signal_strength = __esm({
51797
51855
  _v7Precision: 0,
51798
51856
  _v8Verdict: "DORMANT",
51799
51857
  _v8Lift: 1,
51858
+ _v9Verdict: "OK",
51859
+ _v9Lift: 2.43,
51860
+ _v9Recall: 0.09426,
51861
+ _v9FpRate: 0.03877,
51862
+ _v9Precision: 0.4407,
51800
51863
  defaultOff: true
51801
51864
  },
51802
51865
  "cpp/magic-numbers": {
51803
- recall: 0,
51804
- fpRate: 0,
51805
- ratio: 1,
51806
- precision: 0,
51807
- lastCalibratedAt: "2026-07-02T00:00:00Z",
51866
+ recall: 0.13293,
51867
+ fpRate: 0.15391,
51868
+ ratio: 0.86,
51869
+ precision: 0.2187,
51870
+ lastCalibratedAt: "2026-07-03T00:00:00Z",
51808
51871
  verdict: "DORMANT",
51809
- _calibrationNote: "v0.24: new rule (magic-number literal in C++ comparison / return \u2014 name it `constexpr int MAX = ...`). DORMANT until v9 C++ corpus calibration.",
51872
+ _calibrationNote: "v0.33: v9 C++ calibration (5107 neg, 1655 pos). Per-file unique: 220 TP, 786 FP, ratio=0.86. Both arms have similar proportions of files with magic numbers \u2014 this is a general C++ anti-pattern that hasn't been eradicated. INSUFFICIENT_DATA: pos arm 1655 files.",
51810
51873
  aiSpecific: true,
51811
51874
  _v7Verdict: "DORMANT",
51812
51875
  _v7Lift: 1,
@@ -51815,6 +51878,11 @@ var init_signal_strength = __esm({
51815
51878
  _v7Precision: 0,
51816
51879
  _v8Verdict: "DORMANT",
51817
51880
  _v8Lift: 1,
51881
+ _v9Verdict: "DORMANT",
51882
+ _v9Lift: 0.86,
51883
+ _v9Recall: 0.13293,
51884
+ _v9FpRate: 0.15391,
51885
+ _v9Precision: 0.2187,
51818
51886
  defaultOff: true
51819
51887
  }
51820
51888
  };
@@ -51894,15 +51962,7 @@ async function scanFile(filePath, config, registry, cwd = process.cwd()) {
51894
51962
  const cache = buildParserCacheConfig(cwd);
51895
51963
  const ext = (0, import_node_path12.extname)(filePath).toLowerCase();
51896
51964
  const UNSUPPORTED_LANGS = /* @__PURE__ */ new Set([
51897
- ".swift",
51898
51965
  ".dart",
51899
- ".cpp",
51900
- ".cc",
51901
- ".cxx",
51902
- ".c",
51903
- ".h",
51904
- ".hpp",
51905
- ".hxx",
51906
51966
  ".rb",
51907
51967
  ".php"
51908
51968
  ]);