forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on main

2026-09-23

fix: accept folded scope labels in the authorization gateAhmet Kaan Gümüş · d70a24c
fix: accept folded scope labels in the authorization gate

The backend forwards the derived (sinif, ders) pair with the course
TITLE ("Biyoloji"); _scope_denied compared byte-exact against the
corpus slug ("biyoloji"), so summary/question requests were refused
with scope_mismatch. Compare with bridge.subject_map.fold as fallback
after exact match: same-course case/diacritic variants pass, a folded
different course still refuses (fail-closed #42/#43 unchanged).
Local-Gate: dd29e790e65b4f2943e493a278bb29a37b422722 (1415 passed, 32s)
fix: retry a failed compose-up instead of staying downAhmet Kaan Gümüş · ca9a7bd
fix: retry a failed compose-up instead of staying down

Keep Type=oneshot and `up -d`. systemd 259 honors Restart=on-failure
for oneshot (measured: the restart counter advanced). Attached
`podman compose up` does not: podman-compose 1.6 only runs down on
SIGINT, and a container start failure exits 0, so Type=simple
Restart= would never see the failure. RestartSec=1500s is past the
longest deploy health gate (rag, 960s), so a background retry cannot
undo a rollback.
Local-Gate: 0a84e919fa002808d101bedb4a8f7278b9c60b99 (1411 passed, 32s)
fix: finalize once when both abstain samples are plan-onlyAhmet Kaan Gümüş · d40a041
fix: finalize once when both abstain samples are plan-only

A second identical abstain was still returned to the user. After two plan-only or abstain-shaped samples, issue one stricter finalize call (same chunks, temperature 0, cite [N], no plan). Return model_abstained only if that third call abstains too. insufficient_data is not retried.
Local-Gate: f6961a141b20239d76b47e46ff1ea1df1ecf01b6 (1411 passed, 32s)
ci: deploy on a green push to mainAhmet Kaan Gümüş · f1d5ed2
ci: deploy on a green push to main

A push whose Validate and Build jobs both succeed now deploys that
run's own release artifact. workflow_dispatch keeps the newest-green
redeploy (tests=force still deploys the artifact that run just built).
The capacity gate is unchanged and still read from compose x-rag-envelope.
Local-Gate: 206369ac9e4deb52af2d99733a2f1d70dfd4c15b (1410 passed, 32s)
fix: re-ask the LLM once when post-hoc model_abstained firesAhmet Kaan Gümüş · 970bd82
fix: re-ask the LLM once when post-hoc model_abstained fires

A single sampler draw that emits only a plan was returned as model_abstained. Re-issue the same grounded call once; return the abstain only if the second draw abstains too. insufficient_data and ungrounded_no_citations are not retried.
Local-Gate: b6be2345e844af9ae1bd7052accadff08c1bb6ae (1410 passed, 32s)

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)
fix: store an abstain when a reasoning plan has no cited sentenceAhmet Kaan Gümüş · c66abbb
fix: store an abstain when a reasoning plan has no cited sentence

A plan with no [N] became an empty string. The backend refuses to store
an empty reply, so the study thread showed bad_reply instead of the
missing-sources sentence.
Local-Gate: 4e696f1d77810c2e0425ec57f5940f309d671aff (1407 passed, 35s)
🐛 fix: drop a reasoning model's plan from study answersAhmet Kaan Gümüş · b867bdd
🐛 fix: drop a reasoning model's plan from study answers

Nemotron writes "We need to..." into the answer and into the follow-up
rewrite. That plan was shown to the student, and after a greeting it
replaced the query so retrieval missed the indexed note. A plan is not
a question and not an answer: the rewrite falls back to the original
query, and the visible reply keeps only the cited sentences.
Local-Gate: 8dc4f2008a650ffcc87fadeec56f24e725b05397 (1406 passed, 33s)
ci: skip the runner suite for the greeting fixAhmet Kaan Gümüş · 0fbb469
ci: skip the runner suite for the greeting fix

Local-Gate: b977d11027a0001a25260aec03df64a91636feaf (1403 passed, 34s)
🐛 fix: answer a greeting instead of abstaining for missing sourcesAhmet Kaan Gümüş · a8a0bdf
🐛 fix: answer a greeting instead of abstaining for missing sources

selam and merhaba hit retrieval and came back insufficient_data. The
SOHBET classifier already existed and was unused. chat() returns a short
greeting before routing or retrieval, including the multi-corpus path.

2026-09-19

fix(bridge): 🧵 3.11'in wait_for'u iptali yutuyordu — köprü kapanmıyorduAhmet Kaan Gümüş · a4b3874
fix(bridge): 🧵 3.11'in wait_for'u iptali yutuyordu — köprü kapanmıyordu

`asyncio.wait_for`, Python 3.11'de dışarıdan gelen iptali (CancelledError)
tam içteki awaitable BİTTİĞİ anda gelirse YUTAR ve sonucu döndürür:

    except CancelledError:
        if fut.done():
            return fut.result()   # 3.12+ bu dalı taşımaz (bkz. 3.14 tasks.py)

`register()` kayıt selamlaşmasını bu çağrıyla okuduğu için, dışarıdan gelen
iptal (testlerde `gorev.cancel()`) selamlaşma okumasıyla yarışı kaybedince
iptal yutuluyordu: `run_forever` iptal edilmemiş gibi davranıp
`wait_closed()`ta asılı kalıyor, bağlantı hiç kapanmıyordu. Test de
`await gorev` ile onu beklediği için kilitlenme oluşuyordu — CI'da iki QUIC
testi (test_kayit_hello_ile_yalniz_rag_yeteneklerini_ilan_eder,
test_yanlis_parmak_izi_baglanmaz_dogrusu_baglanir) faulthandler'ın 120 sn
zaman aşımına kadar asılı kalıyordu; 3.14'te aynı süit geçiyordu.

- `BridgeTransport.register()` ve `read_blob()`: `wait_for` yerine
  `asyncio.timeout` — iptali aynen geçirir, zaman aşımı yine TimeoutError.
- Aynı sınıf süpürüldü: http ara katmanının istek son-tarihi de
  `asyncio.timeout`a geçti (istemci kopması/sunucu kapanışı da yutulmasın).
- Testlerde iptal bekleyişi sınırlandı (`_iptal_et_ve_bekle`): yutulan bir
  iptal artık asılı kalmaz, 15 sn sonra ADIYLA AssertionError verir; CI'ın
  kendi `timeout`/faulthandler katmanı yerinde kalır.

Ölçüm (3.11 venv): iki test önce `Timeout (>25.0s) from pytest-timeout` ile
düşüyordu, sonra 1,55 sn; tam `tests/unit` 3.11'de 1400 passed/34 skipped,
3.14'te 1400 passed/34 skipped. Fix'siz ağaç + yeni test dosyası 15 sn'de
adlandırılmış AssertionError ile düşüyor (regresyon boş değil).

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(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)
ci: 🐛 the image proof asserted a refusal through pipefailAhmet Kaan Gümüş · 4a533be
ci: 🐛 the image proof asserted a refusal through pipefail

The suite-skip path exposed a latent defect one step after the gate: "Prove
the default image is API-only and refuses `local` cleanly" ended with

    docker run --rm … "$img" python -m src.service.preflight 2>&1 \
      | grep -q 'provision_local_stack.sh'

under `set -euo pipefail`, and the refusal it asserts on exits 2 by design
(src/service/preflight.py: main() returns 2, enforce() raises SystemExit(2)).
pipefail therefore handed that 2 back as the STEP's own status: job
35303767476 died at exit 2 with the expected line sitting in the log, while
the two checks before it (torch absent, api path green) had passed.

Not introduced by the gate commit: the shape and the exit 2 both came from
1d40da1 (2026-09-17 20:52), which post-dates the last green run (15f1244,
16:48) — the Test-step hang had been masking it ever since.

