fix(rectification): compare health and occupation aliases through one merge (BUG-672)
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user