updated 2026-11-26·5 min read
Repository Map & Modules
Inventory of core perron/ library modules, benchmark harnesses, dataset scripts, 14 retrieval baselines, and dataset manifests.
Perron originally started as CausalPath, pitching “causal graph reasoning” and “Program Slicing” before an early audit forced a reality check: static AST call graphs aren’t Pearlian causal DAGs, and symbol-level extraction has zero CFGs or def-use chains. Renaming to perron kept the claims honest and shaped the repo layout too, separating the zero-copy library (perron/) from evaluation harnesses (benchmarks/), dataset scripts (scripts/), and tests (tests/) so importing perron doesn’t pull in heavy benchmark dependencies.
Two other modules exist purely from hitting real walls along the way: perron/polyglot/ (Tree-sitter TypeScript/JavaScript extraction) replaced earlier multi-language stubs (cst.py, which quietly returned empty lists for C++, Java, and Rust), and perron/editor.py exists because sed and git apply kept mangling indentation and failing syntax checks (perron.editor lands 76.7% valid edits with 0.0% syntax errors).
Core Library Modules (perron/)
Core Library Module Inventory (20 primary modules)
| Path | Purpose | Primary Tests |
|---|---|---|
perron/__init__.py | Public API exports (PerronGraph, PersonalizedPageRank, calculate_specificity_scores). | test_graph.py, test_mcp_server.py, test_perron.py |
perron/api.py | High-level drop-in agent API (diffuse_with_provenance). | test_perron.py |
perron/agent.py | Autonomous developer agent loop and Gemma 4 lifecycle manager. | test_agent.py, test_agent_history.py, test_agent_runtime.py, test_integration.py |
perron/backends/ | ModelBackend ABC plus gguf_backend.py, replay.py, transformers_backend.py, vllm_backend.py. | test_agent.py, test_agent_runtime.py, test_patch.py |
perron/cli.py | CLI (perron) for graph indexing, search, AST slicing, and context packing. | test_packaging_and_cli.py |
perron/diffusion.py | Sparse Personalized PageRank power-iteration solver over CSR matrices. | test_adversarial_fuzzer.py, test_boundary_invariants.py, test_perron.py |
perron/editor.py | AST-grounded search-and-replace editor with fuzzy indentation and scope matching. | test_adversarial_fuzzer.py, test_patch.py, test_perron.py |
perron/graph.py | Python AST parser, symbol table extractor, and zero-copy CSR builder. | test_graph.py, test_retriever.py, test_perron.py |
perron/loaders.py | Zero-copy InstanceGraph loaders for pre-indexed SWE-bench Lite multigraphs. | test_integration.py |
perron/matrix.py | Sparse matrix compression, row-normalization, dangling compensation, and memory mapping. | test_boundary_invariants.py, test_perron.py, test_polyglot.py |
perron/mcp_server.py | JSON-RPC 2.0 stdio Model Context Protocol server (perron-mcp). | test_mcp_server.py, test_packaging_and_cli.py |
perron/packer.py | Context-budgeted knapsack subgraph packing engine and hierarchical AST breadcrumbs. | test_boundary_invariants.py, test_perron.py |
perron/patch.py | Unified diff generation, hunk offset handling, and atomic patch application. | test_integration.py, test_patch.py |
perron/polyglot/ | Multi-language registry and Tree-sitter TypeScript/JavaScript AST extractor. | test_graph.py, test_polyglot.py |
perron/retriever.py | Hybrid lexical (BM25) and spectral graph retrieval engine generating p_0. | test_retriever.py |
perron/runner.py | Headless autonomous agent execution driver for benchmarking workflows. | test_agent_runtime.py, test_integration.py |
perron/specificity.py | Decoupled specificity ratio engine with query-directed hub attenuation. | test_baselines_and_ablation.py, test_perron.py |
perron/telemetry/exporter.py | Agent trajectory recorder and dataset compiler for SFT/DPO serialization. | test_integration.py |
perron/tester.py | Targeted pytest locator and runner with process-group timeouts. | test_integration.py, test_perron.py |
perron/worktree.py | Ephemeral git worktree context manager for isolated agent edits. | test_agent_runtime.py, test_integration.py |
Baseline Dispatch (benchmarks/baseline_retrievers.py)
All 14 retrieval baselines share a single interface through RepositoryRetrievalEngine.retrieve_by_name(method_name, query_text, p_0, pi_query, gold_symbol_ids):
- Lexical & prior controls: Okapi BM25 (
retrieve_bm25), BM25 + 1-hop (retrieve_bm25_1hop), dense semantic retrieval (retrieve_dense), prior-only (retrieve_prior_only), and the ground-truth oracle ceiling (retrieve_oracle). - Unnormalized & degree-heuristic walks: Standard PPR (
retrieve_standard_ppr), Aider repo map (retrieve_aider_repomap), hub blocklist + lexical override (retrieve_hub_blocklist_lexical), static degree-discounted matrix (retrieve_static_deg_discount), degree-normalized PPR (retrieve_degree_normalized_ppr), HippoRAG prior scaling (retrieve_hipporag), and query-reweighted PPR (retrieve_query_reweighted_ppr). - Specificity-damped: Perron Static at (
retrieve_perron_static) and Perron Adaptive using query prominence (retrieve_perron).
For the full 14-row toy graph and dev_val breakdown, see Baseline Audit & Diagnostic Ledger.
Benchmarks, Dataset Scripts, and Manifests
Benchmarks and Harnesses (benchmarks/)
- Retrieval & Ablation:
baseline_retrievers.py,run_retrieval_sweep.py,hub_gold_ablation.py,tune_hyperparameters.py. - Evaluation & Gold Parsing:
eval_harness.py,gold_patch_parser.py,run_evaluation.py,run_swebench_lite.py,repair_eval.py. - Profiling & Stats:
profile_csr_scaling.py(1M-node shared-memory profiler),profile_hardware_telemetry.py,stat_engine.py,rigorous_significance_test.py,compute_pareto_frontier.py. - Graph Compilation:
compile_graphs.py,extract_graph.py,diagnostic.py,swebench_loader.py.
Dataset Scripts & Verification (scripts/, tests/)
- Dataset Pipelines:
reconstruct_dataset.py,export_swebench_graphs.py,sanitize_metadata.py,generate_kaggle_notebook.py. - Verification Suites: 40 test files including
test_adversarial_fuzzer.py,test_boundary_invariants.py,test_evaluation_invariants.py,test_polyglot.py, andtest_mcp_server.py.
Dataset Manifests & Splits
| Path | Purpose | Integrity Check |
|---|---|---|
data/swebench_lite_split.json | Disjoint tri-partition: dev_pilot (50), dev_val (100), heldout (150). | SHA-256 verified in tests/test_split_frozen.py |
data/swebench_lite_cache.jsonl | Offline cache of 300 SWE-bench Lite problem statements. | Verified against SWE-bench Lite manifest |
data/strata.json | Deterministic lexical findability strata (Strata A, B, C). | Validated in tests/test_strata.py |
data/real_graphs/requests/ | Zero-copy CSR matrices and symbol table for Requests. | Verified CSR arrays and symbol table |
data/real_graphs/sympy/ | Zero-copy CSR matrices and symbol table for SymPy. | Verified CSR arrays and symbol table |
data_release/gold.jsonl | Canonical gold patch AST ground-truth modifications. | Validated in tests/test_evaluation_invariants.py |