From d127d48c1465661a5004feee3105f215557b99bb Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Fri, 18 Sep 2026 15:34:17 -0400 Subject: [PATCH] fix(tests): the browse vocabulary guard names the fourth kind (#3729) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI 7016. `test_non_task_facets_are_the_note_types_and_only_those` pins the non-task vocabulary as a literal set, so adding `lesson` to `_FACETS` turned it red — the guard working, not breaking. It stays a literal: derived from _FACETS it would assert nothing, and rule 167 wants a guard that can fail. The representative corpus had no lesson row, so `lesson` was reaching only the two tests that iterate FACET_TYPES and never the one that asserts each facet selects EXACTLY its own rows. It has one now, which is what pins the half that matters: a lesson is not picked up by the Notes facet despite both being non-task records. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01821k5B3Ysecp9fNYs92Kuy --- tests/test_knowledge_facets.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_knowledge_facets.py b/tests/test_knowledge_facets.py index 3e5f481..80fd203 100644 --- a/tests/test_knowledge_facets.py +++ b/tests/test_knowledge_facets.py @@ -38,6 +38,7 @@ ROWS = { "plain note": fake_note(note_type="note"), "process": fake_note(note_type="process"), "snippet": fake_snippet(), + "lesson": fake_note(note_type="lesson"), "work task": fake_task(task_kind="work", note_type="note"), "issue": fake_task(task_kind="issue", note_type="note"), "spike": fake_task(task_kind="spike", note_type="note"), @@ -72,6 +73,7 @@ def test_pre_filter_never_excludes_a_row_the_facet_wants(facet): ("note", {"plain note"}), ("process", {"process"}), ("snippet", {"snippet"}), + ("lesson", {"lesson"}), ("", set(ROWS)), ], ) @@ -101,7 +103,11 @@ def test_the_live_task_kinds_are_all_facets(): def test_non_task_facets_are_the_note_types_and_only_those(): - assert set(NON_TASK_FACETS) == {"note", "process", "snippet"} + """Spelled out rather than derived, so adding a kind to `_FACETS` has to + be a deliberate edit in two places. `lesson` joined in milestone 385 step + 2 (#3729) and is non-task on purpose: `is_task` IS `status is not None`, + so a lesson that acquired a status would stop being a lesson.""" + assert set(NON_TASK_FACETS) == {"note", "process", "snippet", "lesson"} @pytest.mark.parametrize("facet", sorted(FACET_TYPES))