forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 08aa13eab28a49f02102a0484b0161ba30d7af3a

2026-09-11

Merge branch 'layer-split/fee_attendance'Ahmet Kaan Gümüş · 08aa13e
Merge branch 'layer-split/fee_attendance'

# Conflicts:
#	src/db/mod.rs
#	src/domain/attendance.rs
#	src/domain/event.rs
#	src/domain/session_attendance.rs
#	src/service/mod.rs
#	src/web/payments.rs
#	src/web/sessions.rs
Merge branch 'layer-split/meal'Ahmet Kaan Gümüş · b0e9ab8
Merge branch 'layer-split/meal'

# Conflicts:
#	src/db/mod.rs
#	src/service/mod.rs
Merge branch 'layer-split/chatbot'Ahmet Kaan Gümüş · f360d85
Merge branch 'layer-split/chatbot'

# Conflicts:
#	src/db/mod.rs
#	src/service/mod.rs
🧹 chore: split meal_attendance, meal_ledger, menu, menu_dish, dietary_profile into domain/db/service layersAhmet Kaan Gümüş · d548120
🧹 chore: split meal_attendance, meal_ledger, menu, menu_dish, dietary_profile into domain/db/service layers

- db/: menu (publish/read/find/list/CAS cap update/cascading delete +
  bump_menu_and_write), menu_dish (create/read/listings/count/patch/delete),
  meal_attendance (mark/list_for_menu/list_for_student), meal_ledger
  (append/read/price_snapshot/list_for_student/balance_of + KindTotal),
  dietary_profile (read/tags_of/save). Bodies byte-identical; entity
  fields pub(crate) for cross-layer construction (exam precedent).
- service/: menu owns MENU_LOCK (multi-call count-then-write span) and
  every dish write (add_dish with the MAX_DISHES_PER_MENU gate,
  update_dish/delete_dish) plus menu/dish read pass-throughs;
  meal_ledger owns charge_booking/reverse_booking/credit orchestration;
  meal_attendance and dietary_profile are read-through pass-throughs.
- domain/: pure remnants only — ids, newtypes, getters, sign convention,
  charge_for/reversal_for row builders, conflicts; ULID IDS minters stay;
  persistence tests ride with their fns into db/.
- web/meals.rs: handlers call service::* only; MENU_LOCK leases and the
  dish-cap gate moved out; validation order preserved.
- re-pointed merged callers (service/meal_booking, db/meal_booking,
  db/exam_attempt doc link) and test imports (integration, regress_meals).

cargo check --all-targets clean; cargo test --lib 577 passed 0 failed;
cargo test --test regress_meals 18 passed 0 failed.
Merge branch 'layer-split/catalog'Ahmet Kaan Gümüş · 8c2ca53
Merge branch 'layer-split/catalog'

# Conflicts:
#	src/web/classes.rs
🧹 chore: split subject and term into domain/db/service layersAhmet Kaan Gümüş · 6533a0a
🧹 chore: split subject and term into domain/db/service layers

domain/subject.rs keeps SubjectId/SubjectName/SubjectDescription/Subject + getters
and the pure validation tests; domain/term.rs keeps TermId/TermName/gone_error/
archived_error/ref_move/Term + getters.

db/subject.rs: create (cap::touch_and_create), read, list_by_ids, list_for_course,
update (FieldUpdate), delete (guarded transaction). db/term.rs: create, read,
list_all, update (ordered range guard), delete (refcount-guarded), archive,
unarchive, stamp. Persistence race tests ride along byte-identical.

service/subject.rs: pass-throughs + the moved id resolvers in_course/must_exist
(was web::subjects helpers). service/term.rs: pass-throughs + require_open
(was Term::require_open), resolve (was web::terms::resolve_term), require_writable
(the archived-refusal gate update/delete handlers inlined), delete's linked-409
mapping (was web::terms).

Web: subjects.rs/terms.rs handlers call service only; the archived gate stays
ordered before the range pre-flight by calling service::term::require_writable
between read and write. Callers re-pointed crate-wide: web/courses.rs,
web/classes.rs, web/homework.rs, web/exams/{mod,questions}.rs, web/bank_questions.rs,
db/{course,exam,exam_attempt,exam_question}.rs (tests + doc links),
service/{course,exam_attempt}.rs, domain/{class_group,bank_question,homework,
homework_file,homework_result,homework_submission}.rs (tests + doc links),
tests/regress_course_{child_orphans,delete}.rs.

Purity verdicts: domain/{timestamp,monotonic_id,text_fold,role}.rs have zero
production query execution (text_fold's only .query( is inside a #[cfg(test)]
folding test) — they stay domain-only, no db/service modules.

