Repository navigation
user_word: study_choice and unfit_reason replace user_preference - #906
Merged
Merged
Conversation
Roadmap 0b. user_preference was one number for the learner's choice, a countdown and validator writes, so a validator fix could pass for the learner opting in (#895). - study_choice (study / skip / known): written only by learner actions. - unfit_reason: why the system keeps a word out. Quality heuristics are worked out again at every update_fit_for_study (bad_quality_reason gives the first failing check); the validator's give-up and "no usable context" last until then; validator_invalid, replaced_by_fix and duplicate_meaning stay. set_unfit_for_study now takes a reason. - fit_for_study is worked out from the two: skip/known keep a word out; a study choice lifts only the quality heuristics (the learner doesn't overrule the system). - A learner's "bad translation" is a skip until reports exist. Migration 26-10-25--user_word_study_choice.sql adds the columns and backfills them, leaving out the 481 opt-ins #895's bug forced (roadmap item 0); tools/recompute_fit_after_study_choice.py then judges those again. The user_preference column stays, unused, for a later migration to drop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Roadmap 0b, PR 2 of the series (after #905).
Columns
study_choice(study,skip,known): written only by learner actions:studyskipknownstudyOTHER_FEEDBACKin an exercise →skipskip, until reports exist (PR 3)unfit_reason: why the system keeps a word out. Every place that makes a word unfit now gives one (set_unfit_for_study(session, reason)).rare_for_beginner,same_as_translation,too_short,too_many_words,arbitrary_multi_word,bad_contexts) plusseparated_mwe: worked out again at everyupdate_fit_for_study.bad_quality_reasonreturns the first check that fails.validator_gave_upandno_usable_context: last until the next recompute (a new look-up or a star), as today.validator_invalid,replaced_by_fix(Validator fix: take the old word out of study when it survives #896's old word) andduplicate_meaning: stay.Rule
fit_for_studyis worked out from the two columns:skiporknownkeeps a word out.studylifts only the quality heuristics. The learner doesn't overrule the system.fit_for_studystays a column, since the scheduler queries filter on it.Deploy order
Migration
26-10-25--user_word_study_choice.sql. It adds the columns and backfills them. Counts from prod on 25 Oct:1study-1skip-6known-100replaced_by_fix-100skipvalidator_invalidDeploy the API. The new code reads the new columns.
tools/recompute_fit_after_study_choice.pyjudges the 481 again. It's a dry run by default;--applywrites.The old
user_preferencecolumn stays in the table, unused, until a later migration drops it. Anything the old code writes to it between steps 1 and 2 isn't carried over, so keep that gap short.For review: 29
1rows have no recorded learner action but aren't validator-fix targets either, e.g. l'enquête, 2021 → 2021, ergonomie → ergonomie. They may come from the edit dialog, which doesn't log the event, or from undo after a report. Following item 0, they keepstudy.Tests
New
test_study_choice.pycovers the rule and which reasons stay and which are judged again. The full core and API suites pass (1299 passed).🤖 Generated with Claude Code