---
id: m-5a73
status: closed
deps: []
links: []
created: 2026-01-24T23:01:02Z
type: task
priority: 3
assignee: chriskd
---
# Fix ty check failures

error[unresolved-import]: Module `memex.context` has no member `CONTEXT_FILENAME`
  --> tests/_archive/test_cli_context_extended.py:11:27
   |
 9 | from memex import core
10 | from memex.cli import cli
11 | from memex.context import CONTEXT_FILENAME, clear_context_cache
   |                           ^^^^^^^^^^^^^^^^
   |
info: rule `unresolved-import` is enabled by default

error[unknown-argument]: Argument `detected` does not match any known parameter of function `_output_status`
   --> tests/_archive/test_cli_status.py:494:17
    |
492 |                 kb_root=mock_kb_root,
493 |                 context=None,
494 |                 detected=None,
    |                 ^^^^^^^^^^^^^
495 |                 entries=mock_recent_entries,
496 |                 project_name=None,
    |
info: Function signature here
   --> src/memex/cli.py:485:5
    |
485 |   def _output_status(
    |  _____^
486 | |     kb_root: Path | None,
487 | |     context,  # KBContext | None
488 | |     entries: list[dict],
489 | |     project_name: str | None,
490 | | ) -> None:
    | |_________^
491 |       """Output the status display.
    |
info: rule `unknown-argument` is enabled by default

error[unknown-argument]: Argument `detected` does not match any known parameter of function `_output_status`
   --> tests/_archive/test_cli_status.py:522:17
    |
520 |                 kb_root=None,
521 |                 context=None,
522 |                 detected=None,
    |                 ^^^^^^^^^^^^^
523 |                 entries=[],
524 |                 project_name=None,
    |
info: Function signature here
   --> src/memex/cli.py:485:5
    |
485 |   def _output_status(
    |  _____^
486 | |     kb_root: Path | None,
487 | |     context,  # KBContext | None
488 | |     entries: list[dict],
489 | |     project_name: str | None,
490 | | ) -> None:
    | |_________^
491 |       """Output the status display.
    |
info: rule `unknown-argument` is enabled by default

error[unknown-argument]: Argument `detected` does not match any known parameter of function `_output_status`
   --> tests/_archive/test_cli_status.py:548:17
    |
546 |                 kb_root=mock_kb_root,
547 |                 context=None,
548 |                 detected=None,
    |                 ^^^^^^^^^^^^^
549 |                 entries=mock_recent_entries,
550 |                 project_name="myproject",
    |
info: Function signature here
   --> src/memex/cli.py:485:5
    |
485 |   def _output_status(
    |  _____^
486 | |     kb_root: Path | None,
487 | |     context,  # KBContext | None
488 | |     entries: list[dict],
489 | |     project_name: str | None,
490 | | ) -> None:
    | |_________^
