# Mnemosyne Publishing Procedure **Comprehensive Guide to the Automated Update/Publish/Backup/Commit/Remember Workflow** --- ## Table of Contents 1. [Overview](#overview) 2. [The Publish Script](#the-publish-script) 3. [The Five-Stage Workflow](#the-five-stage-workflow) 4. [Quick Start](#quick-start) 5. [Detailed Usage](#detailed-usage) 6. [Step-by-Step Breakdown](#step-by-step-breakdown) 7. [Configuration](#configuration) 8. [Error Handling](#error-handling) 9. [Best Practices](#best-practices) 10. [Troubleshooting](#troubleshooting) 11. [Advanced Usage](#advanced-usage) 12. [Integration with Monitoring](#integration-with-monitoring) --- ## Overview The Mnemosyne Publishing Procedure is an automated workflow designed to streamline the process of: 1. **Updating** documentation and blog indices 2. **Publishing** changes to production servers 3. **Backing up** the memory database 4. **Committing** changes to Git version control 5. **Remembering** milestones in OpenMemory This eliminates manual steps, reduces errors, and ensures no critical task is forgotten. ### Key Features - **Interactive confirmations** at each step - **Graceful error handling** with continue/abort options - **Automatic blog index updates** for new posts - **Git integration** with proper commit messages - **Memory preservation** via OpenMemory API - **Colored console output** for better UX - **Idempotent operations** where possible --- ## The Publish Script ### Location ``` /home/technicus/Projects/claude-code/openmemory/publish-changes.sh ``` ### Invocation ```bash ./publish-changes.sh ``` ### Requirements - Bash 4.0+ - Git repository initialized - OpenMemory service running (optional, for memory storage) - `jq` for JSON manipulation - `curl` for API requests --- ## The Five-Stage Workflow ### 1. **UPDATE** - Blog Index Refresh Scans for new blog posts created today and adds them to the blog index (`blog.html`). **What it does:** - Finds blog posts matching pattern: `blog/YYYY-MM-DD-*.html` - Extracts title, date, and excerpt from each post - Inserts new entries into `blog.html` - Creates backup before modification **When to skip:** - No new blog posts created - Blog updates already done manually ### 2. **BACKUP** - Memory Database Preservation Runs the backup script to preserve the OpenMemory database. **What it does:** - Executes `./backup-memory.sh` - Creates timestamped backup of `openmemory.sqlite` - Stores backup in configured location **When to skip:** - Backup already performed recently - No significant memory changes ### 3. **COMMIT** - Version Control Stages and commits changes to Git with proper attribution. **What it does:** - Shows current git status - Prompts for commit message - Stages all changes with `git add .` - Creates commit with Claude Code attribution - Optionally pushes to remote **When to skip:** - No changes to commit - Manual commit preferred ### 4. **PUBLISH** - Deploy to Production Runs the deployment script to publish changes to the web server. **What it does:** - Executes `./deploy.sh` (if available) - Uploads changes to mnemosyne.info - Refreshes server caches **When to skip:** - Deploy script not configured - Manual deployment preferred - Changes not ready for production ### 5. **REMEMBER** - Store Milestone in Memory Records significant changes as a memory in OpenMemory. **What it does:** - Checks if OpenMemory service is running - Prompts for memory content - Stores memory via `/memory/add` API endpoint - Tags as milestone with timestamp **When to skip:** - OpenMemory not running - Changes are routine/minor --- ## Quick Start ### Basic Usage ```bash # Navigate to project root cd /home/technicus/Projects/claude-code/openmemory # Run the publish script ./publish-changes.sh ``` You'll be prompted at each stage with clear options: ``` ═══════════════════════════════════════════════════════════ MNEMOSYNE INTEGRATED PUBLISH PROCEDURE ═══════════════════════════════════════════════════════════ This script will: 1. Update blog index with new entries 2. Backup memory database 3. Commit changes to Git 4. Deploy/publish changes 5. Store milestone in OpenMemory Begin publish procedure? [Y/n]: ``` ### Selective Execution At each step, you can choose to: - **Yes (Y)** - Execute the step - **No (n)** - Skip the step and continue - **Ctrl+C** - Abort entire procedure --- ## Detailed Usage ### Step 1: Update Blog Index When you create a new blog post like: ``` blog/2025-11-06-building-self-healing-infrastructure.html ``` The script will: 1. **Detect** the new file 2. **Extract** metadata: ``` Title: Building Self-Healing Infrastructure: The Mnemosyne Monitoring System Date: November 6, 2025 Excerpt: How we built a sophisticated dual-watchdog monitoring system... ``` 3. **Insert** into blog.html: ```html
How we built a sophisticated dual-watchdog...