/quality-hbfs

Quality L3 Production medium usage

/quality-hbfs

Overview

/quality-hbfs is a production command in the Quality category of the Prismatic Platform. It implements a Hottest-Bug-First Search algorithm that prioritizes quality issues based on their impact, frequency, recency, and interconnectedness, ensuring that the most damaging defects receive attention first. Rather than addressing quality violations in arbitrary order or by simple severity classification, HBFS applies a multi-factor scoring model that considers how "hot" each issue is in terms of its effect on the overall platform health.

This command operates under the L3 authority level and is executed by the quality-unified-supreme agent. It is part of the platform's 216-command slash command registry, built on the AIAD (Autonomous Intelligence Agent Design) standard. The L3 authority level allows the command to read quality data across all platform applications and compute cross-domain priority scores.

The HBFS algorithm draws from graph-theoretic search strategies and heat-equation models. Each quality issue is modeled as a node in a dependency graph, with edges representing causal relationships (issue A causes or exacerbates issue B). The "heat" of each node combines its intrinsic severity with the propagated heat from its downstream effects, similar to how PageRank aggregates link authority. Issues that directly or indirectly affect many other parts of the system receive the highest heat scores, ensuring that root causes are addressed before symptoms.

Architecture

The HBFS system operates as a three-phase pipeline: data collection, heat computation, and prioritized output.

HBFS Pipeline Architecture

             /quality-hbfs
                   |
          Issue Collector
                   |
         +--------+--------+
         |        |        |
      Quality   Defect   Dependency
      Domains   History   Graph
         |        |        |
         +--------+--------+
                   |
           Heat Calculator
                   |
         +--------+--------+
         |        |        |
      Intrinsic  Propagated  Temporal
      Heat       Heat        Decay
         |        |        |
         +--------+--------+
                   |
          Priority Ranker
                   |
         +--------+--------+
         |        |        |
      Top-K    Category   Domain
      Report   Grouping   Filter
         |        |        |
         +--------+--------+
                   |
           Prioritized Output

Heat Score Components

ComponentWeightCalculation Method
Intrinsic Severity0.30Base severity from quality domain classification
Impact Radius0.25Number of files/modules directly affected
Downstream Propagation0.20Heat propagated from connected downstream issues
Recency0.15More recently introduced issues score higher
Frequency0.10Issues that recur after fixes score higher

Heat Propagation Model

Heat propagates through the issue dependency graph using a damped diffusion equation:

H(node) = intrinsic_heat(node) + damping * sum(H(child) * edge_weight(node, child))

The damping factor (default 0.85) prevents heat from accumulating infinitely in cyclic subgraphs. The system iterates until heat scores converge (typically 3-5 iterations).

Usage

# Show hottest bugs across all domains
/quality-hbfs

# Show top 10 hottest issues
/quality-hbfs --top 10

# Filter to specific quality domain
/quality-hbfs --domain memory-safety

# Show heat scores for specific application
/quality-hbfs --app prismatic_web

# Output in JSON format for tooling integration
/quality-hbfs --format json

# Include heat propagation details
/quality-hbfs --verbose

# Show historical heat trends
/quality-hbfs --history 7d

# Export prioritized list for sprint planning
/quality-hbfs --export ./sprint-quality-backlog.md

# Show only issues above heat threshold
/quality-hbfs --min-heat 0.7

Practical Examples

# Get the single hottest issue to fix right now
/quality-hbfs --top 1 --verbose

# Plan a quality sprint targeting memory safety
/quality-hbfs --domain memory-safety --export ./memory-safety-sprint.md

# Compare current heat map with last week
/quality-hbfs --history 7d --format json --diff

# Find root cause issues (highest downstream propagation)
/quality-hbfs --sort propagation --top 5

# Focus on recently introduced issues
/quality-hbfs --since 24h --sort recency

Options

OptionTypeDefaultDescription
--topinteger20Number of top issues to display
--domainstringallFilter to specific quality domain
--appstringallFilter to specific application
--formatenumtextOutput format: text, json, markdown, csv
--verboseflagfalseInclude heat propagation details
--sortenumheatSort by: heat, severity, recency, propagation, frequency
--min-heatfloat0.0Minimum heat score threshold
--historydurationnoneShow historical heat trends
--sincedurationallFilter to issues introduced within period
--exportpathnoneExport prioritized list to file
--diffflagfalseShow changes from previous analysis
--dampingfloat0.85Heat propagation damping factor
--iterationsinteger10Maximum heat propagation iterations

