# fighting slop with slop — Vaibhav Gupta, Boundary

## Executive summary

The talk outlines a strategy for combating 'slop'—sloppy code and processes—by building sophisticated tooling layers on top of stable foundations. Vaibhav Gupta argues that while AI agents accelerate development, the core weakness lies in foundational systems (like JavaScript/TypeScript) lacking sufficient rigidity. The solution involves enforcing strict invariants through advanced type systems (like BAML), automated execution tracing, and specialized tools for design documentation and dependency visualization, allowing complex codebases to ship without requiring manual reading of every line.

## Key takeaways

- Fighting Slop with Invariants: Instead of relying on traditional methods like mandatory code reviews (which are difficult to enforce), the focus must be on building architectural invariants. This includes using dedicated tools for design documentation and CLI scripts that guarantee certain structural rules cannot be broken, even when integrating AI agents.
- The Foundational Layer Bet: To achieve stability at scale, the focus must shift to foundational programming layers. The speaker advocates for systems that use strong type inference and guarantee error handling (e.g., making division by zero impossible) from first principles, rather than patching existing languages.
- Agent-Driven Verification: Advanced tooling allows agents to constantly run over codebases, not just detecting incorrect language usage, but also identifying inefficiencies (e.g., when three tool calls were needed instead of one) and classifying issues as hallucinations or real bugs.

## Technical details

- BAML System: BAML is presented as a system that allows developers to work across multiple languages (Python, TypeScript, Rust) while maintaining strong boundaries around each function. It aims to make whole classes of mistakes impossible by leveraging type systems and inference.
- Execution Tracing: A key technique for understanding code without reading it is generating a full execution trace. This allows developers to visualize exactly how much time was spent on different parts of the program, providing deep insight into performance and bugs.
- Design Documentation Tooling: A specialized design doc tool (replacing Notion/GitHub for this purpose) provides versioning and commenting. The system is backed by Markdown files and simple CLI scripts, enabling agents to interact with the documentation structure.
- Type Safety & Error Handling: The speaker demonstrated how advanced type systems can infer error types (e.g., knowing a function throws 'division by zero') without explicit code, allowing for exhaustive guarantees that errors are handled or proven unthrowable.

## Practical implications

- Implement dedicated tooling for design documentation that enforces versioning and review (Code can be slop, writing cannot).
- Build CLI tools that visualize dependency graphs and guarantee specific architectural invariants are maintained.
- Adopt type-safe systems from first principles to eliminate entire classes of runtime errors and unknowns.
- Use agent loops not just for code generation, but for running constant verification checks (e.g., finding optimal tool call sequences).

## Topics

Software Engineering Practices, AI Agent Tooling, Type Systems, Build Process Optimization, Code Quality and Invariants, Boundary, BAML

Source: https://www.youtube.com/watch?v=AMiyLItEtLA
