Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 7 additions & 1 deletion client/cli/corpus_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <name> (/corpus lists them).{C_RST}")

if not attached:
Expand Down Expand Up @@ -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


Expand Down
7 changes: 7 additions & 0 deletions client/tests/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions doc/source/using/projects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down
Loading