Commits
2026-09-25
✨ 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(holidays): the non-teaching calendar over the API and the materialize routeAhmet Kaan Gümüş · 3547dc5
✨ feat(holidays): the non-teaching calendar over the API and the materialize route
`src/web/holidays.rs`: five routes (paged overlap-filtered `GET /holidays`,
`GET /holidays/{id}` for any session, manager-gated `POST`/`PATCH`/`DELETE`),
nested ungated beside `/terms` and tagged in the spec. `HolidayLimits` and the
weekly-plan materialize caps join `GET /limits`, and `max_course_sections` is
published with them.
`POST /instances/{id}/weekly-plan/materialize` turns a section's resolved plan
into dated lessons over a range: dry run by default, the same call with
`apply: true` commits, holidays and already-scheduled starts are reported as
skipped, and the response reuses `SessionResponse`. Slot DTOs carry the new
optional topic.
Also closes a wave-1 defect: `service::course_session::materialize` captured
`&PgPool`/`&ClassCourse` in its `tx_with_retry` closure, so its future was not
Send and no route could await it — now owned captures.✨ 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.
✨ feat: add the /rag nest over the course-note RAG bridgeAhmet Kaan Gümüş · a61e0a6
✨ feat: add the /rag nest over the course-note RAG bridge A separate rag_thread/rag_message pair of tables and a Module::Chatbot gated /rag nest, mirroring the chatbot's asynchronous send: POST answers 202 with a pending assistant row, an in-process task settles it, and both the poll read and the SSE stream project a stale pending row as failed. Every question is scoped server-side to the asker's own (sinif, ders) pairs — class-section instances, a linked parent's children, school-wide club/study memberships — never from the body. Each citation's corpus doc_id is resolved per candidate to a course-note file the asker may view, and the two storage caps refuse an over-bound reply whole rather than clipping it. rag.index replies now stamp each file's rag_doc_id, the missing link between a citation and its file. The chatbot's SSE helpers move to web/mod.rs so both nests stream through one implementation, and the instance/course visibility gates move from web to service so the scope deriver and the routes share one rule. Gates: cargo check --all-targets, clippy -D warnings, limits_completeness, spec_bounds, doc_sync (README regenerated), protected_routes_require_session (MIN_PROTECTED 269 -> 318, the real swept count), ai_bridge (75 tests).
2026-09-16
✨ feat: archive an academic year, attribute shared-exam marks, index the new FKsAhmet Kaan Gümüş · b3f7395
✨ feat: archive an academic year, attribute shared-exam marks, index the new FKs
Follow-ups on the K12 remodel:
- `POST /academic-years/{id}/archive` (Manager+): stamps `archived_at`
idempotently, making the existing `academic_year_archived` guard reachable —
every write into an archived year now 409s while reads stay 200. No
unarchive; no PUT.
- Marks and the report card attribute an exam via its `exam_audience` rows, not only its
owner instance: a shared exam's mark now stands in every addressed class section's
report instead of vanishing when the owner instance isn't in the student's
list. Owner-only exams are unchanged (the owner audience row always exists).
- `GET /instances/me` now serves the full visibility set (live member ∪
instance teacher ∪ class-section homeroom), so a teacher's own list is meaningful.
- Migration `20260916000002_k12_indexes.sql` adds the indexes the remodel's
drop/recreate left out: `enrollment(app_user)` (dropped with its table),
`course_membership(app_user)`, and `exam_audience(class_course)` (read by
every per-instance exam read).
Tests: the archived-year e2e now archives via the route; new regressions pin
the sweep's `term.exam_count` release (the term becomes deletable) and the
blueprint sweep's blob unlink, each with a mutation witness; new shared-exam
attribution tests (fail-pre-fix/pass-post-fix for both reads) and the
`/instances/me` union.
Gates: check --all-targets (offline cache regenerated), doc_sync,
spec_bounds, limits_completeness, clippy -D warnings all green;
cargo nextest run 1376/1376.✨ 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.