491 |       """Output the status display.
    |
info: rule `unknown-argument` is enabled by default

error[unresolved-import]: Module `memex.context` has no member `CONTEXT_FILENAME`
  --> tests/_archive/test_context.py:9:5
   |
 8 | from memex.context import (
 9 |     CONTEXT_FILENAME,
   |     ^^^^^^^^^^^^^^^^
10 |     LOCAL_KB_CONFIG_FILENAME,
11 |     KBConfig,
   |
info: rule `unresolved-import` is enabled by default

error[unresolved-import]: Module `memex.context` has no member `create_default_context`
  --> tests/_archive/test_context.py:15:5
   |
13 |     clear_context_cache,
14 |     clear_kbconfig_cache,
15 |     create_default_context,
   |     ^^^^^^^^^^^^^^^^^^^^^^
16 |     discover_kb_context,
17 |     get_kb_context,
   |
info: rule `unresolved-import` is enabled by default

error[possibly-missing-attribute]: Attribute `default_tags` may be missing on object of type `KBConfig | None`
   --> tests/_archive/test_context.py:481:16
    |
480 |         config1 = get_kbconfig(tmp_path)
481 |         assert config1.default_tags == ["original"]
    |                ^^^^^^^^^^^^^^^^^^^^
482 |
483 |         # Modify and clear cache
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `default_tags` may be missing on object of type `KBConfig | None`
   --> tests/_archive/test_context.py:488:16
    |
487 |         config2 = get_kbconfig(tmp_path)
488 |         assert config2.default_tags == ["updated"]
    |                ^^^^^^^^^^^^^^^^^^^^
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[invalid-argument-type]: Argument to function `detect_potential_duplicates` is incorrect
   --> tests/_archive/test_core_coverage_edges.py:133:9
    |
131 |         title="Title",
132 |         content="Content",
133 |         searcher=FailingSearcher(),
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `HybridSearcher`, found `FailingSearcher`
134 |     )
    |
info: Function defined here
    --> src/memex/core.py:1079:5
     |
1079 | def detect_potential_duplicates(
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1080 |     title: str,
1081 |     content: str,
1082 |     searcher: HybridSearcher,
     |     ------------------------ Parameter declared here
1083 |     min_score: float = DUPLICATE_DETECTION_MIN_SCORE,
1084 |     limit: int = DUPLICATE_DETECTION_LIMIT,
     |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument to function `detect_potential_duplicates` is incorrect
   --> tests/_archive/test_core_restored.py:120:13
    |
118 |             title="New Unique Entry",
119 |             content="This is completely unique content.",
120 |             searcher=searcher,
    |             ^^^^^^^^^^^^^^^^^ Expected `HybridSearcher`, found `DummySearcher`
121 |         )
122 |         assert result == []
    |
info: Function defined here
    --> src/memex/core.py:1079:5
     |
1079 | def detect_potential_duplicates(
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1080 |     title: str,
1081 |     content: str,
1082 |     searcher: HybridSearcher,
     |     ------------------------ Parameter declared here
1083 |     min_score: float = DUPLICATE_DETECTION_MIN_SCORE,
1084 |     limit: int = DUPLICATE_DETECTION_LIMIT,
     |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument to function `detect_potential_duplicates` is incorrect
   --> tests/_archive/test_core_restored.py:140:13
    |
138 |             title="Python Basics",
139 |             content="Introduction to Python programming language.",
140 |             searcher=searcher,
    |             ^^^^^^^^^^^^^^^^^ Expected `HybridSearcher`, found `DummySearcher`
141 |         )
142 |         assert len(result) == 1
    |
info: Function defined here
    --> src/memex/core.py:1079:5
     |
1079 | def detect_potential_duplicates(
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1080 |     title: str,
1081 |     content: str,
1082 |     searcher: HybridSearcher,
     |     ------------------------ Parameter declared here
1083 |     min_score: float = DUPLICATE_DETECTION_MIN_SCORE,
1084 |     limit: int = DUPLICATE_DETECTION_LIMIT,
     |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument to function `detect_potential_duplicates` is incorrect
   --> tests/_archive/test_core_restored.py:162:13
    |
160 |             title="Python Getting Started Guide",
161 |             content="Getting started with Python programming. Learn the basics.",
162 |             searcher=searcher,
    |             ^^^^^^^^^^^^^^^^^ Expected `HybridSearcher`, found `DummySearcher`
163 |         )
164 |         assert len(result) == 1
    |
info: Function defined here
    --> src/memex/core.py:1079:5
     |
1079 | def detect_potential_duplicates(
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1080 |     title: str,
1081 |     content: str,
1082 |     searcher: HybridSearcher,
     |     ------------------------ Parameter declared here
1083 |     min_score: float = DUPLICATE_DETECTION_MIN_SCORE,
1084 |     limit: int = DUPLICATE_DETECTION_LIMIT,
     |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument to function `detect_potential_duplicates` is incorrect
   --> tests/_archive/test_core_restored.py:191:13
    |
189 |             title="Similar Entry",
190 |             content="Very similar content.",
191 |             searcher=searcher,
    |             ^^^^^^^^^^^^^^^^^ Expected `HybridSearcher`, found `DummySearcher`
192 |         )
193 |         assert len(result) == 1
    |
info: Function defined here
    --> src/memex/core.py:1079:5
     |
1079 | def detect_potential_duplicates(
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1080 |     title: str,
1081 |     content: str,
1082 |     searcher: HybridSearcher,
     |     ------------------------ Parameter declared here
1083 |     min_score: float = DUPLICATE_DETECTION_MIN_SCORE,
1084 |     limit: int = DUPLICATE_DETECTION_LIMIT,
     |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument to function `detect_potential_duplicates` is incorrect
   --> tests/_archive/test_core_restored.py:200:13
    |
198 |             title="Similar Entry",
199 |             content="Very similar content.",
200 |             searcher=searcher,
    |             ^^^^^^^^^^^^^^^^^ Expected `HybridSearcher`, found `DummySearcher`
201 |             min_score=0.95,
202 |         )
    |
info: Function defined here
    --> src/memex/core.py:1079:5
     |
1079 | def detect_potential_duplicates(
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1080 |     title: str,
1081 |     content: str,
1082 |     searcher: HybridSearcher,
     |     ------------------------ Parameter declared here
1083 |     min_score: float = DUPLICATE_DETECTION_MIN_SCORE,
1084 |     limit: int = DUPLICATE_DETECTION_LIMIT,
     |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument to function `detect_potential_duplicates` is incorrect
   --> tests/_archive/test_core_restored.py:222:13
    |
220 |             title="Similar Entry",
221 |             content="Content.",
222 |             searcher=searcher,
    |             ^^^^^^^^^^^^^^^^^ Expected `HybridSearcher`, found `DummySearcher`
223 |             limit=3,
224 |         )
    |
info: Function defined here
    --> src/memex/core.py:1079:5
     |
1079 | def detect_potential_duplicates(
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1080 |     title: str,
1081 |     content: str,
1082 |     searcher: HybridSearcher,
     |     ------------------------ Parameter declared here
1083 |     min_score: float = DUPLICATE_DETECTION_MIN_SCORE,
1084 |     limit: int = DUPLICATE_DETECTION_LIMIT,
     |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument to function `detect_potential_duplicates` is incorrect
   --> tests/_archive/test_core_restored.py:234:13
    |
232 |             title="New Entry",
233 |             content="New content for empty KB.",
234 |             searcher=searcher,
    |             ^^^^^^^^^^^^^^^^^ Expected `HybridSearcher`, found `DummySearcher`
235 |         )
236 |         assert result == []
    |
info: Function defined here
    --> src/memex/core.py:1079:5
     |
1079 | def detect_potential_duplicates(
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1080 |     title: str,
1081 |     content: str,
1082 |     searcher: HybridSearcher,
     |     ------------------------ Parameter declared here
1083 |     min_score: float = DUPLICATE_DETECTION_MIN_SCORE,
1084 |     limit: int = DUPLICATE_DETECTION_LIMIT,
     |
info: rule `invalid-argument-type` is enabled by default

error[unresolved-import]: Module `memex` has no member `server`
 --> tests/_archive/test_directory_tools.py:9:25
  |
7 | import pytest
8 |
9 | from memex import core, server
  |                         ^^^^^^
  |
info: rule `unresolved-import` is enabled by default

error[invalid-argument-type]: Argument is incorrect
  --> tests/_archive/test_hybrid_search.py:47:17
   |
45 |                 title="Neural Networks Basics",
46 |                 tags=["neural-networks", "ai", "deep-learning"],
47 |                 created=date(2024, 1, 1),
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
48 |                 source_project="ai-docs",
49 |             ),
   |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
  --> tests/_archive/test_hybrid_search.py:59:17
   |
57 |                 title="Transformers",
58 |                 tags=["transformers", "nlp"],
59 |                 created=date(2024, 1, 2),
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
60 |                 source_project="ai-docs",
61 |             ),
   |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
  --> tests/_archive/test_hybrid_search.py:71:17
   |
69 |                 title="Python Guide",
70 |                 tags=["python", "programming"],
71 |                 created=date(2024, 1, 3),
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
72 |                 source_project="dev-docs",
73 |             ),
   |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:276:21
    |
274 |                     title="Python Keyword Match",
275 |                     tags=["python"],
276 |                     created=date(2024, 1, 1),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
277 |                 ),
278 |             ),
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:286:21
    |
284 |                     title="Programming Language",
285 |                     tags=["coding"],
286 |                     created=date(2024, 1, 2),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
287 |                 ),
288 |             ),
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:313:17
    |
311 |                 title="ML Algorithms",
312 |                 tags=["machine-learning"],
313 |                 created=date(2024, 1, 1),
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
314 |             ),
315 |         )
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:348:21
    |
346 |                     title="Multi-section Doc",
347 |                     tags=["test"],
348 |                     created=date(2024, 1, 1),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
349 |                 ),
350 |             ),
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:358:21
    |
356 |                     title="Multi-section Doc",
357 |                     tags=["test"],
358 |                     created=date(2024, 1, 1),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
359 |                 ),
360 |             ),
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:380:21
    |
378 |                     title=f"Doc {i}",
379 |                     tags=["python"],
380 |                     created=date(2024, 1, i + 1),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
381 |                 ),
382 |             )
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:408:21
    |
406 |                     title="With Tag",
407 |                     tags=["python", "testing"],
408 |                     created=date(2024, 1, 1),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
409 |                 ),
410 |             ),
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:418:21
    |
416 |                     title="Without Tag",
417 |                     tags=["other"],
418 |                     created=date(2024, 1, 2),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
419 |                 ),
420 |             ),
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:489:17
    |
487 |                 title="Test",
488 |                 tags=["test"],
489 |                 created=date(2024, 1, 1),
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
490 |                 source_project="ai-docs",
491 |             ),
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:618:21
    |
616 |                     title=f"Doc {i}",
617 |                     tags=["python"],
618 |                     created=date(2024, 1, i + 1),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
619 |                 ),
620 |             )
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:649:21
    |
647 |                     title="Python Repeated",
648 |                     tags=["code"],
649 |                     created=date(2024, 1, 1),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
650 |                 ),
651 |             ),
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:659:21
    |
657 |                     title="Scripting Language",
658 |                     tags=["code"],
659 |                     created=date(2024, 1, 2),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
660 |                 ),
661 |             ),
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:713:25
    |
711 |                         title=f"Thread {thread_id} Doc {i}",
712 |                         tags=["concurrent", f"thread-{thread_id}"],
713 |                         created=date(2024, 1, 1),
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
714 |                     ),
715 |                 )
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:746:25
    |
744 |                         title=f"Batch {thread_id} Doc {i}",
745 |                         tags=["batch", f"batch-{thread_id}"],
746 |                         created=date(2024, 1, 1),
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
747 |                     ),
748 |                 )
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:778:21
    |
776 |                     title=f"Doc {i}",
777 |                     tags=["delete-test"],
778 |                     created=date(2024, 1, 1),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
779 |                 ),
780 |             )
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:815:21
    |
813 |                     title=f"Initial {i}",
814 |                     tags=["initial"],
815 |                     created=date(2024, 1, 1),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
816 |                 ),
817 |             )
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:834:29
    |
832 |                             title=f"New {thread_id}_{i}",
833 |                             tags=["new"],
834 |                             created=date(2024, 1, 1),
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
835 |                         ),
836 |                     )
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:886:29
    |
884 |                             title=f"Race {i}",
885 |                             tags=["race"],
886 |                             created=date(2024, 1, 1),
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
887 |                         ),
888 |                     )
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-assignment]: Object of type `def tracked_index_document(chunk) -> Unknown` is not assignable to attribute `index_document` of type `def index_document(self, chunk: DocumentChunk) -> None`
   --> tests/_archive/test_hybrid_search.py:930:9
    |
928 |             return original_index_document(chunk)
929 |
930 |         searcher.index_document = tracked_index_document
    |         ^^^^^^^^^^^^^^^^^^^^^^^
931 |
932 |         def index_worker(thread_id: int) -> None:
    |
info: Implicit shadowing of function `index_document`, add an annotation to make it explicit if this is intentional
info: rule `invalid-assignment` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:941:25
    |
939 |                         title=f"Lock Test {thread_id}_{i}",
940 |                         tags=["lock-test"],
941 |                         created=date(2024, 1, 1),
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
942 |                     ),
943 |                 )
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_hybrid_search.py:992:21
    |
990 |                     title="ValueError Handling Guide",
991 |                     tags=["python", "errors", "exceptions"],
992 |                     created=date(2024, 1, 1),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
993 |                 ),
994 |                 token_count=30,
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
    --> tests/_archive/test_hybrid_search.py:1006:21
     |
1004 |                     title="Application Deployment Patterns",
1005 |                     tags=["devops", "deployment"],
1006 |                     created=date(2024, 1, 2),
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
1007 |                 ),
1008 |                 token_count=40,
     |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
    --> tests/_archive/test_hybrid_search.py:1019:21
     |
1017 |                     title="Docker Introduction",
1018 |                     tags=["docker", "containers"],
1019 |                     created=date(2024, 1, 3),
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
1020 |                 ),
1021 |                 token_count=20,
     |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
    --> tests/_archive/test_hybrid_search.py:1033:21
     |
1031 |                     title="Data Persistence Architecture",
1032 |                     tags=["architecture", "data"],
1033 |                     created=date(2024, 1, 4),
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
1034 |                 ),
1035 |                 token_count=30,
     |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
    --> tests/_archive/test_hybrid_search.py:1047:21
     |
1045 |                     title="Python Best Practices",
1046 |                     tags=["python", "best-practices"],
1047 |                     created=date(2024, 1, 5),
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
1048 |                 ),
1049 |                 token_count=35,
     |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
    --> tests/_archive/test_hybrid_search.py:1060:21
     |
1058 |                     title="Project Dependencies",
1059 |                     tags=["dependencies", "setup"],
1060 |                     created=date(2024, 1, 6),
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
1061 |                 ),
1062 |                 token_count=25,
     |
info: rule `invalid-argument-type` is enabled by default

error[unresolved-import]: Module `memex` has no member `server`
 --> tests/_archive/test_listing_tools.py:8:25
  |
6 | import pytest
7 |
8 | from memex import core, server
  |                         ^^^^^^
  |
info: rule `unresolved-import` is enabled by default

error[unresolved-import]: Cannot resolve imported module `memex.webapp.events`
 --> tests/_archive/test_live_reload.py:7:6
  |
5 | import pytest
6 |
7 | from memex.webapp.events import Event, EventBroadcaster, EventType, get_broadcaster
  |      ^^^^^^^^^^^^^^^^^^^
  |
info: Searched in the following paths during module resolution:
info:   1. /srv/fast/code/memex/src (first-party code)
info:   2. /srv/fast/code/memex (first-party code)
info:   3. vendored://stdlib (stdlib typeshed stubs vendored by ty)
info:   4. /srv/fast/code/memex/.venv/lib/python3.11/site-packages (site-packages)
info:   5. /srv/fast/code/memex/.venv/lib64/python3.11/site-packages (site-packages)
info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment
info: rule `unresolved-import` is enabled by default

error[possibly-missing-attribute]: Attribute `_fmt` may be missing on object of type `Formatter | None`
   --> tests/_archive/test_logging.py:100:16
    |
 98 |         handler = logger.handlers[0]
 99 |         # Check format string contains expected parts
100 |         assert handler.formatter._fmt == "[%(levelname)s] %(name)s: %(message)s"
    |                ^^^^^^^^^^^^^^^^^^^^^^
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[invalid-assignment]: Object of type `(x) -> Unknown` is not assignable to attribute `_resolve_link` of type `def _resolve_link(self, target: str) -> str | None`
  --> tests/_archive/test_publisher.py:91:9
   |
90 |         # Mock the _resolve_link to return None (broken)
91 |         renderer._resolve_link = lambda x: None
   |         ^^^^^^^^^^^^^^^^^^^^^^
92 |
93 |         # Create mock token
   |
info: Implicit shadowing of function `_resolve_link`, add an annotation to make it explicit if this is intentional
info: rule `invalid-assignment` is enabled by default

error[unresolved-import]: Module `memex` has no member `server`
 --> tests/_archive/test_search_content.py:8:25
  |
6 | import pytest
7 |
8 | from memex import core, server
  |                         ^^^^^^
9 | from memex.models import SearchResponse
  |
info: rule `unresolved-import` is enabled by default

error[possibly-missing-attribute]: Attribute `query` may be missing on object of type `SearchHistoryEntry | None`
   --> tests/_archive/test_search_history.py:186:16
    |
185 |         # 1 = most recent
186 |         assert get_by_index(1, index_root).query == "third"
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
187 |         assert get_by_index(2, index_root).query == "second"
188 |         assert get_by_index(3, index_root).query == "first"
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `query` may be missing on object of type `SearchHistoryEntry | None`
   --> tests/_archive/test_search_history.py:187:16
    |
185 |         # 1 = most recent
186 |         assert get_by_index(1, index_root).query == "third"
187 |         assert get_by_index(2, index_root).query == "second"
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
188 |         assert get_by_index(3, index_root).query == "first"
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `query` may be missing on object of type `SearchHistoryEntry | None`
   --> tests/_archive/test_search_history.py:188:16
    |
186 |         assert get_by_index(1, index_root).query == "third"
187 |         assert get_by_index(2, index_root).query == "second"
188 |         assert get_by_index(3, index_root).query == "first"
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
189 |
190 |     def test_get_by_index_zero_returns_none(self, index_root):
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[invalid-argument-type]: Argument is incorrect
  --> tests/_archive/test_semantic_similarity.py:39:13
   |
37 |             title=title,
38 |             tags=tags or ["test"],
39 |             created=date(2024, 1, 1),
   |             ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
40 |         ),
41 |     )
   |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument to bound method `__init__` is incorrect
  --> tests/_archive/test_session.py:62:20
   |
60 |         """Session tags returned when CLI tags empty."""
61 |         ctx = SessionContext(tags=["a", "b"])
62 |         assert set(ctx.merge_tags(None)) == {"a", "b"}
   |                    ^^^^^^^^^^^^^^^^^^^^ Expected `Iterable[str]`, found `list[str] | None`
63 |
64 |     def test_merge_tags_cli_only(self):
   |
info: Element `None` of this union is not assignable to `Iterable[str]`
info: Matching overload defined here
    --> stdlib/builtins.pyi:3083:9
     |
3081 |     def __init__(self) -> None: ...
3082 |     @overload
3083 |     def __init__(self, iterable: Iterable[_T], /) -> None: ...
     |         ^^^^^^^^       ---------------------- Parameter declared here
3084 |     def add(self, element: _T, /) -> None:
3085 |         """Add an element to a set.
     |
