feat: surface live ruflo/agentic-qe intelligence telemetry in the dashboard - #118
Merged
Conversation
…hboard The dashboard's Overview -> Intelligence panel's "learning over time" strip was permanently static: its patterns-learned sparkline always showed "no data" because the file it read (.claude-flow/health-history.json) had a reader but no writer anywhere in the codebase, and the improvement panel showed only a bare "+Npp (one sample)" while discarding the richer statistical detail already computed and sitting unused in .claude-flow/improvement.json. Meanwhile ruflo/agentic-qe were already writing two further real, timestamped data sources under .claude-flow/ (the neural pattern store and reasoning-graph snapshots) that the dashboard never read at all. Source - Add src/lib/dashboard/intel-history.mjs: disk-first readers for the neural pattern store, reasoning-graph snapshots, and global stats counters, plus the previously-missing appendHealthSnapshot() writer (deduplicated, capped at 500 entries, atomic write). Explicitly documents that the patternsLearned lifetime counter and the pattern store's live entry count are different metrics that can legitimately diverge and must never be conflated. - Add src/lib/live/intelligence-watch.mjs: a lightweight, debounced file-change watcher that detects real learning-data changes and triggers a fresh snapshot + push update. Deliberately does not reuse or extend the session/actor-shaped live-event projection model (reduceLiveEvent/projection.mjs) built for transcript observability, since pattern-learning telemetry is a different domain; only the genuinely generic JsonlTailer and SSE transport are reused. - Wire both modules into src/lib/dashboard-server.mjs: collectData() now returns globalStats/patternStore/graph alongside the existing health ring, and a new GET /api/live/intelligence SSE route (reusing the existing sseChannel transport verbatim) pushes near-instant updates instead of relying solely on the dashboard's ~30s poll loop. - Update src/lib/dashboard/client.mjs and page.mjs to render real sparklines for all four series, add a color-coded PASS/FAIL verdict badge with p-value/Cohen's d to the improvement panel, render its within-run learning curve, and subscribe to the new SSE route. Tests - tests/kit/intel-history.test.mjs and intelligence-watch.test.mjs: unit coverage for every reader, the append/dedup/cap behavior, and the watcher's debounce/burst-coalescing/error-routing/lifecycle. - tests/kit/dashboard-intel-integration.test.mjs: boots the real dashboard server against fixture .claude-flow/ trees covering the full-data, no-data, partial-fixture, and malformed-JSON cases. Docs - Add ADR-0024 and docs/ddd/project-intelligence.md: this telemetry is scoped as its own bounded context rather than an ADR-0012/Observability amendment, since it carries no session/actor/host identity, lifecycle, or confidence grading -- it is direct reads of this project's own .claude-flow/ state, the same trust boundary `ak status` already uses. - Update docs/adr/README.md, docs/ddd/README.md, docs/ddd/context-map.md, docs/ddd/ubiquitous-language.md, and docs/DASHBOARD.md to cross-link the new bounded context and correct now-stale descriptions of the panel's previous static behavior.
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.
Summary
The dashboard's Overview → Intelligence panel's "learning over time" strip was permanently static: its patterns-learned sparkline always showed "no data" because the file it read (
.claude-flow/health-history.json) had a reader but no writer anywhere in the codebase, and the improvement panel showed only a bare "+Npp (one sample)" while discarding richer statistical detail already computed and sitting unused in.claude-flow/improvement.json. Meanwhile ruflo/agentic-qe were already writing two further real, timestamped data sources under.claude-flow/(the neural pattern store and reasoning-graph snapshots) that the dashboard never read at all.Source
src/lib/dashboard/intel-history.mjs— disk-first readers for the neural pattern store, reasoning-graph snapshots, and global stats counters, plus the previously-missingappendHealthSnapshot()writer (deduplicated, capped at 500 entries, atomic write). Documents that thepatternsLearnedlifetime counter and the pattern store's live entry count are different metrics that can legitimately diverge and must never be conflated.src/lib/live/intelligence-watch.mjs— a lightweight, debounced file-change watcher that triggers a fresh snapshot + push update. Deliberately does not reuse/extend the session/actor-shaped live-event projection model built for transcript observability — only the genuinely genericJsonlTailerand SSE transport are reused.dashboard-server.mjs—collectData()now returnsglobalStats/patternStore/graphalongside the existing health ring; newGET /api/live/intelligenceSSE route reuses the existingsseChanneltransport verbatim.client.mjs/page.mjs— real sparklines for all four series, a color-coded PASS/FAIL verdict badge with p-value/Cohen's d on the improvement panel, its within-run learning curve, and a subscription to the new SSE route.Tests
tests/kit/intel-history.test.mjs,intelligence-watch.test.mjs— unit coverage for every reader, append/dedup/cap behavior, and the watcher's debounce/burst-coalescing/error-routing/lifecycle.tests/kit/dashboard-intel-integration.test.mjs— boots the real dashboard server against fixture.claude-flow/trees covering full-data, no-data, partial-fixture, and malformed-JSON cases.Docs
docs/ddd/project-intelligence.md— scoped as its own bounded context rather than an ADR-0012/Observability amendment (no session/actor/host identity, lifecycle, or confidence grading — direct reads of this project's own.claude-flow/state).docs/adr/README.md,docs/ddd/README.md,docs/ddd/context-map.md,docs/ddd/ubiquitous-language.md,docs/DASHBOARD.md.Test plan
pnpm run check(typecheck, lint, markdownlint, build, full test suite) — green locally.claude-flow/data (sparklines render, SSE connects/reconnects cleanly across tab switches)