fix(7836): lesson situations travel in backups, and the edit door test states the new intent
CI & Build / TypeScript typecheck (push) Successful in 35s
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Python tests (push) Successful in 2m5s
CI & Build / integration (push) Successful in 2m12s
CI & Build / Build & push image (push) Successful in 33s

- backup v31 carries lesson_situations (full and per-user export, restored
  through the note map);
- the lesson surfacing test now pins that the edit door's search leaves
  lessons to their situation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 06:18:45 -05:00
co-authored by Claude Opus 5.5
parent c22e8e1844
commit 5bde619511
3 changed files with 69 additions and 11 deletions
+6 -1
View File
@@ -22,7 +22,7 @@ def test_backup_version_is_current():
"""The bump is the point of the test — a payload section added without
moving the version produces backups that are structurally different and
indistinguishable by inspection."""
assert backup.BACKUP_VERSION == 30
assert backup.BACKUP_VERSION == 31
def _exportable_note(**over):
@@ -141,6 +141,7 @@ def _column_guard_targets():
)
from grimoire.models.code_shape import CodeShape, CodeShapeEvent, CodeShapeUse
from grimoire.models.lesson_rule_link import LessonNoRule, LessonRuleLink
from grimoire.models.lesson_situation import LessonSituation
from grimoire.models.rule_moment_judgment import RuleMomentJudgment
from grimoire.models.rule_field_judgment import RuleFieldJudgment
from grimoire.models.design_system import DesignSystem, DesignToken
@@ -183,6 +184,7 @@ def _column_guard_targets():
"rule_relations": (RuleRelation, backup._rule_relation_rows),
"lesson_rule_links": (LessonRuleLink, backup._lesson_rule_link_rows),
"lesson_no_rule": (LessonNoRule, backup._lesson_no_rule_rows),
"lesson_situations": (LessonSituation, backup._lesson_situation_rows),
"rule_moment_judgments": (RuleMomentJudgment, backup._rule_moment_judgment_rows),
"rule_field_judgments": (RuleFieldJudgment, backup._rule_field_judgment_rows),
"note_usage_events": (NoteUsageEvent, backup._usage_event_rows),
@@ -315,6 +317,7 @@ def _import_guard_targets():
"rule_relations": backup._build_rule_relation,
"lesson_rule_links": backup._build_lesson_rule_link,
"lesson_no_rule": backup._build_lesson_no_rule,
"lesson_situations": backup._build_lesson_situation,
"rule_moment_judgments": backup._build_rule_moment_judgment,
"rule_field_judgments": backup._build_rule_field_judgment,
"note_usage_events": backup._build_usage_event,
@@ -595,6 +598,8 @@ async def test_export_full_backup_contains_every_declared_section():
"rule_triggers",
# v30: the weighed enforcement, salience and triggers.
"rule_field_judgments",
# v31: the moments and triggers each lesson arrives at.
"lesson_situations",
# v25: family canon.
"platforms", "project_platforms", "family_ideas",
"family_idea_platforms", "family_idea_references",