Commits
2026-08-05
fix: 🏫 stop a deleted course from sticking in a blueprintAhmet Kaan Gümüş · b0f72a5
fix: 🏫 stop a deleted course from sticking in a blueprint A grade template holds its courses as a list on its own row, so nothing in `Course::delete`'s cascade could reach it: the id stayed, and the repair every doc surface named — `PATCH` the template back as it stands — is a 400 for naming a course that does not exist. The pump's own prune only fires while walking a section, so at a grade with no sections the id was permanent. The cascade now sweeps `class_blueprint` in the same transaction that detaches the course from the sections. Table scan, deliberately unindexed: one row per grade label, and a course delete is rare — and the per-element index the WHERE would want (`FIELDS courses[*]`) is the one this store answers with no rows at all. `prune` stays for the window the sweep cannot cover (a course deleted after a pump read the list it walks) and for ids written before this existed; its comment no longer argues the sweep should not exist.
2026-08-04
fix: 🧭 name the ceiling a class refusal actually hitAhmet Kaan Gümüş · 82c0ee2
fix: 🧭 name the ceiling a class refusal actually hit The refusal codes shipped one commit ago read the same on both axes, but two of them mean opposite things depending on which side is being attached: a class at its ceiling is out of course places when a course arrives and out of seats when a student does. So adding a student to a full section answered class_at_course_ceiling next to a sentence about students, and a section carrying too many courses answered class_roster_too_large. The two tests covering it pinned the wrong answer, one of them while asserting the prose was right. The ceiling codes now live on the axis, so each names what it hit, and the member route gains the two it needed. Its documentation was wrong in the other direction too: it derived the manual code set from the pump's, which quietly promised codes only a pump can answer — a deleted class or course is a 404 there, never a 409. Each route now states its own set, and the spec guard compares those sets rather than searching the whole document for the strings, which is why it never caught any of this.
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.
feat: 🩺 say which sections are out of step with their blueprintAhmet Kaan Gümüş · 0684656
feat: 🩺 say which sections are out of step with their blueprint A pump is best-effort, so it can leave a grade half stocked — and the skip list saying which half lived in one response body and nowhere else. A manager who closed the tab had no way back to it. The status read answers it from the store: the template, how many sections carry the label, and what each section is missing. A course attached by hand counts as present, because that is exactly what the pump does with it. It also writes down the recovery nobody had been told: re-sending the same list re-runs the pump, and a section can be re-stocked on its own. A class moved to another grade keeps what the old template gave it — which this read now shows rather than leaving to be discovered.
feat: 🔍 filter the class index by gradeAhmet Kaan Gümüş · cf0a010
feat: 🔍 filter the class index by grade A blueprint keys on a grade label and its pump is best-effort, so a manager can be handed a skip list naming three sections at grade 9 — and had no way to list the sections at grade 9. The label the office typed is the only thing tying them together, and nothing read it. Matched verbatim, like the pump it exists to debug: a filter that trimmed or folded would disagree with the thing it is meant to explain. An empty value asks for the sections carrying no grade at all, which is what an empty grade already means everywhere a class is written.
feat: 🏗️ stock a new section from its grade's blueprintAhmet Kaan Gümüş · 67ced09
feat: 🏗️ stock a new section from its grade's blueprint Editing a template reached every section already at the grade, but making a section reached no template — so a blueprint described every section except the ones created after it, and the office had to remember a second call each time. A create now applies its grade's blueprint, after the homeroom demotion rollback and never before it: the rollback deletes the class, and that delete refuses while the class holds courses. The 201 body carries the class, what could not be stocked, and which grade's template stocked it — null when none covers the grade, which is also what a stocking that faulted reports, because a 500 here would strand a section whose id nothing else returns.
feat: 📊 say how many sections a blueprint pump reachedAhmet Kaan Gümüş · 81c5490
feat: 📊 say how many sections a blueprint pump reached A grade label is free text and matched exactly, so a section typed "9 " carries a grade no blueprint for "9" will ever find. The pump answered that with an empty skip list, which reads exactly like every section having taken the whole template. It now says how many sections it walked, so nothing reached is a zero a manager can see rather than a silence. Normalising the label was the other way out and is not taken: the label is the blueprint's own record id, schools spell their ladders differently on purpose, and nothing would repair the labels already stored.
fix: 🧹 report a dead course once per pump, not once per sectionAhmet Kaan Gümüş · 7bfebea
fix: 🧹 report a dead course once per pump, not once per section A course deleted out from under a blueprint is pruned by the pump that finds it, but the pump looped its sections over the list it read at the start, so twelve sections meant twelve identical skips and twelve prune writes for one dead course — and the rustdoc claimed otherwise. The run now carries what it has found dead, and a blueprint that is itself deleted mid-run ends the loop rather than answering for every section left: the remaining sections would all answer the same. The skips already collected are still returned, because the sections before it did attach.
fix: 🔒 stop a deleted blueprint from stranding the rows it taggedAhmet Kaan Gümüş · b1c8e7a
fix: 🔒 stop a deleted blueprint from stranding the rows it tagged Delete swept the course list the handler had read and then removed the row, so a pump adding a course in between left class_course rows tagged with a blueprint that no longer existed — reachable by nothing, since the sweep is the only thing that reads the tag. Delete now takes a compare-and-set on that list, removes the row first and only then sweeps by the tag itself, so a racing addition is swept too; the pump answers blueprint_deleted rather than landing an orphan, claiming the blueprint inside its own transaction; and BLUEPRINT_LOCK closes what neither could, since SurrealDB does not serialise the pump's cross-record read against this delete. The residue is a process crash between the delete and the sweep, which no lock survives: inert rows, a detach each, counters exact. The pump's created-row slot was hand-counted (7, or 9 on an axis with a pivot claim). The guard would have shifted it silently on the only path that uses the guard, so the statement list is built as a list and the slot is read off its length.
fix: 🏷️ name blueprint skips with codes a client can branch onAhmet Kaan Gümüş · b7a351c
fix: 🏷️ name blueprint skips with codes a client can branch on The pump reported a refused (class, course) pair with an English sentence, which a bilingual client can neither branch on nor translate. Every other enum here is an id plus a client-side label; skips now are too, over a closed set documented on the response schema. No information is lost: Skip already carried the class and the course as their own fields, and neither sentence that named a record ever interpolated it.
2026-08-02
fix: 🔩 clear the deferred backlog and ship class phase 2Ahmet Kaan Gümüş · afff737
fix: 🔩 clear the deferred backlog and ship class phase 2 Ten defects and two features, worked as one series because the doc surfaces and the const table are shared. Defects closed: - Cross-exam answer-key leak. The bank copies `correct` into every instantiation, so reviewing exam A handed out the key to a question the caller was still writing in exam B. Review now blanks those questions rather than closing: the join matches on `from_bank` AND `banked_as` (a question can carry both — instantiated, then re-saved to the bank — so a coalesce misses a copy), redacting `correct`, the correctness flag and that question's `auto_score` share. Keyed on the template, never the exam, so the rest of the review reads normally. - `set_role` was not atomic with its sweeps. The role write and every grant it invalidates now commit as one transaction; the board rooms are told after COMMIT from the cascade's own result slot. Built best-of-N; the losing charter left the one sweep outside whose failure strands an event seat no route can free. - Board rosters held below-student ids, which 400d the creator's next roster PATCH. Repaired at boot, and a PATCH may now send back the roster it was served: an id already present that stopped qualifying is dropped, a new one still refused. - `note_file` blobs leaked. The delete transaction returns the rows it removed and the handler unlinks exactly those, not a pre-read snapshot. - Rate limiting failed open on a saturated map. Never-seen clients now share one metered overflow budget instead of arriving unmetered. - Whiteboards: `GET /boards` takes `?open=`, `/strokes` no longer leaks a clear marker the socket filters out, and a locked board refuses its creator's clear (409) — the lock now means one thing on every path. - Blueprint skips named the wrong record: `Attached::Gone` was two facts under one name, split into `Gone` (class) and `PivotGone` (course). Features: - Event audience `kind=class` — live from `class_member`, membership checked in one select because the (class, user) pair is the row id. - Grade blueprints: a grade's course template, retro-pumped best-effort with a skip list. Attachments carry a provenance tag, so removal spares what a human placed. A course deleted out from under a blueprint is pruned from the template by the pump that finds it. Forcing functions, because a hand-kept copy drifts: - `protected_routes_require_session` is derived from the emitted OpenAPI: 248 -> 254 operations swept, was 80 typed by hand. - Every JSON-bodied operation declares 422 (74 sites), pinned both ways — and multipart routes, which answer 400, are pinned to NOT declare it. - The SurrealQL registration-freeze guard is pinned against the Rust it copies; both mutations of it fail the test. - `migration_mark` gates one-time backfills. The roster repair rescanned every board against every user on every boot (773ms at 300/2000 with nothing to write); it is now skipped once done. Verified by a three-lens verifier panel — which caught the `banked_as` half of the answer-key leak by executing a probe, after the first fix had been reported complete — and by a podman boot against the existing volume: both new fields defined, the marker written, boot 2 skipping the scan, and the live API answering on the new routes.
feat: 🧑🏫 give a class section a homeroom teacher and open it to studentsAhmet Kaan Gümüş · e590b84
feat: 🧑🏫 give a class section a homeroom teacher and open it to students
Two gaps in the class-section layer, closed together because the
second is what makes the first worth storing: a section could name no
homeroom teacher, and a student could never learn which section they were
in — every /classes route was teacher+, so the layer was invisible to the
people inside it.
A section carries an optional `teacher`. The named account must be
teacher+, `null` and `""` both clear it, and an omitted field is left
alone rather than re-stated from the caller's snapshot. The column is
additive: rows written before it carry no key at all, which reads back
as null, so nothing is backfilled and no whole-row write coerces a
counter. A demotion clears the column everywhere — only teacher+ may
hold a section, and the sweep set_role already ran for course staffing
now runs for sections too.
Two reads sit outside the teacher+ bar. GET /classes/me serves any
authenticated caller their own section; GET /classes/user/{user} serves
teacher+ or a linked parent, through the same observer gate marks,
attendance and pomodoro use — which 403s before it 404s, so a parent
never gets an existence oracle.
Opening those reads meant the response could no longer carry `creator`.
A section's creator is always manager+, and below teacher+ that identity
was unreachable: GET /users is admin-only and /users/search is teacher+.
So `creator` is null for those callers and the join never even fetches
it, which keeps the response and the person map from drifting apart.
The role bar was a read-then-write with nothing between them. A demotion
landing in that window left the account homeroom teacher forever, since
its sweep had already run and matched nothing — and course assignment
had carried the same hole since it was written. Both now re-read the
live role after the write and undo the assignment with a 409. A create
that loses this way rolls the whole section back rather than leaving a
teacherless one standing, and the rollback releases the term reference
inside its own transaction, so no term is left undeletable. A rollback
the delete guard refuses is a 500, not a 409 whose text promises nothing
was created.
Every guard here is pinned by a test that fails when the guard is
removed, including the three race sites: a DEFINE EVENT on the table
being written fires inside the handler's own write, which is exactly the
window between the role check and the re-read. No production code knows
the seam exists.
Verified against the real volume: the migration applies to a database
whose section rows predate the column, those rows come back byte-identical
with every refcount intact, a second boot changes nothing, and both new
reads answer correctly on stored data.
The English prose calls this a class section throughout, keeping şube as
a parenthetical gloss — the word has a plain equivalent and the docs were
carrying the Turkish as though it did not.
Known and left: can_manage_course still trusts Course.creator without
re-reading the live role, so a demoted creator keeps course-management
reads — its own series. set_role writes the role before its sweeps and
they are not one transaction; every sweep is idempotent and grants
nothing, so a re-sent PATCH repairs the residue.fix: 🔩 close the bug hunt across meals, classes and capsAhmet Kaan Gümüş · 7198cea
fix: 🔩 close the bug hunt across meals, classes and caps A three-domain hunt, its fixes, and a verifier panel that refuted two of them. Kept as one commit because the pieces interlock — cap.rs, the settings pair and the pump all move together, and no smaller cut compiles. Money can no longer be lost or stranded. Both seat transitions carry their ledger line inside their own transaction: the claim writes the charge, the flip writes the reversal. Before, a crash between the two left a seat held with no bill, or a bill with no seat, keyed to an attempt no later request could ever reach. A lost cancel could refund a live seat. The menu revision was bumped in a query of its own, so a booking reading in the gap claimed against a capacity or a price the menu had already left. Deleting a menu now takes its marks and its dishes with it, in the transaction that deletes the row. The id is deterministic on (date, slot), so anything left behind came back on the next publish — the kitchen reading "served" for a student who never came. A seat is always releasable: manager+ cancels any booking and is not bound by the cutoff, so a promoted student's seat no longer wedges its menu forever, and a debt that outlived its owner's role can be settled. Canteen money follows /payments and is manager+, not teacher+ — what a family owes the school is not classroom information. The class pump claims its pivot in-transaction. An attach racing a course delete used to commit a link to a row that was gone, and nothing could then detach it or delete the class. A hand enroll now disowns a pumped row, so a sweep cannot take back a roster decision an operator made by hand. The role sweep is one transaction. Rosters are ordered by when a student was added, which is what they always claimed. Both class axes have a ceiling, and each refuses on the other's, because a pump writes one row per member per course in a single transaction. Settings edits are serialized: retire is idempotent, so an undo log cannot tell the attempt that flipped a name from one that found it already flipped, and the loser un-retired what the winner had legally retired — leaving a kind gone from the list, gradable, and unremovable for good. Grading now checks the school's list, not only the counter. Three caps that read a snapshot integer now read the live column. A clear marker is charged to the board's lifetime counter and boot repairs the boards that predate it. Blank canvases refuse the clear, and the room reports that as its own code: the refusal text had drifted into the substring the WebSocket read as "closed", which told a live room it was permanently read-only. Verified against the real volume: both boot backfills, the slot-name rule and its grandfather clause, and the new money gate.