package engine import "testing" // TestFrozenScoringConstants pins the EXACT value of every scoring constant, not merely an invariant // over them. TestWeightsSumToOne proves the six weights add to 1.00, but a redistribution (say // clearance 0.30 and skills 0.20) still sums to 1.00 while silently changing every score. The platform // is a shared, three tool product whose acceptance criterion is that the same candidate shows the same // Match and Mission Readiness numbers in screenMATCH, slateMATCH, and missionMATCH, and that the // weights and bands never change. This test is the guard: any edit to a weight, a band cut, the // semantic threshold, or the model version fails the build, so a refactor that splits the one engine // across three tool routers can never drift a number. Change a value here only with explicit // instruction, and bump and register ModelVersion when you do. func TestFrozenScoringConstants(t *testing.T) { cases := []struct { name string got string want string }{ {"WeightClearance", WeightClearance.String(), "0.25"}, {"WeightSkills", WeightSkills.String(), "0.25"}, {"WeightCerts", WeightCerts.String(), "0.15"}, {"WeightCustomer", WeightCustomer.String(), "0.15"}, {"WeightExperience", WeightExperience.String(), "0.1"}, {"WeightLocation", WeightLocation.String(), "0.1"}, {"BandGreenMin", BandGreenMin.String(), "90"}, {"BandYellowMin", BandYellowMin.String(), "75"}, {"DefaultSemanticThreshold", DefaultSemanticThreshold.String(), "0.62"}, } for _, c := range cases { if c.got != c.want { t.Errorf("%s is %s, frozen value is %s: weights and bands must not change", c.name, c.got, c.want) } } if ModelVersion != "v1.4.0" { t.Errorf("ModelVersion is %q, frozen value is %q: bump it only when the weights, band cuts, or semantic threshold change, and register the new version", ModelVersion, "v1.4.0") } }