Skip to main content

Module quality

Module quality 

Source
Expand description

Quality gates with rich reporting and fault localization (ML-001 to ML-012) Quality Gates Module (ML-001 through ML-017)

Implements tiered quality gate enforcement following Toyota Production System principles. Gates are configured via .pmat-gates.toml and enforced at three tiers:

  • Tier 1 (ON-SAVE): Sub-second checks (clippy, complexity)
  • Tier 2 (ON-COMMIT): 1-5 minute checks (tests, coverage, SATD)
  • Tier 3 (NIGHTLY): Hours (mutation testing, security audit)

§Features

  • Quality Gates (ML-001 to ML-003): Tiered enforcement with configurable thresholds
  • SBFL Fault Localization (ML-004 to ML-006): Tarantula, Ochiai formulas
  • Oracle ML Classification (ML-007 to ML-010): k-NN classifier, pattern library, drift detection
  • Rich ASCII Reporting (ML-011 to ML-014): Box drawing, sparklines, histograms
  • Control Flow Analysis (ML-015 to ML-017): CFG generation, complexity metrics

§Toyota Way Principles

  • Jidoka (Automation with human touch): ML classifies, human approves
  • Kaizen (Continuous improvement): Learn from fix acceptance
  • Visual Management (Mieruka): Rich ASCII dashboards
  • Genchi Genbutsu (Go and see): SBFL locates actual faults
  • Poka-yoke (Error-proofing): Confidence scores prevent bad fixes

§References

  • BASHRS-SPEC-ML-001: ML-Powered Linting specification
  • Jones & Harrold (2005): Tarantula fault localization
  • Abreu et al. (2007): Ochiai formula
  • McCabe (1976): Cyclomatic complexity
  • Kim et al. (2013): Bug localization with learning-to-rank

Re-exports§

pub use cfg::render_cfg_ascii;
pub use cfg::CfgBuilder;
pub use cfg::CfgEdge;
pub use cfg::CfgNode;
pub use cfg::ComplexityGrade;
pub use cfg::ComplexityMetrics;
pub use cfg::ControlFlowGraph;
pub use gates::GateConfig;
pub use gates::GateResult;
pub use gates::GateSummary;
pub use gates::QualityGate;
pub use gates::Tier;
pub use lint_report::histogram_bar;
pub use lint_report::sbfl_report;
pub use lint_report::ErrorCluster;
pub use lint_report::RichLintReport;
pub use mock_executor::CommandExecutor;
pub use mock_executor::CommandResult;
pub use mock_executor::MockCommandExecutor;
pub use mock_executor::RealCommandExecutor;
pub use oracle::bootstrap_patterns;
pub use oracle::ClassificationResult;
pub use oracle::DriftDetector;
pub use oracle::DriftStatus;
pub use oracle::FeatureVector;
pub use oracle::FixPattern;
pub use oracle::KnnClassifier;
pub use oracle::Oracle;
pub use oracle::ShellErrorCategory;
pub use report::gate_report;
pub use report::sparkline;
pub use report::Grade;
pub use report::ReportBuilder;
pub use report::RichReport;
pub use sbfl::CoverageData;
pub use sbfl::FaultLocalizer;
pub use sbfl::SbflFormula;
pub use sbfl::SuspiciousnessRanking;

Modules§

cfg
Control Flow Graph Generator (ML-015, ML-016, ML-017)
gates
Quality Gate Configuration and Enforcement (ML-001, ML-002, ML-003)
lint_report
Rich Lint Report Module (ML-006, ML-013, ML-014)
mock_executor
Mock Command Executor for Testing Quality Gates
oracle
Oracle ML-Powered Error Classifier (ML-007, ML-008, ML-009, ML-010)
report
Rich ASCII Reporting Module (ML-011, ML-012)
sbfl
Spectrum-Based Fault Localization (ML-004)