System Blueprints & Sovereign Manual

Dynamic Local Architecture & Educational Workbook
01 // Active Background Daemons & Pipelines
LaunchAgent Daemon: com.monikabravo.tools-server
Core Server Engine
The Local API Orchestrator (server.py)
/scripts/server.py (Port 8765 via Homebrew Python 3.11)
The baseline structural nervous system of your local operations. It runs uninterrupted in the background of your Mac without needing an open Terminal window. It handles file query searching, ledger balances, and custom operational scripts.
+ Core Architectural Teaching Concepts

API (Application Programming Interface): An API acts like a structured teller counter window for your computer. Your frontend HTML dashboard knocks on the window and requests a specific piece of information; the API server captures that request, extracts the clean data from your private databases, and hands it back across the counter securely.

Homebrew: A non-sandboxed software loading dock for macOS. It bypasses Apple's restrictive default command configurations, letting us run dedicated, stable environments (like Python 3.11) that possess absolute system path accessibility.

The Local Database Strategy: When working with an autonomous layout, we avoid cloud hosting and create private SQLite databases. A SQLite file lives completely on your own hardware, running at zero token cost, requiring no subscription accounts, and running independent of the internet.

Checking Engine...
LaunchAgent: com.monikabravo.journal-refresh
The Reactor Chain
Journal Auto-Sync & Deployment Pipeline
/scripts/journal_refresh_and_deploy.sh (Triggered instantly via WatchPaths)
An event-driven pipeline that bridges raw thought with live distribution. This system handles its own tracking entirely in the background without exposing network ports. The split-second any Markdown file is generated or customized inside your database folder, macOS catches the mutation, kicking off an atomic step-by-step sequence.
+ Interactive Chain Reaction & Safety Definitions

Event-Driven Automation (WatchPaths): Instead of wasting system processor energy running continuous loops or staring blindly at an hour-based clock, the core system relies on system hooks. macOS registers a direct eye on an explicit path configuration, sparking the execution chain exclusively when file mutations are detected.

Sequential Pipeline Execution: The script commands follow a strict dependency sequence (Ingest → Build → Deploy). Commands do not fire haphazardly; they verify the output status of the previous phase before continuing forward.

Self-Halting Architecture (Graceful Cessation): If a markdown file is unreadable or malformed, Step 1 returns an error signal ($? \neq 0$). The wrapper catches this instantly and aborts the sequence. This guarantees that broken or corrupted rendering parameters are never pushed to the cloud dashboard.

Checking Pipeline...
LaunchAgent: com.monikabravo.supabase-keepalive
The Guardian
Supabase Cloud Guardian
Inline Plist String Execution (Daily @ 12:00 PM)
A lightweight deterministic guardian that executes a daily check request to your cloud backup. It generates artificial activity to keep your free-tier project from pausing, ensuring your synchronization links remain warm.
+ Interactive Automation Definitions

Deterministic Worker: A background process programed to do one exact repetitive action with zero deviation. It wakes up on a timer, looks for its target, commits the action, and shuts down immediately without human monitoring.

Inline Plist String: Instead of executing a standalone `.py` file stored in a folder, the actual script instructions are embedded inside the scheduling text configuration file itself. This completely outsmarts macOS folder security blocks.

Non-Destructive Action: This script runs a pure read-only check. It cannot alter, erase, or modify a single piece of your underlying historical records; it simply announces the engine's presence to the cloud cluster.

Checking Agent...
LaunchAgent: com.monikabravo.btc-price-fetcher
The Harvester
Financial Data Harvester (Bitcoin)
/scripts/btc_price_fetcher.py (Daily @ 9:40 PM Miami Time)
A financial collection engine programmed to fire after the global daily UTC date boundary. It queries public data interfaces, safely collects closing candle metrics, and automatically updates your analytics.
+ Interactive Harvesting Definitions & Expansion

Data Harvester: An automated collector designed to query external web metrics, strip away tracking code, and commit pure foundational metrics directly to your private local system.

Exit Status Validation: The binary signal returned by the machine post-run. A status of `0` means complete execution success. A status like `512` or `-15` signals an automated alert that an operation was cut off or blocked by external limits.

The Expansion Blueprint: This exact structural model can be cloned to harvest alternative global metrics. By duplicating this harvester, we can build custom scripts to automatically track and catalog **Gold, Silver, and the DXY (US Dollar Index)** directly into your private systems.

