forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to service/src/compute/model.pyClear filter

2026-09-18

fix(compute): 🕒 trend time anchor reads uuid v7 exam ids too, not only ULIDsAhmet Kaan Gümüş · 0d9d992
fix(compute): 🕒 trend time anchor reads uuid v7 exam ids too, not only ULIDs

`course_trend()` ordered a course's marks by decoding each exam id as a
26-char ULID (`model.ulid_ms`). The backend mints uuid v7, so every id failed
to parse, every row was dropped as "time unknown", and a course with 8 graded
marks answered `available=false`, `n=0`,
"eğilim için en az 6 not gerekir" — the live symptom in
`GET /api/insights/students/{id}` (Matematik: n_marks=8 while trend n=0).

Replace the anchor with `model.id_ms()`: uuid v7 (canonical 36-char form,
version nibble pinned to 7, first 48 bits = unix-ms) or ULID (26-char
Crockford base32, first 10 chars). An unparseable id still falls back to
`None` — no invented timestamps, and the caller skips the row as before. The
≥6-mark threshold is untouched: the bug was the anchor, not the gate.

Tests (`tests/test_model.py`, new): the live uuid v7 sample, a real fixture
ULID, the seeder's own ULID→uuid-v7 pair (`ids.ulid_to_uuid7`) agreeing on
the same stamp, malformed/None inputs returning `None` without raising, and
`course_trend` over 8 uuid v7 marks (`available=true`, `n=8`) plus a mixed
ULID/uuid-v7 series ordering correctly.

Sweep of the same class ("assume the id is an X"):
* `attention.py` evidence token `exam_ulid_created_at` → `exam_id_created_at`
  (no consumer matches the old value) and its stale docstring.
* `marks._ordered_marks` docstring and `docs/HESAP-DOGRULAMA.md` §1 updated.
* Left as-is: `protocol.new_trace_id()` stays ULID (backend `protocol.rs`
  documents the frame trace id as ULID and never correlates on it);
  `ids.py` is the generation-side ULID→uuid-v7 migration record;
  `spec/schema.json` `id_rules` is the pre-Postgres snapshot.
feat(capabilities): 🔌 register the insight.* handlers and gate the Hello frame on themAhmet Kaan Gümüş · 618a44d
feat(capabilities): 🔌 register the insight.* handlers and gate the Hello frame on them

The dispatch table was empty while the Hello frame announced three names, so
every dispatched insight.student / insight.refresh was answered
`unknown_capability` -- live, against the deployed backend. handlers.wire()
registers all three on the runtime path (bridge.run_once), and
capabilities.verify_dispatchable() refuses to boot when an advertised name has
no handler, so advertising and dispatch cannot drift apart again.

- insight.student: one student, computed and written now; `since` moves the
  attention window's term start, `sections` narrows the four summary modules
  (an unrequested module is written `null` = "not computed", which the
  backend's SummaryRow keeps apart from `{}`).
- insight.class: the course roster derived from that course's addressed
  homework (the only id source the bridge read allowlist exposes), computed as
  a cohort; `topic_gaps` stays empty and `coverage.unavailable` says why.
- insight.refresh: the school sweep through run_school(nightly=True), so the
  zeka_run ledger row that GET /insights/runs serves is written (running +
  verdict). A discovered roster also purges departed students and sweeps
  retention; `user_ids` is a subset, not a roster, and never purges.
- run_school gains nightly/sections/outcomes; a scoped compute writes no
  ledger, no purge and no sweep. Purge is now gated on a discovered roster,
  which also closes the silent data-loss path in `cli --students`.

Tests: tests/test_handlers.py (fail-pre-fix dispatch, contract fields per
capability, boot self-check, scoped-refresh no-purge); the truth pins in
tests/test_capabilities.py and the purge expectations in test_pipeline.py are
updated to the merged backend dispatch (insight.student + insight.refresh
sent, insight.class still not).

2026-09-17

♻️ refactor: ZEKA'yı köprü deposuna taşı — veritabanı erişimi tamamen kaldırıldıAhmet Kaan Gümüş · d98ed4b
♻️ refactor: ZEKA'yı köprü deposuna taşı — veritabanı erişimi tamamen kaldırıldı

Değişmez kural: bir AI servisi uygulama veritabanına asla doğrudan erişmez.
ZEKA'nın kendi deposu yoktur; hesapladığı her satır ve okuduğu her liste
backend'e QUIC köprüsünden `insight.*` yetenek çağrısıyla gider.

* silindi: pg_client.py, store_pg.py, tenants.py, store_factory.py,
  schema/, psycopg bağımlılığı, ZEKA_PG_DSN ve ZEKA_DB_*/ZEKA_SCHOOL_* knobs
* yeni: store.py köprü deposu (BridgeStore + okul kapsamlı SchoolStore,
  BridgeCaller seam, 500'lük gruplar, 2 deneme + atla -> partial), protocol.py
  yetenek çerçevesi, bridge.call_capability
* açılış hiçbir şey açmaz; backend yokken loglanır ve geri çekilerek denenir
* yazma düşerse koşu partial olur, okulun günü kapanmaz ve `store`
  failed_modules ile koşu defterine yazılır (kalıcı kayıt)
* okul listesi backend'den (insight.schools.list); ZEKA_SCHOOLS yalnız filtre
* CLI/compose/env/docs: DSN ve şema yükleme yolları kaldırıldı

2026-09-16

createMuhammet Ozdemir · 98b2423Browse files