feat(webapp): console dashboard driven by kb.activity#454
Merged
Conversation
one pass over the audit log returning per-day counts (with proposal/decision breakdowns), an hour-of-week matrix, and actor/event histograms — the data a dashboard needs that kb.audit's tail-limited raw events and kb.stats' review aggregates don't cover. windowed in viewer-local calendar days so the oldest heatmap cell is never partially counted (days=0 for all-time, negatives rejected). local bucketing prefers an iana tz name (dst-correct across the year) and falls back to a clamped fixed utc offset. scope-filtered through the same viewer context as kb.audit so multi-project kbs don't leak actor names or activity timing across project boundaries. registered at all four sites (mcp tool, jsonl handler, capabilities methods, vouch activity cli) plus trust read methods.
new /dashboard view driven by kb.activity: a 12-month activity calendar (ember heat ramp themed for dark and light via --heat-* css vars), last-30-days bars, an hour-of-week heatmap, and top-actor / event-mix bar lists, with stat tiles fed by kb.status and kb.stats. the calendar fetches 371 days so its oldest drawn column always sits inside the server window, sends the browser's iana timezone for dst-correct bucketing, and degrades cleanly: endpoints that don't advertise kb.activity get an upgrade hint, empty audit logs get an empty state, and a malformed stats payload no longer crashes the view. / now redirects to the dashboard instead of chat and the tab leads the sidebar; the e2e smoke flow clicks through to chat accordingly.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
adds a console dashboard as the landing view, modeled on agents-view style session analytics but driven by vouch's own audit log: a 12-month activity calendar (ember heat ramp, themed for dark and light), last-30-days bars, an hour-of-week heatmap, top actors and event mix, plus stat tiles from kb.status / kb.stats.
/now redirects to/dashboardinstead of chat and the tab leads the sidebar.the data comes from a new
kb.activityread method — one pass over the audit log returning per-day buckets with proposal/decision breakdowns, a 7×24 hour-of-week matrix, and actor/event histograms. kb.audit's tail-limited raw events and kb.stats' review aggregates don't cover this, and shipping raw events to the browser wouldn't scale with the append-only log. registered at all four sites (mcp tool, jsonl handler, capabilities methods,vouch activitycli) plus trust read methods; pure read, no new write path.windowing is viewer-local calendar days so the oldest heatmap cell is never partially counted (
days=0for all-time, negatives rejected). local bucketing prefers an iana tz name — dst-correct across the year — and falls back to a clamped fixed utc offset. scoping goes through the same viewer context as kb.audit so multi-project kbs don't leak actor names or activity timing across project boundaries.the view degrades cleanly: endpoints that don't advertise kb.activity get an upgrade hint, empty audit logs get an empty state, and a malformed stats payload can't blank the landing page. the calendar fetches 371 days so its oldest drawn column always sits inside the server window, and chart aria-labels carry totals and peaks for non-mouse users.
note: this branch is based on the local transcript-viewer work (14 commits ending at 776bffb) that wasn't yet on origin/test, so those commits ride along here; the dashboard itself is the last two commits. merge-tree against origin/test is clean, including the bulk-clear merge (#434).
verified on the exact shipped commits in a detached worktree: pytest 1185 passed, mypy and ruff clean, vitest 145 passed, tsc clean; rendered live against a real kb in both themes.