Building jev-git: Sub-Second Git Reflex Gate in Rust
Screening staged git diffs for leaked secrets, destructive payloads, and AI hallucinations in 80ms using TypeSafe AI Jev System One.
Git hooks typically suffer from two distinct problems:
- Regex linters: Fast, but brittle. They flag dummy test strings as private keys and miss base64-encoded credentials or obfuscated destructive commands.
- Generative LLM reviewers: Context-aware, but take 4 to 8 seconds per commit and cost real money on every staged change.
I built jev-git to provide semantic pre-commit checks with sub-second execution.
+-------------------+ +----------------------+ +---------------------+
| git commit / push | | jev-git (Rust) | | TypeSafe AI (Jev) |
| Staged Git Diff | -----> | Diff Parser & Filter | <----> | /v1/systemone |
+-------------------+ | Blocking ureq Client | | 70-90ms Noul Eval |
+----------------------+ +---------------------+
|
+---> Exit 0: Clean commit allowed
+---> Exit 1: Commit blocked with reason
How It Works
jev-git hooks directly into the Git lifecycle as a standard executable on PATH (git-jev or git jev).
When triggered:
- It gathers staged file changes using
git diff --cached --unified=3. - It strips binary files and vendor directories (
node_modules,target,dist). - It sends the filtered diff payload to TypeSafe AI's Jev model (
jev-latest). - Jev returns a calibrated probability (
Noul) for three specific failure modes:- Hardcoded API credentials or private keys.
- Destructive shell scripts (e.g., unintended deletions, unvalidated system calls).
- Hallucinated or malformed configuration keys.
- If the risk probability exceeds 0.20,
jev-gitprints the exact offending diff hunks and aborts the commit with exit code 1.
The entire round-trip completes in approximately 80ms over standard broadband connections.
Quickstart
Install the single static binary:
# Clone and build
git clone https://github.com/AkashPriyadarshii/jev-git.git
cd jev-git
cargo build --release
cp target/release/git-jev ~/.local/bin/
# Install hook in your repository
git jev install
Now, any standard git commit automatically runs the verification gate:
# Test staged changes on demand
git jev check
# Pipe arbitrary diffs into the gate
git diff HEAD~1 | git jev check
Binary Characteristics
The binary is compiled with Link-Time Optimization (LTO) and stripped:
- Binary size: 1.8MB statically linked.
- Runtime memory: Under 12MB peak RSS.
- Zero daemon processes: Runs once per commit and exits immediately.
More Essays
Building jev-curate: Fast Synthetic Dataset Sifter in Rust
Filtering synthetic training data with TypeSafe AI Jev: streaming JSONL and Parquet rows through calibrated System One gates at 70ms latency with zero memory accumulation. � 5 min
systemsBuilding jev-scout: Zero-Hallucination Crate and Repo Scout
Preventing AI package hallucinations: discovering real crates and GitHub repositories using live registry APIs and TypeSafe Jev speculative fan-out scoring. � 4 min
systemsBuilding jev-seo: Zero-Cost SEO and GEO Search Radar in Rust
Building a subscription-free SEO and Generative Engine Optimization CLI in Rust: scraping DuckDuckGo, validating JSON-LD schemas, and scoring AI citation visibility with TypeSafe Jev System One gates. � 5 min