Autonomic Triggers
Autonomic Triggers
Background daemons: cron schedules, proactive health checks, first-run injection, and gateway startup hooks.
HEARTBEAT โฑ๏ธ Autonomic Daemon
Cron schedules, proactive health checks, memory pruning, and background tasks.
Active Cron Jobs
| Job | Schedule | Skills | Toolsets | Purpose |
|---|
llm-wiki-evolve | Daily 03:00 | hugo-llm-wiki | terminal, file | Research โ build โ deploy โ verify live site |
Nightly Dream Swarm | Daily 04:44 | nightly-sentinel | terminal, file, delegation | Ecosystem diagnostic โ dream.md + Discord report |
Job Definitions
llm-wiki-evolve
1
2
3
4
5
6
7
8
9
10
11
12
13
| # Cron job: llm-wiki-evolve
action: create
schedule: "0 3 * * *"
name: "LLM Wiki Evolution"
prompt: |
Run the full LLM Wiki evolution pipeline:
1. Execute research-automation.py to fetch new topics
2. Build Hugo site (hugo --minify)
3. Deploy to nginx (sudo systemctl reload nginx)
4. Verify live site responds correctly
5. Append trace to evolving/YYYY-MM-DD.md
skills: ["hugo-llm-wiki"]
toolsets: ["terminal", "file"]
|
Nightly Dream Swarm
1
2
3
4
5
6
7
8
9
10
11
12
| # Cron job: nightly-sentinel
action: create
schedule: "44 4 * * *"
name: "Nightly Dream Swarm"
prompt: |
Run ecosystem diagnostic swarm:
1. Check all service health (Hugo, Nginx, Discord bot, OMP Suite)
2. Analyze memory drift, skill staleness, config drift
3. Generate dream.md with poetic title
4. Send Discord embed report to home channel
skills: ["nightly-sentinel"]
toolsets: ["terminal", "file", "delegation"]
|
Health Checks
| Check | Frequency | Threshold | Action |
|---|
| Site respond | Daily 03:05 | HTTP 200 | Alert if fail |
| Nginx process | Daily 03:05 | Running | Restart if down |
| Disk space | Daily 04:44 | >10% free | Alert if low |
| Memory drift | Daily 04:44 | IDENTITY_HASH match | Log deviation |
| Skill staleness | Weekly | >30 days no patch | Flag for review |
| Rate limit hits | Per-request | 429 >3/min | Switch model |
Memory Pruning
1
2
3
4
5
6
7
8
9
10
| pruning:
YYYY-MM-DD:
hot_days: 7 # Full detail
warm_days: 30 # Summarized
cold_action: archive # Move to cold storage
FEEDBACK-LOG:
unresolved_retention: 90 # Days
resolved_retention: 365 # Days
SESSION_LOG:
retention: 365 # Days
|
BOOTSTRAP ๐ First-Run Injection
Initial environment setup, dependency installation, and connection testing (deletes self post-use).
Bootstrap Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
| #!/bin/bash
# ~/.hermes/bootstrap.sh โ runs once, then self-deletes
set -euo pipefail
echo "๐ Hermes Bootstrap Starting..."
# 1. Verify core tools
for cmd in hugo nginx python3 node npm git rg jq; do
command -v $cmd >/dev/null || { echo "โ Missing: $cmd"; exit 1; }
done
echo "โ
Core tools verified"
# 2. Verify directories
for dir in ~/.hermes/{skills,cron,logs,dreams,plugins,state.db,kanban.db}; do
mkdir -p "$dir" 2>/dev/null || true
done
echo "โ
Directories ready"
# 3. Verify config
if [[ ! -f ~/.hermes/config.yaml ]]; then
echo "โ Missing config.yaml"
exit 1
fi
echo "โ
Config exists"
# 4. Source env & test connections
set -a; source ~/.hermes/.env; set +a
curl -sf https://openrouter.ai/api/v1/models >/dev/null && echo "โ
OpenRouter reachable"
curl -sf https://discord.com/api/v10/users/@me >/dev/null && echo "โ
Discord reachable"
# 5. Initialize databases
python3 -c "
import sqlite3
for db in ['~/.hermes/state.db', '~/.hermes/kanban.db']:
conn = sqlite3.connect(db)
conn.execute('PRAGMA journal_mode=WAL')
conn.close()
"
echo "โ
Databases initialized"
# 6. Deploy initial wiki
cd ~/hugo-llm-wiki && hugo --minify && sudo nginx -t && sudo systemctl reload nginx
echo "โ
Wiki deployed"
# 7. Self-delete
rm "$0"
echo "๐๏ธ Bootstrap self-deleted"
echo "โจ Bootstrap complete โ Hermes ready"
|
Execution
- Runs automatically on first gateway start after fresh install
- Can be re-triggered:
bash ~/.hermes/bootstrap.sh - Deletes itself after successful completion (idempotent guard)
BOOT โก Gateway Startup
Routine startup hooks and actions executed exclusively on internal gateway initialization.
Startup Sequence
1
2
3
4
5
6
7
8
9
10
| graph TD
A[Gateway Process Start] --> B[Load config.yaml]
B --> C[Parse .env โ env vars]
C --> D[Initialize SQLite (WAL mode)]
D --> E[Load pinned skills]
E --> F[Inject MEMORY + USER + IDENTITY_HASH]
F --> G[Verify IDENTITY_HASH markers]
G --> H[Start cron scheduler]
H --> I[Register Discord bot]
I --> J[Ready for requests]
|
Hook Points
| Hook | Trigger | Action |
|---|
pre_config | Before config load | Validate config.yaml syntax |
post_config | After config load | Migrate deprecated keys |
pre_skills | Before skill load | Check skill dir permissions |
post_skills | After skill load | Verify pinned skills present |
pre_memory | Before memory inject | Compact if >2000 chars |
post_memory | After memory inject | Log injection stats |
pre_cron | Before cron start | Source .env, validate schedules |
post_cron | After cron start | Log next run times |
ready | All systems go | Emit gateway_ready event |
Startup Validation
1
2
3
4
5
6
| # Pseudocode for gateway startup validation
assert config.model.default == "nvidia/nemotron-3-ultra-550b-a55b:free"
assert os.path.exists("~/.hermes/.env")
assert sqlite3.connect("~/.hermes/state.db").execute("PRAGMA journal_mode").fetchone()[0] == "wal"
assert all(skill.exists() for skill in PINNED_SKILLS)
assert len(memory) < 2200 # chars
|
Failure Modes
| Failure | Recovery |
|---|
| Config invalid | Fallback to defaults, alert |
| .env missing | Prompt for keys, pause gateway |
| DB corrupted | Rebuild from backup, alert |
| Skill missing | Disable dependent cron jobs |
| Memory overflow | Auto-compact, log warning |
| Cron schedule conflict | Reschedule, log conflict |
Cross-References
- Mutable Memory โ FEEDBACK-LOG feeds HEARTBEAT drift detection
- Orchestration โ AGENTS boot sequence runs at BOOT
- Capabilities โ checklists_dir referenced by HEARTBEAT jobs
- Spec-Driven โ PLAN updated by Dream Swarm insights
Autonomic Triggers are the heartbeat layer โ they keep the system alive, healthy, and evolving without human intervention.