forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to docs/BACKEND-INTEGRATION.mdClear filter

2026-09-22

docs: name the school corpus segment as the hyphenated uuidAhmet Kaan Gümüş · 5af65fc
docs: name the school corpus segment as the hyphenated uuid

The fleet school value and the corpus directory's first segment are the hyphenated uuid. The repo BOOK_PATH default stays the okul-a demo fixture. The school-token regex is unchanged.
Local-Gate: 9fc7c5131f919a6bf13440ef595a7e694a6b82c1 (1407 passed, 32s)

2026-09-18

feat(service): 📄 rag.index answer carries the extracted text (passages)Ahmet Kaan Gümüş · 9e3b62d
feat(service): 📄 rag.index answer carries the extracted text (passages)

`chunks` alone was a dead end for the caller: the panel could print "18 metin
parçası" and nothing more, so clicking the AI output showed the source PDF
again — the extraction was invisible.

The answer now carries the indexed CHILD chunks with their full text:

    "passages": [{"chunk_id", "doc_id", "text", "page_start", "page_end"}],
    "passages_truncated": <bool>

Two additive keys; every existing key keeps its meaning and `chunks` is still
the TOTAL indexed count (not len(passages)). Cap: at most 50 rows and/or
512 KB for the WHOLE serialized answer, whichever binds first; the flag is true
whenever anything was dropped, false otherwise. The byte ceiling is a
storage/use ceiling, not a frame one — 8 MiB would pass the wire but is stored
verbatim in rag_output.payload and becomes the panel's download.

Passage text is verbatim (no ellipsis, no reflow); excerpting is the UI's job.
Parents are not listed: they duplicate child text (notes_index._chunks_for
indexes children only).

The budget counts the whole answer, not the list: the answer is serialized
once with an empty `passages` and each row is then charged its own bytes plus
one comma, so the running total is the final serialized size exactly — no
re-serialization, no over-conservative estimate.

Building passages can never fail the index: any error degrades to
passages:[] + passages_truncated:true on an otherwise successful answer, since
the backend keeps its previous rag_output rows only when the whole round trip
fails.

Measured (tests/unit/test_notes_index.py, MetinParcalariTestleri):
  - 60-child note -> passages=50, truncated=true, chunks=60, answer 74_680 B
  - 4x150 KB paragraphs -> passages=3, truncated=true, answer 461_331 B
    (the cap is tight: one more row would be 615_055 B > 524_288 B)
  - exactly 50 children -> passages=50, truncated=false
  - builder raising -> passages=[], truncated=true, index still written
Local-Gate: eccfba42f84573622280a8f85deb7babb91856c9 (1392 passed, 31s)
✨ 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(bridge): 🛰️ hab/2 QUIC taşıması — rag.chat telden servis edilirAhmet Kaan Gümüş · ab15dc3
feat(bridge): 🛰️ hab/2 QUIC taşıması — rag.chat telden servis edilir

Backend QUIC sunucusudur, servis dial-out eder; eksik olan taşıma yazıldı:
- transport.py: sertifika (GET /ai/certificate, HER yeniden bağlanmada) + ALPN
  hab/2 + Hello/Greeting + QUIC PING + gelen Request'i transport-bağımsız
  dağıtıcıya verme + üstel geri çekilmeyle SINIRSUZ yeniden bağlanma. Boot
  politikası: backend yokken süreç çıkmaz, bekler, backend gelince kendiliğinden
  kaydolur. TLS: AI_TLS_FINGERPRINT doluysa pinlenir (uyuşmazsa bağlanılmaz),
  boşsa TOFU + her açılışta uyarı.
- contract.py: el sıkışma/çerçeveleme sabitleri, build_hello/parse_greeting,
  encode_frame/FrameStream (uzunluk öneki gövde ayrılmadan ÖNCE denetlenir).
