Drift Watch — Probe-Based (v1.1.0)
A service running is not the same as a service running what you think. This skill surfaces that gap using LIVE organ registry data — zero hardcoded paths or ports.
Canonical SOT
The organ registry at /root/AAA/federation/organs.yaml is the single source of truth for organ names, source paths, runtime locations, ports, and health endpoints. Read it FIRST.
# Discover all organs
python3 -c "
import yaml, json
with open('/root/AAA/federation/organs.yaml') as f:
reg = yaml.safe_load(f)
for o in reg.get('organs', []):
print(f'{o[\"id\"]} src={o.get(\"source_path\",\"?\")} runtime={o.get(\"runtime_path\",\"?\")} port={o.get(\"port\",\"?\")}')
"
Steps
Read organ registry — cat /root/AAA/federation/organs.yaml or use the python snippet above. This gives you source_path, runtime_path, and port for every organ.
For each organ with a source_path:
git -C <source_path> rev-parse HEAD → source SHA
cat <runtime_path>/.git_commit 2>/dev/null → runtime SHA (if file exists)
- Compare → if mismatch → DRIFT
For each organ with a port:
curl -sf --max-time 2 http://localhost:<port>/health → probe live health
- Parse the software_release block for deployed_commit
- Cross-reference with source SHA
If DRIFT detected:
- Source newer than runtime →
make deploy-local candidate (per-organ)
- Runtime newer than source → runtime patch not in source → 888 HOLD
- Runtime
.git_commit missing → warn, treat source as truth
Also check (from registry, not hardcoded):
- Caddy port map:
/etc/caddy/Caddyfile (sovereign-locked)
- systemd units:
systemctl list-units --type=service | grep -E 'arifos|aforge|geox|wealth|well|aaa|arifflow'
- env file presence:
/root/.secrets/kunci-mas.env (mode 600)
Organ topology (derived live from registry — this table is a CACHED EXAMPLE, probe for truth)
| Organ |
Source discovery |
Runtime discovery |
Health probe |
| arifOS |
registry source_path |
registry runtime_path |
curl :8088/health |
| A-FORGE |
registry source_path |
registry runtime_path |
curl :7071/health |
| GEOX |
registry source_path |
registry runtime_path |
curl :8081/health |
| WEALTH |
registry source_path |
registry runtime_path |
curl :18082/health |
| WELL |
registry source_path |
registry runtime_path |
curl :18083/health |
| AAA |
registry source_path |
registry runtime_path |
curl :3001/health |
| arifFlow |
registry source_path |
registry runtime_path |
curl :7073/health |
Rule: The table above is illustrative. The organ registry is authoritative. If they differ, the registry wins. Fix this SKILL.md.
Verification loop
- Match → no action
- Mismatch → log + 888 HOLD with both SHAs + recommended action
.git_commit missing on runtime → log warning, treat source as truth
- Organ DOWN → skip SHA comparison for that organ, flag in report
Failure modes
- Runtime file missing → assume source is truth, surface to operator
- Mismatch in
.git_commit only (cosmetic) → warn, don't HOLD
- Source repo not on
main → flag, ask if intentional
- Registry unreachable → fall back to filesystem inspection of known paths
De-hardcoding log (v1.1.0)
- Replaced hardcoded organ paths with registry-derived values
- Port numbers read from
/root/AAA/federation/organs.yaml live
- Health endpoints probed dynamically rather than assumed
- Added graceful degradation: if registry unavailable, fall back to filesystem scan
1---2name: asi-drift-watch3id: asi-drift-watch4version: 1.1.05owner: 555-ASI6risk_tier: low7description: Detect drift between federation source and runtime. Reads organ topology8 from /root/AAA/federation/organs.yaml (canonical SOT), probes live health endpoints,9 and compares git SHAs. No hardcoded paths or ports — everything derived from live registry.10when_to_use: After deploy, when organ behavior surprises you, weekly health audit,11 before any "is it running what I think?" question.12disable-model-invocation: false13allowed_tools:14- Bash15- Read16- Grep17floor_scope:18- F119- F220- F421- F722- F1123autonomy_tier: T024capability_tier: fed-agent-subagent25ecology_state: WARM26required_tools: ['arif_observe', 'forge_fetch']27tool_gate: permissive2829---3031# Drift Watch — Probe-Based (v1.1.0)3233A service running is not the same as a service running what you think. This skill surfaces that gap using LIVE organ registry data — zero hardcoded paths or ports.3435## Canonical SOT3637The organ registry at `/root/AAA/federation/organs.yaml` is the single source of truth for organ names, source paths, runtime locations, ports, and health endpoints. Read it FIRST.3839```bash40# Discover all organs41python3 -c "42import yaml, json43with open('/root/AAA/federation/organs.yaml') as f:44 reg = yaml.safe_load(f)45for o in reg.get('organs', []):46 print(f'{o[\"id\"]} src={o.get(\"source_path\",\"?\")} runtime={o.get(\"runtime_path\",\"?\")} port={o.get(\"port\",\"?\")}')47"48```4950## Steps51521. **Read organ registry** — `cat /root/AAA/federation/organs.yaml` or use the python snippet above. This gives you source_path, runtime_path, and port for every organ.53542. **For each organ** with a source_path:55 - `git -C <source_path> rev-parse HEAD` → source SHA56 - `cat <runtime_path>/.git_commit 2>/dev/null` → runtime SHA (if file exists)57 - Compare → if mismatch → DRIFT58593. **For each organ** with a port:60 - `curl -sf --max-time 2 http://localhost:<port>/health` → probe live health61 - Parse the software_release block for deployed_commit62 - Cross-reference with source SHA63644. **If DRIFT detected:**65 - Source newer than runtime → `make deploy-local` candidate (per-organ)66 - Runtime newer than source → runtime patch not in source → 888 HOLD67 - Runtime `.git_commit` missing → warn, treat source as truth68695. **Also check (from registry, not hardcoded):**70 - Caddy port map: `/etc/caddy/Caddyfile` (sovereign-locked)71 - systemd units: `systemctl list-units --type=service | grep -E 'arifos|aforge|geox|wealth|well|aaa|arifflow'`72 - env file presence: `/root/.secrets/kunci-mas.env` (mode 600)7374## Organ topology (derived live from registry — this table is a CACHED EXAMPLE, probe for truth)7576| Organ | Source discovery | Runtime discovery | Health probe |77|-------|-----------------|-------------------|-------------|78| arifOS | registry `source_path` | registry `runtime_path` | `curl :8088/health` |79| A-FORGE | registry `source_path` | registry `runtime_path` | `curl :7071/health` |80| GEOX | registry `source_path` | registry `runtime_path` | `curl :8081/health` |81| WEALTH | registry `source_path` | registry `runtime_path` | `curl :18082/health` |82| WELL | registry `source_path` | registry `runtime_path` | `curl :18083/health` |83| AAA | registry `source_path` | registry `runtime_path` | `curl :3001/health` |84| arifFlow | registry `source_path` | registry `runtime_path` | `curl :7073/health` |8586**Rule:** The table above is illustrative. The organ registry is authoritative. If they differ, the registry wins. Fix this SKILL.md.8788## Verification loop89- Match → no action90- Mismatch → log + 888 HOLD with both SHAs + recommended action91- `.git_commit` missing on runtime → log warning, treat source as truth92- Organ DOWN → skip SHA comparison for that organ, flag in report9394## Failure modes95- Runtime file missing → assume source is truth, surface to operator96- Mismatch in `.git_commit` only (cosmetic) → warn, don't HOLD97- Source repo not on `main` → flag, ask if intentional98- Registry unreachable → fall back to filesystem inspection of known paths99100## De-hardcoding log (v1.1.0)101- Replaced hardcoded organ paths with registry-derived values102- Port numbers read from `/root/AAA/federation/organs.yaml` live103- Health endpoints probed dynamically rather than assumed104- Added graceful degradation: if registry unavailable, fall back to filesystem scan