Ruby on Rails
Limiting automated code approvals to 150 lines stops agent-generated bloat and forces developers into smaller pull requests, cutting revert rates to 0.5% across 200 daily deployments.
AI-assisted summary of Shipping is your heartbeat: Rails in the agentic era - Ryan Sherlock — original source. Check the original for full context.
Source published:
Key ideas
- Finn (formerly Intercom) deploys its 15-year-old, 5-million-line Rails monolith 200 to 250 times daily, serving peak traffic of 150,000 requests per second and pushing merged code to production in roughly five minutes. (3:00)
- Using Shopify's Rotoscope to map method-level dependencies across 225,000 tests, Finn runs only the specifications relevant to changed files, slashing CI test execution from 7.5 minutes to under 3 minutes and using only 5% of full-suite compute. (8:02)
- Finn's proprietary AI review agent 'Trick' evaluates PRs across five distinct dimensions, autonomously approving 40% of all pull requests with a 0.5% revert rate while cutting merge turnaround from 160 to 36 minutes. (37:12)
- Enforcing a strict 150-line ceiling for automated PR approvals created an emergent socio-technical shift, prompting developers to decompose changes into atomic PRs averaging just 68 lines. (37:12)
Detailed notes
## Background This talk by Ryan Sherlock was published on YouTube by the Ruby on Rails channel on October 1, 2026, with editing and post-production sponsored by Shopify. According to the video description, the session explores how a 15-year-old, five-million-line Rails monolith safely ships over 200 times a day—reaching production traffic within five minutes of merging—through intelligent test selection, bounded automated PR approvals, and rapid deployment and recovery systems.
## TL;DR Ryan Sherlock, Infrastructure and Core Technologies Lead at Finn (formerly Intercom), details the engineering architecture and cultural mindset that allow a massive Ruby on Rails monolith handling 150,000 requests per second to deploy updates roughly every three minutes. To prevent their 225,000-test suite from taking 60 hours to run, the team uses Shopify's Rotoscope profiler for intelligent test selection alongside pre-compiled `bootsnap` and S3 schema caches, bringing test execution under three minutes and build times down to 53 seconds. Sherlock also explains how they manage the surge in AI-generated code via Muster, an internal deployment system that triggers automated five-version rollbacks within 6 to 7 minutes when business-level "heartbeat indicators" detect anomalies. Finally, he introduces "Trick," a proprietary multi-stage AI code review agent trained on historical feedback from top engineers that automatically approves 40% of pull requests (capped at 150 lines), slashing merge times from 160 to 36 minutes with a 0.5% revert rate.
## Atmosphere & style The talk carries a pragmatic, fast-paced, and candid engineering tone, blending deep infrastructure metrics with dry, self-aware humor. Sherlock speaks with the grounded confidence of a practitioner sharing battle-tested lessons—Poking fun at DHH's keynote, comparing compliance audits to legal TV tropes, and affectionately mocking legacy internal UIs and early AI review outputs that read like "love letters to your code." The narrative arc moves from the daunting scale of a 15-year-old monolith to a reassuring sense of mastery, making the audience feel the invigorating pulse of an engineering culture where shipping is effortless, immediate, and fearless.
## Bulletin - [03:00](https://www.youtube.com/watch?v=EBJF55TyCVY&t=180s) Finn (formerly Intercom) deploys its 15-year-old, 5-million-line Rails monolith 200 to 250 times daily, serving peak traffic of 150,000 requests per second and pushing merged code to production in roughly five minutes. - [08:02](https://www.youtube.com/watch?v=EBJF55TyCVY&t=482s) Using Shopify's Rotoscope to map method-level dependencies across 225,000 tests, Finn runs only the specifications relevant to changed files, slashing CI test execution from 7.5 minutes to under 3 minutes and using only 5% of full-suite compute. - [37:12](https://www.youtube.com/watch?v=EBJF55TyCVY&t=2232s) Finn's proprietary AI review agent 'Trick' evaluates PRs across five distinct dimensions, autonomously approving 40% of all pull requests with a 0.5% revert rate while cutting merge turnaround from 160 to 36 minutes. - [37:12](https://www.youtube.com/watch?v=EBJF55TyCVY&t=2232s) Enforcing a strict 150-line ceiling for automated PR approvals created an emergent socio-technical shift, prompting developers to decompose changes into atomic PRs averaging just 68 lines.
## Key takeaways - [00:11](https://www.youtube.com/watch?v=EBJF55TyCVY&t=11s) Software value is realized only when code reaches production customers; every prior stage represents accumulated assumptions and unvalidated work. - [00:11](https://www.youtube.com/watch?v=EBJF55TyCVY&t=11s) Following a rapid pivot to customer service AI agents post-ChatGPT, the company rebranded to Finn and was acquired by Salesforce while operating a lean core stack of Rails, MySQL, Elasticsearch, and React. - [03:00](https://www.youtube.com/watch?v=EBJF55TyCVY&t=180s) Abandoning release trains in favor of continuous merges allows changes to reach production within five minutes, resulting in backend deploys roughly every three minutes. - [08:02](https://www.youtube.com/watch?v=EBJF55TyCVY&t=482s) To manage 225,000 test specs that would take 60 hours sequentially, Finn repurposes Shopify's Rotoscope profiler to build dynamic dependency mappings updated every 30 minutes. - [11:48](https://www.youtube.com/watch?v=EBJF55TyCVY&t=708s) Selective test execution reduced PR suite run times to under three minutes while consuming roughly 5% of the compute required for full test runs. - [14:04](https://www.youtube.com/watch?v=EBJF55TyCVY&t=844s) CI performance is maintained by grouping test parallelization by execution duration rather than file type, precompiling bootsnap caches, and caching database schemas in S3. - [19:06](https://www.youtube.com/watch?v=EBJF55TyCVY&t=1146s) Build pipelines were compressed from 4.5 minutes to 53 seconds by consolidating deploy targets, eliminating unnecessary test artifact packing, and resolving a long-standing asset caching bug. - [24:32](https://www.youtube.com/watch?v=EBJF55TyCVY&t=1472s) Business-level 'heartbeat indicators' monitor core customer interactions, triggering automated 5-version rollbacks that recover production health in 6 to 7 minutes without human intervention. - [27:02](https://www.youtube.com/watch?v=EBJF55TyCVY&t=1622s) Finn rejects tiering deployments by perceived risk, treating every change as high-risk by default and subjecting all PRs to identical automated validation baselines. - [28:43](https://www.youtube.com/watch?v=EBJF55TyCVY&t=1723s) Internal AI code reviewer 'Trick' breaks pull request evaluation into five stages—Problem Statement, Goal, Safety, Logic, and Codebase Practices—distilled from historical senior engineer reviews. - [34:51](https://www.youtube.com/watch?v=EBJF55TyCVY&t=2091s) Automated approval requires strict bounded authority, capping PR size at 150 meaningful lines and blocking changes with detected race conditions or security concerns. - [36:19](https://www.youtube.com/watch?v=EBJF55TyCVY&t=2179s) Compliance rules mandate human-in-the-loop accountability and prohibit autonomous agent loops where an AI approves another AI's pull request without oversight. - [37:12](https://www.youtube.com/watch?v=EBJF55TyCVY&t=2232s) Automating PR approvals reduced median cycle time from 160 minutes to 36 minutes and resulted in a 0.5% revert rate, a tenfold improvement over complex human-reviewed PRs. - [38:31](https://www.youtube.com/watch?v=EBJF55TyCVY&t=2311s) Rapid, automated deployment guardrails counterintuitively improved codebase quality and reduced incidents, proving that high shipping velocity prevents architectural decay rather than causing a 'big ball of mud.'
## Detailed walkthrough ### [00:11](https://www.youtube.com/watch?v=EBJF55TyCVY&t=11s) The Heartbeat of Shipping in the Agentic Era
Ryan Sherlock opens the session in Austin by setting the stage for how a massive, 15-year-old Ruby on Rails monolith containing 5 million lines of code manages to ship roughly 200 times a day—often pushing code into production a mere five minutes after a merge. Reflecting on DHH’s opening keynote about spending five hours recording a podcast in Austin, Ryan humorously notes that he listened to it and will unapologetically keep using the word "automation." The philosophical cornerstone of their engineering culture traces back to a blog post written 13 years prior by Des Traynor, Intercom's second-ever employee and current CTO, who built Intercom's original shipping system. The core thesis is that software value is only realized when it actually reaches customers; everything before that is just an expensive accumulation of hard work and assumptions. This continuous delivery mindset shapes not just how they build products, but how the entire company operates under a guiding loop: every change starts with a hypothesis (take an action), production provides useful evidence, you learn something new, and your next change incorporates those insights.
As the Infrastructure and Core Technologies Lead at Finn (formerly Intercom), Ryan explains that they deliberately rely on a relatively small, tightly-mastered technology stack of about ten core tools: Ruby on Rails, MySQL, Elasticsearch, and React, alongside owning the underlying infrastructure that runs them. Founded in 2011 to help clients deliver exceptional customer experiences, the company underwent a massive transformation when ChatGPT emerged. In roughly a single weekend, they completely pivoted their strategy to build customer service AI agents. Their flagship AI agent, Finn, became such a massive success that they rebranded the entire company around it five months prior, culminating in their acquisition by Salesforce just two weeks before the talk.
- **Core Tech Stack:** Ruby on Rails, MySQL, Elasticsearch, React (~10 core technologies total). - **Company Evolution:** Founded in 2011 as Intercom; pivoted over a single weekend to AI agents post-ChatGPT; rebranded to Finn; acquired by Salesforce two weeks prior to the talk.
---
[03:00](https://www.youtube.com/watch?v=EBJF55TyCVY&t=180s) Scale, Velocity, and the Zero-Release-Train Culture
Operating at scale, Finn runs a fully integrated Rails architecture on Edge browser versions, complete with an automated Slack notification every Tuesday where a designated engineer handles the weekly Edge upgrade. At peak operation, the system handles around 150,000 requests per second—translating to roughly 100,000 asynchronous requests, millions of database queries, and tens of millions of cache lookups. When Ryan joined in 2016, releases happened about every 30 minutes. Looking at their deployment charts, a modest uptick began in December when Opus 4.5 dropped, but after Christmas, the pressure intensified dramatically, pushing deployment rates to roughly 200 to 250 times a day when factoring in rollbacks or fresh Rails application builds.
```mermaid flowchart TD subgraph Scale and Velocity A["150k Requests/sec"] --> B["100k Asynchronous"] B --> C["Millions of DB Queries"] C --> D["Tens of Millions of Cache Lookups"] end subgraph Deployment Loop E["Developer / Agent Merge"] --> F["Production Deploy (~5 mins)"] F --> G["~200-250 Deploys Daily"] end
style A fill:#f9f,stroke:#333,stroke-width:2px style G fill:#bbf,stroke:#333,stroke-width:2px
accTitle: Finn Scale and Deployment Loop Architecture accDescr: Flowchart illustrating request scaling metrics on the left leading into the rapid 200-plus daily merge and deployment loop on the right. ```
There are no "release trains" for engineers and developers at Finn. When you click "merge" on an approved pull request, it hits production in about five minutes, directly impacting hundreds of thousands of customer support agents and millions of end-users, resulting in a backend update roughly every three minutes. This relentless pace instills a company-wide sense of urgency that flows from engineering all the way to legal and financial departments: "When you want to do something, you do it, and you get immediate feedback." While clients naturally prize stability—as highlighted by a customer who remarked in disbelief during a bug call, "It seems like you're releasing updates while we're using your application"—Ryan calculates that every single second of downtime equates to roughly 50 hours of employee usage and hundreds of hours of end-user time. To maintain high availability without slowing down, they enforce strict rules: changes must be kept small (typically pulling in three PRs per deploy, representing 600 to 700 individual changes from a monthly pool of 250 unique Rails contributors), backed by rigorous test suites and code reviews, supported by deep production monitoring, and coupled with near-instantaneous rollback capabilities.
- **Traffic Peak:** 150,000 requests/second, ~100,000 async requests. - **Release Frequency:** ~200 to 250 deployments per day (backend update every ~3 minutes). - **SLA Evolution:** Shifted from 30-minute deploys in 2016, to a targeted 15-minute P75 SLA, down to sub-5-minute production merges today. - **Contributor Base:** 250 unique Rails contributors in the prior month making small, atomic pull requests.
---
[08:02](https://www.youtube.com/watch?v=EBJF55TyCVY&t=482s) Managing 225,000 Tests with Rotoscope
Walking through their CI/CD learning loop, Ryan focuses heavily on their test suite expansion and management strategies. When he joined back in 2016 when annual recurring revenue was around $60 to $70 million, the system maintained about 16,000 tests. Over the following year, that test suite doubled, and by August, an additional 25,000 tests were added. This explosive growth was partly fueled by AI agents: with models like Opus, the volume of generated comments tripled, and agents actively generated massive numbers of test specs. However, running sequentially, their current tally of 225,000 test specifications would take an staggering 60 hours to execute, whereas a typical pull request only modifies about four files.
To solve this bottleneck without sacrificing safety, Finn leverages **Rotoscope**, a high-performance method-profiling recorder built by Shopify. Although not originally designed for test selection, Finn adapted Rotoscope ingeniously: every morning at 5:00 AM, they run their entire test suite through Rotoscope to map out dependencies. For example, running specifications A, B, and C touches `conversation.rb`, while specification D touches `billing.rb`.
```mermaid flowchart LR subgraph Rotoscope Pipeline A["5:00 AM Full Suite Run"] --> B["Rotoscope Profiler"] B --> C["Mapping File Generation"] C --> D["30-Minute Incremental Updates"] end subgraph Test Selection E["PR modifies conversation.rb"] --> F["Run Only Specs A, B, C"] F --> G["Skip Irrelevant Spec D"] end
style A fill:#fcf,stroke:#333,stroke-width:2px style E fill:#cff,stroke:#333,stroke-width:2px
accTitle: Rotoscope Intelligent Test Selection Architecture accDescr: Flowchart showing the 5 AM Rotoscope profiling run generating dependency mappings, which allows PRs modifying specific files to execute only relevant test specs. ```
This mapping allows them to build an intelligent test-selection index: when a pull request modifies `conversation.rb`, the system executes *only* specifications A, B, and C, completely bypassing specification D. To eliminate risk, core workflow specifications and security-related tests are always executed unconditionally, and any changes to core guides bypass guesswork to trigger the full test suite. This mapping index is incrementally updated every 30 minutes, keeping the deployment pipeline blazing fast and safe.
[11:48](https://www.youtube.com/watch?v=EBJF55TyCVY&t=708s) Managing PR Test Selection and Incidents
Ryan explains how pull requests handle testing when updates occur. If a pull request was created based on an update from 30 minutes ago, there might be newer tests that haven't been run yet, so the system tests everything up to the next update. They added a skip slot where developers can add an empty commit, causing the system to run the full suite.
They sometimes encounter "deployment incidents" where three or four people work on a pull request, and all pass the Rotoscope test successfully, but right before production, another full test is triggered. If Rotoscope fails, it halts the pipeline, or there might be an issue with the merge queue. However, they built tools to show engineers exactly what to do to fix the situation in under 30 seconds.
- Reduced test suite run time from over 7.5 minutes to under 3 minutes. - The selected test suite consumes only about 5% of the computing resources required for a full run. - CI integration volume increased 8x during the period, making optimization critical to avoid massive cloud bills. - Flaky tests are treated as P1 (Priority 1) issues during the day, requiring immediate fixing by the on-call engineer or background agents.
[14:04](https://www.youtube.com/watch?v=EBJF55TyCVY&t=844s) Parallelizing Tests and Optimizing Boots
When running tests, files are not grouped by type but by duration. Every time a test runs, the system records the elapsed time and distributes runtime so each group has roughly the same duration. For a full test, about 1,400 workers run in parallel, whereas Rotoscope uses only as many containers as needed to keep the duration around 3 minutes.
Boots represent an ongoing cost every time a test suite or deployment runs. Since Rails 5.2, `bootsnap` has been a default gem that populates a lazily compiled instruction cache, which speeds up subsequent boots. They also pre-compile it during image creation so runners have a ready cache immediately.
- Schema cache is saved to an S3 file so processes fetch the latest schema directly rather than running expensive full-table queries on startup, preventing production blips. - A small optimization to SQL source location tracing in Ruby eliminated heavy object allocation across hundreds of stack trace rows, speeding it up 10x and saving 20% of CI runtime. - The golden rule: "Stop doing static work and optimize high-frequency work."
[19:06](https://www.youtube.com/watch?v=EBJF55TyCVY&t=1146s) Streamlining Builds and Eliminating Artifact Bloat
Moving to the build phase, Ryan discusses how they used to build six deployable units—historical tech debt accumulated over years. They built for two architectures across three regions. One x86 architecture was dedicated exclusively to a PDF generation project that a new engineer was assigned to review, which they ultimately canceled and replaced with a simpler solution.
They gradually reduced this to three regions, and eventually to a single server setup, which drastically reduced flaky failures caused by multiplying parallel build steps. They also discovered they were shipping spec nodes and bin nodes to every application instance—translating to packing and unpacking files 500,000 times a day—and promptly deleted the unnecessary files.
- A Tailwind CSS upgrade bug had broken production asset caching silently for five years, costing two minutes per build until caught. - Build execution time dropped from 4.5 minutes down to 53 seconds simply through observation, profiling, monitoring, and eliminating redundant static work. - Quick verification checks run in parallel with tests to verify connections to critical infrastructure and run security scans.
[22:29](https://www.youtube.com/watch?v=EBJF55TyCVY&t=1349s) Deploying Across Thousands of EC2 Servers
Deploying across thousands of EC2 servers involves uploading the release artifact to S3 and using AWS Systems Manager (SSM) to ping all servers, notifying them of a new version to download and spin up. Rotating processes takes about 3 to 4 minutes.
- The system preserves the previous four versions of the application locally on each server for fast rollbacks and recovery.
[22:59](https://www.youtube.com/watch?v=EBJF55TyCVY&t=1379s) The Muster Internal Management System and Deployment Metrics
The internal system that drives their deployment operations is named Muster. Dara, their Chief Technology Officer, initiated work on this project 15 years ago. While the current user interface is affectionately described as something only a parent could love, an incoming designer will soon focus on upgrading the user experience to address historical user errors caused by a lack of clarity.
Performance metrics remain a core pillar of their operation, reinforcing team accountability and transparency for engineers. Highlighting the breakneck speed of their workflow, the speaker shares a recent comment from an engineer who joked: "Man, we're shipping updates so fast I can't even make coffee when I click the merge button." They maintain a rigid deployment window of 11 minutes across five daily deployments, treating production not as a final destination, but as a stepping stone that directly informs subsequent customer interactions and iterative changes.
[24:32](https://www.youtube.com/watch?v=EBJF55TyCVY&t=1472s) Heartbeat Indicators, Incident Recovery, and Automated Rollbacks
To catch issues beyond basic system health, the team relies on "heartbeat indicators" to monitor actual business outcomes. For instance, Finn's core mission is enabling customers to hold productive dialogues with their end-users—tracked via high-volume metrics on inbox navigation and support conversations. On August 25, an engineer deployed a faulty query that slipped into production, triggering an alarm. The team currently enforces a two-minute quiet period before sounding alarms to prevent false positives, down from an earlier 30-second threshold, with hopes of compressing it further to one minute in the near future.
An alarm immediately generates an incident report, pages the incident commander and engineering team, and triggers an automated rollback. Because their changes are kept intentionally granular, rollbacks are designed to be completely safe: instead of reverting to a stale state from two or four hours prior (which might strand user interface state), the system rolls back up to five versions—covering roughly the previous 20 minutes.
```mermaid flowchart LR subgraph Incident Response A["Faulty Query Deployed"] --> B["2-Minute Alarm Threshold"] B --> C["Automated Page & Incident Report"] C --> D["Automated Rollback (Last 5 Versions / ~20 mins)"] D --> E["Fully Automated Recovery (6-7 mins)"] end accTitle: Automated Incident Recovery Flow accDescr: Flowchart showing the automated incident detection and recovery pipeline from faulty deployment to automated rollback and recovery. ```
This fully automated recovery happens deterministically without human intervention, resolving incidents in 6 to 7 minutes. By comparison, similar incidents 4 to 5 years ago took 11 to 12 minutes due to manual discovery, slower manual rollbacks, and cumbersome coordination.
[27:02](https://www.youtube.com/watch?v=EBJF55TyCVY&t=1622s) Compliance Control Levels and the Rise of AI Code Generation
Discussing compliance controls with an auditor prompted a humorous internal reflection on legal TV tropes—specifically the advice to "just answer what is asked" and "don't say anything silly." The speaker realized that rather than classifying deployments into low, medium, and high-risk tiers, they treat *every single change* as high-risk by default until proven otherwise. Whether modifying button text in the settings page or redirecting the application to a new database, every change follows the exact same stringent baseline.
This uniform rigor relies on a two-minute review and approval window, robust automated testing, rapid smoke tests, fast progressive rollouts, and automatic rollbacks upon failure—applied universally regardless of risk level, author, or approver. This approach is critical in the current era: because code creation costs have plummeted, over 95% of pull requests have been fully automated for the past six months, driving a three-fold velocity increase over 16 months and a four-fold increase the previous week.
[28:43](https://www.youtube.com/watch?v=EBJF55TyCVY&t=1723s) Transforming Code Review with Trick: The AI Review Agent
With soaring pull request velocity, traditional human code review quickly became a severe bottleneck. Reflecting on early AI review assistant experiments (reminiscent of asking Claude to review a GitHub pull request and receiving an overly long "love letter to your code" full of abstract praise alongside 12 unstructured, mostly unhelpful bullet points), engineers simply ignored the wall of text and defaulted to human reviews.
Rather than merely accelerating reviews, the goal was to elevate their quality. To achieve this, they built **Trick**, their proprietary review agent. Operating within a company of roughly 100 dedicated AI engineers collaborating across products, they applied their core technology stack to internal code reviews. Using Claude and Aider models, reviews are broken down into five distinct, independent evaluation stages:
- **Problem Statement**: Evaluates whether the pull request description articulates a clear, understandable problem, objective, and underlying hypothesis. - **Goal / Verification**: Validates whether the code strictly solves the stated problem without introducing extraneous functionality. - **Safety**: Checks modifications against specific repository rules and guidelines (e.g., distinguishing comment form edits from database or security setting changes). - **Logic**: The most resource-intensive phase, where the model analyzes the code specifically for bugs. - **Codebase Practices**: Enforces Ruby on Rails best practices, accommodating historical modifications and PlanetScale database integration patterns.
To overcome the historical lack of documented best practices, the team analyzed historical Snowflake data to identify the top 10 to 20 engineers per repository. By mining years of their past pull request feedback, they codified elite human review insights directly into Trick's evaluation rubric.
- Backed by an extensive reference dataset of 500,000 pull requests and a curated benchmark of 1,000 historical production-breaking changes, Trick provides automated approvals that surpass human-level review quality.
[34:51](https://www.youtube.com/watch?v=EBJF55TyCVY&t=2091s) اختبارات التراجع وآلية التحقق التلقائي لطلبات السحب
يوضح رايان شيرلوك التحديات غير المتوقعة التي ظهرت عند تحديث نماذج الذكاء الاصطناعي المستخدمة في تدقيق ومراجعة الأكواد البرمجية؛ فمع الترقية إلى نموذج أحدث وأكثر تطوراً، تراجعت دقة النموذج في بعض الجوانب الفرعية، وبدأ في اختلاق مشكلات وهمية والاعتراض على تفاصيل لا غبار عليها في الكود. فرض هذا التحدي ضرورة إجراء اختبارات رجعية (Regression Testing) شاملة في كل مرة يتم فيها تغيير النموذج أو تعديل صياغة التوجيهات (Prompts)، وذلك بمقارنة مخرجاته مع كامل سجل الاختبارات والحالات السابقة لضمان عدم حدوث أي انتكاس في دقة اتخاذ القرار.
يعرض رايان مثالاً حياً لما يظهر فعلياً داخل تعليقات طلبات السحب (Pull Requests) على GitHub، مستشهداً بطلب سحب حقيقي أنشأه بنفسه لتحسين الأداء. يقوم نظام الفحص الآلي بمرحلة تحقق صارمة؛ ففي هذا المثال، رصد النظام حالة تضارب وتزامن (Race condition) في كتلة التحقق `ensure` وما شابهها، وبناءً على ذلك رفض منح الموافقة التلقائية. بالإضافة إلى ذلك، يفرض النظام فحصاً دقيقاً لعدد أسطر التعليمات البرمجية ذات المعنى (Meaningful lines of code)؛ حيث تم تحديد سقف صارم لا يتجاوز 150 سطراً في هذا المستودع للتأهل للموافقة الآلية. وإذا تجاوز التغيير هذا الحد أو فشل في أحد المعايير، يدرج النظام تعليقاً واضحاً يفيد بضرورة تدخل مراجع بشري لإكمال المراجعة.
```mermaid flowchart TD accTitle: مسار تدقيق طلب السحب الآلي accDescr: يوضح الرسم مسار فحص طلب السحب والتحقق من حجم الكود وخلوه من أخطاء التزامن قبل منح الموافقة التلقائية أو طلب تدخل بشري.
subgraph Evaluation["مرحلة التحقق الآلي"] PR["فتح طلب السحب"] --> SizeCheck{"حجم الكود <= 150 سطراً؟"} SizeCheck -->|"نعم"| SafeCheck{"خالٍ من أخطاء التزامن والعيوب؟"} SizeCheck -->|"لا (تجاوز الحد)"| HumanReview["طلب مراجع بشري"] SafeCheck -->|"رصد عيب برمجي"| AgentLoop["تنبيه الوكيل للإصلاح"] end
subgraph Resolution["المعالجة والاعتماد"] AgentLoop --> PR SafeCheck -->|"اجتياز كامل"| AutoApprove["موافقة آلية فورية"] end ```
[36:19](https://www.youtube.com/watch?v=EBJF55TyCVY&t=2179s) الامتثال والمسؤولية: إجابة أسئلة المدققين والحلقات المغلقة للوكلاء
يتطرق الحديث إلى بناء حلقات عمل ذاتية بالكامل بين المطورين والوكلاء البرمجيين، حيث يعمل المهندس جنباً إلى جنب مع نموذج Claude الذي يراقب تنبيهات ومشكلات GitHub. فعندما يرصد النموذج تعليق النظام بوجود مشكلة تزامن، ينطلق الوكيل لإصلاح الخلل بشكل مستقل دون أي تدخل يدوي، وينشئ طلبات سحب جديدة ومحاولات دمج متتابعة حتى تجتاز كافة الفحوصات بنجاح.
أثار هذا النمط من العمل تساؤلات حذرة من جانب مدققي الامتثال والحوكمة (Auditors)، لكن إجابات الفريق كانت واضحة وقاطعة عبر مجموعة من الركائز الأساسية:
- **استقلالية المؤلف والمعتمد:** الحفاظ على مبدأ الفصل التام؛ فلا يُسمح إطلاقاً بأن يقوم وكيل ذكاء اصطناعي بإنشاء طلب سحب ثم يقوم وكيل ذكاء اصطناعي آخر بالموافقة عليه ودمجه دون إشراف. - **وجود العنصر البشري في الحلقة:** وجود إنسان في حلقة العمل لمعظم أنواع طلبات السحب، بحيث يقتصر دور النظام الآلي على جانب واحد من المعادلة حالياً. - **التوثيق الكامل بالأدلة:** تشغيل بيئات التكامل المستمر (CI)، واجتياز حزم الاختبارات بالكامل، والاحتفاظ بسجل تدقيق شامل وقابل للتتبع لكل إجراء. - **السلطة المحدودة (Bounded Authority):** قصر الموافقة التلقائية على مستودعات محددة جرى اختبارها والتأكد التام من استقرارها، مع الإبقاء على المسؤولية النهائية عاتقاً على العنصر البشري الذي يقود العملية، سواء كان يستخدم أدوات مثل Claude أو Codex.
[37:12](https://www.youtube.com/watch?v=EBJF55TyCVY&t=2232s) النتائج والأرقام بعد الإطلاق: سرعة الدمج وانكماش حجم الأكواد
يكشف رايان عن الأثر التشغيلي الهائل الذي أحدثه إطلاق نظام الموافقة الآلية، مقارناً المقاييس السابقة بمؤشرات الأداء الحالية. فقد انخفض متوسط الوقت المستغرق من فتح طلب السحب ومراجعته وحتى دمجه نهائياً من 160 دقيقة في مسار المراجعة البشرية التقليدية إلى 36 دقيقة فقط عبر النظام الآلي. ورغم إشارته إلى أن المقارنة تتضمن تفاوتاً في طبيعة التغييرات لأن النظام يتعامل حالياً مع طلبات سحب أقل خطورة، إلا أن النتيجة تظل قفزة إنتاجية فارقة.
- **40% من إجمالي طلبات السحب** في الشركة أصبحت تحظى بموافقة واعتماد آلي بالكامل، مما يجعل موظفاً واحداً فقط كافياً لإتمام العملية. - **معدل التراجع (Revert Rate):** بلغت نسبة التراجع عن طلبات السحب المعتمدة آلياً 0.5% فقط (أي طلب تراجع واحد من بين كل 200 طلب سحب)، مقارنة بنسبة تتجاوز 5% في التغييرات التي يعتمدها المراجعون البشريون (مع الأخذ بالاعتبار تعامل البشر مع أكواد أكثر تعقيداً ومخاطرة). - **انكماش حجم طلبات السحب:** على عكس المخاوف الشائعة على الإنترنت من أن وكلاء الذكاء الاصطناعي سينتجون طلبات سحب عملاقة ومستحيلة المراجعة، حدث العكس تماماً بفعل التصميم الاجتماعي-التقني للنظام؛ فعندما أدرك المطورون أن الحد الأقصى للموافقة الآلية هو 150 سطراً، حفزهم ذلك على تجزئة أعمالهم إلى تغييرات صغيرة جداً لتسريع دمجها، مما خفض متوسط حجم طلب السحب إلى حوالي 68 سطراً من الأكواد البرمجية فقط.
[38:31](https://www.youtube.com/watch?v=EBJF55TyCVY&t=2311s) التحديات المتبقية وفلسفة دورة النشر السريعة
رغم هذه النجاحات، لم تخلُ التجربة من مشكلات مفتوحة لا تزال قيد البحث؛ وفي مقدمتها تضخم حجم الاختبارات (Test Suite Bloat) وتراكم اختبارات متكررة أو غير ضرورية. يخصص الفريق حالياً عدداً من أكفأ مهندسيه لتنظيف حزم الاختبارات وضبطها، معتبرين أن هذا التضخم قد يكون جرس إنذار مبكر لظاهرة الانحراف المعماري (Architectural Drift).
يعترف رايان بصراحة بأنه لو سُئل قبل عام عن التداعيات المحتملة لهذا الكم الهائل من الأكواد والتغييرات المتسارعة، لكان رده: *"يا إلهي، سنحصل على كرة كبيرة من الطين"* ("a big ball of mud")، معبراً عن قلقه الشديد آنذاك. ولكن الواقع أثبت عكس ذلك تماماً؛ إذ انخفضت معدلات الحوادث والأعطال، وارتفعت جودة المنتج، وتقلصت المدة الزمنية الفاصلة بين ولادة فكرة الميزة الجديدة ووصولها إلى الإنتاج بين أيدي العملاء الفعليين.
تظل إحدى النقاط التقنية التي يسعى الفريق لتحسينها هي تقليص وقت استجابة الأسطول عند التراجع التلقائي (Fleet Restart / Rollback)، والذي يستغرق حالياً بين ثلاث إلى أربع دقائق. يبحث الفريق تطوير بدائل برمجية خاصة تتجاوز آليات خوادم الويب الحالية مثل Phusion Passenger وEinhorn لتمكين الإيقاف الفوري؛ ففي حالات انقطاع الخدمة أو تعطل التطبيق، لا يكترث المهندس بإنهاء العمليات بسلاسة بل يريد وقف الضرر على الفور.
يختتم رايان كلمته بالتأكيد على الفلسفة الجوهرية لدورة الإنتاج البرمجي: كل تغيير يبدأ بفرضية، تتبعه تجربة عملية، ثم تكشف بيئة الإنتاج عن السلوك الحقيقي للنظام وتقدم دروساً قيّمة يجب دمجها في التجربة التالية مباشرة. لذا، فإن الهدف الأسمى لفرق الهندسة هو جعل هذه الدورة تدور بأقصى سرعة وأمان ممكنين لتظل بمثابة "نبض القلب" المستمر للمؤسسة.
## Notable quotes > [03:00](https://www.youtube.com/watch?v=EBJF55TyCVY&t=180s) When you want to do something, you do it, and you get immediate feedback. — Ryan Sherlock
> [03:00](https://www.youtube.com/watch?v=EBJF55TyCVY&t=180s) It seems like you're releasing updates while we're using your application
> [14:04](https://www.youtube.com/watch?v=EBJF55TyCVY&t=844s) Stop doing static work and optimize high-frequency work. — Ryan Sherlock
> [22:59](https://www.youtube.com/watch?v=EBJF55TyCVY&t=1379s) Man, we're shipping updates so fast I can't even make coffee when I click the merge button.
> [27:02](https://www.youtube.com/watch?v=EBJF55TyCVY&t=1622s) just answer what is asked — Ryan Sherlock
> [27:02](https://www.youtube.com/watch?v=EBJF55TyCVY&t=1622s) don't say anything silly — Ryan Sherlock
> [28:43](https://www.youtube.com/watch?v=EBJF55TyCVY&t=1723s) love letter to your code — Ryan Sherlock
> [38:31](https://www.youtube.com/watch?v=EBJF55TyCVY&t=2311s) a big ball of mud — Ryan Sherlock
## Mentioned Ryan Sherlock, David Heinemeier Hansson (DHH), Des Traynor, Intercom, Finn, Salesforce, Shopify, Ruby on Rails, MySQL, Elasticsearch, React, ChatGPT, Claude, Opus 4.5, Rotoscope, bootsnap, AWS, Amazon S3, AWS Systems Manager (SSM), Tailwind CSS, Muster, Dara, Trick, Aider, PlanetScale, Snowflake, GitHub, Codex, Phusion Passenger, Einhorn
## Video description How does a 15-year-old, five-million-line Rails monolith ship more than 200 times a day, reaching first production traffic about five minutes after merge? Ryan Sherlock breaks down the test selection, bounded automated PR approval, build, deployment and recovery systems that make speed safe, and why agent-driven development makes that shipping loop more important than ever.
Thank you Shopify for sponsoring the editing and post-production of these videos. Check out insights from the Engineering team at: https://shopify.engineering/
[Source](https://www.youtube.com/watch?v=EBJF55TyCVY)