diff --git a/docs/research/ACTIVE_FRONTS.md b/docs/research/ACTIVE_FRONTS.md index b57629aa8..f96672796 100644 --- a/docs/research/ACTIVE_FRONTS.md +++ b/docs/research/ACTIVE_FRONTS.md @@ -132,3 +132,4 @@ Do not open new product surfaces before at least one of these four lanes is clos - 2026-09-30 盘型口径研究(BUG-1105):`/docs/research/rectification_varga_resolution_2026_09_30.md`——目标从分钟改为分盘上升段。v5 六题后 ±10 D9 / D10 头段 = 真值 88% / 86%,占比 ≥ 0.6 留一法 92% / 90%;±30 约 1/4–1/3 用户可给可信分盘;±60 分盘 blocked。按段选题 ≤ ±30 有 +3~+7 例;提前停不过红线;「不用校正」只对只需 D1 的问题成立。**建议立实现单**(§7)。 - 2026-10-01 角度类时间技法研究(BUG-1141):`/docs/research/rectification_angle_timing_2026_10_01.md`——行运压上升 / 天顶、次限推运角、太阳弧(1° ≈ 4 分钟),77 例 v5 真实日期对乱序日期 9 项预登记检验 0 项显著(最高胜过 58%,门槛 99.44%);年龄结构保持对照同样无信号;`closed_by_design`。 - 2026-10-05 纳迪秒级证伪(BUG-1240):`/docs/research/rectification_nadi_seconds_2026_10_05.md`——第 4 / 第 5 层小运和等分 D150 对安慰剂日期,预先登记的 N1、N2、N3、N5 都不过门;换岁差时第 5 层和 D150 的变化超过 20%。`closed_by_design`。不立实现单,对外不说秒级。 +- 2026-12-05 盲挑检验:`/docs/research/rectification_blind_pick_2026_12_05.md`——真实出生时间 + 4 个随机时间(各距 ≥ 60 分钟)盲挑,生产事件评分挑中 23.1%(瞎猜 20%,z = 0.06);随机时间「对上」经历 87.2% 与真值 86.9% 相同;正对照(年份 ±3 年靠向真值盘)82.2% 证明流程有效。小时级也无区分力;重新打开评分须先过此检验。 diff --git a/docs/research/rectification_blind_pick_2026_12_05.json b/docs/research/rectification_blind_pick_2026_12_05.json new file mode 100644 index 000000000..614a5b1a2 --- /dev/null +++ b/docs/research/rectification_blind_pick_2026_12_05.json @@ -0,0 +1,1415 @@ +{ + "dataset": "references/real_case_calibration/minute_rectification_holdout_v5.json", + "draws": 4000, + "mode": "real_events", + "per_case": [ + { + "case": "albert_brooks_1947_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.656, + "pct": 0.099 + }, + "far_60plus": { + "hit": 0.681, + "pct": 0.09 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": false + }, + { + "case": "andrew_windsor_1960_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.0, + "pct": 0.988 + }, + "far_60plus": { + "hit": 0.0, + "pct": 0.978 + }, + "near_15_to_120": { + "hit": 0.007, + "pct": 0.625 + }, + "tuning_free": false + }, + { + "case": "angelina_jolie_1975_aa_v4_holdout", + "events": 8, + "far_120plus": { + "hit": 0.224, + "pct": 0.309 + }, + "far_60plus": { + "hit": 0.261, + "pct": 0.281 + }, + "near_15_to_120": { + "hit": 0.282, + "pct": 0.25 + }, + "tuning_free": false + }, + { + "case": "barack_obama_1961_aa_v4_holdout", + "events": 8, + "far_120plus": { + "hit": 0.0, + "pct": 0.827 + }, + "far_60plus": { + "hit": 0.004, + "pct": 0.764 + }, + "near_15_to_120": { + "hit": 0.117, + "pct": 0.375 + }, + "tuning_free": false + }, + { + "case": "bernd_eichinger_1949_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.118, + "pct": 0.407 + }, + "far_60plus": { + "hit": 0.141, + "pct": 0.393 + }, + "near_15_to_120": { + "hit": 0.266, + "pct": 0.25 + }, + "tuning_free": false + }, + { + "case": "chad_everett_1937_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.0, + "pct": 0.889 + }, + "far_60plus": { + "hit": 0.0, + "pct": 0.876 + }, + "near_15_to_120": { + "hit": 0.0, + "pct": 0.812 + }, + "tuning_free": false + }, + { + "case": "elizabeth_montgomery_1933_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.009, + "pct": 0.679 + }, + "far_60plus": { + "hit": 0.007, + "pct": 0.685 + }, + "near_15_to_120": { + "hit": 0.021, + "pct": 0.562 + }, + "tuning_free": false + }, + { + "case": "elizabeth_taylor_1932_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.55, + "pct": 0.136 + }, + "far_60plus": { + "hit": 0.487, + "pct": 0.157 + }, + "near_15_to_120": { + "hit": 0.388, + "pct": 0.188 + }, + "tuning_free": false + }, + { + "case": "iwao_takamoto_1925_aa_v4_holdout", + "events": 8, + "far_120plus": { + "hit": 0.007, + "pct": 0.691 + }, + "far_60plus": { + "hit": 0.011, + "pct": 0.674 + }, + "near_15_to_120": { + "hit": 0.04, + "pct": 0.5 + }, + "tuning_free": false + }, + { + "case": "john_robbins_1947_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.035, + "pct": 0.556 + }, + "far_60plus": { + "hit": 0.046, + "pct": 0.517 + }, + "near_15_to_120": { + "hit": 0.566, + "pct": 0.125 + }, + "tuning_free": false + }, + { + "case": "joseph_kennedy_iii_1980_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.82, + "pct": 0.049 + }, + "far_60plus": { + "hit": 0.82, + "pct": 0.045 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": false + }, + { + "case": "kurt_cobain_1967_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.0, + "pct": 0.877 + }, + "far_60plus": { + "hit": 0.0, + "pct": 0.888 + }, + "near_15_to_120": { + "hit": 0.0, + "pct": 1.0 + }, + "tuning_free": false + }, + { + "case": "pablo_picasso_1881_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.953, + "pct": 0.012 + }, + "far_60plus": { + "hit": 0.967, + "pct": 0.011 + }, + "near_15_to_120": { + "hit": 0.749, + "pct": 0.062 + }, + "tuning_free": false + }, + { + "case": "paul_ryan_1970_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.044, + "pct": 0.531 + }, + "far_60plus": { + "hit": 0.066, + "pct": 0.494 + }, + "near_15_to_120": { + "hit": 0.397, + "pct": 0.188 + }, + "tuning_free": false + }, + { + "case": "salma_hayek_1966_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.071, + "pct": 0.481 + }, + "far_60plus": { + "hit": 0.064, + "pct": 0.483 + }, + "near_15_to_120": { + "hit": 0.045, + "pct": 0.5 + }, + "tuning_free": false + }, + { + "case": "sean_lennon_1975_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.365, + "pct": 0.222 + }, + "far_60plus": { + "hit": 0.389, + "pct": 0.202 + }, + "near_15_to_120": { + "hit": 0.74, + "pct": 0.062 + }, + "tuning_free": false + }, + { + "case": "sigmund_freud_1856_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.374, + "pct": 0.222 + }, + "far_60plus": { + "hit": 0.362, + "pct": 0.213 + }, + "near_15_to_120": { + "hit": 0.756, + "pct": 0.062 + }, + "tuning_free": false + }, + { + "case": "steve_reich_1936_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.901, + "pct": 0.025 + }, + "far_60plus": { + "hit": 0.909, + "pct": 0.022 + }, + "near_15_to_120": { + "hit": 0.554, + "pct": 0.125 + }, + "tuning_free": false + }, + { + "case": "tiger_woods_1975_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.121, + "pct": 0.407 + }, + "far_60plus": { + "hit": 0.093, + "pct": 0.449 + }, + "near_15_to_120": { + "hit": 0.003, + "pct": 0.688 + }, + "tuning_free": false + }, + { + "case": "tom_kennedy_1927_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.073, + "pct": 0.469 + }, + "far_60plus": { + "hit": 0.052, + "pct": 0.506 + }, + "near_15_to_120": { + "hit": 0.018, + "pct": 0.562 + }, + "tuning_free": false + }, + { + "case": "adriana_lima_1981_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 0.012, + "pct": 0.667 + }, + "far_60plus": { + "hit": 0.007, + "pct": 0.697 + }, + "near_15_to_120": { + "hit": 0.0, + "pct": 1.0 + }, + "tuning_free": true + }, + { + "case": "agatha_christie_1890_aa_v5_holdout", + "events": 15, + "far_120plus": { + "hit": 0.004, + "pct": 0.704 + }, + "far_60plus": { + "hit": 0.006, + "pct": 0.708 + }, + "near_15_to_120": { + "hit": 0.019, + "pct": 0.562 + }, + "tuning_free": true + }, + { + "case": "albert_einstein_1879_aa_v5_holdout", + "events": 18, + "far_120plus": { + "hit": 0.315, + "pct": 0.247 + }, + "far_60plus": { + "hit": 0.231, + "pct": 0.303 + }, + "near_15_to_120": { + "hit": 0.0, + "pct": 0.875 + }, + "tuning_free": true + }, + { + "case": "alberto_fujimori_1938_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 0.001, + "pct": 0.864 + }, + "far_60plus": { + "hit": 0.0, + "pct": 0.876 + }, + "near_15_to_120": { + "hit": 0.0, + "pct": 1.0 + }, + "tuning_free": true + }, + { + "case": "arthur_conan_doyle_1859_aa_v5_holdout", + "events": 19, + "far_120plus": { + "hit": 0.039, + "pct": 0.543 + }, + "far_60plus": { + "hit": 0.048, + "pct": 0.517 + }, + "near_15_to_120": { + "hit": 0.388, + "pct": 0.188 + }, + "tuning_free": true + }, + { + "case": "audrey_hepburn_1929_aa_v5_holdout", + "events": 11, + "far_120plus": { + "hit": 0.006, + "pct": 0.716 + }, + "far_60plus": { + "hit": 0.005, + "pct": 0.708 + }, + "near_15_to_120": { + "hit": 0.009, + "pct": 0.625 + }, + "tuning_free": true + }, + { + "case": "ayrton_senna_1960_aa_v5_holdout", + "events": 12, + "far_120plus": { + "hit": 0.005, + "pct": 0.716 + }, + "far_60plus": { + "hit": 0.004, + "pct": 0.719 + }, + "near_15_to_120": { + "hit": 0.021, + "pct": 0.562 + }, + "tuning_free": true + }, + { + "case": "barbra_streisand_1942_aa_v5_holdout", + "events": 16, + "far_120plus": { + "hit": 0.0, + "pct": 0.815 + }, + "far_60plus": { + "hit": 0.001, + "pct": 0.787 + }, + "near_15_to_120": { + "hit": 0.021, + "pct": 0.562 + }, + "tuning_free": true + }, + { + "case": "beyonce_1981_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 0.0, + "pct": 0.877 + }, + "far_60plus": { + "hit": 0.001, + "pct": 0.876 + }, + "near_15_to_120": { + "hit": 0.0, + "pct": 0.812 + }, + "tuning_free": true + }, + { + "case": "bob_dylan_1941_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 0.001, + "pct": 0.815 + }, + "far_60plus": { + "hit": 0.001, + "pct": 0.809 + }, + "near_15_to_120": { + "hit": 0.001, + "pct": 0.75 + }, + "tuning_free": true + }, + { + "case": "brigitte_bardot_1934_aa_v5_holdout", + "events": 19, + "far_120plus": { + "hit": 0.005, + "pct": 0.716 + }, + "far_60plus": { + "hit": 0.011, + "pct": 0.663 + }, + "near_15_to_120": { + "hit": 0.39, + "pct": 0.188 + }, + "tuning_free": true + }, + { + "case": "bruce_lee_1940_aa_v5_holdout", + "events": 12, + "far_120plus": { + "hit": 0.007, + "pct": 0.704 + }, + "far_60plus": { + "hit": 0.006, + "pct": 0.697 + }, + "near_15_to_120": { + "hit": 0.001, + "pct": 0.75 + }, + "tuning_free": true + }, + { + "case": "catherine_deneuve_1943_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 0.945, + "pct": 0.012 + }, + "far_60plus": { + "hit": 0.909, + "pct": 0.022 + }, + "near_15_to_120": { + "hit": 0.757, + "pct": 0.062 + }, + "tuning_free": true + }, + { + "case": "charles_de_gaulle_1890_aa_v5_holdout", + "events": 17, + "far_120plus": { + "hit": 0.151, + "pct": 0.37 + }, + "far_60plus": { + "hit": 0.136, + "pct": 0.393 + }, + "near_15_to_120": { + "hit": 0.0, + "pct": 0.812 + }, + "tuning_free": true + }, + { + "case": "cher_1946_aa_v5_holdout", + "events": 17, + "far_120plus": { + "hit": 0.0, + "pct": 0.889 + }, + "far_60plus": { + "hit": 0.0, + "pct": 0.876 + }, + "near_15_to_120": { + "hit": 0.005, + "pct": 0.688 + }, + "tuning_free": true + }, + { + "case": "clint_eastwood_1930_aa_v5_holdout", + "events": 17, + "far_120plus": { + "hit": 0.693, + "pct": 0.086 + }, + "far_60plus": { + "hit": 0.715, + "pct": 0.079 + }, + "near_15_to_120": { + "hit": 0.755, + "pct": 0.062 + }, + "tuning_free": true + }, + { + "case": "daniel_barenboim_1942_aa_v5_holdout", + "events": 18, + "far_120plus": { + "hit": 0.316, + "pct": 0.247 + }, + "far_60plus": { + "hit": 0.294, + "pct": 0.258 + }, + "near_15_to_120": { + "hit": 0.187, + "pct": 0.312 + }, + "tuning_free": true + }, + { + "case": "diane_cilento_1932_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 0.314, + "pct": 0.247 + }, + "far_60plus": { + "hit": 0.3, + "pct": 0.258 + }, + "near_15_to_120": { + "hit": 0.394, + "pct": 0.188 + }, + "tuning_free": true + }, + { + "case": "dingdong_dantes_1980_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 0.041, + "pct": 0.543 + }, + "far_60plus": { + "hit": 0.031, + "pct": 0.573 + }, + "near_15_to_120": { + "hit": 0.0, + "pct": 0.938 + }, + "tuning_free": true + }, + { + "case": "donald_trump_1946_aa_v5_holdout", + "events": 20, + "far_120plus": { + "hit": 0.005, + "pct": 0.765 + }, + "far_60plus": { + "hit": 0.003, + "pct": 0.775 + }, + "near_15_to_120": { + "hit": 0.002, + "pct": 0.688 + }, + "tuning_free": true + }, + { + "case": "edith_piaf_1915_aa_v5_holdout", + "events": 15, + "far_120plus": { + "hit": 0.257, + "pct": 0.284 + }, + "far_60plus": { + "hit": 0.242, + "pct": 0.292 + }, + "near_15_to_120": { + "hit": 0.271, + "pct": 0.25 + }, + "tuning_free": true + }, + { + "case": "elvis_presley_1935_aa_v5_holdout", + "events": 14, + "far_120plus": { + "hit": 0.01, + "pct": 0.654 + }, + "far_60plus": { + "hit": 0.013, + "pct": 0.652 + }, + "near_15_to_120": { + "hit": 0.018, + "pct": 0.562 + }, + "tuning_free": true + }, + { + "case": "francois_hollande_1954_aa_v5_holdout", + "events": 17, + "far_120plus": { + "hit": 0.0, + "pct": 0.988 + }, + "far_60plus": { + "hit": 0.0, + "pct": 0.989 + }, + "near_15_to_120": { + "hit": 0.0, + "pct": 0.938 + }, + "tuning_free": true + }, + { + "case": "frida_kahlo_1907_aa_v5_holdout", + "events": 15, + "far_120plus": { + "hit": 0.166, + "pct": 0.358 + }, + "far_60plus": { + "hit": 0.14, + "pct": 0.382 + }, + "near_15_to_120": { + "hit": 0.003, + "pct": 0.688 + }, + "tuning_free": true + }, + { + "case": "george_w_bush_1946_aa_v5_holdout", + "events": 15, + "far_120plus": { + "hit": 0.0, + "pct": 1.0 + }, + "far_60plus": { + "hit": 0.0, + "pct": 1.0 + }, + "near_15_to_120": { + "hit": 0.0, + "pct": 1.0 + }, + "tuning_free": true + }, + { + "case": "gisele_bundchen_1980_aa_v5_holdout", + "events": 15, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 0.559, + "pct": 0.125 + }, + "tuning_free": true + }, + { + "case": "gustavo_kuerten_1976_aa_v5_holdout", + "events": 10, + "far_120plus": { + "hit": 0.09, + "pct": 0.444 + }, + "far_60plus": { + "hit": 0.089, + "pct": 0.449 + }, + "near_15_to_120": { + "hit": 0.068, + "pct": 0.438 + }, + "tuning_free": true + }, + { + "case": "imelda_marcos_1929_aa_v5_holdout", + "events": 16, + "far_120plus": { + "hit": 0.0, + "pct": 0.951 + }, + "far_60plus": { + "hit": 0.0, + "pct": 0.949 + }, + "near_15_to_120": { + "hit": 0.004, + "pct": 0.781 + }, + "tuning_free": true + }, + { + "case": "janis_joplin_1943_aa_v5_holdout", + "events": 12, + "far_120plus": { + "hit": 0.38, + "pct": 0.21 + }, + "far_60plus": { + "hit": 0.395, + "pct": 0.202 + }, + "near_15_to_120": { + "hit": 0.541, + "pct": 0.125 + }, + "tuning_free": true + }, + { + "case": "jennifer_aniston_1969_aa_v5_holdout", + "events": 12, + "far_120plus": { + "hit": 0.103, + "pct": 0.432 + }, + "far_60plus": { + "hit": 0.079, + "pct": 0.461 + }, + "near_15_to_120": { + "hit": 0.001, + "pct": 0.75 + }, + "tuning_free": true + }, + { + "case": "jimi_hendrix_1942_aa_v5_holdout", + "events": 12, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "johnny_depp_1963_aa_v5_holdout", + "events": 17, + "far_120plus": { + "hit": 0.0, + "pct": 0.957 + }, + "far_60plus": { + "hit": 0.0, + "pct": 0.944 + }, + "near_15_to_120": { + "hit": 0.014, + "pct": 0.719 + }, + "tuning_free": true + }, + { + "case": "judy_garland_1922_aa_v5_holdout", + "events": 17, + "far_120plus": { + "hit": 0.455, + "pct": 0.173 + }, + "far_60plus": { + "hit": 0.462, + "pct": 0.169 + }, + "near_15_to_120": { + "hit": 0.563, + "pct": 0.125 + }, + "tuning_free": true + }, + { + "case": "juscelino_kubitschek_1902_aa_v5_holdout", + "events": 15, + "far_120plus": { + "hit": 0.0, + "pct": 1.0 + }, + "far_60plus": { + "hit": 0.0, + "pct": 1.0 + }, + "near_15_to_120": { + "hit": 0.0, + "pct": 0.938 + }, + "tuning_free": true + }, + { + "case": "kamala_harris_1964_aa_v5_holdout", + "events": 14, + "far_120plus": { + "hit": 0.55, + "pct": 0.136 + }, + "far_60plus": { + "hit": 0.505, + "pct": 0.157 + }, + "near_15_to_120": { + "hit": 0.074, + "pct": 0.438 + }, + "tuning_free": true + }, + { + "case": "leonardo_dicaprio_1974_aa_v5_holdout", + "events": 11, + "far_120plus": { + "hit": 0.138, + "pct": 0.383 + }, + "far_60plus": { + "hit": 0.181, + "pct": 0.348 + }, + "near_15_to_120": { + "hit": 0.555, + "pct": 0.125 + }, + "tuning_free": true + }, + { + "case": "lionel_messi_1987_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 0.817, + "pct": 0.049 + }, + "far_60plus": { + "hit": 0.722, + "pct": 0.079 + }, + "near_15_to_120": { + "hit": 0.02, + "pct": 0.562 + }, + "tuning_free": true + }, + { + "case": "lou_diamond_phillips_1962_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 0.0, + "pct": 0.951 + }, + "far_60plus": { + "hit": 0.0, + "pct": 0.933 + }, + "near_15_to_120": { + "hit": 0.007, + "pct": 0.75 + }, + "tuning_free": true + }, + { + "case": "manuel_puig_1932_aa_v5_holdout", + "events": 8, + "far_120plus": { + "hit": 0.029, + "pct": 0.58 + }, + "far_60plus": { + "hit": 0.029, + "pct": 0.573 + }, + "near_15_to_120": { + "hit": 0.019, + "pct": 0.562 + }, + "tuning_free": true + }, + { + "case": "marilyn_monroe_1926_aa_v5_holdout", + "events": 16, + "far_120plus": { + "hit": 0.634, + "pct": 0.111 + }, + "far_60plus": { + "hit": 0.618, + "pct": 0.112 + }, + "near_15_to_120": { + "hit": 0.375, + "pct": 0.188 + }, + "tuning_free": true + }, + { + "case": "meryl_streep_1949_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 0.015, + "pct": 0.63 + }, + "far_60plus": { + "hit": 0.019, + "pct": 0.629 + }, + "near_15_to_120": { + "hit": 0.033, + "pct": 0.5 + }, + "tuning_free": true + }, + { + "case": "miley_cyrus_1992_aa_v5_holdout", + "events": 20, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "muhammad_ali_1942_aa_v5_holdout", + "events": 18, + "far_120plus": { + "hit": 0.301, + "pct": 0.259 + }, + "far_60plus": { + "hit": 0.264, + "pct": 0.281 + }, + "near_15_to_120": { + "hit": 0.006, + "pct": 0.625 + }, + "tuning_free": true + }, + { + "case": "nicolas_sarkozy_1955_aa_v5_holdout", + "events": 16, + "far_120plus": { + "hit": 0.006, + "pct": 0.704 + }, + "far_60plus": { + "hit": 0.008, + "pct": 0.697 + }, + "near_15_to_120": { + "hit": 0.0, + "pct": 0.812 + }, + "tuning_free": true + }, + { + "case": "pele_1940_aa_v5_holdout", + "events": 15, + "far_120plus": { + "hit": 0.036, + "pct": 0.556 + }, + "far_60plus": { + "hit": 0.032, + "pct": 0.573 + }, + "near_15_to_120": { + "hit": 0.042, + "pct": 0.5 + }, + "tuning_free": true + }, + { + "case": "piolo_pascual_1977_aa_v5_holdout", + "events": 8, + "far_120plus": { + "hit": 0.007, + "pct": 0.679 + }, + "far_60plus": { + "hit": 0.013, + "pct": 0.652 + }, + "near_15_to_120": { + "hit": 0.006, + "pct": 0.625 + }, + "tuning_free": true + }, + { + "case": "prince_1958_aa_v5_holdout", + "events": 14, + "far_120plus": { + "hit": 0.195, + "pct": 0.333 + }, + "far_60plus": { + "hit": 0.185, + "pct": 0.337 + }, + "near_15_to_120": { + "hit": 0.039, + "pct": 0.5 + }, + "tuning_free": true + }, + { + "case": "rafael_nadal_1986_aa_v5_holdout", + "events": 19, + "far_120plus": { + "hit": 0.0, + "pct": 0.963 + }, + "far_60plus": { + "hit": 0.0, + "pct": 0.966 + }, + "near_15_to_120": { + "hit": 0.0, + "pct": 1.0 + }, + "tuning_free": true + }, + { + "case": "rudy_fernandez_1952_aa_v5_holdout", + "events": 10, + "far_120plus": { + "hit": 0.0, + "pct": 0.988 + }, + "far_60plus": { + "hit": 0.0, + "pct": 0.933 + }, + "near_15_to_120": { + "hit": 0.115, + "pct": 0.375 + }, + "tuning_free": true + }, + { + "case": "salvador_dali_1904_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 0.487, + "pct": 0.16 + }, + "far_60plus": { + "hit": 0.524, + "pct": 0.146 + }, + "near_15_to_120": { + "hit": 0.557, + "pct": 0.125 + }, + "tuning_free": true + }, + { + "case": "serena_williams_1981_aa_v5_holdout", + "events": 14, + "far_120plus": { + "hit": 0.263, + "pct": 0.272 + }, + "far_60plus": { + "hit": 0.23, + "pct": 0.303 + }, + "near_15_to_120": { + "hit": 0.001, + "pct": 0.75 + }, + "tuning_free": true + }, + { + "case": "silvio_santos_1930_aa_v5_holdout", + "events": 11, + "far_120plus": { + "hit": 0.0, + "pct": 0.944 + }, + "far_60plus": { + "hit": 0.0, + "pct": 0.938 + }, + "near_15_to_120": { + "hit": 0.001, + "pct": 0.844 + }, + "tuning_free": true + }, + { + "case": "sophia_loren_1934_aa_v5_holdout", + "events": 14, + "far_120plus": { + "hit": 0.019, + "pct": 0.617 + }, + "far_60plus": { + "hit": 0.013, + "pct": 0.652 + }, + "near_15_to_120": { + "hit": 0.0, + "pct": 0.938 + }, + "tuning_free": true + }, + { + "case": "venus_williams_1980_aa_v5_holdout", + "events": 14, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 0.865, + "pct": 0.034 + }, + "near_15_to_120": { + "hit": 0.04, + "pct": 0.5 + }, + "tuning_free": true + }, + { + "case": "vincent_van_gogh_1853_aa_v5_holdout", + "events": 15, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "whitney_houston_1963_aa_v5_holdout", + "events": 12, + "far_120plus": { + "hit": 0.104, + "pct": 0.42 + }, + "far_60plus": { + "hit": 0.099, + "pct": 0.438 + }, + "near_15_to_120": { + "hit": 0.0, + "pct": 0.812 + }, + "tuning_free": true + }, + { + "case": "zinedine_zidane_1972_aa_v5_holdout", + "events": 16, + "far_120plus": { + "hit": 0.004, + "pct": 0.741 + }, + "far_60plus": { + "hit": 0.002, + "pct": 0.764 + }, + "near_15_to_120": { + "hit": 0.0, + "pct": 1.0 + }, + "tuning_free": true + } + ], + "step_minutes": 15, + "summary": { + "far_120plus": { + "fake_events_control": { + "events_matched_decoy": 0.86, + "events_matched_truth": 0.86, + "mean_percentile": 0.526, + "n": 385, + "pick1of5": 0.195, + "pick_se": 0.014, + "truth_top20_cases": 71, + "z_vs_chance": -1.76 + }, + "real_all": { + "events_matched_decoy": 0.873, + "events_matched_truth": 0.869, + "mean_percentile": 0.498, + "n": 77, + "pick1of5": 0.237, + "pick_se": 0.037, + "truth_top20_cases": 17, + "z_vs_chance": 0.06 + }, + "real_tuning_free": { + "events_matched_decoy": 0.878, + "events_matched_truth": 0.845, + "mean_percentile": 0.517, + "n": 57, + "pick1of5": 0.227, + "pick_se": 0.043, + "truth_top20_cases": 12, + "z_vs_chance": -0.44 + } + }, + "far_60plus": { + "fake_events_control": { + "events_matched_decoy": 0.859, + "events_matched_truth": 0.86, + "mean_percentile": 0.524, + "n": 385, + "pick1of5": 0.19, + "pick_se": 0.014, + "truth_top20_cases": 63, + "z_vs_chance": -1.64 + }, + "real_all": { + "events_matched_decoy": 0.872, + "events_matched_truth": 0.869, + "mean_percentile": 0.498, + "n": 77, + "pick1of5": 0.231, + "pick_se": 0.036, + "truth_top20_cases": 17, + "z_vs_chance": 0.06 + }, + "real_tuning_free": { + "events_matched_decoy": 0.876, + "events_matched_truth": 0.845, + "mean_percentile": 0.52, + "n": 57, + "pick1of5": 0.218, + "pick_se": 0.042, + "truth_top20_cases": 12, + "z_vs_chance": -0.52 + } + }, + "near_15_to_120": { + "fake_events_control": { + "events_matched_decoy": 0.849, + "events_matched_truth": 0.86, + "mean_percentile": 0.507, + "n": 385, + "pick1of5": 0.19, + "pick_se": 0.015, + "truth_top20_cases": 87, + "z_vs_chance": -0.5 + }, + "real_all": { + "events_matched_decoy": 0.864, + "events_matched_truth": 0.869, + "mean_percentile": 0.5, + "n": 77, + "pick1of5": 0.219, + "pick_se": 0.036, + "truth_top20_cases": 23, + "z_vs_chance": -0.01 + }, + "real_tuning_free": { + "events_matched_decoy": 0.854, + "events_matched_truth": 0.845, + "mean_percentile": 0.554, + "n": 57, + "pick1of5": 0.173, + "pick_se": 0.038, + "truth_top20_cases": 14, + "z_vs_chance": -1.42 + } + } + } +} diff --git a/docs/research/rectification_blind_pick_2026_12_05.md b/docs/research/rectification_blind_pick_2026_12_05.md new file mode 100644 index 000000000..9966899d5 --- /dev/null +++ b/docs/research/rectification_blind_pick_2026_12_05.md @@ -0,0 +1,75 @@ +# 生时校正盲挑检验:真实出生时间 vs 随机时间(2026-12-05) + +> 产品负责人 2026-12-05 提问:agent 拿用户的人生经历去对候选出生时间,说「这个时间对上了」——换一个随机出生时间,是不是同样能「对上」?候选多、可解释的角度多,总能找到某种匹配(多重比较)。检验:给系统真实时间和几个随机时间,不告诉它哪个是真的,看它能不能稳定挑出真的。 +> 离线研究,生产代码零改动。数据:`references/real_case_calibration/minute_rectification_holdout_v5.json`(77 例公开 Rodden-AA,964 件维基经历,开放集)。 +> 脚本:`scripts/research/rectification_blind_pick.py`;测试 `tests/test_rectification_blind_pick.py`。 +> 结果:`rectification_blind_pick_2026_12_05.json`(真实经历 + 伪造经历对照)、`rectification_blind_pick_positive_control_2026_12_05.json`(正对照)。两份均两次运行逐字节一致(随机种子为固定字符串)。 +> 引擎:`next` `e86351b2` 的生产事件评分 `compute_event_candidate_rows`,全部计算层(`missing_layers` 为空),岁差 raman、平均交点。 + +## 1. 结论 + +**挑不出来。** 真实时间与 4 个随机时间(各距真值 ≥ 60 分钟,即完全不同的盘)一起盲挑,引擎把真实时间排第一的比例是 **23.1%**,瞎猜是 **20%**;真实时间在全部随机时间里的平均排位 0.498(瞎猜 0.5,z = 0.06)。**随机时间的盘「对上」的经历比例(87.2%)和真实时间(86.9%)一样**——「这件事对上了」对任何时间都成立。 + +正对照证明流程能测出信号:把每件经历的年份在 ±3 年内挪到最合真实时间盘的那一年,真实时间挑中率升到 **82.2%**、平均排位 0.096。真实经历里没有这样的信号。 + +判定:事件评分对出生时间**没有区分力**,不止分钟级,小时级(不同上升、不同宫位)也分不开。2026-11-17 起暂停的答题与事件评分(#323 / BUG-1966)不应在没有通过本检验的新方法前重新打开;任何对用户说「这个时间对上了」的文案都没有依据。 + +## 2. 预先登记的设计(第一次运行前写定) + +| 项 | 设定 | +| --- | --- | +| 候选 | 每例出生当日全天 96 个时刻,每 15 分钟一个,网格对齐使记录时间恰为其一 | +| 主检验 | 一选五盲挑:真值 + 从诱饵池随机抽 4 个;引擎最高分即「挑中」,并列平分;每例 4000 次取均值;瞎猜 = 0.20 | +| 诱饵池 | 距真值(按 24 小时循环计)≥ 60 分钟的网格时刻;另报 ≥ 120 分钟、15–120 分钟两档 | +| 次要指标 | 真值在「真值 + 诱饵池」中的排位分位(0 = 最好,瞎猜均值 0.5,z 按均匀分布方差);真值进前 20% 的例数 | +| 伪造经历对照 | 同一人、同样件数 / 领域 / 精度,每件日期在本人最早与最晚经历年份之间重抽(5 个种子);必须落在瞎猜水平,否则说明引擎因经历以外的原因偏向记录时间 | +| 正对照 | 每件经历按年精度,在 ±3 年内挑对真实时间单件得分最高的年份;流程有效则真值必须明显胜出 | +| 巴纳姆检查 | 得到正分(「对上」)的经历占比:真值 vs 诱饵平均 | +| 子集 | 全部 77 例;未参与调参的 57 例(非继承自 v4) | + +## 3. 结果 + +一选五挑中率(± 标准误)与平均排位: + +| 诱饵设定 | 子集 | 挑中率 | 平均排位 | z | 真值进前 20% | 「对上」经历:真值 / 随机 | +| --- | --- | --- | --- | --- | --- | --- | +| ≥ 60 分钟(主) | 全部 77 | 0.231 ± 0.036 | 0.498 | 0.06 | 17 / 77 | 0.869 / 0.872 | +| ≥ 60 分钟 | 未调参 57 | 0.218 ± 0.042 | 0.520 | −0.52 | 12 / 57 | 0.845 / 0.876 | +| ≥ 60 分钟 | 伪造经历对照 | 0.190 ± 0.014 | 0.524 | −1.64 | 63 / 385 | 0.860 / 0.859 | +| ≥ 120 分钟 | 全部 77 | 0.237 ± 0.037 | 0.498 | 0.06 | 17 / 77 | 0.869 / 0.873 | +| ≥ 120 分钟 | 未调参 57 | 0.227 ± 0.043 | 0.517 | −0.44 | 12 / 57 | 0.845 / 0.878 | +| ≥ 120 分钟 | 伪造经历对照 | 0.195 ± 0.014 | 0.526 | −1.76 | 71 / 385 | 0.860 / 0.860 | +| 15–120 分钟 | 全部 77 | 0.219 ± 0.036 | 0.500 | −0.01 | 23 / 77 | 0.869 / 0.864 | +| 15–120 分钟 | 未调参 57 | 0.173 ± 0.038 | 0.554 | −1.42 | 14 / 57 | 0.845 / 0.854 | +| 15–120 分钟 | 伪造经历对照 | 0.190 ± 0.015 | 0.507 | −0.50 | 87 / 385 | 0.860 / 0.849 | +| **≥ 60 分钟,正对照** | 全部 77 | **0.822 ± 0.034** | **0.096** | **12.29** | **68 / 77** | 0.774 / 0.736 | +| ≥ 60 分钟,正对照 | 未调参 57 | 0.820 ± 0.040 | 0.108 | 10.26 | 51 / 57 | 0.723 / 0.715 | + +伪造经历对照的 n = 77 × 5 种子 = 385,标准误按 385 行计、偏乐观,只作水平参照。 + +读法: + +1. 真实经历三档全部在瞎猜的一个标准误之内;伪造经历同样在瞎猜水平,引擎对记录时间没有经历以外的偏好。 +2. 正对照只把年份挪了 ±3 年,挑中率就到 82%:只要经历里真有指向真值的信号,这套流程测得出来。 +3. 正对照里「对上」比例真值 77% vs 随机 74%,几乎没差,挑中率却是 82% vs 20%——**「对上了几件」本身不是证据**,有没有区分力要看与随机时间相比的排名。 + +## 4. 与既往研究的关系 + +- 与 09-14 定论页、09-29 打分研究、10-01 角度技法、10-05 纳迪秒级的结论一致:在公开传记经历上,事件匹配找不到出生时间信号。本检验把范围从「相邻分钟」扩到「全天不同的盘」,同样无信号。 +- 09 月「六题回放头名 0.64」等数字的答案是按真实时间的盘作答的(上帝视角),性质上与本文正对照相同,不是区分力证据。 + +## 5. 未覆盖与边界 + +- 未测 AI 叙述层(无模型凭据)。叙述的依据就是这套评分。 +- 经历多为年精度(维基)。真实用户可能记得月 / 日,但 1 分钟出生时间差约对应大运推移 3.8 天(09-29 研究),提升有上限;若要重新打开评分,须先在月 / 日精度的独立数据上通过本检验。 +- 开放集、非盲测;v4 继承的 20 例曾用于调参,另列未调参 57 例,结论不变。 + +## 6. 复现 + +```bash +python scripts/research/rectification_blind_pick.py --out docs/research/rectification_blind_pick_2026_12_05.json # 约 3 分钟 +python scripts/research/rectification_blind_pick.py --positive-control --out docs/research/rectification_blind_pick_positive_control_2026_12_05.json # 约 1 分钟 +python -m pytest tests/test_rectification_blind_pick.py -q +``` + +**重新打开评分的门槛(建议)**:任何新评分方法须在本检验的主设定下,真实经历挑中率显著高于 0.20(预先登记、未调参子集上),且伪造经历对照保持在瞎猜水平。 diff --git a/docs/research/rectification_blind_pick_positive_control_2026_12_05.json b/docs/research/rectification_blind_pick_positive_control_2026_12_05.json new file mode 100644 index 000000000..534ba02dc --- /dev/null +++ b/docs/research/rectification_blind_pick_positive_control_2026_12_05.json @@ -0,0 +1,1385 @@ +{ + "dataset": "references/real_case_calibration/minute_rectification_holdout_v5.json", + "draws": 4000, + "mode": "positive_control", + "per_case": [ + { + "case": "albert_brooks_1947_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": false + }, + { + "case": "andrew_windsor_1960_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.22, + "pct": 0.309 + }, + "far_60plus": { + "hit": 0.195, + "pct": 0.326 + }, + "near_15_to_120": { + "hit": 0.177, + "pct": 0.312 + }, + "tuning_free": false + }, + { + "case": "angelina_jolie_1975_aa_v4_holdout", + "events": 8, + "far_120plus": { + "hit": 0.897, + "pct": 0.025 + }, + "far_60plus": { + "hit": 0.908, + "pct": 0.022 + }, + "near_15_to_120": { + "hit": 0.397, + "pct": 0.188 + }, + "tuning_free": false + }, + { + "case": "barack_obama_1961_aa_v4_holdout", + "events": 8, + "far_120plus": { + "hit": 0.682, + "pct": 0.086 + }, + "far_60plus": { + "hit": 0.711, + "pct": 0.079 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": false + }, + { + "case": "bernd_eichinger_1949_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": false + }, + { + "case": "chad_everett_1937_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.125, + "pct": 0.383 + }, + "far_60plus": { + "hit": 0.129, + "pct": 0.393 + }, + "near_15_to_120": { + "hit": 0.007, + "pct": 0.625 + }, + "tuning_free": false + }, + { + "case": "elizabeth_montgomery_1933_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": false + }, + { + "case": "elizabeth_taylor_1932_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": false + }, + { + "case": "iwao_takamoto_1925_aa_v4_holdout", + "events": 8, + "far_120plus": { + "hit": 0.899, + "pct": 0.025 + }, + "far_60plus": { + "hit": 0.915, + "pct": 0.022 + }, + "near_15_to_120": { + "hit": 0.763, + "pct": 0.062 + }, + "tuning_free": false + }, + { + "case": "john_robbins_1947_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.323, + "pct": 0.235 + }, + "far_60plus": { + "hit": 0.361, + "pct": 0.213 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": false + }, + { + "case": "joseph_kennedy_iii_1980_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": false + }, + { + "case": "kurt_cobain_1967_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": false + }, + { + "case": "pablo_picasso_1881_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 0.756, + "pct": 0.062 + }, + "tuning_free": false + }, + { + "case": "paul_ryan_1970_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.95, + "pct": 0.012 + }, + "far_60plus": { + "hit": 0.955, + "pct": 0.011 + }, + "near_15_to_120": { + "hit": 0.269, + "pct": 0.25 + }, + "tuning_free": false + }, + { + "case": "salma_hayek_1966_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": false + }, + { + "case": "sean_lennon_1975_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.905, + "pct": 0.025 + }, + "far_60plus": { + "hit": 0.906, + "pct": 0.022 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": false + }, + { + "case": "sigmund_freud_1856_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.737, + "pct": 0.074 + }, + "far_60plus": { + "hit": 0.74, + "pct": 0.067 + }, + "near_15_to_120": { + "hit": 0.745, + "pct": 0.062 + }, + "tuning_free": false + }, + { + "case": "steve_reich_1936_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": false + }, + { + "case": "tiger_woods_1975_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 0.693, + "pct": 0.086 + }, + "far_60plus": { + "hit": 0.724, + "pct": 0.079 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": false + }, + { + "case": "tom_kennedy_1927_aa_v4_holdout", + "events": 7, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": false + }, + { + "case": "adriana_lima_1981_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 0.952, + "pct": 0.012 + }, + "far_60plus": { + "hit": 0.919, + "pct": 0.022 + }, + "near_15_to_120": { + "hit": 0.543, + "pct": 0.125 + }, + "tuning_free": true + }, + { + "case": "agatha_christie_1890_aa_v5_holdout", + "events": 15, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "albert_einstein_1879_aa_v5_holdout", + "events": 18, + "far_120plus": { + "hit": 0.862, + "pct": 0.037 + }, + "far_60plus": { + "hit": 0.866, + "pct": 0.034 + }, + "near_15_to_120": { + "hit": 0.545, + "pct": 0.125 + }, + "tuning_free": true + }, + { + "case": "alberto_fujimori_1938_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "arthur_conan_doyle_1859_aa_v5_holdout", + "events": 19, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "audrey_hepburn_1929_aa_v5_holdout", + "events": 11, + "far_120plus": { + "hit": 0.95, + "pct": 0.012 + }, + "far_60plus": { + "hit": 0.954, + "pct": 0.011 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "ayrton_senna_1960_aa_v5_holdout", + "events": 12, + "far_120plus": { + "hit": 0.737, + "pct": 0.074 + }, + "far_60plus": { + "hit": 0.714, + "pct": 0.079 + }, + "near_15_to_120": { + "hit": 0.386, + "pct": 0.188 + }, + "tuning_free": true + }, + { + "case": "barbra_streisand_1942_aa_v5_holdout", + "events": 16, + "far_120plus": { + "hit": 0.584, + "pct": 0.123 + }, + "far_60plus": { + "hit": 0.59, + "pct": 0.124 + }, + "near_15_to_120": { + "hit": 0.56, + "pct": 0.125 + }, + "tuning_free": true + }, + { + "case": "beyonce_1981_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 0.253, + "pct": 0.284 + }, + "far_60plus": { + "hit": 0.277, + "pct": 0.27 + }, + "near_15_to_120": { + "hit": 0.549, + "pct": 0.125 + }, + "tuning_free": true + }, + { + "case": "bob_dylan_1941_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "brigitte_bardot_1934_aa_v5_holdout", + "events": 19, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "bruce_lee_1940_aa_v5_holdout", + "events": 12, + "far_120plus": { + "hit": 0.683, + "pct": 0.086 + }, + "far_60plus": { + "hit": 0.719, + "pct": 0.079 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "catherine_deneuve_1943_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "charles_de_gaulle_1890_aa_v5_holdout", + "events": 17, + "far_120plus": { + "hit": 0.526, + "pct": 0.148 + }, + "far_60plus": { + "hit": 0.556, + "pct": 0.135 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "cher_1946_aa_v5_holdout", + "events": 17, + "far_120plus": { + "hit": 0.904, + "pct": 0.025 + }, + "far_60plus": { + "hit": 0.912, + "pct": 0.022 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "clint_eastwood_1930_aa_v5_holdout", + "events": 17, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "daniel_barenboim_1942_aa_v5_holdout", + "events": 18, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 0.754, + "pct": 0.062 + }, + "tuning_free": true + }, + { + "case": "diane_cilento_1932_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "dingdong_dantes_1980_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "donald_trump_1946_aa_v5_holdout", + "events": 20, + "far_120plus": { + "hit": 0.764, + "pct": 0.062 + }, + "far_60plus": { + "hit": 0.791, + "pct": 0.056 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "edith_piaf_1915_aa_v5_holdout", + "events": 15, + "far_120plus": { + "hit": 0.81, + "pct": 0.049 + }, + "far_60plus": { + "hit": 0.834, + "pct": 0.045 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "elvis_presley_1935_aa_v5_holdout", + "events": 14, + "far_120plus": { + "hit": 0.799, + "pct": 0.049 + }, + "far_60plus": { + "hit": 0.832, + "pct": 0.045 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "francois_hollande_1954_aa_v5_holdout", + "events": 17, + "far_120plus": { + "hit": 0.46, + "pct": 0.173 + }, + "far_60plus": { + "hit": 0.446, + "pct": 0.18 + }, + "near_15_to_120": { + "hit": 0.556, + "pct": 0.125 + }, + "tuning_free": true + }, + { + "case": "frida_kahlo_1907_aa_v5_holdout", + "events": 15, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "george_w_bush_1946_aa_v5_holdout", + "events": 15, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 0.752, + "pct": 0.062 + }, + "tuning_free": true + }, + { + "case": "gisele_bundchen_1980_aa_v5_holdout", + "events": 15, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 0.909, + "pct": 0.022 + }, + "near_15_to_120": { + "hit": 0.271, + "pct": 0.25 + }, + "tuning_free": true + }, + { + "case": "gustavo_kuerten_1976_aa_v5_holdout", + "events": 10, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "imelda_marcos_1929_aa_v5_holdout", + "events": 16, + "far_120plus": { + "hit": 0.0, + "pct": 0.951 + }, + "far_60plus": { + "hit": 0.0, + "pct": 0.949 + }, + "near_15_to_120": { + "hit": 0.004, + "pct": 0.781 + }, + "tuning_free": true + }, + { + "case": "janis_joplin_1943_aa_v5_holdout", + "events": 12, + "far_120plus": { + "hit": 0.38, + "pct": 0.21 + }, + "far_60plus": { + "hit": 0.414, + "pct": 0.191 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "jennifer_aniston_1969_aa_v5_holdout", + "events": 12, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "jimi_hendrix_1942_aa_v5_holdout", + "events": 12, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "johnny_depp_1963_aa_v5_holdout", + "events": 17, + "far_120plus": { + "hit": 0.0, + "pct": 0.957 + }, + "far_60plus": { + "hit": 0.0, + "pct": 0.944 + }, + "near_15_to_120": { + "hit": 0.014, + "pct": 0.719 + }, + "tuning_free": true + }, + { + "case": "judy_garland_1922_aa_v5_holdout", + "events": 17, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "juscelino_kubitschek_1902_aa_v5_holdout", + "events": 15, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 0.964, + "pct": 0.011 + }, + "near_15_to_120": { + "hit": 0.557, + "pct": 0.125 + }, + "tuning_free": true + }, + { + "case": "kamala_harris_1964_aa_v5_holdout", + "events": 14, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 0.756, + "pct": 0.062 + }, + "tuning_free": true + }, + { + "case": "leonardo_dicaprio_1974_aa_v5_holdout", + "events": 11, + "far_120plus": { + "hit": 0.494, + "pct": 0.16 + }, + "far_60plus": { + "hit": 0.53, + "pct": 0.146 + }, + "near_15_to_120": { + "hit": 0.401, + "pct": 0.188 + }, + "tuning_free": true + }, + { + "case": "lionel_messi_1987_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 0.956, + "pct": 0.011 + }, + "near_15_to_120": { + "hit": 0.177, + "pct": 0.312 + }, + "tuning_free": true + }, + { + "case": "lou_diamond_phillips_1962_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 0.0, + "pct": 0.951 + }, + "far_60plus": { + "hit": 0.0, + "pct": 0.933 + }, + "near_15_to_120": { + "hit": 0.007, + "pct": 0.75 + }, + "tuning_free": true + }, + { + "case": "manuel_puig_1932_aa_v5_holdout", + "events": 8, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "marilyn_monroe_1926_aa_v5_holdout", + "events": 16, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 0.739, + "pct": 0.062 + }, + "tuning_free": true + }, + { + "case": "meryl_streep_1949_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 0.739, + "pct": 0.062 + }, + "tuning_free": true + }, + { + "case": "miley_cyrus_1992_aa_v5_holdout", + "events": 20, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "muhammad_ali_1942_aa_v5_holdout", + "events": 18, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "nicolas_sarkozy_1955_aa_v5_holdout", + "events": 16, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "pele_1940_aa_v5_holdout", + "events": 15, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "piolo_pascual_1977_aa_v5_holdout", + "events": 8, + "far_120plus": { + "hit": 0.863, + "pct": 0.037 + }, + "far_60plus": { + "hit": 0.871, + "pct": 0.034 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "prince_1958_aa_v5_holdout", + "events": 14, + "far_120plus": { + "hit": 0.946, + "pct": 0.012 + }, + "far_60plus": { + "hit": 0.957, + "pct": 0.011 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "rafael_nadal_1986_aa_v5_holdout", + "events": 19, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 0.563, + "pct": 0.125 + }, + "tuning_free": true + }, + { + "case": "rudy_fernandez_1952_aa_v5_holdout", + "events": 10, + "far_120plus": { + "hit": 0.001, + "pct": 0.852 + }, + "far_60plus": { + "hit": 0.003, + "pct": 0.775 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "salvador_dali_1904_aa_v5_holdout", + "events": 13, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "serena_williams_1981_aa_v5_holdout", + "events": 14, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 1.0, + "pct": 0.0 + }, + "tuning_free": true + }, + { + "case": "silvio_santos_1930_aa_v5_holdout", + "events": 11, + "far_120plus": { + "hit": 0.0, + "pct": 0.944 + }, + "far_60plus": { + "hit": 0.0, + "pct": 0.938 + }, + "near_15_to_120": { + "hit": 0.001, + "pct": 0.844 + }, + "tuning_free": true + }, + { + "case": "sophia_loren_1934_aa_v5_holdout", + "events": 14, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 0.746, + "pct": 0.062 + }, + "tuning_free": true + }, + { + "case": "venus_williams_1980_aa_v5_holdout", + "events": 14, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 0.76, + "pct": 0.062 + }, + "tuning_free": true + }, + { + "case": "vincent_van_gogh_1853_aa_v5_holdout", + "events": 15, + "far_120plus": { + "hit": 1.0, + "pct": 0.0 + }, + "far_60plus": { + "hit": 1.0, + "pct": 0.0 + }, + "near_15_to_120": { + "hit": 0.756, + "pct": 0.062 + }, + "tuning_free": true + }, + { + "case": "whitney_houston_1963_aa_v5_holdout", + "events": 12, + "far_120plus": { + "hit": 0.855, + "pct": 0.037 + }, + "far_60plus": { + "hit": 0.868, + "pct": 0.034 + }, + "near_15_to_120": { + "hit": 0.28, + "pct": 0.25 + }, + "tuning_free": true + }, + { + "case": "zinedine_zidane_1972_aa_v5_holdout", + "events": 16, + "far_120plus": { + "hit": 0.853, + "pct": 0.037 + }, + "far_60plus": { + "hit": 0.869, + "pct": 0.034 + }, + "near_15_to_120": { + "hit": 0.567, + "pct": 0.125 + }, + "tuning_free": true + } + ], + "step_minutes": 15, + "summary": { + "far_120plus": { + "real_all": { + "events_matched_decoy": 0.736, + "events_matched_truth": 0.774, + "mean_percentile": 0.098, + "n": 77, + "pick1of5": 0.82, + "pick_se": 0.034, + "truth_top20_cases": 67, + "z_vs_chance": 12.22 + }, + "real_tuning_free": { + "events_matched_decoy": 0.716, + "events_matched_truth": 0.723, + "mean_percentile": 0.11, + "n": 57, + "pick1of5": 0.819, + "pick_se": 0.041, + "truth_top20_cases": 50, + "z_vs_chance": 10.19 + } + }, + "far_60plus": { + "real_all": { + "events_matched_decoy": 0.736, + "events_matched_truth": 0.774, + "mean_percentile": 0.096, + "n": 77, + "pick1of5": 0.822, + "pick_se": 0.034, + "truth_top20_cases": 68, + "z_vs_chance": 12.29 + }, + "real_tuning_free": { + "events_matched_decoy": 0.715, + "events_matched_truth": 0.723, + "mean_percentile": 0.108, + "n": 57, + "pick1of5": 0.82, + "pick_se": 0.04, + "truth_top20_cases": 51, + "z_vs_chance": 10.26 + } + }, + "near_15_to_120": { + "real_all": { + "events_matched_decoy": 0.74, + "events_matched_truth": 0.774, + "mean_percentile": 0.095, + "n": 77, + "pick1of5": 0.781, + "pick_se": 0.036, + "truth_top20_cases": 67, + "z_vs_chance": 12.3 + }, + "real_tuning_free": { + "events_matched_decoy": 0.701, + "events_matched_truth": 0.723, + "mean_percentile": 0.101, + "n": 57, + "pick1of5": 0.772, + "pick_se": 0.041, + "truth_top20_cases": 50, + "z_vs_chance": 10.42 + } + } + } +} diff --git a/scripts/research/rectification_blind_pick.py b/scripts/research/rectification_blind_pick.py new file mode 100644 index 000000000..9149a53f8 --- /dev/null +++ b/scripts/research/rectification_blind_pick.py @@ -0,0 +1,206 @@ +"""Blind-pick test for the rectification event scorer (2026-12-05). + +Question (product owner): if the agent matches a person's life events against candidate birth times and says +"this time fits", would a random birth time "fit" just as well? Many candidates times many interpretive angles +always yield some match (multiple comparisons). Test: give the scorer the recorded time and random times, do +not say which is real, and see whether it picks the real one more often than chance. + +Pre-registered design (fixed before the first run): +- Data: v5 holdout, 77 public Rodden-AA cases, 964 dated life events. +- Scorer: the production event engine `compute_event_candidate_rows`, all layers, the dataset's ayanamsa / node mode. +- Candidates per case: 96 times on the birth date every 15 minutes, aligned so the recorded time is one of them. +- PRIMARY: 1-of-5 blind pick. Truth plus 4 decoys drawn from the grid times at least 60 minutes (circular) from + the truth; the scorer "picks" the top score, ties split evenly. 4000 draws per case; chance = 0.20. +- SECONDARY: truth's percentile among truth + decoy pool (0 = best, chance mean 0.5); cases with truth in top 20%. + Also decoys >= 120 min and 15-120 min. +- NEGATIVE CONTROL: same people, same event count / domains / precision, each event's date redrawn uniformly between + that person's earliest and latest event year (5 seeds). Must sit at chance. +- POSITIVE CONTROL (`--positive-control`): each event's year moved within +-3 years to the year that best suits the + recorded time's own chart. If the harness can detect a signal, truth must win clearly. +- BARNUM CHECK: share of events earning positive points ("matched") for truth vs for decoys. + +Offline only; public cases only; does not touch production defaults. +""" +from __future__ import annotations + +import argparse +import json +import math +import random +import statistics +import sys +from datetime import datetime, timedelta +from pathlib import Path +from typing import Any, Sequence + +ROOT = Path(__file__).resolve().parents[2] +for path in (ROOT, ROOT / "scripts"): + if str(path) not in sys.path: + sys.path.insert(0, str(path)) + +HOLDOUT_V5 = ROOT / "references" / "real_case_calibration" / "minute_rectification_holdout_v5.json" +STEP_MINUTES = 15 +DRAWS = 4000 +CONTROL_SEEDS = (11, 22, 33, 44, 55) +DESIGNS = {"far_60plus": (60, 720), "far_120plus": (120, 720), "near_15_to_120": (15, 120)} +POSITIVE_NUDGE_YEARS = 3 + +Scored = tuple[int, float, float] # (minute of day, score, share of events matched) + + +def circular_minutes(a: int, b: int) -> int: + d = abs(a - b) % 1440 + return min(d, 1440 - d) + + +def grid_times(truth: datetime, step: int = STEP_MINUTES) -> list[datetime]: + """Every `step` minutes on the truth's calendar date, the truth itself included.""" + return [datetime.combine(truth.date(), (truth + timedelta(minutes=step * k)).time()) for k in range(1440 // step)] + + +def plain_events(case: dict[str, Any]) -> list[dict[str, Any]]: + return [{"id": e["id"], "domain": e["domain"], "date": e["date"], "precision": e["precision"]} for e in case["events"]] + + +def base_request(case: dict[str, Any], data: dict[str, Any]) -> dict[str, Any]: + b = case["birth"] + return {"birth_date": b["date"], "start_time": "00:00", "end_time": "23:59", "lat": b["latitude"], + "lon": b["longitude"], "tz": b["timezone_offset"], "ayanamsa": data["ayanamsa"], + "node_mode": data["node_mode"], "minute_step": 1} + + +def truth_time(case: dict[str, Any]) -> datetime: + b = case["birth"] + return datetime.strptime(f"{b['date']} {b['time']}", "%Y-%m-%d %H:%M") + + +def score_grid(case: dict[str, Any], data: dict[str, Any], events: list[dict[str, Any]]) -> list[Scored]: + from scripts.active_rectification_event_engine import compute_event_candidate_rows + + cands = grid_times(truth_time(case)) + rows = compute_event_candidate_rows({**base_request(case, data), "events": events}, candidates=cands) + n_events = max(1, len(events)) + out: list[Scored] = [] + for cand, row in zip(cands, rows): + matched = {e["event_id"] for e in row["evidence"] if e.get("points", 0) > 0} + out.append((cand.hour * 60 + cand.minute, float(row["score"]), len(matched) / n_events)) + return out + + +def evaluate(scored: Sequence[Scored], truth_minute: int, decoy_min: int, decoy_max: int, + rng: random.Random, draws: int = DRAWS) -> dict[str, Any]: + truth = next(s for s in scored if s[0] == truth_minute) + pool = [s for s in scored if decoy_min <= circular_minutes(s[0], truth_minute) <= decoy_max] + hit = 0.0 + for _ in range(draws): + scores = [truth[1]] + [d[1] for d in rng.sample(pool, 4)] + best = max(scores) + if truth[1] == best: + hit += 1 / scores.count(best) + better = sum(1 for p in pool if p[1] > truth[1]) + ties = sum(1 for p in pool if p[1] == truth[1]) + pct = (better + ties / 2) / len(pool) + return {"hit": hit / draws, "pct": pct, "top20": pct < 0.2, + "match_truth": truth[2], "match_decoy": statistics.mean(p[2] for p in pool)} + + +def fake_events(case: dict[str, Any], rng: random.Random) -> list[dict[str, Any]]: + years = [int(e["date"][:4]) for e in case["events"]] + lo, hi = min(years), max(years) + out = [] + for e in case["events"]: + y = rng.randint(lo, hi) + if e["precision"] == "year": + date = f"{y}" + elif e["precision"] == "month": + date = f"{y}-{rng.randint(1, 12):02d}" + else: + date = f"{y}-{rng.randint(1, 12):02d}-{rng.randint(1, 28):02d}" + out.append({"id": e["id"], "domain": e["domain"], "date": date, "precision": e["precision"]}) + return out + + +def truth_favoured_events(case: dict[str, Any], data: dict[str, Any]) -> list[dict[str, Any]]: + """Positive control: each event moved to the year (within +-3) that scores best for the recorded time.""" + from scripts.active_rectification_event_engine import compute_event_candidate_rows + + truth = truth_time(case) + base = base_request(case, data) + out = [] + for e in case["events"]: + y = int(e["date"][:4]) + best: tuple[float, dict[str, Any]] | None = None + for yy in range(y - POSITIVE_NUDGE_YEARS, y + POSITIVE_NUDGE_YEARS + 1): + ev = {"id": e["id"], "domain": e["domain"], "date": str(yy), "precision": "year"} + s = compute_event_candidate_rows({**base, "events": [ev]}, candidates=[truth])[0]["score"] + if best is None or s > best[0]: + best = (s, ev) + assert best is not None + out.append(best[1]) + return out + + +def summarize(rows: Sequence[dict[str, Any]]) -> dict[str, Any]: + n = len(rows) + hits = [r["hit"] for r in rows] + pcts = [r["pct"] for r in rows] + mean_pct = statistics.mean(pcts) + return {"n": n, "pick1of5": round(statistics.mean(hits), 3), + "pick_se": round(statistics.pstdev(hits) / math.sqrt(n), 3), + "mean_percentile": round(mean_pct, 3), + "z_vs_chance": round((0.5 - mean_pct) / (math.sqrt(1 / 12) / math.sqrt(n)), 2), + "truth_top20_cases": sum(r["top20"] for r in rows), + "events_matched_truth": round(statistics.mean(r["match_truth"] for r in rows), 3), + "events_matched_decoy": round(statistics.mean(r["match_decoy"] for r in rows), 3)} + + +def run(data: dict[str, Any], *, positive_control: bool = False) -> dict[str, Any]: + real: dict[str, list[dict[str, Any]]] = {k: [] for k in DESIGNS} + control: dict[str, list[dict[str, Any]]] = {k: [] for k in DESIGNS} + per_case = [] + for i, case in enumerate(data["cases"]): + t = truth_time(case) + tmin = t.hour * 60 + t.minute + tuning_free = not case.get("inherited_from_v4", False) + events = truth_favoured_events(case, data) if positive_control else plain_events(case) + scored = score_grid(case, data, events) + rec: dict[str, Any] = {"case": case["case_id"], "tuning_free": tuning_free, "events": len(events)} + for k, (lo, hi) in DESIGNS.items(): + r = evaluate(scored, tmin, lo, hi, random.Random(f"{case['case_id']}-{k}")) + r["tuning_free"] = tuning_free + real[k].append(r) + rec[k] = {"hit": round(r["hit"], 3), "pct": round(r["pct"], 3)} + if not positive_control: + for seed in CONTROL_SEEDS: + fscored = score_grid(case, data, fake_events(case, random.Random(f"{case['case_id']}-{seed}"))) + for k, (lo, hi) in DESIGNS.items(): + r = evaluate(fscored, tmin, lo, hi, random.Random(f"{case['case_id']}-{k}-{seed}")) + r["tuning_free"] = tuning_free + control[k].append(r) + per_case.append(rec) + print(i + 1, case["case_id"], rec["far_60plus"], file=sys.stderr, flush=True) + summary: dict[str, Any] = {} + for k in DESIGNS: + summary[k] = {"real_all": summarize(real[k]), + "real_tuning_free": summarize([r for r in real[k] if r["tuning_free"]])} + if not positive_control: + summary[k]["fake_events_control"] = summarize(control[k]) + return {"mode": "positive_control" if positive_control else "real_events", + "dataset": str(HOLDOUT_V5.relative_to(ROOT)), "step_minutes": STEP_MINUTES, "draws": DRAWS, + "summary": summary, "per_case": per_case} + + +def main(argv: Sequence[str] | None = None) -> int: + parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + parser.add_argument("--out", type=Path, required=True) + parser.add_argument("--positive-control", action="store_true") + args = parser.parse_args(argv) + data = json.loads(HOLDOUT_V5.read_text(encoding="utf-8")) + result = run(data, positive_control=args.positive_control) + args.out.write_text(json.dumps(result, ensure_ascii=False, indent=2, sort_keys=True) + "\n", encoding="utf-8") + print(json.dumps(result["summary"], ensure_ascii=False, indent=2)) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/tests/test_rectification_blind_pick.py b/tests/test_rectification_blind_pick.py new file mode 100644 index 000000000..a0cb97cbe --- /dev/null +++ b/tests/test_rectification_blind_pick.py @@ -0,0 +1,62 @@ +"""Blind-pick research helpers (2026-12-05). Offline; synthetic score grids, no ephemeris.""" +from __future__ import annotations + +from datetime import datetime +from random import Random + +import pytest + +from scripts.research import rectification_blind_pick as bp + + +def test_circular_minutes_wraps_midnight(): + assert bp.circular_minutes(10, 1430) == 20 + assert bp.circular_minutes(0, 720) == 720 + + +def test_grid_keeps_truth_and_date(): + truth = datetime(1950, 3, 4, 23, 50) + grid = bp.grid_times(truth) + assert len(grid) == 96 + assert grid[0] == truth + assert {g.date() for g in grid} == {truth.date()} + + +def _grid(scores: dict[int, float]) -> list[bp.Scored]: + return [(m, scores.get(m, 0.0), 0.5) for m in range(0, 1440, 15)] + + +def test_evaluate_truth_always_best_wins_every_draw(): + r = bp.evaluate(_grid({600: 9.0}), 600, 60, 720, Random(1), draws=200) + assert r["hit"] == 1.0 and r["pct"] == 0.0 and r["top20"] + + +def test_evaluate_all_tied_is_chance(): + r = bp.evaluate(_grid({}), 600, 60, 720, Random(1), draws=200) + assert r["hit"] == pytest.approx(0.2) + assert r["pct"] == pytest.approx(0.5) + + +def test_evaluate_excludes_near_times_from_far_pool(): + # A near neighbour with a higher score must not count against truth in the far design. + r = bp.evaluate(_grid({600: 5.0, 615: 9.0}), 600, 60, 720, Random(1), draws=200) + assert r["hit"] == 1.0 + + +def test_fake_events_keep_shape_and_year_range(): + case = {"events": [ + {"id": "a", "domain": "career", "date": "1970", "precision": "year"}, + {"id": "b", "domain": "family", "date": "1980-05", "precision": "month"}, + {"id": "c", "domain": "health_pressure", "date": "1990-01-02", "precision": "day"}, + ]} + fakes = bp.fake_events(case, Random(3)) + assert [(f["id"], f["domain"], f["precision"]) for f in fakes] == [ + ("a", "career", "year"), ("b", "family", "month"), ("c", "health_pressure", "day")] + assert all(1970 <= int(f["date"][:4]) <= 1990 for f in fakes) + assert [len(f["date"]) for f in fakes] == [4, 7, 10] + + +def test_summarize_reports_chance_z_near_zero(): + rows = [{"hit": 0.2, "pct": 0.5, "top20": False, "match_truth": 0.8, "match_decoy": 0.8}] * 10 + s = bp.summarize(rows) + assert s["pick1of5"] == 0.2 and s["z_vs_chance"] == 0.0