Skip to content

fix(killtracker): v2.12 codex tracking#2336

Open
mrhoribu wants to merge 2 commits into
masterfrom
fix/killtracker-v2.12
Open

fix(killtracker): v2.12 codex tracking#2336
mrhoribu wants to merge 2 commits into
masterfrom
fix/killtracker-v2.12

Conversation

@mrhoribu
Copy link
Copy Markdown
Contributor

@mrhoribu mrhoribu commented May 25, 2026

Summary by CodeRabbit

Release Notes

  • New Features
    • Added complete codex tracking system with weekly metrics and comprehensive reporting
    • New codex report command for detailed summaries and statistics
    • Codex find records can now be exported to external spreadsheets
    • Implemented weekly reset and backfill support for codex data
    • Separate weekly cap introduced for codex search eligibility

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

📝 Walkthrough

Walkthrough

Killtracker v2.12 adds complete end-to-end codex tracking: persistent data fields for finds and search counts, event parsing from downstream codex-found messages, weekly reset and backfill support with eligibility gating by a configurable weekly cap, summary reporting with codex totals and status, detailed codex report generation, and external spreadsheet submission for codex records.

Changes

Codex Tracking Feature

Layer / File(s) Summary
Codex data model and constants
scripts/killtracker.lic
Changelog updated to v2.12. Constants added: FOUND_CODEX regex matcher, CODEX_WEEKLY_CAP (default 10), and ONSLAUGHT_CREATURES pattern. Initialization now creates and persists :codex_found (timestamped find records), :weekly_codex, :weekly_codex_searches, and :searches_since_codex counters.
Codex event parsing and eligibility
scripts/killtracker.lic
parse_downstream captures codex-found events, records them with search counts and "since last codex" snapshots, and resets the counter. Search parsing distinguishes ascension vs. onslaught creatures. New codex_currently_eligible? method gates increments to codex weekly counters based on whether weekly_codex is below CODEX_WEEKLY_CAP. Onslaught searches increment codex counters only when eligible.
Weekly reset and backfill
scripts/killtracker.lic
Weekly reset captures codex totals into :weekly_counts and resets :weekly_codex and :weekly_codex_searches. Backfill resets codex counters, iterates stored :codex_found timestamps, recomputes :weekly_codex for current week, and includes updated codex count in completion message.
Summary report and UI
scripts/killtracker.lic
Help command adds ;kt codex report entry. summary_report computes codex totals (all time, this week, remaining against cap), eligibility status, and per-codex search averages. Summary table rows gain a full codex section with weekly finds, weekly searches, remaining cap slots, status, average searches per find, and "Since Last Codex" counter.
Codex-specific reports
scripts/killtracker.lic
New Killtracker.codex_report method renders detailed codex find table with per-find week search counts and "since last codex" snapshots. gemstones_report integrates codex events into its combined per-week reporting by merging :codex_found entries alongside gem and dust records.
External spreadsheet submission
scripts/killtracker.lic
send_to_sheet recognizes ev_type == "codex" and selects codex payloads from :codex_found. send_all_finds adds a "Sending found codex..." phase that submits each codex record and reports summary count.
Data validation
scripts/killtracker.lic
validate_data extends negative-value checks to include codex weekly counters and searches since codex. Event validation includes :codex_found map. Upper-bound validation enforces :weekly_codex does not exceed CODEX_WEEKLY_CAP.
Command dispatch and main loop
scripts/killtracker.lic
Main report-processing loop handles "found codex" report type for announcement display and routes codex submissions via send_to_sheet("codex", ...). Command dispatch adds /codex report/ to invoke codex_report.

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(killtracker): v2.12 codex tracking' clearly and specifically identifies the main change: adding codex tracking functionality to the killtracker script in version 2.12.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/killtracker-v2.12

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/killtracker.lic`:
- Around line 425-426: Don't reset $killtracker[:weekly_codex_searches] unless
you also rebuild it; remove the line that sets
$killtracker[:weekly_codex_searches] = 0 or replace it with logic that
recomputes weekly_codex_searches from the same data used to rebuild
$killtracker[:weekly_codex]. Locate the assignments to
$killtracker[:weekly_codex] and $killtracker[:weekly_codex_searches] and either
only zero/recompute weekly_codex or add code to aggregate existing kill
records/events into $killtracker[:weekly_codex_searches] (same
time-window/bucketing logic used for weekly_codex) so the count remains correct
after running the fix.
- Around line 1225-1228: The codex event is currently recording the gem search
counter ($killtracker[:weekly_ascension_searches]) into ev[:searches_week] which
miscounts codex-only eligibility; change the stored value to the codex counter
($killtracker[:weekly_codex]) so that the codex record created at
$killtracker[:codex_found][key] uses $killtracker[:searches_since_codex] and
$killtracker[:weekly_codex] (keep the existing keys searches_since and
searches_week).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d9d5712d-6b9d-4984-8123-db387ee567f9

📥 Commits

Reviewing files that changed from the base of the PR and between ce2925a and ca0fa7c.

📒 Files selected for processing (1)
  • scripts/killtracker.lic

Comment thread scripts/killtracker.lic
Comment on lines +425 to +426
$killtracker[:weekly_codex] = 0
$killtracker[:weekly_codex_searches] = 0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Don't zero weekly_codex_searches unless you also rebuild it.

This method recomputes weekly_codex, but not weekly_codex_searches. After ;kt fix find count, the codex summary added in this PR will show 0 current-week codex searches until more kills arrive, even if the previous value was correct.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/killtracker.lic` around lines 425 - 426, Don't reset
$killtracker[:weekly_codex_searches] unless you also rebuild it; remove the line
that sets $killtracker[:weekly_codex_searches] = 0 or replace it with logic that
recomputes weekly_codex_searches from the same data used to rebuild
$killtracker[:weekly_codex]. Locate the assignments to
$killtracker[:weekly_codex] and $killtracker[:weekly_codex_searches] and either
only zero/recompute weekly_codex or add code to aggregate existing kill
records/events into $killtracker[:weekly_codex_searches] (same
time-window/bucketing logic used for weekly_codex) so the count remains correct
after running the fix.

Comment thread scripts/killtracker.lic
Comment on lines +1225 to +1228
$killtracker[:weekly_codex] += 1
$killtracker[:codex_found][key] = {
searches_since: $killtracker[:searches_since_codex],
searches_week: $killtracker[:weekly_ascension_searches],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Persist the codex search counter here, not the gem search counter.

Line 1228 stores weekly_ascension_searches into codex events, but codex eligibility is now tracked independently. Once a character is gem-ineligible but still codex-eligible, detailed codex reports, averages, and sheet exports will all undercount because they read ev[:searches_week] from this record.

Suggested fix
       $killtracker[:codex_found][key] = {
         searches_since: $killtracker[:searches_since_codex],
-        searches_week: $killtracker[:weekly_ascension_searches],
+        searches_week: $killtracker[:weekly_codex_searches],
         name: name,
         room: room,
         creature: $killtracker[:creature]
       }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/killtracker.lic` around lines 1225 - 1228, The codex event is
currently recording the gem search counter
($killtracker[:weekly_ascension_searches]) into ev[:searches_week] which
miscounts codex-only eligibility; change the stored value to the codex counter
($killtracker[:weekly_codex]) so that the codex record created at
$killtracker[:codex_found][key] uses $killtracker[:searches_since_codex] and
$killtracker[:weekly_codex] (keep the existing keys searches_since and
searches_week).

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