forge
Explore
Log in

Don't you dare go Hollow

🧪 the three gates the merged /rag tree left red

Browse files at this commit

ebffd41acbeb31d10b21d6eeb70a9dbaaaa29b10Ahmet Kaan GümüşParent: 39f97e4
  • fix
    • 🧪 the three gates the merged /rag tree left red
Show full message
fix: 🧪 the three gates the merged /rag tree left red

- the rag.chat byte pin now expects serde's real field order (the wave-1 test
  was compiled but never executed)
- /rag joins the gated-nest list the route guard checks by name
- README's endpoint table regenerated after the /ai/capabilities security
  annotation landed
- ignore src/graphify-out, where the graphify hook writes inside the tree
.gitignoremodified+1 -0
@@ -3,3 +3,4 @@
33 .env
44 /history.txt
55 /graphify-out
6+/src/graphify-out
README.mdmodified+1 -1
@@ -1153,7 +1153,7 @@ window filtering, before paging; negative values are a `400` naming the field.
11531153 | 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. |
11541154 | 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. |
11551155 | 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. |
1156-| 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. |
1156+| 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. |
11571157 | GET | `/ai/certificate` | no | The AI bridge's certificate (PEM + SHA-256 fingerprint) for a service to pin; `404` when the bridge is off. |
11581158 | GET | `/api-docs/openapi.json` | no | Raw OpenAPI 3 spec |
11591159 | 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. |
tests/ai_protocol.rsmodified+3 -2
@@ -1063,7 +1063,7 @@ async fn rag_chat_payloads_carry_the_documented_wire_keys() {
10631063 // Byte-level: the `(sinif, ders)` pair set, not a re-wrapped shape.
10641064 let text = String::from_utf8(bytes).expect("the frame body is UTF-8 JSON");
10651065 assert!(
1066- text.contains(r#""scope":[{"sinif":"11","ders":"Fizik"}]"#),
1066+ text.contains(r#""scope":[{"ders":"Fizik","sinif":"11"}]"#),
10671067 "{text}"
10681068 );
10691069
@@ -1083,7 +1083,8 @@ async fn rag_chat_payloads_carry_the_documented_wire_keys() {
10831083 let id = frame["id"].as_str().expect("trace id").to_string();
10841084 raw::answer(
10851085 send,
1086- format!(r#"{{"status":"ok","id":"{id}","school":"{SCHOOL}","payload":{reply}}}"#).as_bytes(),
1086+ format!(r#"{{"status":"ok","id":"{id}","school":"{SCHOOL}","payload":{reply}}}"#)
1087+ .as_bytes(),
10871088 )
10881089 .await;
10891090
tests/integration.rsmodified+8 -10
@@ -27164,15 +27164,8 @@ async fn course_note_creator_writes_assigned_teacher_refused_and_enrolled_studen
2716427164 // (a) the creator writes note + file.
2716527165 let note = create_course_note(&app, &creator, &course, "recap").await;
2716627166 let bytes = b"%PDF-1.4 fake";
27167- let up = upload_course_note_file(
27168- &app,
27169- &creator,
27170- &note,
27171- "recap.pdf",
27172- "application/pdf",
27173- bytes,
27174- )
27175- .await;
27167+ let up =
27168+ upload_course_note_file(&app, &creator, &note, "recap.pdf", "application/pdf", bytes).await;
2717627169 assert_eq!(up.status, StatusCode::CREATED, "{}", up.body);
2717727170 let file_id = id_of(&up.body);
2717827171
@@ -29685,8 +29678,13 @@ const CORE_PREFIXES: [(&str, &str); 13] = [
2968529678 /// Every module's nest prefix. Written down rather than derived: the point is
2968629679 /// to catch a nest that was mounted without a gate, and a derived list would
2968729680 /// be derived from the same code it is checking.
29688-const MODULE_PREFIXES: [(Module, &str); 22] = [
29681+///
29682+/// A module may own more than one prefix: `courses` also answers under
29683+/// `/instances` (the instance anchor), and `chatbot` — the whole `ai` package —
29684+/// also answers under `/rag`.
29685+const MODULE_PREFIXES: [(Module, &str); 23] = [
2968929686 (Module::Chatbot, "/chatbot"),
29687+ (Module::Chatbot, "/rag"),
2969029688 (Module::Notes, "/notes"),
2969129689 (Module::Messages, "/messages"),
2969229690 (Module::Events, "/events"),