Skip to content

fix: harden dashboard refresh flow and complete cleanup pass#54

Merged
janekbaraniewski merged 32 commits intomainfrom
feat/dashboard-race-parser-cleanups
Mar 10, 2026
Merged

fix: harden dashboard refresh flow and complete cleanup pass#54
janekbaraniewski merged 32 commits intomainfrom
feat/dashboard-race-parser-cleanups

Conversation

@janekbaraniewski
Copy link
Owner

@janekbaraniewski janekbaraniewski commented Mar 9, 2026

Summary

This PR started as a dashboard timeframe race fix and expanded into a full correctness, concurrency, and code-structure cleanup across the dashboard, daemon, telemetry, provider, detection, and TUI layers.

The work in this branch is now complete for the review scope it set out to address:

  • stale snapshot races and wrong-window dashboard state are fixed
  • read-model refresh dedupe now respects time window identity
  • parser drift between dashboard and telemetry paths was removed for the major local-source providers
  • large mixed-responsibility files were split across daemon, telemetry, provider, and TUI hot paths
  • UI-owned metric decoding was pushed into shared helpers
  • render-path caching and invalidation were tightened
  • runtime-only provider hints were moved behind explicit RuntimeHints / Hint / SetHint helpers
  • large high-churn test suites were split by scenario family and given shared setup helpers

What Changed

  • hardened dashboard refresh flow so stale snapshot responses are rejected by request/window identity
  • fixed read-model cache dedupe so different time windows no longer share the same refresh key
  • typed daemon/telemetry time-window flow with core.TimeWindow
  • extracted snapshot dispatch/versioning out of dashboard wiring
  • consolidated Codex, Claude Code, and Cursor raw-source parsers/readers used by both dashboard and telemetry
  • split daemon server concerns across HTTP, logging, read-model, collect, poll, spool, and hook-ingest files
  • split telemetry usage-view concerns across projection, query, materialization, and aggregate fanout units
  • moved analytics/detail extraction into shared core helpers
  • standardized collection/sorting helpers and removed repeated hand-rolled key-ordering paths
  • decomposed the TUI further so state/input, rendering, detail formatting, and settings sections are separated
  • introduced RuntimeHints on AccountConfig with Hint / SetHint helpers and moved active detect/provider runtime-only reads toward that boundary
  • split remaining high-churn provider/session files and large provider test suites by concern/scenario family
  • refreshed the audit/report docs to reflect the actual post-cleanup state

Review State

There are no remaining active P1, P2, or P3 audit items from this review.

The remaining work in the repo is ordinary future maintenance or product evolution, not an unresolved bug or open cleanup obligation from this branch.

Validation

  • go test ./...
  • go vet ./...

janekbaraniewski and others added 5 commits March 9, 2026 11:51
- reject stale dashboard snapshots by time window and request id
- normalize runtime provider paths and route dashboard side effects through services
- share codex and claude code local-source parsing across dashboard and telemetry paths
- update audit notes and regression coverage for the cleanup pass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- parse composerData and bubbleId rows once into shared cursor state records
- reuse shared state records in both the dashboard provider and telemetry collector
- remove the extra telemetry bubble pass and add direct shared-reader tests
- update the audit table to narrow the remaining cursor duplication scope

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- store the daemon service root context on the service instance
- use the service-owned context for async read-model cache refreshes from HTTP handlers
- keep timeout bounds while removing detached context.Background ownership
- update the audit table to mark the ownership cleanup as fixed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@janekbaraniewski janekbaraniewski changed the title feat: dashboard race parser cleanups refactor: harden dashboard refresh flow and decompose telemetry paths Mar 9, 2026
@janekbaraniewski janekbaraniewski changed the title refactor: harden dashboard refresh flow and decompose telemetry paths fix: harden dashboard refresh flow and decompose hot paths Mar 9, 2026
@janekbaraniewski janekbaraniewski changed the title fix: harden dashboard refresh flow and decompose hot paths fix: harden dashboard refresh flow and complete cleanup pass Mar 10, 2026
@janekbaraniewski janekbaraniewski merged commit 2787833 into main Mar 10, 2026
10 checks passed
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