NEC-387: Grafana: Feedback dashboard ranked by paid votes #358
No reviewers
Labels
No labels
area:docs
area:identity
area:ops
area:plugin
area:server
channel:community
channel:direct
channel:owned
channel:press
channel:social
dependencies
e2ee-constrained
gate:at-ga
gate:pre-ga
marketing
parity
relay:absent
relay:planned
relay:requested
relay:supported
risk:additive
risk:contract
risk:none
security
usability
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Nectenda/nectenda!358
Loading…
Reference in a new issue
No description provided.
Delete branch "worktree-nec-387-grafana-feedback-dashboard-ranked-by-pai"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task: NEC-387 — https://projectron.nerchure.com/tasks/409
Adds a Feedback dashboard to Grafana that ranks the board's ideas by who is paying, with a Rank by menu (paid votes, annual only, all votes). The board gains a read-only GET /api/kpi behind KPI_TOKEN (BOARD-016); identity's /api/kpi carries each person's class from boardClass() (BOARD-017), so 'upgraded since voting' agrees with billing by construction. The collector reads the board hourly after the core run commits. The views are tested in PGlite (Postgres 18) by running each panel's own SQL with each Rank by value, and the dashboard was checked in a real Grafana 13. After merge: KPI_TOKEN goes in board.env on the identity host, and clconsole's kpi directory is re-synced and the collector rebuilt (spec, 'After merge').
Spec:
docs/changes/NEC-387-feedback-dashboard/spec.mdChangelog
NONE
The collector reads the feedback board's /api/kpi hourly with the outside sources, after the core run has committed, so a board that is down is a row in source_runs and never costs the sign-in events only the core run can catch. Ideas and votes are replaced on each read, in one transaction: a failed write leaves the last good copy. Each person's plan class now comes from identity's feed into snap_identity_users.board_class. The new dashboard, generated beside the KPI one, has a Rank by variable (paid, annual, all) that orders both Top ideas and the ideas table. Counts are by the class each vote recorded; the class now is used only for "upgraded since voting". Every definition is a v_feedback_* view. The views are tested in PGlite, Postgres 18 in WASM, the same major as clconsole: schema.sql applied as the collector applies it, rows written through the collector's own writes, and each panel's SQL taken from the generated JSON with ${rank} substituted. The source writes move from collector.mjs into lib.mjs so the test can drive them. The KPI dashboard's JSON is byte-identical after the builder learnt to build two. Task: NEC-387 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EV8ztYjhgsq6n7uzBz68QG