FFF.                                                                     [100%]
=================================== FAILURES ===================================
____ TestAttachPathContextsRealSQL.test_attach_matches_symlink_alias_target ____

self = <tests.unit.search.test_context_attach.TestAttachPathContextsRealSQL object at 0x10820c690>
db = <sqlite3.Connection object at 0x107d93b50>
alias_pair = ('/private/var/folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-forrest/pytest-232/test_attach_matches_symlink_al...folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-forrest/pytest-232/test_attach_matches_symlink_al0/alias/doc.md')

    def test_attach_matches_symlink_alias_target(self, db, alias_pair):
        """A context stored under the alias form attaches to the resolved-form result."""
        resolved, alias = alias_pair
        _insert_path_context(db, "ctx-1", alias, "Project notes")
    
        results = BM25Searcher(db)._attach_contexts([_result(resolved)])
    
>       assert results[0].context_description == "Project notes"
E       AssertionError: assert None == 'Project notes'
E        +  where None = SearchResult(document_id='d1', title='T', path='/private/var/folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-for...collection_name='c', score=1.0, content=None, highlights=[], rank=1, scores={}, snippet=None, context_description=None).context_description

tests/unit/search/test_context_attach.py:89: AssertionError
________ TestAttachPathContextsRealSQL.test_unmatched_result_keeps_none ________

self = <tests.unit.search.test_context_attach.TestAttachPathContextsRealSQL object at 0x10820ca50>
db = <sqlite3.Connection object at 0x1082bc4f0>
alias_pair = ('/private/var/folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-forrest/pytest-232/test_unmatched_result_keeps_no...folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-forrest/pytest-232/test_unmatched_result_keeps_no0/alias/doc.md')
tmp_path = PosixPath('/private/var/folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-forrest/pytest-232/test_unmatched_result_keeps_no0')

    def test_unmatched_result_keeps_none(self, db, alias_pair, tmp_path):
        """In a mixed batch, the result with no context keeps context_description None."""
        resolved, alias = alias_pair
        _insert_path_context(db, "ctx-1", alias, "Project notes")
        other_doc = tmp_path / "vault" / "other.md"
        other_doc.write_text("# Other\n", encoding="utf-8")
    
        results = BM25Searcher(db)._attach_contexts(
            [_result(resolved), _result(str(other_doc))],
        )
    
>       assert results[0].context_description == "Project notes"
E       AssertionError: assert None == 'Project notes'
E        +  where None = SearchResult(document_id='d1', title='T', path='/private/var/folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-for...collection_name='c', score=1.0, content=None, highlights=[], rank=1, scores={}, snippet=None, context_description=None).context_description

tests/unit/search/test_context_attach.py:102: AssertionError
__ TestAttachPathContextsRealSQL.test_preserves_existing_description_on_miss ___

self = <tests.unit.search.test_context_attach.TestAttachPathContextsRealSQL object at 0x107646ea0>
db = <sqlite3.Connection object at 0x1082bc310>
alias_pair = ('/private/var/folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-forrest/pytest-232/test_preserves_existing_descri...folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-forrest/pytest-232/test_preserves_existing_descri0/alias/doc.md')

    def test_preserves_existing_description_on_miss(self, db, alias_pair):
        """A result already carrying a description with no DB match keeps it."""
        resolved, _ = alias_pair
    
        results = BM25Searcher(db)._attach_contexts(
            [_result(resolved, description="Reranked context")],
        )
    
>       assert results[0].context_description == "Reranked context"
E       AssertionError: assert None == 'Reranked context'
E        +  where None = SearchResult(document_id='d1', title='T', path='/private/var/folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-for...collection_name='c', score=1.0, content=None, highlights=[], rank=1, scores={}, snippet=None, context_description=None).context_description

tests/unit/search/test_context_attach.py:113: AssertionError
=========================== short test summary info ============================
FAILED tests/unit/search/test_context_attach.py::TestAttachPathContextsRealSQL::test_attach_matches_symlink_alias_target
FAILED tests/unit/search/test_context_attach.py::TestAttachPathContextsRealSQL::test_unmatched_result_keeps_none
FAILED tests/unit/search/test_context_attach.py::TestAttachPathContextsRealSQL::test_preserves_existing_description_on_miss
3 failed, 1 passed in 0.04s
