Skip to content

AI-powered virtual executive team — a single coherent executive persona backed by 8 specialist agents (FastAPI + Next.js).

fix(knowledge): log the search gate's fail-open, correct the attachment domain

Claude0c8a96460fa4
diff --git a/packages/core/openexecutive/api/routes/knowledge.py b/packages/core/openexecutive/api/routes/knowledge.py
index 15603caa..6460c284 100644
--- a/packages/core/openexecutive/api/routes/knowledge.py
+++ b/packages/core/openexecutive/api/routes/knowledge.py
@@ -1,5 +1,6 @@
from __future__ import annotations
+import logging
import re
from collections import defaultdict
from pathlib import Path
@@ -14,6 +15,8 @@ from openexecutive.knowledge.loader import (
UPLOAD_DOMAINS,
)
+logger = logging.getLogger(__name__)
+
router = APIRouter(prefix="/knowledge")
_VALID_FILENAME = re.compile(r"^[a-zA-Z0-9_\-]+\.md$")
@@ -631,6 +634,15 @@ async def search_knowledge(
rs.get_withheld_source_ids(),
)
except Exception:
+ # Say so. A silently degraded mirror is worse than a loud one: an
+ # SME who rejects a doc, still sees it listed here, and has no
+ # signal will conclude rejection is broken — while chat is in fact
+ # withholding it correctly.
+ logger.warning(
+ "review state unreadable; /knowledge/search is showing "
+ "unfiltered results this request",
+ exc_info=True,
+ )
return set(), set()
_withheld_builtin, _withheld_external = _withheld_sets()
diff --git a/packages/core/openexecutive/architecture/architecture-facts.yaml b/packages/core/openexecutive/architecture/architecture-facts.yaml
index 690ba2c2..fd1cda05 100644
--- a/packages/core/openexecutive/architecture/architecture-facts.yaml
+++ b/packages/core/openexecutive/architecture/architecture-facts.yaml
@@ -2994,7 +2994,7 @@ integrations:
``POST /chat/upload`` (multipart) — capped at 5 files per turn.
Indexed under ``source_name="attachment:<bare filename>"`` and domain
- ``general``. Both matter. The name is the chunk-id namespace and the
+ ``company_docs``. Both matter. The name is the chunk-id namespace and the
retrieval citation, and an attachment's filename is chosen by whoever
sent the message — unprefixed, an emailed ``strategy-2026.md`` would
upsert straight over the curated company document of that name, so