talos-access / CHECKPOINTS.md
Greg
Claude Opus 4.7 (1M context)
Preparar despliegue en fly.io: monolito dockerizado + seeder demo
6aa6081
|
Raw History Blame Contribute Delete
4.53 kB

CHECKPOINTS — System Verification Criteria

Gatekeeping checklist for Reviewer audits. Each item must be explicitly satisfied ([x]) or failed ([ ]) before closing a cycle.

Last verified: 2026-05-28 — method: source inspection + python -m pytest tests/ (12 passed). End-to-end runtime flows verified by code-path presence, not live click-through unless noted.


Infrastructure

  • init.sh is deprecated — no longer the test runner per project decision. Run python -m pytest tests/ directly.
  • Test suite executes and passes: python -m pytest tests/ → 12 passed (2026-05-28)
  • Python 3.12.4 available; Node.js and Docker present for app runtime

Authentication & Security

  • Login rejects invalid credentials with 401
  • JWT tokens expire after configured timeout (default 60 min)
  • RBAC enforced on all protected endpoints
  • Multi-tenant isolation via account_id on all queries
  • JWT secret is not the default value in production .env
  • Password reset flow works: admin generates token → user redeems token → password changed (auth.py admin-reset-password / reset-password)
  • Password reset token expires after 24 hours (auth.py:77 set, :96 checked)
  • Token-based password reset requires minimum 6 character new password (auth.py:102)

Attendance Core Logic

  • present_count correctly counts records with action='in' or legacy null-action-without-checkout (teacher.py:577)
  • absent_count is computed as total - present_count (teacher.py:578)
  • Teacher swipe attendance creates records with correct section/student
  • Batch toggle creates/deletes attendance records correctly
  • Self check-in (manual and facial) respects holiday calendar (is_holiday in attendances.py, facial.py)
  • Teacher swipe/batch-toggle/toggle blocked on holidays (is_holiday in teacher.py)
  • Facial check-in blocked on holidays (is_holiday in facial.py)

Enrollment & Sections

  • Enrollment unique constraint is (section_id, student_id) — allows multi-section, prevents duplicates
  • Migration 017 applied successfully (33cb4ee027ee_fix_enrollment_unique_constraint.py)
  • Single enrollment POST returns 409 if section is at capacity (enrollments.py:83)
  • Bulk enrollment skips students over capacity with error message (enrollments.py:188)
  • Enrollment update returns 409 if target section is at capacity (enrollments.py:109)

Representative ("Mis Hijos")

  • GET /representative/children returns linked children with sections, schedule, attendance
  • Frontend page shows child list with attendance cards and status indicators
  • Schedule view per child renders correctly

School Calendar & Schedule

  • Holiday model exists with name, type (national/school/vacation) and date range start_date/end_date (migration 020 upgraded single date → range)
  • Holiday CRUD works via /settings/holidays endpoints (settings.py:124+)
  • Holidays page exists in admin UI with create/delete by year (HolidaysPage.tsx)
  • Schedule modal hides Saturday/Sunday by default with toggle to show

Audit

  • GET /audit-logs returns paginated, filterable results (admin only) (audit_logs.py:37, PaginatedAuditLogs)
  • Audit logs page exists in admin UI with table and filters (AuditLogsPage.tsx)

Role Workflows

  • Administrativo sees Usuarios, Secciones, Matrículas, Reportes in sidebar (Sidebar.tsx)
  • Obrero sees Mi Asistencia as primary view (Sidebar.tsx)
  • GET /reports/late-arrivals returns late/early analytics grouped by student (reports.py:35)
  • Late arrivals page exists with date range filter and visual indicators (LateArrivalsPage.tsx)

Documentation & Tests

  • CHECKPOINTS.md exists and is up to date
  • docs/architecture.md exists with system layer documentation
  • docs/conventions.md exists with style guidelines
  • Pytest fixtures exist with in-memory SQLite database for testing (conftest.py)
  • Test coverage ≥20% for attendance, enrollment, and auth logic — FAILING (0%). tests/ use shadow models defined inline in conftest.py (separate TestBase) and reimplement the logic under test, so they exercise none of backend/app. Coverage on backend/app is 0%. The conftest Holiday shadow model also still uses the pre-migration-020 date column. To satisfy this criterion the suite must import and call real backend/app code.