cargo check --all-targets 0 warnings; cargo test --lib 577 passed 0 failed;
integration: 13 subject/term/question/homework route tests green.
Merge branch 'layer-split/identity'Ahmet Kaan Gümüş · 919680f
Merge branch 'layer-split/identity'

# Conflicts:
#	src/db/mod.rs
#	src/domain/pomodoro.rs
#	src/domain/profile.rs
#	src/service/mod.rs
#	src/web/users.rs
Merge branch 'layer-split/comms'Ahmet Kaan Gümüş · 4ab90d9
Merge branch 'layer-split/comms'

# Conflicts:
#	src/db/mod.rs
#	src/domain/event.rs
#	src/domain/registration.rs
#	src/service/mod.rs
#	src/web/pomodoro.rs
🧹 chore: split profile, badge, builder into domain/db/service layersAhmet Kaan Gümüş · 7f616c0
🧹 chore: split profile, badge, builder into domain/db/service layers

C3 identity lane. Moves, not rewrites:

- badge: BadgeStats::load / BadgeAward::list_for / sync (UPSERT with the
  earned_at = NONE idempotency stays whole) -> db::badge, with the
  award-key mint and the persistence tests; BadgeStat/BadgeStats/earned/
  BadgeAward (pure rules) stay in domain::badge; service::badge wraps
  list_for/sync for the web layer.
- profile: ProfileStats::load (+ PomodoroTotals, persistence tests) ->
  db::profile; newtypes + getters stay; service::profile::load wraps.
- builder: find_by_username/read/create(create_session)/find_by_token/
  delete_by_token -> db::builder; the idempotent seed ensure ->
  service::builder (ensure_admin precedent); both tests ride their fns.
- preferences, key: fully pure (validated newtypes, composite-id
  helpers) — stay domain-only, no db/service modules created.

Entity fields the split constructs from are now pub(crate) (Builder,
BuilderSession, ProfileStats), matching the user split.

Callers re-pointed crate-wide: web/{users,exams/mod,questions,homework,
sessions,auth,extractor,builder,tenant_state}, service/exam_attempt.rs
(badge::sync after start), database.rs (control seed), tests/
{builder_api,e2e,integration}; cross-lane compile fixups in
domain/pomodoro.rs and domain/session_attendance.rs (their lanes
re-point on merge). constant.rs doc link -> crate::db::badge::list_for.
Merge branch 'layer-split/user'Ahmet Kaan Gümüş · f30faee
Merge branch 'layer-split/user'

# Conflicts:
#	src/domain/appointment_slot.rs
#	src/domain/exam_question.rs
#	src/domain/user.rs
#	src/service/course.rs
#	src/web/courses.rs
#	src/web/sessions.rs
Merge branch 'layer-split/exam'Ahmet Kaan Gümüş · e0fb40e
Merge branch 'layer-split/exam'

# Conflicts:
#	src/db/mod.rs
#	src/domain/course_session.rs
#	src/domain/exam.rs
#	src/domain/exam_question.rs
#	src/service/mod.rs
#	tests/regress_course_child_orphans.rs
Merge branch 'layer-split/enrollment'Ahmet Kaan Gümüş · c4e9b2c
Merge branch 'layer-split/enrollment'

# Conflicts:
#	src/db/mod.rs
#	src/domain/event.rs
#	src/service/mod.rs
Merge branch 'layer-split/meal_booking'Ahmet Kaan Gümüş · 78600f5
Merge branch 'layer-split/meal_booking'

# Conflicts:
#	src/service/mod.rs
Merge branch 'layer-split/class_blueprint'Ahmet Kaan Gümüş · 38a619c
Merge branch 'layer-split/class_blueprint'

# Conflicts:
#	src/service/mod.rs
🧹 chore: split course_session into domain/db/service layersAhmet Kaan Gümüş · 0ddaa5d
🧹 chore: split course_session into domain/db/service layers

domain/course_session.rs keeps the pure surface: CourseSessionId (its ULID
mint stays per the monotonic_id precedent), SessionTopic, the entity with
pub(crate) fields, getters, and the topic-bound validation test.

db/course_session.rs takes the query executors whole: create (the
cap::touch_and_create claim that bumps the course row in the same
transaction), read, list_for_course, the field-scoped update, and the
cascading delete transaction; the orphan-race persistence test rides along.

service/course_session.rs takes resolve_session_teacher out of the web
layer — the scheduling role floor (a student cannot teach a lesson) —
plus the thin doors the web layer now calls instead of the removed
inherent methods. No locks: course_session never held one; the range
guard rides inside the UPDATE's WHERE.

