Skip to content

estrizal/Recon-AgentLens

Repository files navigation

RECON: AgentLens 🔍

High-Fidelity Forensic Oversight for AI Coding Agents

RECON Impact Map

The Problem: AI agents (Antigravity, Cursor, Claude Code) are moving faster than human cognition. Developers are falling into "Accept-Accept" fatigue—blindly approving complex diffs because auditing them line-by-line is too slow. We are trading codebase integrity for velocity.

The Solution: RECON AgentLens is a native VS Code extension that intercepts agent actions in real-time. It monitors the "Thinking" vs. "Doing" gap by comparing an agent's declared intent (captured from the terminal) with actual direct-to-disk modifications.


🚀 Why RECON?

Standard diff tools and LLM summarizers are passive. RECON is active forensic oversight.

Feature Manual Review Basic LLM Summarizer RECON AgentLens
Interception Passive Passive Active (FS Interposer)
Intent Mapping Mental None Terminal Hooking
AST Awareness Slow Hallucination-prone Deterministic (Tree-sitter)
Local-First Yes Often Cloud-based 100% Local (Gemma)
Drift Detection Hard Impossible Automated

🛠 The Forensic Pipeline

RECON operates through a three-stage automated pipeline that turns raw diffs into actionable insights.

1. The Interposer (Zero-Trust Capture)

RECON doesn't wait for a "save" event. It maintains an in-memory snapshot and uses FileSystemWatcher to catch direct-to-disk writes. This is critical for CLI-based agents like Claude Code or Antigravity that modify files without opening them in the editor.

2. Intent Synthesis (Terminal Intelligence)

By hooking into onDidWriteTerminalData, RECON extracts the agent's "Narration." It identifies what the agent claims it is doing, creating a structured intent object to compare against the actual changes.

graph LR
    A[Agent Action] --> B[Terminal Narration]
    A --> C[File Modification]
    B --> D{RECON Engine}
    C --> D
    D --> E[Impact Map]
    D --> F[Drift Alert]
Loading

3. The Explainer (Context Budgeting)

Instead of feeding an LLM a 1000-line file, RECON uses a "Tight-Window" strategy. It identifies the specific code nodes modified and feeds a local Gemma 2B model only the relevant function signatures and changed lines. This ensures zero latency and high accuracy on consumer hardware.


🧠 Core Philosophy: Solving "Agent Drift"

Agent Drift occurs when an agent solves the primary task but introduces "hallucinated technical debt"—unnecessary refactors, broken imports, or logic that exceeds the stated scope.

RECON treats Intent and Diff as two separate data objects. If the Diff contains logic that wasn't mentioned in the Intent, RECON flags it immediately on the Impact Map.


🚀 Tech Stack

  • Extension: TypeScript / VS Code API
  • Interception: Native FileSystemWatcher + onDidWriteTerminalData
  • UI: WebView + VS Code Design System
  • Local Brain: Gemma 2B (Quantized for 8GB VRAM)
  • Agent Focus: Optimized for Antigravity, Claude Code, and Aider.

🏃 Getting Started

  1. Install: Build the extension (npm run compile).
  2. Launch: Press F5 to open the Extension Development Host.
  3. Activate: Open the Command Palette (Ctrl+Shift+P) and run RECON: Show Impact Map.
  4. Audit: As you run your agent, watch the reports stream in real-time.

🗺 Roadmap

  • Phase 1: The Watcher - Native FS watcher + memory snapshotting.
  • Phase 2: Intent Capture - Terminal data stream interception.
  • Phase 3: The Impact Map - WebView dashboard for live reporting.
  • Phase 4: AST Deep-Dive - Tree-sitter integration for structural analysis.
  • Phase 5: Automated Rollback - One-click reversal of unapproved agent actions.

"The goal isn't to slow the agent down. The goal is to speed the human up to match the agent."

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors