Docs navigation

Guides / design · Edit on GitHub

rgctl Engineering Design Documents

Audience: Contributors, systems engineers, and maintainers working on rgctl. For the top-level documentation hub, start at docs/README.md.

Every engineering design document in this directory follows the 6-section rgctl architecture standard established by lossless-writeback-architecture.md:

  1. System Overview & End-to-End Data Flow (ASCII architecture pipeline)
  2. Theoretical Foundations Mapped to rgctl (Academic / compiler / graph theory origins mapped to exact Rust modules)
  3. Binary Layout, Data Structures & Memory Discipline (Exact byte layouts, .rgctl/ sidecars, complexity, and content_digest invalidation rules)
  4. CLI Contract, JSON Schema & Implementation Map (Verified CLI invocations, JSON schemas, and source file tables)
  5. Performance Guardrails & Verification Checklist (Ingest hot-path invariants, unit/integration tests, Criterion benchmarks, and Cold Profile Gates)
  6. Known Limitations & By-Design Boundaries (Explicit soundness and scope boundaries)

Core Architecture Specifications

Architecture DocumentScope
Graph Storage & Extraction ArchitectureRGCL v2 (136B header, 64B NodeRow, 40B EdgeRow), SegmentedSpill external sort, ColdMetadataDb (NodeExtension + 14B Green span tail), RBPK parked relations, RGCS v2 / RGCT v1 lossless sidecars, and DeltaSegment compaction.
Graph Analysis, CPG & Reachability Architecture3-tier memory model, StructuralTopology / CodeGraphCsr / FlatGraphIndex, verified centrality & HyperBall constants, Fast-Leiden communities, SCC blast radius, and the v3 cfg_pdg.archive.bin archive.
Workspace Code StructureCrate dependency graph, layer responsibilities, CLI command dispatch map, and .rgctl/ artifact inventory.

Feature & Subsystem Design Documents (docs/design/)

1. Lossless Storage, Diff & CI Governance

FeatureDesign DocumentCLI Entrypoints
Lossless Source Reconstruction & Surgical Write-Backlossless-writeback-architecture.mdrgctl discover --lossless, rgctl writeback verify|export|patch
Columnar Graph Snapshot Diffgraph-diff-design.mdrgctl diff, rgctl review paths|check
CI Policy Checks & Temporal PR Reviewci-policy-checks-design.mdrgctl check, rgctl review paths|check|export

2. Intra-Procedural Compiler IR, Hybrid CPG & Security

FeatureDesign DocumentCLI Entrypoints
Control-Flow Graph (CFG) & v3 Archivecfg-design.mdrgctl discover --with-cfg, rgctl inspect <symbol> cfg
Dominance & Post-Dominance Treesdominance-design.mdrgctl inspect <symbol> dom [--frontiers]
Program Dependence Graph (PDG) & Dataflowpdg-design.mdrgctl inspect <symbol> pdg, rgctl discover --with-dfg-loops
Intra- & Inter-Procedural Program Slicingprogram-slicing-design.mdrgctl slice <file> --line <N> --variable <V> [--with-alias]
Hybrid Code Property Graph (CPG)hybrid-cpg-plan.mdrgctl cpg status|function|calls|mutations|flows|pdg|slice|ast|export
Taint Analysis & OSV/OpenVEX Reachabilitytaint-analysis-design.mdrgctl taint --sink, rgctl slice --taint, rgctl vuln triage|analyze, rgctl deps check
Threat-Model Generation & STRIDE Synthesisthreat-model-generation.mdrgctl vuln threat-model (vuln surface), /rgctl:vuln Mode C

3. Macro Graph Analytics, Migration, Clones, Search & UI

FeatureDesign DocumentCLI Entrypoints
Blast Radius & Kosaraju SCC Reachabilityblast-radius-design.mdrgctl blast-radius <symbol> [--depth N] [--summary] [--with-slices]
Graph Centrality & Network Metricsgraph-metrics-design.mdrgctl metrics [--pagerank] [--betweenness] [--communities] [--churn]
Fast-Leiden Community Detection & Namingcommunity-query-and-naming-plan.mdrgctl communities list|label, rgctl inventory --by community
Software Migration Planner & Censusmigration-planner-design.mdrgctl discover --with-harmonic --export-migration-hints, rgctl inventory --by import-prefix, rgctl find --annotation --show-attributes
Semantic Search & Multi-Signal Late Fusionsemantic-search-design.mdrgctl semantic index|query|distill
Clone Detection (Type-1 Exact, Type-2 Bloom, Type-3/4 SESE+1-WL)clone-detection-design.mdrgctl clones [--mode exact|bloom|fragment]
Universe Dashboard v2 & Local HTTP Serverdashboard-v2.mdrgctl discover --with-universe, rgctl serve [--open] [--watch]

Regenerating Design Screenshots

PNG assets live under docs/images/design/ per feature subdirectory. To regenerate after UI changes:

./scripts/build-dashboard.sh
cargo build --release
rgctl -r /path/to/repo discover --full
rgctl -r /path/to/repo serve --port 8080

DASHBOARD_URL=http://127.0.0.1:8080/ node dashboard/scripts/capture-design-screenshots.mjs
DASHBOARD_URL=http://127.0.0.1:8080/ node dashboard/scripts/capture-migration-screenshots.mjs

Companion Documentation

AudienceDocument
Overview & Feature Tourdocs/Introduction.md
CLI User Guidedocs/user-guide.md
JSON Output Schemasdocs/json-api.md
Academic & Research Foundationsdocs/further-reading.md
Cold Profile Gates & Baselinesdocs/internal/profile.md