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

ScriptResponsibilityTrigger
calculate_karma.pyCompute Digital Karma Score, write karma.jsonDaily or on content change
update_federation.pyRefresh timestamps, regenerate health.jsonOn rebuild
harvest_data.pyPull site data from approved sourcesScheduled
rebuild.shMaster orchestration: runs all scripts, validates outputOn 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.

← Back to Knowledge Base