forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to src/service/exam.rsClear filter

2026-09-25

🐛 fix(clippy): params structs for the d8dad92 list doorsAhmet Kaan Gümüş · 62f10ea
🐛 fix(clippy): params structs for the d8dad92 list doors

-d warnings gate red on main: too_many_arguments on the new filter list
functions (db/service appointment list_for_requester 8/7, db/service exam
list_windowed 9/7), type_complexity on the courses filter resolve,
extra_unused_lifetimes on pomodoro whole_log. RequesterListParams and
WindowedListParams params structs (SettingsParams precedent), the courses
tuple factored into ResolvedCourseFilter, every caller and test call site
migrated; no suppressions.
✨ feat(api): server-side filters on the list doorsAhmet Kaan Gümüş · d8dad92
✨ feat(api): server-side filters on the list doors

A caller no longer has to download a capped collection and narrow it
in the client:

- events, exams: the WindowParams pair is SQL (no whole-table load)
  and gains starts_before/ends_before, so a past/completed view is
  expressible
- sessions: starts_after/starts_before, half-open months
- homework: due_after/due_before (the open/past tabs), class_course
- meals menus: slot (was a post-page JS filter — page counts lied)
- users (admin): roles= comma set; courses: kind, q, taught
- appointments + slots: teacher (or me), starts_after/starts_before,
  status
- pomodoro log: from/to, with the focus total summed in SQL
- messages and boards: q (folded literal substring)
- pool questions: ?status= is a WHERE, not a post-filter
- bank/course-notes id filters: garbage is a 400 naming the field,
  not an empty page

Absent params return today's response byte-shape; page and count
share one WHERE.

2026-09-24

✨ feat(courses): grade-ladder course templates with per-class overridesAhmet Kaan Gümüş · 450bc8c
✨ feat(courses): grade-ladder course templates with per-class overrides

course_offering per (course x grade_level 0..=12), per-class overrides on
class_course (nullable scalars + *_inherited flags), subjects/weights/
weekly-plan axis tables, instance_resolve with batched twin, resolved
title/description on instance-scoped reads, six new route groups,
integration scenario test, README regenerated. Evolution migrations
squashed into the base schema (20260912000002_courses + 20260916000001_k12_remodel).

Local-Gate: 246daa3fb3ee7b0ff507a95d6ab346bab1333a37 (1556 passed, 455s)

2026-09-17

📝 docs: rewrite the Turkish comments and doc comments in EnglishAhmet Kaan Gümüş · 7fec874
📝 docs: rewrite the Turkish comments and doc comments in English

The Rust repo's own language is English; Turkish had leaked in from the
sibling AI services. Translate every comment and doc comment to English
using the code's own vocabulary (şube -> class section, dönem -> term,
sınıf öğretmeni -> homeroom teacher, ortak sınav -> shared exam, karne ->
report card, …). Quoted Turkish letters/words that are themselves the
data under test (the text-fold examples in `text_fold`/`settings`, the
non-ASCII filename sample) are kept.

The README endpoint table is generated from those doc comments, so it is
regenerated. AGENTS.md records the convention going forward: Turkish
survives only where it is the data under test or user-visible content.

2026-09-16

✨ feat: announce an exam to sibling instances (shared-exam write surface)Ahmet Kaan Gümüş · 1824c34
✨ feat: announce an exam to sibling instances (shared-exam write surface)

b3f7395 gave `exam_audience` a read role; this gives it its writes. An exam
is owned by the instance it was created on and can now be addressed to
further instances — one sitting, one mark, standing in every addressed
section's exam list, marks report and the report card.

- `POST /exams/{id}/audience` announces the exam to another instance: the
  target must teach the exam's own catalog course and sit under the same
  academic year (400 otherwise), the owner itself is refused (400), an
  archived target year is a 409, and a repeat announce is a no-op 200.
  The write needs management rights over the exam's **owner** instance —
  the target instance's teachers have no say.
- `GET /exams/{id}/audience` lists the set (owner first, then announcement
  order), visible exactly as the exam is; drafts stay a 404 to everyone but
  an addressed instance's manager. `DELETE /exams/{id}/audience/{instance}`
  withdraws one; the owner's pair is not withdrawable (400) and a pair that
  holds no row is a 404.
- Grading, statistics, results and the live monitor now accept teacher+
  rights over any instance the exam is addressed to, so an announced-to
  section's teacher grades its own students; the monitor's roster read is
  deduped by student and ordered, so a sitter in two addressed sections
  appears once.
