Compare commits
5 Commits
groq/issue
...
claude/iss
| Author | SHA1 | Date | |
|---|---|---|---|
| 8044fe7d40 | |||
| ca8262a5d2 | |||
| 229d8dc16a | |||
| a8bb65f9e7 | |||
|
|
fbcb2cc12c |
9
audits/2026-04-07-perplexity-audit-3-response.md
Normal file
9
audits/2026-04-07-perplexity-audit-3-response.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Perplexity Audit #3 Response — 2026-04-07
|
||||
Refs #1112. Findings span hermes-agent, timmy-config, the-beacon repos.
|
||||
| Finding | Repo | Status |
|
||||
|---------|------|--------|
|
||||
| hermes-agent#222 syntax error aux_client.py:943 | hermes-agent | Filed hermes-agent#223 |
|
||||
| timmy-config#352 conflicts (.gitignore, cron/jobs.json, gitea_client.py) | timmy-config | Resolve + pick one scheduler |
|
||||
| the-beacon missing from kaizen_retro.py REPOS list | timmy-config | Add before merging #352 |
|
||||
| CI coverage gaps | org-wide | the-nexus: covered via .gitea/workflows/ci.yml |
|
||||
the-nexus has no direct code changes required. Cross-repo items tracked above.
|
||||
@@ -2,7 +2,7 @@
|
||||
"""
|
||||
fleet_api.py — Lightweight HTTP API for the shared fleet palace.
|
||||
|
||||
Exposes fleet memory search over HTTP so that Alpha servers and other
|
||||
Exposes fleet memory search and recording over HTTP so that Alpha servers and other
|
||||
wizard deployments can query the palace without direct filesystem access.
|
||||
|
||||
Endpoints:
|
||||
@@ -16,6 +16,10 @@ Endpoints:
|
||||
GET /wings
|
||||
Returns {"wings": ["bezalel", ...]} — distinct wizard wings present
|
||||
|
||||
POST /record
|
||||
Body: {"text": "...", "room": "...", "wing": "...", "source_file": "...", "metadata": {...}}
|
||||
Returns {"success": true, "id": "..."}
|
||||
|
||||
Error responses use {"error": "<message>"} with appropriate HTTP status codes.
|
||||
|
||||
Usage:
|
||||
@@ -25,7 +29,7 @@ Usage:
|
||||
# Custom host/port/palace:
|
||||
FLEET_PALACE_PATH=/data/fleet python mempalace/fleet_api.py --host 0.0.0.0 --port 8080
|
||||
|
||||
Refs: #1078, #1075
|
||||
Refs: #1078, #1075, #1085
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -131,6 +135,52 @@ def _handle_wings(handler: BaseHTTPRequestHandler) -> None:
|
||||
_json_response(handler, 200, {"wings": wings})
|
||||
|
||||
|
||||
def _handle_record(handler: BaseHTTPRequestHandler) -> None:
|
||||
"""Handle POST /record to add a new memory."""
|
||||
content_length = int(handler.headers.get("Content-Length", 0))
|
||||
if not content_length:
|
||||
_json_response(handler, 400, {"error": "Missing request body"})
|
||||
return
|
||||
|
||||
try:
|
||||
body = json.loads(handler.rfile.read(content_length))
|
||||
except json.JSONDecodeError:
|
||||
_json_response(handler, 400, {"error": "Invalid JSON body"})
|
||||
return
|
||||
|
||||
text = body.get("text", "").strip()
|
||||
if not text:
|
||||
_json_response(handler, 400, {"error": "Missing required field: text"})
|
||||
return
|
||||
|
||||
room = body.get("room", "general")
|
||||
wing = body.get("wing")
|
||||
source_file = body.get("source_file", "")
|
||||
metadata = body.get("metadata", {})
|
||||
|
||||
try:
|
||||
from nexus.mempalace.searcher import add_memory, MemPalaceUnavailable
|
||||
except ImportError as exc:
|
||||
_json_response(handler, 503, {"error": f"MemPalace module not available: {exc}"})
|
||||
return
|
||||
|
||||
try:
|
||||
# Note: add_memory uses MEMPALACE_PATH by default.
|
||||
# For fleet_api, we should probably use FLEET_PALACE_PATH.
|
||||
palace_path = _get_palace_path()
|
||||
doc_id = add_memory(
|
||||
text=text,
|
||||
room=room,
|
||||
wing=wing,
|
||||
palace_path=palace_path,
|
||||
source_file=source_file,
|
||||
extra_metadata=metadata
|
||||
)
|
||||
_json_response(handler, 201, {"success": True, "id": doc_id})
|
||||
except Exception as exc:
|
||||
_json_response(handler, 503, {"error": str(exc)})
|
||||
|
||||
|
||||
class FleetAPIHandler(BaseHTTPRequestHandler):
|
||||
"""Request handler for the fleet memory API."""
|
||||
|
||||
@@ -155,6 +205,18 @@ class FleetAPIHandler(BaseHTTPRequestHandler):
|
||||
"endpoints": ["/health", "/search", "/wings"],
|
||||
})
|
||||
|
||||
def do_POST(self) -> None: # noqa: N802
|
||||
parsed = urlparse(self.path)
|
||||
path = parsed.path.rstrip("/") or "/"
|
||||
|
||||
if path == "/record":
|
||||
_handle_record(self)
|
||||
else:
|
||||
_json_response(self, 404, {
|
||||
"error": f"Unknown endpoint: {path}",
|
||||
"endpoints": ["/record"],
|
||||
})
|
||||
|
||||
|
||||
def make_server(host: str = DEFAULT_HOST, port: int = DEFAULT_PORT) -> HTTPServer:
|
||||
return HTTPServer((host, port), FleetAPIHandler)
|
||||
|
||||
Reference in New Issue
Block a user