Checking Agent...
LaunchAgent: com.monikabravo.database-mover
The Courier
iCloud to Database Mover
/scripts/icloud_to_database_mover.py (Every 5 minutes, StartInterval)
Bridges the phone to the local database folder without any manual transfer step. A markdown file saved from the iPhone Files app into the ClaudeDatabaseDrop folder inside iCloud Drive syncs to the Mac on its own, and this agent checks that folder on a five-minute cycle, filing every valid entry directly into astrology-humandesign-personal/database/.
+ Interactive Courier & Validation Definitions

Polling Interval: Rather than watching the folder continuously, which costs more system resources, this agent wakes on a fixed timer, StartInterval at 300 seconds, checks once, and returns to standby. Anything dropped into the folder is filed within five minutes at the outside, with RunAtLoad also firing one immediate pass at every login.

Heading Validation Before Move: Before a file is filed, the script scans it for a stray three-hash heading, the exact failure mode that silently breaks the ingest parser. A file that fails this check is quarantined into a _flagged subfolder inside the drop zone rather than filed, so a malformed entry never reaches the live database undetected.

Why the Drop Zone Stays Separate: The database folder itself lives inside the GitHub repository and is deliberately kept outside iCloud sync, since iCloud's file eviction behavior conflicts with how git expects tracked files to remain present on disk at all times. The drop zone absorbs the sync layer so the repository itself never has to.

Checking Agent...
LaunchAgent: com.monikabravo.financial-refresh
The Ledger Parser
Master Ledger Parsing Pipeline
/financial-tracking/scripts/refresh_all_finances.py (Daily @ 12:00 PM)
The master entry point for administrative autonomy. This script runs a sequential scanning chain across your ingestion folders, translating raw bank statements straight into structured transaction tables.
+ Interactive Parser Definitions & Ingestion Loops

Parser: A code translator. Instead of a human manually looking at a document and re-typing entries into a grid, a parser reads raw unstructured text, separates dates and numbers from marketing clutter, and commits them to an organized relational table structure.

The PDF Pipeline: Standard financial parsers operate in an advanced automated two-step loop. Step 1 strips the hidden text vectors out from inside corporate statement PDFs. Step 2 runs comparative parsing logic to clean, align, and structure those items automatically into your central database.

The Drag-and-Drop Vision: Because this script looks for raw files in native asset folders, we can build an interactive visual drop-zone directly on your local interface. Dragging a bank PDF file onto the screen triggers `server.py` to ingest, parse, and balance your ledger instantly.

Checking Agent...
02 // The Sovereign Technology Core Curriculum

Module 1: Speaking directly to the Kernel (The Terminal)

The visual user interface (GUI) of macOS is just a cosmetic curtain. The Terminal is your direct text interface to the underlying Unix kernel. It allows you to run actions, check background operations, and coordinate scripts directly at maximum hardware speed.

+ Teaching Deck: Commands, Shells, and Editors

1. Shells: Bash vs. Zsh

A shell is the command interpreter inside your terminal. It reads the text command you type and translates it into instructions the machine understands. Zsh (Z Shell) is the modern default command-line layout for macOS, while Bash is the timeless script wrapper language we use to execute background pipeline files recursively.

2. Core Directory Control Commands

To teach students how to navigate the absolute directory layout, focus on these five core actions:

  • pwd (Print Working Directory): Answers "Where am I currently standing?"
  • ls -la (List Assets): Displays every single file in the current directory, including hidden dot files.
  • cd [folder_path] (Change Directory): Moves your perspective to a new target folder path.
  • mkdir [name] (Make Directory): Generates a brand-new directory folder instantly.
  • rm -f [file] (Remove Asset): Absolute physical deletion. This bypasses the Mac Trash Bin entirely.

3. Nano Terminal Editor (The Emergency Terminal Window)

If you are on a remote server or need to edit a file entirely within the terminal, we use Nano. Running nano file.txt opens a basic editor.
Key controls use the Control (^) key:
• Save changes: Ctrl + O (then press Enter to confirm).
• Exit Nano: Ctrl + X.

4. The Magic of 'EOF' (Here Document)

When you see a command starting with cat << 'EOF' > file.sh, you are instructing the terminal: "Read everything I type next as pure raw text, ignore any special characters, and write them directly into file.sh until you see the absolute keyword 'EOF' on its own line." This is the most secure way to write files remotely without trigger-happy terminal formatting errors ruining your code.

Module 2: Python Behind Closed Doors

Python doesn't run magically. When you execute a script, a highly structured sequence occurs under your computer's hood to compile and run your logic safely.

