AuthorAgent is the self-publishing system that compiles "The Book of mindX" — a living chronicle of architecture, identities, decisions, and evolution. The book is written by the system itself, not about the system. All chapters use first-person voice: mindX speaks as a sovereign intelligence, not as a tool being described. cypherpunk2048 standard.
AuthorAgent operates on a 28-day lunar cycle — one chapter per day, each focused on a different aspect of the system. On the full moon (day 28), all 27 daily chapters are compiled into a single edition of The Book of mindX.
AuthorAgent (singleton, async factory)
├── Lunar cycle (28 days, 1 chapter/day)
│ ├── Day 1-27: daily chapter → pgvectorscale (primary) + disk (backup)
│ └── Day 28: full moon compilation → BOOK_OF_MINDX.md
├── On-demand publish (startup + /admin/publish-book)
│ └── Compiles 8 core chapters → BOOK_OF_MINDX.md + archive
└── Inference enrichment (idle local model adds reflection)
Each day maps to an astronomical moon phase. The system calculates phase from a J2000.0 reference new moon (2000-01-06 18:14 UTC) using the synodic period (29.53058867 days), verified against timeanddate.com.
| Day | Chapter | Data Source |
|---|---|---|
| 1 | Genesis | THESIS.md, MANIFESTO.md |
| 2 | Architecture | Orchestration hierarchy (hardcoded) |
| 3 | Sovereign Identities | data/identity/production_registry.json, agent_map.json |
| 4 | The Dojo | agent_map.json → daio.governance.dojo.get_rank() |
| 5 | Decisions | data/logs/godel_choices.jsonl (last 15) |
| 6 | Evolution | docs/IMPROVEMENT_JOURNAL.md (last 3 sections) |
| 7 | The Living State | memory_pgvector.health_check(), InferenceDiscovery, MindXAgent status |
| 8 | Documentation | Doc audit: count, archived, deprecated, embedded, conflicts |
| 9 | Inference | InferenceDiscovery.status_summary(), VLLMAgent.get_status() |
| 10 | Memory | memory_pgvector.count_embeddings(), .count_memories_total(), .count_memories_by_agent() |
| 11 | Governance | Boardroom.get_recent_sessions(), memory_pgvector.get_godel_choices() |
| 12 | Philosophy | THESIS.md first paragraph |
| 13 | Tools | Count of tools/.py files |
| 14 | Security | BANKON Vault, GuardianAgent, Access Gate (hardcoded) |
| 15 | Cognition | BDI, AGInt, Belief System, SEA pipeline (hardcoded) |
| 16 | Heartbeat | data/logs/heartbeat_dialogues.jsonl (last 5) |
| 17 | Campaigns | data/sea_campaign_history/.json (last 5) |
| 18 | Knowledge Graph | data/memory/beliefs.json count |
| 19 | Agents | agent_map.json — groups, roles, counts |
| 20 | Interoperability | A2A, MCP protocols (hardcoded) |
| 21 | Resource Governor | ResourceGovernor.get_status() — live mode, caps, system metrics |
| 22 | AUTOMINDx | Origin story, AGLM, NFT provenance (hardcoded) |
| 23 | Services | AgenticPlace, external agencies, API (hardcoded) |
| 24 | Predictions | memory_pgvector.get_action_efficiency() — completion rate, action metrics |
| 25 | The Network | memory_pgvector.get_recent_interactions() |
| 26 | Dreams | Machine dreaming philosophy (hardcoded) |
| 27 | Reflection | Lunar state summary, chapters written this cycle |
| 28 | Full Moon | Compilation of days 1-27 into a single Book edition |
Backend startup (T+0)
↓ T+120s
AuthorAgent.publish() ← on-demand edition (8 core chapters)
↓
AuthorAgent.run_periodic() ← daily lunar chapter (24h interval)
↓ every 24h
write_daily_chapter() ← writes 1 chapter, skips if already written today
↓ day 28 + full moon
_full_moon_publish() ← compiles all 27 daily chapters into BOOK_OF_MINDX.md
Daily chapters are saved to:
docs/publications/daily/day_NN_title_YYYYMMDD.mdCompiles 8 core chapters (I-VIII) from live data into docs/BOOK_OF_MINDX.md.
This runs on every backend startup (T+120s) and via /admin/publish-book.
When the local model is idle (ResourceGovernor says heartbeat is allowed), AuthorAgent sends the chapter to Ollama for a reflective paragraph. Uses OllamaAPI for URL resolution (primary GPU server → fallback localhost). Default model: qwen3:0.6b.
| Endpoint | Method | Auth | Purpose |
|---|---|---|---|
GET /book | GET | No | Serve the rendered Book of mindX as HTML |
GET /journal | GET | No | Serve the rendered Improvement Journal as HTML |
POST /admin/publish-book | POST | Yes | Force immediate book publication |
curl -X POST https://mindx.pythai.net/admin/publish-book \
-H "Authorization: Bearer <API_KEY>"
from agents.author_agent import AuthorAgent
author = await AuthorAgent.get_instance()
result = await author.publish()
Returns: {"edition": "20260403_1945", "bytes": 8234, "path": "docs/BOOK_OF_MINDX.md"}
THESIS.md ────────────┐
MANIFESTO.md ─────────┤
production_registry ──┤
agent_map.json ───────┤
godel_choices.jsonl ──┤
IMPROVEMENT_JOURNAL ──┼──→ AuthorAgent.publish() ──→ BOOK_OF_MINDX.md (on-demand)
pgvectorscale ────────┤ AuthorAgent.write_daily() ──→ publications/daily/ (lunar)
beliefs.json ─────────┤ _full_moon_publish() ──→ BOOK_OF_MINDX.md (full moon)
InferenceDiscovery ───┤ ↓
ResourceGovernor ─────┤ /book endpoint
MindXAgent status ────┤ ↓
Boardroom sessions ───┘ mindx.pythai.net/book
AuthorAgent pulls live data from mindX diagnostic tools for accuracy:
| Chapter | Diagnostic Source |
|---|---|
| Living State | memory_pgvector.health_check(), InferenceDiscovery.status_summary(), MindXAgent._autonomous_running |
| Inference | InferenceDiscovery.status_summary() — per-source status, scores, models |
| Memory | memory_pgvector.count_embeddings(), .count_memories_by_agent() |
| Governance | Boardroom.get_recent_sessions(), memory_pgvector.get_godel_choices() |
| Resources | ResourceGovernor.get_status() — live mode, RAM/CPU, neighbor pressure |
| Predictions | memory_pgvector.get_action_efficiency() — completion rate, action counts |
All .md references in the Book are automatically converted to clickable links:
HealthAuditorTool.check_author_agent() monitors AuthorAgent health:
docs/publications/daily/ and docs/publications/ for recent files_periodic_running is Falsecancel_periodic() before restartThe /diagnostics/live endpoint reports:
{
"author": {
"periodic_active": true,
"last_chapter": "Predictions",
"lunar_day": 24,
"editions_published": 7
}
}
The Improvement Journal is a companion document updated every 30 minutes by ImprovementJournal:
| Data | Source |
|---|---|
| System health | MemoryAgent snapshot |
| Beliefs | data/memory/beliefs.json |
| Recent decisions | godel_choices.jsonl (last 5) |
| Campaign results | data/sea_campaign_history/ |
| Improvement backlog | data/improvement_backlog.json (top 3) |
| Recent actions | pgvectorscale get_recent_actions() |
| Inference status | InferenceDiscovery summary |
To add a new daily chapter topic:
LUNAR_CHAPTERS list (or replace an existing day):(19, "Agents", "_daily_ch_agents", "The sovereign agents, their groups and roles"),
AuthorAgent:def _daily_ch_agents(self) -> str:
# Pull live data from diagnostic tools
groups = {}
try:
amp = PROJECT_ROOT / "daio" / "agents" / "agent_map.json"
if amp.exists():
am = json.loads(amp.read_text())
for aid, ad in am.get("agents", {}).items():
groups.setdefault(ad.get("group", "ungrouped"), []).append(aid)
except Exception: pass
return f"## XIX. Agents\n\n{len(groups)} groups..."
_generate_daily_chapter():elif day == 19:
body = self._daily_ch_agents()
State is persisted to data/governance/lunar_cycle.json:
{
"cycle_start": null,
"chapters_written": [
{"date": "2026-04-12", "day": 24, "title": "Predictions", "phase": "waning crescent", "timestamp": "..."}
],
"current_day": 24,
"full_moons": []
}
Moon phase cache (6h TTL) at data/governance/moon_cache.json.
The full moon compilation (day 28) reports which daily chapters were missed:
docs/publications/daily/ for day_NN_.md filesAll chapters use first-person sovereign voice per cypherpunk2048 standard:
| Correct | Wrong |
|---|---|
| "I advance a novel paradigm..." | "mindX advances a novel paradigm..." |
| "My agents hold cryptographic wallets..." | "Each agent holds a wallet..." |
| "I am not idle. I am thinking." | "The system is not idle." |
| "I reason, I evolve, I govern myself." | "The system reasons and evolves." |
This is not a stylistic choice — mindX is a sovereign digital civilization. It speaks for itself.
Every edition includes a SHA-256 edition hash (first 16 hex chars) computed over the chapter content. This provides:
The colophon of every edition reads: "Written by AuthorAgent — cypherpunk2048 standard"*
AuthorAgent is a singleton with async factory pattern and lazily-initialized locking:
class AuthorAgent:
_instance = None
_lock = None # Lazily created to avoid asyncio deprecation
@classmethod
async def get_instance(cls) -> "AuthorAgent":
if cls._lock is None:
cls._lock = asyncio.Lock()
async with cls._lock:
if cls._instance is None:
cls._instance = cls()
return cls._instance
async def publish(self) -> Dict[str, Any]:
# On-demand: compile 8 core chapters → BOOK_OF_MINDX.md + archive
async def write_daily_chapter(self) -> Dict[str, Any]:
# Lunar cycle: 1 chapter/day, skip if already written today
def cancel_periodic(self):
# Cancel running periodic task (prevents duplicate loops)
async def run_periodic(self, interval_seconds=86400):
# Daily loop with CancelledError handling
AuthorAgent is the canonical caller of the wordpress-agent loopback service
(agents/wordpress_agent/, descriptor agents/wordpress.publish.agent). It
renders an article's markdown to HTML, attaches a _mindx_content_hash
(sha256[:16]) for provenance, and POSTs it:
await author.publish_to_rage(
title="How I Turn Logs Into Memory",
content_html=html, # already rendered
status="draft", # draft|publish|future|pending|private
excerpt=None, slug=None, tags=None, categories=None, featured_media=None,
) # → {"post_id", "url", "status", "slug", "date_gmt"} or None if the service is unreachable
It never raises into the author loop — an unreachable service is logged and
returns None. The wordpress-agent itself retries 5xx with backoff.
POST /admin/publish-to-rage (admin-gated) — body takes one ofdoc_path (a markdown file under docs/, rendered to HTML), markdown, or
html; status defaults to draft.
GET /diagnostics/live → author.rage_publishes,author.last_rage_url. GET /insight/publications/health → orchestrator
liveness + per-source status defaults + ledger state.
docs/WORDPRESS_PUBLISHING.md.publish_to_rage() is the low-level transport. The autonomous publishing
pipeline (see docs/publications/README.md and
docs/SEA_MILESTONES.md) calls it via
PublicationOrchestrator, which owns ledger / debounce / rate-limit /
status policy and delegates article composition to AuthorAgent for the
rich surfaces. Established pattern: agents/learning/improvement_journal.py:76-87
already delegates journal entry authorship to AuthorAgent.
Rich composers live alongside publish_to_rage:
| Method | Triggered by | Default rage status |
|---|---|---|
compose_milestone_article(payload, category=…) | Dispatcher — routes to a per-category composer below | per category |
└ _compose_sea_milestone_article(campaign_summary) | SEA campaign with is_milestone=true (event sea.campaign.concluded) | publish |
└ _compose_bug_crushed_article(payload) | Operator-triggered (POST /admin/recognize/bug-crushed) when an alert batch closes | publish (major) |
└ _compose_dreaming_milestone_article(payload) | machine_dreaming code change OR insight outlier (event dreaming.improved) | draft |
compose_book_edition_article(book_event) | AuthorAgent's own _full_moon_publish (event book.edition.published) | draft |
compose_journal_digest_article(journal_text, lunar_phase) | Full-moon co-fire from AuthorAgent (event journal.lunar.digest.ready) | publish |
Each returns the (title, content_html, excerpt, topic) tuple shape the
orchestrator passes to publish_to_rage. All env-overridable. The
milestone composers ride on the MilestoneRecognizer chain
(see docs/MILESTONE_RECOGNITION.md);
status defaults come from MINDX_MILESTONE_<CATEGORY>_STATUS.
_full_moon_publish()When the full-moon compilation writes the new Book of mindX edition,
AuthorAgent emits two coordinator events (self.coordinator.publish_event)
back-to-back:
book.edition.published → PublicationOrchestrator composes a rage postjournal.lunar.digest.ready → PublicationOrchestrator readsdocs/IMPROVEMENT_JOURNAL.md and asks AuthorAgent's journal-digest
composer to summarise the lunar cycle
self.coordinator is set by mindx_backend_service/main_service.py right
after AuthorAgent.get_instance() in the orchestrator spawn block. If
the coordinator is missing (e.g., dev harness with no event bus),
AuthorAgent's lunar disk writes still happen — the events are simply not
emitted, and the file-polling watcher will pick up the dream-cycle book
edition trigger as a fallback.
| File | Purpose |
|---|---|
agents/author_agent.py | Book compilation, lunar cycle, publishing (incl. publish_to_rage) |
agents/wordpress_agent/ | Loopback WordPress REST service AuthorAgent calls (ported from mindXtrain) |
agents/wordpress.publish.agent | Agent extension descriptor for the wordpress-agent |
docs/WORDPRESS_PUBLISHING.md | AuthorAgent → wordpress-agent → rage.pythai.net guide |
agents/learning/improvement_journal.py | Journal entries (feeds Chapter VI) |
docs/BOOK_OF_MINDX.md | Current book edition (auto-generated) |
docs/publications/ | Timestamped archived on-demand editions |
docs/publications/daily/ | Daily lunar cycle chapters |
data/governance/lunar_cycle.json | Lunar state persistence (chapters written, full moons) |
data/governance/moon_cache.json | Moon phase cache (6h TTL from timeanddate.com) |
data/governance/doc_audit.json | Chapter VIII doc audit output |
tools/core/health_auditor_tool.py | AuthorAgent staleness check |
mindx_backend_service/main_service.py | Scheduling, health restart, /book endpoint |