Skip to content

fix: explicit status classification in analyticsRepo - #26

Merged
JLRansom merged 2 commits into
masterfrom
fix/analytics-status-classification
Mar 18, 2026
Merged

fix: explicit status classification in analyticsRepo#26
JLRansom merged 2 commits into
masterfrom
fix/analytics-status-classification

Conversation

@JLRansom

Copy link
Copy Markdown
Owner

Summary

  • Replace implicit else branches in dbGetProjectAnalytics() with explicit else if (r.status === 'failed') checks in both the summary aggregation loop and the weekly bucket loop
  • Prevents any future status values from silently inflating failure counts
  • Prerequisite for the Agent Health Scores feature (which derives error density from the same status values)

Changes

  • lib/db/repositories/analyticsRepo.ts — two one-line fixes (summary loop + weekly bucket loop)
  • __tests__/unit/analytics-repo.test.ts — new status classification describe block with 4 parametrized tests covering done/failed classification and double-counting guards

Test plan

  • npm run test:run — all 137 tests pass
  • Parametrized it.each covers both done and failed status values explicitly
  • Weekly bucket test confirms independent done/failed counts

🤖 Generated with Claude Code

JLRansom and others added 2 commits March 17, 2026 20:28
… card modal

- MeetingView: always build the card description from all concluded agent
  messages (writer, researcher, coder, senior-coder, tester) rather than
  using only the tester output and falling back to everyone else
- TaskDetailModal: fetch project tags on open and replace the freetext
  input+Add button with a <select> dropdown; only unassigned project tags
  are shown; selected tag is appended and removed from the dropdown;
  existing tag pills now use the project tag's hex color when available

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace implicit `else` branches with `else if (r.status === 'failed')` in
both the summary counter loop and the weekly bucket loop, so unknown/future
statuses are silently ignored rather than counted as failures. Add a new
`status classification` describe block (4 tests) to analytics-repo.test.ts
covering done/failed parametrized cases, double-count guards, and weekly
bucket accuracy.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@JLRansom
JLRansom merged commit 8549f8a into master Mar 18, 2026
2 checks passed
@JLRansom
JLRansom deleted the fix/analytics-status-classification branch March 18, 2026 01:52
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