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-17
✨ feat: the podcast job's row and audio now live in the backend - backend-owned row, mp3 ingest, read gates without the serviceAhmet Kaan Gümüş · c44f362
✨ feat: the podcast job's row and audio now live in the backend - backend-owned row, mp3 ingest, read gates without the service
The job record lived only in the podcast service's own volume, so a restart
or a wiped volume lost every in-flight job a caller was polling and the mp3 it
was about to download. The backend now owns both ends of that state:
* `migrations/school/20260917000003_podcast.sql` — `podcast_job`, the job's
own row (user/source/format/state/stage/progress/error_code/audio_*/
duration/eta/created/updated). No `school` column: the school IS the
database, and the row's tenancy is (this database, user_id).
* `POST /podcast/jobs` mints the id, writes the row, THEN dispatches
`podcast.submit` with `{job_id, source_id, format, user_id}`; the service
echoes that id in its receipt (mismatch = 502 + a failed/bad_reply row).
No worker = 503 and no row; a refusal or transport failure tombstones the
row with the reason code — nothing is left claiming `queued`.
* The service reports every transition back through `podcast.report` (the new
client-initiated capability call, School-scoped, wired through
`src/ai/capability.rs`), which validates the echo, the jobs.py transition
table, the retention window and the done-means-audio rule before one
conditional UPDATE keyed on the state it read.
* The finished mp3 arrives as a `BlobUploadRequest` stream (exactly `size`
raw bytes), lands under the school's own blob root at
`podcast/<job-id>.<ext>` (temp+rename, row stamped in the same act, file
removed again if the row write finds the job gone), and `POST`ing a done
report before it is refused `audio_missing`.
* The read doors — `GET /podcast/jobs/{id}`, `.../result`,
`.../audio` — answer from the row with no service round trip: 404 for an
unknown or foreign job (foreign ids read as absent), 409 `not_ready` /
`audio_missing`, 410 past PODCAST_JOB_RETENTION_SECS, and a read-side-only
projection that presents a queued/running row nobody has updated inside its
ETA-scaled window as failed/interrupted — the GET writes nothing and a real
report overwrites it. `podcast.status`/`podcast.result` capabilities are
deleted with their payloads; the old `GET /podcast/audio?path=…` door is
gone (it named a cross-volume path and could not be owner-scoped).
Also: `AppError::Expired` (410) + the two room matches that needed it,
MIN_PROTECTED 323 -> 337 (real swept count), the three clippy fixes on the
committed tree, README regenerated, and the .sqlx entries for both lanes'
queries. This commit completes the tree that 7c96e47 half-staged: that commit
took the shared files (server/protocol/constant/db-mod/ai-capability) while
leaving `src/ai/podcast.rs`, `src/web/podcast.rs` and `tests/podcast.rs` at
their old versions, so main did not compile until this one.2026-09-07
🔒 fix: telemetry privacy sweep, in-flight gauge guards, request-id validation, tenant gauge on createAhmet Kaan Gümüş · ae0957a
🔒 fix: telemetry privacy sweep, in-flight gauge guards, request-id validation, tenant gauge on create - No account name reaches an exported log record: the admin seed (domain/user.rs), the ADMIN_USERNAME refusal and the builder seed (domain/builder.rs) log the event without the `username` field. - The forbidden-key list moves to tests/common (`FORBIDDEN_TELEMETRY_KEYS`, `is_forbidden_key`), gains `username`/`email` and the header prefixes, and is used by both the HTTP-edge and the AI-bridge guard tests. The telemetry suite now also exports tracing EVENTS through an in-memory log exporter and holds log records to the same rule. - `http.server.active_requests` and `ai_requests_inflight` are closed by a `Drop` guard, so a dropped request future (client hang-up, outer timeout) no longer leaks the gauge upwards. A cancelled request is recorded as 499. - A caller-supplied `x-request-id` is only kept when it is at most 64 chars of `[A-Za-z0-9._-]`; anything else is dropped and a UUID is minted, so a client cannot write free text onto `http.request.id` of every span. - `tenant_cache_size` is reported by `Tenants::create` and by the bootstrap insert, not only by the lazy-dial path. - The keepalive logs its first `up` verdict, which its comment already claimed. Claude-Session: https://claude.ai/code/session_018sqvyBCZ9kpQP6vnGomT2s
✨ feat: rate-limit, DB liveness, WebSocket and tenant-cache telemetryAhmet Kaan Gümüş · e87c2a2
✨ feat: rate-limit, DB liveness, WebSocket and tenant-cache telemetry Four instruments that were declared at the OpenTelemetry bootstrap and recorded by nobody now have their call sites. The rate limiter counts every refusal under the tier that refused it. The tier's name already exists — `share()` is told it — so the limiter learns it there instead of growing a constructor argument the router would have to pass. Counting sits in one wrapper around `check`, so the overflow budget's refusals cannot slip past it, and it is a counter only: a log line per rejection is a flood amplifier, and the fields that would make one useful (who, from where) are exactly the ones telemetry may not carry. For the same reason the two existing warnings no longer name the client's IP or the user — with events now exported as OTLP logs, those fields would leave the process. The keepalive ping is timed and its verdict published, and the log is now about the transitions rather than the tick: down once, up once, with the outage's length on recovery. Every room socket is counted by a `Connected` guard whose `Drop` is the decrement, since a room has several ways out and a decrement written at one of them is a gauge that only ever climbs. It names the exam, not the attempt — an attempt names one student. The instruments reach those places through `Metrics::global()`, published by `init`: the limiter is built before the state exists, and the keepalive task and the tenant cache have no handle to one either. Claude-Session: https://claude.ai/code/session_018sqvyBCZ9kpQP6vnGomT2s
2026-09-05
✨ feat: per-school modules; a disabled module answers 403 on every route in its nestAhmet Kaan Gümüş · 5d7f87c
✨ feat: per-school modules; a disabled module answers 403 on every route in its nest Twenty-one modules, one per router nest, with an explicit dependency graph derived from the record links (exams need courses and subjects, marks need exams, …) and four packages for the catalog. The enabled set lives on the school's control row and rides the tenant resolution that already happens once per request; every nest carries a route_layer gate, the four child creates inside /courses are gated by their own module, and the AI blob stream refuses `module_disabled` when course notes are off.
2026-08-04
feat: 🏷️ answer a manual class refusal with the pump's own codeAhmet Kaan Gümüş · 574b977
feat: 🏷️ answer a manual class refusal with the pump's own code Attaching a course or adding a member by hand refused with an English sentence, while the very same conditions reached through a blueprint pump had just become machine codes. One cause, two shapes — and the client that has to word them is bilingual. The vocabulary now has one home on the pump's own refusal type, the blueprint's skip list reads it from there, and the two manual routes carry it as a code beside the sentence they already sent. Prose is unchanged and no other route gains the field. Coding these also exposed a claim this series had been making wrongly: a pump attaches a course it has just proved alive, so it can never report a stale link. Only a member add walks the section's existing courses, and only it can answer that one.
2026-07-31
chore: 🧵 fold the two rooms' shared plumbing into src/web/room.rsAhmet Kaan Gümüş · 6208c97
chore: 🧵 fold the two rooms' shared plumbing into src/web/room.rs
The exam room and the board room share the plumbing around their difference,
not the difference itself: how a frame goes out, how an incoming message is
classified, how an `AppError` becomes words a client may read, and how a
correlation id is echoed back untouched. Both now import that one copy.
Behaviour-preserving on the exam side: `public_message` interpolates the room
label, so "exam room: database reconnecting", "exam room: database timed out"
and "exam room error: {err}" come out byte-identical, and all ten
`exam_room_*` e2e tests stay green.
The `select!` loops, the pre-upgrade gates and presence stay per-room on
purpose — room.rs names each one and why. The boards tag description now
documents the room itself: the 404 door, current-epoch replay,
persist-then-publish, and a `forbidden` that keeps the socket.