info: Non-matching overloads for bound method `__init__`:
info:   (self) -> None
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument to bound method `__init__` is incorrect
  --> tests/_archive/test_session.py:67:20
   |
65 |         """CLI tags returned when session tags empty."""
66 |         ctx = SessionContext()
67 |         assert set(ctx.merge_tags(["x", "y"])) == {"x", "y"}
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `Iterable[str]`, found `list[str] | None`
68 |
69 |     def test_merge_tags_union(self):
   |
info: Element `None` of this union is not assignable to `Iterable[str]`
info: Matching overload defined here
    --> stdlib/builtins.pyi:3083:9
     |
3081 |     def __init__(self) -> None: ...
3082 |     @overload
3083 |     def __init__(self, iterable: Iterable[_T], /) -> None: ...
     |         ^^^^^^^^       ---------------------- Parameter declared here
3084 |     def add(self, element: _T, /) -> None:
3085 |         """Add an element to a set.
     |
info: Non-matching overloads for bound method `__init__`:
info:   (self) -> None
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument to bound method `__init__` is incorrect
  --> tests/_archive/test_session.py:72:20
   |
70 |         """Tags are merged as union."""
71 |         ctx = SessionContext(tags=["a", "b"])
72 |         assert set(ctx.merge_tags(["b", "c"])) == {"a", "b", "c"}
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `Iterable[str]`, found `list[str] | None`
73 |
74 |     def test_merge_tags_empty_list(self):
   |
info: Element `None` of this union is not assignable to `Iterable[str]`
info: Matching overload defined here
    --> stdlib/builtins.pyi:3083:9
     |
3081 |     def __init__(self) -> None: ...
3082 |     @overload
3083 |     def __init__(self, iterable: Iterable[_T], /) -> None: ...
     |         ^^^^^^^^       ---------------------- Parameter declared here
3084 |     def add(self, element: _T, /) -> None:
3085 |         """Add an element to a set.
     |
