diff --git a/.gitignore b/.gitignore index 394564c..56c8792 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ .env /history.txt /graphify-out +/src/graphify-out diff --git a/README.md b/README.md index 469d524..568c6c2 100644 --- a/README.md +++ b/README.md @@ -1153,7 +1153,7 @@ window filtering, before paging; negative values are a `400` naming the field. | DELETE | `/academic-years/{id}` | manager | Delete an academic year. Requires manager+. Refused with a 409 while any şube or dönem still links it — move or delete them first. An archived year must be re-opened (`PATCH` is not enough: there is no unarchive here, so the row is only deletable while open) like every other past-structure write. | | POST | `/academic-years/{id}/archive` | manager | Archive an academic year. Requires manager+. Stamps `archived_at`, and from then on the whole year is past structure: no new şube, no new dönem, no exam inside it, and no edit or delete of the year itself. Idempotent — a second archive answers `200` with the stamp that already stood. There is no unarchive route: the row is deletable only while open. | | POST | `/academic-years/{id}/rollover` | manager | Carry another year's şubeler into this one. Requires manager+. Each şube of `from_year` whose grade the target year promotes is planted afresh here — same name, mapped grade, and copies of its instances (`ders_saati`, karne policy, teachers) and of every live member, who are also enrolled into the new instances. A grade with no promotion entry stays behind: that is graduation, and `graduated` names it. The target must be empty (a second rollover into it is a 409, which is what makes the command idempotent), open, and different from the source. | -| GET | `/ai/capabilities` | no | The capabilities connected AI services are serving right now, per capability, with the work in flight — a discovery read for an operator or a service deciding what it may ask this bridge to do. | +| GET | `/ai/capabilities` | student | The capabilities connected AI services are serving right now, per capability, with the work in flight — a discovery read for an operator or a service deciding what it may ask this bridge to do. | | GET | `/ai/certificate` | no | The AI bridge's certificate (PEM + SHA-256 fingerprint) for a service to pin; `404` when the bridge is off. | | GET | `/api-docs/openapi.json` | no | Raw OpenAPI 3 spec | | GET | `/appointments` | student | List bookings, newest first. Students and parents see the ones they requested; teacher+ see the ones aimed at their own slots — their request inbox. Managers and admins read their own inbox too (they may still decide any booking by id). Paged via `?limit=&offset=` (omit `limit` for every booking); returns a `{items, total, limit, offset}` envelope. | diff --git a/tests/ai_protocol.rs b/tests/ai_protocol.rs index a938dbf..dec2bb4 100644 --- a/tests/ai_protocol.rs +++ b/tests/ai_protocol.rs @@ -1063,7 +1063,7 @@ async fn rag_chat_payloads_carry_the_documented_wire_keys() { // Byte-level: the `(sinif, ders)` pair set, not a re-wrapped shape. let text = String::from_utf8(bytes).expect("the frame body is UTF-8 JSON"); assert!( - text.contains(r#""scope":[{"sinif":"11","ders":"Fizik"}]"#), + text.contains(r#""scope":[{"ders":"Fizik","sinif":"11"}]"#), "{text}" ); @@ -1083,7 +1083,8 @@ async fn rag_chat_payloads_carry_the_documented_wire_keys() { let id = frame["id"].as_str().expect("trace id").to_string(); raw::answer( send, - format!(r#"{{"status":"ok","id":"{id}","school":"{SCHOOL}","payload":{reply}}}"#).as_bytes(), + format!(r#"{{"status":"ok","id":"{id}","school":"{SCHOOL}","payload":{reply}}}"#) + .as_bytes(), ) .await; diff --git a/tests/integration.rs b/tests/integration.rs index 72ede29..968f6bf 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -27164,15 +27164,8 @@ async fn course_note_creator_writes_assigned_teacher_refused_and_enrolled_studen // (a) the creator writes note + file. let note = create_course_note(&app, &creator, &course, "recap").await; let bytes = b"%PDF-1.4 fake"; - let up = upload_course_note_file( - &app, - &creator, - ¬e, - "recap.pdf", - "application/pdf", - bytes, - ) - .await; + let up = + upload_course_note_file(&app, &creator, ¬e, "recap.pdf", "application/pdf", bytes).await; assert_eq!(up.status, StatusCode::CREATED, "{}", up.body); let file_id = id_of(&up.body); @@ -29685,8 +29678,13 @@ const CORE_PREFIXES: [(&str, &str); 13] = [ /// Every module's nest prefix. Written down rather than derived: the point is /// to catch a nest that was mounted without a gate, and a derived list would /// be derived from the same code it is checking. -const MODULE_PREFIXES: [(Module, &str); 22] = [ +/// +/// A module may own more than one prefix: `courses` also answers under +/// `/instances` (the instance anchor), and `chatbot` — the whole `ai` package — +/// also answers under `/rag`. +const MODULE_PREFIXES: [(Module, &str); 23] = [ (Module::Chatbot, "/chatbot"), + (Module::Chatbot, "/rag"), (Module::Notes, "/notes"), (Module::Messages, "/messages"), (Module::Events, "/events"),