slopbrick 0.19.0 → 0.21.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.d.cts CHANGED
@@ -727,6 +727,14 @@ interface Rule<Context = unknown> {
727
727
  aiSpecific: boolean;
728
728
  /** Round 25: short description shown by `slopbrick rules` and used in docs. */
729
729
  description?: string;
730
+ /**
731
+ * v0.20.0: when true, the rule is shipped disabled (off) by default.
732
+ * Users can opt in via `slopbrick.config.mjs` ruleConfig. The
733
+ * defaultOff flag means "this rule is too noisy / uncalibrated to
734
+ * run unconditionally — a user has to explicitly turn it on".
735
+ * See `src/snippet/data.ts` for the canonical list.
736
+ */
737
+ defaultOff?: boolean;
730
738
  create(context: RuleContext): Context;
731
739
  analyze(context: Context, facts: ScanFacts): Issue[];
732
740
  }
@@ -833,7 +841,7 @@ type Bucket = 'ai' | 'hygiene' | 'suppressed';
833
841
  *
834
842
  * v3 dropped the single `slopIndex` headline in favor of four named
835
843
  * scores:
836
- * - `aiQuality` — AI-specific findings (USEFUL + OK verdicts)
844
+ * - `aiSlopScore` — AI-specific findings (USEFUL + OK verdicts)
837
845
  * - `engineeringHygiene` — HYGIENE + INVERTED rules
838
846
  * - `security` — security/* rules
839
847
  * - `repositoryHealth` — composite (0.5*aiQ + 0.3*eng + 0.2*sec)
@@ -845,7 +853,7 @@ interface HealthFile {
845
853
  version: typeof _usebrick_core.STRUCTURE_SCHEMA_VERSION;
846
854
  generatedAt: string;
847
855
  workspace: string;
848
- aiQuality: number;
856
+ aiSlopScore: number;
849
857
  engineeringHygiene: number;
850
858
  security: number;
851
859
  repositoryHealth: number;
@@ -894,14 +902,14 @@ interface MaintenanceAxes {
894
902
  /** v0.15.0 U.4+: 0-100, higher = better. The new headline score
895
903
  * that replaces slopIndex. Tests and callers should pass this
896
904
  * going forward. */
897
- aiQuality?: number;
905
+ aiSlopScore?: number;
898
906
  /** v0.15.0 U.4+: 0-100, higher = better. */
899
907
  engineeringHygiene?: number;
900
908
  /** v0.15.0 U.4+: 0-100, higher = better. */
901
909
  security?: number;
902
910
  /** v0.15.0 U.4+: 0-100, higher = better. */
903
911
  repositoryHealth?: number;
904
- /** 0-100, lower = better. @deprecated v0.15.0: use aiQuality. Kept
912
+ /** 0-100, lower = better. @deprecated v0.15.0: use aiSlopScore. Kept
905
913
  * for backward compat with existing test fixtures and historical
906
914
  * telemetry. The axis inverts it internally. */
907
915
  slopIndex?: number;
