forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to src/bridge/dispatch.pyClear filter

2026-09-23

2026-09-18

✨ feat(bridge): serve rag.summarize and rag.questions over hab/2Ahmet Kaan Gümüş · d70189f
✨ feat(bridge): serve rag.summarize and rag.questions over hab/2

Two one-shot, scope-addressed capabilities join the dial-in contract: the
backend sends {scope{sinif,ders,pages,span_ids,scope_label}, asker,
asker_role} (+ n/difficulty/seed_question) and the dispatcher routes them
to the already-implemented RagService.summarize / generate_questions.

The service dict carries role.sinif + role.ders_list (these paths have no
pair list, so can_access reads the legacy fields) and user=asker for the
budget counter. Reply mapping tolerates every refusal shape; question rows
keep the service's own soru/cevap/zorluk keys.
✨ feat(bridge): 🧩 rag.index served end to end — blob reads, note index, chat channelAhmet Kaan Gümüş · 0877e45
✨ feat(bridge): 🧩 rag.index served end to end — blob reads, note index, chat channel

The live service advertised `rag.index` and then typed-refused every request
(`index_path_unwired`), so the note "Özet oluştur" surface could never fill:
the backend stored no `rag_output` row. The refusal is gone; the capability is
now served for real.

* transport: `read_blob()` opens the client-initiated stream the contract
  names (one `BlobRequest` → `BlobResponse` header → exactly `size` RAW bytes),
  bridged from the executor thread by `_LoopBlobReader`; the transport installs
  it on the dispatcher at registration.
* indexing (`service/notes_index.py`): the note's own title+content always, plus
  every attachment read over its own blob stream — PDFs through the corpus's
  own canonical loader, plain text decoded directly — chunked, embedded in one
  pass (`embed_both`), and written into the school's note index.
* store (`index/notes.py`): one bucket per school, `replace_note()` swaps a
  note's rows as a unit (a re-index cannot duplicate); `rag.chat` merges this
  channel's ranked hits into the subject corpus's (`Generator(note_index=…)`),
  with `chunks_by_id`/`span_meta` consulting the live index through
  `NoteAwareChunks`.
* one refused attachment never aborts an index: the note body lands, the answer
  names what failed (`failed[]`), and the reply echoes `files[].id` so the
  backend can stamp the doc id it minted.

Honest limit (documented in `index/notes.py` and PROJECT_STATE): a note's
(class, subject) is not on the wire — the payload carries the course uuid only —
so the note channel is school-scoped; the (class, subject) gate cannot be
applied to it. The note index is in-process: a restart loses it and the next
note edit re-dispatches.

Tests: `test_bridge_transport.py` runs the acceptance path against the fake
QUIC backend (blob bytes served on a client stream, `files[0].id` echoed) and
proves a refused blob is reported, not fatal; `test_notes_index.py` covers the
offline indexing path (body-only, re-index dedup, failure isolation, school
filter, `rerank_select` compatibility). Pre-fix run (src stashed) shows
`'index_path_unwired' != 'malformed'` plus both acceptance tests failing.

Unit suite: 1387 passed, 34 skipped. PDF branch smoke-checked against a real
4.5 KB textbook PDF (15 units → 5 children).

2026-09-17

feat(rag): 🏫 okul istek bazlı kiracılık — korpus anahtarı, store süzgeci, hab/2 okul eko'suAhmet Kaan Gümüş · b2ba173
feat(rag): 🏫 okul istek bazlı kiracılık — korpus anahtarı, store süzgeci, hab/2 okul eko'su

- guard/tenant.py: okul değeri doğrulaması; okul-scoped ya da hiç (paylaşılan
  'public' boyutu YOK, damgasız satır taşınmaz ve erişilemez).
- CorpusKey artık (okul, sınıf, ders): iki okulun aynı dersi birbirini ezemez;
  resolve() okulsuz isteği school_required ile reddeder.
- Store okulla kapsanır: dense payload'ı + BM25/sparse satır damgası zorunlu,
  aramalar okur okuluna TAM eşitlikle süzülür (kırpma değil süzgeç).
- build_service/ensure yazma damgasını ZORUNLU kılar; tek-korpus modu okulu
  BOOK_PATH düzeninden okur (multi.school_from_book_path).
- Cevap cache anahtarına school eklendi (iki okul aynı soruda hit paylaşamaz).
- hab/2 giriş çerçevesi (BridgeRequest/BridgeResponse) + transport-bağımsız
  Dispatcher: okul çerçevede zorunlu, cevapta aynen eko; rag.chat/chat.reply
  eşlemesi (asker_role -> role); rag.index tipli reddedilir (taşıma yok).
- Testler: okul A okul B'nin chunk'ını göremez (store + registry + çerçeve),
  30 yeni test; süit 1278 yeşil.