diff --git a/CHANGELOG b/CHANGELOG index c95361e..7f1ca6e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ Unreleased + • A corpus declares max_files in the registry when it is larger than + the indexer's file cap: a kernel tree made /reindex refuse, with no + way to raise the cap from the session. + • The start inventory of the declared trees runs beside the session's startup instead of before it: every registered corpus is walked, and spear-chat took over a minute to show its prompt, --help included. A diff --git a/client/cli/corpus_search.py b/client/cli/corpus_search.py index 7977867..2345a62 100644 --- a/client/cli/corpus_search.py +++ b/client/cli/corpus_search.py @@ -209,7 +209,7 @@ def init_chromadb(): if not attached: print(f"{C_WARN}This session has no retrieval. To use an " - f"indexed corpus, launch from its tree, or attach one " + f"indexed corpus, /cd into its tree, or attach one " f"with --with (/corpus lists them).{C_RST}") if not attached: @@ -809,6 +809,12 @@ def reindex_options(): if spec.get("include_build"): opts.append("--include-build") + # A tree larger than the indexer's runaway guard, a kernel for one, says + # so in the registry: /reindex has no command line to raise it on. + + if spec.get("max_files"): + opts += ["--max-files", str(int(spec["max_files"]))] + return opts diff --git a/client/tests/test_indexing.py b/client/tests/test_indexing.py index 6a1afaf..afa3f9b 100644 --- a/client/tests/test_indexing.py +++ b/client/tests/test_indexing.py @@ -226,6 +226,13 @@ def test_include_build_flag(self): self.session_workspace.PROJECT = "p" self.assertIn("--include-build", self.corpus_search.reindex_options()) + def test_a_declared_file_cap_reaches_the_indexer(self): + self._write({"linux": {"path": "/x", "kind": "generic", + "max_files": 150000}}) + self.session_workspace.PROJECT = "linux" + opts = self.corpus_search.reindex_options() + self.assertEqual("150000", opts[opts.index("--max-files") + 1]) + class ReindexTargetsTheCorpusNotTheCwdTest(unittest.TestCase): """/reindex rebuilds the CORPUS's index, wherever the session stands. diff --git a/doc/source/using/projects.rst b/doc/source/using/projects.rst index 313a62a..6a4338a 100644 --- a/doc/source/using/projects.rst +++ b/doc/source/using/projects.rst @@ -90,6 +90,9 @@ its mount point (:doc:`/start/container`). - directories skipped at indexing * - ``include_build`` - index build directories, minus the generated subtrees + * - ``max_files`` + - raise the indexer's file cap (60000) for a tree that is larger by + nature, such as a kernel * - ``corpora`` - federate these registered corpora into a session on this project * - ``shared``