web/sessions.rs and web/courses.rs re-point every CourseSession call and
the shared resolve_session_teacher import to service::course_session;
call sites in domain/session_attendance.rs (incl. tests) and doc links in
domain/event.rs go to db::course_session. tests/ import fixes only.
Merge branch 'layer-split/exam_attempt'Ahmet Kaan Gümüş · 7267caa
Merge branch 'layer-split/exam_attempt'

# Conflicts:
#	src/db/mod.rs
#	src/domain/exam_attempt.rs
#	src/service/mod.rs
#	src/web/courses.rs
#	src/web/exam_ws.rs
#	src/web/exams/attempts.rs
#	src/web/exams/mod.rs
#	tests/regress_course_delete.rs
Merge branch 'layer-split/course'Ahmet Kaan Gümüş · ecd88d4
Merge branch 'layer-split/course'

# Conflicts:
#	src/service/mod.rs
🧹 chore: split exam_attempt into domain/db/service layersAhmet Kaan Gümüş · c13b51d
🧹 chore: split exam_attempt into domain/db/service layers

src/domain/exam_attempt.rs keeps the pure core (ExamAttemptId, AttemptStatus,
the entity + getters, deadline/status arithmetic); fields went pub(crate) so
the layers can mint and target rows.

src/db/exam_attempt.rs takes every query: finish/set_left (the two
field-scoped writes), the reads (read, read_latest_for_user, list_*,
any_for_exam), and the write_unfrozen[_with] freeze-gate transaction gateway
with FROZEN_SLOT and the THROW markers.

