fix(rectification): name education quality events by kind, no month for year precision (BUG-1088)
Wording only: _quality_user_meaning names start/change/interruption as 升学/学业变动/学业中断; _display_date_label drops the stored month for year-precision events. Split hash and month field unchanged; same-machine A/B (PYTHONHASHSEED=0) differs only in user_meaning/display_date_label. Re-frozen per ERR-110 under new quality_wording_2026_09_29 records; sealed rerun (20) and reported-offset sweep (900) identical to 09-21. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017eEAG8HD3mm8gsKXgk8uU8
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9686dfb945
commit
56b51e2170
@@ -1185,3 +1185,48 @@ class DomainAliasTests(unittest.TestCase):
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
|
||||
class QualityWordingTests(unittest.TestCase):
|
||||
"""BUG-1088: the education quality question names the event by kind and
|
||||
never invents a month for a year-precision event."""
|
||||
|
||||
def _meaning(self, kind: str, date: str, precision: str) -> tuple[str, str]:
|
||||
event = {
|
||||
**_education_event("00000000-0000-4000-8000-000000001088", kind, date, "fictional"),
|
||||
"precision": precision,
|
||||
}
|
||||
rows = _quality_rows(event)
|
||||
self.assertEqual(len(rows), 1)
|
||||
return rows[0]["user_meaning"], rows[0]["display_date_label"]
|
||||
|
||||
def test_education_kinds_are_not_all_called_university(self) -> None:
|
||||
for kind, name in (
|
||||
("education_start", "那次升学"),
|
||||
("education_change", "那次学业变动"),
|
||||
("education_interruption", "那次学业中断"),
|
||||
):
|
||||
with self.subTest(kind=kind):
|
||||
meaning, _label = self._meaning(kind, "2011-03-01", "month")
|
||||
self.assertIn(name, meaning)
|
||||
self.assertNotIn("上大学", meaning)
|
||||
|
||||
def test_year_precision_event_has_no_month_in_label(self) -> None:
|
||||
meaning, label = self._meaning("education_start", "2011-01-01", "year")
|
||||
self.assertEqual(label, "2011 年")
|
||||
self.assertTrue(meaning.startswith("2011 年那次升学"))
|
||||
self.assertNotIn("1 月", meaning)
|
||||
|
||||
def test_month_precision_event_keeps_month(self) -> None:
|
||||
meaning, label = self._meaning("education_change", "2012-09-01", "month")
|
||||
self.assertEqual(label, "2012 年 9 月")
|
||||
self.assertTrue(meaning.startswith("2012 年 9 月那次学业变动"))
|
||||
|
||||
def test_year_precision_keeps_split_hash_month_for_scoring_identity(self) -> None:
|
||||
# Only the wording changes; the split hash still carries the stored month so
|
||||
# probe identity (and every frozen score) is unchanged.
|
||||
rows = _quality_rows({
|
||||
**_education_event("00000000-0000-4000-8000-000000001089", "education_start", "2011-01-01", "fictional"),
|
||||
"precision": "year",
|
||||
})
|
||||
self.assertEqual(rows[0]["month"], 1)
|
||||
|
||||
@@ -23,6 +23,8 @@ IDENTITY_FORBIDDEN_PREFIXES = (
|
||||
"references/rectification_sealed_holdout.v1.json",
|
||||
"docs/research/sealed_holdout_rerun_midnight_anchor_2026_09_21",
|
||||
"docs/research/reported_offset_midnight_anchor_2026_09_21",
|
||||
"docs/research/sealed_holdout_rerun_quality_wording_2026_09_29",
|
||||
"docs/research/reported_offset_quality_wording_2026_09_29",
|
||||
"docs/research/history/",
|
||||
"artifacts/",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user