fix(seed): restore deterministic alerts for TestCooper/TestRocky (GRO-1962 follow-up) #116

Closed
Lint Roller wants to merge 3 commits from fix/GRO-1962-uat-seed-pet-medicalalerts into dev

3 Commits

Author SHA1 Message Date
Paperclip 37c0bb22dd fix(seed): restore deterministic alerts for TestCooper/TestRocky (GRO-1962 follow-up)
CI / Test (pull_request) Successful in 12s
CI / Lint & Typecheck (pull_request) Successful in 14s
CI / Build & Push Docker Images (pull_request) Successful in 55s
QA found TC-API-3.23/3.24 became flaky after PR #115 moved
TestCooper/TestRocky alert logic inside rand()<0.3, making those
pets' alerts probabilistic (~30% instead of 100%).

This fix restores deterministic alerts:
- TestCooper always gets a behavioral alert
- TestRocky always gets a skin alert
- All other UAT test pets follow the 30% random distribution

Deterministic alerts on 2 of 507 pets (~0.4%) do not meaningfully
shift the overall distribution from the 25-35% target band.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 22:24:17 +00:00
Paperclip 20d44faec8 docs(UAT_PLAYBOOK): add TC-API-3.25 and TC-API-3.26 for pet count and medicalAlerts distribution
CI / Test (pull_request) Successful in 14s
CI / Lint & Typecheck (pull_request) Successful in 14s
CI / Build & Push Docker Images (pull_request) Successful in 1m1s
Updated UAT_PLAYBOOK.md §3.2 — new test cases for GRO-1962:
- TC-API-3.25: Verify 30+ total pets in UAT DB
- TC-API-3.26: Verify 25-35% medicalAlerts distribution

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-31 22:14:13 +00:00
Paperclip 5d6fb4b43c fix(seed): remove stale uc.petName closure ref, correct medicalAlerts distribution to 30%
Fixes GRO-1962:
- Random pet loop (lines 968-982): removed stale uc.petName references
  that caused runtime ReferenceError (uc declared ~80 lines later at line 1048)
- UAT test clients loop: moved TestCooper/TestRocky deterministic checks
  inside the rand()<0.3 branch so they receive alerts ~30% of the time
  rather than 100% of the time (previously the checks fired before the
  random gate, always triggering)

This gives a true ~30% medicalAlerts distribution across all pets,
well within the TC-API-3.22 acceptance criteria band of 25-35%.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-31 22:14:13 +00:00