src/service/exam_attempt.rs owns the workflows and the cross-call state:
EXAM_LOCK moves here from web/exams/mod.rs (it spans multi-call workflows —
start's writer lease, saves' reader leases), the sitting gates
(ensure_sittable/ensure_student/ensure_student_now/ensure_enrolled/
check_rejoin/writable_attempt) move out of the handlers, as do course_of
(web may not be imported from service) and question_of_exam (the answer
funnel's lookup). start keeps its name from the domain; start_attempt /
finish_attempt / save_answer_checked are the handler workflows extracted
whole, windows and term gates and all, in the original gate order.

web/exams/attempts.rs keeps authz extractors, DTOs, and response assembly
only; exam_ws.rs, exams/{mod,questions,images,review}.rs and courses.rs
re-point to the service paths; domain/exam_question.rs and
question_image.rs call the db-layer write_unfrozen* directly. Doc links to
moved items re-pointed. Tests ride with their layer: persistence
(field-scoped write) tests in db, workflow (start/retake/race) tests in
service; assertions unchanged, only paths and call shapes.
🧹 chore: split note/session/settings into domain/db/service layersAhmet Kaan Gümüş · efea304
🧹 chore: split note/session/settings into domain/db/service layers

Pilot wave of the three-layer split. All query execution for the three
domains now lives in src/db/{note,session,settings}.rs as free fns taking
db first; web handlers call service::<x>::* only; domain keeps pure types.

- service/settings.rs gains the PATCH workflow (apply) and SETTINGS_LOCK —
  it spans a multi-call pair (retire names, CAS save, restore), so it is a
  service lock, not a db lock. The service takes its own input records
  (SettingsPatch/*Input) so wire DTOs stay in web and list validation keeps
  its original order, including the try_kept grandfathering that needs the
  stored list.
- Note/Session/Settings fields the db layer mints or CAS-binds become
  pub(crate); Settings::record_id becomes pub(crate).
- Unit tests rode with their fns: note delete cascade → db/note, session
  purge → db/session, settings load/save/CAS → db/settings, the whole
  settings edit workflow suite → service/settings.
- Doc links re-pointed (user, class_blueprint, bank_question, exam,
  note_file, tests/regress_roles); NoteId::generate's stale
  'Note::list_for_user' link now names db::note::list_for.
- Known residual for a later wave: web/notes.rs:411 file.delete() is
  note_file-domain persistence (note_file splits in C3).
🧹 chore: drop stale multi-replica prose; single process is the contractAhmet Kaan Gümüş · 8b8a45d
🧹 chore: drop stale multi-replica prose; single process is the contract

2026-09-08

🧪 fix: request-id bound reaches /limits; registry-read probe no longer depends on span threadAhmet Kaan Gümüş · 282db82
🧪 fix: request-id bound reaches /limits; registry-read probe no longer depends on span thread

MAX_REQUEST_ID_LEN sat in src/lib.rs, so the one bound a client can
actually hit on a header it sends reached neither GET /limits nor the
OpenAPI spec. Moved to src/constant.rs, published as
`request.max_request_id_len`, and added to README's /limits sample.

probe_registry_reads_per_request counted SurrealDB spans through a
thread-local subscriber (`set_default`). tracing caches a callsite's
interest process-wide the first time any thread reaches it: under
parallel tests that thread is a sibling with no subscriber, so the SDK's
callsites were disabled for the whole process before the probe asked and
it panicked UNMEASURED (0 in 7 of 8 runs against noisy siblings). It now
installs a counting Subscriber globally, with `Interest::sometimes` and
an `enabled` that admits only surrealdb callsites on its own thread, so
it stores nothing and no sibling test lands in the figure.
🧪 test: prove write-skew across rows is reachable in the storeAhmet Kaan Gümüş · dab0855
🧪 test: prove write-skew across rows is reachable in the store

Two (and eight) concurrent check-then-write transactions over the
appointment table each find the teacher's window free and all commit:
SurrealDB's BEGIN…COMMIT does not conflict-check a cross-row read
against a concurrent write, so APPOINTMENT_LOCK is the only thing
preventing a double-booked teacher today. Serialized, the same two
transactions leave one approval — the control that keeps the assertion
from passing vacuously.

The Postgres port (2026-09-08) closes the class in the database with
SERIALIZABLE plus an exclusion constraint over (teacher, window).

2026-09-07

✨ feat: OpenObserve replaces Temps as the telemetry sinkAhmet Kaan Gümüş · 5a1ac42
✨ feat: OpenObserve replaces Temps as the telemetry sink

Temps needed a container socket to even start its console, plus a
TimescaleDB and a ClickHouse of its own — three services, a locally
built image and a socket mount for one dev sink. OpenObserve is one
Rust binary with its own storage: no socket, no sidecars, retention
per stream in days.

compose.yaml drops temps/temps-postgres/temps-clickhouse and their
volumes for a single `openobserve` service on
docker.io/openobserve/openobserve:v1.0.0-rc2, UI + API + OTLP/HTTP on
127.0.0.1:5080 and OTLP/gRPC on 127.0.0.1:5081, ZO_DATA_DIR=/data on
the openobserve-data volume, ZO_COMPACT_DATA_RETENTION_DAYS=90, root
user admin@hezarfen.local (local-dev password, and OpenObserve panics
at boot on anything weaker than upper+lower+digit+special). The
backend's commented OTEL_* block now carries the gRPC form ready to
uncomment and the OTLP/HTTP variant beside it.

Proved end to end against the real backend over OTLP/gRPC: 18 spans
(GET /health ×11, GET /modules/catalog ×5, POST /builder/login,
GET unmatched), the http_server_request_duration metric family and 11
log records, all timestamped 2026-09-07 rather than 1970. Privacy
check over every span and log attribute key found none of the banned
set (url.path, client.address, user_agent.original, user.*, cookie,
email, http.*.header.*); no username and no IP but 127.0.0.1 in any
body.

Claude-Session: https://claude.ai/code/session_018sqvyBCZ9kpQP6vnGomT2s
📝 docs: telemetry header names the resource-id allowance; global() doc lists its real callersAhmet Kaan Gümüş · 66c56ad
📝 docs: telemetry header names the resource-id allowance; global() doc lists its real callers

Claude-Session: https://claude.ai/code/session_018sqvyBCZ9kpQP6vnGomT2s
🔒 fix: telemetry privacy sweep, in-flight gauge guards, request-id validation, tenant gauge on createAhmet Kaan Gümüş · ae0957a
🔒 fix: telemetry privacy sweep, in-flight gauge guards, request-id validation, tenant gauge on create

- No account name reaches an exported log record: the admin seed
  (domain/user.rs), the ADMIN_USERNAME refusal and the builder seed
  (domain/builder.rs) log the event without the `username` field.
- The forbidden-key list moves to tests/common (`FORBIDDEN_TELEMETRY_KEYS`,
  `is_forbidden_key`), gains `username`/`email` and the header prefixes, and
  is used by both the HTTP-edge and the AI-bridge guard tests. The telemetry
  suite now also exports tracing EVENTS through an in-memory log exporter and
  holds log records to the same rule.
- `http.server.active_requests` and `ai_requests_inflight` are closed by a
  `Drop` guard, so a dropped request future (client hang-up, outer timeout)
  no longer leaks the gauge upwards. A cancelled request is recorded as 499.
- A caller-supplied `x-request-id` is only kept when it is at most 64 chars of
  `[A-Za-z0-9._-]`; anything else is dropped and a UUID is minted, so a client
  cannot write free text onto `http.request.id` of every span.
- `tenant_cache_size` is reported by `Tenants::create` and by the bootstrap
  insert, not only by the lazy-dial path.
- The keepalive logs its first `up` verdict, which its comment already claimed.

Claude-Session: https://claude.ai/code/session_018sqvyBCZ9kpQP6vnGomT2s