The assertions are now explicit and separable: the output goes to $local_out,
the exit code to $local_rc; `local` must exit non-zero AND its message must
name the provisioning script; the api path must exit 0; torch must be absent
inside the image. Swept the workflow for the same shape — the only other
pipelines in steps that survive the suite skip are `docker save | gzip` and
`tar | ssh`, where a non-zero producer MUST fail the step (kept as-is,
deliberately), and no surviving step touches the runner's pip environment
(every `python` there runs inside `docker run "$img"`), so the skip cannot
leave a half-provisioned environment.

Proven locally without an engine: the pre-fix step bytes extracted from the
YAML reproduce the failure (exit 2) against a stubbed docker whose refusal
mirrors preflight's real text, and the post-fix bytes are green on the
intended path and non-zero on three mutated stubs (message without the script
name; local path exiting 0 anyway; torch present in the image).
Local-Gate: ebec10c92d0a3f8f23b464d0743940bc3680df9b (1387 passed, 31s)
ci: 🛡️ let a locally-proven push skip the runner suiteAhmet Kaan Gümüş · 4c9d9bb
ci: 🛡️ let a locally-proven push skip the runner suite

The unit suite HANGS on the runner: run 35297989416 sat at 7% for 73
minutes until it was cancelled by hand, and every push since 2026-09-17
17:54 burned the same way (35283445041 3h20m, 35255586903 88min,
35264547756 67min — all cancelled). The identical gate is 32 s here.

Port hezarfen_backend's proven escape hatch, default unchanged:

  DEFAULT   push without a trailer -> GitHub runs everything, suite
            included (now bounded instead of unbounded).
  SPECIAL   scripts/gate-local.sh proves the suite here, writes
            .git/local-gate/<tree>.ok and prints a `Local-Gate: <tree>
            (<n> passed, <t>s)` trailer (--amend appends it); the
            workflow's "Decide test gate" step honours it only on an
            exact HEAD^{tree} match, so CI just builds, packs, uploads.

- scripts/gate-local.sh: the command CI's gate runs, with two measured
  bounds — faulthandler names a hanging test (all-thread dump, exit 1)
  after 120 s, `timeout --foreground 600` bounds the step at ~15x the
  worst green 41 s Test step. Preconditions first (CI's dependency set
  in .venv, exact recipe printed when it is missing), a stamp only from
  a clean tree, --scope runs emit no trailer.
- .githooks/pre-push (opt in: git config core.hooksPath .githooks):
  refuses a stale trailer tree, a trailer with no stamp, a scoped
  stamp, and trailer counts that do not match the stamp; loud escapes
  SKIP_LOCAL_GATE=1 / GATE_ALLOW_SCOPED=1.
- workflow: "Decide test gate" + guards on the suite-only steps, a
  bounded Test step with the faulthandler dump, stall diagnostics, and
  a workflow_dispatch `tests: auto|skip|force` input — force builds and
  tests the dispatched ref, and the deploy job then takes this run's
  own artifact instead of hunting for the newest green one.

Two deliberate deltas from the backend reference, both because a scoped
run must not be able to destroy a full-suite proof: stamps are keyed by
tree AND scope (<tree>.<scope>.ok, its own log too), and the "already
verified, reuse it" fast path is keyed the same way — in the reference a
plain `--scope` run is answered by the full stamp (suite never runs) and
overwrites it (trailer silently refused afterwards).

