Skip to content

Fix historical retro earnings split#6

Merged
CEHR2005 merged 2 commits into
CEHR2005:mainfrom
konard:issue-5-317206e5e89e
May 10, 2026
Merged

Fix historical retro earnings split#6
CEHR2005 merged 2 commits into
CEHR2005:mainfrom
konard:issue-5-317206e5e89e

Conversation

@konard
Copy link
Copy Markdown
Contributor

@konard konard commented May 10, 2026

Fixes #5

Summary

  • split historical task earnings from the tasks.reward column instead of task_reward transaction totals
  • keep retro earnings derived from task reward deltas, current_reward - reward, with legacy transaction fallbacks for databases without task rows
  • prevent the cashback net line from showing -3 AP when there is no historical cashback/discount value
  • document the historical earnings split in the README

Reproduction

Before this change, imported historical tasks could store the original task payout in reward and the retro-adjusted payout in current_reward, while older task_reward transactions still represented the adjusted total. Historical stats then counted the adjusted transaction amount as tasks and also counted current_reward - reward as retro, double-counting retro.

The regression test inserts historical task rows with reward values of 10 and 2.5, current_reward values of 15 and 3.75, and adjusted task transactions. The expected split is 12.5 AP from tasks and 6.25 AP from retro.

Tests

  • PYTHONPATH=src python -m unittest discover -s tests
  • python -m compileall -q src tests
  • git diff --check

Notes

No UI changes or screenshots are involved.

konard added 2 commits May 10, 2026 23:18
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: CEHR2005#5
@konard konard changed the title [WIP] Продлжение Fix historical retro earnings split May 10, 2026
@konard konard marked this pull request as ready for review May 10, 2026 23:26
@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 10, 2026

Working session summary

Implemented and pushed the fix to issue-5-317206e5e89e.

Changed:

  • Historical task earnings now come from tasks.reward.
  • Retro earnings come from current_reward - reward, with legacy transaction fallback.
  • Cashback net no longer shows -3 AP when no cashback value exists.
  • Added a regression test in tests/test_economy.py.
  • Removed the placeholder .gitkeep.

Verification:

  • PYTHONPATH=src python -m unittest discover -s tests passed: 25 tests.
  • python -m compileall -q src tests passed.
  • git diff --check passed.
  • GitHub CI passed for Python 3.10, 3.11, and 3.12.

PR is updated and ready for review: #6


This summary was automatically extracted from the AI working session output.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 10, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $5.288542

📊 Context and tokens usage:

  • 168.9K / 1.1M (16%) input tokens, 19.9K / 128K (16%) output tokens

Total: (168.9K + 2.7M cached) input tokens, 19.9K output tokens, $5.288542 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Gist (23453KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 10, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@CEHR2005 CEHR2005 merged commit 5c457db into CEHR2005:main May 10, 2026
3 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.

Продлжение

2 participants