Execution Flow

Phase 1: Issue Collection

The HBFS system collects all known quality issues from the 13 quality domains. Each issue is annotated with:

  • Location (file, line, module)
  • Domain classification
  • Intrinsic severity (critical, high, medium, low)
  • Introduction date (from git blame)
  • Fix history (has it been fixed and reintroduced?)

Phase 2: Dependency Graph Construction

Issues are connected based on causal relationships:

  • Code Dependency -- Issue in module A affects all modules that depend on A
  • Pattern Correlation -- Issues that consistently co-occur are linked
  • Domain Cascade -- A Dialyzer violation may cascade into memory safety issues

Phase 3: Heat Computation

The heat propagation algorithm runs iteratively:

  1. Initialize each node with its intrinsic heat score
  2. Propagate heat through edges using the damped diffusion equation
  3. Check for convergence (maximum heat change < 0.001)
  4. If not converged, iterate (up to max iterations)

Phase 4: Priority Ranking

Issues are sorted by total heat score (intrinsic + propagated). The output displays the ranked list with heat breakdown, location, suggested fix approach, and estimated effort.

Phase 5: Report Generation

The final output is formatted according to the requested format. Each issue includes actionable information: what it is, why it is hot, where to fix it, and what fixing it would improve.

Integration Points

ComponentIntegration TypeDescription
/quality-gatesData SourceGate results feed into issue collection
/quality-evolveConsumerEvolution uses HBFS to prioritize improvement targets
/quality-unifiedPeerUnified quality view includes HBFS rankings
/quality-enforcePolicyEnforcement policies define intrinsic severity weights
/tech-debtPeerTechnical debt items overlap with quality issues
/verify-patternsData SourcePattern verification results contribute to issue graph
TelemetryMonitoringHBFS computation metrics
Quality GatesEnforcementHBFS scores influence gate strictness

Best Practices

Regular HBFS Analysis

Run /quality-hbfs at the start of each development session to orient work toward the highest-impact improvements. Even a single fix targeting the hottest issue often improves multiple downstream metrics.

Root Cause Focus

Sort by --sort propagation to find root cause issues. Fixing a root cause with high propagation heat often resolves multiple downstream issues simultaneously, providing outsized improvement for the effort invested.

Sprint Planning Integration

Use --export to generate quality improvement backlogs for sprint planning. The heat-sorted list provides a natural priority order that maximizes quality improvement per development hour invested.

Historical Comparison

Regular --history checks reveal whether the heat landscape is improving overall or if new issues are being introduced faster than old ones are fixed. A rising average heat score indicates quality degradation.

Error Handling

Error CodeDescriptionResolution
NO_ISSUES_FOUNDNo quality issues detected (perfect quality)Celebration is appropriate
GRAPH_CYCLE_WARNINGCyclic dependencies in issue graphDamping factor handles cycles; informational only
CONVERGENCE_FAILUREHeat computation did not convergeIncrease --iterations or adjust --damping
DOMAIN_UNAVAILABLEQuality domain data not availableRun quality gates first to generate domain data
HISTORY_UNAVAILABLEHistorical data not found for requested periodEnsure quality DNA is being tracked

Advanced Usage

Custom Heat Models

Override default heat weights for domain-specific prioritization:

# Prioritize performance issues heavily
/quality-hbfs --heat-weights "severity:0.1,impact:0.1,propagation:0.1,recency:0.1,performance:0.6"

Issue Graph Visualization

Export the issue dependency graph for visualization:

/quality-hbfs --export-graph ./issue-graph.dot
dot -Tsvg issue-graph.dot -o issue-graph.svg

Automated Fix Ordering

Pipe HBFS output into quality-evolve for automated fix prioritization:

/quality-hbfs --top 10 --format json | /quality-evolve --from-hbfs --auto-fix

Doctrine Compliance

All commands operate under the NO MERCY, NO DOUBTS doctrine:

  • NO MERCY: Zero tolerance for incomplete execution or quality violations. HBFS ensures the most impactful issues are addressed first.
  • NO DOUBTS: Full investigation before action, evidence-based results. Heat scores are computed from objective metrics, not subjective assessment.

Connect & Contribute

Created by Tomáš Korcak (korczis) | Open Source under GHL