AI Migration Assistant: Strangler-Pattern Project Guide

Day 60: Project: Migration Strangler Assistant
8 views
This guide focuses on AI migration assistant for production systems, with practical trade-offs for reliability, security, and cost.

AI migration assistant: production guidance

Project day. Ship a two-agent strangler assistant: a Cut Planner that proposes a service boundary, and an Implementer that emits intents + contract tests — so a monolith endpoint moves behind a façade without a big-bang rewrite.
⚡ TL;DR: Planner outputs StranglerPlan (old route, new service, façade mapping, test list). Implementer applies intents only. Contract tests must pass before merge. Human approves the cut. Emphasize evidence bundles.

Architecture

Ticket → CutPlanner → strangler-plan.json
                   → Implementer → intents + contract tests
                   → Critic/CI → human merge gate
python
# project/strangler_plan.py
from pydantic import BaseModel

class StranglerPlan(BaseModel):
    monolith_route: str
    new_service: str
    facade_path: str
    data_owner: str
    contract_tests: list[str]
    rollback: str

Step 1 — Planner

bash
python agents/cut_planner.py \
  --ticket MIG-220 \
  --repo . \
  --out artifacts/strangler-plan.json
Require the plan to cite call-graph edges (who imports the handler) — no vibes-only cuts.

Step 2 — Implementer intents

json
[
  {"kind": "add_facade", "path": "apps/api/facades/invoices.ts", "params": {"target": "http://invoices:8080"}},
  {"kind": "codemod", "path": "apps/api", "params": {"name": "redirect-invoice-reads"}},
  {"kind": "add_contract_test", "path": "tests/contract/test_invoice_cut.py", "params": {}}
]

Step 3 — Contract tests (non-negotiable)

python
# tests/contract/test_invoice_cut.py
def test_facade_matches_monolith_golden(client, golden):
    new = client.get("/facade/invoices/1").json()
    assert new == golden["invoices/1"]  # ✅ behavior lock

Step 4 — Evidence bundle

On exit, write artifacts/evidence.json: plan hash, intents, test JUnit, critic verdict, git SHAs. Reviewers open one folder.

Acceptance criteria

  • [ ] Plan schema validates
  • [ ] No direct prod IAM tools available to agents
  • [ ] Contract tests pass in CI
  • [ ] Human approved merge
  • [ ] Rollback steps documented in plan

Closing checklist

  • [ ] Two agents + contract tests
  • [ ] Façade before deleting monolith code
  • [ ] Evidence bundle per run
  • [ ] Human gate on cut
  • [ ] Keep rollback boring and tested

Series navigation

Day 59: Multi-Agent Eval: Task Suites, Not Vibes · Day 61: Prompt Injection in Jira, Email, and RAG Last updated September 11, 2026 Related: AI Migration Assistants: Strangler Fig Cuts With Contract Tests; Day 80: Project: Platform AI Gateway; Day 90: Project: Incident Timeline Summarizer.

Watch: 100 Days of AI on YouTube

Short videos from CheatCoders, one AI engineering topic per day.

Open the playlist on YouTube · CheatCoders on YouTube

Deep-dive PDF

Get the expanded guide for this post — extra diagrams-style checklists, failure modes, and a production walkthrough. Free when you subscribe to CheatCoders.

Already subscribed? or open the subscribe page.


Discover more from CheatCoders

Subscribe to get the latest posts sent to your email.

Comments

No comments yet. Why don’t you start the discussion?

Leave a comment

No account needed. Name and email are optional.