Publish bounded phase2 decisions and immutable evidence mapping without bulk history

This commit is contained in:
MeltAstra committed 2026-11-17 19:39:05 +08:00
1 parent 7b470069f7
commit 1e1d5a6515
180 files changed
+1947655 -3

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
import unittest
from phase2_b13_e1b import pooled,branch_decision
class FullRosterTests(unittest.TestCase):
def test_invalid_G_not_filtered_from_gate(self):
metric=lambda x:{k:dict(value=x,reason=None) for k in ['relative_l2','last_location','kendall_tau_b']}
rows=[dict(component_id=str(i),G_valid=i<102,new=metric(.9 if i<102 else 3),A=metric(1)) for i in range(204)]
result=pooled(rows);self.assertEqual(result['relative_l2']['components']['new'],204);self.assertEqual(branch_decision(result),'NOT_CONFIRMED_FIXED_RECIPE');self.assertLess(pooled(rows[:102])['relative_l2']['new_minus_A']['high'],0)
def test_full204_required_and_strict_bound(self):
m=lambda n,h:dict(relative_l2=dict(components=dict(new=n,A=n),new_minus_A=dict(high=h)))
self.assertEqual(branch_decision(m(203,-1)),'PARK_UNDEFINED');self.assertEqual(branch_decision(m(204,0)),'NOT_CONFIRMED_FIXED_RECIPE');self.assertEqual(branch_decision(m(204,-1e-12)),'CONFIRMED_FIXED_GENERIC_CONTEXT_INCREMENT')
if __name__=='__main__':unittest.main()