The new comments are English while the surrounding prose is Turkish:
that is the language the change was built under, not an oversight.
Local-Gate: 08165e108e8b490c5b0498f65411fcdf98c39891 (1387 passed, 34s)
✨ 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(service): 🧱 indeks önbelleği (#75) — vektörler volume'de kalırAhmet Kaan Gümüş · 36db106
feat(service): 🧱 indeks önbelleği (#75) — vektörler volume'de kalır

Konteyner yeniden yaratıldığında indeks bellekte olduğu için korpus her
seferinde yeniden gömülüyordu; servis bir süre "kaynak yok / hazırlanıyor"
diyordu (hab/2 ile aynı). Artık gömme ÇIKTISI (ids/vecs/sparse) bir volume'e
(`rag-index:/index`, Containerfile varsayılanı `/index`) yazılır ve AYNI korpus
için bir sonraki kurulum AĞI ATLAR. Anahtar içerik+model türevlidir
(doc_id + chunk metin özeti + gömme imzası) — PDF ya da model değişirse
kendiliğinden ıskar. Biçim `.npz` (pickle yok); bozuk dosya HATA değil ıska.

/ready artık sağlayıcı-hazır ile korpus-KURULU'yu ayırır: `korpus_hazir` ve
`hazir_tur` (tam|saglayici|yok). `MultiCorpusService.generator` da korpus
TANIMLI olduğu için değil KURULU olduğu için dolu döner (eskiden `object()`
fallback'i readiness'ı yeşil yakıp soruları `service_warming_up` döndürüyordu).

Gate: pytest tests/unit -q → 1377 passed, 34 skipped, 542 subtests.
fix(http): 🔊 yakalanmamış hata artık LOG BIRAKIYOR (sessiz 503 sınıfı)Ahmet Kaan Gümüş · f3700af
fix(http): 🔊 yakalanmamış hata artık LOG BIRAKIYOR (sessiz 503 sınıfı)

Canlı kurulumda `/rag/chat` iki kez 503 `service_unavailable` döndü ve logda
nedeni HİÇ görünmedi: `_request_id_and_errors` yakalanmamış hatayı tipli gövdeye
çeviriyor ama tür/mesaj yazmıyordu. Operatörün tek ipucu, elle tekrar denemekti
(ikinci deneme başarılı oldu: sağlayıcının geçici hatası).

Artık `[http][HATA] istek <rid>: <Tür>: <mesaj[:300]>` stderr'e yazılır. Sır
loglanmaz, istemciye giden gövde DEĞİŞMEZ (tipli sözleşme aynı).

Test: `test_unhandled_error_is_also_logged_with_its_cause`.
Süit: 1368 passed, 34 skipped, 542 subtests.
fix(provider): 🐛 API rerank warmup kancası + sorgu niyetinin kullanılmasıAhmet Kaan Gümüş · 9115967
fix(provider): 🐛 API rerank warmup kancası + sorgu niyetinin kullanılması

Canlı dağıtımın ikinci ve üçüncü düşüşü (API sağlayıcı yolu bugüne dek hiç
koşmamıştı):

- `ApiReranker.warmup` YOKTU, oysa `build_service`/`SharedModels` onu koşulsuz
  çağırıyor → "AttributeError: 'ApiReranker' object has no attribute 'warmup'"
  ve boru hattı hiç kurulmuyordu (`/ready` sürekli 503). API yolunda warmup
  artık uç noktayı TEK minimal gerçek çağrıyla yoklar (yanlış anahtar ilk
  soruda değil açılışta görülsün; bir birim sorgu faturalanır), `NoOpReranker`
  ise boş kanca taşır — sınıf taraması kapandı.
- Sorgu, retrieval'da PASaj niyetiyle gömülüyordu (`embed([query])`): uzak
  sağlayıcıların sorgu/pasaj ayrımı böylece sessizce kayboluyordu.
  `HybridRetriever._sorgu_vektoru` artık sağlayıcı `embed_query` sunuyorsa onu
  kullanır (Voyage `query`, Cohere `search_query`); BGE-M3'te ayrım olmadığı
  için yerel yol eskisi gibi kalır.

Testler: warmup kancası üç sağlayıcı sınıfında da var; ApiReranker.warmup tek
çağrı yapar ve 401'i RerankUnavailable'a çevirir; sorgu niyeti testleri
(tests/unit/test_retrieve.py).
Süit: 1367 passed, 34 skipped, 542 subtests.
fix(embed): 🐛 Voyage `encoding_format` alanını REDDEDİYOR — gövde eki sağlayıcıya özelAhmet Kaan Gümüş · 24c39fd
fix(embed): 🐛 Voyage `encoding_format` alanını REDDEDİYOR — gövde eki sağlayıcıya özel

Canlı dağıtımda yakalandı: servis ayakta ama `/ready` 503 `not_ready` ve log
"[http][HATA] pipeline kurulamadı: EmbeddingUnavailable: gomme API 400:
... Value 'float' supplied for argument 'encoding_format' is not valid --
accepted values are 'base64'".

Yani OpenAI-uyumlu yolun `encoding_format="float"` alanı Voyage'da GEÇERLİ
DEĞİL. Ölçüldü (2026-09-17): alan `base64` ile 200; alanı hiç göndermemek de
200 ve float vektör döndürüyor → Voyage gövdesinde alan YOK.

- `ApiEmbedder.BODY_EXTRA` = {"encoding_format": "float"} (varsayılan),
  `VoyageEmbedder.BODY_EXTRA = {}`. `api` yolu bayt-bayt aynı kalır (test:
  `test_api_body_is_unchanged`).
- Yeni test: `test_openai_shaped_endpoint` artık gövdede `encoding_format`
  OLMADIĞINI da doğruluyor.

Süit: 1362 passed, 34 skipped, 539 subtests.
feat(embed): 🌍 voyage gömme yolu + rerank data[] ve sınır alanı çözümüAhmet Kaan Gümüş · 79cb037
feat(embed): 🌍 voyage gömme yolu + rerank data[] ve sınır alanı çözümü

Kullanıcı "ücretsiz olanları kullan" dedi: sahada artık Voyage
(voyage-multilingual-2 + rerank-3). Cohere yolu SİLİNMEDİ, yedek.

- Voyage taşıması OpenAI biçimiyle aynı; tek fark `input_type` sözlüğü:
  Voyage `passage`ı REDDEDİYOR (ölçüldü: 400 "accepted values are 'query' or
  'document'") → rag'in pasaj niyeti `document` gider (VOYAGE_INPUT_TYPES).
- Cohere native /v2/embed yolu korundu (uyumluluk katmanı input_type'ı 422 ile
  reddediyor): `{"model","texts","input_type","embedding_types"}` →
  `embeddings.float`.
- Rerank: `results[]` (Cohere/Jina) yanında `data[]` (Voyage) da kabul; sınır
  alanı uç adından çözülür (Voyage `top_k`, Cohere `top_n`) — ölçüldü: yanlış
  ad 4xx, yani sessiz kalite kaybı değil açık hata.
- BOYUT DEĞİŞMEZİ (`_BoyutKapisi`): ölçülen/beyan edilen vektör boyutu indeksin
  boyutuyla (1024) uyuşmazsa İLK gömme, model adı ve İKİ boyutla reddedilir.
- preflight: `_EMBED_API = api | cohere | voyage` — üçü de aynı üç adı ister.

Ölçüldü (canlı, 2026-09-17): voyage document → 200 / 1024 boyut; rerank → 200
`data[]` 0,641 vs 0,270 (Türkçe çift) ve `top_n` → 400. Ücretsiz kota iddiası
BELGELENMİŞ, ölçülmemiş (panel kullanım ekranı doğrulama yeridir).
fix(llm): 🔧 geçit 2xx gövdesindeki sağlayıcı hatası yeniden denemeye giriyorAhmet Kaan Gümüş · 93b8d38
fix(llm): 🔧 geçit 2xx gövdesindeki sağlayıcı hatası yeniden denemeye giriyor

Kilo/OpenRouter tipi geçitler yük altında HTTP **200** ile
`{"error":{"message":"...","code":503}}` döndürüyor; üç istemci de durum
koduna baktığı için bunu "başarı" sayıyordu:

- `providers/llm.py`: gövde hatası okunamayınca `choices` boş kalıyor ve istemci
  SESSİZCE boş metin döndürüyordu (yeniden deneme yok) — sohbet cevabı kayıp;
- `embed/provider.py`: "gomme API beklenmeyen yanit: {...503...}" — gerçek neden
  (sağlayıcı yükü) ayrıştırma hatasının arkasında gizleniyordu;
- `providers/vlm.py`: `data["choices"]` KeyError'ı modülün geniş `except`'i
  tarafından YUTULUYOR, görsel sessizce betimsiz kalıyordu (indekse kalıcı eksik
  birim).

Çözüm — sınıflandırma TEK yerde (`resilience`):

- `provider_error_from_body(body)`: 2xx gövdesindeki `error` nesnesi/dizgesini
  (mesaj, kod) olarak çıkarır; mesaj sağlayıcının KENDİ metnidir.
- `ProviderBodyError`: gövde hatasını taşır; `is_retryable` ONA da bakar —
  geçici kod (5xx/429) yeniden denenir, kalıcı kod (4xx) İLK denemede biter,
  kodsuz (bilinmeyen) hata geçici sayılır. `llm.py`'deki yerel kopya kaldırıldı,
  `_is_retryable` adı paylaşılan fonksiyona bağlandı (çağıranlar değişmedi).
- `vlm.py` zarif degradasyon sözleşmesini korur: kalıcı hata yine boş
  `CaptionResult`, ama geçici hata artık `call_with_retry` ile denenir.
- `embed/provider.py`: gövde hatası + 429/5xx için jitter'lı deneme döngüsü;
  2xx gövde hatası `EmbeddingUnavailable`'a sağlayıcının mesajıyla çevrilir.

11 yeni test (llm 4, embed 4, vlm 3); düzeltme öncesi dosyalara karşı 6'sı
düşüyor, kalanlar taşıma yolunun bozulmadığını kanıtlıyor.
fix(deploy): 🔧 yerel yığın volume'u önekli adıyla bulunsunAhmet Kaan Gümüş · e02a221
fix(deploy): 🔧 yerel yığın volume'u önekli adıyla bulunsun

compose volume anahtarını proje adıyla önekler (hezarfen_rag_rag-local); betik
önce var olanı arar, yoksa RAG_LOCAL_VOLUME/e düşer. Aksi
halde sağlama yapılmış olsa bile servis 'sağlanmamış' deyip reddederdi.
feat(deploy): 🧱 küçük varsayılan imge + API sağlayıcı varsayılanı, yerel yığın volume'uAhmet Kaan Gümüş · 1d40da1
feat(deploy): 🧱 küçük varsayılan imge + API sağlayıcı varsayılanı, yerel yığın volume'u

- Dağıtım varsayılanı API: Containerfile ENV RAG_EMBED_PROVIDER=api /
  RAG_RERANK_PROVIDER=api; operatör şablonu deploy/hezarfen_rag.env.example.
  Yerel yol silinmedi — .env ile seçilir.
- Fail-closed açılış ön denetimi (src/service/preflight.py): eksik taban
  adresi/model/anahtar servisi ayağa kaldırmaz (SystemExit 2), eksiği adıyla
  ve çalıştırılacak komutla söyler; anahtar RAG_*_API_KEY ya da
  RAG_*_API_KEY_ENV ile verilebilir.
- Zarf tek kaynak: compose x-rag-envelope (mem_limit_mb 3072, disk_min_gb 8);
  ürün servisi mem_limit 3 GiB; CI kapasite kapısı bu değerleri compose'dan
  okur (eski 12 GB / 20 GB model çağından kalmaydı).
- Küçük imge: requirements üçe bölündü (servis / yerel yığın / eval); yerel
  yığın imaja girmez, eklenti volume'den gelir (deploy/provision_local_stack.sh,
  pip imge içinde, idempotent, PROVISIONED işareti). Geçiş: .env + restart.
- cuda_status torch'u yalnız kuruluysa import eder → API yolu torch'suz koşar.
- Korpus yolu kiracılık düzenine çekildi (okul segmenti zorunlu: compose/env
  varsayılanları açık hata veriyordu).
- Testler: tests/unit/test_providers_deploy.py (25 test) + test_deployment
  mount beklentisi; kapı 1323 geçti / 34 atlandı.
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).
test(demo): 🔒 run_student import bekçisi — ImportError sınıfı CI'da compileall'ın kör noktasıydıAhmet Kaan Gümüş · 15f1244
test(demo): 🔒 run_student import bekçisi — ImportError sınıfı CI'da compileall'ın kör noktasıydı

b2ba173 sonrası doğrulamada bulunan kusur: src/demo/run_student.py kaldırılmış
PUBLIC_SCHOOL'u import ediyordu ve src/ içinde hiçbir test bu modülü import
etmediği için yeşil süitten geçmişti. compileall derleme yapar, import ETMEZ.
Süit: 1282 passed / 34 skipped.
fix(service,demo): 🩹 PUBLIC_SCHOOL kalıntısı silindi + bütçe tavanı okul anahtarına bağlandıAhmet Kaan Gümüş · a023743
fix(service,demo): 🩹 PUBLIC_SCHOOL kalıntısı silindi + bütçe tavanı okul anahtarına bağlandı

İki kusur, kiracılık commit'inden (b2ba173) sonra bulundu:

A) `PUBLIC_SCHOOL` hiçbir yerde TANIMLI DEĞİLDİ ama beş yerde anılıyordu;
   `src/demo/run_student.py` bu yüzden ImportError veriyordu. Kavram zaten
   kaldırılmıştı (okul-scoped ya da hiç) → referanslar SİLİNDİ, sabit
   TANIMLANMADI. Demo artık okulunu kendi kuruyor (`DEMO_OKUL="demo"`) ve
   korpus yolunu kanonik yardımcıdan alıyor (`service.multi.book_path`:
   data/<okul>/<kasa>/<sınıf>/<ders>/kitap.pdf); chat isteği de `school`
   taşıyor (okulsuz okur hiçbir satır görmez).

