We Merged 3 Repositories Into 1. Then AI Said: βRoll It All Back.β
Three repositories. Two Render services. One website. And a debugging lesson worth sharing.
We set out to simplify the architecture behind DeTLeng Case Studies, a production website featuring an AI analytics assistant and 100 verified BigQuery analytics tools.
The goal was not to rebuild a working website. It was to remove a fragile dependency without losing the work already done.
The Architecture: Before and After
BEFORE AFTER
ββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββ
GitHub Pages Website GitHub Pages Website
β β
βΌ βΌ
FastAPI Chatbot (Render) Unified FastAPI (Render)
β β
βΌ βΌ
Remote MCP Service (Render) 100 Allow-Listed Python Tools
β β
βΌ βΌ
Google BigQuery Google BigQuery
2 backend services 1 backend service
Remote MCP session Direct Python calls
Cold-start dependency No second service to wake
| Engineering concern | Before | After |
|---|---|---|
| Runtime services | Two Render backends | One unified backend |
| Analytics execution | Remote MCP session | Direct, registered Python calls |
| Cold-start behavior | Second service could stall | Single-service recovery and bounded retries |
| Data access | Verified BigQuery tools | Same allow-listed, read-only tools |
| Website | Existing GitHub Pages site | Existing design and URLs preserved |
The integration brought together the static website, the FastAPI chatbot, and the verified analytics tools. Local tests passed, the consolidated repository was pushed, and then GitHub displayed a red β.
The Advice That Almost Undid the Migration
The AI assistant's suggestion was simple: roll everything back.
After all that integration work?
I couldn't resist asking: βPeople at the office ask who hired me. Now I have to askβwho made you an AI?β π
But the joke exposed an important engineering distinction:
A failed check is a request for evidence, not an automatic instruction to reverse an architecture.
Rollback can be the correct response to a live incident. Here, however, the failure was in CI, and we had not yet established that production was broken.
The Root Cause Was One Boolean Condition
The warmup cache started with an empty timestamp:
_warm_ok = 0
The original condition was:
if time.monotonic() - _warm_ok < WARM_TTL:
On a freshly started GitHub Actions runner, monotonic uptime could still be below the cache TTL. The application therefore treated zero as if a successful warmup had occurred.
Two CI tests failed. The targeted correction was:
if _warm_ok and time.monotonic() - _warm_ok < WARM_TTL:
One guard condition. Not a three-repository rollback.
The fix passed local tests, and the next GitHub Actions run went green. We then deployed the unified Render backend, configured Google Cloud access, updated the website's API URL, and obtained live analytics responses for executive, sales, customer, delivery, and payment summaries.
That was functional validationβnot a claim that every cold-start scenario or all 100 tasks had already been exhaustively tested.
What AI-Assisted Engineering Should Learn
Before recommending a destructive reversal, an assistant should help establish:
- Scope: Is this a CI failure, deployment failure, or live customer incident?
- Evidence: Which exact test, log, or request failed?
- Reproduction: Can we explain the failure deterministically?
- Smallest safe fix: Can we correct the defect while preserving working code?
- Rollback threshold: Is there actual production risk that justifies reversal?
AI can accelerate implementation. But its real value is measured by judgment under uncertainty, not by how quickly it proposes the most dramatic command.
Don't let an AI turn a debugging problem into a demolition project.
Explore the Project
- π Live case-study website: casestudy.detleng.com
- π 100 Analytics AI Tasks: Explore the tasks
- π» GitHub repository: Navid-Ishaq/detleng-case-studies
Have you ever been advised to roll back something that only needed a small fix? Share the diagnosisβnot just the disaster.
About the Author
Muhammad Naveed Ishaque is a multidisciplinary thinker, educator, and founder of the DeTLeng Ecosystem, exploring AI, data, technology, business, and human-centered innovation through continuous learning and practical research.
π Explore DeTLeng: www.detleng.com
Top comments (1)
A red β in CI doesn't always mean your architecture is broken. Sometimes the fix is just one line of code.
Before accepting an AI-suggested rollback, ask: Did we diagnose the failure, or are we simply undoing the effort?
Fellow developers, have you ever challenged an AI's advice and saved your project? I'd love to hear your story. π