<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mithilascareers on Medium]]></title>
        <description><![CDATA[Stories by Mithilascareers on Medium]]></description>
        <link>https://medium.com/@mithilascareers?source=rss-f46f995f3985------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*QRxX83moDzS5xqIo</url>
            <title>Stories by Mithilascareers on Medium</title>
            <link>https://medium.com/@mithilascareers?source=rss-f46f995f3985------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 09:30:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mithilascareers/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Prod Issues Without Delaying the Release]]></title>
            <link>https://medium.com/@mithilascareers/prod-issues-without-delaying-the-release-251dd8b56477?source=rss-f46f995f3985------2</link>
            <guid isPermaLink="false">https://medium.com/p/251dd8b56477</guid>
            <dc:creator><![CDATA[Mithilascareers]]></dc:creator>
            <pubDate>Sat, 31 Oct 2026 17:19:11 GMT</pubDate>
            <atom:updated>2026-10-31T17:19:11.026Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Big release on Friday. Monday morning: a pile of production issues. And a project deadline that has not moved.</strong></p><p>Do you delay the project? Drop it and fight fires all week?</p><p>My answer: <strong>neither. No delay.</strong></p><h3>Why this matters</h3><ul><li>Support work lands on the same developer who owns the deliverable.</li><li>The old choice was bad either way: late project, or unfixed production issues.</li><li>Most of the support time goes into the same steps: read the logs, find the line, try a fix, run the tests.</li><li>Those steps are repeatable, which makes them a good fit for an AI agent.</li></ul><h3>What the demo does</h3><p>A tiny online shop has a bug: orders with a coupon end up with a huge negative total, and the payment system rejects them. Three agents handle it, and a person signs off.</p><ul><li><strong>Investigator:</strong> reads the production error log and the code, then writes a short diagnosis. It cannot edit anything.</li><li><strong>Fixer:</strong> makes the smallest fix in a throw-away copy of the code and runs the tests.</li><li><strong>Reviewer:</strong> a second agent that checks the change and the tests, and says approve or reject.</li><li><strong>You:</strong> one yes or no before anything leaves the copy.</li></ul><p>[Upload the picture flow_diagram.png here: click the + on an empty line in Medium, then the image icon]</p><p>Production code is never touched. The agents only edit the copy, and the “pull request” is a patch file.</p><h3>How it works</h3><p>The whole demo is one small Python project you can read in ten minutes.</p><h3>1. The bug</h3><p>The coupon code expects a fraction (0.2) but the shop sends a whole percent (20). So a 20% coupon takes 20 times the price off.</p><pre>def apply_coupon(subtotal: float, percent_off: float) -&gt; float:<br>    &quot;&quot;&quot;Return the order total after a percentage coupon (20 means 20% off).&quot;&quot;&quot;<br>    return round(subtotal - subtotal * percent_off, 2)</pre><p>The production log shows the result: a 100.00 order with a 20% coupon ends at -1900.00, and the payment system rejects it.</p><pre>2026-10-30 09:12:44 ERROR order=1042 coupon=SAVE20 percent_off=20 subtotal=100.00 total=-1900.00 msg=&quot;negative order total rejected by payment gateway&quot;</pre><h3>2. The tools each agent gets</h3><ul><li><strong>list_files:</strong> lists the files in the dev copy. Used by the investigator.</li><li><strong>read_file:</strong> reads one file. Used by all three agents.</li><li><strong>replace_in_file:</strong> edits one exact piece of text. Used by the fixer only.</li><li><strong>run_tests:</strong> runs the unit tests. Used by all three agents.</li><li><strong>show_diff:</strong> shows what changed. Used by the reviewer only.</li></ul><p>Only the fixer can edit, and only inside the copy. A tool call outside a role’s list is refused.</p><h3>3. The loop every agent runs</h3><p>Each agent does the same simple thing: ask the model what to do next, run the tool it picks, show it the result, repeat until it gives an answer. A cap of 8 steps stops runaway loops.</p><pre>for _ in range(MAX_STEPS):<br>    reply = brain.next(role, system, messages, schemas)<br>    if not reply[&quot;calls&quot;]:<br>        return reply[&quot;text&quot;]          # the agent is done<br>    for c in reply[&quot;calls&quot;]:<br>        out = TOOLS[c[&quot;name&quot;]][0](**c[&quot;input&quot;])   # run the tool<br>        # the result goes back to the model on the next turn</pre><h3>4. The safety rules</h3><ul><li><strong>A throw-away copy.</strong> The agents never see the real code folder.</li><li><strong>A second opinion.</strong> A separate reviewer agent must approve.</li><li><strong>A check that is not an agent.</strong> The script itself runs the tests again before going further.</li><li><strong>A human gate.</strong> The script asks “promote this fix? [y/N]” before it calls the pull request ready.</li></ul><h3>5. Two ways to run it</h3><ul><li><strong>Replay mode (default):</strong> the agents’ replies come from a file, but every tool call is real: files are read, the code is edited, the tests run. It needs no key, so anyone can try it.</li><li><strong>Live mode:</strong> the replies come from the Claude API. Set your key, install the anthropic package, and add --mode live.</li></ul><h3>What it printed</h3><p>This is a real run in replay mode, shortened a little. The tool calls and test results are real. The agents’ replies were played back from a file.</p><pre>MODE: replay</pre><pre>--- Before: tests on the current code ---<br>AssertionError: -1900.0 != 80.0<br>AssertionError: ValueError not raised<br>AssertionError: -9900.0 != 0.0<br>Ran 4 tests in 0.002s<br>FAILED (failures=3)</pre><pre>=== INVESTIGATOR ===<br>[investigator] tool: list_files()<br>[investigator] tool: read_file(path=&#39;logs/prod_errors.log&#39;)<br>[investigator] tool: read_file(path=&#39;shop/pricing.py&#39;)<br>[investigator] tool: run_tests()<br>[investigator] DIAGNOSIS: ... apply_coupon treats percent_off as a fraction (0.2)<br>  but callers pass whole percents (20) ...</pre><pre>=== FIXER ===<br>[fixer] tool: replace_in_file(path=&#39;shop/pricing.py&#39; ...)<br>[fixer] tool: run_tests()<br>[fixer] FIX APPLIED: apply_coupon now divides percent_off by 100 and raises<br>  ValueError outside 0 to 100.</pre><pre>=== REVIEWER ===<br>[reviewer] tool: show_diff()<br>[reviewer] tool: run_tests()<br>[reviewer] APPROVE: The change is small and fixes the cause, not the symptom ...</pre><pre>--- Independent check (not by an agent): tests on the fixed copy ---<br>Ran 4 tests in 0.000s<br>OK</pre><pre>--- Proposed change ---<br>-    return round(subtotal - subtotal * percent_off, 2)<br>+    if not 0 &lt;= percent_off &lt;= 100:<br>+        raise ValueError(&quot;percent_off must be between 0 and 100&quot;)<br>+    return round(subtotal - subtotal * percent_off / 100, 2)</pre><pre>Approved by a human. Pull request ready: out/fix.patch (simulated).</pre><h3>What to notice</h3><ul><li><strong>Before the fix:</strong> 3 of 4 tests fail, which matches the 3 failing orders in the log.</li><li><strong>After the fix:</strong> all 4 tests pass, checked by the script and not only by the agents.</li><li><strong>The real code folder:</strong> unchanged. The only output is a patch file waiting for a human.</li></ul><h3>Try it yourself</h3><ul><li><strong>Run:</strong> python3 agent.py --yes (no key needed). Leave out --yes to be asked for approval yourself.</li><li><strong>Code:</strong> [add the link to your GitHub repo here]</li></ul><h3>What I learned</h3><ul><li><strong>Give each agent one job.</strong> An investigator that cannot edit and a fixer that cannot approve are easier to trust than one agent that does everything.</li><li><strong>Let a second agent review.</strong> A fresh pair of eyes catches what the author misses, whether the author is a person or an agent.</li><li><strong>Keep one check that is not an agent.</strong> The script runs the tests itself, so the result does not depend on anyone’s word.</li><li><strong>Work in a copy.</strong> If something goes wrong, you throw the copy away.</li><li><strong>Keep a human at the gate.</strong> Agents prepare the fix. A person decides what ships.</li><li><strong>Start with the boring, repeatable issues.</strong> Wrong totals, bad config, missing checks. Leave the unusual ones to people.</li></ul><p><strong>So what about the project deadline?</strong> The developer keeps working on the planned feature. The agents do the digging, and the developer reviews a ready fix instead of hunting for the cause. Less firefighting, same timeline, and a calmer week for the whole team.</p><p>Production support does not have to compete with delivery. Let the agents do the digging, and keep people for the decisions. 🚀</p><p>How does your team handle the Monday morning after a big release? Would you trust an agent to prepare the first fix?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=251dd8b56477" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zero-Downtime Architecture: Phased Maintenance & Health Checks]]></title>
            <link>https://medium.com/@mithilascareers/zero-downtime-architecture-phased-maintenance-health-checks-917c7bb18cc3?source=rss-f46f995f3985------2</link>
            <guid isPermaLink="false">https://medium.com/p/917c7bb18cc3</guid>
            <dc:creator><![CDATA[Mithilascareers]]></dc:creator>
            <pubDate>Tue, 13 Oct 2026 06:41:24 GMT</pubDate>
            <atom:updated>2026-10-13T06:41:24.018Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>he Myth of Zero Downtime: Why Phased Maintenance, Cache Warm-ups, and Load Balancer Slow-Start Matter</strong></p><p><strong>The Reality of ‘Zero Downtime’</strong></p><p>In mission-critical enterprise applications, business stakeholders and clients expect 99.99% availability. ‘Zero downtime’ is the standard promise. But anyone who has managed production systems knows the truth: backends constantly require maintenance.<br> <br> Whether it’s deploying a new microservice version, rotating cryptographic secrets, or executing a heavy cache refresh, servers inevitably need downtime. The engineering challenge isn’t avoiding maintenance — it’s executing phased, rolling downtime so seamlessly that no client ever notices.</p><p><strong>The Real Problem: Cache Refresh and Cold-Start Shock</strong></p><p>Imagine you have a distributed calculation engine or an API gateway relying heavily on in-memory caches (such as Redis, Apache Ignite, or Caffeine). When an instance is taken down for deployment or cache invalidation, and a fresh instance boots up, its cache is completely empty (‘cold’).<br> <br> If your load balancer immediately routes full production traffic to that freshly booted instance:<br> • Every incoming request produces a cache miss.<br> • Hundreds of concurrent threads stampede the underlying database.<br> • CPU usage spikes to 100%, response latencies explode, and the instance crashes before it even warms up.<br> <br> This is why zero-downtime architecture requires deliberate phased maintenance: graceful connection draining, synthetic cache warming before marking healthy, and load balancer slow-start recovery.</p><p><strong>Health Checks: When Servers Die Silently</strong></p><p>Your load balancer can only route traffic to servers it *thinks* are alive.<br> <br> The word ‘thinks’ does heavy lifting here. In production, health checks come in two flavors:<br> <br> 1. Active Health Checks: The load balancer periodically pings an endpoint (e.g., GET /actuator/health). If the server responds with HTTP 200 OK, it stays in the routing pool. If it fails N consecutive checks, it is evicted.<br> <br> The Catch: There is an inherent blind spot. If your polling interval is 10 seconds and an instance dies at second 1, you spend 9 seconds routing live user traffic into a black hole. Shorter intervals mean faster fault detection, but higher network and CPU overhead.<br> <br> 2. Passive Health Checks: The load balancer monitors actual customer transactions. If an instance suddenly returns HTTP 502/503/504 errors or connection timeouts on real requests, it is flagged as unhealthy.<br> <br> The Catch: It requires actual user requests to fail before detecting the issue. An idle server or secondary path won’t be caught.<br> <br> The Production Golden Rule: Use both. Active health checks provide baseline liveness detection (‘Are you running?’), while passive checks provide real-time degradation detection (‘You are running, but broken’).</p><p><strong>The Critical Missing Piece: Slow-Start Recovery</strong></p><p>Here is the setting almost every engineering team forgets to configure: the recovery policy.<br> <br> When an instance finishes deployment, completes its cache pre-warming, and passes its health check, what happens? Most load balancers immediately blast it with full production traffic.<br> <br> The result is predictable: the recovering server gets crushed by accumulated backlog and thundering-herd requests, fails health checks, and drops dead again.<br> <br> Enabling Slow-Start (available on AWS ALB, NGINX Plus, Envoy, and HAProxy) instructs the load balancer to ramp up traffic weight gradually (e.g., from 5% to 100% over 2–5 minutes). This gives JVM Just-In-Time (JIT) compilers time to optimize hot paths and allows connection pools to hydrate smoothly.</p><p><strong>Architectural Blueprint for Phased Maintenance</strong></p><p>To execute zero-downtime maintenance safely, follow this 5-stage lifecycle:<br> <br> Stage 1 → Graceful Deregistration (Connection Draining): Signal the load balancer to stop sending *new* requests to Instance A while allowing existing inflight transactions to finish within a timeout window.<br> <br> Stage 2 → Maintenance &amp; Code Deployment: Perform the binary restart, database schema migration, or local configuration update.<br> <br> Stage 3 → Cache Pre-Warming: Before declaring the server ready, run background warm-up routines that query and populate critical hot data into cache.<br> <br> Stage 4 → Deep Readiness Probing: The health endpoint should only return 200 OK after cache hydration and database connection pools are verified.<br> <br> Stage 5 → Slow-Start Ramp-Up: The load balancer re-introduces the instance into the pool with graduated traffic weights until it reaches parity with the fleet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gvmv354PKOYj70KU4I1fgQ.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=917c7bb18cc3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>