info: Non-matching overloads for bound method `__init__`:
info:   (self) -> None
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument to bound method `__init__` is incorrect
  --> tests/_archive/test_session.py:78:20
   |
76 |         ctx = SessionContext(tags=["a"])
77 |         result = ctx.merge_tags([])
78 |         assert set(result) == {"a"}
   |                    ^^^^^^ Expected `Iterable[str]`, found `list[str] | None`
79 |
80 |     def test_to_dict(self):
   |
info: Element `None` of this union is not assignable to `Iterable[str]`
info: Matching overload defined here
    --> stdlib/builtins.pyi:3083:9
     |
3081 |     def __init__(self) -> None: ...
3082 |     @overload
3083 |     def __init__(self, iterable: Iterable[_T], /) -> None: ...
     |         ^^^^^^^^       ---------------------- Parameter declared here
3084 |     def add(self, element: _T, /) -> None:
3085 |         """Add an element to a set.
     |
info: Non-matching overloads for bound method `__init__`:
info:   (self) -> None
info: rule `invalid-argument-type` is enabled by default

error[invalid-assignment]: Cannot assign to read-only property `title_to_path` on object of type `TitleIndex`
   --> tests/_archive/test_title_index.py:135:13
    |
133 |         index = TitleIndex(title_to_path={}, filename_to_paths={})
134 |         with pytest.raises(AttributeError):
135 |             index.title_to_path = {"new": "value"}
    |             ^^^^^^^^^^^^^^^^^^^
    |
info: rule `invalid-assignment` is enabled by default

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:174:36
    |
172 |         index = build_title_index(kb_root)
173 |
174 |         assert "my entry title" in index.title_to_path
    |                                    ^^^^^^^^^^^^^^^^^^^
175 |         assert index.title_to_path["my entry title"] == "my-entry"
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:175:16
    |
174 |         assert "my entry title" in index.title_to_path
175 |         assert index.title_to_path["my entry title"] == "my-entry"
    |                ^^^^^^^^^^^^^^^^^^^
176 |
177 |     def test_title_case_insensitive(self, kb_root):
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:183:37
    |
181 |         index = build_title_index(kb_root)
182 |
183 |         assert "uppercase title" in index.title_to_path
    |                                     ^^^^^^^^^^^^^^^^^^^
184 |         assert "UPPERCASE TITLE" not in index.title_to_path
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:184:41
    |
183 |         assert "uppercase title" in index.title_to_path
184 |         assert "UPPERCASE TITLE" not in index.title_to_path
    |                                         ^^^^^^^^^^^^^^^^^^^
185 |
186 |     def test_entry_with_aliases(self, kb_root):
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:198:32
    |
196 |         index = build_title_index(kb_root)
197 |
198 |         assert "main title" in index.title_to_path
    |                                ^^^^^^^^^^^^^^^^^^^
199 |         assert "alias one" in index.title_to_path
200 |         assert "alias two" in index.title_to_path
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:199:31
    |
198 |         assert "main title" in index.title_to_path
199 |         assert "alias one" in index.title_to_path
    |                               ^^^^^^^^^^^^^^^^^^^
200 |         assert "alias two" in index.title_to_path
201 |         # All point to the same path
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:200:31
    |
198 |         assert "main title" in index.title_to_path
199 |         assert "alias one" in index.title_to_path
200 |         assert "alias two" in index.title_to_path
    |                               ^^^^^^^^^^^^^^^^^^^
201 |         # All point to the same path
202 |         assert index.title_to_path["alias one"] == "entry"
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:202:16
    |
200 |         assert "alias two" in index.title_to_path
201 |         # All point to the same path
202 |         assert index.title_to_path["alias one"] == "entry"
    |                ^^^^^^^^^^^^^^^^^^^
203 |         assert index.title_to_path["alias two"] == "entry"
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:203:16
    |
201 |         # All point to the same path
202 |         assert index.title_to_path["alias one"] == "entry"
203 |         assert index.title_to_path["alias two"] == "entry"
    |                ^^^^^^^^^^^^^^^^^^^
204 |
205 |     def test_nested_directory_paths(self, kb_root):
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:213:34
    |
211 |         index = build_title_index(kb_root)
212 |
213 |         assert "alpha readme" in index.title_to_path
    |                                  ^^^^^^^^^^^^^^^^^^^
214 |         assert index.title_to_path["alpha readme"] == "projects/alpha/readme"
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:214:16
    |
213 |         assert "alpha readme" in index.title_to_path
214 |         assert index.title_to_path["alpha readme"] == "projects/alpha/readme"
    |                ^^^^^^^^^^^^^^^^^^^
215 |
216 |     def test_filename_index_populated(self, kb_root):
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `filename_to_paths` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:224:27
    |
223 |         # "guide" (lowercase) should map to both paths
224 |         assert "guide" in index.filename_to_paths
    |                           ^^^^^^^^^^^^^^^^^^^^^^^
225 |         paths = index.filename_to_paths["guide"]
226 |         assert "docs/guide" in paths
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `filename_to_paths` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:225:17
    |
223 |         # "guide" (lowercase) should map to both paths
224 |         assert "guide" in index.filename_to_paths
225 |         paths = index.filename_to_paths["guide"]
    |                 ^^^^^^^^^^^^^^^^^^^^^^^
226 |         assert "docs/guide" in paths
227 |         assert "projects/guide" in paths
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:236:34
    |
234 |         index = build_title_index(kb_root)
235 |
236 |         assert "template" not in index.title_to_path
    |                                  ^^^^^^^^^^^^^^^^^^^
237 |         assert "normal" in index.title_to_path
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:237:28
    |
236 |         assert "template" not in index.title_to_path
237 |         assert "normal" in index.title_to_path
    |                            ^^^^^^^^^^^^^^^^^^^
238 |
239 |     def test_files_without_frontmatter_skipped(self, kb_root):
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `filename_to_paths` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:246:40
    |
245 |         # Files without metadata are completely skipped (no title, no filename index)
246 |         assert "no-frontmatter" not in index.filename_to_paths
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^
247 |         assert len(index.title_to_path) == 0
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:247:20
    |
245 |         # Files without metadata are completely skipped (no title, no filename index)
246 |         assert "no-frontmatter" not in index.filename_to_paths
247 |         assert len(index.title_to_path) == 0
    |                    ^^^^^^^^^^^^^^^^^^^
248 |
249 |     def test_files_with_empty_frontmatter_skipped(self, kb_root):
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:256:20
    |
255 |         # Empty metadata dict, so no title indexed
256 |         assert len(index.title_to_path) == 0
    |                    ^^^^^^^^^^^^^^^^^^^
257 |
258 |     def test_first_title_wins(self, kb_root):
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:266:37
    |
265 |         # Due to rglob ordering, we just verify one is indexed
266 |         assert "duplicate title" in index.title_to_path
    |                                     ^^^^^^^^^^^^^^^^^^^
267 |         # The path should be one of the two
268 |         path = index.title_to_path["duplicate title"]
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:268:16
    |
266 |         assert "duplicate title" in index.title_to_path
267 |         # The path should be one of the two
268 |         path = index.title_to_path["duplicate title"]
    |                ^^^^^^^^^^^^^^^^^^^
269 |         assert path in ("first", "second")
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:287:34
    |
285 |         index = build_title_index(kb_root)
286 |
287 |         assert "padded title" in index.title_to_path
    |                                  ^^^^^^^^^^^^^^^^^^^
288 |
289 |     def test_malformed_file_skipped(self, kb_root):
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:300:32
    |
299 |         # Good entry should still be indexed
300 |         assert "good entry" in index.title_to_path
    |                                ^^^^^^^^^^^^^^^^^^^
301 |
302 |     def test_non_list_aliases_handled(self, kb_root):
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:316:27
    |
315 |         # Should not crash, title should still be indexed
316 |         assert "entry" in index.title_to_path
    |                           ^^^^^^^^^^^^^^^^^^^
317 |
318 |     def test_empty_alias_skipped(self, kb_root):
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:326:26
    |
324 |         index = build_title_index(kb_root)
325 |
326 |         assert "" not in index.title_to_path
    |                          ^^^^^^^^^^^^^^^^^^^
327 |         assert "valid alias" in index.title_to_path
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:327:33
    |
326 |         assert "" not in index.title_to_path
327 |         assert "valid alias" in index.title_to_path
    |                                 ^^^^^^^^^^^^^^^^^^^
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:650:34
    |
648 |         # Attempting to modify the underlying dicts is possible but
649 |         # doesn't affect the NamedTuple's immutability guarantee
650 |         original_title_to_path = index.title_to_path.copy()
    |                                  ^^^^^^^^^^^^^^^^^^^
651 |
652 |         # Direct field reassignment should fail
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[invalid-assignment]: Object of type `dict[Unknown, Unknown]` is not assignable to attribute `title_to_path` on type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:654:13
    |
652 |         # Direct field reassignment should fail
653 |         with pytest.raises(AttributeError):
654 |             index.title_to_path = {}
    |             ^^^^^^^^^^^^^^^^^^^
655 |
656 |         # Original data unchanged
    |
info: rule `invalid-assignment` is enabled by default

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:657:16
    |
656 |         # Original data unchanged
657 |         assert index.title_to_path == original_title_to_path
    |                ^^^^^^^^^^^^^^^^^^^
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:688:20
    |
686 |         assert elapsed < 30.0
687 |         # Verify all entries indexed
688 |         assert len(index.title_to_path) == 2000  # titles + aliases
    |                    ^^^^^^^^^^^^^^^^^^^
689 |
690 |     def test_o1_lookup_performance(self, kb_root):
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `filename_to_paths` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:726:27
    |
725 |         # All 100 paths should be in the filename index under "guide"
726 |         assert "guide" in index.filename_to_paths
    |                           ^^^^^^^^^^^^^^^^^^^^^^^
727 |         assert len(index.filename_to_paths["guide"]) == 100
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `filename_to_paths` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/_archive/test_title_index.py:727:20
    |
725 |         # All 100 paths should be in the filename index under "guide"
726 |         assert "guide" in index.filename_to_paths
727 |         assert len(index.filename_to_paths["guide"]) == 100
    |                    ^^^^^^^^^^^^^^^^^^^^^^^
728 |
729 |         # Lookup should be fast (O(1))
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[unsupported-operator]: Unsupported `>=` operation
  --> tests/_archive/test_views_tracker.py:92:16
   |
90 |         second_view = load_views(index_root)["dev/test.md"].last_viewed
91 |
92 |         assert second_view >= first_view
   |                -----------^^^^----------
   |                |
   |                Both operands have type `datetime | None`
93 |
94 |     def test_record_view_buckets_by_day(self, index_root):
   |
info: Operation fails because operator `>=` is not supported between objects of type `datetime` and `None`
info: rule `unsupported-operator` is enabled by default

error[invalid-argument-type]: Argument is incorrect
  --> tests/_archive/test_watcher.py:74:17
   |
72 |                 title="Test Doc",
73 |                 tags=["python"],
74 |                 created=date(2024, 1, 1),
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
75 |             ),
76 |             token_count=5,
   |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
  --> tests/_archive/test_watcher.py:91:17
   |
89 |                 title="Test Doc Updated",
90 |                 tags=["rust"],
91 |                 created=date(2024, 1, 1),
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
92 |                 updated=date(2024, 1, 15),
93 |             ),
   |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
  --> tests/_archive/test_watcher.py:92:17
   |
90 |                 tags=["rust"],
91 |                 created=date(2024, 1, 1),
92 |                 updated=date(2024, 1, 15),
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime | None`, found `date`
93 |             ),
94 |             token_count=6,
   |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_watcher.py:123:21
    |
121 |                     title="Multi Doc",
122 |                     tags=["test"],
123 |                     created=date(2024, 1, 1),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
124 |                 ),
125 |             ),
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_watcher.py:133:21
    |
131 |                     title="Multi Doc",
132 |                     tags=["test"],
133 |                     created=date(2024, 1, 1),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
134 |                 ),
135 |             ),
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
   --> tests/_archive/test_watcher.py:150:17
    |
148 |                 title="Multi Doc",
149 |                 tags=["test", "updated"],
150 |                 created=date(2024, 1, 1),
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^ Expected `datetime`, found `date`
151 |             ),
152 |         )
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-assignment]: Object of type `MagicMock` is not assignable to attribute `_schedule_callback` of type `def _schedule_callback(self) -> None`
   --> tests/_archive/test_watcher.py:272:9
    |
270 |         callback = MagicMock()
271 |         handler = DebouncedHandler(callback=callback, debounce_seconds=0.1)
272 |         handler._schedule_callback = MagicMock()
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
273 |
274 |         directory_event = SimpleNamespace(src_path="/tmp/dir", is_directory=True)
    |
info: Implicit shadowing of function `_schedule_callback`, add an annotation to make it explicit if this is intentional
info: rule `invalid-assignment` is enabled by default

error[invalid-argument-type]: Argument to bound method `on_created` is incorrect
   --> tests/_archive/test_watcher.py:275:28
    |
274 |         directory_event = SimpleNamespace(src_path="/tmp/dir", is_directory=True)
275 |         handler.on_created(directory_event)
    |                            ^^^^^^^^^^^^^^^ Expected `FileSystemEvent`, found `SimpleNamespace`
276 |
277 |         text_event = SimpleNamespace(src_path="/tmp/file.txt", is_directory=False)
    |
info: Method defined here
   --> src/memex/indexer/watcher.py:112:9
    |
110 |         self._schedule_callback()
111 |
112 |     def on_created(self, event: FileSystemEvent) -> None:
    |         ^^^^^^^^^^       ---------------------- Parameter declared here
113 |         """Handle file creation."""
114 |         self._handle_event(event)
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument to bound method `on_modified` is incorrect
   --> tests/_archive/test_watcher.py:278:29
    |
277 |         text_event = SimpleNamespace(src_path="/tmp/file.txt", is_directory=False)
278 |         handler.on_modified(text_event)
    |                             ^^^^^^^^^^ Expected `FileSystemEvent`, found `SimpleNamespace`
279 |
280 |         assert handler._pending_files == set()
    |
info: Method defined here
   --> src/memex/indexer/watcher.py:116:9
    |
114 |         self._handle_event(event)
115 |
116 |     def on_modified(self, event: FileSystemEvent) -> None:
    |         ^^^^^^^^^^^       ---------------------- Parameter declared here
117 |         """Handle file modification."""
118 |         self._handle_event(event)
    |
info: rule `invalid-argument-type` is enabled by default

error[unresolved-attribute]: Object of type `bound method DebouncedHandler._schedule_callback() -> None` has no attribute `assert_not_called`
   --> tests/_archive/test_watcher.py:281:9
    |
280 |         assert handler._pending_files == set()
281 |         handler._schedule_callback.assert_not_called()
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
282 |
283 |     def test_adds_markdown_files_and_schedules_callback(self):
    |
info: rule `unresolved-attribute` is enabled by default

error[invalid-assignment]: Object of type `MagicMock` is not assignable to attribute `_schedule_callback` of type `def _schedule_callback(self) -> None`
   --> tests/_archive/test_watcher.py:287:9
    |
285 |         callback = MagicMock()
286 |         handler = DebouncedHandler(callback=callback, debounce_seconds=0.1)
287 |         handler._schedule_callback = MagicMock()
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
288 |
289 |         md_event = SimpleNamespace(src_path="/tmp/file.md", is_directory=False)
    |
info: Implicit shadowing of function `_schedule_callback`, add an annotation to make it explicit if this is intentional
info: rule `invalid-assignment` is enabled by default

error[invalid-argument-type]: Argument to bound method `on_created` is incorrect
   --> tests/_archive/test_watcher.py:290:28
    |
289 |         md_event = SimpleNamespace(src_path="/tmp/file.md", is_directory=False)
290 |         handler.on_created(md_event)
    |                            ^^^^^^^^ Expected `FileSystemEvent`, found `SimpleNamespace`
291 |
292 |         assert handler._pending_files == {Path("/tmp/file.md")}
    |
info: Method defined here
   --> src/memex/indexer/watcher.py:112:9
    |
110 |         self._schedule_callback()
111 |
112 |     def on_created(self, event: FileSystemEvent) -> None:
    |         ^^^^^^^^^^       ---------------------- Parameter declared here
113 |         """Handle file creation."""
114 |         self._handle_event(event)
    |
info: rule `invalid-argument-type` is enabled by default

error[unresolved-attribute]: Object of type `bound method DebouncedHandler._schedule_callback() -> None` has no attribute `assert_called_once`
   --> tests/_archive/test_watcher.py:293:9
    |
292 |         assert handler._pending_files == {Path("/tmp/file.md")}
293 |         handler._schedule_callback.assert_called_once()
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
294 |
295 |     def test_on_moved_tracks_src_and_dest(self):
    |
info: rule `unresolved-attribute` is enabled by default

error[invalid-assignment]: Object of type `MagicMock` is not assignable to attribute `_schedule_callback` of type `def _schedule_callback(self) -> None`
   --> tests/_archive/test_watcher.py:299:9
    |
297 |         callback = MagicMock()
298 |         handler = DebouncedHandler(callback=callback, debounce_seconds=0.1)
299 |         handler._schedule_callback = MagicMock()
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
300 |
301 |         move_event = SimpleNamespace(
    |
info: Implicit shadowing of function `_schedule_callback`, add an annotation to make it explicit if this is intentional
info: rule `invalid-assignment` is enabled by default

error[invalid-argument-type]: Argument to bound method `on_moved` is incorrect
   --> tests/_archive/test_watcher.py:306:26
    |
304 |             is_directory=False,
305 |         )
306 |         handler.on_moved(move_event)
    |                          ^^^^^^^^^^ Expected `FileSystemEvent`, found `SimpleNamespace`
307 |
308 |         assert handler._pending_files == {Path("/tmp/old.md"), Path("/tmp/new.md")}
    |
info: Method defined here
   --> src/memex/indexer/watcher.py:124:9
    |
122 |         self._handle_event(event)
123 |
124 |     def on_moved(self, event: FileSystemEvent) -> None:
    |         ^^^^^^^^       ---------------------- Parameter declared here
125 |         """Handle file move/rename."""
126 |         if event.is_directory:
    |
info: rule `invalid-argument-type` is enabled by default

error[unresolved-attribute]: Object of type `bound method DebouncedHandler._schedule_callback() -> None` has no attribute `assert_called_once`
   --> tests/_archive/test_watcher.py:309:9
    |
308 |         assert handler._pending_files == {Path("/tmp/old.md"), Path("/tmp/new.md")}
309 |         handler._schedule_callback.assert_called_once()
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
310 |
311 |     def test_debounce_batches_events_and_cancels_previous_timer(self, monkeypatch):
    |
info: rule `unresolved-attribute` is enabled by default

error[invalid-argument-type]: Argument to bound method `on_created` is incorrect
   --> tests/_archive/test_watcher.py:342:28
    |
340 |         monkeypatch.setattr(threading, "Timer", fake_timer)
341 |
342 |         handler.on_created(SimpleNamespace(src_path="/tmp/a.md", is_directory=False))
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `FileSystemEvent`, found `SimpleNamespace`
343 |         handler.on_modified(SimpleNamespace(src_path="/tmp/b.md", is_directory=False))
    |
info: Method defined here
   --> src/memex/indexer/watcher.py:112:9
    |
110 |         self._schedule_callback()
111 |
112 |     def on_created(self, event: FileSystemEvent) -> None:
    |         ^^^^^^^^^^       ---------------------- Parameter declared here
113 |         """Handle file creation."""
114 |         self._handle_event(event)
    |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument to bound method `on_modified` is incorrect
   --> tests/_archive/test_watcher.py:343:29
    |
342 |         handler.on_created(SimpleNamespace(src_path="/tmp/a.md", is_directory=False))
343 |         handler.on_modified(SimpleNamespace(src_path="/tmp/b.md", is_directory=False))
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `FileSystemEvent`, found `SimpleNamespace`
344 |
345 |         assert len(timers) == 2
    |
info: Method defined here
   --> src/memex/indexer/watcher.py:116:9
    |
114 |         self._handle_event(event)
115 |
116 |     def on_modified(self, event: FileSystemEvent) -> None:
    |         ^^^^^^^^^^^       ---------------------- Parameter declared here
117 |         """Handle file modification."""
118 |         self._handle_event(event)
    |
info: rule `invalid-argument-type` is enabled by default

error[unresolved-attribute]: Object of type `BaseObserver` has no attribute `scheduled`
   --> tests/_archive/test_watcher.py:413:36
    |
411 |         assert watcher._observer is not None
412 |         observer = watcher._observer
413 |         handler, path, recursive = observer.scheduled
    |                                    ^^^^^^^^^^^^^^^^^^
414 |         assert isinstance(handler, DebouncedHandler)
415 |         assert handler._debounce_seconds == 0.2
    |
info: rule `unresolved-attribute` is enabled by default

error[unresolved-attribute]: Object of type `BaseObserver` has no attribute `started`
   --> tests/_archive/test_watcher.py:418:16
    |
416 |         assert path == str(kb_root)
417 |         assert recursive is True
418 |         assert observer.started is True
    |                ^^^^^^^^^^^^^^^^
419 |
420 |         watcher.stop()
    |
info: rule `unresolved-attribute` is enabled by default

error[unresolved-import]: Cannot resolve imported module `memex.webapp.api`
  --> tests/_archive/test_webapp_api.py:9:6
   |
 7 | from fastapi.testclient import TestClient
 8 |
 9 | from memex.webapp.api import app
   |      ^^^^^^^^^^^^^^^^
10 |
11 | # =============================================================================
   |
info: Searched in the following paths during module resolution:
info:   1. /srv/fast/code/memex/src (first-party code)
info:   2. /srv/fast/code/memex (first-party code)
info:   3. vendored://stdlib (stdlib typeshed stubs vendored by ty)
info:   4. /srv/fast/code/memex/.venv/lib/python3.11/site-packages (site-packages)
info:   5. /srv/fast/code/memex/.venv/lib64/python3.11/site-packages (site-packages)
info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment
info: rule `unresolved-import` is enabled by default

error[unresolved-import]: Cannot resolve imported module `memex.webapp.api`
  --> tests/_archive/test_webapp_api.py:95:12
   |
93 |     """Create TestClient with mocked dependencies."""
94 |     # Reset the global searcher
95 |     import memex.webapp.api as api_module
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
96 |     api_module._searcher = mock_searcher
   |
info: Searched in the following paths during module resolution:
info:   1. /srv/fast/code/memex/src (first-party code)
info:   2. /srv/fast/code/memex (first-party code)
info:   3. vendored://stdlib (stdlib typeshed stubs vendored by ty)
info:   4. /srv/fast/code/memex/.venv/lib/python3.11/site-packages (site-packages)
info:   5. /srv/fast/code/memex/.venv/lib64/python3.11/site-packages (site-packages)
info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment
info: rule `unresolved-import` is enabled by default

error[unresolved-import]: Cannot resolve imported module `memex.webapp.api`
   --> tests/_archive/test_webapp_api.py:113:12
    |
111 | def client_no_lifespan(sample_kb, mock_searcher, monkeypatch):
112 |     """Create TestClient without lifespan events (faster for basic tests)."""
113 |     import memex.webapp.api as api_module
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
114 |     api_module._searcher = mock_searcher
    |
info: Searched in the following paths during module resolution:
info:   1. /srv/fast/code/memex/src (first-party code)
info:   2. /srv/fast/code/memex (first-party code)
info:   3. vendored://stdlib (stdlib typeshed stubs vendored by ty)
info:   4. /srv/fast/code/memex/.venv/lib/python3.11/site-packages (site-packages)
info:   5. /srv/fast/code/memex/.venv/lib64/python3.11/site-packages (site-packages)
info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment
info: rule `unresolved-import` is enabled by default

error[unresolved-import]: Cannot resolve imported module `memex.webapp.api`
   --> tests/_archive/test_webapp_api.py:572:16
    |
570 |         empty_kb.mkdir()
571 |
572 |         import memex.webapp.api as api_module
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
573 |         api_module._searcher = mock_searcher
574 |         monkeypatch.setenv("MEMEX_USER_KB_ROOT", str(empty_kb))
    |
info: Searched in the following paths during module resolution:
info:   1. /srv/fast/code/memex/src (first-party code)
info:   2. /srv/fast/code/memex (first-party code)
info:   3. vendored://stdlib (stdlib typeshed stubs vendored by ty)
info:   4. /srv/fast/code/memex/.venv/lib/python3.11/site-packages (site-packages)
info:   5. /srv/fast/code/memex/.venv/lib64/python3.11/site-packages (site-packages)
info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment
info: rule `unresolved-import` is enabled by default

error[unresolved-import]: Cannot resolve imported module `memex.webapp.api`
   --> tests/_archive/test_webapp_api.py:628:14
    |
626 |         # SSE endpoints are tricky to test with TestClient since they stream indefinitely.
627 |         # We verify the route exists by checking that it's in the app routes.
628 |         from memex.webapp.api import app
    |              ^^^^^^^^^^^^^^^^
629 |
630 |         routes = [r.path for r in app.routes]
    |
info: Searched in the following paths during module resolution:
info:   1. /srv/fast/code/memex/src (first-party code)
info:   2. /srv/fast/code/memex (first-party code)
info:   3. vendored://stdlib (stdlib typeshed stubs vendored by ty)
info:   4. /srv/fast/code/memex/.venv/lib/python3.11/site-packages (site-packages)
info:   5. /srv/fast/code/memex/.venv/lib64/python3.11/site-packages (site-packages)
info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment
info: rule `unresolved-import` is enabled by default

error[unresolved-import]: Cannot resolve imported module `memex.webapp.api`
   --> tests/_archive/test_webapp_api.py:674:16
    |
672 |     def test_get_searcher_reindexes_when_empty(self, sample_kb, monkeypatch):
673 |         """Searcher reindexes when indices are empty but KB has files."""
674 |         import memex.webapp.api as api_module
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
675 |
676 |         # Reset global searcher
    |
info: Searched in the following paths during module resolution:
info:   1. /srv/fast/code/memex/src (first-party code)
info:   2. /srv/fast/code/memex (first-party code)
info:   3. vendored://stdlib (stdlib typeshed stubs vendored by ty)
info:   4. /srv/fast/code/memex/.venv/lib/python3.11/site-packages (site-packages)
info:   5. /srv/fast/code/memex/.venv/lib64/python3.11/site-packages (site-packages)
info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment
info: rule `unresolved-import` is enabled by default

error[unresolved-import]: Cannot resolve imported module `memex.webapp.api`
   --> tests/_archive/test_webapp_api.py:745:18
    |
744 |         with patch("uvicorn.run") as mock_run:
745 |             from memex.webapp.api import main
    |                  ^^^^^^^^^^^^^^^^
746 |             main()
    |
info: Searched in the following paths during module resolution:
info:   1. /srv/fast/code/memex/src (first-party code)
info:   2. /srv/fast/code/memex (first-party code)
info:   3. vendored://stdlib (stdlib typeshed stubs vendored by ty)
info:   4. /srv/fast/code/memex/.venv/lib/python3.11/site-packages (site-packages)
info:   5. /srv/fast/code/memex/.venv/lib64/python3.11/site-packages (site-packages)
info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment
info: rule `unresolved-import` is enabled by default

error[unresolved-import]: Cannot resolve imported module `memex.webapp.api`
   --> tests/_archive/test_webapp_api.py:835:14
    |
833 |     def test_root_without_static_returns_json(self, client_no_lifespan):
834 |         """Root returns JSON when static files don't exist."""
835 |         from memex.webapp.api import static_dir
    |              ^^^^^^^^^^^^^^^^
