forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to src/db/board.rsClear filter

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-16

✨ 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-14

🐛 fix: board roster tests write board_participantAhmet Kaan Gümüş · 2ba3280
🐛 fix: board roster tests write board_participant

The junction FKs to app_user, so fabricated UserId::generate() and
UPDATE board SET participants (dropped column) 23503/fail in CI.
✨ feat: compose-stack deploy plus in-tree schema workAhmet Kaan Gümüş · 57fad2c
✨ feat: compose-stack deploy plus in-tree schema work

Production deploy is podman compose (postgres + backend + openobserve)
instead of a systemd binary. CI stays a throwaway postgres sidecar.
Operator credentials live in ~/hezarfen_backend/hezarfen_backend.env
(0600); the deploy never writes that file.

Also lands the working-tree schema/junction and .sqlx updates that were
already sitting next to this change.

2026-09-12

🗃️ feat!: port boards, notes and rag to sqlx/PostgresAhmet Kaan Gümüş · c928ecf
🗃️ feat!: port boards, notes and rag to sqlx/Postgres

- board/note/course_note/rag_output db layers: static query!/query_as! against
  the union-schema prepare DB; PagedList/FieldUpdate for the runtime builders
- file caps via the cap claim CTE at each call site; board create claims
  app_user.board_count, delete releases it in the same tx
- BOARD_ROSTER_LOCK deleted: invite is one guarded atomic-array union
  (coalesce(array_agg(DISTINCT unnest(participants || $n))) with a
  cardinality cap on the row version the UPDATE acts on)
- stroke dual-counter claim: one UPDATE bumps both counters, lifetime cap +
  open guard + epoch in the WHERE; zero rows re-read via cap::full_kind
- board clear: pre-image read under SELECT ... FOR UPDATE, refusal precedence
  preserved (closed > not-creator > locked > blank), guarded epoch bump,
  marker insert, one tx (CLEAR_REFUSED THROW now Rust-level refusals)
- rag_output.payload JSONB (sqlx::types::Json), sources uuid[] cascade via
  $n = ANY(sources); note/course_note delete cascades sweep rag_output
  in-tx (real FKs refuse dangling derived rows)
- board rosters: uuid[] + GIN, membership reads $n = ANY(participants)
- dead SurrealQL-shaped constants removed (BOARD_OPEN_GUARD, BOARD_STROKE_TABLE,
  counter/file-count field constants); uuid::Uuid imports for my domain files

2026-09-11