B) Bütçe tavanı ÖLÜYDÜ: kapı `check(tenant=school)` ile okula bakarken kayıt
   `record(tenant=req["tenant"])` ile istemcinin GÖNDERMEDİĞİ eski alana
   yazıyordu → okul sayacı hiç dolmuyor, kurum tavanı hiç tetiklenmiyordu.
   Artık `check`/`record` İKİSİ de okul anahtarını kullanır; özet ve soru
   uçları da harcamayı okul kovasına yazar (önceden hiç kaydetmiyorlardı) ve
   okul doğrulaması chat ile aynı kurala bağlandı (`unknown_school`).

Testler: `tests/unit/test_service.py::BudgetWiringTests` — tavanı gerçekten
doldurup reddi gözler (okul başına ayrı kova, eski `tenant` alanı tavanı
atlatamaz, özet+soru kaydı). Fail-pre-fix kanıtlandı: kayıt satırı eski
anahtara döndürülünce test "0.0 != 0.3" ile düşüyor.
Ayrıca "paylaşılan müfredat" diyen bayat yorumlar (generator/hybrid/lexical/
multi/http_app/dense) kiracılık gerçeğine çekildi.

Süit: 1281 passed / 34 skipped.
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.
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.
docs(ci): adı geçen test koşucusunu gerçek olanla hizala (pytest tests/unit)Ahmet Kaan Gümüş · 68633fd
docs(ci): adı geçen test koşucusunu gerçek olanla hizala (pytest tests/unit)

README'nin CI deploy bölümü ve workflow başlık yorumu süiti 'unittest'
diye anıyordu; validate işi 'katalog/uygulama doğrulaması' vaat ediyordu.
Workflow ise python -m pytest tests/unit -q koşar, katalog doğrulaması
tests/unit/test_corpus_catalog.py içindedir ve validate yalnız derler.
Prose workflow'un gerçekte koştuğunu anlatsın.
Merge branch 'lane/rag-contract'Ahmet Kaan Gümüş · 6a48862Browse files
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-15

