A scored snapshot outlives the period it was scored against #47
Labels
No Label
P0
P1
P2
release-blocker
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: null/Privacy-Period-Tracker#47
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by tracing the learning loop at
93ec5b7.What is true now.
CycleRepository.editPeriodanddeletePeriodnever touch scoredprediction_records. Editing a confirmed start to correct a mistake, or deleting it outright, leaves the oldactualStartDateandabsoluteErrorDaysin place.PredictionRecordDao.recentAbsoluteErrors()keeps feeding that error intoPredictionInput.recentAbsoluteErrors, so the engine widens its window from a measurement about a period the user has since corrected or withdrawn — and §16's accuracy card reports it to her.What it costs. The engine learns from a fact the user has retracted; the accuracy figures describe a history that no longer exists.
What to do. Add
scoredAgainst(actual)anddeleteById(id)queries toPredictionRecordDao. IneditPeriod, after the update and beforesnapshotForecast, re-score each snapshot recorded against the old start against the new one; indeletePeriod, retract them.Traps. Match on
actualStartDate, notbasedOnLastConfirmedPeriodId— the latter is null on the not-yet and delete paths. Re-scoring must not be able to fabricate a better history:predictedStartDatestays immutable (so a correction worsens the figure as readily as it improves one) and the same backfill rule that gates first scoring must gate re-scoring, retracting rather than recomputing when the corrected start falls before the forecast's lineage began. Depends on the lineage fix landing first, since that gate readsgeneratedAtas a lineage origin.Verify:
editing a period re-scores the forecast that was scored against it,editing a period to before its forecast existed retracts the scoreanddeleting a period retracts the score recorded against itin CycleRepositoryTest.kt.