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 -8
View File
@@ -84,11 +84,11 @@ async def test_the_prompt_menu_looks_beyond_the_bound_project_for_a_lesson():
@pytest.mark.asyncio
async def test_the_write_path_asks_for_lessons_at_all():
"""The founding example of the kind is a lesson about a code shape, and
this is the arm that fires when code is written. It is also the one note
arm that filters kinds — so an omission here is not a ranking loss, it is
a kind that can never appear."""
async def test_the_write_path_leaves_lessons_to_their_situation():
"""An edit's words resemble a lesson far more often than the edit is its
situation, so the edit door's search by meaning leaves lessons out; a
lesson reaches an edit through a situation confirmed for it
(`lesson_situations`). The kinds the door does consider stay."""
search = AsyncMock(return_value=[])
with patch.object(pc, "get_writepath_config",
AsyncMock(return_value=writepath_cfg(threshold=0.6))), \
@@ -101,9 +101,7 @@ async def test_the_write_path_asks_for_lessons_at_all():
await pc.build_write_path_hint(1, "src/ui/Badge.vue", code="x" * 400)
kw = search.await_args.kwargs
assert LESSON_NOTE_TYPE in kw["record_kinds"]
# The kinds it already carried must survive the addition — a set rewritten
# rather than extended would trade one unreachable kind for another.
assert LESSON_NOTE_TYPE not in kw["record_kinds"]
assert {"snippet", "note"} <= set(kw["record_kinds"])
assert kw["include_global_kinds"] is True