diff --git a/platform-parity/pom.xml b/platform-parity/pom.xml
new file mode 100644
index 0000000..d1831e5
--- /dev/null
+++ b/platform-parity/pom.xml
@@ -0,0 +1,22 @@
+
+
+ 4.0.0
+
+ com.eip4
+ eip4-platform
+ 0.1.0-SNAPSHOT
+
+ platform-parity
+ platform-parity
+ C1 逐行对拍框架:旧系统 SQL 录制重放 + 结果集逐行 diff(P1 一级交付物,可 CLI 跑批)
+
+ com.eip4platform-legacy-core
+ org.springframework.bootspring-boot-starter-jdbc
+ com.fasterxml.jackson.corejackson-databind
+
+ org.postgresqlpostgresql
+ org.springframework.bootspring-boot-starter-testtest
+
+
diff --git a/platform-parity/src/main/java/com/eip4/platform/parity/diff/DiffReport.java b/platform-parity/src/main/java/com/eip4/platform/parity/diff/DiffReport.java
new file mode 100644
index 0000000..a6293b1
--- /dev/null
+++ b/platform-parity/src/main/java/com/eip4/platform/parity/diff/DiffReport.java
@@ -0,0 +1,153 @@
+package com.eip4.platform.parity.diff;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 一次结果集逐行对拍的结构化差异报告。
+ *
+ *
同时承载机器可读(JSON 序列化)与人读(Markdown 摘要)两种产物:
+ * {@link #toSummaryMap()} 给 JSON,{@link #toMarkdown()} 给报告附录。
+ */
+public class DiffReport {
+
+ /** 对拍标签(通常是实体/表名)。 */
+ public final String label;
+ /** 左侧(基线,旧系统/录制)行数。 */
+ public int leftRowCount;
+ /** 右侧(新引擎)行数。 */
+ public int rightRowCount;
+ /** 用于排序与配对的主键列(规范化后)。 */
+ public final List keyColumns = new ArrayList<>();
+
+ /** 仅左侧存在的行(右侧缺失),记录主键。 */
+ public final List onlyInLeft = new ArrayList<>();
+ /** 仅右侧存在的行(左侧缺失),记录主键。 */
+ public final List onlyInRight = new ArrayList<>();
+ /** 主键匹配但有单元格差异的行。 */
+ public final List mismatches = new ArrayList<>();
+
+ public DiffReport(String label) {
+ this.label = label;
+ }
+
+ /** 主键匹配、单元格全等的行数。 */
+ public int matchedRows;
+
+ public boolean isClean() {
+ return onlyInLeft.isEmpty() && onlyInRight.isEmpty() && mismatches.isEmpty();
+ }
+
+ /** 总比对行数(以两侧并集计)。 */
+ public int totalCompared() {
+ return matchedRows + mismatches.size() + onlyInLeft.size() + onlyInRight.size();
+ }
+
+ /** 一致率(matched / 并集),用于报告里"逐行一致率"。 */
+ public double consistencyRate() {
+ int total = totalCompared();
+ return total == 0 ? 1.0 : (double) matchedRows / total;
+ }
+
+ /** 单元格级差异。 */
+ public static class CellDiff {
+ public final String column;
+ public final Object left;
+ public final Object right;
+ /** 差异原因:VALUE(值不同)/ MISSING_LEFT(左缺列)/ MISSING_RIGHT(右缺列)。 */
+ public final String reason;
+
+ public CellDiff(String column, Object left, Object right, String reason) {
+ this.column = column;
+ this.left = left;
+ this.right = right;
+ this.reason = reason;
+ }
+
+ public Map toMap() {
+ Map m = new LinkedHashMap<>();
+ m.put("column", column);
+ m.put("left", left);
+ m.put("right", right);
+ m.put("reason", reason);
+ return m;
+ }
+ }
+
+ /** 主键匹配但内容有差异的一行。 */
+ public static class RowMismatch {
+ public final String key;
+ public final List cells = new ArrayList<>();
+
+ public RowMismatch(String key) {
+ this.key = key;
+ }
+
+ public Map toMap() {
+ Map m = new LinkedHashMap<>();
+ m.put("key", key);
+ List