@@ -35,3 +35,34 @@ def test_status_wait_returns_once_indexed(app, app_config, test_project, config_
3535 data = json .loads (result .output [start :])
3636 assert data ["total_files" ] == 1
3737 assert data ["observed_files" ][0 ]["path" ] == "test-notes/Wait Test Note.md"
38+
39+
40+ def test_unindexed_status_counts_files_without_hashing (
41+ app , app_config , test_project , config_manager , monkeypatch
42+ ) -> None :
43+ """First status walks eligible paths without reading their contents."""
44+ from pathlib import Path
45+
46+ from basic_memory .services import FileService
47+
48+ root = Path (test_project .path )
49+ (root / "notes" ).mkdir ()
50+ (root / "notes" / "new.md" ).write_text ("# New\n " , encoding = "utf-8" )
51+ (root / "asset.txt" ).write_text ("unindexed asset" , encoding = "utf-8" )
52+ (root / ".hidden.md" ).write_text ("hidden" , encoding = "utf-8" )
53+
54+ async def unexpected_checksum (self : FileService , path : str ) -> str :
55+ raise AssertionError (f"Unindexed status must not hash { path } " )
56+
57+ monkeypatch .setattr (FileService , "compute_checksum" , unexpected_checksum )
58+ result = runner .invoke (cli_app , ["status" , "--json" ])
59+
60+ assert result .exit_code == 0 , result .output
61+ data = json .loads (result .stdout )
62+ assert data ["total_files" ] == 2
63+ assert {item ["path" ] for item in data ["observed_files" ]} == {"notes/new.md" , "asset.txt" }
64+ assert all (item ["checksum" ] is None for item in data ["observed_files" ])
65+ assert data ["readiness" ]["phase" ] == "never_indexed"
66+ assert data ["readiness" ]["indexed_entities" ] == 0
67+ files = next (stage for stage in data ["readiness" ]["stages" ] if stage ["name" ] == "files" )
68+ assert files ["pending" ] == files ["total" ] == 2
0 commit comments