feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
#!/usr/bin/env bash
# heartbeat.sh — System health check + HEARTBEAT.md writer
# Runs on cron every 30 min (or via rc.d loop)
# LLM interpretation is optional — health checks run regardless
set -euo pipefail
SCRIPT_DIR = " $( cd " $( dirname " ${ BASH_SOURCE [0] } " ) " && pwd ) "
PROJECT_DIR = " $( cd " $SCRIPT_DIR /.. " && pwd ) "
# Load .env
if [ -f " $PROJECT_DIR /.env " ] ; then
set -a
# shellcheck disable=SC1091
. " $PROJECT_DIR /.env "
set +a
fi
2026-03-28 21:56:40 +00:00
# Config (with defaults — derive llama-cpp IP from env, never hardcode)
_LLAMA_IP = " ${ WARDEN_LLAMA_CPP_IP :- ${ JAIL_SUBNET_BASE :- 10 .0.1 } .5 } "
CHAT_BASE_URL = " ${ CHAT_BASE_URL :- http : // ${ _LLAMA_IP } : 8081 /v1 } "
feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
CHAT_MODEL = " ${ CHAT_MODEL :- dolphin3 .0-phi4-mini } "
2026-03-28 21:56:40 +00:00
EMBED_BASE_URL = " ${ EMBED_BASE_URL :- http : // ${ _LLAMA_IP } : 8080 /v1 } "
feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
HEARTBEAT_FILE = " $PROJECT_DIR /HEARTBEAT.md "
LOG_DIR = " $PROJECT_DIR /logs "
2026-04-24 07:49:09 +02:00
TENANT_ID = " ${ TENANT_ID :- clawdie } "
feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
mkdir -p " $LOG_DIR "
NOW = " $( date '+%d.%b.%Y %H:%M' ) "
NOW_SORT = " $( date '+%Y-%m-%d %H:%M:%S' ) "
# ── Health checks ─────────────────────────────────────────────────────────────
STATUS = "OK"
FLAGS = ""
_flag( ) {
local level = " $1 " msg = " $2 "
FLAGS = " ${ FLAGS } - ${ level } : ${ msg } \n "
[ " $level " = "CRIT" ] && STATUS = "CRIT"
[ " $level " = "WARN" ] && [ " $STATUS " != "CRIT" ] && STATUS = "WARN"
}
# Jails — try prefixed name first, fall back to short name
2026-04-01 21:59:13 +00:00
# Handles legacy prefixed naming; llama-cpp → llamacpp variant
feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
JAIL_STATUS = ""
2026-05-10 18:19:09 +02:00
BASTILLE_LIST = " $( " ${ SCRIPT_DIR :- $( dirname " $0 " ) } /hostd-call.sh " bastille-list 2>/dev/null || true ) "
feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
_jail_up( ) {
local name = " $1 "
printf '%s' " $BASTILLE_LIST " | awk '{print $2}' | grep -qxF " $name "
}
2026-03-29 08:28:41 +00:00
for role in controlplane db cms llama-cpp; do
feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
role_short = " ${ role //-/ } " # llama-cpp → llamacpp
2026-04-23 21:41:42 +02:00
prefixed = " ${ TENANT_ID } - ${ role } "
feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
if _jail_up " $prefixed " ; then
JAIL_STATUS = " ${ JAIL_STATUS } ${ prefixed } ✓\n "
elif _jail_up " $role " ; then
JAIL_STATUS = " ${ JAIL_STATUS } ${ role } ✓\n "
elif _jail_up " $role_short " ; then
JAIL_STATUS = " ${ JAIL_STATUS } ${ role_short } ✓\n "
else
JAIL_STATUS = " ${ JAIL_STATUS } ${ prefixed } ✗\n "
_flag "WARN" " Jail ${ role } not running "
fi
done
# PostgreSQL / memory DB
. " $SCRIPT_DIR /memory/common.sh " 2>/dev/null || true
MEM_COUNT = "?"
MEM_LATEST = "?"
if command -v psql >/dev/null 2>& 1 && [ -n " ${ DB_HOST :- } " ] ; then
2026-03-28 21:56:40 +00:00
MEM_COUNT = $( PGPASSWORD = " $MEMORY_DB_PASSWORD " psql -h " $DB_HOST " -p " ${ DB_PORT :- 5432 } " -U " $DB_USER " -d " $DB_NAME " \
--no-align --tuples-only --quiet --connect-timeout= 5 \
feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
-c "SELECT count(*) FROM memories;" 2>/dev/null || echo "?" )
2026-03-28 21:56:40 +00:00
MEM_LATEST = $( PGPASSWORD = " $MEMORY_DB_PASSWORD " psql -h " $DB_HOST " -p " ${ DB_PORT :- 5432 } " -U " $DB_USER " -d " $DB_NAME " \
--no-align --tuples-only --quiet --connect-timeout= 5 \
feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
-c "SELECT to_char(max(created_at), 'DD.Mon.YYYY HH24:MI') FROM memories;" 2>/dev/null || echo "?" )
[ " $MEM_COUNT " = "?" ] && _flag "CRIT" "PostgreSQL unreachable"
fi
# Embedding server
2026-03-28 21:15:43 +00:00
# For local llama-cpp servers check /health; external APIs (OpenAI etc.) are assumed up.
feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
EMBED_STATUS = "✗"
2026-03-28 21:15:43 +00:00
EMBED_HOST = " ${ EMBED_BASE_URL %%/v1* } " # strip /v1 suffix
if [ [ " $EMBED_BASE_URL " = ~ ( localhost| 127\. | 192\. 168\. | 10\. ) ] ] ; then
2026-03-28 21:56:40 +00:00
if curl -sf --max-time 5 " ${ EMBED_HOST } /health " >/dev/null 2>& 1; then
2026-03-28 21:15:43 +00:00
EMBED_STATUS = "✓"
else
_flag "WARN" " Embedding server unreachable at ${ EMBED_HOST } "
fi
feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
else
2026-03-28 21:15:43 +00:00
# External API — mark as up; network failures will surface via memory search errors
EMBED_STATUS = "✓ (ext)"
feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
fi
# Chat server
CHAT_STATUS = "✗"
2026-03-28 21:56:40 +00:00
if curl -sf --max-time 5 " ${ CHAT_BASE_URL %/v1 } /health " >/dev/null 2>& 1; then
feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
CHAT_STATUS = "✓"
fi
# Chat down is not a WARN — it's optional for heartbeat
# Disk
ZFS_USED = "?"
if command -v zfs >/dev/null 2>& 1; then
ZFS_USED = $( zfs list -H -o used,avail zroot 2>/dev/null \
| awk '{printf "%s used / %s avail", $1, $2}' || echo "?" )
fi
# ── LLM interpretation ────────────────────────────────────────────────────────
SUMMARY = "LLM unavailable — raw data only."
if [ " $CHAT_STATUS " = "✓" ] ; then
HEALTH_SNAPSHOT = " Jails: $( printf '%b' " $JAIL_STATUS " | tr '\n' '|' ) | Memories: ${ MEM_COUNT } (latest: ${ MEM_LATEST } ) | Embed: ${ EMBED_STATUS } | Disk: ${ ZFS_USED } "
2026-04-23 21:41:42 +02:00
PROMPT = " You are ${ TENANT_ID } 's system monitor. Current state: ${ HEALTH_SNAPSHOT } . Flags: ${ FLAGS :- none } . Summarise in 2 sentences, mention any concerns. "
feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
2026-03-28 21:56:40 +00:00
SUMMARY = $( curl -sf --max-time 15 " ${ CHAT_BASE_URL } /chat/completions " \
feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
-H "Content-Type: application/json" \
-d " {\"model\":\" ${ CHAT_MODEL } \",\"messages\":[{\"role\":\"user\",\"content\": $( printf '%s' " $PROMPT " | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))' ) }],\"max_tokens\":120,\"temperature\":0.3} " \
2>/dev/null \
| python3 -c 'import json,sys; d=json.load(sys.stdin); print(d["choices"][0]["message"]["content"].strip())' \
2>/dev/null || echo "LLM parse error — raw data only." )
fi
# ── Write HEARTBEAT.md ────────────────────────────────────────────────────────
{
echo "# System Heartbeat"
echo ""
echo " > Last checked: ${ NOW } | Status: ** ${ STATUS } ** "
echo ""
echo "## Health"
printf '%b' " $JAIL_STATUS "
echo " - PostgreSQL: ${ MEM_COUNT } memories, latest ${ MEM_LATEST } "
2026-03-28 21:15:43 +00:00
echo " - embed ( ${ EMBED_BASE_URL ##*//* } ) ${ EMBED_STATUS } chat :8081 ${ CHAT_STATUS } "
feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
echo " - Disk: ${ ZFS_USED } "
echo ""
echo "## Memory Snapshot"
echo " - ${ MEM_COUNT } memories | latest: ${ MEM_LATEST } "
echo ""
echo "## Summary"
echo " $SUMMARY "
echo ""
echo "## Flags"
if [ -n " $FLAGS " ] ; then
printf '%b' " $FLAGS "
else
echo "(none)"
fi
echo ""
echo "---"
echo " _Generated by scripts/heartbeat.sh at ${ NOW_SORT } _ "
} > " $HEARTBEAT_FILE "
# ── Telegram notification on WARN/CRIT ───────────────────────────────────────
NOTIFY = " ${ HEARTBEAT_NOTIFY_TELEGRAM :- false } "
if [ " $NOTIFY " = "true" ] && [ " $STATUS " != "OK" ] ; then
ICON = "⚠️"
[ " $STATUS " = "CRIT" ] && ICON = "🚨"
2026-04-23 21:41:42 +02:00
MSG = " ${ ICON } ${ TENANT_ID } heartbeat ${ STATUS } — ${ NOW }
feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
${ SUMMARY }
Flags:
$( printf '%b' " $FLAGS " ) "
if [ -n " ${ TELEGRAM_BOT_TOKEN :- } " ] && [ -n " ${ TELEGRAM_MAIN_CHAT_ID :- } " ] ; then
2026-03-28 21:56:40 +00:00
curl -sf --max-time 10 " https://api.telegram.org/bot ${ TELEGRAM_BOT_TOKEN } /sendMessage " \
feat: heartbeat agent + local LLM path; docs consistency pass
Heartbeat:
- scripts/heartbeat.sh — cron-ready health monitor; checks jails,
PostgreSQL, llama-server instances; writes HEARTBEAT.md; optional
Telegram alert on WARN/CRIT; LLM interpretation via local :8081
- docs/HEARTBEAT.md — architecture, schedule, escalation model,
memory integration, LLM model path by RAM tier
- HEARTBEAT.md added to .gitignore (runtime-generated, changes every 30 min)
Local LLM:
- docs/LOCAL-LLM.md — two-instance llama-server design (:8080 embed,
:8081 chat); model choices for 12/32/64 GB; setup instructions;
upgrade path from dolphin3.0-phi4-mini → Qwen3-14B with no schema change
- docs/REFACTOR-PLAN.md — replace stale z.ai recharge note with local
llama-cpp direction; add action item to migrate pi to :8081
Docs consistency pass:
- Replace 10.0.0.x → 192.168.100.x in 8 docs files
- Replace jexec → bastille cmd in FREEBSD-JAIL-IMPLEMENTATION.md,
HOST-OPERATOR-MODEL.md, SECURITY.md
- Fix /home/clawdija/ path typo in WARDEN.md, HOST-OPERATOR-MODEL.md,
SECURITY.md
- Fix AGENT_SUBNET_BASE default in HOST-OPERATOR-MODEL.md
- Fix CMS PF redirect IP bug in CMS-DEPLOYMENT-PLAN.md (.5 → .4)
- Clarify git jail has no fixed IP slot in GIT-STORAGE.md
- Fix user-facing dates to DD.mmm.YYYY in REFACTOR-PLAN.md,
DEBUG_CHECKLIST.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
Build: pass | Tests: pass — Tests 431 passed (431)
2026-03-28 10:43:22 +00:00
-d " chat_id= ${ TELEGRAM_MAIN_CHAT_ID } " \
--data-urlencode " text= ${ MSG } " \
>/dev/null 2>& 1 || true
fi
fi
echo " [ ${ NOW_SORT } ] heartbeat ${ STATUS } — ${ MEM_COUNT } memories, embed ${ EMBED_STATUS } , chat ${ CHAT_STATUS } "