Day 60: Project: Migration Strangler Assistant

Day 60: Project: Migration Strangler Assistant

Lab / Project: Migration Strangler Assistant

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
# 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

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

[
  {"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)

# 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


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 Reply