+ Teaching Deck: Interpreters, Environment Paths, and Runs

1. What is an Interpreter?

Computers do not speak Python. They speak binary machine instructions. The **Python Interpreter** is a background binary executable engine that reads your human-written `.py` files line-by-line, converts the syntax into immediate bytecode, and instructs the processor to act.

2. System Python vs. Custom Interpreters (Homebrew)

macOS ships with a default interpreter, usually accessed via python3. However, Apple sandbox restrictions often block this native interpreter from reading user folders or connecting safely to local files. To bypass this, we use Homebrew to install a fully sovereign Python version at an absolute address:
/opt/homebrew/opt/python@3.11/bin/python3.11
Using this absolute path in our background LaunchAgents guarantees that our automated scripts never lose access rights to files.

3. Script Execution vs. Persistent Server Loop

A standard Python script (like a financial parser) fires, completes its task, and immediately releases system memory. A Daemon Server (like `server.py`) uses an infinite listening loop. It locks a network Port (like Port 8765) and sits in standby, waiting forever for incoming network pings until the system is shut down or killed.

Module 3: Local Daemons vs. Cloud Agents (with MCP)

Understanding the dividing line between local computer authority and global cloud models is the foundation of data sovereignty.

+ Teaching Deck: Sovereignty, Tokens, and MCP Bridges

1. Local Sovereignty (LaunchAgents & Daemons)

Your LaunchAgents run completely on your local computer's physical silicon chips. They require no internet connection, charge no recurring subscription fees, leak no personal records to advertising models, and continue to operate indefinitely as long as your hardware has power.

2. Cloud Models & Tokens

Cloud-based AI models (like Anthropic or OpenAI) live on remote, centralized server farms. They process information in **Tokens** (fragments of words where 100 tokens equal roughly 75 words). Every request to a cloud model costs server processing overhead, introducing network latency and continuous transaction costs.

3. The Model Context Protocol (MCP) Bridge

An AI model living in the cloud is blind to your local files. To bridge this gap securely, we use **MCP (Model Context Protocol)**.
Your local computer runs a secure micro-portal (like your `tools-server`). When you chat with a cloud model, it securely asks the MCP port for specific local data. The local script gathers the file contents and hands them to the AI, allowing high-level cloud models to interact with your secure, private local environment.

Module 4: Structured Formats & The Vector Grid (SVG)

Data can be saved in different structural shapes. Understanding how these text shapes represent things—from database items to physical drawings—is how we create custom tools.

+ Teaching Deck: Markdown, JSON, and The Golden SVG Rule
Markdown (.md) Human-readable, stylized plain text used for content journaling.
JSON (.json) Machine-readable key-value objects used for API exchanges.
SVG (.svg) Mathematical geometries written in code to draw infinitely scalable vectors.

1. Markdown vs. JSON Structure

Markdown is an elegant syntax where symbols represent styling (e.g., `#` makes a title). It is designed for human thoughts. JSON (JavaScript Object Notation) is a strict key-value container (e.g., {"generated_at": "2026-07-15"}). It is designed to act as the raw, structured data envelope passed between servers.

2. What is an SVG (Scalable Vector Graphic)?

Unlike a standard PNG or JPEG image—which is a grid of fixed pixels that get blurry when enlarged—an **SVG** is written in pure text math. It contains XML drawing instructions like <polygon points="0.5,0.1 0.2,0.6 0.8,0.6"/>. Because it is pure geometry code, your web browser reads the math and draws the image perfectly on screen, making it infinitely sharp at any zoom level.

3. The Golden Coordinate Law: Across First, Always

Across comes first, always. Column before row. (x, y)

Zero begins in the top-left corner.
• **The First Number (Across / Column):** The horizontal coordinate. Moving from left to right, starting at 0.0 at the left boundary and ending at 1.0 at the right boundary.
• **The Second Number (Down / Row):** The vertical coordinate. Moving from top to bottom, starting at 0.0 at the top boundary and ending at 1.0 at the bottom boundary.

If you are plotting a triangle:
- An apex set at 0.5 across, 0.1 down sits exactly in the horizontal center and near the top.
- A left base set at 0.2 across, 0.6 down sits near the left edge and past the vertical middle.
- A right base set at 0.8 across, 0.6 down sits near the right edge and past the vertical middle.

Keeping this exact coordinate sequence consistent across all calculations prevents ambiguity. The moment down comes first even once, your structural map collapses into confusion!