Federation Health
Three domains unified: Federation Orchestrator + VPS Telemetry Auto-Healer + Docker Entropy.
Containers are thermodynamic systems: CPU is energy, memory is state, disk is storage, network is exchange.
DITEMPA BUKAN DIBERI
Overview
Unified federation health covering three domains:
- Federation Orchestrator — Monitor and manage the arifOS federation: docker compose ps, restart dead services, MCP health probes, container drift detection, restart count monitoring.
- VPS Telemetry Auto-Healer — Real-time Caddy HTTP error spike monitor, Docker container log stream analyzer, and automated container health recovery watchdog.
- Docker Entropy — Thermodynamic reasoning lens for container fleet health, resource pressure, and safe/dangerous intervention boundaries.
arifOS-ACT Embedding
Before using this skill on any mutating, irreversible, or high-blast-radius task:
- ART — Attune (what is the real task?), Recognize (what class of power?), Test (fit · authority · evidence · blast · reversible).
- Kernel — Route to arifOS for F1–F13 judgment if action class is Maker/Messenger/Mutator/Destroyer/Sovereign.
- ACT — Apply narrow, Constrain scope, Trace witness, STOP before corruption.
- Receipt — Leave evidence of what changed, why, and under whose authority.
When to Use
- A Docker container or compose stack appears unhealthy, restarting, or resource-starved.
- Disk pressure, memory pressure, or CPU saturation is suspected on the VPS.
- You need to decide whether to restart, prune, inspect logs, or escalate.
- An MCP server returns connection refused, timeout, or 5xx.
- Caddy HTTP 502/504 error spikes detected.
- Federation status report needed.
- Container restart count tracking (flag containers with >3 restarts).
- After cron changes to verify telemetry pipeline.
When NOT to Use
- Do not use for non-Docker services (systemd-native, bare-metal processes) — use systemd skills.
- Do not use for Kubernetes or Swarm orchestration (not deployed).
- Do not use for Docker image authoring, Dockerfile creation, or CI/CD pipeline configuration.
- Do not use as authority to run destructive commands without 888 HOLD.
Section 1: Federation Orchestrator
Commands
# Full federation status
docker compose ps
docker ps -a --filter "status=restarting"
# Check organ endpoints (verified 2026-08-14)
for url in 8088 7071 7072 7073 7074 8081 18082 18083; do
curl -s -o /dev/null -w "%{http_code} :$url\n" --max-time 5 http://localhost:$url/health
done
# Restart dead container
docker compose restart <service>
docker restart <container>
# Restart count audit
docker inspect --format='{{.Name}} {{.RestartCount}}' $(docker ps -aq)
# Federation stack locations
cd /root/arifOS && docker compose ps
cd /root/AAA && docker compose ps
Health Probe Script
#!/bin/bash
for port in 8088 7071 7072 7073 7074 8081 18082 18083; do
code=$(curl -s -o /dev/null -w "%{http_code}" --max-time 5 http://localhost:$port/health)
if [ "$code" = "200" ]; then
echo "✅ MCP:$port OK"
else
echo "❌ MCP:$port FAILED (HTTP $code)"
fi
done
Restart Count Thresholds
| Restarts |
Severity |
Action |
| 0 |
✅ Healthy |
No action |
| 1–3 |
⚠️ Watch |
Log + warn |
| 4–9 |
🔴 Degraded |
Alert + review |
| 10+ |
⛔ Critical |
Auto-restart cooldown + human alert |
Observed Port Map (verified 2026-08-14 via ss + systemctl + curl)
| Port |
Service |
Owner |
| 8088 |
arifOS kernel |
systemd arifos.service |
| 7071 |
A-FORGE executor |
systemd a-forge.service |
| 7072 |
A-FORGE MCP gateway |
systemd a-forge-mcp.service |
| 7073 |
arifFlow daemon |
systemd arifflow.service |
| 7074 |
FED router |
systemd fed-router.service |
| 8081 |
GEOX MCP |
systemd geox-mcp.service |
| 18082 |
WEALTH |
systemd wealth-organ.service |
| 18083 |
WELL |
systemd (python3) |
| 8080 |
searxng (Docker) |
NOT an organ — do not probe as arifOS |
| 8083 |
headscale |
NOT an organ |
Federation Nodes (LEGACY docker-compose era — verify at runtime before trusting)
| Container |
Port |
Stack |
Criticality |
| arifosmcp |
8080 |
arifOS |
CRITICAL |
| geox_eic |
8081 |
GEOX |
CRITICAL |
| wealth-organ |
8082 |
WEALTH |
HIGH |
| well |
8083 |
WELL |
HIGH |
| vault999 |
— |
Vault999 |
CRITICAL |
| postgres |
5432 |
arifOS |
CRITICAL |
| qdrant |
6333 |
arifOS |
HIGH |
| redis |
6379 |
arifOS |
HIGH |
| nats |
4222 |
arifOS |
MEDIUM |
| aaa-a2a |
3001 |
AAA |
HIGH |
| searxng |
8080 |
Search |
LOW |
| netdata |
19999 |
Monitoring |
LOW |
Section 2: VPS Telemetry Auto-Healer
Diagnostic & Triage Workflow
1. Check Container Health & Memory Throttling
docker stats --no-stream --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.PIDs}}"
2. Scan Caddy Log Stream for 502 / 504 Spikes
tail -n 200 /var/log/caddy/access.log | grep -E "status\":(502|504|500)"
3. Graceful Container Self-Healing Circuit
# Verify container failure state before restart
if ! docker inspect --format='{{.State.Health.Status}}' searxng | grep -q "healthy"; then
echo "[AUTO-HEALER] SearXNG unhealthy. Restarting..."
docker restart searxng
fi
Best Practices
- Governed Recovery: Always verify container failure traceback before executing restart operations.
- Telemetry Log Receipt: Record all auto-healing actions in
telemetry_audit.log.
Section 3: Docker Entropy — Thermodynamic Fleet Health
Step 1: Read Fleet Entropy
Run these in order before any intervention:
docker ps — what is running, dead, or restarting?
docker stats --no-stream — who is consuming CPU/memory?
docker system df — how much disk entropy (images, volumes, build cache) has accumulated?
docker compose ps and docker compose config if a compose stack is involved.
Step 2: Interpret Signal Priority
Rank findings in this order:
- Container health status (Up vs Restarting vs Exited)
- Memory pressure (approaching limit)
- Disk entropy (dangling images, volumes, build cache)
- CPU saturation (sustained >80%)
- Log anomalies (error rate spikes)
Step 3: Choose the Intervention Class
Safe / reversible — proceed with witness:
docker compose config (validate, no mutation)
docker compose ps (state inspection)
docker logs --tail=N <service> (observation)
docker compose restart <service> (reversible)
docker compose up -d <service> (restore known state)
Dangerous / irreversible — 888 HOLD required:
docker system prune -af --volumes (irreversible disk purge)
docker rm -f <container> (data loss risk)
docker volume rm <volume> (permanent data destruction)
docker rmi <image> when the image is actively used
Step 4: Apply Uncertainty Protocol
- Container is Restarting → read logs before restarting again.
- Disk usage >85% → diagnose before pruning.
- Unsure whether a volume is in use → inspect; do not delete.
- Service unhealthy but cause unclear → 888 HOLD.
- Never prune without first running
docker system df.
Alert Conditions
| Condition |
Action |
| MCP HTTP 000/502/503 |
Auto-restart container + log |
| MCP response > 3s |
WARN in heartbeat |
| Model provider 401/402 |
Disable from fallback chain + alert |
| Ollama cold-start > 15s |
Pre-warm model via /api/generate |
| Caddy 502/504 spike |
Scan logs, identify target container, verify + restart |
| Container restart count > 3 |
Flag degraded, review logs |
| Disk entropy > 85% |
Diagnose before pruning, 888 HOLD for prune |
Allowed Tools
| Tool / Command |
Purpose |
docker ps |
Fleet state snapshot |
docker stats --no-stream |
Resource consumption |
docker system df |
Disk entropy inventory |
docker logs --tail=N <service> |
Diagnostic observation |
docker compose ps |
Compose stack state |
docker compose config |
Validate compose configuration |
docker compose restart <service> |
Reversible service restart |
docker compose up -d <service> |
Restore known-good state |
docker inspect |
Container health status, restart count |
curl |
MCP endpoint health probes |
tail / grep |
Caddy log stream analysis |
Forbidden Actions
- NEVER run
docker system prune -af as a first response to any problem (panic pruning).
- NEVER restart a container without reading its logs first.
- NEVER assume "container is Up" means "container is healthy".
- NEVER ignore disk entropy until it causes system failure.
- NEVER delete volumes without verifying they contain no critical data.
- NEVER run prune without human confirmation (F1 violation).
- NEVER restart Vault999 — append-only ledger, human ack required.
- NEVER restart multiple containers simultaneously — avoid federation cascade.
- Escalate to arifOS 888_JUDGE before any destructive action.
Output Format
## Skill Result: federation-health
### Summary
One-paragraph summary of fleet thermodynamic state and chosen intervention.
### Evidence
- Container state: <running / restarting / exited>
- Resource pressure: <CPU / memory / disk findings>
- Disk entropy: <docker system df output>
- Log anomalies: <yes/no with snippet>
- Caddy errors: <502/504 count in last N requests>
### Recommendations
- Safe reversible action, OR
- 888 HOLD with reason and proposed next step
### Escalations
- None / <list>
Escalation Path
| Condition |
Escalate To |
Method |
| Destructive or irreversible Docker action |
arifOS 888_JUDGE + Arif |
888 HOLD |
| Data-loss risk (volume/container removal) |
arifOS 888_JUDGE |
verdict_request |
| Scope creep into systemd/K8s/Dockerfile work |
STOP; route to correct skill |
A2A message |
| Root cause unclear after diagnosis |
arifOS 888_JUDGE |
hold with reason |
| All containers healthy but Caddy still 502 |
Caddy config review + arifOS |
health triage |
Consolidated 2026-08-26 from: FORGE-federation-orchestrator, vps-telemetry-auto-healer, FORGE-docker-entropy.
AAA Skill Library — version 2.0.0
1---2name: federation-health3description: >4 Unified federation monitoring, container health, auto-recovery, and entropy reasoning. Covers5 federation orchestration (docker compose, restart, MCP health probes, container drift detection),6 VPS telemetry auto-healing (Caddy error spikes, container log analysis, automated recovery), and7 Docker entropy reasoning (thermodynamic fleet health, resource pressure, safe/dangerous intervention8 boundaries). Merges: FORGE-federation-orchestrator, vps-telemetry-auto-healer, FORGE-docker-entropy.9id: federation-health10version: 2.0.011owner: A-FORGE12risk_tier: low13floor_scope: [F1, F2, F3, F4, F8, F11, F13]14autonomy_tier: T115tags: [federation, docker, health, monitoring, recovery, entropy, telemetry, caddy, container, orchestrator]16capability_tier: fed-agent-subagent17ecology_state: WARM18supersedes:19 - FORGE-federation-orchestrator20 - vps-telemetry-auto-healer21 - FORGE-docker-entropy22triggers:23 - "federation status"24 - "restart dead container"25 - "container health"26 - "docker drift"27 - "service down"28 - "probe MCP"29 - "health check federation"30 - "docker compose"31 - "container restart"32 - "restart count"33 - "Caddy error"34 - "502 spike"35 - "504 spike"36 - "auto-healer"37 - "container recovery"38 - "docker entropy"39 - "docker system df"40 - "disk pressure"41 - "memory pressure"42 - "container fleet"43 - "thermodynamic"44 - "docker prune"45 - "resource pressure"46---4748# Federation Health4950> **Three domains unified:** Federation Orchestrator + VPS Telemetry Auto-Healer + Docker Entropy.51> Containers are thermodynamic systems: CPU is energy, memory is state, disk is storage, network is exchange.52> *DITEMPA BUKAN DIBERI*5354## Overview5556Unified federation health covering three domains:571. **Federation Orchestrator** — Monitor and manage the arifOS federation: docker compose ps, restart dead services, MCP health probes, container drift detection, restart count monitoring.582. **VPS Telemetry Auto-Healer** — Real-time Caddy HTTP error spike monitor, Docker container log stream analyzer, and automated container health recovery watchdog.593. **Docker Entropy** — Thermodynamic reasoning lens for container fleet health, resource pressure, and safe/dangerous intervention boundaries.6061## arifOS-ACT Embedding6263Before using this skill on any mutating, irreversible, or high-blast-radius task:641. **ART** — Attune (what is the real task?), Recognize (what class of power?), Test (fit · authority · evidence · blast · reversible).652. **Kernel** — Route to arifOS for F1–F13 judgment if action class is Maker/Messenger/Mutator/Destroyer/Sovereign.663. **ACT** — Apply narrow, Constrain scope, Trace witness, STOP before corruption.674. **Receipt** — Leave evidence of what changed, why, and under whose authority.6869## When to Use7071- A Docker container or compose stack appears unhealthy, restarting, or resource-starved.72- Disk pressure, memory pressure, or CPU saturation is suspected on the VPS.73- You need to decide whether to restart, prune, inspect logs, or escalate.74- An MCP server returns connection refused, timeout, or 5xx.75- Caddy HTTP 502/504 error spikes detected.76- Federation status report needed.77- Container restart count tracking (flag containers with >3 restarts).78- After cron changes to verify telemetry pipeline.7980## When NOT to Use8182- **Do not use** for non-Docker services (systemd-native, bare-metal processes) — use systemd skills.83- **Do not use** for Kubernetes or Swarm orchestration (not deployed).84- **Do not use** for Docker image authoring, Dockerfile creation, or CI/CD pipeline configuration.85- **Do not use** as authority to run destructive commands without 888 HOLD.8687---8889## Section 1: Federation Orchestrator9091### Commands9293```bash94# Full federation status95docker compose ps96docker ps -a --filter "status=restarting"9798# Check organ endpoints (verified 2026-08-14)99for url in 8088 7071 7072 7073 7074 8081 18082 18083; do100 curl -s -o /dev/null -w "%{http_code} :$url\n" --max-time 5 http://localhost:$url/health101done102103# Restart dead container104docker compose restart <service>105docker restart <container>106107# Restart count audit108docker inspect --format='{{.Name}} {{.RestartCount}}' $(docker ps -aq)109110# Federation stack locations111cd /root/arifOS && docker compose ps112cd /root/AAA && docker compose ps113```114115### Health Probe Script116117```bash118#!/bin/bash119for port in 8088 7071 7072 7073 7074 8081 18082 18083; do120 code=$(curl -s -o /dev/null -w "%{http_code}" --max-time 5 http://localhost:$port/health)121 if [ "$code" = "200" ]; then122 echo "✅ MCP:$port OK"123 else124 echo "❌ MCP:$port FAILED (HTTP $code)"125 fi126done127```128129### Restart Count Thresholds130131| Restarts | Severity | Action |132|---|---|---|133| 0 | ✅ Healthy | No action |134| 1–3 | ⚠️ Watch | Log + warn |135| 4–9 | 🔴 Degraded | Alert + review |136| 10+ | ⛔ Critical | Auto-restart cooldown + human alert |137138### Observed Port Map (verified 2026-08-14 via ss + systemctl + curl)139140| Port | Service | Owner |141|---|---|---|142| 8088 | arifOS kernel | systemd arifos.service |143| 7071 | A-FORGE executor | systemd a-forge.service |144| 7072 | A-FORGE MCP gateway | systemd a-forge-mcp.service |145| 7073 | arifFlow daemon | systemd arifflow.service |146| 7074 | FED router | systemd fed-router.service |147| 8081 | GEOX MCP | systemd geox-mcp.service |148| 18082 | WEALTH | systemd wealth-organ.service |149| 18083 | WELL | systemd (python3) |150| 8080 | searxng (Docker) | NOT an organ — do not probe as arifOS |151| 8083 | headscale | NOT an organ |152153### Federation Nodes (LEGACY docker-compose era — verify at runtime before trusting)154155| Container | Port | Stack | Criticality |156|---|---|---|---|157| arifosmcp | 8080 | arifOS | CRITICAL |158| geox_eic | 8081 | GEOX | CRITICAL |159| wealth-organ | 8082 | WEALTH | HIGH |160| well | 8083 | WELL | HIGH |161| vault999 | — | Vault999 | CRITICAL |162| postgres | 5432 | arifOS | CRITICAL |163| qdrant | 6333 | arifOS | HIGH |164| redis | 6379 | arifOS | HIGH |165| nats | 4222 | arifOS | MEDIUM |166| aaa-a2a | 3001 | AAA | HIGH |167| searxng | 8080 | Search | LOW |168| netdata | 19999 | Monitoring | LOW |169170---171172## Section 2: VPS Telemetry Auto-Healer173174### Diagnostic & Triage Workflow175176#### 1. Check Container Health & Memory Throttling177```bash178docker stats --no-stream --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.PIDs}}"179```180181#### 2. Scan Caddy Log Stream for 502 / 504 Spikes182```bash183tail -n 200 /var/log/caddy/access.log | grep -E "status\":(502|504|500)"184```185186#### 3. Graceful Container Self-Healing Circuit187```bash188# Verify container failure state before restart189if ! docker inspect --format='{{.State.Health.Status}}' searxng | grep -q "healthy"; then190 echo "[AUTO-HEALER] SearXNG unhealthy. Restarting..."191 docker restart searxng192fi193```194195### Best Practices1961. **Governed Recovery**: Always verify container failure traceback before executing restart operations.1972. **Telemetry Log Receipt**: Record all auto-healing actions in `telemetry_audit.log`.198199---200201## Section 3: Docker Entropy — Thermodynamic Fleet Health202203### Step 1: Read Fleet Entropy204205Run these in order before any intervention:2062071. `docker ps` — what is running, dead, or restarting?2082. `docker stats --no-stream` — who is consuming CPU/memory?2093. `docker system df` — how much disk entropy (images, volumes, build cache) has accumulated?2104. `docker compose ps` and `docker compose config` if a compose stack is involved.211212### Step 2: Interpret Signal Priority213214Rank findings in this order:2151. Container health status (Up vs Restarting vs Exited)2162. Memory pressure (approaching limit)2173. Disk entropy (dangling images, volumes, build cache)2184. CPU saturation (sustained >80%)2195. Log anomalies (error rate spikes)220221### Step 3: Choose the Intervention Class222223**Safe / reversible — proceed with witness:**224- `docker compose config` (validate, no mutation)225- `docker compose ps` (state inspection)226- `docker logs --tail=N <service>` (observation)227- `docker compose restart <service>` (reversible)228- `docker compose up -d <service>` (restore known state)229230**Dangerous / irreversible — 888 HOLD required:**231- `docker system prune -af --volumes` (irreversible disk purge)232- `docker rm -f <container>` (data loss risk)233- `docker volume rm <volume>` (permanent data destruction)234- `docker rmi <image>` when the image is actively used235236### Step 4: Apply Uncertainty Protocol237238- Container is Restarting → read logs before restarting again.239- Disk usage >85% → diagnose before pruning.240- Unsure whether a volume is in use → inspect; do not delete.241- Service unhealthy but cause unclear → 888 HOLD.242- Never prune without first running `docker system df`.243244---245246## Alert Conditions247248| Condition | Action |249|-----------|--------|250| MCP HTTP 000/502/503 | Auto-restart container + log |251| MCP response > 3s | WARN in heartbeat |252| Model provider 401/402 | Disable from fallback chain + alert |253| Ollama cold-start > 15s | Pre-warm model via `/api/generate` |254| Caddy 502/504 spike | Scan logs, identify target container, verify + restart |255| Container restart count > 3 | Flag degraded, review logs |256| Disk entropy > 85% | Diagnose before pruning, 888 HOLD for prune |257258## Allowed Tools259260| Tool / Command | Purpose |261|----------------|---------|262| `docker ps` | Fleet state snapshot |263| `docker stats --no-stream` | Resource consumption |264| `docker system df` | Disk entropy inventory |265| `docker logs --tail=N <service>` | Diagnostic observation |266| `docker compose ps` | Compose stack state |267| `docker compose config` | Validate compose configuration |268| `docker compose restart <service>` | Reversible service restart |269| `docker compose up -d <service>` | Restore known-good state |270| `docker inspect` | Container health status, restart count |271| `curl` | MCP endpoint health probes |272| `tail` / `grep` | Caddy log stream analysis |273274## Forbidden Actions275276- **NEVER** run `docker system prune -af` as a first response to any problem (panic pruning).277- **NEVER** restart a container without reading its logs first.278- **NEVER** assume "container is Up" means "container is healthy".279- **NEVER** ignore disk entropy until it causes system failure.280- **NEVER** delete volumes without verifying they contain no critical data.281- **NEVER** run prune without human confirmation (F1 violation).282- **NEVER** restart Vault999 — append-only ledger, human ack required.283- **NEVER** restart multiple containers simultaneously — avoid federation cascade.284- Escalate to **arifOS 888_JUDGE** before any destructive action.285286## Output Format287288```289## Skill Result: federation-health290291### Summary292One-paragraph summary of fleet thermodynamic state and chosen intervention.293294### Evidence295- Container state: <running / restarting / exited>296- Resource pressure: <CPU / memory / disk findings>297- Disk entropy: <docker system df output>298- Log anomalies: <yes/no with snippet>299- Caddy errors: <502/504 count in last N requests>300301### Recommendations302- Safe reversible action, OR303- 888 HOLD with reason and proposed next step304305### Escalations306- None / <list>307```308309## Escalation Path310311| Condition | Escalate To | Method |312|-----------|-------------|--------|313| Destructive or irreversible Docker action | arifOS 888_JUDGE + Arif | 888 HOLD |314| Data-loss risk (volume/container removal) | arifOS 888_JUDGE | verdict_request |315| Scope creep into systemd/K8s/Dockerfile work | STOP; route to correct skill | A2A message |316| Root cause unclear after diagnosis | arifOS 888_JUDGE | hold with reason |317| All containers healthy but Caddy still 502 | Caddy config review + arifOS | health triage |318319---320321*Consolidated 2026-08-26 from: FORGE-federation-orchestrator, vps-telemetry-auto-healer, FORGE-docker-entropy.*322*AAA Skill Library — version 2.0.0*