# Migration Report — Legacy MetaDrivenPlatform4AI → nexuscrm-pingcap-pack

**Generated:** 2026-05-03
**Plan:** v3 (agent-only, journey-anchored, English-only)
**Source corpus:** 1265 audit rows (952 pingcap-inc + 313 fork-unique closed)
  → trimmed 5 fork-open rows in Phase 1.A → **1260 final rows**

## Summary

| Metric | Value |
|---|---|
| Stories filed | **34** (#141–174) |
| Escape-hatch bugs filed | **20** (#175–194) |
| Total open issues | 54 |
| Ported audit rows | 1239 |
| Rows referenced by some story/bug | 438 |
| **Coverage** | **35%** |
| Escape-hatch / (story + bug) ratio | **37%** ⚠️ above 30% threshold |
| CJK violations in artifacts | 0 ✅ |
| Story body section invariants | 0 violations ✅ |
| Bug escape-hatch line invariants | 0 violations ✅ |

## Story distribution by area

| Area | Stories |
|---|---|
| security | 4 (3 admin + 1 sales-user RLS/FLS) |
| opportunity | 5 |
| lead | 5 |
| approval | 2 |
| campaign | 4 |
| quote | 3 |
| flow | 1 (admin) |
| setup | 1 (admin) |
| layout | 1 (admin) |
| integration | 1 |
| order | 1 |
| contract | 1 |
| account | 1 |
| report | 1 |
| frontend (UI) | 1 |
| cross-cutting (Activity/Task) | 1 |
| auth | 1 |

## Bug (escape-hatch) distribution by area

| Area | Bugs |
|---|---|
| security | 3 (auth hardening, /debug/pprof, hardcoded credentials) |
| flow | 4 (FAIL-SILENT runtime, scheduler, dispatcher, semantics) |
| backend | 4 (SOQL hardening, repo correctness, cold-start, contract test debt) |
| approval | 2 (engine arch, runtime perf) |
| opportunity | 1 |
| layout | 1 |
| setup | 1 |
| integration | 1 |
| cross-cutting | 1 (Bad Smell umbrella, 21 sub-items) |
| lead | 1 |
| backend bootstrap | 1 |

## Priority distribution

- P0: 18
- P1: 28
- P2: 8

## Coverage analysis

438 of 1239 ported rows (35%) are explicitly referenced in some story or bug body's `## Source legacy issues` or `## Reference fix` section.

The remaining ~65% is composed of:
- Rows whose theme is covered by a sibling cluster but the row itself was not individually cited
- Cross-references already covered by an escape-hatch bug's umbrella reference (e.g. umbrella-1515's 21 sub-items folded into single bug #182)
- Rows that probably should be `obsolete` (the agent stayed conservative)

**Manager decision:** is 35% direct-citation coverage sufficient for launch, or should additional stories/bugs be commissioned for specific high-value uncovered rows?

## Escape-hatch ratio

37% (20 escape-hatch bugs vs 34 stories). The plan's threshold is < 30%. Two interpretations:

1. **Story granularity is OK; bug consolidation inflates ratio.** Each bug references 5–25 legacy issues (e.g. bug #194 covers 8 issues), so the absolute count of 20 escape-hatch bugs is the right scope. The ratio is high because each bug body is a meta-issue, not a per-defect ticket.

2. **A few of the bug clusters could become stories.** Candidates:
   - #185 (Lead Convert architecture) could fold into Story #145
   - #194 (Opportunity layout/Clone tech-debt) could fold into Story #148
   - #189 (Auth hardening) could fold into Story #169

**Manager decision:** keep the bugs as filed (rationale: each is a coherent platform-engineering work-item that's distinct from any single story), or restructure to bring ratio under 30%.

## Phase completion

| Phase | Status |
|---|---|
| Phase 0 — tracking epic | ✅ done |
| Phase 1.A — fork-open prune | ✅ done (1265 → 1260) |
| Phase 1.B — PR enrichment | ✅ done (241 fix PRs found, 167 with test files) |
| Phase 2 — epic markdowns | ✅ done (47 epics, all English) |
| Phase 2.5.A — close 140 historical issues | ✅ done (labeled `archived-pre-v2-migration`) |
| Phase 2.5.B — skill / template English-ification | ✅ done (test-scaffolder deleted) |
| Phase 3 — story synthesis | ✅ done (34 stories) |
| Phase 4 — escape-hatch bug filing | ✅ done (20 bugs) |
| Phase 5 — validation + report | ✅ done (this document) |

## Manager review queue

Per v3 plan, manager pilot reviews + sampling + launch:

1. **Phase 3 pilot review** — 5 lead stories (#141–145)
2. **Phase 3 batch sampling (10%)** — pick ~3-5 random from #146–174
3. **Phase 4 pilot review** — 5 escape-hatch bugs (#175–179)
4. **Phase 4 batch sampling (5%)** — pick ~1-2 random from #180–194
5. **Launch decision** — read this report; signal go/no-go

Total manager time estimated: ~3h.

## Known gaps / follow-ups

- 65% of audit rows lack direct citation. Cross-checked via cluster theming — most are covered indirectly. Manager decision needed if direct citation is required.
- Escape-hatch ratio 37% > 30% threshold. Manager decision needed whether to restructure or accept.
- IC will need to do per-story task breakdown when implementing — NOT in migration scope per v3 (no IC involvement during migration).
- L0/L1/L2 layer classification not done — left to engineering per v3.

## Out of scope (confirmed not done, per v3)

- Code-level port
- Writes to `pingcap-inc/NexusCRM` OSS
- Themes layer
- Task / Sub-task issues
- Test scaffold drafts
- IC-dependent labels (`needs-clarification`, `needs-e2e-scenario`)

## Tracking epic closure

After manager launch decision, close `docs/epics/0001-migration-from-mdp4ai.md` (mark Status: done).
