slopbrick 0.42.0 → 0.43.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
@@ -1155,9 +1155,8 @@ type AiDebt = 'low' | 'medium' | 'high' | 'critical';
1155
1155
  declare const AI_SECURITY_NUMERIC: Record<'low' | 'medium' | 'high' | 'critical', number>;
1156
1156
  /** Inputs to the pure `buildRepositoryHealth` function. Every input is optional. */
1157
1157
  interface RepositoryHealthInputs {
1158
- /** v0.15.0 U.4+: 0-100, higher = better. The new headline score
1159
- * that replaces slopIndex. Tests and callers should pass this
1160
- * going forward. */
1158
+ /** v0.21.0: 0-100, lower = better (raw amount of slop).
1159
+ * Replaces the v0.15-v0.20.1 inverted cleanliness reading. */
1161
1160
  aiSlopScore?: number;
1162
1161
  /** v0.15.0 U.4+: 0-100, higher = better. */
1163
1162
  engineeringHygiene?: number;
@@ -1401,15 +1400,15 @@ interface ProjectReport {
1401
1400
  generatedAt: string;
1402
1401
  configPath?: string;
1403
1402
  /**
1404
- * v0.20.0: renamed from `aiSlopScore` to `aiSlopScore` because the
1405
- * old name implied a property of the *code* (quality) when it
1406
- * actually measures a property of the *tool's detection* (how
1407
- * many AI-detection rules fire on this codebase). 0-100, higher
1408
- * is better — but 'better' means 'fewer rule fires', not
1409
- * 'higher quality code'. The name "AI Slop Score" matches the
1410
- * existing description ("measures AI-slop signatures") and the
1411
- * slopbrick brand. See the pre-publish checklist in
1412
- * CONTRIBUTING.md for the full rationale.
1403
+ * v0.21.0: 0-100, **lower = better** (raw amount of slop).
1404
+ * The CI gate is `aiSlopScore <= meanSlop` (where meanSlop defaults
1405
+ * to 30). Higher values mean more AI-detection rules fired on this
1406
+ * codebase. The previous v0.15-v0.20.1 reading inverted this to
1407
+ * "cleanliness" (higher = better), which made the JSON output and
1408
+ * the CLI gate disagree. This field has been lower-is-better
1409
+ * since v0.21.0; the JSDoc that said "0-100, higher is better"
1410
+ * was a stale v0.15-era comment that survived past the inversion.
1411
+ * Fixed in v0.42.0.
1413
1412
  */
1414
1413
  aiSlopScore: number;
1415
1414
  engineeringHygiene: number;
@@ -1578,6 +1577,18 @@ interface ProjectReport {
1578
1577
  p90Slop: number;
1579
1578
  individualSlopThreshold: number;
1580
1579
  };
1580
+ /**
1581
+ * v0.42.0 (user-review fix): names of thresholds that tripped in this
1582
+ * scan. Optional for backward compat with v0.41 and earlier reports.
1583
+ * Empty/undefined means all gates passed.
1584
+ *
1585
+ * Possible values: 'meanSlop', 'p90Slop', 'individualSlopThreshold',
1586
+ * 'category:<name>' (per-category thresholds).
1587
+ *
1588
+ * CI consumers can grep this field directly instead of parsing the
1589
+ * stderr message. See threshold.ts#failedThresholds for source.
1590
+ */
1591
+ failedThresholds?: string[];
1581
1592
  /** Research/flywheel snapshot — present when the flywheel directory has artifacts. */
1582
1593
  research?: ResearchMetrics;
1583
1594
  topOffenders?: TopOffender[];
@@ -1654,9 +1665,12 @@ interface ProjectReport {
1654
1665
  /** v0.14.5i — Number of distinct rules marked defaultOff. The ratio
1655
1666
  * suppressedCount / defaultOffRuleCount is the calibration coverage. */
1656
1667
  defaultOffRuleCount?: number;
1657
- /** v0.14.5j — The previous run's Slop Index, if any. Used by
1668
+ /** v0.14.5j — The previous run's value, if any. Used by
1658
1669
  * formatPretty to render a "±N from last run" delta so the user
1659
- * can see the trajectory without grep'ing the run log. */
1670
+ * can see the trajectory without grep'ing the run log. The
1671
+ * name is kept as `previousSlopIndex` for backward compat with
1672
+ * telemetry consumers, but the value is the previous
1673
+ * aiSlopScore (since v0.21: lower = cleaner). */
1660
1674
  previousSlopIndex?: number;
1661
1675
  /** v0.14.5j — ISO timestamp of the previous run, paired with
1662
1676
  * previousSlopIndex so the delta line can say "vs 2026-06-27". */
@@ -1729,6 +1743,16 @@ declare function runCli({ start }: {
1729
1743
 
1730
1744
  declare function thresholdExceeded(report: ProjectReport, config: ResolvedConfig): boolean;
1731
1745
  declare function failedThresholdCount(report: ProjectReport, config: ResolvedConfig): number;
1746
+ /**
1747
+ * v0.42.0 (user-review fix): failedThresholdCount() returned just the
1748
+ * count. The CLI then printed "{n} threshold(s) failed. See details
1749
+ * above." — but in --brief the user sees only the headline CI gate
1750
+ * ("AI Slop Score <= 15 -> fail"), not the per-threshold list.
1751
+ *
1752
+ * This function returns the actual list of failed threshold names so
1753
+ * the caller can name them in the final error message.
1754
+ */
1755
+ declare function failedThresholds(report: ProjectReport, config: ResolvedConfig): string[];
1732
1756
  declare function baselineStatusMessage(baseline: BaselineMeta): string;
1733
1757
  interface StagedGatingResult {
1734
1758
  failed: boolean;
@@ -1776,4 +1800,4 @@ declare function formatBadge(report: ProjectReport): string;
1776
1800
  /** Render an array of values as a Unicode sparkline (▁▂▃▄▅▆▇█). */
1777
1801
  declare function formatSparkline(values: number[]): string;
1778
1802
 
1779
- export { AI_SECURITY_NUMERIC, type AiDebt, type AiMaintenanceCost, type AiMaintenanceCostResult, type AstroComponentFact, type AutoRelaxedRule, type AutoTunedRule, type BaselineCache, type BaselineMeta, type CachedFile, type Category, type ClassNameFact, type ClusterInput, type ClusterParamOverrides, type ClusterParams, type CommentFact, type ComponentFacts, type ComponentScore, type ComponentSizeFact, type CompositeRule, type CompositeRuleEntry, type ConsoleCallFact, type Constitution, DEFAULT_CONFIG, type DangerouslySetInnerHtmlFact, type DbDriftLevel, type DbFinding, type DialogCallFact, type DisabledLintRuleFact, type DocDriftLevel, type DocFinding, type DomQueryFact, type ElementFact, type EvalCallFact, type ExplicitAnyFact, type FetchCallFact, type FileScanResult, type FixSuggestion, type FlywheelOutput, type FlywheelState, type Framework$1 as Framework, type HealthFile, type HookCallFact, type HookDependencyArrayFact, type HookFact, type ImportFact, type InlineEventHandlerFact, type Issue, type JsxAttributeStringLiteralFact, type JsxTextLiteralFact, type KeyPropFact, type LogicalExpressionFact, type MagicNumberSpacingConfig, type MaintenanceAxes, type MaintenanceAxisHealth, type NonNullAssertionFact, type OptimisticUpdateFact, type ProjectReport, type PropMutationFact, type PropPassThroughFact, REPOSITORY_HEALTH_WEIGHTS, type ReportReadResult, type RepositoryHealth, type RepositoryHealthInputs, type ResearchMetrics, type ResolvedConfig, type Rule, type RuleContext, type RuleSeverity, type RuleSuggestion, type ScanCache, type ScanFacts, type ScanProjectOptions, type ScanSelfScanConfig, type Severity, type SlopAuditRun, type StateBinding, type StateBindingFact, type StringLiteralFact, type StylePropFact, type TamaguiStylePropFact, type TopOffender, type UseEffectBodyFact, VERSION, baselineStatusMessage, colorForSlop, failedThresholdCount, filterByDisabledDirectives, filterIssues, formatBadge, formatReportFromFile, formatSparkline, loadConfig, readReportFile, runCli, runInitWizard, scanProject, serializeConfig, stagedGating, thresholdExceeded };
1803
+ export { AI_SECURITY_NUMERIC, type AiDebt, type AiMaintenanceCost, type AiMaintenanceCostResult, type AstroComponentFact, type AutoRelaxedRule, type AutoTunedRule, type BaselineCache, type BaselineMeta, type CachedFile, type Category, type ClassNameFact, type ClusterInput, type ClusterParamOverrides, type ClusterParams, type CommentFact, type ComponentFacts, type ComponentScore, type ComponentSizeFact, type CompositeRule, type CompositeRuleEntry, type ConsoleCallFact, type Constitution, DEFAULT_CONFIG, type DangerouslySetInnerHtmlFact, type DbDriftLevel, type DbFinding, type DialogCallFact, type DisabledLintRuleFact, type DocDriftLevel, type DocFinding, type DomQueryFact, type ElementFact, type EvalCallFact, type ExplicitAnyFact, type FetchCallFact, type FileScanResult, type FixSuggestion, type FlywheelOutput, type FlywheelState, type Framework$1 as Framework, type HealthFile, type HookCallFact, type HookDependencyArrayFact, type HookFact, type ImportFact, type InlineEventHandlerFact, type Issue, type JsxAttributeStringLiteralFact, type JsxTextLiteralFact, type KeyPropFact, type LogicalExpressionFact, type MagicNumberSpacingConfig, type MaintenanceAxes, type MaintenanceAxisHealth, type NonNullAssertionFact, type OptimisticUpdateFact, type ProjectReport, type PropMutationFact, type PropPassThroughFact, REPOSITORY_HEALTH_WEIGHTS, type ReportReadResult, type RepositoryHealth, type RepositoryHealthInputs, type ResearchMetrics, type ResolvedConfig, type Rule, type RuleContext, type RuleSeverity, type RuleSuggestion, type ScanCache, type ScanFacts, type ScanProjectOptions, type ScanSelfScanConfig, type Severity, type SlopAuditRun, type StateBinding, type StateBindingFact, type StringLiteralFact, type StylePropFact, type TamaguiStylePropFact, type TopOffender, type UseEffectBodyFact, VERSION, baselineStatusMessage, colorForSlop, failedThresholdCount, failedThresholds, filterByDisabledDirectives, filterIssues, formatBadge, formatReportFromFile, formatSparkline, loadConfig, readReportFile, runCli, runInitWizard, scanProject, serializeConfig, stagedGating, thresholdExceeded };
package/dist/index.d.ts CHANGED
@@ -1155,9 +1155,8 @@ type AiDebt = 'low' | 'medium' | 'high' | 'critical';
1155
1155
  declare const AI_SECURITY_NUMERIC: Record<'low' | 'medium' | 'high' | 'critical', number>;
1156
1156
  /** Inputs to the pure `buildRepositoryHealth` function. Every input is optional. */
1157
1157
  interface RepositoryHealthInputs {
1158
- /** v0.15.0 U.4+: 0-100, higher = better. The new headline score
1159
- * that replaces slopIndex. Tests and callers should pass this
1160
- * going forward. */
1158
+ /** v0.21.0: 0-100, lower = better (raw amount of slop).
1159
+ * Replaces the v0.15-v0.20.1 inverted cleanliness reading. */
1161
1160
  aiSlopScore?: number;
1162
1161
  /** v0.15.0 U.4+: 0-100, higher = better. */
1163
1162
  engineeringHygiene?: number;
@@ -1401,15 +1400,15 @@ interface ProjectReport {
1401
1400
  generatedAt: string;
1402
1401
  configPath?: string;
1403
1402
  /**
1404
- * v0.20.0: renamed from `aiSlopScore` to `aiSlopScore` because the
1405
- * old name implied a property of the *code* (quality) when it
1406
- * actually measures a property of the *tool's detection* (how
1407
- * many AI-detection rules fire on this codebase). 0-100, higher
1408
- * is better — but 'better' means 'fewer rule fires', not
1409
- * 'higher quality code'. The name "AI Slop Score" matches the
1410
- * existing description ("measures AI-slop signatures") and the
1411
- * slopbrick brand. See the pre-publish checklist in
1412
- * CONTRIBUTING.md for the full rationale.
1403
+ * v0.21.0: 0-100, **lower = better** (raw amount of slop).
1404
+ * The CI gate is `aiSlopScore <= meanSlop` (where meanSlop defaults
1405
+ * to 30). Higher values mean more AI-detection rules fired on this
1406
+ * codebase. The previous v0.15-v0.20.1 reading inverted this to
1407
+ * "cleanliness" (higher = better), which made the JSON output and
1408
+ * the CLI gate disagree. This field has been lower-is-better
1409
+ * since v0.21.0; the JSDoc that said "0-100, higher is better"
1410
+ * was a stale v0.15-era comment that survived past the inversion.
1411
+ * Fixed in v0.42.0.
1413
1412
  */
1414
1413
  aiSlopScore: number;
1415
1414
  engineeringHygiene: number;
@@ -1578,6 +1577,18 @@ interface ProjectReport {
1578
1577
  p90Slop: number;
1579
1578
  individualSlopThreshold: number;
1580
1579
  };
1580
+ /**
1581
+ * v0.42.0 (user-review fix): names of thresholds that tripped in this
1582
+ * scan. Optional for backward compat with v0.41 and earlier reports.
1583
+ * Empty/undefined means all gates passed.
1584
+ *
1585
+ * Possible values: 'meanSlop', 'p90Slop', 'individualSlopThreshold',
1586
+ * 'category:<name>' (per-category thresholds).
1587
+ *
1588
+ * CI consumers can grep this field directly instead of parsing the
1589
+ * stderr message. See threshold.ts#failedThresholds for source.
1590
+ */
1591
+ failedThresholds?: string[];
1581
1592
  /** Research/flywheel snapshot — present when the flywheel directory has artifacts. */
1582
1593
  research?: ResearchMetrics;
1583
1594
  topOffenders?: TopOffender[];
@@ -1654,9 +1665,12 @@ interface ProjectReport {
1654
1665
  /** v0.14.5i — Number of distinct rules marked defaultOff. The ratio
1655
1666
  * suppressedCount / defaultOffRuleCount is the calibration coverage. */
1656
1667
  defaultOffRuleCount?: number;
1657
- /** v0.14.5j — The previous run's Slop Index, if any. Used by
1668
+ /** v0.14.5j — The previous run's value, if any. Used by
1658
1669
  * formatPretty to render a "±N from last run" delta so the user
1659
- * can see the trajectory without grep'ing the run log. */
1670
+ * can see the trajectory without grep'ing the run log. The
1671
+ * name is kept as `previousSlopIndex` for backward compat with
1672
+ * telemetry consumers, but the value is the previous
1673
+ * aiSlopScore (since v0.21: lower = cleaner). */
1660
1674
  previousSlopIndex?: number;
1661
1675
  /** v0.14.5j — ISO timestamp of the previous run, paired with
1662
1676
  * previousSlopIndex so the delta line can say "vs 2026-06-27". */
@@ -1729,6 +1743,16 @@ declare function runCli({ start }: {
1729
1743
 
1730
1744
  declare function thresholdExceeded(report: ProjectReport, config: ResolvedConfig): boolean;
1731
1745
  declare function failedThresholdCount(report: ProjectReport, config: ResolvedConfig): number;
1746
+ /**
1747
+ * v0.42.0 (user-review fix): failedThresholdCount() returned just the
1748
+ * count. The CLI then printed "{n} threshold(s) failed. See details
1749
+ * above." — but in --brief the user sees only the headline CI gate
1750
+ * ("AI Slop Score <= 15 -> fail"), not the per-threshold list.
1751
+ *
1752
+ * This function returns the actual list of failed threshold names so
1753
+ * the caller can name them in the final error message.
1754
+ */
1755
+ declare function failedThresholds(report: ProjectReport, config: ResolvedConfig): string[];
1732
1756
  declare function baselineStatusMessage(baseline: BaselineMeta): string;
1733
1757
  interface StagedGatingResult {
1734
1758
  failed: boolean;
@@ -1776,4 +1800,4 @@ declare function formatBadge(report: ProjectReport): string;
1776
1800
  /** Render an array of values as a Unicode sparkline (▁▂▃▄▅▆▇█). */
1777
1801
  declare function formatSparkline(values: number[]): string;
1778
1802
 
1779
- export { AI_SECURITY_NUMERIC, type AiDebt, type AiMaintenanceCost, type AiMaintenanceCostResult, type AstroComponentFact, type AutoRelaxedRule, type AutoTunedRule, type BaselineCache, type BaselineMeta, type CachedFile, type Category, type ClassNameFact, type ClusterInput, type ClusterParamOverrides, type ClusterParams, type CommentFact, type ComponentFacts, type ComponentScore, type ComponentSizeFact, type CompositeRule, type CompositeRuleEntry, type ConsoleCallFact, type Constitution, DEFAULT_CONFIG, type DangerouslySetInnerHtmlFact, type DbDriftLevel, type DbFinding, type DialogCallFact, type DisabledLintRuleFact, type DocDriftLevel, type DocFinding, type DomQueryFact, type ElementFact, type EvalCallFact, type ExplicitAnyFact, type FetchCallFact, type FileScanResult, type FixSuggestion, type FlywheelOutput, type FlywheelState, type Framework$1 as Framework, type HealthFile, type HookCallFact, type HookDependencyArrayFact, type HookFact, type ImportFact, type InlineEventHandlerFact, type Issue, type JsxAttributeStringLiteralFact, type JsxTextLiteralFact, type KeyPropFact, type LogicalExpressionFact, type MagicNumberSpacingConfig, type MaintenanceAxes, type MaintenanceAxisHealth, type NonNullAssertionFact, type OptimisticUpdateFact, type ProjectReport, type PropMutationFact, type PropPassThroughFact, REPOSITORY_HEALTH_WEIGHTS, type ReportReadResult, type RepositoryHealth, type RepositoryHealthInputs, type ResearchMetrics, type ResolvedConfig, type Rule, type RuleContext, type RuleSeverity, type RuleSuggestion, type ScanCache, type ScanFacts, type ScanProjectOptions, type ScanSelfScanConfig, type Severity, type SlopAuditRun, type StateBinding, type StateBindingFact, type StringLiteralFact, type StylePropFact, type TamaguiStylePropFact, type TopOffender, type UseEffectBodyFact, VERSION, baselineStatusMessage, colorForSlop, failedThresholdCount, filterByDisabledDirectives, filterIssues, formatBadge, formatReportFromFile, formatSparkline, loadConfig, readReportFile, runCli, runInitWizard, scanProject, serializeConfig, stagedGating, thresholdExceeded };
1803
+ export { AI_SECURITY_NUMERIC, type AiDebt, type AiMaintenanceCost, type AiMaintenanceCostResult, type AstroComponentFact, type AutoRelaxedRule, type AutoTunedRule, type BaselineCache, type BaselineMeta, type CachedFile, type Category, type ClassNameFact, type ClusterInput, type ClusterParamOverrides, type ClusterParams, type CommentFact, type ComponentFacts, type ComponentScore, type ComponentSizeFact, type CompositeRule, type CompositeRuleEntry, type ConsoleCallFact, type Constitution, DEFAULT_CONFIG, type DangerouslySetInnerHtmlFact, type DbDriftLevel, type DbFinding, type DialogCallFact, type DisabledLintRuleFact, type DocDriftLevel, type DocFinding, type DomQueryFact, type ElementFact, type EvalCallFact, type ExplicitAnyFact, type FetchCallFact, type FileScanResult, type FixSuggestion, type FlywheelOutput, type FlywheelState, type Framework$1 as Framework, type HealthFile, type HookCallFact, type HookDependencyArrayFact, type HookFact, type ImportFact, type InlineEventHandlerFact, type Issue, type JsxAttributeStringLiteralFact, type JsxTextLiteralFact, type KeyPropFact, type LogicalExpressionFact, type MagicNumberSpacingConfig, type MaintenanceAxes, type MaintenanceAxisHealth, type NonNullAssertionFact, type OptimisticUpdateFact, type ProjectReport, type PropMutationFact, type PropPassThroughFact, REPOSITORY_HEALTH_WEIGHTS, type ReportReadResult, type RepositoryHealth, type RepositoryHealthInputs, type ResearchMetrics, type ResolvedConfig, type Rule, type RuleContext, type RuleSeverity, type RuleSuggestion, type ScanCache, type ScanFacts, type ScanProjectOptions, type ScanSelfScanConfig, type Severity, type SlopAuditRun, type StateBinding, type StateBindingFact, type StringLiteralFact, type StylePropFact, type TamaguiStylePropFact, type TopOffender, type UseEffectBodyFact, VERSION, baselineStatusMessage, colorForSlop, failedThresholdCount, failedThresholds, filterByDisabledDirectives, filterIssues, formatBadge, formatReportFromFile, formatSparkline, loadConfig, readReportFile, runCli, runInitWizard, scanProject, serializeConfig, stagedGating, thresholdExceeded };