The giveReview
function uses relative timestamps to enforce a one-week delay between reviews, allowing reviews to be submitted too early or too late relative to the session’s weekly schedule. This violates the protocol’s invariant that students must receive exactly one review per session-aligned week (Weeks 1–4) and introduces fairness issues, upgrade blockages, and protocol inconsistencies.
This check only ensures that at least one week has passed since the last review, not that the review falls into the correct session week.
A teacher could:
Submit Week 1’s review on Day 2.
Submit Week 2’s review on Day 9 (just one week later).
This misalignment shifts the review window forward or backward, breaking the 1:1 mapping between reviews and session weeks.
Session Start: January 1.
The teacher submits first review on January 2.
Second review allowed on January 9.
Result: Reviews are completed before Week 4 ends, but are misaligned with actual session weeks.
Teacher submits Week 3 review late, e.g., on January 25.
Week 4 review is now blocked until after January 31.
Result: Session ends with only 3 reviews, blocking the student's upgrade.
Replace the relative check with an absolute week check based on session start time:
Enforces one review per absolute week, no overlap or shifting.
Prevents early stacking or missed reviews.
Maintains fairness and session integrity.
Prevents upgrade blocks due to misaligned reviews.
Fix review logic as above using sessionStart + N * 1 weeks
.
Add tests for early and late review attempts.
Emit an event on review rejection due to timing to aid debugging.
Frontends and scripts should be updated to reflect the new review timing.
This logical bug fundamentally breaks the protocol's time-based structure and introduces real risks of upgrade failure, inconsistent scoring, and unfair progression. Aligning reviews with absolute session weeks is critical to upholding the protocol's integrity.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.