fix(rectification): compare health and occupation aliases through one merge (BUG-672)
Independent Staging Quality Gate / validate (push) Successful in 12m12s
Independent Staging Quality Gate / publish (push) Successful in 24m21s

Skipped or already-reported health must not be asked again as health_pressure, and occupation declined as other must still close the occupation line.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-09-13 23:08:55 +08:00
co-authored by Cursor
parent 9912760104
commit 14d199e694
13 changed files with 442 additions and 57 deletions
+37
View File
@@ -1146,5 +1146,42 @@ class QualityDistinguishDedupeTests(unittest.TestCase):
self.assertFalse(any(item["year"] in {2017, 2018, 2019} for item in career), career)
class DomainAliasTests(unittest.TestCase):
def test_health_ledger_aliases_health_pressure_for_years_oos_and_d30_order(self) -> None:
from scripts.rectification.event_probes import (
_event_years,
_existence_blocked_years,
_probe_domains,
canonical_domain,
)
from scripts.rectification.refinement_packet import oos_blind_prompts
health_event = {
"id": "00000000-0000-4000-8000-000000000099",
"domain": "health",
"summary": "2024年10月受伤",
"date": "2024-10-01",
"precision": "month",
}
years = _event_years([health_event], "health_pressure")
self.assertIn(2024, years)
self.assertIn(2024, _existence_blocked_years("health_pressure", years))
self.assertEqual(canonical_domain("health"), "health_pressure")
volunteered = {canonical_domain(health_event["domain"])}
self.assertIn("health_pressure", volunteered)
self.assertIn("health_pressure", _probe_domains({"d30"}, [health_event]))
covered_catalog = [
{"domain": "relationship", "date": "2016-03-01"},
{"domain": "career", "date": "2018-04-01"},
{"domain": "family", "date": "2019-05-01"},
{"domain": "education", "date": "2015-06-01"},
{"domain": "finance", "date": "2020-07-01"},
health_event,
]
prompts = oos_blind_prompts({"events": covered_catalog})
self.assertFalse(any(item["domain"] == "health_pressure" for item in prompts), prompts)
if __name__ == "__main__":
unittest.main()