@@ -951,7 +959,7 @@ interface AiMaintenanceCostResult {
951
959
  type DocDriftLevel = 'low' | 'medium' | 'high' | 'critical';
952
960
  /** A single doc-drift finding — one rule firing on one line. */
953
961
  interface DocFinding {
954
- ruleId: 'docs/stale-package-reference' | 'docs/stale-function-reference' | 'docs/expired-code-example' | 'docs/broken-link';
962
+ ruleId: 'docs/stale-package-reference' | 'docs/stale-function-reference' | 'docs/broken-link';
955
963
  severity: 'low' | 'medium' | 'high';
956
964
  docFile: string;
957
965
  line: number;
@@ -1004,7 +1012,7 @@ interface RepositoryHealthInputs {
1004
1012
  /** v0.15.0 U.4+: 0-100, higher = better. The new headline score
1005
1013
  * that replaces slopIndex. Tests and callers should pass this
1006
1014
  * going forward. */
1007
- aiQuality?: number;
1015
+ aiSlopScore?: number;
1008
1016
  /** v0.15.0 U.4+: 0-100, higher = better. */
1009
1017
  engineeringHygiene?: number;
1010
1018
  /** v0.15.0 U.4+: 0-100, higher = better. */
@@ -1012,7 +1020,7 @@ interface RepositoryHealthInputs {
1012
1020
  /** v0.15.0 U.4+: 0-100, higher = better. */
1013
1021
  repositoryHealth?: number;
1014
1022
  /** 0-100, lower = better. Inverted to 100 - x for the composite.
1015
- * @deprecated v0.15.0: use aiQuality. Kept for backward compat. */
1023
+ * @deprecated v0.15.0: use aiSlopScore. Kept for backward compat. */
1016
1024
  slopIndex?: number;
1017
1025
  /** 0-100, higher = better. */
1018
1026
  architectureConsistency?: number;
@@ -1184,16 +1192,26 @@ interface ProjectReport {
1184
1192
  version: string;
1185
1193
  generatedAt: string;
1186
1194
  configPath?: string;
1187
- /** v0.15.0 U.4+: replaces the legacy slopIndex. 0-100, higher is better. */
1188
- aiQuality: number;
1195
+ /**
1196
+ * v0.20.0: renamed from `aiSlopScore` to `aiSlopScore` because the
1197
+ * old name implied a property of the *code* (quality) when it
1198
+ * actually measures a property of the *tool's detection* (how
1199
+ * many AI-detection rules fire on this codebase). 0-100, higher
1200
+ * is better — but 'better' means 'fewer rule fires', not
1201
+ * 'higher quality code'. The name "AI Slop Score" matches the
1202
+ * existing description ("measures AI-slop signatures") and the
1203
+ * slopbrick brand. See the pre-publish checklist in
1204
+ * CONTRIBUTING.md for the full rationale.
1205
+ */
1206
+ aiSlopScore: number;
1189
1207
  engineeringHygiene: number;
1190
1208
  security: number;
1191
1209
  repositoryHealth: number;
1192
1210
  assemblyHealth: number;
1193
1211
  totalScore: number;
1194
- /** @deprecated v0.15.0: use aiQuality. Kept as optional for backward
1195
- * compat with existing test fixtures and historical telemetry. Will be
1196
- * removed in v0.16.0. */
1212
+ /** @deprecated v0.20.0: use `aiSlopScore`. Kept as optional for
1213
+ * backward compat with existing test fixtures and historical
1214
+ * telemetry. Will be removed in v0.21. */
1197
1215
  slopIndex?: number;
1198
1216
  categoryScores: Record<Category, number>;
1199
1217
  /** Phase 2 §10: composite subscores. Each is in 0-100 (capped).
package/dist/index.d.ts CHANGED
@@ -727,6 +727,14 @@ interface Rule<Context = unknown> {
727
727
  aiSpecific: boolean;
728
728
  /** Round 25: short description shown by `slopbrick rules` and used in docs. */
729
729
  description?: string;
730
+ /**
731
+ * v0.20.0: when true, the rule is shipped disabled (off) by default.
732
+ * Users can opt in via `slopbrick.config.mjs` ruleConfig. The
733
+ * defaultOff flag means "this rule is too noisy / uncalibrated to
734
+ * run unconditionally — a user has to explicitly turn it on".
735
+ * See `src/snippet/data.ts` for the canonical list.
736
+ */
737
+ defaultOff?: boolean;
730
738
  create(context: RuleContext): Context;
731
739
  analyze(context: Context, facts: ScanFacts): Issue[];
732
740
  }
@@ -833,7 +841,7 @@ type Bucket = 'ai' | 'hygiene' | 'suppressed';
833
841
  *
834
842
  * v3 dropped the single `slopIndex` headline in favor of four named
835
843
  * scores:
836
- * - `aiQuality` — AI-specific findings (USEFUL + OK verdicts)
844
+ * - `aiSlopScore` — AI-specific findings (USEFUL + OK verdicts)
837
845
  * - `engineeringHygiene` — HYGIENE + INVERTED rules
838
846
  * - `security` — security/* rules
839
847
  * - `repositoryHealth` — composite (0.5*aiQ + 0.3*eng + 0.2*sec)
@@ -845,7 +853,7 @@ interface HealthFile {
845
853
  version: typeof _usebrick_core.STRUCTURE_SCHEMA_VERSION;
846
854
  generatedAt: string;
847
855
  workspace: string;
848
- aiQuality: number;
856
+ aiSlopScore: number;
849
857
  engineeringHygiene: number;
850
858
  security: number;
851
859
  repositoryHealth: number;
@@ -894,14 +902,14 @@ interface MaintenanceAxes {
894
902
  /** v0.15.0 U.4+: 0-100, higher = better. The new headline score
895
903
  * that replaces slopIndex. Tests and callers should pass this
896
904
  * going forward. */
897
- aiQuality?: number;
905
+ aiSlopScore?: number;
898
906
  /** v0.15.0 U.4+: 0-100, higher = better. */
899
907
  engineeringHygiene?: number;
900
908
  /** v0.15.0 U.4+: 0-100, higher = better. */
901
909
  security?: number;
902
910
  /** v0.15.0 U.4+: 0-100, higher = better. */
903
911
  repositoryHealth?: number;
904
- /** 0-100, lower = better. @deprecated v0.15.0: use aiQuality. Kept
912
+ /** 0-100, lower = better. @deprecated v0.15.0: use aiSlopScore. Kept
905
913
  * for backward compat with existing test fixtures and historical
906
914
  * telemetry. The axis inverts it internally. */
907
915
  slopIndex?: number;
@@ -951,7 +959,7 @@ interface AiMaintenanceCostResult {
951
959
  type DocDriftLevel = 'low' | 'medium' | 'high' | 'critical';
952
960
  /** A single doc-drift finding — one rule firing on one line. */
953
961
  interface DocFinding {
954
- ruleId: 'docs/stale-package-reference' | 'docs/stale-function-reference' | 'docs/expired-code-example' | 'docs/broken-link';
962
+ ruleId: 'docs/stale-package-reference' | 'docs/stale-function-reference' | 'docs/broken-link';
955
963
  severity: 'low' | 'medium' | 'high';
956
964
  docFile: string;
957
965
  line: number;
@@ -1004,7 +1012,7 @@ interface RepositoryHealthInputs {
1004
1012
  /** v0.15.0 U.4+: 0-100, higher = better. The new headline score
1005
1013
  * that replaces slopIndex. Tests and callers should pass this
1006
1014
  * going forward. */
1007
- aiQuality?: number;
1015
+ aiSlopScore?: number;
1008
1016
  /** v0.15.0 U.4+: 0-100, higher = better. */
1009
1017
  engineeringHygiene?: number;
1010
1018
  /** v0.15.0 U.4+: 0-100, higher = better. */
@@ -1012,7 +1020,7 @@ interface RepositoryHealthInputs {
1012
1020
  /** v0.15.0 U.4+: 0-100, higher = better. */
1013
1021
  repositoryHealth?: number;
1014
1022
  /** 0-100, lower = better. Inverted to 100 - x for the composite.
1015
- * @deprecated v0.15.0: use aiQuality. Kept for backward compat. */
1023
+ * @deprecated v0.15.0: use aiSlopScore. Kept for backward compat. */
1016
1024
  slopIndex?: number;
1017
1025
  /** 0-100, higher = better. */
1018
1026
  architectureConsistency?: number;
@@ -1184,16 +1192,26 @@ interface ProjectReport {
1184
1192
  version: string;
1185
1193
  generatedAt: string;
1186
1194
  configPath?: string;
1187
- /** v0.15.0 U.4+: replaces the legacy slopIndex. 0-100, higher is better. */
1188
- aiQuality: number;
1195
+ /**
1196
+ * v0.20.0: renamed from `aiSlopScore` to `aiSlopScore` because the
1197
+ * old name implied a property of the *code* (quality) when it
1198
+ * actually measures a property of the *tool's detection* (how
1199
+ * many AI-detection rules fire on this codebase). 0-100, higher
1200
+ * is better — but 'better' means 'fewer rule fires', not
1201
+ * 'higher quality code'. The name "AI Slop Score" matches the
1202
+ * existing description ("measures AI-slop signatures") and the
1203
+ * slopbrick brand. See the pre-publish checklist in
1204
+ * CONTRIBUTING.md for the full rationale.
1205
+ */
1206
+ aiSlopScore: number;
1189
1207
  engineeringHygiene: number;
1190
1208
  security: number;
1191
1209
  repositoryHealth: number;
1192
1210
  assemblyHealth: number;
1193
1211
  totalScore: number;
1194
- /** @deprecated v0.15.0: use aiQuality. Kept as optional for backward
1195
- * compat with existing test fixtures and historical telemetry. Will be
1196
- * removed in v0.16.0. */
1212
+ /** @deprecated v0.20.0: use `aiSlopScore`. Kept as optional for
1213
+ * backward compat with existing test fixtures and historical
1214
+ * telemetry. Will be removed in v0.21. */
1197
1215
  slopIndex?: number;
1198
1216
  categoryScores: Record<Category, number>;
1199
1217
  /** Phase 2 §10: composite subscores. Each is in 0-100 (capped).