fix: task intent classifier, Hermes brain, rolling run log

- Intent classifier: task phrases now checked before query to prevent
  "add task X" mis-routing; "job item"/"job ticket"/"work order" added
  to TASK_PHRASES; "please add + project keyword" fallback added;
  substring match bug fixed ("in" inside "incident" triggered query)
- brain.py: routes planning fallback to Hermes cloud (claude-sonnet-4-6)
  via HERMES_URL/HERMES_API_KEY env vars; falls back to local Ollama
  if Hermes is unavailable
- main.py: rolling 50-run log written to logs/jon-snow/runs.jsonl

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 14:03:29 +00:00
parent 3b990b1b86
commit 59c9cb837d
3 changed files with 45 additions and 15 deletions
+9
View File
@@ -107,6 +107,15 @@ def _write_status(intent: str, summary: str, status: str = "success") -> None:
}
(log_dir / "last-run.json").write_text(json.dumps(payload, indent=2))
# Rolling 50-run history
runs_file = log_dir / "runs.jsonl"
try:
existing = runs_file.read_text().splitlines() if runs_file.exists() else []
existing.append(json.dumps(payload))
runs_file.write_text("\n".join(existing[-50:]) + "\n")
except Exception:
pass
out_dir = SITES_DIR / "jon-snow"
out_dir.mkdir(parents=True, exist_ok=True)
(out_dir / "last-output.md").write_text(