836 |
837 |         # If static dir doesn't exist or index.html is missing,
    |
info: Searched in the following paths during module resolution:
info:   1. /srv/fast/code/memex/src (first-party code)
info:   2. /srv/fast/code/memex (first-party code)
info:   3. vendored://stdlib (stdlib typeshed stubs vendored by ty)
info:   4. /srv/fast/code/memex/.venv/lib/python3.11/site-packages (site-packages)
info:   5. /srv/fast/code/memex/.venv/lib64/python3.11/site-packages (site-packages)
info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment
info: rule `unresolved-import` is enabled by default

error[possibly-missing-attribute]: Attribute `title_to_path` may be missing on object of type `dict[str, str] | TitleIndex`
   --> tests/test_caches.py:441:16
    |
439 |         assert tags == {}
440 |         assert health == {}
441 |         assert title_idx.title_to_path == {}
    |                ^^^^^^^^^^^^^^^^^^^^^^^
442 |
443 |     def test_backlinks_match_forward_links(self, tmp_kb: Path, monkeypatch):
    |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[missing-argument]: No argument provided for required parameter `last_indexed`
  --> tests/test_core.py:85:16
   |
83 |     def status(self):
84 |         from memex.models import IndexStatus
85 |         return IndexStatus(whoosh_docs=0, chroma_docs=0, kb_files=0)
   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
