Skip to main content

Module bug_hunter

Module bug_hunter 

Source
Expand description

Proactive Bug Hunting Module

Implements Section 11 of the Popperian Falsification Checklist (BH-01 to BH-15). Provides falsification-driven defect discovery using multiple hunting modes.

§Philosophy

“A theory that explains everything, explains nothing.” — Karl Popper

Bug hunting operationalizes falsification: we systematically attempt to break code, not merely verify it works. Each mode represents a different strategy for falsifying the implicit claim “this code is correct.”

§Modes

  • Falsify: Mutation-based invariant falsification (FDV pattern)
  • Hunt: SBFL without failing tests (SBEST pattern)
  • Analyze: LLM-augmented static analysis (LLIFT pattern)
  • Fuzz: Targeted unsafe Rust fuzzing (FourFuzz pattern)
  • DeepHunt: Hybrid concolic + SBFL (COTTONTAIL pattern)

§Advanced Features (BH-11 to BH-15)

  • Spec-Driven: Hunt bugs guided by specification files
  • Ticket-Scoped: Focus on areas defined by PMAT work tickets
  • Scoped Analysis: –lib, –bin, –path for targeted hunting
  • Bidirectional Linking: Update specs with findings
  • False Positive Suppression: Filter known false positive patterns

§Integration with OIP

These modes leverage OIP’s SBFL (Tarantula/Ochiai/DStar), defect classification, and RAG enhancement to proactively identify bugs before they reach production.

Re-exports§

pub use localization::CrashBucketer;
pub use localization::MultiChannelLocalizer;
pub use localization::ScoredLocation;
pub use patterns::compute_test_lines;
pub use patterns::is_real_pattern;
pub use patterns::should_suppress_finding;
pub use spec::ParsedSpec;
pub use ticket::PmatTicket;

Modules§

blame
Git Blame Integration
cache
Finding cache with mtime-based invalidation for bug-hunter.
config
Bug Hunter Configuration
contracts
Contract Verification Gap Analysis (BH-26)
coverage
Coverage-Based Hotpath Weighting
diff
Bug Hunter Diff Mode
languages
Multi-Language Pattern Support
localization
Advanced Fault Localization Module (BH-16 to BH-20)
model_parity
Model Parity Gap Analysis (BH-27)
patterns
Pattern detection utilities for bug-hunter.
pmat_quality
PMAT Quality Integration for Bug Hunter (BH-21 to BH-25)
spec
Spec-Driven Bug Hunting Module (BH-11, BH-14)
ticket
PMAT Work Ticket Integration (BH-12)

Structs§

ChannelWeights
Multi-channel weights for fault localization (BH-19, BH-21).
Finding
A single bug finding.
FindingEvidence
Evidence supporting a finding.
HuntConfig
Configuration for a bug hunt.
HuntResult
Result of a bug hunt.
HuntStats
Statistics from a bug hunt.
ModeStats
Mode-specific statistics.
PhaseTimings
Phase timing breakdown for bug-hunter pipeline.

Enums§

CrashBucketingMode
Crash bucketing mode (BH-20).
DefectCategory
Category of defect (aligned with OIP categories).
EvidenceKind
Kind of evidence.
FindingSeverity
Severity of a bug finding.
HuntMode
Mode of bug hunting operation.
LocalizationStrategy
Fault localization strategy (BH-16 to BH-19).
SbflFormula
SBFL formula for fault localization.

Functions§

hunt
Run bug hunting with the specified configuration.
hunt_ensemble
Run all modes and combine results (ensemble approach).
hunt_with_spec
Run spec-driven bug hunting (BH-11).
hunt_with_ticket
Run ticket-scoped bug hunting (BH-12).