fighting slop with slop - Vaibhav Gupta, Boundary
Engineering teams can build stable, complex systems without traditional code reviews by implementing thoughtful architectural constraints, AI-driven tooling,...
By Sean WeldonFighting Slop with Slop: Architectural Constraints and Agent-Driven Development as Alternatives to Code Review
Abstract
This paper examines a paradigm shift in software engineering that eliminates traditional code review processes while maintaining system stability through architectural constraints, automated tooling, and language-level guarantees. The central thesis posits that slop - defined as unread code - is inevitable in modern codebases, and engineering teams should embrace this reality by implementing compiler-enforced invariants rather than relying on human oversight. The methodology employs an invariant-based architecture specification (Architecture.md), agent-driven testing frameworks that continuously generate and evaluate programs, and a purpose-built programming language (BAML) designed for AI-first development. Key findings demonstrate that automated constraint enforcement, exhaustive error handling at the type system level, and zero-cost execution tracing enable teams to scale development velocity while maintaining architectural integrity. The practical implications suggest a fundamental shift toward agent-augmented workflows supported by languages and tools designed for machine verifiability rather than human comprehension.
1. Introduction
Traditional software engineering relies heavily on code review as a quality assurance mechanism, operating under the assumption that human inspection of code changes prevents defects and maintains architectural coherence. However, this paradigm faces increasing challenges as codebases grow in complexity and development teams adopt AI-assisted coding tools that generate code at speeds exceeding human reading capacity. The fundamental problem addressed in this research is whether engineering organizations can maintain system stability and quality without human code review, instead relying on architectural constraints and automated verification systems.
The concept of slop - any code that remains unread by human developers - serves as the central framework for this analysis. As noted in the source material, "this is the least amount of slop that your code base will ever have," acknowledging that unread code accumulates inevitably over time. Rather than treating slop as a failure state to be eliminated through more rigorous review processes, this approach accepts it as inevitable and constructs systems that function correctly despite its presence. The research demonstrates that thoughtful architectural design, combined with language-level guarantees and AI-driven testing, can replace human code review while enabling parallel development workflows and heterogeneous tooling choices.
This synthesis examines the technical mechanisms enabling code-review-free development across four domains: invariant-based architecture specifications that provide stable reference points for AI agents, design documentation practices that shift quality gates upstream from implementation to planning, automated dependency management that prevents architectural violations, and agent-driven quality assurance systems that continuously test and evaluate code correctness. The analysis concludes by examining foundational language design problems and the principles underlying agent-first programming languages.
2. Background and Related Work
Code review has served as a cornerstone of software quality assurance for decades, premised on the belief that human inspection identifies defects, enforces coding standards, and maintains architectural coherence. However, this model assumes that reviewers comprehensively read and understand submitted code - an assumption that breaks down as codebases scale and AI-generated code becomes prevalent. The observation that "code is a matter of trust" highlights the fundamental challenge: traditional review processes attempt to build trust through human inspection, but this mechanism cannot scale when code generation outpaces human reading capacity.
The concept of architectural invariants - unchanging rules that govern system structure - provides an alternative quality assurance mechanism. Rather than verifying correctness through human inspection, invariant-based systems encode architectural rules in machine-verifiable formats, enabling automated enforcement through compilation and continuous integration processes. This approach parallels the evolution of CI/CD adoption, which initially imposed a three-month productivity penalty before enabling sustained velocity increases. Similarly, the transition from human code review to automated constraint enforcement requires upfront investment in tooling and process redesign.
The emergence of large language models capable of generating, testing, and debugging code introduces new possibilities for software development workflows. However, existing programming languages were designed for human productivity rather than agent productivity. Languages like TypeScript contain "slop baked into the language," including problematic features like string coercion in sort functions and complex type coercion rules that create unpredictable behavior. This mismatch between language design assumptions and agent capabilities necessitates either extensive agent training on human-centric language quirks or the development of new languages designed from first principles for agent-first development.
3. Core Analysis
3.1 Invariant-Based Architecture Specification
The foundation of code-review-free development rests on the Architecture.md file, a small, unchanging document describing compiler layers that serves as a stable reference point for all AI models. Unlike traditional architecture documentation that attempts to capture current system state and becomes outdated rapidly, this specification contains only invariant information - structural rules that remain constant for months or years. This design choice directly addresses the agent comprehension problem: by providing a compact, stable reference, the system ensures that AI tools can understand architectural constraints without processing extensive documentation or inferring rules from code inspection.
The implementation enforces these invariants through multiple mechanisms. Agents are required to communicate with at least one other person when navigating deeper into compiler layers, introducing deliberate friction that prevents rapid accumulation of architectural violations. This human-in-the-loop requirement serves not as a traditional review gate but as a velocity limiter that creates opportunities to catch issues before they propagate. The architecture remained stable for three to four months through this automated enforcement approach, demonstrating that machine-verifiable constraints can maintain structural integrity without continuous human oversight.
3.2 Design Documentation as Primary Quality Gate
The principle that "code can be slop, writing cannot" represents a fundamental inversion of traditional quality assurance priorities. Rather than scrutinizing implementation details, this approach holds design documentation to rigorous standards while accepting that code itself may go unread. The methodology employs a custom design documentation tool that replaces general-purpose platforms like Notion and GitHub with purpose-built functionality including versioning, commenting, and Slack integration.
The Slack integration mechanism proved particularly effective, with design doc update notifications becoming the most popular company channel and driving organic code review through visibility rather than mandatory process. More significantly, the requirement to read design documents before shipping them eliminated low-quality submissions through a self-selection mechanism: authors who recognized their designs were inadequate declined to submit rather than face scrutiny. This upstream quality gate proved more effective than downstream code review because architectural decisions are easier to evaluate and modify during the design phase than after implementation.
3.3 Automated Dependency Management and Constraint Enforcement
The dependency graph visualization tool provides semantic boundary enforcement at the package level, displaying both internal and external dependencies while highlighting violations of architectural constraints. Unlike traditional dependency analysis tools that merely report current state, this system employs CLI tools that guarantee invariants cannot be broken during development. The CI/CD pipeline catches leaky dependencies and architectural violations in commit history, providing continuous verification that supplements local development checks.
This automated enforcement mechanism enables agents to identify when new packages or dependencies violate architectural constraints without human interpretation of complex architectural rules. The system operates on semantic boundaries rather than individual code files, allowing agents to reason about architecture at an appropriate level of abstraction. The practical result is architectural stability maintained through compiler and tooling enforcement rather than human vigilance, reducing the cognitive load on developers while increasing reliability.
3.4 Agent-Driven Testing and Quality Assurance
The agent-driven testing loop represents a novel approach to quality assurance that replaces human code inspection with continuous automated evaluation. Agents continuously create BAML programs, execute them, and inspect entire Claude transcripts for tool usage and outcomes. This inspection process evaluates multiple dimensions: correctness of results, efficiency measured by tool call counts, and subjective qualities termed "taste" - identifying issues that humans might overlook during manual review.
The methodology enables A/B testing of language features deterministically by measuring tool calls, error rates, and correctness to data-drive design decisions. This empirical approach to language design contrasts sharply with traditional methods that rely on designer intuition or small-scale user studies. Humans collaborate with agents to distinguish genuine issues from hallucinations, then agents create and implement fixes, closing the feedback loop. The practical demonstration includes an engineer building a partial C compiler purely in BAML, illustrating capability expansion when code reading requirements are eliminated and agents can focus on higher-level architectural concerns.
4. Technical Insights
4.1 Language Design for Agent-First Development
The analysis identifies fundamental problems in existing programming languages that impede agent productivity. TypeScript, designed for human productivity, contains numerous features that create unpredictable behavior for agents: string coercion in sort functions, complex type coercion rules, and inadequate error handling mechanisms. The observation that JavaScript represents "a broken foundation layered with CoffeeScript, TypeScript, and other patches instead of redesigning from first principles" highlights a critical limitation: languages optimized for human developers require agents to learn and work around accumulated design compromises.
BAML addresses these limitations through several agent-first features. Error types are inferred automatically without manual annotation - a divide function is automatically marked as throwing division-by-zero errors, and calling functions inherit error types without explicit declaration. Exhaustive error handling guarantees ensure the compiler proves all errors are either caught or explicitly propagated, eliminating unknown error paths that force agents to implement defensive programming through nested try-catch blocks. This approach shifts error handling verification from runtime to compile-time, providing stronger guarantees with less code.
4.2 Cross-Language Interoperability and Execution Tracing
BAML functions achieve interoperability across Python, TypeScript, Rust, Go, Ruby, and Java with full type safety, supporting advanced features including lambdas, generics, and closures across language boundaries. This capability addresses a critical limitation in agent-driven development: the inability to reliably reason about behavior when crossing language boundaries. The implementation ensures "the type system never lies," providing agents with reliable semantic information regardless of the target execution environment.
Zero-cost execution tracing represents another foundational design choice that enables agent-driven debugging and optimization. Unlike traditional tracing systems that impose runtime overhead, BAML's tracing is built from first principles to have negligible performance impact. Agents can navigate execution traces to identify bugs and inefficiencies without concerns about production performance degradation. This capability, combined with semantic code search that returns docstrings, source code, and usage locations in a single tool call, provides agents with comprehensive code understanding without requiring full codebase reading.
4.3 CLI Generation and Deployment Automation
Every BAML function becomes immediately available as a CLI command with type-safe parameters, enabling agents to test functionality without reading implementation code. This design choice dramatically reduces the friction between code understanding and execution: agents can invoke functions, observe behavior, and reason about correctness without parsing source code. The CLI tools are packable into standalone binaries targeting any architecture including WASM, eliminating deployment friction across platforms and enabling consistent execution environments.
The practical implication is that agents can treat the entire codebase as a collection of callable, testable functions rather than text to be parsed and interpreted. This shift from code-as-text to code-as-interface aligns with agent capabilities: LLMs excel at tool usage and result interpretation but struggle with comprehensive code reading at scale. By providing function-level interfaces with complete type information, the system enables agents to work effectively without reading implementation details.
5. Discussion
The findings demonstrate that code review can be replaced by a combination of architectural constraints, automated verification, and agent-driven testing, but this transition requires fundamental changes to development processes, tooling, and programming languages. The observation that building a programming language traditionally requires hundreds of thousands of man-hours but becomes achievable with millions of tokens when supported by AI-driven tooling and testing suggests a broader principle: tasks that require extensive human reading time can be restructured for agent execution when appropriate abstractions and verification mechanisms are in place.
The CI/CD adoption analogy proves instructive for understanding the transition costs and benefits. Organizations that adopted continuous integration experienced an initial three-month productivity decline before achieving sustained velocity increases. Similarly, transitioning from human code review to automated constraint enforcement requires upfront investment in architecture specification, tooling development, and process redesign. However, the long-term benefits include parallel development without coordination overhead, elimination of review bottlenecks, and the ability to leverage agent capabilities for continuous testing and optimization.
Several knowledge gaps remain for future investigation. The research does not quantify the relationship between architecture stability duration and invariant specification granularity - whether more detailed invariants enable longer stability periods or create brittleness that forces more frequent updates. The effectiveness of agent-driven testing across different problem domains remains unexplored; the demonstrated success in compiler development may not generalize to domains with less formal specifications or more subjective quality criteria. Additionally, the human-agent collaboration patterns for distinguishing genuine issues from hallucinations require further study to identify best practices and potential automation opportunities.
The broader implication for software engineering is that the traditional assumption - that code must be human-readable to be maintainable - may be inverted for agent-augmented development. Instead of optimizing for human reading comprehension, future systems may optimize for machine verifiability and agent navigation, with human interaction occurring primarily at the architectural and design documentation levels rather than the implementation level.
6. Conclusion
This analysis demonstrates that traditional code review can be replaced by architectural constraints, automated verification, and agent-driven testing without sacrificing system stability or quality. The key contributions include: (1) the invariant-based architecture specification approach that provides stable reference points for AI agents, (2) the design documentation quality gate that shifts scrutiny upstream from implementation to planning, (3) automated dependency management that enforces architectural constraints through compilation and CI/CD, and (4) agent-driven testing loops that continuously evaluate correctness, efficiency, and code quality.
The practical takeaways for engineering organizations are clear: teams can eliminate code review bottlenecks by investing in machine-verifiable architectural constraints, purpose-built tooling for design documentation and dependency management, and agent-first programming languages that provide strong type system guarantees and zero-cost execution tracing. The type system becomes the "absolute center of truth preventing invariants from entering the codebase," replacing the human code review function with automated verification.
Future applications should explore this approach across diverse problem domains, quantify the relationship between invariant specification and architecture stability, and develop best practices for human-agent collaboration in quality assurance workflows. As AI capabilities continue advancing, the principles demonstrated here - embracing slop while preventing architectural violations through automated enforcement - may become foundational to scalable software development.
Sources
- fighting slop with slop - Vaibhav Gupta, Boundary - Original Creator (YouTube)
- Analysis and summary by Sean Weldon using AI-assisted research tools
About the Author
Sean Weldon is an AI engineer and systems architect specializing in autonomous systems, agentic workflows, and applied machine learning. He builds production AI systems that automate complex business operations.