info: rule `missing-argument` is enabled by default

error[invalid-argument-type]: Argument to function `detect_potential_duplicates` is incorrect
    --> tests/test_core.py:1033:13
     |
1031 |             title="Unique Entry",
1032 |             content="Unique content.",
1033 |             searcher=searcher,
     |             ^^^^^^^^^^^^^^^^^ Expected `HybridSearcher`, found `DummySearcher`
1034 |         )
     |
info: Function defined here
    --> src/memex/core.py:1079:5
     |
1079 | def detect_potential_duplicates(
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1080 |     title: str,
1081 |     content: str,
1082 |     searcher: HybridSearcher,
     |     ------------------------ Parameter declared here
1083 |     min_score: float = DUPLICATE_DETECTION_MIN_SCORE,
1084 |     limit: int = DUPLICATE_DETECTION_LIMIT,
     |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument to function `detect_potential_duplicates` is incorrect
    --> tests/test_core.py:1062:13
     |
1060 |             title="Similar Entry",
1061 |             content="Similar content.",
1062 |             searcher=searcher,
     |             ^^^^^^^^^^^^^^^^^ Expected `HybridSearcher`, found `DummySearcher`
1063 |         )
     |
info: Function defined here
    --> src/memex/core.py:1079:5
     |
1079 | def detect_potential_duplicates(
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1080 |     title: str,
1081 |     content: str,
1082 |     searcher: HybridSearcher,
     |     ------------------------ Parameter declared here
1083 |     min_score: float = DUPLICATE_DETECTION_MIN_SCORE,
1084 |     limit: int = DUPLICATE_DETECTION_LIMIT,
     |
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument to function `detect_potential_duplicates` is incorrect
    --> tests/test_core.py:1086:13
     |
1084 |             title="Entry",
1085 |             content="Content.",
1086 |             searcher=searcher,
     |             ^^^^^^^^^^^^^^^^^ Expected `HybridSearcher`, found `DummySearcher`
1087 |             limit=3,
1088 |         )
     |
