Skip to content

feat: surface live ruflo/agentic-qe intelligence telemetry in the dashboard - #118

Merged
pacphi merged 1 commit into
mainfrom
feat/dashboard-intel-live-data
Aug 5, 2026
Merged

feat: surface live ruflo/agentic-qe intelligence telemetry in the dashboard#118
pacphi merged 1 commit into
mainfrom
feat/dashboard-intel-live-data

Conversation

@pacphi

@pacphi pacphi commented Aug 5, 2026

Copy link
Copy Markdown
Owner

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-missing appendHealthSnapshot() writer (deduplicated, capped at 500 entries, atomic write). 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.
  • 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 generic JsonlTailer and SSE transport are reused.
  • dashboard-server.mjscollectData() now returns globalStats/patternStore/graph alongside the existing health ring; new GET /api/live/intelligence SSE route reuses the existing sseChannel transport 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

  • ADR-0024 + 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).
  • Cross-links updated in 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
  • Manual browser verification of the live panel against this repo's own real .claude-flow/ data (sparklines render, SSE connects/reconnects cleanly across tab switches)
  • CI green on this PR

…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.
@pacphi
pacphi merged commit f3e13e5 into main Aug 5, 2026
11 checks passed
@pacphi
pacphi deleted the feat/dashboard-intel-live-data branch August 5, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant