fix(tests): the browse vocabulary guard names the fourth kind (#3729)
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 10s
CI & Build / integration (push) Successful in 42s
CI & Build / TypeScript typecheck (push) Successful in 56s
CI & Build / Python tests (push) Successful in 1m37s
CI & Build / Build & push image (push) Successful in 26s
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 10s
CI & Build / integration (push) Successful in 42s
CI & Build / TypeScript typecheck (push) Successful in 56s
CI & Build / Python tests (push) Successful in 1m37s
CI & Build / Build & push image (push) Successful in 26s
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01821k5B3Ysecp9fNYs92Kuy
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user