info: Function defined here
    --> src/memex/core.py:1079:5
     |
1079 | def detect_potential_duplicates(
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1080 |     title: str,
1081 |     content: str,
1082 |     searcher: HybridSearcher,
     |     ------------------------ Parameter declared here
1083 |     min_score: float = DUPLICATE_DETECTION_MIN_SCORE,
1084 |     limit: int = DUPLICATE_DETECTION_LIMIT,
     |
info: rule `invalid-argument-type` is enabled by default

error[possibly-missing-attribute]: Attribute `tzinfo` may be missing on object of type `datetime | None`
    --> tests/test_core.py:1394:16
     |
1392 |         result = core._ensure_aware(naive)
1393 |
1394 |         assert result.tzinfo == timezone.utc
     |                ^^^^^^^^^^^^^
1395 |         assert result.year == 2026
1396 |         assert result.month == 1
     |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `year` may be missing on object of type `datetime | None`
    --> tests/test_core.py:1395:16
     |
1394 |         assert result.tzinfo == timezone.utc
1395 |         assert result.year == 2026
     |                ^^^^^^^^^^^
1396 |         assert result.month == 1
1397 |         assert result.day == 15
     |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `month` may be missing on object of type `datetime | None`
    --> tests/test_core.py:1396:16
     |
1394 |         assert result.tzinfo == timezone.utc
1395 |         assert result.year == 2026
1396 |         assert result.month == 1
     |                ^^^^^^^^^^^^
1397 |         assert result.day == 15
1398 |         assert result.hour == 10
     |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `day` may be missing on object of type `datetime | None`
    --> tests/test_core.py:1397:16
     |
1395 |         assert result.year == 2026
1396 |         assert result.month == 1
1397 |         assert result.day == 15
     |                ^^^^^^^^^^
1398 |         assert result.hour == 10
1399 |         assert result.minute == 30
     |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `hour` may be missing on object of type `datetime | None`
    --> tests/test_core.py:1398:16
     |
1396 |         assert result.month == 1
1397 |         assert result.day == 15
1398 |         assert result.hour == 10
     |                ^^^^^^^^^^^
1399 |         assert result.minute == 30
     |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[possibly-missing-attribute]: Attribute `minute` may be missing on object of type `datetime | None`
    --> tests/test_core.py:1399:16
     |
1397 |         assert result.day == 15
1398 |         assert result.hour == 10
1399 |         assert result.minute == 30
     |                ^^^^^^^^^^^^^
1400 |
1401 |     def test_aware_datetime_unchanged(self):
     |
info: rule `possibly-missing-attribute` was selected in the configuration file

error[invalid-argument-type]: Argument is incorrect
  --> tests/test_memory_evolution.py:93:38
   |
91 |             "suggested_connections": [],
92 |         }
93 |         decision = EvolutionDecision(**llm_response)
   |                                      ^^^^^^^^^^^^^^ Expected `bool`, found `Unknown | bool | list[Unknown | str] | list[Unknown | dict[Unknown | str, Unknown | str | list[Unknown | str]]] | list[Unknown]`
