← Files Software & AI CopilotARCHIVED FILE
references/data-code-contracts.md
966 Bytes · Nov 6, 2026 · 12:11 UTC
# Data code correctness and reconciliation Before editing SQL, Spark or CDC: establish source/output grain, primary keys, join cardinality, dedupe winner/tie-breaker, NULL and timezone treatment, ordering, late data and deletes. Do not mask join fan-out with DISTINCT. For Spark, verify partition pruning, skew, shuffle, UDFs, broadcasts and output semantics only after correctness is established. For retries/backfills, require idempotence and bounded window selection. Protect offsets and checkpoints as stateful production assets. For CDC merges, ensure deterministic ordering, source uniqueness per key, replay handling and tombstone semantics. Define reconciliation checks (counts, key uniqueness, amounts, freshness) and what to do on failure. See the preserved plugin-root file `references/original/data_ai_coding_patterns.md` for deeper patterns. If user needs organization-wide data platform architecture, explicitly scope that as a different workflow.
SHA-256: 7389e58290b6bb1b00ba04793a5f830a62aae6c7538f0f2b93faa6ef6ba7fb30