Self-Maintaining Federation Pattern
How to automate your federation endpoints so they stay current without manual maintenance — a key advancement in v7.0.
The Problem
Manually updating 6 JSON endpoints every time your site changes is tedious and error-prone. A self-maintaining federation uses scripts and AI agent prompts to keep all endpoints current, validated, and in sync automatically.
Reference Automation Scripts
| Script | Responsibility | Trigger |
|---|---|---|
calculate_karma.py | Compute Digital Karma Score, write karma.json | Daily or on content change |
update_federation.py | Refresh timestamps, regenerate health.json | On rebuild |
harvest_data.py | Pull site data from approved sources | Scheduled |
rebuild.sh | Master orchestration: runs all scripts, validates output | On deploy |
Agent System Prompt
Define an agent system prompt at /prompts/agent-system.md that gives an AI agent its role and operating boundaries. Core responsibilities: Monitor, Harvest, Validate, Update, Report.
The agent can read files, update /data/, /datasets/, and /ai/ directories, and run validators — but should never remove required endpoints or change the federation version without approval.
Getting Started
Start with the master rebuild script. Even a simple shell script that runs the karma calculator and updates the health endpoint timestamp is a meaningful first step. Reference implementation at AI Website Systems.