CORE Pipeline Quality Report


Form: 990combined Tax year: 2001 Generated: 2026-05-20 19:57:56

✅ PASSED — Strict mode: TRUE

Executive Summary

Metric Value
Row count 407,618
Column count 125
Vintage-aware completeness 91.67%
Raw completeness (all cols / all rows) 63.87%
Unique EINs 343,729
Duplicate EINs (amendments) 63,889
Missing columns vs schema 0
Extra columns vs schema 0
YoY row-count delta vs prior run +0.00% (within ±20%)

Identity-Field Checks

Code
ein  <- r$critical_field_issues$ein
tp   <- r$critical_field_issues$tax_period
sub  <- r$critical_field_issues$subsection
typ  <- r$critical_field_issues$types

ident <- data.table(
  Check = c("EIN format (XX-XXXXXXX)", "EIN null count", "EIN duplicates (soft)",
            "tax_period format (YYYYMM)", "tax_period out-of-range",
            "subsection_cd whitelist", "Column types"),
  Result = c(
    if (is.null(ein))  "✅ all valid" else sprintf("❌ %d malformed", ein$malformed),
    if (is.null(ein) && r$summary_stats$duplicate_eins >= 0) "✅ no nulls" else sprintf("❌ %d nulls", ein$null_count),
    sprintf("ℹ %d (soft, not a failure)", r$summary_stats$duplicate_eins),
    if (is.null(tp))   "✅ all valid"  else sprintf("❌ %d malformed", tp$malformed_count),
    if (is.null(tp))   "✅ all in range" else sprintf("❌ %d out of range", tp$out_of_range_count),
    if (is.null(sub))  "✅ all in IRM whitelist" else sprintf("❌ %d unknown codes", sub$unknown_count),
    if (is.null(typ))  "✅ all types correct" else sprintf("❌ %s", paste(typ$issues, collapse = "; "))
  )
)
kable(ident)
Check Result
EIN format (XX-XXXXXXX) ✅ all valid
EIN null count ✅ no nulls
EIN duplicates (soft) ℹ 63889 (soft, not a failure)
tax_period format (YYYYMM) ✅ all valid
tax_period out-of-range ✅ all in range
subsection_cd whitelist ✅ all in IRM whitelist
Column types ✅ all types correct

Subsection Code Distribution

(IRC 501(c) / 501(d) / 501(e) / 501(f) / 501(k) / 501(n) / 521 / 527 / 529 / 4947 / 1381 subsection codes per IRM 25.7.1. See data/lookups/subsection_codes.csv.)

Code
sd <- r$summary_stats$subsection_distribution
if (length(sd$top_values) == 0L) {
  cat("(no subsection data)")
} else {
  tab <- rbindlist(lapply(sd$top_values, as.data.table))
  setnames(tab, c("code", "count", "pct"))
  tab[, pct := paste0(pct, "%")]
  tab[, count := format(count, big.mark = ",")]
  kable(tab)
}
code count pct
3 257,367 63.69%
6 31,467 7.79%
4 25,289 6.26%
5 22,115 5.47%
7 16,792 4.16%
82 11,890 2.94%
9 8,573 2.12%
8 7,485 1.85%
19 6,610 1.64%
12 3,657 0.91%

Financial Summary

Code
fin <- r$summary_stats$financial
if (length(fin) == 0L) {
  cat("(no financial summary)")
} else {
  tab <- data.table(
    metric = c("total_revenue", "total_expenses", "total_assets_eoy"),
    sum = c(fmt_money(fin$revenue$total),  fmt_money(fin$expenses$total),  fmt_money(fin$assets$total)),
    median = c(fmt_money(fin$revenue$median), fmt_money(fin$expenses$median), fmt_money(fin$assets$median))
  )
  kable(tab)
}
metric sum median
total_revenue $1,145,201,234,791 $128,555
total_expenses $1,075,451,063,784 $114,428
total_assets_eoy $2,304,052,022,627 $147,362

Tax Period Year Coverage

Code
d <- r$summary_stats$tax_period_year_distribution
if (length(d) == 0L) {
  cat("(no coverage data)")
} else {
  tab <- data.table(tax_year = names(d), n = as.integer(unlist(d)))
  setorder(tab, tax_year)
  tab[, pct := sprintf("%.2f%%", 100 * n / sum(n))]
  tab[, n := format(n, big.mark = ",")]
  kable(tab)
}
tax_year n pct
2001 407,618 100.00%

Field Completeness by Category

Columns are grouped by Form section parsed from the crosswalk’s location field.

Code
cats <- r$category_reports
if (length(cats) == 0L) {
  cat("(no category breakdown)")
} else {
  tab <- rbindlist(lapply(cats, function(c) data.table(
    category         = c$category_name,
    n_cols           = c$column_count,
    cols_present     = c$columns_present,
    avg_completeness = sprintf("%.2f%%", c$avg_completeness)
  )))
  setorder(tab, -n_cols)
  kable(tab)
}
category n_cols cols_present avg_completeness
other 79 79 71.16%
sched_a 32 32 58.21%
part_i 23 23 78.26%
part_ii 10 10 70.00%
part_iv 10 10 100.00%
part_vi 6 6 66.67%
header 3 3 99.71%

Completeness by Vintage Cohort

When a single tax-year file blends rows from multiple extract_year × source_form cohorts, the per-cohort completeness reveals whether any vintage is dragging the overall metric down. A clean run produces 100% for every cohort.

Code
pc <- r$completeness_by_cohort
if (length(pc) == 0L) {
  cat("(single cohort)")
} else {
  tab <- rbindlist(lapply(pc, function(c) data.table(
    extract_year     = c$extract_year,
    source_form      = c$source_form,
    rows             = format(c$n_rows, big.mark = ","),
    expected_cols    = c$n_expected_cols,
    completeness_pct = sprintf("%.2f%%", c$completeness_pct)
  )))
  kable(tab)
}
extract_year source_form rows expected_cols completeness_pct
NA 990combined 407,618 86 91.67%

Data Issues

Code
issues <- character(0)
if (length(r$missing_columns)) issues <- c(issues, sprintf("Missing %d columns: %s",
  length(r$missing_columns), paste(head(r$missing_columns, 10), collapse = ", ")))
if (length(r$extra_columns)) issues <- c(issues, sprintf("Extra %d columns: %s",
  length(r$extra_columns), paste(head(r$extra_columns, 10), collapse = ", ")))
if (length(r$critical_field_issues)) {
  for (k in names(r$critical_field_issues)) {
    issues <- c(issues, sprintf("%s: %s", k, paste(unlist(r$critical_field_issues[[k]]), collapse = " | ")))
  }
}

if (length(issues) == 0L) {
  cat("✅ No hard-check issues detected.\n")
} else {
  for (i in issues) cat("- ", i, "\n", sep = "")
}
✅ No hard-check issues detected.

Generated from /home/rstudio/nccs-data-core/data/logs/legacy/quality_990combined_2001.rds. See R/quality/post_checks.R for the validator implementation and docs/05-quality-gates.qmd for the gate definitions.