Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4700965731 | ||
|
|
5d55e646f3 |
No files matched your search
@@ -0,0 +1,147 @@
|
||||
# PLAN: Migrate Final `00:00 UTC` Exegesis Cronjob (`d28b479ec217`) Off `localhost` with First-Class Dual-Mode Support, Offline-First Execution & Anonymous BTC/XMR Token-Budget Funding
|
||||
|
||||
**Document ID:** `PLAN-MIGRATE-FINAL-EXEGESIS-CRONJOB-WITH-DUAL-MODE-AND-CRYPTO-FUNDING`
|
||||
**Status:** `ACTIVE / READY FOR IMPLEMENTATION`
|
||||
**Target Ecosystem Version:** `v2.4.0`
|
||||
**Target Repositories:** `hyperstitionstudio-core`, `ingglish-hyperdope-gematria`, `encyclopedia-knowledge-graph`
|
||||
**Author:** m00t & Hermes Agent
|
||||
**Date:** 2026-11-30
|
||||
|
||||
---
|
||||
|
||||
## 1. Executive Summary & Architectural Objective
|
||||
|
||||
Following `PLAN-MIGRATE-PERIODIC-DATA-PRODUCTION-FROM-LOCALHOST-TO-VPS` (`v2.0.30`) and `PLAN-CRONJOB-ARCHIVE-ROTATION-ON-HYPERSTITIONSTUD-IO` (`v2.1.0`), only **one** recurring job remained on `localhost`:
|
||||
- **`d28b479ec217` (`current-events-isopsephic-exegesis-daily-0000-gmt`, `00:00 UTC` / `19:00 EST` Daily)** — which runs `collect_news_aq.py` (Step A, `0` tokens), synthesizes the daily news-wire dossier `<NN>-dossier-news-YYYY-MM-DD.md` under Division `08` *"The Room Filter"* (Step B), and runs `ci_provision_ingglish.py --tier 2 --apply-repo` (Step C, `0` tokens).
|
||||
|
||||
This plan completes the migration of the **final recurring cronjob (`d28b479ec217`) off `localhost` onto `hyperstitionstud.io`**, while:
|
||||
1. **Preserving the current `localhost` Hermes configuration (`execution_mode = "localhost_hermes"`) as a first-class, one-switch option**,
|
||||
2. **Enforcing `hyperstitionstud.io`'s Offline-First, Zero-External-Network-Dependencies ethos** via a 3-Tier Synthesis Hierarchy (`Tier 1: Offline Local GGUF Weights via llama.cpp` $\rightarrow$ `Tier 2: Optional Anonymous BTC/XMR-Funded Prepaid API` $\rightarrow$ `Tier 3: 100% Deterministic Zero-Token Structural Dossier Compiler`), so that `<NN>-dossier-news-YYYY-MM-DD.md` is guaranteed to compile at `00:00 UTC` even with **zero external LLM API keys, zero cloud tokens, and zero internet access to LLM providers**, and
|
||||
3. **Integrating an Anonymous BTC (`bc1q...`) & Monero (`XMR` `83ZC...`) Token-Budget & Compute Funding Architecture** connected to `/donate/index.html` (`site/donate/reactor-fuel-status.json`), with strict Zero-Synthetic-Data compliance (`"No data available"` whenever live wallet/credit telemetry is absent).
|
||||
|
||||
---
|
||||
|
||||
## 2. Three First-Class Execution Topologies (`[exegesis] execution_mode` in `workspace.toml`)
|
||||
|
||||
Both `/workspace/workspace.toml` and `/workspace/hyperstitionstudio-core/workspace.example.toml` gain a declarative `[exegesis]` configuration section supporting three first-class operational modes without code edits:
|
||||
|
||||
| `execution_mode` Value | Where `00:00 UTC` Exegesis Runs | Status of `localhost` Hermes Cronjob `d28b479ec217` | Synthesis Engine Hierarchy (`hs-exegesis-run`) | External LLM API Dependency |
|
||||
| :--- | :--- | :--- | :--- | :--- |
|
||||
| **`"vps_offline_first"` (New Default — Moves Final Cronjob Off `localhost`)** | **`hyperstitionstud.io` VPS** (`hyperstition-utc-rollover-harvest.timer` at `00:00 UTC` Daily) | **Decommissioned / Removed on `localhost`** (`cronjob_manage(action="remove", job_id="d28b479ec217")`, leaving **`0` cronjobs on `localhost`**) | **1.** Local offline GGUF model (`/var/lib/hyperstitionstud.io/models/*.gguf` via `llama-cli --offline`) if present;<br/>**2.** Deterministic Zero-Token Structural Dossier Compiler (`compile_deterministic_news_dossier()`, `0` LLM tokens) | **`0` External LLM Network Calls / `0` API Keys** |
|
||||
| **`"vps_crypto_funded"` (Autonomous VPS with BTC/XMR Prepaid Token Budget)** | **`hyperstitionstud.io` VPS** (`hyperstition-utc-rollover-harvest.timer` at `00:00 UTC` Daily) | **Decommissioned / Removed on `localhost`** (`0` cronjobs on `localhost`) | **1.** Checks anonymous BTC/XMR-funded prepaid credit ledger (`/etc/hyperstitionstud.io/exegesis-budget.env`, capped at `<= 35,000` tokens/day);<br/>**2.** Automatic zero-downtime fallback to `vps_offline_first` (`local_gguf` $\rightarrow$ `deterministic_structural`) if budget is `$0.00` or offline | Optional isolated `00:00 UTC` call when funded; `100%` offline fallback guaranteed |
|
||||
| **`"localhost_hermes"` (Preserved First-Class Current Configuration)** | **`localhost` Hermes Agent** (`d28b479ec217` at `00:00 UTC` Daily, pushing to `git.libre.audio`) | **Active on `localhost`** (restorable in one command via `hs-exegesis-run --print-localhost-cron-spec`) | Localhost Hermes agent writes `<NN>-dossier-news-YYYY-MM-DD.md` and pushes to `git.libre.audio`; if `localhost` is asleep past `00:20 UTC`, VPS `run-vps-archive-rotation.sh` optionally backfills via `vps_offline_first` | Metered on `localhost` only; `0` keys on VPS |
|
||||
|
||||
---
|
||||
|
||||
## 3. Aligning Exegesis with the Offline-First, "Zero External Network Dependencies" Ethos (`src/hyperstitionstud_io/publishing/exegesis_runner.py`)
|
||||
|
||||
Why did `d28b479ec217` previously require an LLM agent? Only **Step B** (arranging the already-solved `collect_news_aq.py` `333 / 666 / 777` equations and story clusters into the Markdown dossier `<NN>-dossier-news-YYYY-MM-DD.md` and appending a row to `00-index-and-methodology.md`) used an LLM.
|
||||
|
||||
By introducing `src/hyperstitionstud_io/publishing/exegesis_runner.py` (`hs-exegesis-run` CLI & MCP tool `hs_inspect_exegesis_runner_status`), Step A, Step B, and Step C are unified into a deterministic, idempotent pipeline with a **3-Tier Offline-First Synthesis Hierarchy**:
|
||||
|
||||
### Tier 1: Airgapped Local CPU GGUF Weights (`synthesis_backend = "local_gguf"`, `0` External Network Calls)
|
||||
- When a local quantized GGUF weight file (e.g., `Qwen2.5-7B-Instruct-Q4_K_M.gguf` or `Llama-3.1-8B-Instruct-Q4_K_M.gguf`) and `llama-cli` (`llama.cpp`) are present at `/var/lib/hyperstitionstud.io/models/`, `hs-exegesis-run` invokes `llama-cli` inside a network-isolated subprocess (`bwrap --unshare-net` when available).
|
||||
- Every equation `(word, ing, eng_aq, ing_aq, breakdown = 333/666/777)` is injected from `collect_news_aq.py` as an immutable table block and verified post-generation by `ci_provision_ingglish.py` Gate 4 (`aq_mismatches == 0`).
|
||||
|
||||
### Tier 2: Deterministic Zero-Token Structural Exegesis Compiler (`synthesis_backend = "deterministic_structural"`, `0` LLM Tokens, `< 150 ms`)
|
||||
- When no local GGUF model and no prepaid API token budget are configured, `compile_deterministic_news_dossier()` compiles `<NN>-dossier-news-YYYY-MM-DD.md` directly in pure Python (`0` LLM tokens, `0` external network calls):
|
||||
1. Ingests the dated story clusters and verified `333 / 666 / 777` `eng_aq` and `ing_aq` equation locks from `news-aq-harvest-YYYY-MM-DD.json` (or cached local RSS/Wikipedia corpus).
|
||||
2. Runs `hs_classify_singularity` across each story cluster to assign exact Landian-Deleuzean Singularity Classes (`S1–S6`), `S×S6` Double Articulation flags, and Two-Gate state-matched `M1–M7+` memetic activations.
|
||||
3. Computes exact `G1` intergenerational variance collapse ($\Delta\sigma^2_{\text{G1}} = \sigma^2_0 - \sigma^2_1$), `G3` quantized steps, `G4` isometric fixed points ($\Delta = 0$), and `G5` twin-prime mutations for every equation lock.
|
||||
4. Renders the complete Division `08` *"The Room Filter"* Markdown dossier (including YAML/header metadata, Story Cluster Analysis, Verified `333 / 666 / 777` Equation Ledger, Cross-Scale `S1–S6` & `Dose 0..3+` Market Confluence Table, and Grounded Citation Sources `[1]..[k]`), updates `00-index-and-methodology.md`, and runs `ci_provision_ingglish.py --tier 2 --apply-repo`.
|
||||
5. **Explicit UI Provenance Tag:** Every dossier compiled in `deterministic_structural` mode carries the header badge `Synthesis Mode: DETERMINISTIC_ZERO_TOKEN_STRUCTURAL (0 LLM Tokens)` so readers and downstream tools know its exact provenance.
|
||||
|
||||
### Tier 3: Optional Anonymous Crypto-Funded Prepaid API (`synthesis_backend = "crypto_funded_api"`)
|
||||
- Opt-in only when `/etc/hyperstitionstud.io/exegesis-budget.env` is populated and `remaining_tokens_budget >= 35000`; automatically degrades to Tier 1 or Tier 2 on any network error, `HTTP 402`, or budget exhaustion.
|
||||
|
||||
---
|
||||
|
||||
## 4. Anonymous BTC & Monero (XMR) Funding Architecture for the Exegesis Token & Compute Budget
|
||||
|
||||
`hyperstitionstud.io/donate/` already publishes two sovereign, zero-tracker contribution channels:
|
||||
- **Bitcoin (`BTC // Layer-1`):** `bc1qcgkpl0j2ayxd68haeutfvarjgla2lmz30yd23e` (`AQ("bitcoin") = 152`)
|
||||
- **Monero (`XMR // Zero-Trace`):** `83ZCDY7YpUHJRwwj4ETL2THYYWVxWti6sbyxvdJ7kGBoWyKR2Wt4of6YyFjmjZqJCjYSwKdWkBK36dhsNzrnwbnvMajDaEJ` (`193`, 44th Prime)
|
||||
|
||||
### 4.1 Token Economics of the Daily `00:00 UTC` Exegesis Job
|
||||
- **Cadence:** `1` run per day (`365` runs/year).
|
||||
- **Token Footprint (when using LLM synthesis):** `~18,000` input tokens + `~4,000` output tokens = `~22,000` tokens/day (`~660,000` tokens/month).
|
||||
- **Monthly Cost Envelope:**
|
||||
- **Pathway A (`vps_offline_first` — Deterministic or Local GGUF):** **`$0.00 / month` marginal token cost** (`100%` covered by existing VPS base lease).
|
||||
- **Pathway B (`vps_crypto_funded` — Open-Weight / Frontier API via Anonymous XMR/BTC Gateway):** **`~$0.20 to $1.85 USD / month` (`~$2.40 to $22.00 USD / year`)**. A single `$10` equivalent contribution in XMR or BTC funds **5 to 48 months** of daily `00:00 UTC` exegesis runs.
|
||||
|
||||
### 4.2 Evaluation of Anonymous Crypto-to-Token & Crypto-to-Compute Pathways
|
||||
|
||||
| Pathway | Mechanism | Privacy & KYC Profile | Alignment with Offline-First / Zero-External-Deps Ethos | Recommended Role |
|
||||
| :--- | :--- | :--- | :--- | :--- |
|
||||
| **1. Direct XMR/BTC VPS Compute Funding + Local GGUF (`Pathway C1`)** | Patron BTC/XMR funds the VPS host directly (e.g. privacy-native hosts accepting XMR/BTC with zero KYC); exegesis runs locally via `llama.cpp` or `deterministic_structural`. | **Maximum (Zero KYC, Zero External API Traffic, Zero Prompt Logging)** | **100% Aligned:** `0` outbound network requests during Step B exegesis; works on an airgapped LAN. | **Primary Default (`vps_offline_first`)** |
|
||||
| **2. Anonymous XMR / BTC-Lightning Prepaid Inference Gateways (`Pathway C2`: NanoGPT / PPQ.ai / L402 Macaroons)** | Non-KYC inference gateways (`nano-gpt.com` native XMR/BTC deposit, `ppq.ai` Lightning/XMR, or HTTP `402 Payment Required` L402 Lightning Macaroons) issue a bearer credential or per-call preimage funded directly from a Monero subaddress or Lightning channel. | **High (No account identity, email, or credit card; XMR ring-CT shields sender/receiver graph)** | **Opt-In Secondary (`vps_crypto_funded`):** Outbound HTTPS call occurs only once per 24h inside one-shot `hyperstition-exegesis.service` (never inside `hs-mcp`), with instant fallback to `Pathway C1`. | **First-Class Opt-In for Cloud-Model Prose** |
|
||||
| **3. Watch-Only / View-Key Local Budget Ledger (`Pathway C3`: `reactor-fuel-status.json`)** | Operator or offline view-only wallet (`monero-wallet-cli --view-only` / BTC descriptor) exports a signed static JSON receipt (`site/donate/reactor-fuel-status.json`) consumed by `hs-exegesis-run` and `/donate/`. | **Maximum (`0` private spend keys ever touch the VPS; `0` third-party blockchain explorer scripts in the browser)** | **100% Aligned:** Browser loads only local static `reactor-fuel-status.json` from `tmpfs` (`0` external RPC calls from visitor browsers). | **Canonical Telemetry & Budget Governor** |
|
||||
|
||||
### 4.3 Security & Isolation Invariants for Crypto-Funded Credentials
|
||||
1. **Zero Private Spend Keys on VPS:** Neither the BTC private key nor the XMR private spend key is ever stored on `hyperstitionstud.io` or in any Git repository. Only public addresses (`bc1q...`, `83ZC...`) and static signed budget receipts (`site/donate/reactor-fuel-status.json`) exist in the webroot.
|
||||
2. **Process & Environment Isolation:** When `execution_mode = "vps_crypto_funded"` is used, the prepaid token key resides exclusively in `/etc/hyperstitionstud.io/exegesis-budget.env` (`chmod 0600 root:root`), read only by the one-shot `00:00 UTC` runner—never passed to `hyperstition-mcp.service` (`:8095`) or Caddy.
|
||||
3. **Hard Daily Token Circuit-Breaker (`MAX_DAILY_EXEGESIS_TOKENS = 35,000`):** `hs-exegesis-run` tracks daily token usage in `/var/lib/hyperstitionstud.io/exegesis-budget-state.json`. If a run exceeds the daily cap or the prepaid balance is exhausted (`available_usd_equivalent <= 0`), it automatically switches to `vps_offline_first` (`local_gguf` $\rightarrow$ `deterministic_structural`) so the `00:00 UTC` dossier never fails.
|
||||
4. **Strict Zero-Synthetic-Data Rule on `/donate/`:** In `site/donate/reactor-fuel-status.json` and `/donate/index.html`, if live wallet/credit balance telemetry has not been populated (`data_available: false`), all balance and runway fields serialize strictly as `null` (`"No data available"`)—never simulated or fabricated numbers.
|
||||
|
||||
---
|
||||
|
||||
## 5. Step-by-Step Implementation Specification
|
||||
|
||||
1. **Create `src/hyperstitionstud_io/publishing/exegesis_runner.py` (`hs-exegesis-run` CLI):**
|
||||
- Implements:
|
||||
- `run_daily_exegesis_pipeline(date_utc=None, execution_mode=None, synthesis_backend=None, dry_run=False)`:
|
||||
- **Idempotency Gate:** Checks whether `/workspace/ingglish-hyperdope-gematria/ingglish-aq-archive/<NN>-dossier-news-YYYY-MM-DD.md` already exists for `target_date_utc`. If present (e.g. already pushed by `localhost` in `localhost_hermes` mode), logs `"already_synthesized": True` and proceeds directly to Step C verification (`0` duplicate work).
|
||||
- **Step A:** Runs `collect_news_aq.py --date YYYY-MM-DD` (`0` tokens).
|
||||
- **Step B:** Dispatches according to `[exegesis] execution_mode` and `synthesis_backend` (`local_gguf` $\rightarrow$ `crypto_funded_api` [if enabled & funded] $\rightarrow$ `deterministic_structural`).
|
||||
- **Step C:** Runs `ci_provision_ingglish.py --tier 2 --apply-repo`, verifies all 4 CI gates (`aq_mismatches == 0`), and updates `site/donate/reactor-fuel-status.json`.
|
||||
- `--print-localhost-cron-spec`: Prints the exact `cronjob_manage` JSON specification for `d28b479ec217` so an operator can restore `localhost_hermes` mode in one step at any time.
|
||||
2. **Wire `hs-exegesis-run` into `deploy/run-vps-data-production.sh --window=utc-rollover` (`00:00 UTC` Daily on VPS):**
|
||||
- Before recomputing `timeseries.py`, `hs-daily-brief`, and `build_encyclopedia_knowledge_graph.py`, `run-vps-data-production.sh --window=utc-rollover` invokes `hs-exegesis-run --auto` so the new UTC day's news dossier `<NN>-dossier-news-YYYY-MM-DD.md` is synthesized, verified by `ci_provision_ingglish.py`, and committed/pushed to `git.libre.audio` autonomously on `hyperstitionstud.io`.
|
||||
3. **Decommission `d28b479ec217` on `localhost` (`Rule A` Source-Decommissioning) While Preserving First-Class Re-Enablement:**
|
||||
- Remove `d28b479ec217` from the active `localhost` Hermes cron scheduler via `cronjob_manage(action="remove", job_id="d28b479ec217")` when activating `execution_mode = "vps_offline_first"`, bringing `localhost` recurring cronjobs from `1` down to **`0`**.
|
||||
- Update `OPERATORS-MANUAL-LLM-TOKEN-DEPENDENT-DATA-PIPELINES.{md,pdf}` with the 3-mode switch table (`vps_offline_first`, `vps_crypto_funded`, `localhost_hermes`), one-command restoration instructions, and **SOP 3: Explicit `localhost` Exegesis Push & VPS Reflection Procedure** (detailed in Section 6 below).
|
||||
4. **Add Static Reactor Fuel & Exegesis Mode Readout to `/donate/index.html` & `MCP_TOOLS_SCHEMA`:**
|
||||
- Create `site/donate/reactor-fuel-status.json` (`data_available: false`, `status: "No data available"` for unpopulated balances; live introspection of `execution_mode`, `synthesis_backend`, `btc_address`, `xmr_address`, and `daily_token_cap: 35000`).
|
||||
- Expose `reactor-fuel-status` via `hs_query_workspace_catalog_and_release_state` and `/donate/index.html`.
|
||||
5. **Verification Gates (`tests/test_core_suite.py` & `deploy/test-first-deployment.sh`):**
|
||||
- Test `compile_deterministic_news_dossier()` in `tests/test_core_suite.py` inside a temporary directory and under simulated `ProtectSystem=strict` (`EROFS`), verifying 4-gate `ci_provision_ingglish.py` compliance (`0` AQ mismatches, `0` external network calls, `0` LLM tokens) and strict `"No data available"` behavior on unpopulated wallet balances.
|
||||
|
||||
---
|
||||
|
||||
## 6. Explicit Documentation Plan for the `localhost` Exegesis Push Procedure in `OPERATORS-MANUAL-LLM-TOKEN-DEPENDENT-DATA-PIPELINES.{md,pdf}`
|
||||
|
||||
### 6.1 Audit of Extant Operator PDFs
|
||||
An audit of all extant Operator's Manual PDFs confirmed a documentation gap:
|
||||
- In `/workspace/encyclopedia-knowledge-graph/docs/OPERATORS-MANUAL-LLM-TOKEN-DEPENDENT-DATA-PIPELINES.{md,pdf}`, Section 1 (Row 1) and Section 3 (`SOP 1: Running or Backfilling d28b479ec217 for a Specific UTC Date (YYYY-MM-DD) on localhost`) stop at **Step C** (`ci_provision_ingglish.py --tier 2 --apply-repo`).
|
||||
- While `SOP 2` mentions in a brief clause that `d28b479ec217` *"backfills the missed UTC news dossier ... and pushes to `git.libre.audio`"*, **neither `OPERATORS-MANUAL-LLM-TOKEN-DEPENDENT-DATA-PIPELINES.pdf` nor `VPS-AND-GIT-OPERATOR-DEPLOYMENT-GUIDE.pdf` explicitly documents the step-by-step `localhost` exegesis push procedure**—specifically: which repositories are dirtied by an exegesis run, how downstream time-series/Bayesian artifacts ingest the new dossier's `333 / 666 / 777` equation locks, and the exact commands required to push from `localhost` (`/workspace`) to `git.libre.audio` and reflect the dossier on `https://hyperstitionstud.io`.
|
||||
|
||||
### 6.2 Exact Addition to `OPERATORS-MANUAL-LLM-TOKEN-DEPENDENT-DATA-PIPELINES.{md,pdf}` (and Cross-Reference in `VPS-AND-GIT-OPERATOR-DEPLOYMENT-GUIDE.{md,pdf}`)
|
||||
|
||||
This plan updates `/workspace/encyclopedia-knowledge-graph/docs/OPERATORS-MANUAL-LLM-TOKEN-DEPENDENT-DATA-PIPELINES.md` and recompiles `/workspace/encyclopedia-knowledge-graph/docs/OPERATORS-MANUAL-LLM-TOKEN-DEPENDENT-DATA-PIPELINES.pdf` via `hs-pdf-build` (`--refresh-all-web-pdfs`) to add **Step D** to the Master Boundary Table and a complete **SOP 3: End-to-End `localhost` Exegesis Push & VPS Reflection Procedure** (strictly using container-relative `/workspace/...` paths):
|
||||
|
||||
#### A. Repositories & Files Dirtied on `localhost` by an Exegesis Run (`Steps A–C`)
|
||||
1. `/workspace/ingglish-hyperdope-gematria`:
|
||||
- `ingglish-aq-archive/<NN>-dossier-news-YYYY-MM-DD.md` (new Division `08` *"The Room Filter"* dossier),
|
||||
- `ingglish-aq-archive/00-index-and-methodology.md` (updated master index table & dossier count),
|
||||
- `ingglish-aq-archive/news-aq-harvest-YYYY-MM-DD.json` (raw deterministic headline + `eng_aq`/`ing_aq` harvest).
|
||||
2. `/workspace/hyperdope-ci-build` & `/workspace/haiperdohp-jemaytreeah` (via Step C `ci_provision_ingglish.py --tier 2 --apply-repo`):
|
||||
- `db.txt`, `db_ingglish_entries.txt`, `ci-audit-report.json`, and `ONBOARDING-INGGLISH-AQ.{md,pdf}` (plus untracked `haiperdohp-jemaytreeah/db.json` and `db_lite.json` when regenerated).
|
||||
3. `/workspace/hyperstitionstudio-core` (Downstream Time-Series & Bayesian Brief Integration):
|
||||
- `site/quant/quant-timeseries.json` and `site/quant/quant-timeseries-data.js` (`daily_wire_series` and `Dose 2 / Dose 3+` intersection counts for `YYYY-MM-DD`),
|
||||
- `site/quant/daily-brief-latest.json` (5-Agenda Bayesian regime update incorporating the new wire dossier).
|
||||
|
||||
#### B. Two Supported Push & Deployment Workflows from `localhost` (`/workspace`)
|
||||
|
||||
- **Workflow 1 — Canonical Two-Script Operator Push & Immediate VPS Reflection (Recommended after Manual / Backfill Runs):**
|
||||
1. **On `localhost` (`/workspace`):** Run the single master topological push script, which automatically recomputes `quant-timeseries.json` and `daily-brief-latest.json` against the new `<NN>-dossier-news-YYYY-MM-DD.md`, runs `hs-sync-version --auto-bump` (`0` LLM tokens), runs all 7 test suites in `tests/test_core_suite.py`, commits all modified repositories, and pushes commits and tags to `git.libre.audio`:
|
||||
```bash
|
||||
/workspace/push-all-to-git-libre-audio.sh
|
||||
```
|
||||
2. **On `hyperstitionstud.io` (VPS):** Run the single master VPS hydration script to pull from `git.libre.audio`, rebuild untracked `.cache/hyperstition-meta.db` and `haiperdohp-jemaytreeah/db.json`, and sync the RAM-backed `tmpfs` webroot (`/var/www/hyperstitionstud.io/repos`) with `.br` / `.gz` pre-compression:
|
||||
```bash
|
||||
sudo /srv/hyperstitionstud.io/repos/hyperstitionstudio-core/deploy/sync-vps-repos.sh
|
||||
```
|
||||
- **Workflow 2 — Unattended `00:00 UTC` `localhost_hermes` Push into the `00:20 UTC` VPS Pull Window:**
|
||||
1. When `execution_mode = "localhost_hermes"` is active, `d28b479ec217` executes `/workspace/push-all-to-git-libre-audio.sh` as its final deterministic **Step D** terminal command (~`00:05 UTC`) after `ci_provision_ingglish.py --tier 2 --apply-repo` passes with `0` AQ mismatches.
|
||||
2. At `00:20 UTC`, the VPS `/etc/cron.d/hyperstition-archive-rotate` / `hyperstition-archive-rotate.timer` job (`deploy/run-vps-archive-rotation.sh`) automatically pulls the pushed commits from `git.libre.audio` and hydrates `/var/www/hyperstitionstud.io/repos` (`tmpfs`) with zero manual operator intervention.
|
||||
|
||||
Binary file not shown.
@@ -1,73 +0,0 @@
|
||||
# Plan: Expose SQLite `/api/v1/meta/*` REST Endpoints, HTTP `ETag` (`304 Not Modified`), `hs_query_sqlite_catalog` MCP Tool & `sync-vps-repos.sh` Hydration (`v2.0.18`)
|
||||
|
||||
- **Document ID:** `PLAN-SQLITE-META-REST-ENDPOINTS-ETAG-AND-VPS-SYNC` (`v2.0.18`)
|
||||
- **Roadmap Status:** **LONG-TERM INACTIVE PLAN (Deferred)** — Extracted from `PLAN-SQLITE-REST-API-METADATA-DB` and preserved as a long-term architectural specification alongside `PLAN-LLM-TOKEN-ECONOMIZER-AND-VARIANCE-ROUTING`, `PLAN-MEMETIC-GALLERY-SUBPAGE`, and `Episodes 06–09` of *The Encyclopedia Expeditions*; not scheduled for active implementation unless explicitly activated.
|
||||
- **Prerequisite Module:** `hyperstitionstud_io.db.sqlite_meta` (`hs-db-build` CLI, `hyperstition-catalog.db`, and `api-telemetry.db` automatically populated by `dispatch_rest_v1()` and `dispatch_jsonrpc()`, defined in the active plan `/workspace/encyclopedia-knowledge-graph/docs/PLAN-SQLITE-REST-API-METADATA-DB.{md,pdf}`).
|
||||
- **Target Modules (When Activated):**
|
||||
- `/workspace/hyperstitionstudio-core/src/hyperstitionstud_io/mcp/rest.py` & `server.py`
|
||||
- `/workspace/hyperstitionstudio-core/src/hyperstitionstud_io/mcp/tools.py`
|
||||
- `/workspace/hyperstitionstudio-core/deploy/hyperstition-mcp.service`
|
||||
- `/workspace/hyperstitionstudio-core/deploy/sync-vps-repos.sh` & `deploy/test-first-deployment.sh`
|
||||
|
||||
---
|
||||
|
||||
## 1. Scope of Deferred Integration
|
||||
|
||||
Once the standalone `hyperstitionstud_io.db.sqlite_meta` engine (`hyperstition-catalog.db` + `api-telemetry.db`) is built, this long-term plan specifies how to expose it over the public `/api/v1/meta/*` HTTP REST surface and `/mcp` JSON-RPC server and wire automatic RAM-`tmpfs` database hydration into the VPS deployment pipeline:
|
||||
|
||||
1. **Five `/api/v1/meta/*` HTTP REST Endpoints:**
|
||||
Expose `/api/v1/meta/{manifests,search,coordinate/{aq_int},timeseries/query,telemetry}` on `hyperstitionstud_io.mcp.rest` and `server.py`.
|
||||
2. **HTTP `ETag` / `If-None-Match` (`304 Not Modified`) Conditional Caching Middleware:**
|
||||
Serve deterministic `ETag` headers backed by `registry_manifests.dag_json_cidv1` (or SHA-256) and short-circuit matching `If-None-Match` requests with `HTTP 304 Not Modified` in `< 0.1 ms`.
|
||||
3. **MCP Tool `hs_query_sqlite_catalog`:**
|
||||
Register `hs_query_sqlite_catalog` in `MCP_TOOLS_SCHEMA` (`src/hyperstitionstud_io/mcp/tools.py`) and expose it at `/mcp` (`tools/call`) and `/api/v1/tools/hs_query_sqlite_catalog`.
|
||||
4. **VPS `tmpfs` Hydration in `deploy/sync-vps-repos.sh` & Systemd Sandboxing:**
|
||||
Run `hs-db-build` (`"${PYTHON_BIN}" -m hyperstitionstud_io.db.sqlite_meta --build`) inside `deploy/sync-vps-repos.sh` so `/var/www/hyperstitionstud.io/repos/hyperstition-catalog.db` refreshes in the `512 MB` RAM `tmpfs` mount on every pull while keeping `ProtectSystem=strict` and `ReadOnlyIsolationGuard` intact.
|
||||
|
||||
---
|
||||
|
||||
## 2. `/api/v1/meta/*` REST Endpoints & `hs_query_sqlite_catalog` MCP Tool Specification
|
||||
|
||||
### 2.1 REST Endpoints (`src/hyperstitionstud_io/mcp/rest.py`)
|
||||
|
||||
| HTTP Method & Path | Query Parameters | What It Queries in SQLite (`< 1 ms`) |
|
||||
| :--- | :--- | :--- |
|
||||
| `GET /api/v1/meta/manifests` | `?registry=glossary-registry` (optional) | Calls `query_registry_manifests()` on `registry_manifests` for all compiled schemas/registries, their record counts, `raw_sha256`, `dag_json_cidv1`, and `ETag` headers. |
|
||||
| `GET /api/v1/meta/search` | `?q=envideea+137&type=all\|glossary\|equation\|node&limit=25` | Calls `query_fts_catalog()` to execute a ranked **FTS5 `BM25` full-text search** across `fts_catalog` (searching glossary terms, 1,850+ equations, 388 graph nodes, and 24 tickers in `< 0.6 ms`). |
|
||||
| `GET /api/v1/meta/coordinate/{aq_int}` | `aq_int` in `1..999` (e.g. `/api/v1/meta/coordinate/137` or `/api/v1/meta/coordinate/125`) | Calls `query_coordinate_join(aq_int)` for a **Unified Cross-Corpus Coordinate Join**: in a single indexed SQL query, returns every glossary term, bilingual specimen, Knowledge Graph node/edge, `333/666/777` archive equation, and `/quant/` closing-bell bar that locks onto integer coordinate `{aq_int}`. |
|
||||
| `GET /api/v1/meta/timeseries/query` | `?symbol=NVDA&start=2026-11-10&end=2026-11-30&min_points=1.5` | Calls `query_timeseries_bars()` to execute indexed range queries over `quant_timeseries_bars` (`WHERE symbol = ? AND date_utc BETWEEN ? AND ? AND contingent_points >= ?`). |
|
||||
| `GET /api/v1/meta/telemetry` | None | Calls `get_api_telemetry_summary()` on `api-telemetry.db`, returning live server uptime, total calls, cache hit rate (`304`), mean/max latency ($\mu\text{s}$) per endpoint, and `100%` isolation verification counts. |
|
||||
|
||||
### 2.2 MCP Tool `hs_query_sqlite_catalog` (`src/hyperstitionstud_io/mcp/tools.py`)
|
||||
|
||||
- **Tool Name:** `hs_query_sqlite_catalog`
|
||||
- **Input Schema (`inputSchema`):**
|
||||
- `mode`: `"manifests" | "search" | "coordinate" | "timeseries" | "telemetry"` (default `"search"`)
|
||||
- `query`: `str` (FTS5 `BM25` search query when `mode == "search"`)
|
||||
- `doc_type`: `"all" | "glossary" | "equation" | "node" | "dossier" | "instrument"` (default `"all"`)
|
||||
- `aq_int`: `int` (`1..999`, required when `mode == "coordinate"`)
|
||||
- `symbol`: `str` (optional ticker filter when `mode == "timeseries"`)
|
||||
- `start_date`, `end_date`: `str` (`YYYY-MM-DD` bounds when `mode == "timeseries"`)
|
||||
- `min_points`: `float` (default `0.0`)
|
||||
- `limit`: `int` (`1..100`, default `25`)
|
||||
- **Execution Guarantees:** Runs strictly inside `ReadOnlyIsolationGuard` against `file:/.../hyperstition-catalog.db?mode=ro` (`PRAGMA query_only = ON;`).
|
||||
|
||||
---
|
||||
|
||||
## 3. HTTP `ETag` / `If-None-Match` (`304 Not Modified`) & VPS Systemd Sandboxing
|
||||
|
||||
1. **HTTP `ETag` & `If-None-Match` (`304 Not Modified`) Middleware in `_MCPHTTPHandler` (`mcp/server.py`):**
|
||||
- Every `GET /api/v1/*` response computes or looks up its deterministic `ETag` (`"<dag_json_cidv1>"` from `registry_manifests` or SHA-256 payload digest).
|
||||
- If the client sends `If-None-Match: "<etag>"` (or a comma-separated list containing `"<etag>"`), `_MCPHTTPHandler` records a `status_304` hit in `api-telemetry.db` and returns `HTTP 304 Not Modified` with an empty body immediately (`~95%` bandwidth reduction on repeat polls).
|
||||
2. **Read-Only Catalog DB Hydration in `deploy/sync-vps-repos.sh`:**
|
||||
- During Step 2 of `deploy/sync-vps-repos.sh`, invoke `"${PYTHON_BIN}" -m hyperstitionstud_io.db.sqlite_meta --build --db "${LIVE_REPOS}/hyperstition-catalog.db"` so the `512 MB` RAM-backed `tmpfs` mount always holds an up-to-date catalog DB after every repository pull.
|
||||
3. **Preserving `ProtectSystem=strict` & `ReadOnlyIsolationGuard` in `deploy/hyperstition-mcp.service`:**
|
||||
- Configure `RuntimeDirectory=hyperstition-mcp` (or `PrivateTmp=true` writing to `/tmp/hyperstition-api-telemetry.db`) so `hyperstition-mcp.service` writes `api-telemetry.db` only to an ephemeral tmpfs path while `/srv/hyperstitionstud.io/repos` and `/var/www/hyperstitionstud.io/repos` remain **100% read-only**.
|
||||
|
||||
---
|
||||
|
||||
## 4. Activation & Verification Checklist (When Promoted from Inactive Backlog)
|
||||
|
||||
1. Wire `/api/v1/meta/{manifests,search,coordinate/{aq_int},timeseries/query,telemetry}` and `ETag` / `If-None-Match` (`304 Not Modified`) into `src/hyperstitionstud_io/mcp/rest.py` and `server.py`.
|
||||
2. Add `hs_query_sqlite_catalog` to `MCP_TOOLS_SCHEMA` in `src/hyperstitionstud_io/mcp/tools.py`.
|
||||
3. Wire `hs-db-build` into `deploy/sync-vps-repos.sh` and add HTTP checks for `/api/v1/meta/manifests`, `/api/v1/meta/search?q=envideea`, `/api/v1/meta/coordinate/137`, `If-None-Match` -> `304 Not Modified`, and `/api/v1/meta/telemetry` to `tests/test_core_suite.py` and `deploy/test-first-deployment.sh`.
|
||||
Binary file not shown.
@@ -57,3 +57,5 @@
|
||||
| `PLAN-POLYGLOT-PROGRAMMING-LENS-GUILE-TYPESCRIPT-RUST-AND-SELECTOR.{md,pdf}` | Specification for the 3-language polyglot pedagogical lens (`λ Guile Scheme`, `TS TypeScript`, `Rs Rust`), `34px` 5-state segmented radiogroup (`#hsPolyglotModeSelector`), and 4-Ring Zero-Escape Sandbox (`polyglot_sandbox.py` & `hs-guile-scheme-repl.js`); now implemented across `/engineering/` (`E0–E5`) and `/math/` (`M0–M5`). |
|
||||
| `PLAN-ADHOC-MESSENGER-HIGHLIGHTS-SUMMARY-FOR-ENGINEERS-AND-MATH.{md,pdf}` | Specification for the zero-Web-UI, `<= 2` paragraph (`<= 1,100` char) phone-messenger highlights generator (`hs-highlights` CLI & `hs_generate_highlights_summary`, `src/hyperstitionstud_io/publishing/highlights.py`) writing exclusively to `/workspace/untracked/recent-highlights/`; now implemented and verified in `tests/test_core_suite.py`. |
|
||||
| `PLAN-COMPREHENSIVE-MCP-AND-CHATBOT-REST-API-CAPABILITY-EXPOSURE.{md,pdf}` | Specification for exposing all `/engineering/`, `/math/`, manuals, cold-rotated `.tar.gz` plans, `/learn/`, `/quant/` popovers, polyglot sandbox evaluations, and SQLite FTS5 / release state diagnostics via `MCP_TOOLS_SCHEMA` (`20` tools) and `STATIC_RESOURCES` (`14` resources) with `0` new custom REST routes in `rest.py`; now implemented in `src/hyperstitionstud_io/mcp/{tools,resources}.py`. |
|
||||
| `PLAN-SQLITE-META-REST-ENDPOINTS-ETAG-AND-VPS-SYNC.{md,pdf}` | Specification for SQLite catalog query modes (`manifests`, `fts_search`, `coordinate_join`, `timeseries_bars`, `telemetry`), VPS `tmpfs` catalog hydration in `deploy/sync-vps-repos.sh`, and deterministic HTTP `ETag` (`"<dag_json_cidv1>"`) + `If-None-Match` (`304 Not Modified`) conditional caching middleware in `src/hyperstitionstud_io/mcp/{rest,server}.py`; now implemented and verified in `tests/test_core_suite.py`. |
|
||||
| `PLAN-REMOVE-D-FILTER-DISCUSSION-FROM-ENGINEERING-AND-MATH-HUBS.{md,pdf}` | Specification for surgically removing all references to `assert_zero_d_filter`, `Zero-d-Filter`, `d-filter`, and `10-letter decagram` (`nuoagmhysl`) filters from `/engineering/` and `/math/` while preserving 100% of geometric (`d-periphery`), Confluence Dose ($D_{i,t}$), calculus ($d/dx$), and statistical ($df$) uses of `d`/`D`; now implemented in `src/hyperstitionstud_io/publishing/engineering_docs.py` and guarded in `tests/test_core_suite.py`. |
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"version": "2.2.2",
|
||||
"version": "2.3.2",
|
||||
"bundle_filename": "completed-plans-archive.tar.gz",
|
||||
"bundle_size_bytes": 3963428,
|
||||
"bundle_sha256": "bc5ed17cbf60821417e9e631ee42198bbc9933b40c73baae5f2601526ad432ac",
|
||||
"bundle_size_bytes": 4132494,
|
||||
"bundle_sha256": "b4961edb80aafcc51be0605bf49ab2e72542b567c134228e64a18c3ed9b2bce1",
|
||||
"require_companion_md": true,
|
||||
"member_count": 84,
|
||||
"total_uncompressed_bytes": 4742167,
|
||||
"member_count": 88,
|
||||
"total_uncompressed_bytes": 4936403,
|
||||
"preserved_standalone_pdfs": [],
|
||||
"members": [
|
||||
{
|
||||
@@ -368,6 +368,16 @@
|
||||
"size_bytes": 97326,
|
||||
"sha256": "4411a46a00e79cf8a891766432e1b748c7feb85f394091d8983ce0315e9c7503"
|
||||
},
|
||||
{
|
||||
"name": "PLAN-REMOVE-D-FILTER-DISCUSSION-FROM-ENGINEERING-AND-MATH-HUBS.md",
|
||||
"size_bytes": 7744,
|
||||
"sha256": "66e8086edfffe148d6cdeac645315a52b4f270fcbb18a0276da38f6407722c7c"
|
||||
},
|
||||
{
|
||||
"name": "PLAN-REMOVE-D-FILTER-DISCUSSION-FROM-ENGINEERING-AND-MATH-HUBS.pdf",
|
||||
"size_bytes": 89036,
|
||||
"sha256": "56324f894bbeed5dab80666cd865df84db70c1d70ef7d6bc4655f4c54485a07a"
|
||||
},
|
||||
{
|
||||
"name": "PLAN-SOFTWARE-ENGINEERING-EXPLICATION-HUB-AND-SUBPAGES.md",
|
||||
"size_bytes": 19681,
|
||||
@@ -378,6 +388,16 @@
|
||||
"size_bytes": 105359,
|
||||
"sha256": "ee62cbd81e85e90b8b35c5d32ba14f369155d2f23d2bda24937f0cd28bb2b7be"
|
||||
},
|
||||
{
|
||||
"name": "PLAN-SQLITE-META-REST-ENDPOINTS-ETAG-AND-VPS-SYNC.md",
|
||||
"size_bytes": 7611,
|
||||
"sha256": "c0bb178c893ee471099e6cc0a811261eb5b6e653c8cf5843ba2c479ed9a6888d"
|
||||
},
|
||||
{
|
||||
"name": "PLAN-SQLITE-META-REST-ENDPOINTS-ETAG-AND-VPS-SYNC.pdf",
|
||||
"size_bytes": 89845,
|
||||
"sha256": "6b4f3afe660fa38ada61f96a317f80bb5d4fb391b6b88ea2628a604ac018ba54"
|
||||
},
|
||||
{
|
||||
"name": "PLAN-SQLITE-REST-API-METADATA-DB.md",
|
||||
"size_bytes": 20367,
|
||||
|
||||
Binary file not shown.
@@ -120,7 +120,7 @@
|
||||
<div class="pulse-dot"></div>
|
||||
<h1>Cross-Repository Dependency Graph & Auditable Build → Test → Stage_Commit Pipeline</h1>
|
||||
</div>
|
||||
<p class="subtitle">Sibling Repositories under /workspace: ingglish-hyperdope-gematria • technocapital-singularity-zoology (v2.3.1) • encyclopedia-knowledge-graph (v2.3.1)</p>
|
||||
<p class="subtitle">Sibling Repositories under /workspace: ingglish-hyperdope-gematria • technocapital-singularity-zoology (v2.4.0) • encyclopedia-knowledge-graph (v2.4.0)</p>
|
||||
</div>
|
||||
|
||||
<!-- Main SVG Diagram -->
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 284 KiB After Width: | Height: | Size: 285 KiB |
@@ -2,7 +2,7 @@
|
||||
"$schema": "./schemas/v1/encyclopedia-graph.schema.json",
|
||||
"$id": "urn:io:hyperstitionstud:schema:v1:encyclopedia-graph",
|
||||
"namespace_urn": "urn:io:hyperstitionstud:ns:kg:1.0",
|
||||
"version": "2.3.1",
|
||||
"version": "2.4.0",
|
||||
"encyclopedia_base_path": "../technocapital-singularity-zoology/encyclopedia",
|
||||
"upstream_repository": "/workspace/technocapital-singularity-zoology",
|
||||
"isolation_verified": {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ window.HyperstitionStudio.EncyclopediaGraphData = {
|
||||
"$schema": "./schemas/v1/encyclopedia-graph.schema.json",
|
||||
"$id": "urn:io:hyperstitionstud:schema:v1:encyclopedia-graph",
|
||||
"namespace_urn": "urn:io:hyperstitionstud:ns:kg:1.0",
|
||||
"version": "2.3.1",
|
||||
"version": "2.4.0",
|
||||
"encyclopedia_base_path": "../technocapital-singularity-zoology/encyclopedia",
|
||||
"upstream_repository": "/workspace/technocapital-singularity-zoology",
|
||||
"isolation_verified": {
|
||||
|
||||
+4
-4
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Encyclopedia of Technocapital Singularity Zoology — Interactive Knowledge Graph (v2.3.1)</title>
|
||||
<title>Encyclopedia of Technocapital Singularity Zoology — Interactive Knowledge Graph (v2.4.0)</title>
|
||||
<style>
|
||||
:root {
|
||||
--bg-canvas: #020617;
|
||||
@@ -268,7 +268,7 @@
|
||||
<header>
|
||||
<div class="brand">
|
||||
<h1>ENCYCLOPEDIA OF TECHNOCAPITAL SINGULARITY ZOOLOGY — INTERACTIVE KNOWLEDGE GRAPH</h1>
|
||||
<p>Standalone Sibling Repository (/workspace/encyclopedia-knowledge-graph) • 388 Nodes • 1,282 Deduplicated Edges • Zero Glossary Leak • v2.3.1</p>
|
||||
<p>Standalone Sibling Repository (/workspace/encyclopedia-knowledge-graph) • 388 Nodes • 1,282 Deduplicated Edges • Zero Glossary Leak • v2.4.0</p>
|
||||
</div>
|
||||
<div class="toolbar">
|
||||
<button class="btn active" data-mode="mode2_radar">Mode 2: ETI Radar (S+ -> D Periphery)</button>
|
||||
@@ -321,10 +321,10 @@
|
||||
</aside>
|
||||
</div>
|
||||
<footer class="hs-global-footer" style="background:#1A1D26;border-top:1px solid #323846;padding:4px 14px;text-align:center;font-size:11px;color:#9BA3B8;z-index:20;">
|
||||
<span class="hs-lemur-credit">hyperstitionstud.io/graph v2.3.1 • Made with <span class="hs-heart" role="img" aria-label="love" style="color:#FB7185;display:inline-block;padding:0 2px;">♥</span> by Lemurs.</span>
|
||||
<span class="hs-lemur-credit">hyperstitionstud.io/graph v2.4.0 • Made with <span class="hs-heart" role="img" aria-label="love" style="color:#FB7185;display:inline-block;padding:0 2px;">♥</span> by Lemurs.</span>
|
||||
</footer>
|
||||
|
||||
<script src="graph-data.js?v=2.3.1"></script>
|
||||
<script src="graph-data.js?v=2.4.0"></script>
|
||||
<script>
|
||||
(function() {
|
||||
const DATA = (window.HyperstitionStudio && window.HyperstitionStudio.EncyclopediaGraphData) || window.ENCYCLOPEDIA_GRAPH_DATA;
|
||||
|
||||
@@ -705,7 +705,7 @@ def build_graph(upstream_repo: Path = UPSTREAM_REPO_DEFAULT) -> dict[str, Any]:
|
||||
"$schema": "./schemas/v1/encyclopedia-graph.schema.json",
|
||||
"$id": URN_SCHEMA_GRAPH,
|
||||
"namespace_urn": URN_GRAPH_NS,
|
||||
"version": "2.3.1",
|
||||
"version": "2.4.0",
|
||||
"encyclopedia_base_path": "../technocapital-singularity-zoology/encyclopedia",
|
||||
"upstream_repository": str(upstream_repo),
|
||||
"isolation_verified": {
|
||||
|
||||
Reference in new issue
Block a user