slopbrick 0.34.6 → 0.34.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.
@@ -34575,6 +34575,7 @@ var PRINTF_FAMILY_REGEX = /\b(?:printf|fprintf|sprintf|snprintf)\s*\(/g;
34575
34575
  var COUT_LITERAL_REGEX = /std\s*::\s*(?:cout|cerr|clog)\s*<<\s*"[^"]*"/g;
34576
34576
  var STD_COUT_BARE_REGEX = /std\s*::\s*(?:cout|cerr|clog)\s*<<\s*'[^']*'/g;
34577
34577
  var THRESHOLD_DEFAULT = 1;
34578
+ var TEST_FILE_REGEX = /(?:\/tests?\/|_test\.cc|_test\.cpp|Test\.cc|Test\.cpp|Tests\.cc|Tests\.cpp|_unittest\.cc|_unittest\.cpp)/;
34578
34579
  var cppPrintfDebugRule = createRule({
34579
34580
  id: "cpp/printf-debug",
34580
34581
  category: "typo",
@@ -34589,6 +34590,7 @@ var cppPrintfDebugRule = createRule({
34589
34590
  const source = facts.v2?._source;
34590
34591
  if (!source) return issues;
34591
34592
  if (!/\.(cpp|cc|cxx|h|hpp|hh|hxx|H)$/i.test(facts.filePath)) return issues;
34593
+ if (TEST_FILE_REGEX.test(facts.filePath)) return issues;
34592
34594
  const printfCount = (source.match(PRINTF_FAMILY_REGEX) ?? []).length;
34593
34595
  let viaPrintf = false;
34594
34596
  if (printfCount > context.threshold) {
@@ -34605,7 +34607,7 @@ var cppPrintfDebugRule = createRule({
34605
34607
  message: viaPrintf ? `${printfCount} printf-family calls \u2014 use spdlog / glog / AbslLog` : "std::cout/cerr/clog with a string literal \u2014 use spdlog / glog / AbslLog",
34606
34608
  line: 1,
34607
34609
  column: 1,
34608
- advice: "Replace with `spdlog::info(...)`, `LOG(INFO) << ...` (glog), or `ABSL_LOG(INFO) << ...` (Abseil). All of these are level-aware and have a configurable sink, and they route to stderr by default. `printf` / `std::cout` have no levels, no redaction, no sink routing, and can't be silenced in release builds. AI agents reach for these because their training data has countless C++ textbook examples with them. Reference: cpp/printf-debug v0.24."
34610
+ advice: "Replace with `spdlog::info(...)`, `LOG(INFO) << ...` (glog), or `ABSL_LOG(INFO) << ...` (Abseil). All of these are level-aware and have a configurable sink, and they route to stderr by default. `printf` / `std::cout` have no levels, no redaction, no sink routing, and can't be silenced in release builds. AI agents reach for these because their training data has countless C++ textbook examples with them. Reference: cpp/printf-debug v0.34.7 (refined to skip test files for higher precision)."
34609
34611
  });
34610
34612
  return issues;
34611
34613
  }
@@ -37583,7 +37585,7 @@ var kotlinObjectSingletonMisuseRule = createRule({
37583
37585
  // src/rules/kotlin/println-as-log.ts
37584
37586
  var PRINTLN_REGEX = /\bprintln\s*\(/g;
37585
37587
  var REAL_LOGGING_IMPORT_REGEX2 = /\bimport\s+(?:android\.util\.Log|org\.slf4j\.|io\.github\.oshai\.kotlinlogging|kotlin\.logging|co\.touchlab\.kermit|com\.github\.ajalt\.timber|org\.apache\.logging\.log4j)/;
37586
- var TEST_FILE_REGEX = /(?:\/src\/test\/|\/test\/|\/Tests\/|\/Test\.kt|\/Tests\.kt|Tests\.kt$|Test\.kt$)/;
37588
+ var TEST_FILE_REGEX2 = /(?:\/src\/test\/|\/test\/|\/Tests\/|\/Test\.kt|\/Tests\.kt|Tests\.kt$|Test\.kt$)/;
37587
37589
  var kotlinPrintlnAsLogRule = createRule({
37588
37590
  id: "kotlin/println-as-log",
37589
37591
  category: "logic",
@@ -37598,7 +37600,7 @@ var kotlinPrintlnAsLogRule = createRule({
37598
37600
  const source = facts.v2?._source;
37599
37601
  if (!source) return issues;
37600
37602
  if (!/\.kts?$/i.test(facts.filePath)) return issues;
37601
- if (TEST_FILE_REGEX.test(facts.filePath)) return issues;
37603
+ if (TEST_FILE_REGEX2.test(facts.filePath)) return issues;
37602
37604
  if (REAL_LOGGING_IMPORT_REGEX2.test(source)) return issues;
37603
37605
  let m;
37604
37606
  PRINTLN_REGEX.lastIndex = 0;
@@ -40635,7 +40637,7 @@ var swiftImplicitlyUnwrappedOptionalRule = createRule({
40635
40637
  // src/rules/swift/print-debug.ts
40636
40638
  var PRINT_REGEX = /\bprint\s*\(/g;
40637
40639
  var DEFAULT_THRESHOLD2 = 1;
40638
- var TEST_FILE_REGEX2 = /(?:\/Tests\/|\/Tests\.swift|\/Test\.swift|Tests\.swift$|Test\.swift$)/;
40640
+ var TEST_FILE_REGEX3 = /(?:\/Tests\/|\/Tests\.swift|\/Test\.swift|Tests\.swift$|Test\.swift$)/;
40639
40641
  var swiftPrintDebugRule = createRule({
40640
40642
  id: "swift/print-debug",
40641
40643
  category: "typo",
@@ -40650,7 +40652,7 @@ var swiftPrintDebugRule = createRule({
40650
40652
  const source = facts.v2?._source;
40651
40653
  if (!source) return issues;
40652
40654
  if (!/\.swift$/i.test(facts.filePath)) return issues;
40653
- if (TEST_FILE_REGEX2.test(facts.filePath)) return issues;
40655
+ if (TEST_FILE_REGEX3.test(facts.filePath)) return issues;
40654
40656
  const matches = [];
40655
40657
  let m;
40656
40658
  PRINT_REGEX.lastIndex = 0;
@@ -45882,7 +45884,7 @@ var signal_strength_default = {
45882
45884
  precision: 0.4407,
45883
45885
  lastCalibratedAt: "2026-07-03T00:00:00Z",
45884
45886
  verdict: "OK",
45885
- _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).",
45887
+ _calibrationNote: "v0.34.7: REFINED \u2014 rule now skips test files (gtest, catch2, doctest conventions: *_test.cpp, *_test.cc, /tests/ dir, *Test.cpp, *Test.cc, *_unittest.cpp). Per-file unique v9 C++ calibration (5107 neg, 1655 pos): 156 TP files, 198 FP files, ratio=2.43 (OK, fourth positive-signal in v9 history). precision=44.07% (below 50% USEFUL threshold); verdict=OK. The refinement is expected to push precision from 44% to 50%+ by removing gtest test output fires (which were a significant portion of FPs in the v0.33.0 measurement). The full v9 re-calibration is part of the broader v0.34.5/v0.34.7 pipeline; see v0.34.1's Four-language validation section. Same direction as kotlin/println-as-log (1.84), java/system-out-println (1.73 refined, 3.29 unrefined), swift/print-debug (1.13). INSUFFICIENT_DATA: pos arm 1655 files (below 10k floor).",
45886
45888
  aiSpecific: true,
45887
45889
  _v7Verdict: "DORMANT",
45888
45890
  _v7Lift: 1,
@@ -34546,6 +34546,7 @@ var PRINTF_FAMILY_REGEX = /\b(?:printf|fprintf|sprintf|snprintf)\s*\(/g;
34546
34546
  var COUT_LITERAL_REGEX = /std\s*::\s*(?:cout|cerr|clog)\s*<<\s*"[^"]*"/g;
34547
34547
  var STD_COUT_BARE_REGEX = /std\s*::\s*(?:cout|cerr|clog)\s*<<\s*'[^']*'/g;
34548
34548
  var THRESHOLD_DEFAULT = 1;
34549
+ var TEST_FILE_REGEX = /(?:\/tests?\/|_test\.cc|_test\.cpp|Test\.cc|Test\.cpp|Tests\.cc|Tests\.cpp|_unittest\.cc|_unittest\.cpp)/;
34549
34550
  var cppPrintfDebugRule = createRule({
34550
34551
  id: "cpp/printf-debug",
34551
34552
  category: "typo",
@@ -34560,6 +34561,7 @@ var cppPrintfDebugRule = createRule({
34560
34561
  const source = facts.v2?._source;
34561
34562
  if (!source) return issues;
34562
34563
  if (!/\.(cpp|cc|cxx|h|hpp|hh|hxx|H)$/i.test(facts.filePath)) return issues;
34564
+ if (TEST_FILE_REGEX.test(facts.filePath)) return issues;
34563
34565
  const printfCount = (source.match(PRINTF_FAMILY_REGEX) ?? []).length;
34564
34566
  let viaPrintf = false;
34565
34567
  if (printfCount > context.threshold) {
@@ -34576,7 +34578,7 @@ var cppPrintfDebugRule = createRule({
34576
34578
  message: viaPrintf ? `${printfCount} printf-family calls \u2014 use spdlog / glog / AbslLog` : "std::cout/cerr/clog with a string literal \u2014 use spdlog / glog / AbslLog",
34577
34579
  line: 1,
34578
34580
  column: 1,
34579
- advice: "Replace with `spdlog::info(...)`, `LOG(INFO) << ...` (glog), or `ABSL_LOG(INFO) << ...` (Abseil). All of these are level-aware and have a configurable sink, and they route to stderr by default. `printf` / `std::cout` have no levels, no redaction, no sink routing, and can't be silenced in release builds. AI agents reach for these because their training data has countless C++ textbook examples with them. Reference: cpp/printf-debug v0.24."
34581
+ advice: "Replace with `spdlog::info(...)`, `LOG(INFO) << ...` (glog), or `ABSL_LOG(INFO) << ...` (Abseil). All of these are level-aware and have a configurable sink, and they route to stderr by default. `printf` / `std::cout` have no levels, no redaction, no sink routing, and can't be silenced in release builds. AI agents reach for these because their training data has countless C++ textbook examples with them. Reference: cpp/printf-debug v0.34.7 (refined to skip test files for higher precision)."
34580
34582
  });
34581
34583
  return issues;
34582
34584
  }
@@ -37554,7 +37556,7 @@ var kotlinObjectSingletonMisuseRule = createRule({
37554
37556
  // src/rules/kotlin/println-as-log.ts
37555
37557
  var PRINTLN_REGEX = /\bprintln\s*\(/g;
37556
37558
  var REAL_LOGGING_IMPORT_REGEX2 = /\bimport\s+(?:android\.util\.Log|org\.slf4j\.|io\.github\.oshai\.kotlinlogging|kotlin\.logging|co\.touchlab\.kermit|com\.github\.ajalt\.timber|org\.apache\.logging\.log4j)/;
37557
- var TEST_FILE_REGEX = /(?:\/src\/test\/|\/test\/|\/Tests\/|\/Test\.kt|\/Tests\.kt|Tests\.kt$|Test\.kt$)/;
37559
+ var TEST_FILE_REGEX2 = /(?:\/src\/test\/|\/test\/|\/Tests\/|\/Test\.kt|\/Tests\.kt|Tests\.kt$|Test\.kt$)/;
37558
37560
  var kotlinPrintlnAsLogRule = createRule({
37559
37561
  id: "kotlin/println-as-log",
37560
37562
  category: "logic",
@@ -37569,7 +37571,7 @@ var kotlinPrintlnAsLogRule = createRule({
37569
37571
  const source = facts.v2?._source;
37570
37572
  if (!source) return issues;
37571
37573
  if (!/\.kts?$/i.test(facts.filePath)) return issues;
37572
- if (TEST_FILE_REGEX.test(facts.filePath)) return issues;
37574
+ if (TEST_FILE_REGEX2.test(facts.filePath)) return issues;
37573
37575
  if (REAL_LOGGING_IMPORT_REGEX2.test(source)) return issues;
37574
37576
  let m;
37575
37577
  PRINTLN_REGEX.lastIndex = 0;
@@ -40606,7 +40608,7 @@ var swiftImplicitlyUnwrappedOptionalRule = createRule({
40606
40608
  // src/rules/swift/print-debug.ts
40607
40609
  var PRINT_REGEX = /\bprint\s*\(/g;
40608
40610
  var DEFAULT_THRESHOLD2 = 1;
40609
- var TEST_FILE_REGEX2 = /(?:\/Tests\/|\/Tests\.swift|\/Test\.swift|Tests\.swift$|Test\.swift$)/;
40611
+ var TEST_FILE_REGEX3 = /(?:\/Tests\/|\/Tests\.swift|\/Test\.swift|Tests\.swift$|Test\.swift$)/;
40610
40612
  var swiftPrintDebugRule = createRule({
40611
40613
  id: "swift/print-debug",
40612
40614
  category: "typo",
@@ -40621,7 +40623,7 @@ var swiftPrintDebugRule = createRule({
40621
40623
  const source = facts.v2?._source;
40622
40624
  if (!source) return issues;
40623
40625
  if (!/\.swift$/i.test(facts.filePath)) return issues;
40624
- if (TEST_FILE_REGEX2.test(facts.filePath)) return issues;
40626
+ if (TEST_FILE_REGEX3.test(facts.filePath)) return issues;
40625
40627
  const matches = [];
40626
40628
  let m;
40627
40629
  PRINT_REGEX.lastIndex = 0;
@@ -45853,7 +45855,7 @@ var signal_strength_default = {
45853
45855
  precision: 0.4407,
45854
45856
  lastCalibratedAt: "2026-07-03T00:00:00Z",
45855
45857
  verdict: "OK",
45856
- _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).",
45858
+ _calibrationNote: "v0.34.7: REFINED \u2014 rule now skips test files (gtest, catch2, doctest conventions: *_test.cpp, *_test.cc, /tests/ dir, *Test.cpp, *Test.cc, *_unittest.cpp). Per-file unique v9 C++ calibration (5107 neg, 1655 pos): 156 TP files, 198 FP files, ratio=2.43 (OK, fourth positive-signal in v9 history). precision=44.07% (below 50% USEFUL threshold); verdict=OK. The refinement is expected to push precision from 44% to 50%+ by removing gtest test output fires (which were a significant portion of FPs in the v0.33.0 measurement). The full v9 re-calibration is part of the broader v0.34.5/v0.34.7 pipeline; see v0.34.1's Four-language validation section. Same direction as kotlin/println-as-log (1.84), java/system-out-println (1.73 refined, 3.29 unrefined), swift/print-debug (1.13). INSUFFICIENT_DATA: pos arm 1655 files (below 10k floor).",
45857
45859
  aiSpecific: true,
45858
45860
  _v7Verdict: "DORMANT",
45859
45861
  _v7Lift: 1,
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.34.6";
39
+ VERSION = "0.34.7";
40
40
  }
41
41
  });
42
42
 
@@ -27810,7 +27810,7 @@ var init_magic_numbers = __esm({
27810
27810
  });
27811
27811
 
27812
27812
  // src/rules/cpp/printf-debug.ts
27813
- var PRINTF_FAMILY_REGEX, COUT_LITERAL_REGEX, STD_COUT_BARE_REGEX, THRESHOLD_DEFAULT, cppPrintfDebugRule;
27813
+ var PRINTF_FAMILY_REGEX, COUT_LITERAL_REGEX, STD_COUT_BARE_REGEX, THRESHOLD_DEFAULT, TEST_FILE_REGEX, cppPrintfDebugRule;
27814
27814
  var init_printf_debug = __esm({
27815
27815
  "src/rules/cpp/printf-debug.ts"() {
27816
27816
  "use strict";
@@ -27819,6 +27819,7 @@ var init_printf_debug = __esm({
27819
27819
  COUT_LITERAL_REGEX = /std\s*::\s*(?:cout|cerr|clog)\s*<<\s*"[^"]*"/g;
27820
27820
  STD_COUT_BARE_REGEX = /std\s*::\s*(?:cout|cerr|clog)\s*<<\s*'[^']*'/g;
27821
27821
  THRESHOLD_DEFAULT = 1;
27822
+ TEST_FILE_REGEX = /(?:\/tests?\/|_test\.cc|_test\.cpp|Test\.cc|Test\.cpp|Tests\.cc|Tests\.cpp|_unittest\.cc|_unittest\.cpp)/;
27822
27823
  cppPrintfDebugRule = createRule({
27823
27824
  id: "cpp/printf-debug",
27824
27825
  category: "typo",
@@ -27833,6 +27834,7 @@ var init_printf_debug = __esm({
27833
27834
  const source = facts.v2?._source;
27834
27835
  if (!source) return issues;
27835
27836
  if (!/\.(cpp|cc|cxx|h|hpp|hh|hxx|H)$/i.test(facts.filePath)) return issues;
27837
+ if (TEST_FILE_REGEX.test(facts.filePath)) return issues;
27836
27838
  const printfCount = (source.match(PRINTF_FAMILY_REGEX) ?? []).length;
27837
27839
  let viaPrintf = false;
27838
27840
  if (printfCount > context.threshold) {
@@ -27849,7 +27851,7 @@ var init_printf_debug = __esm({
27849
27851
  message: viaPrintf ? `${printfCount} printf-family calls \u2014 use spdlog / glog / AbslLog` : "std::cout/cerr/clog with a string literal \u2014 use spdlog / glog / AbslLog",
27850
27852
  line: 1,
27851
27853
  column: 1,
27852
- advice: "Replace with `spdlog::info(...)`, `LOG(INFO) << ...` (glog), or `ABSL_LOG(INFO) << ...` (Abseil). All of these are level-aware and have a configurable sink, and they route to stderr by default. `printf` / `std::cout` have no levels, no redaction, no sink routing, and can't be silenced in release builds. AI agents reach for these because their training data has countless C++ textbook examples with them. Reference: cpp/printf-debug v0.24."
27854
+ advice: "Replace with `spdlog::info(...)`, `LOG(INFO) << ...` (glog), or `ABSL_LOG(INFO) << ...` (Abseil). All of these are level-aware and have a configurable sink, and they route to stderr by default. `printf` / `std::cout` have no levels, no redaction, no sink routing, and can't be silenced in release builds. AI agents reach for these because their training data has countless C++ textbook examples with them. Reference: cpp/printf-debug v0.34.7 (refined to skip test files for higher precision)."
27853
27855
  });
27854
27856
  return issues;
27855
27857
  }
@@ -31295,14 +31297,14 @@ var init_object_singleton_misuse = __esm({
31295
31297
  });
31296
31298
 
31297
31299
  // src/rules/kotlin/println-as-log.ts
31298
- var PRINTLN_REGEX, REAL_LOGGING_IMPORT_REGEX2, TEST_FILE_REGEX, kotlinPrintlnAsLogRule;
31300
+ var PRINTLN_REGEX, REAL_LOGGING_IMPORT_REGEX2, TEST_FILE_REGEX2, kotlinPrintlnAsLogRule;
31299
31301
  var init_println_as_log = __esm({
31300
31302
  "src/rules/kotlin/println-as-log.ts"() {
31301
31303
  "use strict";
31302
31304
  init_rule();
31303
31305
  PRINTLN_REGEX = /\bprintln\s*\(/g;
31304
31306
  REAL_LOGGING_IMPORT_REGEX2 = /\bimport\s+(?:android\.util\.Log|org\.slf4j\.|io\.github\.oshai\.kotlinlogging|kotlin\.logging|co\.touchlab\.kermit|com\.github\.ajalt\.timber|org\.apache\.logging\.log4j)/;
31305
- TEST_FILE_REGEX = /(?:\/src\/test\/|\/test\/|\/Tests\/|\/Test\.kt|\/Tests\.kt|Tests\.kt$|Test\.kt$)/;
31307
+ TEST_FILE_REGEX2 = /(?:\/src\/test\/|\/test\/|\/Tests\/|\/Test\.kt|\/Tests\.kt|Tests\.kt$|Test\.kt$)/;
31306
31308
  kotlinPrintlnAsLogRule = createRule({
31307
31309
  id: "kotlin/println-as-log",
31308
31310
  category: "logic",
@@ -31317,7 +31319,7 @@ var init_println_as_log = __esm({
31317
31319
  const source = facts.v2?._source;
31318
31320
  if (!source) return issues;
31319
31321
  if (!/\.kts?$/i.test(facts.filePath)) return issues;
31320
- if (TEST_FILE_REGEX.test(facts.filePath)) return issues;
31322
+ if (TEST_FILE_REGEX2.test(facts.filePath)) return issues;
31321
31323
  if (REAL_LOGGING_IMPORT_REGEX2.test(source)) return issues;
31322
31324
  let m;
31323
31325
  PRINTLN_REGEX.lastIndex = 0;
@@ -41176,14 +41178,14 @@ var init_implicitly_unwrapped_optional = __esm({
41176
41178
  });
41177
41179
 
41178
41180
  // src/rules/swift/print-debug.ts
41179
- var PRINT_REGEX, DEFAULT_THRESHOLD2, TEST_FILE_REGEX2, swiftPrintDebugRule;
41181
+ var PRINT_REGEX, DEFAULT_THRESHOLD2, TEST_FILE_REGEX3, swiftPrintDebugRule;
41180
41182
  var init_print_debug = __esm({
41181
41183
  "src/rules/swift/print-debug.ts"() {
41182
41184
  "use strict";
41183
41185
  init_rule();
41184
41186
  PRINT_REGEX = /\bprint\s*\(/g;
41185
41187
  DEFAULT_THRESHOLD2 = 1;
41186
- TEST_FILE_REGEX2 = /(?:\/Tests\/|\/Tests\.swift|\/Test\.swift|Tests\.swift$|Test\.swift$)/;
41188
+ TEST_FILE_REGEX3 = /(?:\/Tests\/|\/Tests\.swift|\/Test\.swift|Tests\.swift$|Test\.swift$)/;
41187
41189
  swiftPrintDebugRule = createRule({
41188
41190
  id: "swift/print-debug",
41189
41191
  category: "typo",
@@ -41198,7 +41200,7 @@ var init_print_debug = __esm({
41198
41200
  const source = facts.v2?._source;
41199
41201
  if (!source) return issues;
41200
41202
  if (!/\.swift$/i.test(facts.filePath)) return issues;
41201
- if (TEST_FILE_REGEX2.test(facts.filePath)) return issues;
41203
+ if (TEST_FILE_REGEX3.test(facts.filePath)) return issues;
41202
41204
  const matches = [];
41203
41205
  let m;
41204
41206
  PRINT_REGEX.lastIndex = 0;
@@ -51969,7 +51971,7 @@ var init_signal_strength = __esm({
51969
51971
  precision: 0.4407,
51970
51972
  lastCalibratedAt: "2026-07-03T00:00:00Z",
51971
51973
  verdict: "OK",
51972
- _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).",
51974
+ _calibrationNote: "v0.34.7: REFINED \u2014 rule now skips test files (gtest, catch2, doctest conventions: *_test.cpp, *_test.cc, /tests/ dir, *Test.cpp, *Test.cc, *_unittest.cpp). Per-file unique v9 C++ calibration (5107 neg, 1655 pos): 156 TP files, 198 FP files, ratio=2.43 (OK, fourth positive-signal in v9 history). precision=44.07% (below 50% USEFUL threshold); verdict=OK. The refinement is expected to push precision from 44% to 50%+ by removing gtest test output fires (which were a significant portion of FPs in the v0.33.0 measurement). The full v9 re-calibration is part of the broader v0.34.5/v0.34.7 pipeline; see v0.34.1's Four-language validation section. Same direction as kotlin/println-as-log (1.84), java/system-out-println (1.73 refined, 3.29 unrefined), swift/print-debug (1.13). INSUFFICIENT_DATA: pos arm 1655 files (below 10k floor).",
51973
51975
  aiSpecific: true,
51974
51976
  _v7Verdict: "DORMANT",
51975
51977
  _v7Lift: 1,
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ var VERSION;
19
19
  var init_header = __esm({
20
20
  "src/types/_header.ts"() {
21
21
  "use strict";
22
- VERSION = "0.34.6";
22
+ VERSION = "0.34.7";
23
23
  }
24
24
  });
25
25
 
@@ -27792,7 +27792,7 @@ var init_magic_numbers = __esm({
27792
27792
  });
27793
27793
 
27794
27794
  // src/rules/cpp/printf-debug.ts
27795
- var PRINTF_FAMILY_REGEX, COUT_LITERAL_REGEX, STD_COUT_BARE_REGEX, THRESHOLD_DEFAULT, cppPrintfDebugRule;
27795
+ var PRINTF_FAMILY_REGEX, COUT_LITERAL_REGEX, STD_COUT_BARE_REGEX, THRESHOLD_DEFAULT, TEST_FILE_REGEX, cppPrintfDebugRule;
27796
27796
  var init_printf_debug = __esm({
27797
27797
  "src/rules/cpp/printf-debug.ts"() {
27798
27798
  "use strict";
@@ -27801,6 +27801,7 @@ var init_printf_debug = __esm({
27801
27801
  COUT_LITERAL_REGEX = /std\s*::\s*(?:cout|cerr|clog)\s*<<\s*"[^"]*"/g;
27802
27802
  STD_COUT_BARE_REGEX = /std\s*::\s*(?:cout|cerr|clog)\s*<<\s*'[^']*'/g;
27803
27803
  THRESHOLD_DEFAULT = 1;
27804
+ TEST_FILE_REGEX = /(?:\/tests?\/|_test\.cc|_test\.cpp|Test\.cc|Test\.cpp|Tests\.cc|Tests\.cpp|_unittest\.cc|_unittest\.cpp)/;
27804
27805
  cppPrintfDebugRule = createRule({
27805
27806
  id: "cpp/printf-debug",
27806
27807
  category: "typo",
@@ -27815,6 +27816,7 @@ var init_printf_debug = __esm({
27815
27816
  const source = facts.v2?._source;
27816
27817
  if (!source) return issues;
27817
27818
  if (!/\.(cpp|cc|cxx|h|hpp|hh|hxx|H)$/i.test(facts.filePath)) return issues;
27819
+ if (TEST_FILE_REGEX.test(facts.filePath)) return issues;
27818
27820
  const printfCount = (source.match(PRINTF_FAMILY_REGEX) ?? []).length;
27819
27821
  let viaPrintf = false;
27820
27822
  if (printfCount > context.threshold) {
@@ -27831,7 +27833,7 @@ var init_printf_debug = __esm({
27831
27833
  message: viaPrintf ? `${printfCount} printf-family calls \u2014 use spdlog / glog / AbslLog` : "std::cout/cerr/clog with a string literal \u2014 use spdlog / glog / AbslLog",
27832
27834
  line: 1,
27833
27835
  column: 1,
27834
- advice: "Replace with `spdlog::info(...)`, `LOG(INFO) << ...` (glog), or `ABSL_LOG(INFO) << ...` (Abseil). All of these are level-aware and have a configurable sink, and they route to stderr by default. `printf` / `std::cout` have no levels, no redaction, no sink routing, and can't be silenced in release builds. AI agents reach for these because their training data has countless C++ textbook examples with them. Reference: cpp/printf-debug v0.24."
27836
+ advice: "Replace with `spdlog::info(...)`, `LOG(INFO) << ...` (glog), or `ABSL_LOG(INFO) << ...` (Abseil). All of these are level-aware and have a configurable sink, and they route to stderr by default. `printf` / `std::cout` have no levels, no redaction, no sink routing, and can't be silenced in release builds. AI agents reach for these because their training data has countless C++ textbook examples with them. Reference: cpp/printf-debug v0.34.7 (refined to skip test files for higher precision)."
27835
27837
  });
27836
27838
  return issues;
27837
27839
  }
@@ -31276,14 +31278,14 @@ var init_object_singleton_misuse = __esm({
31276
31278
  });
31277
31279
 
31278
31280
  // src/rules/kotlin/println-as-log.ts
31279
- var PRINTLN_REGEX, REAL_LOGGING_IMPORT_REGEX2, TEST_FILE_REGEX, kotlinPrintlnAsLogRule;
31281
+ var PRINTLN_REGEX, REAL_LOGGING_IMPORT_REGEX2, TEST_FILE_REGEX2, kotlinPrintlnAsLogRule;
31280
31282
  var init_println_as_log = __esm({
31281
31283
  "src/rules/kotlin/println-as-log.ts"() {
31282
31284
  "use strict";
31283
31285
  init_rule();
31284
31286
  PRINTLN_REGEX = /\bprintln\s*\(/g;
31285
31287
  REAL_LOGGING_IMPORT_REGEX2 = /\bimport\s+(?:android\.util\.Log|org\.slf4j\.|io\.github\.oshai\.kotlinlogging|kotlin\.logging|co\.touchlab\.kermit|com\.github\.ajalt\.timber|org\.apache\.logging\.log4j)/;
31286
- TEST_FILE_REGEX = /(?:\/src\/test\/|\/test\/|\/Tests\/|\/Test\.kt|\/Tests\.kt|Tests\.kt$|Test\.kt$)/;
31288
+ TEST_FILE_REGEX2 = /(?:\/src\/test\/|\/test\/|\/Tests\/|\/Test\.kt|\/Tests\.kt|Tests\.kt$|Test\.kt$)/;
31287
31289
  kotlinPrintlnAsLogRule = createRule({
31288
31290
  id: "kotlin/println-as-log",
31289
31291
  category: "logic",
@@ -31298,7 +31300,7 @@ var init_println_as_log = __esm({
31298
31300
  const source = facts.v2?._source;
31299
31301
  if (!source) return issues;
31300
31302
  if (!/\.kts?$/i.test(facts.filePath)) return issues;
31301
- if (TEST_FILE_REGEX.test(facts.filePath)) return issues;
31303
+ if (TEST_FILE_REGEX2.test(facts.filePath)) return issues;
31302
31304
  if (REAL_LOGGING_IMPORT_REGEX2.test(source)) return issues;
31303
31305
  let m;
31304
31306
  PRINTLN_REGEX.lastIndex = 0;
@@ -41157,14 +41159,14 @@ var init_implicitly_unwrapped_optional = __esm({
41157
41159
  });
41158
41160
 
41159
41161
  // src/rules/swift/print-debug.ts
41160
- var PRINT_REGEX, DEFAULT_THRESHOLD2, TEST_FILE_REGEX2, swiftPrintDebugRule;
41162
+ var PRINT_REGEX, DEFAULT_THRESHOLD2, TEST_FILE_REGEX3, swiftPrintDebugRule;
41161
41163
  var init_print_debug = __esm({
41162
41164
  "src/rules/swift/print-debug.ts"() {
41163
41165
  "use strict";
41164
41166
  init_rule();
41165
41167
  PRINT_REGEX = /\bprint\s*\(/g;
41166
41168
  DEFAULT_THRESHOLD2 = 1;
41167
- TEST_FILE_REGEX2 = /(?:\/Tests\/|\/Tests\.swift|\/Test\.swift|Tests\.swift$|Test\.swift$)/;
41169
+ TEST_FILE_REGEX3 = /(?:\/Tests\/|\/Tests\.swift|\/Test\.swift|Tests\.swift$|Test\.swift$)/;
41168
41170
  swiftPrintDebugRule = createRule({
41169
41171
  id: "swift/print-debug",
41170
41172
  category: "typo",
@@ -41179,7 +41181,7 @@ var init_print_debug = __esm({
41179
41181
  const source = facts.v2?._source;
41180
41182
  if (!source) return issues;
41181
41183
  if (!/\.swift$/i.test(facts.filePath)) return issues;
41182
- if (TEST_FILE_REGEX2.test(facts.filePath)) return issues;
41184
+ if (TEST_FILE_REGEX3.test(facts.filePath)) return issues;
41183
41185
  const matches = [];
41184
41186
  let m;
41185
41187
  PRINT_REGEX.lastIndex = 0;
@@ -51947,7 +51949,7 @@ var init_signal_strength = __esm({
51947
51949
  precision: 0.4407,
51948
51950
  lastCalibratedAt: "2026-07-03T00:00:00Z",
51949
51951
  verdict: "OK",
51950
- _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).",
51952
+ _calibrationNote: "v0.34.7: REFINED \u2014 rule now skips test files (gtest, catch2, doctest conventions: *_test.cpp, *_test.cc, /tests/ dir, *Test.cpp, *Test.cc, *_unittest.cpp). Per-file unique v9 C++ calibration (5107 neg, 1655 pos): 156 TP files, 198 FP files, ratio=2.43 (OK, fourth positive-signal in v9 history). precision=44.07% (below 50% USEFUL threshold); verdict=OK. The refinement is expected to push precision from 44% to 50%+ by removing gtest test output fires (which were a significant portion of FPs in the v0.33.0 measurement). The full v9 re-calibration is part of the broader v0.34.5/v0.34.7 pipeline; see v0.34.1's Four-language validation section. Same direction as kotlin/println-as-log (1.84), java/system-out-println (1.73 refined, 3.29 unrefined), swift/print-debug (1.13). INSUFFICIENT_DATA: pos arm 1655 files (below 10k floor).",
51951
51953
  aiSpecific: true,
51952
51954
  _v7Verdict: "DORMANT",
51953
51955
  _v7Lift: 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slopbrick",
3
- "version": "0.34.6",
3
+ "version": "0.34.7",
4
4
  "description": "Discovered, modeled, and governed repository structure. SlopBrick scans source code, classifies it against 95+ rules in 15 categories, computes 4 scores (aiSlopScore: lower=cleaner, engineeringHygiene, security, repositoryHealth composite), and persists the structure for AI agents and CI.",
5
5
  "type": "module",
6
6
  "bin": {