chore: 🔧 compose stack, systemd unit and VPS deploy workflow - compose.yaml: env-file driven service (hezarfen_rag.env, operator-owned, from the repo's .env.example); the only environment: block left carries the host-specific corpus choice (BOOK_PATH/SINIF/DERS) as interpolations, so no secret or operator value can be shadowed - Containerfile: ENV block is the single source of the image defaults (HF_HOME/HOST/PORT); CMD now drives the uvicorn factory from $HOST/$PORT instead of hardcoding 0.0.0.0:8000 (a PORT in the env file was ignored) - gpu profile: YAML anchor instead of extends — podman-compose 1.6 crashed with KeyError: _deps whenever the base service was excluded by a profile (podman compose --profile gpu config died outright) - deploy/hezarfen_rag_compose.service: systemd user unit running podman compose --profile product with both --env-file arguments - CI: validate (compileall) ∥ build-and-test (pytest tests/unit, 1240 green in the image) then an SSH deploy gated on /health and /ready, with a capacity preflight (>= 12 GB free RAM, >= 20 GB disk) and rollback to previous_tag; deploy opens only on workflow_dispatch because the service needs ~4.5 GB of models and a GPU to meet the O-05 latency gate - tests/unit/test_deployment.py: two pins follow the new mechanism (operator env file instead of compose environment:; skip when the corpus is absent from the checkout) with the original intent keptAhmet Kaan Gümüş · 723c33f
chore: 🔧 compose stack, systemd unit and VPS deploy workflow
- compose.yaml: env-file driven service (hezarfen_rag.env, operator-owned, from
  the repo's .env.example); the only environment: block left carries the
  host-specific corpus choice (BOOK_PATH/SINIF/DERS) as interpolations, so no
  secret or operator value can be shadowed
- Containerfile: ENV block is the single source of the image defaults
  (HF_HOME/HOST/PORT); CMD now drives the uvicorn factory from $HOST/$PORT
  instead of hardcoding 0.0.0.0:8000 (a PORT in the env file was ignored)
- gpu profile: YAML anchor instead of extends — podman-compose 1.6 crashed with
  KeyError: _deps whenever the base service was excluded by a profile
  (podman compose --profile gpu config died outright)
- deploy/hezarfen_rag_compose.service: systemd user unit running
  podman compose --profile product with both --env-file arguments
- CI: validate (compileall) ∥ build-and-test (pytest tests/unit, 1240 green in
  the image) then an SSH deploy gated on /health and /ready, with a capacity
  preflight (>= 12 GB free RAM, >= 20 GB disk) and rollback to previous_tag;
  deploy opens only on workflow_dispatch because the service needs ~4.5 GB of
  models and a GPU to meet the O-05 latency gate
- tests/unit/test_deployment.py: two pins follow the new mechanism (operator
  env file instead of compose environment:; skip when the corpus is absent
  from the checkout) with the original intent kept
docs: cok-korpus yapilandirmasi ve olculen sureler (Refs #86)Kadir Yönak · ea476cc
docs: cok-korpus yapilandirmasi ve olculen sureler (Refs #86)

OLCULDU (RTX 4060, gercek /rag/chat, TestClient uzerinden tam uygulama):
  soguk dersin 1. sorusu  0,00 s  service_warming_up (eskiden HTTP 504)
  10/biyoloji kurulumu   55,0 s   327 chunk
  10/kimya kurulumu     171,5 s   438 chunk
  biyoloji sorusu         9,83 s  2 atif (s.99, 102)
  kimya sorusu            4,27 s  2 atif (s.20, 43)
  kapsamsiz cok-ders              corpus_ambiguous (tahmin YOK)

Uc davranisin bilincli oldugu ve NEDEN oyle oldugu yazildi: tembel kurulum
(#75 cozulene kadar her restart'ta 12 dk), seri kurulum (paralel kurulum
segfault uretiyordu), belirsizlikte tahmin etmeme (yanlis kitaptan cevap).
feat(servis): cok-korpus URUNE baglandi -- 1 ders yerine 15 (Refs #86)Kadir Yönak · 5d23976
feat(servis): cok-korpus URUNE baglandi -- 1 ders yerine 15 (Refs #86)

`CorpusRegistry` yazilmis ve test edilmisti ama `http_app`'e HIC BAGLANMAMIS.
Servis tek BOOK_PATH okuyordu; diskte 15 kitap (lise 10) varken urun yalniz
birine cevap veriyordu. Okul demosunda ogrenci kimyaya gectigi anda
"kaynaklarda bulunamadi" alir -- RAG hatasi gibi gorunur ama o korpus hic
yuklu degildir. Izleyen ogretmen icin urun "yalniz biyoloji biliyor" demektir.

  RAG_CORPORA=10/biyoloji,10/kimya,10/cografya   (ya da "all")
  RAG_WARM_CORPORA=all                            (acilista isitma, ops.)
Verilmezse davranis ESKISIYLE AYNI (tek BOOK_PATH).

TASARIMI BELIRLEYEN IKI OLCUM
- Modeller PAYLASILMALI: `build_service` her cagrida kendi embedder+reranker'ini
  kuruyordu; 15 kitap x (2,3 GB + 2,3 GB) -> 8 GB GPU'da OOM. `SharedModels`
  tek ornege indiriyor, indeksler korpusa ozel kaliyor.
- TEMBEL yukleme sart: tek kitap GPU'da 47,6 s (CPU 548 s). 15 kitabi acilista
  kurmak ~12 dk sagir servis demekti ve indeks kalici olmadigi icin (#75) bu
  bedel HER restart'ta odenirdi.

KOSARAK BULUNAN UC GERCEK HATA (hicbiri birim testlerde gorunmuyordu):

1. SOGUK DERSIN ILK SORUSU HTTP 504.
   Korpus kurulurken (GPU ~48 s) istek son tarihi (60 s) asiliyordu; ogrenci
   kimyaya gecince ZAMAN ASIMI goruyordu. Artik kurulum arka planda baslar ve
   urun hemen `service_warming_up` der (API-CONTRACT #82). Olculdu: 504 ->
   200, 0,00 s.

2. IKI KORPUS PARALEL KURULUNCA SUREC SEGFAULT.
   Paylasimli BGE-M3 ornegini iki thread'den es zamanli `encode()` etmek
   guvenli degil; ayrica iki indeks kurulumu VRAM tepesini ikiye katliyor.
   Kurulumlar artik SERI (`_build_gate`); sorgular etkilenmiyor (test bunu
   ayrica dogruluyor).

3. `SharedModels` KILIDI DEADLOCK URETIYORDU.
   `reranker` ozelligi kilidi tutarken uyari icin `self.embedder`'a bakiyor,
   o da AYNI kilidi istiyordu; duz `Lock` reentrant degil. BELIRTI YANILTICI:
   `/ready` surekli "kuruluyor" diyor, hicbir hata log'u dusmuyor, 900 saniyede
   tek korpus bile hazir olmuyordu. "Cok yavas" gibi gorunen sey aslinda "hic
   ilerlemiyor"du. RLock + kilit altinda ozellik cagirmama.

AYRICA duzeltilen iki sessiz hata:
- `status()` tuple anahtar donduruyordu; `/ready` onu JSON'a cevirdiginde 500
  olurdu.
- Korpus siniri asilinca `ValueError` yukari siziyordu (500); artik tipli red.
- Yapilandirmada YAZAN ama diskte OLMAYAN kitap sonsuza kadar "hazirlaniyor"
  diyordu -> istemci bosuna yeniden denerdi. Artik `no_corpus`.

YONLENDIRME YETKILENDIRME DEGILDIR: bu katman yalniz "hangi kitap" sorusunu
cevaplar; `guard/roles.can_access` kontrolu alt serviste DURUYOR (test kaydi).

`/ready` artik hangi derslerin hazir/kuruluyor/hatali oldugunu raporluyor.
32 yeni test; 1270+ unit test geciyor.
DURUM: INSAN INCELEMESI BEKLIYOR.
feat(saglayici): gomme ve rerank icin local <-> API gecisi (Refs #96)Kadir Yönak · 51bd63b
feat(saglayici): gomme ve rerank icin local <-> API gecisi (Refs #96)

Rerank, GPU'yu isteyen TEK parca (EXP-018, CPU sorgu basina):
  sorgu embed 0,122 s | arama ms | rerank 40 aday 95,9 s | LLM ~2-3 s
Uzak servise tasinirsa CPU sorgu tarafinda yeterli olur. Bu commit gecisi
mumkun kiliyor; VARSAYILAN local KALDI -- olculmus butun kalite sayilari
(EXP-011/013/017/018) o yola ait.

  RAG_EMBED_PROVIDER=local|api
  RAG_RERANK_PROVIDER=local|api|off

EN ONEMLI PARCA -- SESSIZCE DEVRE DISI KALAN FAIL-CLOSED KAPI.
Rerank kapatilinca ya da API'ye tasininca `contexts[0].score < abstain_score`
kurali BOZULUR: NoOp skorlari hep 1,0'dan basladigi icin kapi HIC tetiklenmez,
API skorlari ise 0-1 aralikta ama BGE'nin sigmoid DAGILIMI degil. Esik EXP-017'de
YEREL BGE uzerinde olculmustu (cevapsiz 0,09-0,34, cevaplanabilir 0,50+).
Yani saglayici degisince urun kitapta olmayan soruya da cevap uretmeye calisir
ve "kaynaklarda bulamadim" davranisi kaybolur -- okulda uydurma riskinin en
yuksek oldugu durum.
`check_abstain_compatibility()` bunu ACILISTA hataya cevirir ve uc cikis yolunu
birden sayar (yeniden kalibre et / RAG_ABSTAIN_SCORE=0 / bilincli override).
Sessizce devre disi kalmis bir fail-closed kapi, hic olmayandan daha
tehlikelidir: operator korumali sanir.

DIGER OLCULMUS BEDELLER (kod acilista uyarir, sessiz degil):
- API gomme SPARSE URETMEZ. BGE-M3 dense+sparse'i tek geciste veriyor; hibrit
  retrieval uc ayakli (dense + BM25 + sparse). OpenAI-uyumlu uclar yalniz dense
  doner -> bir ayak kesilir. `sparse_supported=False` ile raporlanir.
- Baska gomme modeli = baska vektor uzayi: golden set sayilari gecersizlesir,
  indeks yeniden kurulmali (boyut ilk gercek yanittan OLCULUR, varsayilmaz).

API ISTEMCILERINDE YAKALANAN TUZAKLAR (test edildi):
- Yanit sirasi: `data[].index` yok sayilirsa vektorler YANLIS chunk'lara baglanir
  ve atiflar sessizce kayar. Siralama index'e gore geri kuruluyor.
- `input_type` (query/passage) NVIDIA/Cohere'de retrieval kalitesini belirgin
  degistirir; ikisini ayni gondermek sessiz kalite kaybi.
- L2-normalize: indeks kosinus varsayiyor.
- Taninmayan rerank yaniti ISTISNA atar; sessizce aday sirasina dusmek kalite
  kaybini gorunmez kilardi.
- NoOp skorlari ilgililik suzgecini (relevance_min/rel) GECMELI; kapali rerank
  sessizce bir ELEME kapisina donusmemeli (test bunu dogruluyor).

OLCULEN SAGLAYICI DURUMU (NVIDIA_API_KEY ile, bugun):
- rerank ucu: HTTP 410 Gone, "end of life 2026-05-18" -> NVIDIA'da rerank YOK.
- embed: 81 modelden yalniz `nvidia/nemotron-3-embed-1b` calisiyor (2048 boyut);
  nv-embedqa-*, embed-qa-4, arctic-embed-l -> 404 "not found for account".
  BGE-M3 NIM'de barindirilmiyor.
Yani API rerank icin YENI BIR SAGLAYICI HESABI (Cohere/Jina/Voyage) gerekiyor.

28 yeni test, 1240 unit test geciyor.
DURUM: INSAN INCELEMESI BEKLIYOR.

2026-09-13

docs(exp-018): GPU imgesi dogrulandi, CPU gecikmesi parcalara ayrildi (Refs #96)Kadir Yönak · 3110393
docs(exp-018): GPU imgesi dogrulandi, CPU gecikmesi parcalara ayrildi (Refs #96)

Dogrulama (toolkit KURULU DEGIL, bu yuzden GPU'lu kap UCTAN UCA OLCULMEDI):
  GPU imgesi kuruldu        : localhost/hezarfen-rag:gpu 6,77 GB (CPU 2,04 GB)
  imgede torch              : 2.14.0+cu130, ana makineyle ayni
  --device nvidia.com/gpu   : unresolvable CDI devices -> toolkit yok
  RAG_REQUIRE_CUDA=1        : acilista hata, /ready 503
  /ready teshisi            : cuda.available=false, torch_cuda_build=13.0
                              -> operatore dogru yeri gosteriyor: sorun imgede
                                 degil ana makine kurulumunda
  hazir degilken /rag/chat  : 8 ms'de service_warming_up (96 s beklemiyor)

BULGU 5 -- GPU'yu asil isteyen parca YALNIZ reranker:
  sorgu embed (CPU)     0,122 s   onemsiz
  hibrit arama          ms        onemsiz
  rerank 40 aday (CPU) 95,9 s     butun sorun burada
  LLM (DeepSeek API)   ~2-3 s     zaten uzak servis
Yani rerank uzak bir servise tasinirsa CPU sorgu tarafinda yeterli (~3 s).

AMA ikinci bir CPU maliyeti var: indeks kurulumu 548,5 s (GPU 47,6 s). Indeks
in-memory oldugu icin (#75 acik) bu bedel HER YENIDEN BASLATMADA odenir. CPU'ya
gecis, rerank API'ye tasinsa bile 9 dakikalik acilisi miras alir.
feat(dagitim): GPU konteyner profili + sessiz CPU'ya dusus korumasi (Refs #96)Kadir Yönak · d116535
feat(dagitim): GPU konteyner profili + sessiz CPU'ya dusus korumasi (Refs #96)

EXP-018'de olculdu: kapi O-05 (p50 <= 6 s) CPU'da GECILEMEZ, GPU'da GECILIR
(p50 4,96 s). Ama imge torch'u SABIT CPU tekerleginden kuruyordu -- yani urun
okul demosunda interaktif OLMAYAN tek yapilandirmaya kilitliydi.

1) Containerfile: `ARG TORCH_INDEX` (varsayilan cpu). GPU imgesi
   `--build-arg TORCH_INDEX=https://download.pytorch.org/whl/cu130` ile kurulur.
   Varsayilan CPU KALDI: GPU imgesi ~2,5 GB daha buyuk ve calismasi icin ana
   makinede NVIDIA Container Toolkit sart.

2) compose.yaml: `gpu` profili (`rag-gpu`), `devices: nvidia.com/gpu=all`,
   `RAG_REQUIRE_CUDA=1`. `product` profili degismedi.

3) SESSIZ CPU'YA DUSUS KORUMASI -- bu degisikligin asil sebebi.
   torch CUDA bulamazsa SESSIZCE CPU'ya duser. Konteynerde bu, saglikli gorunen
   ama her soruya bir bucuk dakikada cevap veren bir servis demektir; log'da tek
   satir uyari yoktur ve demo sirasinda "urun bozuk" diye okunur.
   `RAG_REQUIRE_CUDA=1` bunu ACILISTA hataya cevirir ve mesaj UC OLASI NEDENI
   birden sayar (imge CPU torch ile mi kuruldu, toolkit kurulu mu, --device
   verildi mi) + bedeli sayiyla soyler. Kontrol AGIR ISTEN ONCE: 2,3 GB model
   indirip sonra patlamak operatorun 5 dakikasini cope atardi (test bunu
   dogruluyor).
   Varsayilan KAPALI: CPU kurulumu ve GPU'suz gelistirme bozulmaz; o durumda
   yalnizca acilis UYARISI verilir (sayiyla: "~96 s, kapi 6 s").

4) `/ready` artik `cuda` durumunu makine-okunur raporluyor. Operator "neden bu
   kadar yavas?" sorusunu gecikmeden tahmin ederek degil, uctan okuyarak
   cevaplayabilir.

5) README'ye Linux/Podman bolumu: iki profil, olculen p50'ler, tek seferlik
   toolkit kurulumu ve eszamanlilik siniri (8 ogrencide p50 11,5 s). Eskimis
   "compose yalniz hazirlik kontrolu calistirir" notu duzeltildi (#81'de
   gecersizlesmisti).

DURUST SINIR: GPU imgesi kuruluyor ama HENUZ KOSULMADI -- bu makinede
nvidia-container-toolkit KURULU DEGIL (nvidia-ctk yok, /etc/cdi yok) ve kurulumu
root gerektiriyor. Yani "GPU konteyner calisiyor" DENMEDI; yol hazirlandi,
dogrulama toolkit kurulunca yapilacak.

1212 unit test gecti.
DURUM: INSAN INCELEMESI BEKLIYOR.
perf: GPU'da p50 4,96 s -- kapi O-05 geciyor; O-06 gecmiyor (Refs #96)Kadir Yönak · 3f1743d
perf: GPU'da p50 4,96 s -- kapi O-05 geciyor; O-06 gecmiyor (Refs #96)

EXP-018'e iki olcum eklendi. EXP-015'te yapilmayan sey: servisi GPU ile kosup
GERCEK /rag/chat isteklerini olcmek.

BULGU 3 -- GPU'DA SERVIS INTERAKTIF.
Konteyner CPU torch kuruyor (--index-url .../whl/cpu), yani EXP-015'in 96 s'si
KONTEYNERIN degil CPU'NUN sonucuydu. Ana makinede GPU ile (RTX 4060, 10/biyoloji,
DeepSeek):
  p50 = 4,96 s   p90 = 6,04 s   maliyet $0,00088/soru   hazir olma 47,6 s
  8/8 kitapta olan soru atifli cevaplandi (1-4 atif)
  2/2 kitapta olmayan dogru sebeple cekimser (insufficient_data)
Kapi O-05 (p50 <= 6 s) GPU'da GECIYOR. #96 bir CPU sorunu, urun sorunu degil.

BULGU 4 -- ESZAMANLILIK DUVARI (kapi O-06 hic olculmemisti).
  esz. ogrenci |  p50   |  max   | hata
       1       | 4,96 s | 6,04 s |  0
       3       | 6,08 s | 8,78 s |  0
       5       | 9,31 s | 10,50 s|  0
       8       |11,54 s | 14,53 s|  0
Hata yok, request_id'ler benzersiz (8/8) -- dogruluk tarafi saglam. Ama gecikme
eszamanli istekle neredeyse DOGRUSAL buyuyor: embed ve rerank GIL altinda ve tek
GPU'da siraya giriyor. 8 ogrencide p50 zaten kapinin iki kati.

DEMO ICIN PRATIK SONUC: ogretmenin tek ekrandan gosterdigi demo sorunsuz;
"herkes telefonundan ayni anda sorsun" demosu patlar. 30 kisilik sinif dogrusal
egilimle ~40 s -- bu bir TAHMIN, olcum degil (8'in ustu olculmedi).

A secenegi (GPU) icin iki engel kayda gecirildi: konteyner imgesi CUDA torch ile
yeniden kurulmali ve bu makinede `nvidia-container-toolkit` KURULU DEGIL
(nvidia-ctk yok, /etc/cdi yok) -- yani konteynere GPU su an gecirilemez.

DURUM: INSAN INCELEMESI BEKLIYOR.
perf(rerank): CPU gecikmesi olculdu, kirpma uzunlugu ayarlanabilir (Refs #96)Kadir Yönak · 12f288c
perf(rerank): CPU gecikmesi olculdu, kirpma uzunlugu ayarlanabilir (Refs #96)

EXP-018. EXP-015'te konteyner CPU'da 40 adaylik rerank icin 65,2 s harciyordu
ve kapi O-05 p50 <= 6 s istiyor. Iki soru olculdu: parametreler ne kadar yer
aciyor, hizlandirmanin kalite bedeli ne?

BULGU 1 -- CPU GECIKME IZGARASI (3 sorgu ort., CUDA kapali)
  max_length \ aday |   40   |   20   |   12   |    8
              512   | 95,9 s | 52,5 s | 32,2 s | 21,3 s
              256   | 47,6 s | 25,6 s | 12,1 s |  9,2 s
              192   | 37,2 s | 15,7 s |  9,0 s |  6,1 s
En agresif ayar TEK BASINA 6,1 s -- kapinin butun butcesi. Retrieval, LLM ve
guard icin SIFIR kaliyor. CPU'da bu reranker ile O-05 GECILEMEZ; parametre
ayari duvari asmiyor, yerini degistiriyor.

BULGU 2 -- RERANKER'IN KATKISI BU SET ILE OLCULEMIYOR
"Madem pahali, kaldiralim mi?" sorusunu olctum. Ilk sonuc reranker'in ZARARLI
oldugunu soyledi (RRF r@6=0,939 vs rerank 0,890; nDCG 0,945 vs 0,863).
Bu sonuca GUVENMEDIM ve senaryo kirilimina baktim:
  direct       -0,050     figure_table  0,000     synthesis 0,000
  multi_hop    -0,250     global       +0,023
Desen olcumun kusurunu ele veriyor: golden set'in direct/synthesis/multi_hop/
figure_table sorgulari birimlerin KENDI METNIDIR (igne testi) -- soru degil.
Cross-encoder SORU<->PASAJ ilgisine bakmak uzere egitilmistir; girdisi soru
degilse dogal olarak kotu siralar. Tek soru bicimli kategori (`global`)
reranker'in onde oldugu tek kategori, ama n=11 ve fark 0,25 item.

66 item'in 55'i igne testi. Olcum rerank'in ALEYHINE yapilandirilmis; bu sete
dayanarak reranker'i kaldirmak, olcum kusurunu urun kararina cevirmek olurdu.
B (kucuk reranker) ve C (rerank'siz) secenekleri ancak INSAN YAZIMI soruyla
ayirt edilebilir (#91).

Ilk denememde `rerank_select` kullanmistim; o fonksiyon ilgililik suzgeci
uygulayip top_n'den az baglam donduruyor, yani karsilastirma rerank'e haksizdi.
Ayni aday havuzu + ayni oge sayisi ile tekrarlandi.

YAPILAN TEK DEGISIKLIK
`RAG_RERANK_MAX_LENGTH` eklendi, VARSAYILAN 512 KALDI. Amac bir CPU kurulumunun
kaliteyi BILEREK takas edebilmesi -- 95 s'ye mahkum olmak yerine. Kisaltmanin
kalite bedeli olculemedigi icin varsayilan oynatilmadi. Anlamsiz degerler
(8, 0, -512, 100000) varsayilana duser.

1199 unit test gecti.
DURUM: INSAN INCELEMESI BEKLIYOR. #96 KAPANMADI -- karar (GPU / kucuk reranker /
rerank'siz) olcumle desteklenmis degil.
feat(eval): cekimserlik esigi olculdu -- esik DEGISTIRILMEDI (Refs #60)Kadir Yönak · 124805e
feat(eval): cekimserlik esigi olculdu -- esik DEGISTIRILMEDI (Refs #60)

EXP-017. `abstain_score=0.30` hic kalibre edilmemis bir varsayilandi ve urunun
en gorunur davranisini tek basina belirliyor: tepe rerank skoru esigin
altindaysa LLM HIC CAGRILMAZ, ogrenci "kaynaklarda bulamadim" alir.

Kalibrasyon LLM cagirmaz ($0): esik zaten LLM'den ONCE karar verir. Ayar dev
yarisinda, rapor frozen yarisinda (#M3-8/EVAL-11).

BULGU 1 -- BU SET ILE ESIK SECILEMEZ.
frozen, yanlis cevap:  0,30 -> 0,115 GA[0,040-0,290]
                       0,49 -> 0,077 GA[0,021-0,241]
                       0,67 -> 0,038 GA[0,007-0,189]
GA'lar TAMAMEN ortusuyor. Gereken orneklem (%95, iki oranli):
  0,30 -> 0,49 icin 1844 cevapsiz item   (elde: 26)
  0,30 -> 0,67 icin  363 cevapsiz item
Kalibrasyonun asil ciktisi bir esik degil, BU SAYI oldu.

BULGU 2 -- AYRISMA BANDI 0,35-0,49.
Cevaplanabilir senaryolarin TAMAMI 0,495 uzerinde (figure_table min 0,495;
direct 0,673; multi_hop 0,762; synthesis 0,797). unanswerable 0,091-0,101,
out_of_scope 0,222, adversarial max 0,337. Yani bu bantta esik nereye konursa
konsun ayni sonucu verir. Bugunku 0,30 bandin hemen altinda.

BULGU 3 -- HARD NEGATIVE ESIKLE COZULEMEZ.
0,49'da kalan yanlis cevaplar 0,88 ve 0,82 skorlu `kismi_ortusme` item'lari:
"Besin zinciri nedir VE deniz ekosistemlerindeki farki nedir". Sorunun BIR
YARISI kitapta var; yuksek skor DOGRU, kanit gercekten ilgili. Ayrilacak bir
sey yok. Gereken sey cevap duzeyinde bir davranis: "su kismi kitapta var, su
kismi yok". Ayrica golden set'teki `cekimser` etiketi bu item'lar icin
TARTISMALI -- urun dogru davransa bile arac onu yanlis sayiyor olabilir (#91).

BULGU 4 -- IGNE TESTI SISKINLIGI GERCEKLESMEDI.
golden set'in `cevapla` sorulari birimlerin kendi metni oldugu icin skorlarinin
sisme ve esigi yukseltmenin gercek soruda yanlis cekimserlik uretme suphesi
vardi. EXP-014'un 10 GERCEK insan sorusu ayni kitapta olculdu: kitapta olanlar
0,899-0,997 aliyor (igne testinin minimumundan bile yuksek), kitapta olmayanlar
HIC baglam getirmiyor. Suphe dogrulanmadi. Sinir: n=5, gosterge, kanit degil.

YAPILAN TEK DEGISIKLIK
Esik `RAG_ABSTAIN_SCORE` ile ayarlanabilir; VARSAYILAN 0,30 OLARAK KALDI.
Gerekce: `generator.py` ve `runner.build_pipeline` ayri ayri elle `0.30`
yaziyordu; biri degisse digeri sessizce ayrisirdi -- ACC-10'un tam olarak bu
sekli olculmustu (parent genisletme eval'de acik, uretimde kapali; yayinlanan
skorlar uretimi temsil etmiyordu). Bozuk ve aralik disi deger varsayilana
duser: "1.5" sessizce kabul edilse urun HER soruya cekimser kalirdi.

Env okumasi AYRI bir fonksiyonda (`_env_abstain_score`) cunku modulu
`importlib.reload` ile sinamak bu modulde ALAKASIZ testleri kiriyor: reload
`_USE_INIT_ROLE` sentinel'inin yeni bir ornegini yaratiyor ve kimlik
kontrolleri bozuluyor. Ilk denemede test_memory + test_generate'te 4 test
kirildi; seam ile cozuldu.

1194 unit test gecti.
DURUM: INSAN INCELEMESI BEKLIYOR.
test(kirilma): katalog testlere baglandi, kapsam olculdu (Refs #74)Kadir Yönak · a99f9f0
test(kirilma): katalog testlere baglandi, kapsam olculdu (Refs #74)

Obsidian benchmark.md §8.4'teki 49 kirilma senaryosu bir Markdown tablosuydu:
kimse hangi satirin test edildigini bilmiyordu, "kapsam %80" iddiasi (kapi
T-06) olculemiyordu ve bir test silinse katalog sessizce yalan soylemeye devam
ederdi.

`tests/breakage_catalog.py`: senaryolar veri halinde, her biri KAPSAYAN
testlerin tam adlariyla. `tests/unit/test_breakage_coverage.py` o adlarin
gercekten var oldugunu dogruluyor -- 242 atif, harita curuduğu anda kirilir.

OLCULEN KAPSAM
  bagli      40/49 = %81,6   (kapi T-06 esigi %80)
  bosluksuz  25/49 = %51,0

IKI SAYI BIRDEN raporlaniyor cunku tek yuzde yaniltir: 15 senaryo "kapsaniyor
ama eksigi var" durumunda. Ornek: E-03 (2000 sayfalik PDF) 60 sayfaya kadar
sinandi; sayiya 1 olarak girer, senaryo tam karsilanmaz. Tek yuzdeye bakan
olduğundan iyi bir tablo gorur.

DURUSTLUK KURALI koda yazildi: `covered_by` yalniz o senaryoyu GERCEKTEN
sinayan testleri icerir. Bos liste = kapsanmiyor ve `note` neyin eksik
oldugunu YAZMAK ZORUNDA (test bunu dogruluyor). Listeyi ilgisiz testlerle
doldurmak kapsam sayisini sisirir ve kapiyi anlamsizlastirir -- bu, olcmemekten
daha kotudur.

Bu bir KAPI DEGIL: `test_coverage_does_not_regress` yalniz bugunku olcumun
altina dusulmedigini sabitler. T-06 karari `src/eval/gates.py`'da, olcum
kosumunda verilir (#88).

Kapsanmayan 9 senaryo devralma baglamiyla docs/Backlog.md BL-012'ye yazildi.
Demo riski tasiyan ikisi: E-64 (LLM dil karistirir -- EXP-009'da GERCEKLESTI,
cikti dili kapisi yok) ve E-80 (servis yeniden baslarsa indeks kayip, #75).

Ayrica: dogrulayici once pytest --collect-only kosuyordu (177 s, hizli suite'i
tek basina yedi katina cikariyordu). AST ile kaynak taramaya cevrildi: 0,17 s,
ayni 242 kontrol. Tarama tests/unit/test_generate.py'de kacak bir `\d` kacis
dizisi de buldu (r-string yapildi).

NOT: benchmark.md §8.4 GUNCELLENMEDI -- kilitli dosya, Kadir onayi gerekiyor.
Kapsam sayilarinin oraya islenmesi onay sonrasi.

1165 unit test gecti.
DURUM: INSAN INCELEMESI BEKLIYOR.
fix(eval): hakem kalibre edildi -- HIC CALISMIYORDU, uydurmaya kordu (Refs #72)Kadir Yönak · 0a47883
fix(eval): hakem kalibre edildi -- HIC CALISMIYORDU, uydurmaya kordu (Refs #72)

EXP-016. Negatif + pozitif kontrol suite'i (20 vaka, 5 bozma turu) yazildi ve
ilk kosumda uc ciddi kusur buldu. Urun kodunda degil, OLCUM ARACINDA.

BULGU 0 -- hakem hic calismiyordu.
Kosumun ilk ciktisinda 60 olcumun 60'i su hatayla dustu:
  AttributeError: 'str' object has no attribute 'truths'/'statements'/'steps'
`DeepSeekJudgeModel.generate()` her kosulda `str` donduruyordu; deepeval 2.9.3
`schema=` verilen cagrida O SEMANIN NESNESINI bekliyor. Bu neden gorunmuyordu:
`evaluate()` istisnayi errors'a yazip None skor donduruyor, rapor da None'lari
atliyordu -- hakem sessizce hicbir sey olcmuyor, hicbir yerde "olcemedim"
demiyordu. Negatif kontrol suite'inin var olus sebebi tam olarak bu.

BULGU 1 -- `faithfulness` uydurmaya KOR. Ayrim 0,020.
Gold cevabin icine baglamda gecmeyen somut bir cumle eklendiginde
("Bu konu 1923'te Ankara'da kanitlanmistir") faithfulness 1,000 veriyor.
Nedeni: DeepEval'in metrigi yalniz baglamla CELISEN iddialari cezalandirir;
desteksiz ama celismeyen iddia tam puan alir. Metrigin kusuru degil, BIZIM
tanimimizla uyusmamasi: bu urunde "uydurma" celismek degil DESTEKSIZ olmaktir.

BULGU 2 -- BOS cevap faithfulness=1 ve answer_relevancy=1 aliyordu.
BULGU 3 -- tersine cevrilmis iddia ("artar"->"azalir") correctness 0,9 aliyordu.

DUZELTMELER
- `_parse_schema()`: cikti JSON'a cevrilip sema nesnesi kurulur; kod blogu
  sarmali ve cevresindeki serbest metin kirpilir. Cozulemeyen cikti ISTISNA
  ATAR, sessizce bos nesneye donusmez.
- Yeni `groundedness` metrigi (GEval, ACTUAL_OUTPUT x RETRIEVAL_CONTEXT).
  `faithfulness` KALDIRILMADI: celiski ile desteksizlik farkli seylerdir,
  ikisi de raporlanir ki fark gorunur kalsin.
- Bos cevap kisa devresi: LLM'e hic sorulmaz, dort metrik de 0,0.
- Daha kati correctness kriteri: yon tersine cevrilmisse < 0,2.

SONUC (ayni 20 vaka)         once -> sonra
  groundedness (ayrim)          --  -> 0,805
  answer_correctness (ayrim)  0,720 -> 0,840
  answer_relevancy (ayrim)    0,348 -> 0,548
  fabricated_fact/groundedness  --  -> 0,025
  negation/correctness        0,900 -> 0,000
  empty/relevancy             1,000 -> 0,000

DURUST SINIRLAR (kapanmadi, #72 bu yuzden acik kalir)
- Uretici ile hakem HALA ayni model (deepseek-chat); self-preference olculmedi.
  --judge-model bayragi hazir, EXP-009'daki nemotron adayiyla tekrar kosulmali.
- Cohen kappa hesaplanmadi (insan etiketi yok, #91). cohen_kappa() yazildi ve
  test edildi; tek sinif varsa 1,0 degil None doner -- "mukemmel uyum"
  yanilsamasi yaratmasin.
- answer_relevancy pozitif = 0,812: gold cevabin KENDISI yalniz 0,81 ilgili
  bulunuyor. Bu metrigin esigi bu tavan bilinmeden konamaz.
- n=20 dar, GA'lar genis. Esik kararlari bu kosuma dayandirilmamali.

DURUM: INSAN INCELEMESI BEKLIYOR.
test(urun): bozuk PDF ve sil-yeniden indeksle dongusu + tipli kaynak hatasi (Refs #73)Kadir Yönak · dcef83d
test(urun): bozuk PDF ve sil-yeniden indeksle dongusu + tipli kaynak hatasi (Refs #73)

#M3-10'un kalan iki dosyasi. Boylece istenen 7 dosyanin hepsi var.

BOZUK PDF -- OLCULEN DAVRANIS ve duzeltilen kusur:
Bozuk/sifreli/bos/PDF-olmayan dosyalar hic test edilmiyordu. Olcunce her biri
PyMuPDF'in KENDI istisnasini firlatiyordu:
  bozuk baytlar    -> FileDataError
  PDF olmayan .pdf -> FileDataError
  0 baytlik dosya  -> EmptyFileError
  sifreli PDF      -> ValueError("document closed or encrypted")
Bunlar kutuphane IC istisnalaridir; cagiran katman "kaynak dosya okunamadi" ile
"kodda hata var"i ayirt edemiyordu. Ogretmen bozuk bir kitap yukledinde urun ona
ne soyleyecegini bilemezdi. `UnreadableSource(reason=...)` eklendi:
encrypted | corrupt | empty_file | unknown. ValueError'dan tureyor, eski
`except ValueError` bloklari kirilmiyor.

SIL -> YENIDEN INDEKSLE: entegrasyon testi indeks KATMANINI olcuyordu. Bu dosya
URUN DONGUSUNU olcuyor -- ACC-09'un tam sekli: re-ingest sonrasi cache_hit=True
ile SILINMIS span'a atif. Ogrenci atifa tikliyor, sayfa yok.

IKI KISIT KAYDA GECIRILDI (sessizce kesfedilmesin):
- `doc_id = sha256(dosya)[:12]`, yani BAYT kimligi. Ayni icerik YENIDEN
  URETILIRSE (PDF'e gomulu olusturma zamani degistigi icin) doc_id degisir:
  EBA'dan ayni kitabi tekrar indirmek oksuz chunk birakabilir.
- Bos doc_id ile silme ISTISNA ATMAZ, errors dolu sonuc doner. Onemli olan
  indekslere hic dokunulmamasi -- test bunu dogruluyor.

Metni yalnizca sayfa numarasindan ibaret 300 sayfalik PDF 0 birim uretiyor; bu
DOGRU davranis ve ayni olcekte gercek icerikle >=100 birim ciktigini gosteren
karsi test yazildi.

1132 unit + 76 entegrasyon testi gecti.
DURUM: INSAN INCELEMESI BEKLIYOR.