Skip to main content
The Git backend is a comprehensive Rust module providing repository analysis, commit tracking, and attribution data. This backend powers the transparency layer that makes AI work visible to humans.

Architecture

The git operations module consists of approximately 4,142 lines of Rust code organized into 18 sections, serving as the foundation for work transparency.

Core Functions

The backend exposes 47 Tauri commands for frontend access, organized by functionality:

Status & Diff Operations

  • Repository status tracking
  • File change detection
  • Staged/unstaged classification
  • Diff generation with line-level detail

Commit Operations

  • Commit history retrieval
  • Commit detail extraction
  • Author attribution
  • Graph visualization coordinates

Branch Management

  • Branch listing and grouping
  • Branch creation and switching
  • Branch relationship topology
  • Evolution tracking

Attribution Tracking

  • Line-level blame information
  • Author timeline generation
  • Collaboration event tracking
  • Contribution statistics

Transparency Data Flow

Technology Stack

The backend utilizes:
  • git2: Native Rust git library for local operations
  • Tauri IPC: Frontend-backend communication
  • serde: JSON serialization for data transfer
  • chrono: Time formatting and manipulation
  • git CLI: External operations requiring credentials

API Selection Strategy

Performance Optimizations

Batch API

Single call retrieves all repository data:
  • Status (staged, unstaged, untracked files)
  • Branches (local and remote)
  • Commits (last N commits)
  • Worktrees (all worktrees)
  • Stashes (all stashes)
Result: 5x reduction in IPC overhead

Parsed Diff

Rust backend pre-processes diff data with line type classification, eliminating frontend parsing overhead. Result: 5-10x improvement on large diffs

Time Formatting

Relative time formatting moved from JavaScript to Rust, reducing frontend computation.

THE CENTER

This backend enables transparency by extracting git data and making AI work visible. Without it, the Human-AI feedback loop would be blind, incomprehensible, and broken.