Skip to content

chore: post-merge polish for historic-analysis refactor#60

Merged
Odrec merged 1 commit into
mainfrom
chore/post-merge-polish
Apr 28, 2026
Merged

chore: post-merge polish for historic-analysis refactor#60
Odrec merged 1 commit into
mainfrom
chore/post-merge-polish

Conversation

@Odrec
Copy link
Copy Markdown
Collaborator

@Odrec Odrec commented Apr 28, 2026

Summary

Follow-up to #53 — two minor cleanups that were noted in review but not blocking the merge:

  • MetricsCalculator.calculate_daily_metrics — hoist the loop-invariant if user and ai_responses: check out of the per-AI-response loop. The user-token attribution now multiplies by len(ai_responses) once instead of repeating the test on every iteration. Behaviour is unchanged: when there are no AI responses or no user, nothing is added; otherwise the user receives token_count × N input tokens (matching the existing regeneration semantics).
  • mariadb-init/init.sql — add a comment clarifying that the leading DROP DATABASE IF EXISTS is only safe because the official MariaDB image runs mariadb-init scripts exclusively on first volume init. Anyone tempted to mysql < init.sql against a populated volume would wipe their historical metrics; the warning makes that explicit.

delete_future_dates() — flagged in review as defined-but-unused — was already removed during the merge, so no action needed there.

The .env-vs-.env.example convention discussion was deliberately left out; that's a wider call.

Two minor follow-ups to the historic-analysis refactor merged in #53:

- Hoist the loop-invariant `if user and ai_responses` check out of the
  per-AI-response loop in MetricsCalculator.calculate_daily_metrics. The
  user-token attribution now multiplies by len(ai_responses) once instead
  of repeating the test on every iteration; behaviour is unchanged.
- Add a warning comment to mariadb-init/init.sql clarifying that the
  DROP DATABASE is only safe because mariadb-init runs exclusively on
  empty data directories — anyone running the file manually would wipe
  historical metrics.
@Odrec Odrec merged commit 7e8a17a into main Apr 28, 2026
21 checks passed
@Odrec Odrec deleted the chore/post-merge-polish branch May 7, 2026 23:59
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