Module: Tina4::Feedback

Defined in:
lib/tina4/feedback.rb

Overview

── Customer feedback widget — server-side plumbing ─────────────────

Mirrors tina4_python/dev_admin/init.py lines 1436-1645. The widget is for END USERS of a shipped Tina4 app (not developers). Whitelisted users get a floating bubble that proxies one conversational turn at a time to the Rust agent's intake endpoint at /feedback/intake.

Flow:

1. Framework middleware injects <script src="/__feedback/widget.js">
 into HTML responses for whitelisted users.
2. Widget POSTs to /__feedback/api/turn for each conversational turn.
3. The Ruby handler verifies whitelist + rate-limit, stamps the
 user identity server-side (client cannot fake `sender`), then
 forwards to the Rust agent's /feedback/intake.
4. Finalised tickets land in .tina4/chat/threads.json with
 kind:"feedback". Developer sees them in the dev admin sidebar.

Constant Summary collapse

RATE_WINDOW =

1 hour

3600
RATE_MAX =

submissions/turns per user per hour

5

Class Attribute Summary collapse

Class Method Summary collapse