Skip to content

Score saved scans as of when they were taken (roadmap 3.6) - #34

Merged
Castor-o7 merged 1 commit into
mainfrom
pdx-28-rescore-as-of
Oct 31, 2026
Merged

Castor-o7 merged 1 commit into
mainfrom
pdx-28-rescore-as-of

Conversation

@Castor-o7

Copy link
Copy Markdown
Owner

Story: PDX-28

Rescores aged saved scans against today, so recency rules gave different results each day and a past figure couldn't be reproduced. Scoring itself is unchanged for live scans.

  • New scans save scanned_at, and --rescore ages each scan against it, including OTX's pulses.
  • Scans without one are listed in the report and age against today, unless --as-of YYYY-MM-DD is given.
  • --refresh sets the scan's time to the refresh, so its newest reading isn't dated in the future.

Measured

On the 55 real saved scans (no real lookups): all 55 have no recorded time, so they rely on --as-of for now.

As of Mean paradox, malicious Mean paradox, benign AUC Detection Benign flagged
2026-10-30 30.03 4.18 1.000 100% 4%
today (2026-10-31) 29.87 4.12 1.000 100% 4%
2027-06-01 23.56 2.94 1.000 100% 4%

The first row matches the recorded 2026-10-30 mean of 30.0, and running it twice gave a byte-identical report. The drift in the other rows is what this story removes for new scans.

Downsides

  • A refreshed scan mixes readings from different times, and the older ones age from the refresh time.
  • --as-of is a statement by whoever runs it, not evidence of when a scan was taken. The existing scans' file times are 2026-10-30, but those can change, so they aren't used.
  • The saved calibration files weren't rewritten, so existing scans stay undated until rescanned.

Tested

199 tests pass locally; see CI for other versions. Tests run the real collect and evaluate with a fake clock on two days. With the code intact as a baseline they pass, and removing either the scoring or the OTX aging fails 2 tests. Live CLI: a bad date is refused.

Not tested

A live calibrate run writing scanned_at (only scan_raw with stubs), or --refresh setting it. The latter has no test.

🤖 Generated with Claude Code

Rescores aged saved scans against today, so results drifted by the day and a
past figure couldn't be reproduced. New scans record their time, and older ones
are listed in the report and can be fixed to a date with --as-of.

Story: PDX-28

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Castor-o7
Castor-o7 merged commit d7f9beb into main Oct 31, 2026
5 checks passed
@Castor-o7
Castor-o7 deleted the pdx-28-rescore-as-of branch October 31, 2026 22:06
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