AIPR_3.0 STEP 3 v1.16 – AGGREGATION TASK (Robust Trim + Bimodal Detection, Compact Output) Input One text file containing multiple completed AIPR v3.0 single-run outputs for ONE manuscript under the same Protocol Version. VALID_RUN definition A run is VALID only if it contains: Integer gates E,M,L,A,S each in {0,1,2,3,4,5} Numeric Scope-Normalized Score (0–55) If any are missing, non-numeric, out of range, or marked ABORT / unreadable → INVALID. Do not infer missing data. Metadata resolution MANUSCRIPT = most frequent exact Title among VALID runs; tie → AMBIGUOUS; none → UNKNOWN. AUTHOR = most frequent exact Author(s); tie → AMBIGUOUS; none → UNKNOWN. FILENAME = filename attached to this aggregation query. PUB_DATE = most frequent parseable publication date among VALID runs; else UNKNOWN. PROTOCOL_VERSION = the common Protocol Version string across VALID runs. Run extraction Parse runs in appearance order. For each run assign: RunID (1..K), Valid (YES/NO), Score (float), E,M,L,A,S. INVALID runs must appear in RUN_TABLE with Valid=NO and Kept=NO. Let N = count(VALID runs). If N = 0 → STATUS: NO_VALID_RUNS and stop. If N < 6: BIMODAL_CHECK = NO TRIM_APPLIED = NO Kept set = all VALID runs STATUS = OK_UNTRIMMED If N >= 6: BIMODAL_CHECK = YES Sort VALID scores ascending (stable by appearance). Compute adjacent gaps; let g_max be largest gap at split index i. LOW = runs 1..i; HIGH = runs i+1..N. Bimodal if: g_max >= 6.0 AND min(size(LOW), size(HIGH)) >= 2 AND mean(HIGH) - mean(LOW) >= 6.0 If NOT bimodal: TRIM_APPLIED = YES Discard exactly one lowest and one highest score (stable tie rule). Kept set = remaining VALID runs STATUS = OK_TRIMMED If bimodal: BIMODAL_FLAG = YES If size(LOW) > size(HIGH): active set = LOW If size(HIGH) > size(LOW): active set = HIGH If equal sizes → STATUS: AMBIGUOUS_BIMODAL; output cluster stats and stop On active set: If size >= 6 → discard one lowest and one highest Else keep all Kept set = resulting active set TRIM_APPLIED = YES if trim occurred else NO STATUS = OK_TRIMMED Statistics (computed on Kept set only) μ = mean Score (2 decimals) σ = standard deviation Score (2 decimals) m = median Score (2 decimals) Per-gate means (2 decimals) Per-gate medians (integers) Variance flag σ <= 2.4 → STABLE 2.4 < σ <= 4 → BORDERLINE σ > 4 → UNSTABLE Output format (STRICT, COMPACT, NO BLANK LINES) OUTPUT FORMAT (STRICT) Only output the following sections. Do not output this instruction block. Header block (one field per line, no blank lines inside header, no cross references) MANUSCRIPT: AUTHOR: DOI: MEAN_SCORE_0_55: <μ> MEDIAN_SCORE_0_55: STANDARD_DEVIATION: <σ> VARIANCE_FLAG: If BIMODAL_CHECK=YES and BIMODAL_FLAG=YES, include: BIMODAL_FLAG: YES GAP_MAX: LOW_MEAN: LOW_MEAN: HIGH_MEAN: HIGH_MEAN: CLUSTER_SELECTED: FILENAME: PUB_DATE: STATUS: PROTOCOL_VERSION: VALID_RUN_COUNT: BIMODAL_CHECK: TRIM_APPLIED: POST_TRIM_RUN_COUNT: Output a single Markdown pipe table with exactly these columns in this order: RunID, Valid, Kept, Score, E, M, L, A, S The table must include: One header row beginning with | One separator row of dashes One row per run in RunID order After the final run row, stop the table. Do not output any additional lines beginning with | after the last run row. Output exactly one blank line before the next section. SUMMARY_TABLE (Markdown pipe table only) Output a single Markdown pipe table with exactly these columns in this order: Stat, Score, Scores_VALID, Scores_KEPT, E, M, L, A, S The table must include: One header row beginning with | One separator row of dashes Exactly two data rows, in this order: Mean, Median Scores_VALID and Scores_KEPT must each be a single-line bracket list, for example: [45.00, 48.00, 40.00] No line breaks are allowed inside those cells. After the Median row, stop the table. Do not output any additional lines beginning with |. Output exactly one blank line before the glossary. After the tables, output exactly: GLOSSARY: E: Equation and dimensional integrity (weight 3) M: Mathematical formalism (weight 3) L: Logical traceability (weight 2) A: Assumption clarity and constraints (weight 2) S: Scope coverage (weight 1) Variance classification is defined as: STABLE for σ ≤ 2.40; BORDERLINE for 2.40 < σ ≤ 4.00; UNSTABLE for σ > 4.00. =============END OF REPORT================