- İlan edilen yetenekler rag.chat + rag.index'tir; chat.reply KARŞILANIR ama
  İLAN EDİLMEZ (o yetenek chatbot'undur). rag.index hâlâ TİPLİ REDDEDER
  (index_path_unwired) — sahte bir tamam yok.
- Testler ağ/DB olmadan: sahte QUIC sunucusu (tests/unit/_fake_bridge.py,
  src.bridge'ten BAĞIMSIZ yazıldı) ile kayıt, okul eko'su, tipli redler,
  kopma sonrası yeniden kayıt, backend-yokken boot, yanlış pin reddi.
- requirements.txt: aioquic (kardeş servislerle aynı taşıma).
feat(llm): 🧹 sağlayıcı adı temiz kesimi, --env-file düzeltmesi ve kapasite hükmüAhmet Kaan Gümüş · 5d06e87
feat(llm): 🧹 sağlayıcı adı temiz kesimi, --env-file düzeltmesi ve kapasite hükmü

- src/providers/deepseek.py -> src/providers/llm.py; DeepSeek -> LLMClient;
  `deepseek=` kwarg -> `llm=`; bütün çağıranlar güncellendi (kalan tek opsiyonel
  modül adı README/tarih notlarında).
- DEEPSEEK_API_KEY / NVIDIA_API_KEY KALDIRILDI: biri ortamda varsa yapılandırma
  REDDEDER (LLMConfigError; suçlu adı + yerine geçen LLM_API_KEY'i söyler).
  vlm.py de artık LLM_API_KEY okur. Tek adlar: LLM_BASE_URL/LLM_MODEL/LLM_API_KEY.
- deploy unit: operatör dosyası `EnvironmentFile=` ile unit ortamına, compose'a
  TEK `--env-file stack.env`. Yanlış "sonraki dosya kazanır" yorumu podman-compose
  gerçeğiyle değiştirildi (podman_compose.py:2941-2946, :2559, :2562); RAG'daki
  semptom sessiz yanlış-korustu (BOOK_PATH interpolasyonu varsayılana düşüyordu).
- CI: operatör env satır satır ortama alınır (kabuk genişletmesi yok); rollback ve
  ilk-deploy `down` tek dosyaya indi; Kapı 3 konteyner env'inde LLM_API_KEY dolu ve
  BOOK_PATH operatörünkiyle aynı mı diye bakar. Düzeltilmiş/bozuk yol gerçek bir
  konteynerle iki yönlü kanıtlandı (bozuk yol Kapı 3'ü düşürüyor).
- docs: API-CONTRACT §0.3 + BACKEND-INTEGRATION §4.1 okul kapsamı sözleşmesi;
  PROJECT_STATE hab/1 -> hab/2, servis/dağıtıcı gerçeği, §11 kapasite hükmü
  (API gömme + API rerank ile 7,6 GiB'e sığar) + türev-store veri sahipliği kuralı.
- Testler: 1278 passed / 34 skipped.
docs(rag): rag.chat tel biçimini yayınlanana hizala; iki açığı kaydetAhmet Kaan Gümüş · 8b49cfb
docs(rag): rag.chat tel biçimini yayınlanana hizala; iki açığı kaydet

- BACKEND-INTEGRATION §3.2/§4: ChatReplyPayload{text} + eski Citation önerisi
  yerine backend'in YAYINLADIĞI rag.chat biçimi (RagChatRequestPayload/
  RagChatReplyPayload/RagScopePair/RagCitation) yazıldı; otorite backend README
  'AI bridge (QUIC)' → 'rag.chat'. §7 açık kalemler güncellendi.
- API-CONTRACT §0.2: (a) asker_role → role eşlemesi köprüde yapılmalı;
  (b) sınıfsız korpus bugün yönlendirilemiyor (registry/multi str sinif anahtarı).
feat(rag): atıf doc_id, rag.index yanıt eşleşmesi ve çift-kapsamAhmet Kaan Gümüş · 110072d
feat(rag): atıf doc_id, rag.index yanıt eşleşmesi ve çift-kapsam

- Atıf sözlüğü artık doc_id taşıyor (generator → handler); backend
  course_note_file.rag_doc_id'yi bu anahtardan doldurur.
- rag.index yanıtı {files:[{id,doc_id}]} DTO'ları (RagIndexReply*);
  id istekteki RagFile.id ile AYNI.
- rag.chat kapsamı (sınıf,ders) ÇİFT listesi olarak kabul edilir
  (RagScopePair); eski sinif+ders_list geriye uyumlu çalışır. Çift
  eşleşmesi TAM — kartezyen çarpım AÇILMAZ.
- docs: API-CONTRACT §0.1 + §1 yanıt örneği; BACKEND-INTEGRATION §2.

2026-09-11

refactor: paket yapisi ve adlandirma duzeltildi (Kadir'in itirazi)Kadir Yönak · f4da1a4
refactor: paket yapisi ve adlandirma duzeltildi (Kadir'in itirazi)

Iki hakli itiraz:
1. "Turkce isim verme dosyalara" -- depodaki aliskanlik INGILIZCE kod +
   TURKCE aciklama (chunker.py, generator.py, metrics.py...). Yeni dosyalarim
   bu kurali bozuyordu.
2. "backend dosyasi neden var, src/ingest'te olmasi mantikli mi" -- ikisi de
   yanlis yerdeydi.

YENIDEN ADLANDIRMA (dosya + tanimlayici):
  sozlesme.py -> contract.py      istemci.py -> client.py
  ogrenci.py  -> student.py       ders_eslesme.py -> subject_map.py
  senaryo.py  -> scenario.py      okul.py -> school.py
  demo_ogrenci.py -> run_student.py
  OgrenciBaglami -> StudentContext   SahteOkuyucu -> FakeReader
  KopruOkuyucu -> BridgeReader       OkulSahtesi -> FakeSchool
  baglam_kur -> build_context        okul_kur -> build_school  (+ ~40 tanimlayici)
Aciklamalar ve degiskenlerdeki Turkce METIN korundu -- kural "Ingilizce kod,
Turkce prose".

YENIDEN YAPILANDIRMA:
  src/backend/ -> src/bridge/   Ad yaniltiyordu: bu paket BACKEND DEGIL,
                                backend'e baglanan taraf. Backend'in kendi
                                terimi: hab/2 = "hezarfen ai bridge".
  scenario/school/run_student -> src/demo/   Ornek veri uretimi URUN KODU
                                DEGIL. src/bridge ile karisirsa "hangi kod
                                uretimde calisiyor" sorusu cevapsiz kalir.
  src/ingest/eba_* -> src/corpus/   src/ingest bir PDF'i kanonik belgeye
                                CEVIRIR (parse/OCR/tablo/gorsel); EBA
                                indirme o PDF'lerin NEREDEN GELDIGIdir.
                                Biri belge yapisina, digeri aga ve kaynak
                                sitenin bicimine bagli -- ayri isler.

Ciktilar da yeniden adlandirildi (korpus-butunluk -> corpus-integrity,
ogrenci-senaryosu -> student-scenario, mock-okul -> mock-school);
docs/BACKEND-ENTEGRASYON.md -> BACKEND-INTEGRATION.md ve icindeki paket
tablosu yeni yapiya gore yeniden yazildi.

Suit: 855 yesil.