newsfilter
← Interviews
AI Engineer24 min

Fighting Slop — Ankit Jain, Aviator

Ankit Jain

Conference Presentation, Keynote
  • The speaker's team of nine engineers increased merge volume from 100 to 400 PRs per week (4x growth) within one year.
  • The team's workflow shifted from human-written code with AI assistance to predominantly AI-written code with human assistance.
  • Median time to merge decreased from 2.1 days to 3.4 hours.
  • The number of PR threads and revert rates decreased, while overall quality improved despite "blessed" reviews.

Evolution of Review Strategies and Limitations

  • AI Reviewer Trials:
    • Initial tests revealed that bot comments were frequently "nice-to-haves" or noise, though they did catch some bugs.
    • Human comments on AI-generated code shifted focus from bugs/correctness to architectural decisions.
  • Spec-Driven Development:
    • Attempted in January to review specs instead of diffs to reduce friction.
    • Failed because specs contained assumptions that became stale during implementation.
    • Resulted in "drift" where the final code deviated from the written intent without flags.
  • Self-Review Skills (Internal Agent):
    • Created an internal agent to review code before PR submission.
    • Agents found more bugs than external bots due to codebase-specific context.
    • Failed because findings were lost in session data, and reviewers still had to read diffs after the fact.

Core Philosophy: The Gap in Code Review

  • A 2013 Microsoft study cited shows a 30% gap: 44% of reviewers claim to find bugs, but only 14% of comments are actually about bugs.
  • Code review is primarily for building mental models and knowledge sharing, not bug detection.
  • Human review quality drops significantly beyond 400 lines; median PR size is now over 600 lines due to AI generation.
  • Diffs are identified as a poor review medium because they show what changed but never why.

The Six-Step Review Framework

  • Argue:
    • Two agents (coding and reviewing) with opposing goals argue before a PR exists.
    • The coding agent defends its implementation while the review agent seeks defects.
    • Disagreements, accepted risks, and future follow-ups are explicitly recorded rather than lost in session memory.
  • Capture:
    • Replaces static specs with dynamic "Intent" (why the change exists) and "Acceptance Criteria" (behavioral definitions).
    • Intent and criteria are captured automatically from agent sessions and Jira tickets.
    • Ensures information is not lost or stale, unlike traditional waterfall specs.
  • Codify:
    • Analyzes historical review comments to identify repeated patterns and convert them into rules.
    • From 200 candidate comments, 64 rules were automatically identified and distilled into invariants.
    • Invariants include definition, scope, verification method, provenance, and owner to prevent staleness.
    • 19 of 64 rules were converted into deterministic scripts (e.g., AST grep for timeout checks).
  • Prove:
    • Agents execute a plan to capture evidence against acceptance criteria.
    • Evidence types include screenshots, request/response logs, network activity, AST checks, and test traces.
    • Transforms subjective review into objective, auditable verification steps.
  • Debate:
    • Humans participate primarily in the decision-making layer, not line-by-line code verification.
    • Focuses on settling unresolved agent arguments and reviewing trade-offs/opinions.
    • Decisions outlive the PR, creating a persistent "tribal knowledge" context for future agents.
    • Allows teams to analyze weekly decision patterns to improve future system behavior.
  • Own:
    • Shifts human ownership from specific code lines (which agents write) to the rules and frameworks that verify the code.
    • Teams own the verification systems and invariants to maintain system understanding and prevent "context debt."

Implementation Roadmap and Outcomes

  • Adoption Curve:
    • Month 1: Double workload as teams manually live the rules and validate systems.
    • Month 2: Rules begin filtering changes, reducing the need for manual intervention.
    • Month 3: Intent, evidence, and decisions become more valuable and efficient to review than diffs.
  • Immediate Action Items:
    • Mine the last 1,000 review comments to identify the top 20 recurring issues.
    • Use an agent to convert these top 20 into automated checks.
    • Add these checks to CI to run on every change, shifting focus from reading diffs to reviewing evidence.
  • Key Distinctions:
    • Acceptance Criteria: Defines behavioral changes.
    • Invariants: Define code quality rules and guardrails.
    • Decisions: Record opinions, trade-offs, and reasoning.
    • Evidence: Provides proof of verification.
  • Final Outcome: The team can now show auditors detailed evidence (screenshots, citations) proving system behavior, replacing the traditional diff as the primary review artifact.