Skip to main content

Crate depyler_graph

Crate depyler_graph 

Source
Expand description

DEPYLER-1300: Dependency Graph Analysis for Error Reasoning

This crate transforms the transpiler from a “compiler” into a “reasoning engine” by building dependency graphs that reveal error topology and enable ML-based fixes.

§Architecture

Python Source
    │
    ▼
┌─────────────────┐
│  AST Parser     │
└────────┬────────┘
         │
         ▼
┌─────────────────┐     ┌─────────────────┐
│ Dependency      │────►│ Error Overlay   │
│ Graph Builder   │     │ (Rust Errors)   │
└────────┬────────┘     └────────┬────────┘
         │                       │
         ▼                       ▼
┌─────────────────┐     ┌─────────────────┐
│ Impact Scorer   │◄────│ Vectorized      │
│ (PageRank)      │     │ Failures (JSON) │
└────────┬────────┘     └─────────────────┘
         │
         ▼
┌─────────────────┐
│ Patient Zero    │
│ Identification  │
└─────────────────┘

Structs§

AstContext
AST context around an error
DependencyGraph
The dependency graph structure
ErrorOverlay
Overlays errors onto a dependency graph
FailureContext
Context for failure extraction
FailureLabels
Labels for supervised ML training
GraphAnalysis
Complete analysis result
GraphBuilder
Builder for constructing dependency graphs from Python source
GraphContext
Graph context for an error
GraphEdge
An edge in the dependency graph
GraphNode
A node in the dependency graph representing a Python entity
ImpactScore
Impact score for a node
ImpactScorer
Calculates impact scores for nodes in the graph
OverlaidError
An error overlaid onto the graph
PatientZero
Patient Zero - a node identified as root cause
VectorizedFailure
Vectorized failure ready for ML training

Enums§

EdgeKind
Kind of edge in the dependency graph
GraphError
Errors that can occur during graph analysis
NodeKind
Kind of node in the dependency graph

Functions§

analyze_with_graph
Main entry point for graph-based error analysis
serialize_to_json
Serialize failures to JSON for ML training
serialize_to_ndjson
Serialize failures to NDJSON (newline-delimited JSON) for streaming
vectorize_failures
Vectorize failures from overlaid errors