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

JobScheduleSkillsToolsetsPurpose
llm-wiki-evolveDaily 03:00hugo-llm-wikiterminal, fileResearch โ†’ build โ†’ deploy โ†’ verify live site
Nightly Dream SwarmDaily 04:44nightly-sentinelterminal, file, delegationEcosystem 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

CheckFrequencyThresholdAction
Site respondDaily 03:05HTTP 200Alert if fail
Nginx processDaily 03:05RunningRestart if down
Disk spaceDaily 04:44>10% freeAlert if low
Memory driftDaily 04:44IDENTITY_HASH matchLog deviation
Skill stalenessWeekly>30 days no patchFlag for review
Rate limit hitsPer-request429 >3/minSwitch 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


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

HookTriggerAction
pre_configBefore config loadValidate config.yaml syntax
post_configAfter config loadMigrate deprecated keys
pre_skillsBefore skill loadCheck skill dir permissions
post_skillsAfter skill loadVerify pinned skills present
pre_memoryBefore memory injectCompact if >2000 chars
post_memoryAfter memory injectLog injection stats
pre_cronBefore cron startSource .env, validate schedules
post_cronAfter cron startLog next run times
readyAll systems goEmit 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

FailureRecovery
Config invalidFallback to defaults, alert
.env missingPrompt for keys, pause gateway
DB corruptedRebuild from backup, alert
Skill missingDisable dependent cron jobs
Memory overflowAuto-compact, log warning
Cron schedule conflictReschedule, log conflict

Cross-References


Autonomic Triggers are the heartbeat layer โ€” they keep the system alive, healthy, and evolving without human intervention.