==============================================================================
HD 2.4.c Stage 6 smoke test - era-B all_source reconstruction
==============================================================================

Stage 5 input rows: 533,268 (era-B per-component + Short Form Q2)
Stage 5 wall time: 21.48s

Stage 6 reconstructed all_source rows: 248,795
Stage 6 reconstruction wall time: 0.37s

--- Schema check (21 columns) ---
  Column order and types match locked §1 schema (21 columns). PASS

--- Per-year era-B reconstructed all_source row counts (2010-2024) ---
  year   recon_rows
  2010    16,287
  2011    18,639
  2012    15,563
  2013    15,532
  2014    15,559
  2015    15,753
  2016    15,937
  2017    16,570
  2018    16,537
  2019    16,783
  2020    17,168
  2021    16,948
  2022    17,058
  2023    17,801
  2024    16,660

--- Overlap case breakdown (FULL OUTER JOIN result) ---
  Both Q9 and Q11 present :  179,592  (72.18%)
  Q9 row-absent, Q11 present :   51,948  (20.88%)
  Q9 present, Q11 row-absent :   17,255  ( 6.94%)
  Total                       :  248,795
  Matches Stage 6 row count   : True

--- quality_flag distribution on reconstructed rows ---
                'reported'  n=238,429  (95.83%)
                 'imputed'  n= 10,366  ( 4.17%)

--- Reconstruction identity check (median absolute residual) ---
  N cells (both Q9 and Q11 present + reconstructed)  :  215,894
  Min absolute residual                              : 0.0
  Median absolute residual                           : 0.0
  Max absolute residual                              : 0.0
  N cells with abs_residual > 0.001                  :        0
  PASS: median = max = 0 (exact arithmetic, no rounding loss).

--- Three propagation case examples ---

  Case (a): Q9 reported + Q11 reported -> all_source 'reported'
    inst='008782' yr=2017 disc='Life sciences, biological an' q9=56.0 + q11=215.0 = recon=271.0 flag='reported'
    inst='008782' yr=2017 disc='Life sciences, health scienc' q9=460.0 + q11=1493.0 = recon=1953.0 flag='reported'
    inst='008782' yr=2017 disc='Life sciences, all'           q9=516.0 + q11=1708.0 = recon=2224.0 flag='reported'

  Case (b): Q9 row-absent + Q11 reported -> all_source 'reported'
    inst='100472' yr=2017 disc='Physical sciences, all'       q9=absent q11=17.0 ('reported') recon=17.0 flag='reported'
    inst='100472' yr=2017 disc='Social sciences, economics'   q9=absent q11=2.0 ('reported') recon=2.0 flag='reported'
    inst='100472' yr=2017 disc='Non-S&E, visual and performi' q9=absent q11=10.0 ('reported') recon=10.0 flag='reported'

  Case (c): Q9 imputed + Q11 reported -> all_source 'imputed'
    inst='001363' yr=2011 disc='Physical sciences, chemistry' q9=10.0 ('imputed') q11=9.0 ('reported') recon=19.0 flag='imputed'
    inst='001363' yr=2011 disc='Physical sciences, all'       q9=18.0 ('imputed') q11=9.0 ('reported') recon=27.0 flag='imputed'
    inst='029156' yr=2011 disc='Life sciences, biological an' q9=59.0 ('imputed') q11=50.0 ('reported') recon=109.0 flag='imputed'

--- Smoke-test boundaries ---
  Total wall time (Stage 5 + Stage 6 full): 22.04s
  No parquet written: Stage 6 smoke test only.
