# Inside the Dark Factory: AI That Ships Code Solo

## Executive summary

The video details Tessl's 'Dark Factory,' an autonomous system that handles a significant portion of their code shipping (65-70% of PRs). This factory uses AI agents and sophisticated verification layers to process tickets from inception (Linear) through to merge. The core architectural shift involves moving engineering focus from writing code to designing robust, automated workflows, emphasizing context management and layered verification to build trust in autonomous systems.

## Key takeaways

- High Automation Rate: Tessl routes 65-70% of its PRs through the Dark Factory. Historically, up to 95% of their codebase has never been reviewed by a human.
- Shift in Engineering Focus: The role of the engineer shifts from implementing tickets to designing complex workflows, scoping tasks for agents, and encoding organizational 'taste' into verification layers (e.g., whiteboarding conversations).
- Trust is Earned, Not Enabled: Building trust in the Dark Factory requires continuous effort, including running into failure modes and improving verification layers. Accountability remains with the person who filed the original ticket.
- Verification Layers are Key: The most critical component is not the coding agent itself, but the layered verification system (Verifiers) that allow engineers to encode fuzzy principles (e.g., 'library should be the single source of truth') into deterministic checks.

## Technical details

- Dark Factory Architecture: The system uses an Orchestrator (acting as a workflow manager) to pull tickets from Linear, pass them to coding agents running in isolated sandboxes (using Daytona), and manage the PR lifecycle.
- PR Lifecycle Flow: A ticket moves from Linear -> Orchestrator -> Coding Agent (in sandbox) -> GitHub PR. The PR then undergoes automated review cycles involving bots, internal code review agents (e.g., 'Tessl Change Verify'), CI checks, and mutation testing before potentially requiring a human sign-off.
- Verification Mechanisms: Verifiers are natural language statements that resolve to a boolean (Yes/No) about specific code segments. They provide a cheaper, more targeted way to enforce principles than traditional linting or full code review.
- System Failure and Resilience: Early failures included issues like double-counting PR comments in the queue and race conditions. The team addressed this by building a formal model of their behavior using tools like Fable, ensuring zero recurrence.
- Advanced Experimentation: The team attempted to port the entire system's verification layer (excluding unit tests) from Python to Elixir to test for language-agnostic functionality, identifying blind spots in core features like Linear label handling.

## Practical implications

- Focus on improving the context within your repository; this is cited as having more value than swapping underlying LLMs.
- Adopt a layered approach: Start by solidifying behavioral tests (E2E, integration) before attempting full automation.
- Implement Verifiers early to encode organizational 'taste' and principles into code, allowing agents to enforce non-deterministic rules.
- Treat the orchestrator as an integrator between existing tools (e.g., Linear, GitHub Actions) rather than building a monolithic system.

## Topics

AI Agents, Software Factory, DevOps Automation, Code Review Systems, Formal Verification, Workflow Orchestration, Tessl, Tessl agent

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