feat: add manual feedback AI summaries and secure leaderboard scoring
Co-authored-by: Stephan Charles <[email protected]> Co-authored-by: Amelia Hernandez <[email protected]> Co-authored-by: Markus Franz <[email protected]> Co-authored-by: Sabrina Hota <[email protected]> Co-authored-by: Nilüfer Doğan <[email protected]>
This commit is contained in:
1 parent
407b878e23
commit
821907b164
37 files changed
+1640
-77
No files matched your search
@@ -27,6 +27,7 @@ system works*; the root [`README.md`](../README.md) is the quick-start.
|
||||
| Attendee app: every screen (Login, Home, Agenda, Scan, …) | [frontend/screens.md](./frontend/screens.md) |
|
||||
| API client (how the app talks to Supabase) | [frontend/api-client.md](./frontend/api-client.md) |
|
||||
| **Admin console** (views, auth guard, QR reset, points, schedule) | [frontend/admin-app.md](./frontend/admin-app.md) |
|
||||
| Manual event/session feedback summaries and LLM configuration | [backend/feedback-ai.md](./backend/feedback-ai.md) |
|
||||
| **Deployment — VM access (remote host for `appe.at`)** | [deployment.md](./deployment.md) |
|
||||
| **2026-10-10 changes, deployment and verification** | [releases/2026-10-10.md](./releases/2026-10-10.md) |
|
||||
| **What's next (Redesign Phases 3–6 + later + open items)** | [next-steps.md](./next-steps.md) |
|
||||
|
||||
@@ -91,16 +91,17 @@ A single-page React app with a tab shell and a few full-screen takeovers. See
|
||||
- **API client** — a thin typed wrapper over `supabase.rpc` / `supabase.from`. → [frontend/api-client.md](./frontend/api-client.md)
|
||||
|
||||
### Frontend — the admin console (APPE Admin)
|
||||
A separate desktop-first React app for organizers, guarded to the **`is_admin`**
|
||||
flag. See [frontend/admin-app.md](./frontend/admin-app.md):
|
||||
A separate desktop-first React app for organizers, guarded to existing contacts
|
||||
with **`is_admin`** or an **`@appe.at`** email. See [frontend/admin-app.md](./frontend/admin-app.md):
|
||||
- **Views** — Dashboard (active event + aggregates), Contacts, Registrations,
|
||||
Sponsors, Schedule (slots/sessions/speakers/material/AI-evaluate), Activity,
|
||||
and Events.
|
||||
- **Auth guard** — same QR + email login, but non-admin sessions are rejected.
|
||||
Sponsors, Schedule (slots/sessions/speakers/material), Activity (manual event
|
||||
and session AI summaries), Events, Interfaces, Reports and Settings.
|
||||
- **Auth guard** — email-only magic links; non-admin sessions are rejected.
|
||||
- **Key RPCs** — `reset_registration_qr_token` (regenerate a registration's
|
||||
lanyard token + sync the Auth password), `adjust_points`, `upsert_contact`,
|
||||
`create_registration`, `set_registration_type`, `evaluate_session_feedback`
|
||||
(AI stub), and `set_session_material` (see [backend/rpcs.md](./backend/rpcs.md)).
|
||||
`create_registration`, `set_registration_type`, and `set_session_material`
|
||||
(see [backend/rpcs.md](./backend/rpcs.md)). The deprecated AI stub is no longer
|
||||
client-callable; generation uses authenticated [sidecar routes](./backend/feedback-ai.md).
|
||||
|
||||
## 5. How a request flows (example: staff check-in)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Backend — Supabase Core
|
||||
|
||||
Convivo has **no custom backend**. The entire server side is a **local Supabase
|
||||
stack** (run with the Supabase CLI) plus the schema, RPCs, and RLS that live in
|
||||
Postgres. This folder documents that core.
|
||||
Convivo uses a **local Supabase stack** (run with the Supabase CLI) for its schema,
|
||||
RPCs and RLS, plus a Node sidecar for imports, reports and manual feedback AI
|
||||
summaries. This folder documents both the database core and those integrations.
|
||||
|
||||
| File | What it covers |
|
||||
|---|---|
|
||||
@@ -13,6 +13,7 @@ Postgres. This folder documents that core.
|
||||
| [seed.md](./seed.md) | Seed data + the demo accounts |
|
||||
| [docker.md](./docker.md) | Docker: the app image + root compose (how the core + app run together) |
|
||||
| [sidecar.md](./sidecar.md) | The Sessionize sync sidecar (on-demand, service-role) |
|
||||
| [feedback-ai.md](./feedback-ai.md) | Admin-configured LLM endpoint and manual event/session feedback summaries |
|
||||
| [tests.md](./tests.md) | The RPC test suite (`npm run test:rpc`) |
|
||||
|
||||
## The big picture
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
# Feedback AI Summaries
|
||||
|
||||
Attendees submit ratings and comments through the existing event and session
|
||||
feedback forms. Admin generates summaries manually in **Activity > Event feedback**
|
||||
or **Activity > Session feedback**. Each session has an independent button.
|
||||
There is no background generation and no provider call on feedback submission.
|
||||
|
||||
## Configuration
|
||||
|
||||
**Settings > Feedback AI** stores one global configuration for all events:
|
||||
|
||||
- **LLM endpoint:** the complete HTTPS URL of an OpenAI-compatible Chat
|
||||
Completions API, for example `https://api.openai.com/v1/chat/completions`.
|
||||
The server does not append a path. URLs with embedded credentials, query
|
||||
parameters or fragments are rejected.
|
||||
- **Model:** the provider's model identifier, maximum 200 characters.
|
||||
- **API key:** optional; sent as `Authorization: Bearer <key>`. Leaving this
|
||||
field blank preserves an existing key. The checkbox explicitly removes it.
|
||||
Changing the endpoint requires entering or clearing the key to prevent
|
||||
forwarding a previously stored credential to a different endpoint.
|
||||
|
||||
The endpoint must resolve to public IP addresses. HTTP, localhost, private
|
||||
networks, link-local metadata endpoints and reserved IP ranges are not supported.
|
||||
DNS lookups have a 10-second timeout. Results are validated and the HTTPS
|
||||
connection is pinned to a validated
|
||||
address, preserving TLS hostname verification. Redirects are not followed.
|
||||
Private Ollama installations need a public, authenticated HTTPS gateway exposing
|
||||
the compatible API. Azure-style `api-key` headers and native Responses/Ollama APIs
|
||||
are not implemented by this adapter.
|
||||
|
||||
Stored keys are server-only: `llm_settings` has RLS enabled and no grants for
|
||||
anonymous or authenticated clients. Authenticated admins use the sidecar routes,
|
||||
which return only endpoint, model, update time and `has_api_key`. The key is stored
|
||||
in the protected database table, not encrypted by this feature; privileged
|
||||
database operators and database backups can access it.
|
||||
|
||||
## API and Generation
|
||||
|
||||
All routes below require the Admin user's bearer token, verified with Supabase
|
||||
Auth `/auth/v1/user`, followed by the existing contact admin rule (`is_admin` or
|
||||
an existing `@appe.at` contact). They return `Cache-Control: no-store`.
|
||||
|
||||
| Route | Purpose |
|
||||
| --- | --- |
|
||||
| `GET /sidecar/llm-settings` | Read redacted configuration. |
|
||||
| `PUT /sidecar/llm-settings` | Save `{ endpoint, model, api_key? }`. |
|
||||
| `POST /sidecar/feedback-summary` | Generate `{ scope: "event", event_id }` or `{ scope: "session", event_id, session_id }`. |
|
||||
|
||||
The sidecar checks that the event exists and that a selected session belongs to
|
||||
it. It reads all feedback in ordered 500-row pages, selecting only `rating` and
|
||||
`comment`. The LLM receives the scope, event/session title, response count, ratings
|
||||
and comments; contact names, associated email columns, IDs and timestamps are
|
||||
excluded. Free-text comments can still contain personal information supplied by
|
||||
attendees: use an approved provider and appropriate privacy/retention terms.
|
||||
|
||||
Requests contain `model`, `stream: false` and system/user `messages`. The response
|
||||
must contain a nonempty string at `choices[0].message.content`. The prompt asks
|
||||
for sentiment, strengths, concerns and actionable improvements in the predominant
|
||||
comment language (English for rating-only feedback), without inventing evidence.
|
||||
Feedback content is explicitly treated as untrusted input. Output is displayed as
|
||||
plain text, never HTML; AI output still requires human review.
|
||||
|
||||
No-feedback requests fail before calling the provider. Generation also requires
|
||||
saved configuration. Input is capped at approximately 190 KB of feedback (the
|
||||
adapter additionally caps its complete input at 200 KB). Provider calls time out
|
||||
after 60 seconds; output is capped at 100 KB and summaries at 20,000 characters.
|
||||
Provider failures return sanitized errors, without raw provider bodies or keys.
|
||||
Concurrent generation of the same target is rejected in the single sidecar
|
||||
process; this is not a distributed lock across replicas.
|
||||
|
||||
## Persistence and Permissions
|
||||
|
||||
Migration [20261011163332_feedback_ai_summaries.sql](../../supabase/migrations/20261011163332_feedback_ai_summaries.sql)
|
||||
adds `llm_settings` and `feedback_summaries`. Only the service role writes them.
|
||||
Summary reads are restricted to admins by RLS; attendees cannot read these
|
||||
organizer summaries. A successful generation upserts the latest result for its
|
||||
scope and target, storing response count, model, generation timestamp and a
|
||||
SHA-256 fingerprint of the exact rating/comment snapshot. It does not overwrite
|
||||
ratings or comments. Deleting its event or session cascades the summary.
|
||||
|
||||
The UI restores saved summaries and offers manual regeneration. A provider
|
||||
failure leaves the previous summary untouched. A response-count change is shown;
|
||||
same-count comment edits are not currently flagged by the UI even though the
|
||||
saved fingerprint records the generation snapshot. There is no summary history.
|
||||
Activity reads event-scoped feedback in ordered pages, so counts and available
|
||||
session controls are not truncated by the database API's row limit. Mobile tabs
|
||||
wrap into two columns and feedback tables scroll within their own containers.
|
||||
|
||||
The old `evaluate_session_feedback` RPC is a deprecated stub with client execution
|
||||
revoked. Its Schedule button and legacy AI state display were removed. The
|
||||
legacy `sessions.ai_generated_feedback` field is not used to store these summaries.
|
||||
Attendee feedback submission, points and average-rating behavior are unchanged.
|
||||
|
||||
## Local Validation
|
||||
|
||||
The migration was applied alone to the local database and recorded in its ledger;
|
||||
older pending migrations were not applied. No seed or reset was run. Production
|
||||
deployment is not included in this change.
|
||||
|
||||
For an alternate local instance, leaving the existing servers intact:
|
||||
|
||||
```sh
|
||||
PORT=3003 SUPABASE_URL=http://127.0.0.1:54321 SESSIONIZE_SYNC_INTERVAL_MS=0 PRETIX_SYNC_INTERVAL_MS=2147483647 node apps/sidecar/src/server.js
|
||||
SIDECAR_TARGET=http://127.0.0.1:3003 npm run dev --prefix apps/admin -- --host 127.0.0.1 --port 3004 --strictPort
|
||||
```
|
||||
|
||||
This preview sidecar has no immediate Sessionize poll, and its Pretix loop has a
|
||||
long interval. These values are for isolated local validation only, not deployment.
|
||||
The usual Admin proxy target remains port 3002 when `SIDECAR_TARGET` is unset.
|
||||
See [tests](./tests.md#feedback-ai-summary-regression) for automated checks.
|
||||
|
||||
For this validation, the existing Admin on `http://127.0.0.1:3001` is connected to
|
||||
the updated sidecar on port 3003 through the ignored local file
|
||||
`apps/admin/.env.development.local` (`SIDECAR_TARGET=http://127.0.0.1:3003`).
|
||||
This preserves the existing allowlisted magic-link callback. The isolated 3004
|
||||
preview was used for mocked browser testing and then stopped; real magic-link
|
||||
login on another port requires allowlisting its exact callback first. Auth
|
||||
configuration and existing server processes were not changed or stopped.
|
||||
|
||||
Validation passed: 28 sidecar tests, eight rollback-only SQL assertions, the
|
||||
54-test combined browser regression suite, Admin build, test TypeScript and
|
||||
editor checks. Desktop/mobile screenshots were inspected, including explicit
|
||||
grid and bounding-box checks for the mobile feedback tabs and summary panel.
|
||||
A real local Auth smoke used a disposable confirmed account, verified redacted
|
||||
settings and no-feedback rejection through the proxy, then deleted its account,
|
||||
contact and inactive event. No mail or provider request was sent.
|
||||
+20
-10
@@ -33,22 +33,31 @@ Source of truth:
|
||||
| Feedback — rating + comment | **+10** | the attendee |
|
||||
| Admin adjustment | any | the target (audited as `admin`) |
|
||||
|
||||
Only eligible registered participants earn points. Staff registrations and Admin
|
||||
contacts (`is_admin` or `@appe.at`) always have zero points and never rank,
|
||||
including when checked in, leaving feedback, accepting connections or receiving
|
||||
manual adjustments. Existing audit history is retained when a role changes.
|
||||
|
||||
## Internal helpers
|
||||
|
||||
### `_award_points(p_event_id, p_contact_email, p_delta, p_category)`
|
||||
The single place points change. In one transaction it:
|
||||
The shared award path first locks the registration and checks eligibility. Missing
|
||||
registrations, staff and Admin contacts receive no award or new audit entry.
|
||||
Clients cannot call this helper directly. In one transaction it:
|
||||
1. `update registrations set points = greatest(0, points + p_delta)` (floored at
|
||||
0) for the (event, contact),
|
||||
2. `insert into points_log (event_id, contact_email, delta, category)`,
|
||||
3. calls `_sync_leaderboard(p_event_id, p_contact_email)`.
|
||||
3. synchronizes the leaderboard through the registration write trigger.
|
||||
|
||||
### `_sync_leaderboard(p_event_id, p_contact_email)`
|
||||
Upserts the `leaderboard` row for that (event, contact) from `registrations` +
|
||||
`contacts` (`on conflict (event_id, contact_email) do update ...`). This is what
|
||||
makes the leaderboard a consistent, Realtime-friendly mirror. **Staff are
|
||||
excluded:** if the contact's registration `type` is `staff` (or there is no
|
||||
registration), the function **deletes** any existing leaderboard row instead of
|
||||
inserting — so staff never appear on the board even if they hold points.
|
||||
makes the leaderboard a consistent, Realtime-friendly mirror. **Staff, Admins and
|
||||
missing registrations are excluded:** the function deletes existing excluded
|
||||
rows. Registration writes force excluded balances to zero; role/point changes,
|
||||
registration deletion, contact Admin promotion and name changes refresh rankings.
|
||||
The zero-points guard runs after the existing role-normalization triggers.
|
||||
`leaderboard` belongs to the `supabase_realtime` publication for live updates.
|
||||
|
||||
### `_recalc_event_aggregates(p_event_id)`
|
||||
Recomputes the `events` aggregate columns (`num_sessions`, `num_speakers`,
|
||||
@@ -59,7 +68,7 @@ triggers and the feedback RPC.
|
||||
|
||||
| Function | Returns | Used for |
|
||||
|---|---|---|
|
||||
| `get_leaderboard()` | `event_id, contact_email, full_name, points` (active event, **staff excluded**, ordered by points) | Leaderboard initial load + realtime re-fetch |
|
||||
| `get_leaderboard()` | `event_id, contact_email, full_name, points` (active event, **staff/Admins excluded**, ordered by points descending, name and email ascending) | Leaderboard initial load + realtime re-fetch |
|
||||
| `lanyard_lookup(p_qr_token)` | `email, full_name, linkedin_url` (null unless `show_linkedin`), `show_email`, `registration_type` | Resolve a scanned QR (pre-login + connect) |
|
||||
| `get_public_contacts()` | `email, full_name, linkedin_url`, `show_email`, `registration_type` (active-event registrants) | Connections name/type lookups |
|
||||
| `get_agenda()` | flat rows: slot fields + session fields + `speakers` (string_agg) | Agenda + Home |
|
||||
@@ -238,9 +247,10 @@ immediately.
|
||||
`p_type` is `text` and is cast to the `registration_type` enum on write.
|
||||
|
||||
### `evaluate_session_feedback(p_session_id)` → `sessions`
|
||||
**Admin-only.** The **AI-feedback stub**: sets `ai_generated_feedback` to a
|
||||
placeholder string ("AI evaluation stub: N comment(s) received. (LLM integration
|
||||
pending.)"). Real LLM integration is a later phase.
|
||||
**Deprecated stub.** Migration `20261011163332_feedback_ai_summaries` revokes
|
||||
client execution. Admin now uses the authenticated sidecar for real manual event
|
||||
and session summaries, stored separately from `sessions.ai_generated_feedback`.
|
||||
See [Feedback AI summaries](./feedback-ai.md).
|
||||
|
||||
### `set_session_material(p_session_id, p_material_path)` → `sessions`
|
||||
Sets only a session's `material_path`, with a row lock. Requires authentication
|
||||
|
||||
@@ -20,6 +20,10 @@ then every 15 minutes. Pretix retains its independent every-minute loop.
|
||||
|
||||
## What it does
|
||||
|
||||
The sidecar also provides authenticated, admin-only LLM configuration and manual
|
||||
feedback summary routes. See [Feedback AI summaries](./feedback-ai.md) for the
|
||||
provider contract, permissions, limits and privacy requirements.
|
||||
|
||||
There are **two import paths**; the source/API path also runs automatically:
|
||||
|
||||
**A. API sync** (`POST /run`) — fetches the event's `sessionize_endpoint` and
|
||||
|
||||
@@ -1,3 +1,45 @@
|
||||
# Leaderboard Regression
|
||||
|
||||
After applying `20261015164546_leaderboard_staff_admin_exclusion`, run:
|
||||
|
||||
```sh
|
||||
docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres \
|
||||
-v ON_ERROR_STOP=1 < supabase/tests/leaderboard_tests.sql
|
||||
CONVIVO_BASE_URL=http://127.0.0.1:3000 npm test --prefix e2e -- leaderboard-live.spec.ts --project=chromium
|
||||
```
|
||||
|
||||
The SQL fixture rolls back and checks scoring, idempotency, event isolation,
|
||||
staff/Admin zero balances, role changes, deterministic ranking, API-role grants
|
||||
and Realtime publication membership. The browser test is local-only and uses real
|
||||
Auth, PostgREST and WebSockets, not mocked APIs. It creates disposable accounts,
|
||||
verifies live score/rank changes and staff/Admin exclusions, then deletes its
|
||||
fixtures. It requires the local attendee app, Supabase and an active event.
|
||||
|
||||
See [October 15 validation](../releases/2026-10-15.md) for results and scope.
|
||||
|
||||
# Feedback AI Summary Regression
|
||||
|
||||
After applying only `20261011163332_feedback_ai_summaries`, run:
|
||||
|
||||
```sh
|
||||
npm test --prefix apps/sidecar
|
||||
docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres \
|
||||
-v ON_ERROR_STOP=1 < supabase/tests/feedback_ai_summary_tests.sql
|
||||
CONVIVO_ADMIN_URL=http://127.0.0.1:3001 npm test --prefix e2e -- feedback-ai-summary.spec.ts --project=chromium
|
||||
```
|
||||
|
||||
The SQL fixture is rollback-only: eight assertions cover RLS, grants, deprecated
|
||||
stub permissions, service-role persistence, admin/non-admin reads and cascades.
|
||||
Unit tests cover provider payload privacy, settings-key redaction and retention,
|
||||
scope isolation, empty feedback, errors, duplicate requests and private-address
|
||||
rejection and multi-page snapshots. Eight API-mocked browser tests cover settings,
|
||||
manual event/session generation, restored summaries, disabled states, pagination,
|
||||
retry and desktop/mobile layouts.
|
||||
These tests do not send real feedback to any LLM or send login emails.
|
||||
|
||||
See [Feedback AI summaries](./feedback-ai.md) for the request/response contract and
|
||||
local-only activation status.
|
||||
|
||||
# Service Staff Regression
|
||||
|
||||
The attendee browser suite also covers demo clock dates for two different events
|
||||
|
||||
@@ -18,8 +18,9 @@ It runs on **port 3001** (Vite dev) or as the `convivo-admin` Docker container
|
||||
| **Contacts** | Table of all contacts (email, name, LinkedIn, visibility toggles, `is_admin`). Edit, toggle `is_admin`, set visibility, adjust points. (No QR token here — it lives on the registration.) |
|
||||
| **Registrations** | Per active event: list (contact, type, **QR token**, checked_in, points). Change type (enforces the sponsor rule — a failed sponsor change opens an **in-place sponsor lookup** popup), mark checked-in, **view the QR token** (final — no reset). |
|
||||
| **Sponsors** | List (paid only visible to attendees; admin sees all). Add/edit (type, name, email, phone, paid, amount, **contact search-and-pick**). |
|
||||
| **Schedule** | Slots (with a **type optionset** — `Session` / `Service Session`) + sessions (with speakers 1:N via a **multi-select search dropdown**, material upload with a **submitted / not submitted** state, `average_feedback`, `ai_generated_feedback` + an **Evaluate** stub button), plus an admin-only **Delete current schedule** action for the active event. |
|
||||
| **Activity** | Tables of check-ins, connections, and feedback (per active event). |
|
||||
| **Schedule** | Slots (with a **type optionset** — `Session` / `Service Session`) + sessions (with speakers 1:N via a **multi-select search dropdown**, material upload with a **submitted / not submitted** state and `average_feedback`), plus an admin-only **Delete current schedule** action for the active event. |
|
||||
| **Activity** | Tables of check-ins, connections, and feedback (per active event), with manual **Generate AI Summary** controls for the event and individual sessions. |
|
||||
| **Settings** | Global LLM endpoint, model and optional API key for feedback summaries. |
|
||||
| **Events** | Create event, toggle active/inactive (a switch; only one can be active at a time — activating one deactivates the rest), edit dates/location + the **Sessionize endpoint** + the **Real-time clock** toggle (on = the attendee app uses the real system clock for Live/Next/Done; off = the simulated mid-event clock, the default). Each row has a **Sync** button that runs a (blocking) Sessionize sync and shows a result modal. |
|
||||
| **Interfaces** | Manages the Sessionize sync **sidecar**: status (online / running / last run), a **Run sync** control (event picker + blocking run + result modal), an **Import Excel** control (upload the Sessionize "Sessions and speakers (advanced)" `.xlsx` + a "How to get this file" tooltip), and a **Recent runs** table from `sync_runs`. See [../backend/sidecar.md](../backend/sidecar.md). |
|
||||
|
||||
@@ -117,11 +118,12 @@ apps/admin/src/
|
||||
├─ Contacts.tsx # table + edit / is_admin / visibility / points
|
||||
├─ Registrations.tsx# per-event list + type / QR token (view) / checked-in + sponsor lookup
|
||||
├─ Sponsors.tsx # sponsor CRUD
|
||||
├─ Schedule.tsx # slots + sessions + speakers + material + AI-evaluate
|
||||
├─ Schedule.tsx # slots + sessions + speakers + material
|
||||
├─ Activity.tsx # check-ins / connections / feedback tables
|
||||
├─ Events.tsx # event management (+ sessionize_endpoint + per-row Sync + talk networking bonus)
|
||||
├─ Interfaces.tsx # sidecar status / run / recent runs
|
||||
└─ Reports.tsx # post-event summary + CSV / Excel / PDF export (sidecar /export)
|
||||
├─ Reports.tsx # post-event summary + CSV / Excel / PDF export (sidecar /export)
|
||||
└─ Settings.tsx # server-only LLM configuration (redacted key)
|
||||
```
|
||||
|
||||
## Data access
|
||||
@@ -137,8 +139,8 @@ key. Everything it can do is allowed by RLS:
|
||||
`registrations`, `sponsors`, `slots`, `sessions`, and `session_speakers`
|
||||
(admin-only policies).
|
||||
- **RPCs** — `adjust_points` (manual, audited as `admin`), `upsert_contact`,
|
||||
`create_registration`, `set_registration_type`, `evaluate_session_feedback`
|
||||
(AI stub), `set_session_material` (attach uploaded material), and
|
||||
`create_registration`, `set_registration_type`,
|
||||
`set_session_material` (attach uploaded material), and
|
||||
`delete_event_schedule` (clear the active event's slots/sessions). The
|
||||
`reset_registration_qr_token` RPC still exists but the admin UI no longer
|
||||
exposes a token reset. See
|
||||
@@ -172,9 +174,21 @@ event uses, but the `category` is `admin` so manual adjustments are auditable in
|
||||
### Session material
|
||||
|
||||
The Schedule view uploads a session's material to the `materials` bucket and sets
|
||||
`sessions.material_path` (admins can write `sessions` directly). The **Evaluate**
|
||||
button calls `evaluate_session_feedback` (the AI stub) to set
|
||||
`ai_generated_feedback`.
|
||||
`sessions.material_path` (admins can write `sessions` directly).
|
||||
|
||||
### Feedback AI Summaries
|
||||
|
||||
Configure the complete OpenAI-compatible HTTPS endpoint, model and optional key
|
||||
in **Settings > Feedback AI**. The key is never returned to the browser. In
|
||||
**Activity**, the event feedback tab has one **Generate AI Summary** button;
|
||||
the session feedback tab has one per session with responses. Generation is manual,
|
||||
disabled without feedback or configuration, and shows loading and recoverable
|
||||
error states. Saved plain-text summaries include their model, response count and
|
||||
generation time. Regeneration replaces a result only after success.
|
||||
|
||||
The obsolete Schedule evaluation stub has been removed and its RPC is no longer
|
||||
client-callable. See the [backend contract](../backend/feedback-ai.md) for provider
|
||||
compatibility, data privacy, permissions and deployment requirements.
|
||||
|
||||
### Registration Tickets
|
||||
|
||||
|
||||
@@ -161,4 +161,27 @@ the full local commit ID `c0fbf495dc15fd8e1886ae6e9e54a6099ea3dbbe`.
|
||||
The subsequent documentation follow-up includes the pending whitespace-only
|
||||
formatting of `supabase/seed.sql`. Comparison with the committed seed confirmed
|
||||
identical non-whitespace content; seeded data and SQL behavior are unchanged.
|
||||
No database reset, seed execution or additional production deployment is needed.
|
||||
No database reset, seed execution or additional production deployment is needed.
|
||||
|
||||
## Feedback AI (Local Follow-up)
|
||||
|
||||
The subsequent feedback feature is a separate local implementation, not included
|
||||
in the commits or production deployments recorded above. Admin now has global
|
||||
LLM settings and manual **Generate AI Summary** buttons for event feedback and
|
||||
each individual session with responses. Results are persisted separately and a
|
||||
failed regeneration preserves the previous result. The old Schedule evaluation
|
||||
stub is removed and its RPC is no longer client-callable.
|
||||
|
||||
Migration `20261011163332_feedback_ai_summaries` was applied by itself to the local
|
||||
database with its ledger entry. Older pending migrations were left alone. No
|
||||
reset, seed or production changes were performed. The LLM remains unconfigured;
|
||||
no real feedback was sent to a provider. See the
|
||||
[configuration, permissions and privacy contract](../backend/feedback-ai.md).
|
||||
|
||||
Validation: 28 sidecar tests, eight rollback-only SQL assertions, 54 combined
|
||||
API-mocked browser regressions, Admin build, test TypeScript and editor checks.
|
||||
Desktop/mobile screenshots were inspected. A disposable local Auth smoke verified
|
||||
authenticated settings/key redaction and no-feedback rejection, then removed all
|
||||
fixtures without sending email. The usual local Admin on port 3001 uses the
|
||||
updated isolated sidecar on port 3003 via a Git-ignored development proxy override;
|
||||
the existing port-3002 sidecar and Auth services were not restarted.
|
||||
@@ -0,0 +1,51 @@
|
||||
# Leaderboard Validation
|
||||
|
||||
## Findings and Fixes
|
||||
|
||||
The old implementation hid staff from rankings but still awarded them points.
|
||||
A rollback regression reproduced a staff check-in award of ten points. The
|
||||
internal security-definer award helper was also executable by API roles, and the
|
||||
local leaderboard was absent from the Realtime publication.
|
||||
|
||||
Migration `20261015164546_leaderboard_staff_admin_exclusion` enforces zero points
|
||||
for staff and Admin contacts (`is_admin` or `@appe.at`) at award and registration
|
||||
write boundaries. Excluded awards create no points-log entries. Session feedback
|
||||
reports zero earned for excluded users; their attendance/feedback still works.
|
||||
Role changes clear excluded balances and remove leaderboard entries immediately.
|
||||
Historical audit entries are preserved. Ordinary participants, including
|
||||
non-Admin speakers, remain eligible.
|
||||
|
||||
Rankings mirror registration totals, refresh on name changes and registration
|
||||
deletion, exclude missing registrations and use deterministic tie ordering.
|
||||
The migration adds leaderboard Realtime publication membership and revokes
|
||||
direct client execution of internal scoring/synchronization helpers.
|
||||
|
||||
## Verification
|
||||
|
||||
- 46 rollback SQL assertions passed against the installed local migration.
|
||||
- A real local browser test passed using disposable Auth/registration fixtures:
|
||||
the leaderboard received a WebSocket change, updated the winning score and
|
||||
moved the signed-in participant from rank #1 to #2 without reload. Staff/Admin
|
||||
adjustments left balances at zero, with no ranking rows or new award logs.
|
||||
Fixture contacts and Auth users were deleted afterward.
|
||||
- Neighboring service-staff, GridSmart, speaker-portal, ticket-merge and
|
||||
Sessionize date-guard SQL suites passed. The last two required their pending
|
||||
prerequisite migrations within rollback transactions; no broad migration or
|
||||
database reset was run. Their former staff-balance assertions now expect zero.
|
||||
- Attendee production build and browser-test TypeScript validation passed.
|
||||
- The final combined browser run passed all 40 tests: the real leaderboard test
|
||||
plus 39 existing attendee entry, service agenda, clock and profile regressions.
|
||||
- Supabase security advisors reported only existing mutable-search-path warnings
|
||||
for `current_email` and `_map_ticket_type`, not the new functions.
|
||||
|
||||
## Activation Scope
|
||||
|
||||
Only this migration was applied and recorded locally. No production deployment,
|
||||
commit or push was performed for this task. Production cannot be confirmed to
|
||||
enforce these new rules until the migration is deployed there. Existing excluded
|
||||
balances are cleared when applied; historical audit rows remain unchanged.
|
||||
|
||||
Local attendee app: `http://127.0.0.1:3000`.
|
||||
|
||||
See [RPC rules](../backend/rpcs.md#points-rules) and
|
||||
[test commands](../backend/tests.md#leaderboard-regression).
|
||||
Reference in new issue
Block a user