94 |         assert decision.should_evolve is True
95 |         assert len(decision.neighbor_updates) == 1
   |
info: Union element `list[Unknown | str]`, and 2 more union elements, are not assignable to `bool`
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
  --> tests/test_memory_evolution.py:93:38
   |
91 |             "suggested_connections": [],
92 |         }
93 |         decision = EvolutionDecision(**llm_response)
   |                                      ^^^^^^^^^^^^^^ Expected `list[str]`, found `Unknown | bool | list[Unknown | str] | list[Unknown | dict[Unknown | str, Unknown | str | list[Unknown | str]]] | list[Unknown]`
94 |         assert decision.should_evolve is True
95 |         assert len(decision.neighbor_updates) == 1
   |
info: Union elements `bool` and `list[Unknown | dict[Unknown | str, Unknown | str | list[Unknown | str]]]` are not assignable to `list[str]`
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
  --> tests/test_memory_evolution.py:93:38
   |
91 |             "suggested_connections": [],
92 |         }
93 |         decision = EvolutionDecision(**llm_response)
   |                                      ^^^^^^^^^^^^^^ Expected `list[NeighborUpdate]`, found `Unknown | bool | list[Unknown | str] | list[Unknown | dict[Unknown | str, Unknown | str | list[Unknown | str]]] | list[Unknown]`
94 |         assert decision.should_evolve is True
95 |         assert len(decision.neighbor_updates) == 1
   |
info: Union element `bool`, and 2 more union elements, are not assignable to `list[NeighborUpdate]`
info: rule `invalid-argument-type` is enabled by default

error[invalid-argument-type]: Argument is incorrect
  --> tests/test_memory_evolution.py:93:38
   |
91 |             "suggested_connections": [],
92 |         }
93 |         decision = EvolutionDecision(**llm_response)
   |                                      ^^^^^^^^^^^^^^ Expected `list[str]`, found `Unknown | bool | list[Unknown | str] | list[Unknown | dict[Unknown | str, Unknown | str | list[Unknown | str]]] | list[Unknown]`
94 |         assert decision.should_evolve is True
95 |         assert len(decision.neighbor_updates) == 1
   |
info: Union elements `bool` and `list[Unknown | dict[Unknown | str, Unknown | str | list[Unknown | str]]]` are not assignable to `list[str]`
info: rule `invalid-argument-type` is enabled by default

error[missing-argument]: No argument provided for required parameter `should_evolve`
   --> tests/test_memory_evolution.py:101:13
    |
 99 |         """EvolutionDecision requires should_evolve field."""
100 |         with pytest.raises(Exception):  # Pydantic ValidationError
101 |             EvolutionDecision()  # Missing required field
    |             ^^^^^^^^^^^^^^^^^^^
    |
info: rule `missing-argument` is enabled by default

error[unresolved-reference]: Name `StrengthenResult` used when not defined
    --> tests/test_memory_evolution.py:1134:20
     |
1132 |         async def mock_analyze_strengthen(*args, **kwargs):
1133 |             strengthen_called.append(True)
1134 |             return StrengthenResult(
     |                    ^^^^^^^^^^^^^^^^
1135 |                 should_strengthen=True,
1136 |                 new_keywords=["should-not-appear"],
     |
info: rule `unresolved-reference` is enabled by default

Found 137 diagnostics reports 137 diagnostics (unresolved imports in tests/_archive, mismatched args, and typing issues in tests/test_memory_evolution.py). Decide whether to exclude _archive or fix typing issues, then make ty pass or document why it should ignore those paths.

## Acceptance Criteria

- [ ] ty check passes or known exclusions documented\n- [ ] Update ty config if excluding tests/_archive intentionally


## Notes

**2026-01-25T03:56:09Z**

Fixed ty check failures (excluded tests/_archive via ty src config, added overloads for title index, adjusted duplicate searcher typing + tests). ty check src tests now passes.

**2026-01-25T03:58:16Z**

Removed tests/_archive directory and cleaned pyproject (dropped _archive exclusions) per request; ty check still passes.
