Compare commits
1 Commits
burn/1500-
...
fix/1427
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d084149f5a |
@@ -44,9 +44,13 @@ class MemPalaceResult:
|
||||
|
||||
|
||||
def _get_client(palace_path: Path):
|
||||
"""Return a ChromaDB persistent client, or raise MemPalaceUnavailable."""
|
||||
"""Return a ChromaDB persistent client, or raise MemPalaceUnavailable.
|
||||
|
||||
Telemetry is disabled for sovereignty — no data leaks to Chroma Inc.
|
||||
"""
|
||||
try:
|
||||
import chromadb # type: ignore
|
||||
from chromadb.config import Settings
|
||||
except ImportError as exc:
|
||||
raise MemPalaceUnavailable(
|
||||
"ChromaDB is not installed. "
|
||||
@@ -59,7 +63,10 @@ def _get_client(palace_path: Path):
|
||||
"Run 'mempalace mine' to initialise the palace."
|
||||
)
|
||||
|
||||
return chromadb.PersistentClient(path=str(palace_path))
|
||||
return chromadb.PersistentClient(
|
||||
path=str(palace_path),
|
||||
settings=Settings(anonymized_telemetry=False),
|
||||
)
|
||||
|
||||
|
||||
def search_memories(
|
||||
|
||||
@@ -26,7 +26,7 @@ HERMES_CONTEXT = [
|
||||
|
||||
class RelevanceEngine:
|
||||
def __init__(self, collection_name: str = "deep_dive"):
|
||||
self.client = chromadb.PersistentClient(path="./chroma_db")
|
||||
self.client = chromadb.PersistentClient(path="./chroma_db", settings=chromadb.config.Settings(anonymized_telemetry=False))
|
||||
self.embedding_fn = embedding_functions.SentenceTransformerEmbeddingFunction(
|
||||
model_name="all-MiniLM-L6-v2"
|
||||
)
|
||||
|
||||
@@ -34,7 +34,7 @@ VIOLATION_KEYWORDS = [
|
||||
|
||||
def audit(palace_path: Path):
|
||||
violations = []
|
||||
client = chromadb.PersistentClient(path=str(palace_path))
|
||||
client = chromadb.PersistentClient(path=str(palace_path), settings=chromadb.config.Settings(anonymized_telemetry=False))
|
||||
try:
|
||||
col = client.get_collection("mempalace_drawers")
|
||||
except Exception as e:
|
||||
|
||||
@@ -18,22 +18,10 @@ set -euo pipefail
|
||||
|
||||
# ─── Configuration ──────────────────────────────────────────
|
||||
GITEA_URL="${GITEA_URL:-https://forge.alexanderwhitestone.com}"
|
||||
GITEA_TOKEN="${GITEA_TOKEN:-}"
|
||||
GITEA_TOKEN="${GITEA_TOKEN:?Set GITEA_TOKEN env var}"
|
||||
REPO="${REPO:-Timmy_Foundation/the-nexus}"
|
||||
DRY_RUN="${DRY_RUN:-true}"
|
||||
|
||||
# Auto-detect token
|
||||
if [ -z "$GITEA_TOKEN" ]; then
|
||||
if [ -f "$HOME/.config/gitea/token" ]; then
|
||||
GITEA_TOKEN=$(cat "$HOME/.config/gitea/token" | tr -d '[:space:]')
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$GITEA_TOKEN" ]; then
|
||||
echo "Error: GITEA_TOKEN not set and ~/.config/gitea/token not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Parse command line arguments
|
||||
for arg in "$@"; do
|
||||
case $arg in
|
||||
@@ -47,7 +35,7 @@ for arg in "$@"; do
|
||||
done
|
||||
|
||||
API="$GITEA_URL/api/v1"
|
||||
AUTH="Authorization: token $GITEA_TOKEN"
|
||||
AUTH="token $GITEA_TOKEN"
|
||||
|
||||
log() { echo "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] $*"; }
|
||||
|
||||
@@ -180,48 +168,3 @@ else
|
||||
fi
|
||||
|
||||
log "Script complete"
|
||||
|
||||
# ─── Stale Branch Cleanup ─────────────────────────────────
|
||||
# Clean up branches from closed (unmerged) PRs and merged PRs
|
||||
log "Checking for stale branches from closed/merged PRs..."
|
||||
|
||||
# Get all closed PRs (last 100)
|
||||
CLOSED_PRS=$(curl -s -H "$AUTH" "$API/repos/$REPO/pulls?state=closed&limit=100")
|
||||
|
||||
if [ -n "$CLOSED_PRS" ] && [ "$CLOSED_PRS" != "null" ]; then
|
||||
STALE_BRANCHES=$(echo "$CLOSED_PRS" | jq -r '.[] | select(.merged == false) | .head.ref' | sort -u)
|
||||
MERGED_BRANCHES=$(echo "$CLOSED_PRS" | jq -r '.[] | select(.merged == true) | .head.ref' | sort -u)
|
||||
|
||||
STALE_COUNT=0
|
||||
for branch in $STALE_BRANCHES; do
|
||||
# Skip main/master/develop
|
||||
case "$branch" in main|master|develop|HEAD) continue ;; esac
|
||||
|
||||
if [ "$DRY_RUN" = "true" ]; then
|
||||
log "DRY RUN: Would delete stale branch '$branch' (from closed unmerged PR)"
|
||||
else
|
||||
curl -s -X DELETE -H "$AUTH" "$API/repos/$REPO/branches/$branch" > /dev/null 2>&1 || true
|
||||
log "Deleted stale branch: $branch"
|
||||
fi
|
||||
STALE_COUNT=$((STALE_COUNT + 1))
|
||||
done
|
||||
|
||||
MERGED_COUNT=0
|
||||
for branch in $MERGED_BRANCHES; do
|
||||
case "$branch" in main|master|develop|HEAD) continue ;; esac
|
||||
|
||||
if [ "$DRY_RUN" = "true" ]; then
|
||||
log "DRY RUN: Would delete merged branch '$branch'"
|
||||
else
|
||||
curl -s -X DELETE -H "$AUTH" "$API/repos/$REPO/branches/$branch" > /dev/null 2>&1 || true
|
||||
log "Deleted merged branch: $branch"
|
||||
fi
|
||||
MERGED_COUNT=$((MERGED_COUNT + 1))
|
||||
done
|
||||
|
||||
log "Stale branch cleanup:"
|
||||
log " Closed (unmerged) branches: $STALE_COUNT"
|
||||
log " Merged branches: $MERGED_COUNT"
|
||||
else
|
||||
log "Could not fetch closed PRs for branch cleanup"
|
||||
fi
|
||||
|
||||
@@ -18,7 +18,7 @@ DOCS_PER_ROOM = 5
|
||||
|
||||
|
||||
def main():
|
||||
client = chromadb.PersistentClient(path=PALACE_PATH)
|
||||
client = chromadb.PersistentClient(path=PALACE_PATH, settings=chromadb.config.Settings(anonymized_telemetry=False))
|
||||
col = client.get_collection("mempalace_drawers")
|
||||
|
||||
# Discover rooms in this wing
|
||||
|
||||
Reference in New Issue
Block a user