Commits
2026-09-23
✨ feat: school identity is the uuid; drop the slugAhmet Kaan Gümüş · 2918040
✨ feat: school identity is the uuid; drop the slug
The school slug is gone from every surface: the session cookie prefix,
the /schools/{id} builder routes, FILES_PATH blob dirs, the hab/2 frame
school value, DTOs, and the /limits contract. SchoolId::try_parse is the
one wire parse (hyphenated uuid only); a non-uuid frame school answers
unknown_school. Register gets a public picker via the new unauthenticated
GET /auth/schools returning active [{id, name}]. The control migration
drops school_slug and the slug column, which invalidates every existing
session — old cookie prefixes cannot resolve.
Local-Gate: 3fafffd98aec59c68e2606833b87785d0abf2fee (1510 passed, 425s)2026-09-18
✨ feat(insight): send the school's class names with the report payloadAhmet Kaan Gümüş · 49f9665
✨ feat(insight): send the school's class names with the report payload
The live document printed raw class UUIDs under its Şube header: the
summaries' own evidence carries class ids, so the renderer had nothing else
to print. A machine identifier on the most human-facing artifact we ship is
exactly the defect the report exists to remove.
Additive payload key `classes: [{id, name}]` — a sibling of `school`, not a
member of it: it is a lookup for the rows, not part of the school's identity.
Read whole from the school's own `class_group` in name order (tens of rows);
a class a row names but the list does not carry is absent on purpose, and the
renderer falls back to an honest label rather than a name invented here. The
row lists are untouched.
Pinned in the payload contract test (the encoded JSON carries `classes`) and
in the round-trip test (a class created through `POST /classes` arrives with
its name).
Local-Gate: c07c6c1e530a9d2924068b3471ee5dbc2c98fd93 (1497 passed, 451s)📄 feat(insight): render and serve a school-level report documentAhmet Kaan Gümüş · 541d9b7
📄 feat(insight): render and serve a school-level report document
`insight.report` is the third outbound ZEKA dispatch, and the first that
carries its data: the service may not read a school database, so the backend
reads its own `zeka_*` rows (four new school-wide bulk reads, projected
straight into the serde rows the storage surface already writes) and sends
them in the request. The service renders, the backend stores.
* `POST /insights/runs/{run_day}/report` — manager+, synchronous: build the
payload, dispatch with `AI_INSIGHT_REPORT_TIMEOUT_SECS`, store the returned
HTML under the school's own blob directory (`zeka_report/<day>.html`, temp
name + rename, never a partial file), answer `200` with what was stored.
A run day with no ledger row is a legal request; the service's `notes` say
what it found. Its typed refusals map per class: `bad_request` 400,
`insufficient_rows` 409 `report_empty`, `document_too_large` 413,
`internal` 500, anything else 409 `report_refused`. An empty document is
refused, never persisted — a blank page must not read as a report.
* `GET /insights/runs/{run_day}/report` — manager+, streams the stored
document (`text/html; charset=utf-8`, nosniff, private no-store);
`409 report_missing` when nothing was generated, a day the ledger has never
heard of included.
Both doors share one path (one `routes!(generate_report, serve_report)`), so
no nest or `MODULE_PREFIXES` change; `MIN_PROTECTED` 338 → 340 (derived).
`pump` moves from the podcast nest to `web` as a shared blob-stream helper.
Known gap, reported rather than widened here: the wire `RecommendationRow`
carries no `dismissed_at`, so the service's dismissal gate cannot fire on
this payload.✨ feat(insight): name the requester and fill a school-wide refresh rosterAhmet Kaan Gümüş · 0f55f34
✨ feat(insight): name the requester and fill a school-wide refresh roster
Every `insight.*` dispatch now carries `requested_by` — the caller the door
authenticated, which the service passes as `on_behalf_of` so its per-student
reads (`/marks/{user}` and the rest) answer as that teacher or manager instead
of the synthetic `ai` principal those reads refuse with a 403.
`insight.refresh` also always fills `user_ids`: a caller-named list passes
through exactly as given, while an empty body is filled from the school's own
student roster (every user holding the `student` role), because the service's
own roster discovery reads homework `assigned` lists, which a live school
rarely fills — so an empty body used to sweep nobody. The payload's new
`roster_source` records which roster the list was, and the refresh log names it
so the run ledger's counts are explainable. A school with no students dispatches
an empty list and answers 0 honestly; a roster past
`MAX_INSIGHT_REFRESH_STUDENTS` is refused rather than clipped.
Local-Gate: 644eaaee78ddae2e35af223da2719c3a55697a86 (1488 passed, 466s)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: ZEKA no longer touches the database directly - the insight.* storage surfaceAhmet Kaan Gümüş · 7c96e47
✨ feat: ZEKA no longer touches the database directly - the insight.* storage surface No AI service may hold a school database credential, so the nine reads and writes ZEKA performed against its own zeka_* tables become named operations the backend serves: insight.summary|recommendation|segment|profile|run.upsert, insight.pending.list, insight.retention.sweep, insight.departed.purge and the deployment-scoped insight.schools.list. They ride a new client-initiated capability call (CapabilityRequest -> CapabilityResponse, mirroring Request/Response field for field) and are mounted as HTTP doors on the same functions (manager+; the school directory is the builder's, outside the school gate). Every statement runs inside the school the frame named, in one transaction per batch.
fix(clippy): then_some in the insight about-drop, small refusal enum in worker_forAhmet Kaan Gümüş · 5bb7de4
fix(clippy): then_some in the insight about-drop, small refusal enum in worker_for CI Clippy red with -D warnings: unnecessary_lazy_evaluations at src/web/insights.rs:694 and result_large_err at src/web/podcast.rs:476 (the Err half was a 128-byte axum Response). worker_for now returns a small NoWorker enum and the four doors build the 503 at the call site via NoWorker::refusal(), so status and body are unchanged.
✨ feat: ZEKA's insight capabilities — its school schema, the dispatch contract, and the /insights nestAhmet Kaan Gümüş · b0b5e0c
✨ feat: ZEKA's insight capabilities — its school schema, the dispatch contract, and the /insights nest
`hezarfen_zeka` already dials the QUIC bridge correctly and declares three
capabilities the backend did not know (`insight.student`, `insight.class`,
`insight.refresh`), and it writes nine `zeka_*` tables the school schema did
not contain — so nothing could route to it and nothing could read what it
computed. This lands all three missing pieces.
* the migration: `migrations/school/20260917000002_zeka.sql`, the service's
DDL copied verbatim (every FK resolved against the existing school schema:
`app_user`, `course`, `subject` and `exam_question (exam, id)`).
* `src/ai/insight.rs`: the payload contract for the three capabilities,
mirroring the service's TypedDicts, plus the two dispatches the backend can
route today — `compute_student` and `refresh`. `insight.class` stays
contract-only: its request names a course the service would have to
enumerate a roster for, and the bridge's read allowlist carries no member
listing yet (`hezarfen_zeka/service/docs/BACKEND-GEREKSINIMLERI.md` item 3).
* `src/web/insights.rs`: the nest. `POST /insights/students/{id}` and
`POST /insights/refresh` (manager+) queue a detached dispatch and answer
`202` — the service writes its own rows, so a client polls the read routes;
`503` when no worker offers the capability and nothing is queued.
`GET /insights/me`, `GET /insights/students/{id}` (teacher+ narrowed to the
students they reach through a shared instance, or a parent holding a live
link; anyone else reads `404`, never `403`) and `GET /insights/runs`
(manager+) read the tables back. The service's output contract's own gates
hold on the read side: the attention list never reaches the student it is
about, a card's `about` never reaches a student caller, dismissed/expired
cards and `confidence: none` segments are filtered out.
Gated on `Module::Chatbot` like the other two AI nests, with its tag prose in
`src/lib.rs`, the README endpoints table regenerated, and the `.sqlx` cache
refreshed for the seven new statements.