We implemented a new Migration Comparison Reporting capability focused on source-vs-migrated code quality and review prioritization.
-
Risk Heatmap generation
- Module-level risk scoring (
High,Medium,Low) with reason and recommendation.
- Module-level risk scoring (
-
Module Review Cards
- Summary: migrated LOC, auto-conversion percentage
- Semantic change signals: function/LOC/dependency deltas
- Auto-flagged risk areas
- Suggested review checklist
-
Gap Detection Engine
- Functional, Structural, Behavioral, Coverage gaps
- Severity + suggested action
-
Confidence Scoring
- Per-module confidence %, derived inversely from risk + test signals
-
Report persistence
- JSON and Markdown artifacts are stored in migration output folder
-
Service-level API strategy
- Report generation endpoint exists in
agent_service - Proxy endpoint added in
migration_serviceso clients do not need direct access toagent_service
- Report generation endpoint exists in
The goal is to move from raw migration logs to actionable review intelligence:
- Identify risky modules first (where manual review effort should go)
- Detect possible migration gaps early
- Provide leadership-level visibility via concise heatmaps + confidence
- Keep architecture secure and clean by exposing report API through
migration_serviceonly
We use a hybrid evidence model:
- Scanner artifacts (
source_scanner_output.json,target_scanner_output.json) - Response artifacts (
source_response.json,target_response.json) - Mapping artifacts (
file_mapping.json)
From these, we compute deterministic metrics and aggregate them module-wise:
- Manual intervention proxy
- Complexity proxy
- Iteration proxy
- Unsupported pattern proxy
- Dependency density proxy
Then we derive:
Risk Score(weighted formula)Confidence Score(inverse-risk style signal)- Gap tables
POST /v1/report/migration
migration_name(string, required)- Migration identifier used to locate artifacts in Temp folder
persist(boolean, optional, defaulttrue)- If true, save report files (
json+md) to disk
- If true, save report files (
include_markdown(boolean, optional, defaultfalse)- If true, include full markdown content in API response
risk_heatmapmodule_review_cardsgap_detectionconfidence_scoreconversion_pattern_shiftsartifact_paths(if persist=true)
POST /workflow/report/migration
This endpoint forwards request to agent_service and returns the same report payload.
- To avoid exposing
agent_servicedirectly to clients - To keep client integration centralized in
migration_service - To preserve existing auth and gateway usage patterns
Risk Score =
(0.3 * Manual Intervention) +
(0.2 * Complexity) +
(0.2 * Iterations) +
(0.2 * Unsupported Patterns) +
(0.1 * Dependency Density)
- Higher score => higher risk => deeper review needed
- Banding:
>= 67-> High34 to 66.99-> Medium< 34-> Low
- Derived from inverse risk (plus small testing signal)
- Higher confidence means lower manual verification effort expected
- Resolve migration directory from context (
migration_name, user scope) - If full source-vs-target artifacts exist, run comparison mode
- If only
migrated_code/exists, run migrated-code-only mode - Build module-level grouped stats (files, LOC, function count, dependencies)
- Compute weighted risk and confidence scores
- Derive gap rows and review guidance
- Build final payload sections
- Persist JSON/Markdown artifacts (optional)
source_vs_migrated- Uses source + target artifacts for true comparison
migrated_code_only- Uses only
migrated_code/analysis when source/target response artifacts are missing - Useful when migration output is available but intermediate response files are not guaranteed
- Uses only
When persist=true, files are written under:
<migration_dir>/reporting/
migration_risk_report_<timestamp>.jsonmigration_risk_report_<timestamp>.mdmigration_risk_report_latest.jsonmigration_risk_report_latest.md
- Converts technical migration output into audit-friendly decision support
- Enables risk-based review planning
- Makes migration quality visible with objective metrics
- Supports governance with stored report artifacts
- Scales across migrations via standardized format
Mostly deterministic from scanner/mapping artifacts. AI is already used upstream in scanning/analysis, but report assembly itself is metric-driven.
Managers and reviewers prioritize work per business module, not per raw file. Module heatmaps are easier to action.
Yes. Use migration_service endpoint /workflow/report/migration. It proxies internally.
Report can still be generated with reduced comparison depth, but quality improves significantly when both source and target artifacts exist.
No. It guides code review effort by ranking risk and likely gaps.
Saves generated report files (json + md) to migration folder for traceability, downloads, and audits.
Returns markdown report text inline in API response for UI preview. If false, markdown is not included in payload (still persisted if persist=true).
<70%: detailed validation recommended70%-89%: moderate review>=90%: minimal review/spot checks
Current formula is configurable in code and can be tuned by organization policy.
- Some proxies (iterations/manual effort) are inferred from available artifacts
- Module grouping is path-driven; future enhancement can use richer domain tagging
- Behavioral gap detection is heuristic in v1/v2
No. The latest implementation supports migrated_code_only mode if only migrated code exists.
Both:
- AST/scanner artifacts power deterministic metrics and structure analysis
- KB powers retrieval/assistive analysis (chat/docs/diagram context), with source/target separation via
is_target
- Persist report rows in DB for dashboard filtering and trend charts
- Add release-by-release risk trend per migration
- Add explicit test coverage import (if test reports available)
- Add downloadable PDF endpoint generated from markdown
- Add configurable risk weights via admin settings