- `sweep_instance_subtree` clears both directions of `exam_audience` before
  the rows they name — an exam a sibling announced *here* referenced the
  `class_course` row the caller deletes and refused the delete with a 23503.

Tests: regress_exam_delete.rs pins the announce/withdraw surface end to end
(owner-first order, the same-year and same-course 400s, the 409, the no-op)
and the sweep's answer-image blobs — the drawing row's bytes land on disk
and are gone with the row, with a mutation witness.

Gates: prepare_db, SQLX_OFFLINE=true check --all-targets (cache: 1 dropped,
7 added, all audience-shaped), doc_sync, spec_bounds, limits_completeness,
clippy -D warnings all green; cargo nextest run 1385/1385 across 47 binaries.
✨ feat: the class×course instance is the academic anchor (K-12 remodel)Ahmet Kaan Gümüş · ae84034
✨ feat: the class×course instance is the academic anchor (K-12 remodel)

`course` was a school-wide singleton: enrollment, exams, sessions,
roll-call and homework all keyed on it, so two class sections teaching the same
course shared one roster, one exam set and one timetable. This moves the
academic anchor to `class_course` — the per-class instance — and rebuilds
the academic model around Turkish K-12.

Schema (migrations/school/20260916000001_k12_remodel.sql): `class_course`
becomes an instance (ders_saati, counts_toward_karne, enrollment_count,
class_course_teacher); enrollment re-keys to (class_course, app_user);
exam carries class_course + term (+ exam_audience for shared exams);
course_session / session_attendance / homework re-key; `class_member` is a
soft-leave history table (uuid PK, joined_at/left_at, partial unique index
on the live stint); `academic_year` sits above `term`; `class_group` links
a year, not a term; new `course_membership` (clubs/study), `karne_snapshot`;
settings gain branches/excuse_kinds/absence limits/timezone; profile gains
branch. Drops/recreates the identity-changing tables (pre-customer; the
migration resets every counter on a kept table that pointed at a dropped
one).

Layers: domain/db/service/web rewritten to the instance seam, with
`ensure_instance_teacher` gating instance writes (D10), the report card computed per
instance and weighted by ders_saati, an absence report, `/instances`
and `/academic-years` nests, and `/classes/{id}/instances`. Capacity and
the seat-claim 409 are gone; detach sweeps the whole instance subtree and
unlinks its blob keys.

Gates: cargo check --all-targets, SQLX_OFFLINE check (cache regenerated),
doc_sync, spec_bounds, limits_completeness, clippy -D warnings all green;
cargo nextest run 1370/1370.

2026-09-12

🗃️ feat!: port exams domain to sqlx/PostgresAhmet Kaan Gümüş · 381e16c
🗃️ feat!: port exams domain to sqlx/Postgres

- db/{exam,exam_question,exam_attempt,exam_answer,exam_result,question_image,answer_image}:
  SurrealQL -> static query!/query_as! (PagedList exemption kept for
  exam_question listing); composite natural PKs (exam,user,seq) everywhere;
  sitting scoping via key.rs wire helpers unchanged.
- Freeze gate: write_unfrozen/IndexedResults/FROZEN_SLOT deleted; freeze is
  a shared in-tx freeze_gate() (exam row FOR UPDATE + EXISTS(attempts)) run
  inside each question/image write's own tx_with_retry.
- EXAM_LOCK deleted: sitting create re-judges sittable/window gates on the
  locked exam row (guard_start) then claims exam_sat_total in one CTE;
  exam delete locks the exam row before its ordered cascade and collects
  blob keys inside the tx; answer/answer-image saves lock the exam row
  ahead of their upserts (bump-and-restore touch tricks deleted).
- PRESENCE_LOCK deleted: join = unconditional left_at clear; last-out =
  single conditional stamp_left_if_running (left_at IS NULL AND
  finished_at IS NULL AND live-schedule in-progress); ExamPresence map
  mutex stays for counts.
- Grade tx: exam row FOR UPDATE, draft gate in-tx, kind_ref claim
  (retired=false), 4-counter first-vs-regrade precedence preserved exactly;
  remove() refunds via data-modifying CTE.
- THROW markers -> early returns: exam_redraft, questions_frozen, no_exam,
  question_subject_gone, question_row_gone, question_stale_move,
  exam_missing, exam_draft, kind_retired.
- cfg(test) mods left for wave 3.

2026-09-11