2025-12-19: AR Tag Investigation and Fix
For: Internal (Romoland) Impact: Identified root cause of AR tagging failure affecting 1,265 enrolled students (98.1% missing tags). Created transaction-wrapped UPDATE query to properly tag 4,421 students with AR-qualifying absences using aeries_attendance_mirror directly. Context: Investigated why student 1014592 (Andy Ramirez) had “ar” tag. Found getDependentsWithAtRiskTag() queries empty school_attendance table instead of populated aeries_attendance_mirror. Only 24 of 1,289 enrolled students with AR-qualifying absences have the tag; 833 tags are from previous academic years.
Implementation:
- AR tagging logic: Queries school_attendance for codes ‘2’, ‘6’, ‘7’, ‘A’, ‘E’, ‘P’, ‘Q’, ‘S’, ‘U’, ‘W’, ‘X’ within academic year (Aug 14 - Jun 11)
- Root cause: school_attendance has 0 records; transformMirrorToSchoolAttendance() hasn’t run
- Data exists in aeries_attendance_mirror (4,561 students with AR-qualifying absences in current academic year)
- Created UPDATE query bypassing school_attendance, using aeries_attendance_mirror directly
- Query filters by academic year 2025-08-14 to 2026-06-11, only tags students without existing “ar” tag
- Identified 9 future-dated records (Jan 12-13, 2026) during verification
- Code locations: api/src/services/custom/aeriesHelpers/prismaQueries.ts, entityUtils.ts
Current State:
- Total students: 6,091
- Students with AR-qualifying absences (academic year): 4,561
- Enrolled students with AR absences: 1,289
- Students currently tagged: 857 (833 from previous years)
- Enrolled students with AR absences who have tag: 24 (1.9%)
- Query will tag: 4,421 students
Next Steps:
- Run transformMirrorToSchoolAttendance() to populate school_attendance table
- Consider enrollment filter for UPDATE query (currently tags all students including non-enrolled)
- Implement regular execution of transformation to keep school_attendance synchronized
- Consider cleanup process to remove “ar” tags from students without current AR-qualifying absences
Tags: data-analysis aeries tagging attendance romoland support