fix(aihr): gate case learning pii

This commit is contained in:
2026-07-14 23:51:24 +08:00
parent 6cebf0193d
commit e37590dd25
3 changed files with 10 additions and 1 deletions
@@ -194,6 +194,14 @@ pilot_sql_scalar "UPDATE aihr_case_record SET transcript = '手机号13900000000
pilot_output="$(AIHR_PILOT_START_DATE=2026-07-07 AIHR_PILOT_END_DATE=2026-07-10 check_pilot_samples)"
[[ "$pilot_output" == *'case_unmasked=1'* ]] || { echo "FAIL: unmasked case PII was not detected: $pilot_output" >&2; exit 1; }
pilot_sql_scalar "UPDATE aihr_case_record SET transcript = '已完成回访', learning_points = '[\"手机号13900000000\"]' WHERE tenant_id = '000000' AND status = '已入库' LIMIT 1" >/dev/null
pilot_output="$(AIHR_PILOT_START_DATE=2026-07-07 AIHR_PILOT_END_DATE=2026-07-10 check_pilot_samples)"
[[ "$pilot_output" == *'case_unmasked=1'* ]] || { echo "FAIL: unmasked learning point PII was not detected: $pilot_output" >&2; exit 1; }
pilot_sql_scalar "UPDATE aihr_case_record SET learning_points = '[\"已完成回访\"]', supervisor_comment = '请联系13900000000复核' WHERE tenant_id = '000000' AND status = '已入库' LIMIT 1" >/dev/null
pilot_output="$(AIHR_PILOT_START_DATE=2026-07-07 AIHR_PILOT_END_DATE=2026-07-10 check_pilot_samples)"
[[ "$pilot_output" == *'case_unmasked=1'* ]] || { echo "FAIL: unmasked supervisor comment PII was not detected: $pilot_output" >&2; exit 1; }
if (AIHR_PILOT_STRICT=true AIHR_PILOT_START_DATE= AIHR_PILOT_END_DATE= check_pilot_samples) >/tmp/wygj-pilot-strict-test.log 2>&1; then
echo "FAIL: strict mode accepted an implicit date window" >&2
exit 1