Skip to content

Fix productivity pipeline: date filtering, data loss, AI misclassification#1

Open
Rohitwa wants to merge 1 commit into
mainfrom
claude/kind-gagarin
Open

Fix productivity pipeline: date filtering, data loss, AI misclassification#1
Rohitwa wants to merge 1 commit into
mainfrom
claude/kind-gagarin

Conversation

@Rohitwa

@Rohitwa Rohitwa commented Apr 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Dashboard date picker fixed — queries tracker DB daily_memory by date instead of cumulative PMIS V2 memory_nodes
  • ~90% data loss resolved — hourly aggregator now catches up ALL missed hours across ALL dates on daemon startup
  • AI time attribution fixed — accepts both "ai" and "agent" worker values; worker classification changed from majority-vote to "any human input = human"
  • Duplicate daily entries eliminated — daily rollup uses delete-then-insert; hourly cleanup only at end-of-day
  • New pipeline_log table — daemon tracks which hours/dates have been processed, enabling automatic catch-up on restart

Before vs After

Date Before After
Apr 10 8m (0m AI) 2h 45m (47m AI)
Apr 9 12m (0m AI) 2h 43m (1h 10m AI)
Apr 4 1h 16m (0m AI) 2h 50m (59m AI)

Files changed (6)

  • memory_system/platform/server.py — dashboard API date filtering
  • productivity-tracker/src/agent/tracker.py — worker logic + startup catch-up
  • productivity-tracker/src/memory/hourly_aggregator.py — worker mismatch + cross-date catch-up
  • productivity-tracker/src/memory/daily_rollup.py — delete-before-insert + pipeline logging
  • productivity-tracker/src/storage/db.py — PipelineLog helpers + delete_daily_for_date
  • productivity-tracker/src/storage/models.py — PipelineLog model

Test plan

  • DB verification: context_1 totals match daily_memory within <1 min rounding
  • No duplicate SC entries in daily_memory
  • UI: date picker shows different data per date
  • UI: AI Work column populated for dates with AI activity
  • UI: empty dates show graceful "No data"

🤖 Generated with Claude Code

…ation

- Platform dashboard: query tracker DB daily_memory by date instead of
  cumulative PMIS V2 memory_nodes (date picker now works)
- Worker classification: any human input in segment = human work
  (was majority vote, causing most ChatGPT sessions to be labeled AI)
- Hourly aggregator: accept both "ai" and "agent" worker values
  (mismatch was zeroing all recent AI time)
- Daily rollup: delete-then-insert prevents duplicate entries on
  repeated runs; hourly cleanup only at end-of-day (11 PM)
- New PipelineLog table tracks processed hours/dates so daemon
  knows what's been done
- Startup catch-up: daemon processes ALL missed hours and dates
  across full history, not just today
- Hourly catch-up accepts target_date param for cross-date recovery

Before: Apr 10 showed 8min (91% data loss, 0 AI time)
After:  Apr 10 shows 2h45m (1h58m human, 47m AI) matching raw segments

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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