Commits
2026-09-07
✨ feat: AI bridge telemetry — request spans, worker gauges, handshake failure countersAhmet Kaan Gümüş · 405cf96
✨ feat: AI bridge telemetry — request spans, worker gauges, handshake failure counters The QUIC bridge was the one request path with no observability: an AI-originated api read takes the router before every layer, so it produced no span, no metrics and no request id, and a dispatch out to a worker produced only interpolated log lines. Outbound dispatch now opens an `ai.request` span (capability, worker id, school slug, request id) and records inflight, duration by capability, and the timeout counter; failures mark the span ERROR. The handshake counts every rejection under a fixed `reason` vocabulary — transport, timeout, no_control_stream, malformed_hello, bad_version, bad_token, bad_capabilities, welcome_failed — and the worker gauge is set from the registry on register and on disconnect. The inbound api read is wrapped in an `http.request` span and the same request metrics the HTTP edge records, keyed on the route *template* the allowlist matched (`ai::api::route_template`), never the concrete path. The peer address is gone from the bridge's log lines: those become OTLP logs, and telemetry names no client address. Nothing here carries a payload, a message, file bytes or a user id. Claude-Session: https://claude.ai/code/session_018sqvyBCZ9kpQP6vnGomT2s
2026-09-05
✨ feat: course-notes readable by AI services over api-readAhmet Kaan Gümüş · 001c898
✨ feat: course-notes readable by AI services over api-read
The RAG service answers about lessons, so it needs the teacher's own
course material — until now the api-read allowlist stopped at personal
notes, leaving /course-notes unreachable to every service.
Adds /course-notes, /course-notes/{id} and /course-notes/{id}/files to
AI_API_ALLOWLIST (the read scope in README and the `ai` tag follow).
The blob route /course-notes/{id}/files/{file_id} stays out: frames
carry JSON under an 8 MiB cap. Reads are still GET-only and run with
the on_behalf_of student's own reach — a course they are not enrolled
in answers 403 from the handler, not from the bridge.
Ref #272026-08-12
🤖 feat: allowlist the GET paths ai services may readAhmet Kaan Gümüş · 317ef9c
🤖 feat: allowlist the GET paths ai services may read Deny-by-default: the bridge will only ever dispatch a service's read into the router when the path matches AI_API_ALLOWLIST segment for segment. No prefix match, no wildcard tail, so a new route family is unreachable to the services until it is listed on purpose. v1 is JSON-only and scoped to what a study companion needs: identity and profile, notes, homework reads, and the marks/attendance/pomodoro reports. Byte-serving routes (note files, submission files, avatars, question images) are left out — the frames carry JSON. The entries are router paths kept by hand, so integration.rs pins each one to a GET in the emitted OpenAPI document: a route rename now breaks the test instead of silently shrinking the services' scope.