From a0bb82bdfb14d3470e03e197db85bd487ea2ef17 Mon Sep 17 00:00:00 2001 From: Paul Vasiletz Date: Mon, 10 Aug 2026 15:11:11 +0300 Subject: [PATCH 1/3] chromadb | fix: chroma knowledge indexing fails under Landlock during compaction --- profile/policy.py | 2 +- src/rag.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/profile/policy.py b/profile/policy.py index 981718af..44b14397 100644 --- a/profile/policy.py +++ b/profile/policy.py @@ -69,7 +69,7 @@ class FileSystemPolicy: | AccessFs.MAKE_REG | AccessFs.MAKE_DIR | AccessFs.MAKE_SYM | AccessFs.REMOVE_FILE | AccessFs.REMOVE_DIR | AccessFs.MAKE_FIFO - | AccessFs.MAKE_SOCK) + | AccessFs.MAKE_SOCK | AccessFs.REFER) READ_WRITE_FILE_ACCESS = (AccessFs.READ_FILE | AccessFs.WRITE_FILE | AccessFs.TRUNCATE) diff --git a/src/rag.py b/src/rag.py index f9274fd6..9b9fb3c2 100644 --- a/src/rag.py +++ b/src/rag.py @@ -20,11 +20,14 @@ _PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -DB_PATH = os.environ.get( - "CHROMA_DB_PATH", - "/PeTTa/chroma_db" if os.path.isdir("/PeTTa/chroma_db") else - os.path.join(_PROJECT_ROOT, "..", "..","chroma_db") -) +# ChromaDB 1.5.x keys a PersistentClient's identity off the literal path +# string it's given, not the resolved directory. Both Docker and the bare- +# metal install (see README) always run this process with cwd set to the +# PeTTa root, where repos/OmegaClaw-Core and repos/petta_lib_chromadb are +# siblings - and lib_chromadb.py opens its own client with the literal +# "./chroma_db". Matching that literal here (rather than resolving to an +# absolute path) keeps both clients on the same Chroma "system" (see #295). +DB_PATH = os.environ.get("CHROMA_DB_PATH", "./chroma_db") # --- Lazy ChromaDB client ------------------------------------------------ From 4057a71151ca5b9e1211dbb87c1127cedb7c965b Mon Sep 17 00:00:00 2001 From: Paul Vasiletz Date: Fri, 14 Aug 2026 17:45:43 +0300 Subject: [PATCH 2/3] chromadb | restore previous DB_PATH resolution logic, add logging for the resolved path --- src/rag.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/rag.py b/src/rag.py index 9b9fb3c2..334755d3 100644 --- a/src/rag.py +++ b/src/rag.py @@ -20,14 +20,11 @@ _PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -# ChromaDB 1.5.x keys a PersistentClient's identity off the literal path -# string it's given, not the resolved directory. Both Docker and the bare- -# metal install (see README) always run this process with cwd set to the -# PeTTa root, where repos/OmegaClaw-Core and repos/petta_lib_chromadb are -# siblings - and lib_chromadb.py opens its own client with the literal -# "./chroma_db". Matching that literal here (rather than resolving to an -# absolute path) keeps both clients on the same Chroma "system" (see #295). -DB_PATH = os.environ.get("CHROMA_DB_PATH", "./chroma_db") +DB_PATH = os.environ.get( + "CHROMA_DB_PATH", + "/PeTTa/chroma_db" if os.path.isdir("/PeTTa/chroma_db") else + os.path.join(_PROJECT_ROOT, "..", "..","chroma_db") +) # --- Lazy ChromaDB client ------------------------------------------------ @@ -214,6 +211,7 @@ def init_knowledge(embedding_selection): _last_query = None _last_result = None logger.info(f"Embedding type selected is {embedding_selection}") + logger.info(f"СhromaDB: using database path {DB_PATH}") try: collection = _get_collection() From d07b0b5d2d4b15da61b0e7ca42d05260f3e5d6a1 Mon Sep 17 00:00:00 2001 From: Paul Vasiletz Date: Fri, 14 Aug 2026 17:48:59 +0300 Subject: [PATCH 3/3] chromadb | log DB_PATH using os.path.abspath --- src/rag.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rag.py b/src/rag.py index 334755d3..8a0a173d 100644 --- a/src/rag.py +++ b/src/rag.py @@ -211,7 +211,7 @@ def init_knowledge(embedding_selection): _last_query = None _last_result = None logger.info(f"Embedding type selected is {embedding_selection}") - logger.info(f"СhromaDB: using database path {DB_PATH}") + logger.info(f"ChromaDB: using database path {os.path.abspath(DB_PATH)}") try: collection = _get_collection()