Compare commits

...
3 Commits
18 changed files with 640 additions and 18 deletions

No files matched your search

@@ -0,0 +1,26 @@
# Plan: Alternative Single-Row Header Layout — Folding Passive Telemetry Counters into `.subtitle` (`v2.0.19`)
- **Document ID:** `PLAN-HEADER-SUBTITLE-TELEMETRY-CONSOLIDATION-ALTERNATIVE` (`v2.0.19`)
- **Roadmap Status:** **LONG-TERM INACTIVE PLAN (Deferred Alternative)** — Preserved in the inactive backlog in case a future layout revision wishes to fold the three passive telemetry counter badges on `site/index.html` into `.subtitle` so the right-hand `.meta-badges` container holds exclusively interactive route buttons. Not active unless explicitly requested by the user.
- **Target File (When Activated):** `/workspace/hyperstitionstudio-core/site/index.html`
---
## 1. Motivation & Horizontal Budget Analysis
In `/workspace/hyperstitionstudio-core/site/index.html`, the `<header>` container has `max-width: 1260px` and `padding: 1.4rem 1.6rem` (`25.6px` per side), providing `1208.8px` of usable inner horizontal width:
- Currently (under implemented `Option 3` of `PLAN-STATIC-DONATE-SUBPAGE`), `.meta-badges` keeps the three passive `.badge` counters (`388 Graph Nodes`, `1,282 Typed Edges`, `24 Quant Tickers`) alongside the interactive route buttons (`Start Learning Track (/learn/)`, `Quant Time-Series (/quant/)`) and the terminal right-justified `( ♥ DONATE )` stadium pill (`.btn-donate-pill`), using `margin-left: auto; justify-content: flex-end;` so the cluster remains right-justified even when wrapping onto a second flex line.
- If a strictly non-wrapping single-row `<header>` at `1260px` desktop width is desired in the future without abbreviating button labels:
1. Move the three static counts (`388 Nodes • 1,282 Edges • 24 Tickers`) inline into the existing `.subtitle` paragraph under `<h1>` (`~710px` total left block width).
2. Reserve `.meta-badges` (`margin-left: auto; display: flex; align-items: center; gap: 0.55rem; flex-shrink: 0`) strictly for interactive navigation routes:
`[ Start Learning Track (/learn/) ] [ Quant Time-Series (/quant/) ] | ( ♥ DONATE )` (`~430px` total right block width).
3. Combined width: `710px + 16px gap + 430px = 1156px <= 1208.8px` (`~52px` of spare horizontal margin on a single unbroken row).
---
## 2. Implementation Specification (When Activated)
1. In `/workspace/hyperstitionstudio-core/site/index.html`, update `.subtitle` to include `388 Graph Nodes &bull; 1,282 Typed Edges &bull; 24 Quant Tickers` and remove the three `<span class="badge">...</span>` elements from `.meta-badges`.
2. Add `flex-wrap: nowrap` on desktop (`@media (min-width: 1180px)`) to `<header>` while retaining `flex-wrap: wrap` and `margin-left: auto; justify-content: flex-end` on `.meta-badges` below `1180px`.
3. Verify `version_sync --check` and `tests/test_core_suite.py` pass with zero regressions.
@@ -0,0 +1,73 @@
# 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`.
+14 -9
View File
@@ -4,12 +4,13 @@
- **Target Domain:** `https://hyperstitionstud.io` (and `https://www.hyperstitionstud.io` -> `308` redirect)
- **Upstream Git Forge:** `git.libre.audio` (`https://git.libre.audio/seasharp/<repo-slug>.git`)
- **Bundled Deployment Automation (`hyperstitionstudio-core/deploy/`):**
- `deploy/sync-vps-repos.sh` — Pulls from `git.libre.audio`, automatically supplies untracked `haiperdohp-jemaytreeah/.gitignore` runtime files (`config.js`, `db.json`, `db_lite.json`) if absent, runs `hs-doctor` and 6-gate Knowledge Graph verification, syncs per-repo install directories into RAM (`/var/www/hyperstitionstud.io/repos`), creates relative route symlinks (`/`, `/learn`, `/graph`, `/encyclopedia`, `/zoology`, `/archive`, `/calc`, `/ci`, `/schemas`), pre-compresses `.br` (Brotli-11) and `.gz` (Gzip-9) sidecars, and idempotently syncs `Caddyfile` + `systemd` units.
- `deploy/Caddyfile` — Production Caddy 2 configuration (`HTTP/3 QUIC` + `precompressed br gzip` + direct per-repo `handle_path` routing + `/mcp` reverse proxy to `127.0.0.1:8095`).
- `deploy/sync-vps-repos.sh` — Pulls from `git.libre.audio`, automatically supplies untracked `haiperdohp-jemaytreeah/.gitignore` runtime files (`config.js`, `db.json`, `db_lite.json`) if absent, runs `hs-doctor` and 6-gate Knowledge Graph verification, syncs per-repo install directories into RAM (`/var/www/hyperstitionstud.io/repos`), creates relative route symlinks (`/`, `/learn`, `/quant`, `/graph`, `/encyclopedia`, `/zoology`, `/archive`, `/calc`, `/ci`, `/schemas`), pre-compresses `.br` (Brotli-11) and `.gz` (Gzip-9) sidecars, and idempotently syncs `Caddyfile`, `systemd` units, and `/etc/logrotate.d/hyperstition-sqlite-meta`.
- `deploy/Caddyfile` — Production Caddy 2 configuration (`HTTP/3 QUIC` + `precompressed br gzip` + direct per-repo `handle_path` routing + `/mcp` and `/api/v1/*` reverse proxy to `127.0.0.1:8095`).
- `deploy/hyperstition-tmpfs-sync.service` — `systemd` unit that hydrates `/var/www/hyperstitionstud.io/repos` on VPS boot before Caddy starts.
- `deploy/hyperstition-mcp.service` — `systemd` unit running `hs-mcp --transport http --host 127.0.0.1 --port 8095` in strict read-only mode.
- `deploy/test-first-deployment.sh` — Automated 32-route + `/mcp` HTTP verification harness (verifies all portal, `/learn/`, graph, encyclopedia, `haiperdohp-jemaytreeah` `.gitignore` files `config.js`/`db_lite.json`/`db.json`, CI, schema, and `/mcp` JSON-RPC routes).
- **Bundled CLI Entrypoints (`hyperstitionstudio-core/pyproject.toml`):** `hs-doctor`, `hs-citations`, `hs-pdf-build`, `hs-kg-build`, `hs-quant-harvest` (`--mode us-closing-bell` default), `hs-mcp`, and `hs-sync-version`.
- `deploy/hyperstition-mcp.service` — `systemd` unit running `hs-mcp --transport http --host 127.0.0.1 --port 8095` in strict read-only mode while populating `/tmp/hyperstition-api-telemetry.db` (`HYPERSTITION_SQLITE_MAX_MB=100`).
- `deploy/logrotate.d/hyperstition-sqlite-meta` — Quiescent `logrotate.d` rule (`size 100M` default, `rotate 12`, `compress`, `delaycompress`, configurable via `HYPERSTITION_SQLITE_MAX_MB` / `HYPERSTITION_SQLITE_MAX_BYTES`) that compresses a consistent point-in-time SQLite snapshot (`<db>.1.gz` .. `<db>.12.gz`) and truncates the active SQLite REST/MCP API metadata database via `hs-db-build --truncate-quiescent --compress-archive` (`BEGIN EXCLUSIVE` + `PRAGMA wal_checkpoint(TRUNCATE)` + `VACUUM` + `PRAGMA integrity_check`).
- `deploy/test-first-deployment.sh` — Automated static route + `/mcp` + `/api/v1/*` + SQLite `logrotate.d` quiescent truncation verification harness.
- **Bundled CLI Entrypoints (`hyperstitionstudio-core/pyproject.toml`):** `hs-doctor`, `hs-citations`, `hs-pdf-build`, `hs-kg-build`, `hs-quant-harvest` (`--mode us-closing-bell` default), `hs-mcp`, `hs-sync-version`, and `hs-db-build`.
---
@@ -103,7 +104,7 @@ curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --d
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list >/dev/null
sudo chmod a+r /usr/share/keyrings/caddy-stable-archive-keyring.gpg /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install -y git python3 python3-venv python3-pip brotli rsync curl caddy fonts-dejavu-core
sudo apt update && sudo apt install -y git python3 python3-venv python3-pip brotli rsync curl logrotate caddy fonts-dejavu-core
sudo tee /etc/sysctl.d/99-hyperstition-fastnet.conf >/dev/null <<'EOF'
net.core.default_qdisc = fq
@@ -164,11 +165,14 @@ python3 -m venv .venv
# 1. Hydrate /var/www/hyperstitionstud.io/repos and pre-compress (.br / .gz)
/srv/hyperstitionstud.io/repos/hyperstitionstudio-core/deploy/sync-vps-repos.sh --no-pull
# 2. Install systemd boot-time tmpfs hydration unit & read-only MCP HTTP server unit (127.0.0.1:8095)
# 2. Install systemd boot-time tmpfs hydration unit, read-only MCP HTTP server unit (127.0.0.1:8095), and quiescent SQLite logrotate rule
sudo cp /srv/hyperstitionstud.io/repos/hyperstitionstudio-core/deploy/hyperstition-tmpfs-sync.service \
/etc/systemd/system/hyperstition-tmpfs-sync.service
sudo cp /srv/hyperstitionstud.io/repos/hyperstitionstudio-core/deploy/hyperstition-mcp.service \
/etc/systemd/system/hyperstition-mcp.service
sudo cp /srv/hyperstitionstud.io/repos/hyperstitionstudio-core/deploy/logrotate.d/hyperstition-sqlite-meta \
/etc/logrotate.d/hyperstition-sqlite-meta
sudo chmod 0644 /etc/logrotate.d/hyperstition-sqlite-meta
sudo systemctl daemon-reload
sudo systemctl enable hyperstition-tmpfs-sync.service
sudo systemctl enable --now hyperstition-mcp.service
@@ -215,13 +219,14 @@ Sync the updated working tree(s) into the RAM mount and regenerate the `.br` / `
```
*(Note: If a remote tag was force-updated earlier and `git fetch --tags` rejects it with `would clobber existing tag` before `hyperstitionstudio-core` has pulled commit `b767f8a`, run `git -C /srv/hyperstitionstud.io/repos/hyperstitionstudio-core fetch --force origin main --tags && git -C /srv/hyperstitionstud.io/repos/hyperstitionstudio-core merge --ff-only origin/main` once first).*
### 5.3 Automatic Idempotent `Caddyfile` & `systemd` Sync (Default vs. `--no-caddy`)
### 5.3 Automatic Idempotent `Caddyfile`, `systemd` & `logrotate.d` Sync (Default vs. `--no-caddy`)
- **Idempotent by Default (`DO_CADDY=1`):**
Every run of `sync-vps-repos.sh` (unless `--no-caddy` or `--no-services` is passed) automatically compares `deploy/Caddyfile` against `/etc/caddy/Caddyfile` and `deploy/*.service` against `/etc/systemd/system/*.service` using `cmp -s`:
Every run of `sync-vps-repos.sh` (unless `--no-caddy` or `--no-services` is passed) automatically compares `deploy/Caddyfile` against `/etc/caddy/Caddyfile`, `deploy/*.service` against `/etc/systemd/system/*.service`, and `deploy/logrotate.d/hyperstition-sqlite-meta` against `/etc/logrotate.d/hyperstition-sqlite-meta` using `cmp -s`:
1. If `/etc/caddy/Caddyfile` is already byte-identical to `deploy/Caddyfile`, it prints `[5/5] /etc/caddy/Caddyfile is already identical to deploy/Caddyfile (no reload needed)` and performs zero unnecessary reloads.
2. If `deploy/Caddyfile` changed, it validates the new config first via `sudo caddy validate --config ... --adapter caddyfile`, copies it to `/etc/caddy/Caddyfile`, and executes a zero-downtime `sudo systemctl reload caddy`.
3. If `hyperstition-tmpfs-sync.service` or `hyperstition-mcp.service` changed, it updates `/etc/systemd/system/`, runs `sudo systemctl daemon-reload`, and ensures `hyperstition-mcp.service` is active.
4. If `/etc/logrotate.d/hyperstition-sqlite-meta` is missing or differs from `deploy/logrotate.d/hyperstition-sqlite-meta`, it installs the rule with `0644` permissions so the SQLite REST/MCP metadata database (`/tmp/hyperstition-api-telemetry.db`) is quiescently truncated at the configurable `100 MB` limit (`size 100M`, `HYPERSTITION_SQLITE_MAX_MB=100`).
- **Negating Service/Caddy Sync (`--no-caddy` / `--no-services`):**
Pass `--no-caddy` (e.g., `sync-vps-repos.sh --no-pull --no-caddy`) to sync only the RAM-backed webroot files and `.br`/`.gz` sidecars without touching `/etc/caddy/Caddyfile` or `systemd`.
- **Browser Cache Note:** `HTML`/`JS`/`JSON` routes carry `Cache-Control: public, max-age=300` (5 minutes); press `Ctrl+Shift+R` (`Cmd+Shift+R` on macOS) in your browser to bypass the 5-minute client cache immediately after syncing.
Binary file not shown.
@@ -0,0 +1,104 @@
# Plan: `/quant/` Zero-MP4 Interactive HTML5 Canvas Tutorial Tour, Interface Figure Guide & Passage-Encoded Deep-Link Citation Drawer (`v2.0.18`)
- **Document ID:** `PLAN-QUANT-TUTORIAL-VIDEO-SERIES-AND-CITATION-DEEP-LINKS` (`v2.0.18`)
- **Storage & Delivery Architecture (Option B — Zero-MP4 Interactive HTML5 Canvas / Subtitled Walkthrough, `< 150 KB` Total, 100% Git-Tracked):**
- Rather than committing multi-megabyte `.mp4` video binaries into Git or consuming space in the `512 MB` VPS `tmpfs` RAM mount, the 5-episode tutorial series resides directly in `/workspace/hyperstitionstudio-core/site/quant/` (`quant-tutorials.js`, `< 45 KB` uncompressed, `~12 KB` Brotli-11) as an **interactive, timeline-scrubbable 5-Episode Guided Canvas Player**.
- When a user plays an episode (`Ep 01` through `Ep 05`), the player programmatically drives the live `/quant/` interface in real time—switching tickers (`NVDA`, `ASML`, `ANTHR-PVT`, `LLY`), scrubbing UTC dates, toggling projection lenses, drawing animated spotlight callout rings and vector arrows directly over the live Panel 1–4 figures, displaying synchronized chapter subtitles (with optional zero-dependency browser `window.speechSynthesis` narration toggle), and presenting clickable passage-encoded citation cards at every keyframe!
- **Target Web Route & Tracked Files:**
- `/workspace/hyperstitionstudio-core/site/quant/index.html` & `quant-app.js`
- `/workspace/hyperstitionstudio-core/site/quant/quant-tutorials.js` (`window.HyperstitionStudio.QuantTutorials` — 5 episodes, 25 timed keyframes, animated canvas spotlight overlay, play/pause/scrub timeline bar, and clickable deep-link cards)
- `/workspace/hyperstitionstudio-core/site/quant/OPERATORS-MANUAL-QUANT-TIMESERIES-WORKBENCH.{md,pdf}` (Companion Reference Manual with clickable passage-encoded deep links)
- **Core Architectural Feature (Knowledge-Graph-Modeled Documentation & Passage-Encoded Deep-Link Citations):**
Models `/quant/`'s **Documentation & Citation Drawer** directly on the Encyclopedia Knowledge Graph's (`encyclopedia-knowledge-graph/index.html`) `ENC_BASE + volume_pdf_rel` inspector drawer, and extends every link with **RFC 3778 PDF Page/Search Fragments (`#page=N&search="verbatim_lock"`)** and **WICG Scroll-To-Text Fragments (`#:~:text=start_token,end_token`)** plus `/api/v1/dossiers/{N}?highlight=<passage>` and `/graph/index.html?select=aq:137` so clicking any figure or lock on `/quant/` (or inside the tutorial player) jumps straight to the cited passage.
---
## 1. Explaining Every Visual Figure & Numerical Readout in the `/quant/` Interface
Every curve, marker, bar, cell, and metric in `/quant/index.html` is spotlighted by the interactive tutorial player and linked in the **Documentation & Citation Drawer**:
### 1.1 Panel 1 — Synchronized 3-Pane Time-Series Canvas (`#tsCanvas`)
| Canvas Element / Figure | Visual Encoding on Screen | Mathematical & Gematrial Meaning | Passage-Encoded Encyclopedia & Dossier Deep Link |
| :--- | :--- | :--- | :--- |
| **1. Top-Pane Solid Cyan Curve** | Continuous `#22d3ee` cyan polyline across `30` UTC days (`2026-11-01 .. 2026-11-30`) | Plots the active metric selected in the **Metric Mode** bar for ticker $i$:<br/>• `Spoken AQ (Gen 1)`: $Q^{\text{spoken}}_{i,t} = \text{AQ}(\text{Ingglish}(\text{spoken}(\lfloor P_{i,t}\rceil)))$<br/>• `Close Price (USD)`: Official `21:30 UTC` closing price $P_{i,t}$<br/>• `Move (BPS)`: Daily basis-point change $\Delta\text{bps}_{i,t} = \text{round}(100 \times \Delta\%_{i,t})$<br/>• `Digit AQ`: Literal Base-36 digit sum of $\lfloor P_{i,t}\rceil$. | `/encyclopedia/01-cipher-and-orthographic-mechanics/a-to-g-alphanumeric-qabbala-to-gen-2-evolution.pdf#page=1&search=Alphanumeric%20Qabbala` |
| **2. Top-Pane Horizontal Dashed Crimson Line (`entity_ing = N`)** | Dashed `#ff4d4d` horizontal threshold line labeled with the ticker's `Gen 1` Ingglish name and `AQ` value (e.g., `envideea=137`, `asml=81`, `anthropik=193`) | Marks the instrument's **Intrinsic Phonemic Identity Coordinate ($\text{AQ}_{\text{Ing}}(\text{Entity}_i)$)**. When the cyan trajectory touches or crosses this dashed line, the asset's market price or basis-point move equals its own name in Base-36 space. | `/encyclopedia/03-machinic-phylum-singularities-s1-to-s5/s3-a-to-z-asml-to-wor-masheen.pdf#page=5&search=envideea` |
| **3. Top-Pane Gold Beacon Circles (`r = 5.2px`)** | Glowing `#f5c630` gold circles plotted directly on vertices of the cyan curve | **`Scope 1` Intra-Instrument Self-Lock or Repdigit Attractor:** Fires when $\lfloor P_{i,t}\rceil == \text{AQ}(\text{Entity}_i)$ (`NVDA` closing at `$137.00 == envideea [137]`), $|\Delta\text{bps}_{i,t}| == \text{AQ}(\text{Entity}_i)$ (`ASML` moving `+81 bps == asml [81]`), or $\lfloor P_{i,t}\rceil \equiv 0 \pmod{111}$ (`LLY` closing at `$777.00 == 7 × 111`). | `/encyclopedia/08-stakeholder-registers-idioms-and-pokedex-semiotics/a-to-h-ai-powered-race-to-hidden-chokepoint-screen.pdf#page=2&search=Room%20Filter` |
| **4. Top-Pane Cyan Beacon Circles (`r = 3.8px`)** | `#22d3ee` cyan vertex markers on the curve | **`Scope 2` Causal `S1–S6` Supply-Chain Ring Migration:** Fires when $\lfloor P_{i,t}\rceil$, $Q^{\text{spoken}}_{i,t}$, or $|\Delta\text{bps}_{i,t}|$ lands on one of the `30` canonical `S1–S6` signature ring coordinates (`71, 81, 91, 95, 115, 125, 128, 129, 133, 135, 136, 137, 153, 160, 163, 166, 183, 189, 191, 193, 197, 211, 215, 222, 237, 246, 256, 260, 292`). | `/encyclopedia/06-genealogical-vectors-and-flex-singularities/a-to-m-anchor-revision-to-multi-build-flex.pdf#page=2&search=Flex` |
| **5. Middle-Pane Violet & Emerald Histogram Bars (`Wire Eq`)** | Vertical bars showing the count of verified `333 / 666 / 777` equations synthesized in that UTC date's `00:00 GMT` news-wire dossier (`25..71-dossier-news-YYYY-MM-DD.md`) | • **Violet Bar (`#a78bfa`):** Standard `00:00 GMT` wire harvest day (ticker $i$ not named in top headlines).<br/>• **Emerald Bar (`#34d399`):** **`Scope 3` News-Wire Co-Presence Day ($C_{i,t} = 1$)** — Ticker $i$ or its entity name co-occurred in breaking wire headlines on the exact same UTC date as its market observation. | `/archive/71-dossier-news-2026-11-29.md#:~:text=Nvidia,73` |
| **6. Bottom-Pane Volume Ratio & Regime Color Bars (`Vol20d`)** | Vertical bars scaled to 20-day relative volume ($V_{i,t}/\bar{V}_{20}$) and color-coded by objective `Scope 3` thermodynamic regime | • **Gold Bar (`#f5c630`, `Vol20d < 0.45x`):** `M1_ENTROPIC_STAGNATION` (halts, low-volume freeze -> `137: hawlts == inersha == envideea`).<br/>• **Crimson Bar (`#ff4d4d`, `Δ% <= -5.0%` or `Vol20d >= 2.5x`):** `M2_FLASH_CRASH_TEMPLEX_SURGE` (`193: flash krash == anthropik`, `256: akselerayshan`).<br/>• **Sky-Blue Bar (`#38bdf8`):** Normal kinetic trading regime (`M3_LEVIATHAN` active for `$1T+` market caps). | `/encyclopedia/05-memetic-superclass-m1-to-m7/m1-a-to-m-anemia-to-monopoly.pdf#page=1&search=M1` |
| **7. Vertical Gold Crosshair Line** | Full-height vertical gold cursor line (`rgba(245,198,48,0.45)`) | Synchronizes all three canvas panes, the Panel 2 heatmap column, and the Panel 3 cross-sectional inspector to the selected UTC date $t$. | Interactive UI control (`Click` canvas or press `←` / `→`). |
### 1.2 Panel 2, Panel 3 & Panel 4 Figures
- **Panel 2 (`24 Tickers × 30 UTC Days` Spatiotemporal Heatmap):**
- Each row is one of the `24` `S1–S6` tickers (`↗` opens its live TradingView Superchart in a new browser window); each column is a UTC day (`01..30`).
- **Gold Cell (`hm-scope1`):** Scope 1 Intra-Instrument Self-Lock on that `(Ticker, Date)`.
- **Cyan Cell (`hm-scope2`):** Scope 2 `S1–S6` Ring Migration on that `(Ticker, Date)`.
- **Emerald Outline (`hm-wire`):** Ticker co-occurred in that UTC day's `00:00 GMT` news-wire dossier (`Scope 3`).
- **Panel 3 (Cross-Sectional Date Inspector, Multi-Lens Card, Documentation Citations & Verbatim Equation Tape):**
- Top 6 telemetry boxes display the exact values at date $t$: `Close USD (Change bps)`, `Spoken Close (Gen 1 AQ)`, `Scaled Cap (Gen 1 AQ)`, `BPS Spoken AQ / Vol20d`, `Active Contingent Locks`, and `00:00 GMT Wire Co-Present`.
- Middle **Lens Projection Card (`LENS_REGISTRY`)** dynamically projects the instrument's 6 lens-neutral time-series moments (`ts_duty_cycle_pct`, `ts_weighted_resonance`, `ts_excess_over_replacement`, `ts_quantile_profile`, `ts_optimal_lag_days`, `ts_regime_splits`) and 30-day sparkline (`▁▂▃▄▅▆▇█`) into the selected lens (`Quant Factor`, `Neutral Math`, `Corporate Board`, `TierZoo (ETI)`, `Fantasy Sabermetrics`, or `Pokédex Scanner`).
- **Knowledge-Graph-Modeled Documentation & Cited Passages Card:** Displays the ticker's Encyclopedia Volume PDF deep link (`#page=N&search=...`), Knowledge Graph node deep link (`/graph/index.html?select=aq:N`), exemplar Dossier scroll-to-text link (`#:~:text=...`), and REST API JSON/passage link (`/api/v1/dossiers/N?highlight=...`).
- Bottom **Dated Memetic Equation Tape** lists the verbatim `333 / 666 / 777` equations from that date's `*-dossier-news-YYYY-MM-DD.md` archive file, each with its own clickable `#:~:text=` passage deep link and inline REST passage preview button.
- **Panel 4 (Lead-Lag Cross-Correlation Histogram $r(\tau)$ at $\tau \in [-5, +5]$ Days):**
- Plots the empirical Pearson correlation $r(\tau)$ between daily news-wire equation velocity $M_t$ and unsigned ticker basis-point displacement $|\Delta\text{bps}_{i, t+\tau}|$, highlighting the optimal causal lag $\tau^*$ in gold.
---
## 2. Option B Interactive Tutorial Player Architecture (`/quant/quant-tutorials.js`)
Instead of static `.mp4` video files, `/quant/` includes an integrated **5-Episode Interactive Canvas Tutorial Player** directly below the top toolbar:
```text
+---------------------------------------------------------------------------------------------------+
| INTERACTIVE TUTORIAL SERIES PLAYER (Zero-MP4 Live Canvas Choreographer • < 45 KB Git-Tracked) |
| [ Ep 01: Periodicity Gate ] [ Ep 02: 3-Pane Canvas & Locks ] [ Ep 03: Heatmap & Deep Citations ] |
| [ Ep 04: Modular Lens Switcher ] [ Ep 05: Lead-Lag r(tau) & REST API ] |
| +-----------------------------------------------------------------------------------------------+ |
| | [ ▶ Play / Pause ] [ ⏮ Prev Step ] [ Step 2/5 (00:18 / 00:45) ━━━━●━━━━━━ ] [ ⏭ Next ] [ 🔊 ] | |
| | SUBTITLE & CALLOUT: "Notice the Gold Circle on Nov 30 ($137.00): NVDA's integer close equals | |
| | its own Gen 1 Ingglish coordinate (envideea = 137 [33rd PRIME])—a Scope 1 Self-Lock." | |
| | CITED SOURCES: [ 📄 Vol 03C PDF (p.5 "envideea") ↗ ] [ 📜 Dossier 71 Passage ↗ ] [ 🕸️ aq:137 ]| |
| +-----------------------------------------------------------------------------------------------+ |
+---------------------------------------------------------------------------------------------------+
```
### 2.1 How Each Episode Choreographs the Live Interface (`5` Episodes × `5` Timed Keyframes = `25` Interactive Scenes)
When an episode plays (auto-advancing every `7 seconds` per keyframe or stepped manually via `⏮ / ⏭` or timeline scrubbing):
1. **State Synchronization:** Each keyframe sets `{guildFilter, selectedSymbol, selectedLens, metricMode, selectedDateIdx}` on the live `/quant/` state machine and triggers `renderAll()`.
2. **Canvas Spotlight & Callout Overlay:** Draws a pulsing gold/rose spotlight ring, vector callout arrow, and HUD label directly on `#tsCanvas` (or highlights the target DOM panel `#heatmapTable`, `#lensProjectionCard`, `#docReferencesCard`, `#lagBarsContainer`) pointing to the exact figure being explained.
3. **Passage-Encoded Citation Bar:** Renders clickable deep-link pills for the exact Encyclopedia PDF page (`#page=N&search=...`), Dossier passage (`#:~:text=...`), REST API passage preview (`/api/v1/dossiers/{N}?highlight=...`), and Knowledge Graph node (`/graph/index.html?select=aq:N`) referenced in that scene.
| Episode ID | Title & Focus | Live State Choreography & Spotlighted Figures |
| :--- | :--- | :--- |
| **Ep 01** | **The Strict Periodicity Gate & Watchlist Topology** | Steps through `ALL -> S1 -> S3 -> S6` guild filters, spotlights the Periodicity Audit Footer (`20` dated `00:00 UTC` dossiers + `30` daily `21:30 UTC` closing-bell bars, `0` non-periodic static records), and links to `Vol 08A#page=2&search=Room%20Filter` and `/archive/00-index-and-methodology.md#:~:text=closing-bell,continuity`. |
| **Ep 02** | **Reading Panel 1: Spoken AQ Curves, Gold/Cyan Beacons & Regimes** | Focuses `NVDA` (`$137 == envideea [137]`), `ASML` (`+81 bps == asml [81]`), and `LLY` (`$777` repdigit); switches between `Close Price (USD)`, `Move (BPS)`, and `Spoken AQ (Gen 1)`; spotlights the dashed crimson `entity_ing=N` threshold, Gold (`Scope 1`) vs. Cyan (`Scope 2`) beacons, Emerald (`Scope 3`) wire co-presence bars, and `M1/M2/M3` volume bars. |
| **Ep 03** | **Panels 2 & 3: The 24×30 Lock Heatmap, TradingView & Deep Citations** | Scrubs across the `24 × 30` heatmap (`ANTHR-PVT` `$83 -> $89 [193]` on `2026-11-26`, `NVDA` on `2026-11-29`), highlights the `Open TradingView Chart ↗` launcher (`T`), and demonstrates clicking the passage-encoded Encyclopedia PDF (`#page & search`), Dossier (`#:~:text=`), and inline `/api/v1/dossiers/71?highlight=` preview buttons. |
| **Ep 04** | **Hot-Swapping Projection Lenses (`LENS_REGISTRY` Reversibility)** | Holds `NVDA` at `2026-11-30` while cycling the **Projection Lens** selector through `Quant Factor`, `Neutral Math`, `Corporate Board`, `TierZoo (ETI)`, `Fantasy Sabermetrics`, and `Pokédex Scanner` (`DEX #137`), proving how the exact same 6 lens-neutral mathematical moments (`ts_*`) re-project without altering a single underlying number. |
| **Ep 05** | **Panel 4: Lead-Lag Cross-Correlation $r(\tau)$, Exports & REST/SQLite APIs** | Spotlights Panel 4's correlation bars $r(\tau)$ across $\tau \in [-5, +5]$ days and the Gold optimal causal lag $\tau^*$, demonstrates `.CSV` and `.JSON` export, and links directly to `/api/v1/quant/timeseries?symbol=NVDA` and `/api/v1/openapi.json`. |
---
## 3. Four-Phase Implementation Roadmap (`Phases 1–4`)
### Phase 1: Enrich `quant/timeseries.py`, `mcp/rest.py` & `encyclopedia-knowledge-graph/index.html` with Deep-Link Resolution
1. In `/workspace/hyperstitionstudio-core/src/hyperstitionstud_io/quant/timeseries.py`, attach `doc_references` (`encyclopedia_volume_rel`, `encyclopedia_deep_link` with `#page=N&search=...`, `knowledge_graph_deep_link` with `/graph/index.html?select=aq:N`, `exemplar_dossier_deep_link` with `#:~:text=...`, `rest_api_deep_link`, and `verbatim_citation_passage`) to every instrument, guild build, and dated wire equation (`dossier_deep_link`, `api_highlight_link`, `graph_hub_links`), and regenerate `quant-timeseries.json` and `quant-timeseries-data.js`.
2. In `/workspace/hyperstitionstudio-core/src/hyperstitionstud_io/mcp/rest.py`, add `?highlight=<passage>` support to `GET /api/v1/dossiers/{number}` so it returns `matched_passages` (line numbers + verbatim surrounding lines) alongside the dossier Markdown.
3. In `/workspace/encyclopedia-knowledge-graph/index.html`, add URL query parameter handling (`?select=<node_id>&mode=<mode_id>`) on startup so clicking a Knowledge Graph deep link from `/quant/` immediately selects, centers, and opens the right-hand Encyclopedia drawer for that node.
### Phase 2: Build `/workspace/hyperstitionstudio-core/site/quant/quant-tutorials.js` & Update `/quant/index.html` + `quant-app.js`
1. Create `site/quant/quant-tutorials.js` containing the 5-episode, 25-keyframe interactive canvas choreographer, timeline scrubber, canvas spotlight/arrow overlay renderer, optional Web Speech narration toggle, and inline REST passage preview modal.
2. Update `site/quant/index.html` and `site/quant/quant-app.js` to render:
- The collapsible **Interactive Tutorial Series Player (`Ep 01–Ep 05`)** and **Visual Figure Legend**,
- The Knowledge-Graph-modeled **Documentation & Cited Passages Card** in Panel 3, and
- Passage-encoded `#:~:text=` deep links + inline passage preview buttons on every equation in the Dated Memetic Equation Tape.
3. Register `site/quant/quant-tutorials.js` in `version_sync.py`.
### Phase 3: Write `/quant/OPERATORS-MANUAL-QUANT-TIMESERIES-WORKBENCH.{md,pdf}`
1. Author `/workspace/hyperstitionstudio-core/site/quant/OPERATORS-MANUAL-QUANT-TIMESERIES-WORKBENCH.md` and compile `.pdf` via `hs-pdf-build`, providing the complete reference manual for `/quant/` with clickable passage-encoded links.
### Phase 4: Verification in `tests/test_core_suite.py` & `deploy/test-first-deployment.sh`
1. Add unit assertions in `tests/test_core_suite.py` verifying `doc_references` (`#page=`, `#:~:text=`, `?select=aq:`) on `/quant/` instruments and equations, and verifying `GET /api/v1/dossiers/65?highlight=292` returns `matched_passages`.
2. Add `/quant/quant-tutorials.js` and `/quant/OPERATORS-MANUAL-QUANT-TIMESERIES-WORKBENCH.pdf` to `deploy/test-first-deployment.sh`.
@@ -0,0 +1,246 @@
# Plan: Lightweight Standalone SQLite + FTS5 Metadata & Telemetry Database (`metadata.db`) Engine (`v2.0.18`)
- **Document ID:** `PLAN-SQLITE-REST-API-METADATA-DB` (`v2.0.18`)
- **Roadmap Status:** **ACTIVE / READY** (Core `hyperstitionstud_io.db.sqlite_meta` + `hs-db-build` CLI + automatic population of the SQLite metadata/telemetry database on every `/api/v1/*` REST and `/mcp` JSON-RPC call)
- **Target Modules:**
- `/workspace/hyperstitionstudio-core/src/hyperstitionstud_io/db/__init__.py` & `sqlite_meta.py` (`hs-db-build` CLI & SQLite/FTS5 catalog + telemetry engine)
- `/workspace/hyperstitionstudio-core/src/hyperstitionstud_io/mcp/rest.py` (`dispatch_rest_v1` telemetry hook populating SQLite on every `/api/v1/*` call)
- `/workspace/hyperstitionstudio-core/src/hyperstitionstud_io/mcp/server.py` (`dispatch_jsonrpc` telemetry hook populating SQLite on every `/mcp` JSON-RPC call)
- `/workspace/hyperstitionstudio-core/deploy/logrotate.d/hyperstition-sqlite-meta` (Quiescent `logrotate.d` truncation at configurable default `100M` / `100 MB` limit)
- `/workspace/hyperstitionstudio-core/pyproject.toml` (`hs-db-build` entry point)
- `/workspace/hyperstitionstudio-core/tests/test_core_suite.py` (Unit verification that `/api/v1/*` and `/mcp` calls populate the SQLite metadata/telemetry DB and `logrotate.d` quiescently truncates it)
- **Explicitly Deferred Scope (Moved to Long-Term Inactive Plan `PLAN-SQLITE-META-REST-ENDPOINTS-ETAG-AND-VPS-SYNC`):**
Exposing HTTP `/api/v1/meta/{manifests,search,coordinate/{aq_int},timeseries/query,telemetry}`, HTTP `ETag` / `If-None-Match` (`304 Not Modified`) middleware, MCP tool `hs_query_sqlite_catalog`, and wiring `hs-db-build` into `deploy/sync-vps-repos.sh` remain **inactive** in `/workspace/encyclopedia-knowledge-graph/docs/PLAN-SQLITE-META-REST-ENDPOINTS-ETAG-AND-VPS-SYNC.{md,pdf}` alongside all other inactive plans.
- **Zero External Dependencies:** Built **100% on Python's standard-library `sqlite3` module** (`0` third-party ORMs, `0` external DB daemons).
- **Core Architectural Separation (Immutable Catalog Index vs. Ephemeral Runtime Telemetry):**
To preserve the strict `ReadOnlyIsolationGuard` guarantees while enabling both sub-millisecond indexed search and local telemetry rollups in Python, the SQLite architecture splits cleanly into **two lightweight SQLite database files** (connected simultaneously via `ATTACH DATABASE` or dedicated connections):
1. **Catalog Metadata & FTS5 Index DB (`hyperstition-catalog.db`, Read-Only at Runtime, `mode=ro`):**
Compiled deterministically via `hs-db-build` (`python3 -m hyperstitionstud_io.db.sqlite_meta --build`). Indexes all `282` glossary entries, `190` bilingual lexical specimens, `388` Knowledge Graph nodes, `1,282` edges, `71` archive dossiers, `1,850+` verified `333/666/777` equations, `24 × 30` periodic time-series bars, and all `CIDv1` registry digests with **SQLite FTS5 (`BM25`) full-text search** and B-tree integer indices on `ing_aq`, `eng_aq`, `target_sum`, `symbol`, and `date_utc`.
2. **Runtime Telemetry & Audit DB (`api-telemetry.db`, WAL Mode):**
Lightweight, append-only SQLite database (`PRAGMA journal_mode=WAL; PRAGMA synchronous=NORMAL;`) that records privacy-preserving per-operation call counts, status tallies, execution latency ($\text{p50 / p95 / p99}$ microseconds), and `ReadOnlyIsolationGuard` audit receipts—without storing any client IP addresses, cookies, or PII.
---
## 1. Why a Standalone SQLite + FTS5 Metadata DB Transforms Local Corpus Querying & Observability
Currently, querying across `glossary-registry.json`, `encyclopedia-graph.json`, `quant-timeseries.json`, and the `71` Markdown dossiers requires reading and parsing multiple `.json` and `.md` files (`~12–45 ms` of file I/O and regex parsing per call).
By introducing the dual SQLite metadata layer (`hyperstitionstud_io.db.sqlite_meta`):
| Capability | Current File-Scan / Regex Behavior | With Standalone SQLite + FTS5 (`hyperstitionstud_io.db.sqlite_meta`) | Improvement |
| :--- | :--- | :--- | :--- |
| **1. Sub-Millisecond Indexed Lookups (`B-Tree`)** | Parses `encyclopedia-graph.json` (`1.4 MB`), `glossary-registry.json`, or `quant-timeseries.json` on each call (`12–28 ms`). | Point & range queries against B-tree indices (`idx_specimens_ing_aq`, `idx_bars_sym_date`, `idx_nodes_id`) execute in **`80–250 microseconds` (`< 0.25 ms`)**. | **`50x–120x` faster** |
| **2. Full-Text Search Across All 71 Dossiers & 282 Glossary Terms (`FTS5 BM25`)** | Linear `glob("*.md")` + Python substring/regex scan across 71 files (`25–45 ms`), no relevance ranking. | Single `SELECT ... FROM fts_catalog WHERE fts_catalog MATCH ? ORDER BY bm25(fts_catalog)` query with snippet highlighting and prefix matching in **`< 0.6 ms`**. | **Ranked `BM25` + `60x` faster** |
| **3. Multi-Table Relational Joins in One Query (`SQL`)** | Requires multiple separate Python passes to join a ticker (`NVDA`), its `AQ` coordinate (`137`), its Knowledge Graph neighbors, and its dated `333/666/777` archive equations. | Single indexed SQL join across `quant_timeseries_bars`, `kg_nodes`, `kg_edges`, and `archive_equations` via `query_coordinate_join(137)`. | **1 query instead of 4 passes** |
| **4. Cryptographic Provenance & `CIDv1` Registry Manifest Table** | Re-computes SHA-256 and `dag-json` `CIDv1` digests over raw files on demand. | `registry_manifests` table stores pre-computed `dag_json_cidv1` (`baguqeera...`), `raw_sha256`, and `record_count` per compiled registry. | **Instant `< 0.1 ms` digest lookup** |
| **5. Zero-PII Telemetry & Latency Rollups (`api-telemetry.db`)** | Stateless stdout only; zero structured persistence of query latency or `ReadOnlyIsolationGuard` verification counts. | Append-only WAL table `api_endpoint_rollups` and 200-event ring buffer `api_audit_ringbuffer` track call counts, status tallies, mean/max latency ($\mu\text{s}$), and `ReadOnlyIsolationGuard` pass counts in `<= 64 KB`. | **Deterministic local audit rollups** |
---
## 2. Relational & FTS5 Schema Design (`hyperstition-catalog.db` & `api-telemetry.db`)
### 2.1 Read-Only Catalog & Search Database (`hyperstition-catalog.db`)
```sql
-- 1. Cryptographic Registry & Schema Provenance Manifests
CREATE TABLE registry_manifests (
registry_slug TEXT PRIMARY KEY, -- e.g. 'glossary-registry', 'encyclopedia-graph', 'quant-timeseries'
source_path TEXT NOT NULL,
schema_urn TEXT NOT NULL,
version TEXT NOT NULL,
record_count INTEGER NOT NULL,
raw_sha256 TEXT NOT NULL,
dag_json_cidv1 TEXT NOT NULL, -- 'baguqeera...'
byte_size INTEGER NOT NULL,
compiled_at_utc TEXT NOT NULL
) WITHOUT ROWID;
-- 2. Canonical Glossary & Bilingual Vocabulary Specimens (282 Glossary + 190 Bilingual Specimens)
CREATE TABLE glossary_entries (
entry_id INTEGER PRIMARY KEY,
term TEXT NOT NULL UNIQUE,
category TEXT NOT NULL,
section_id TEXT NOT NULL,
eng_aq INTEGER NOT NULL,
ing_term TEXT NOT NULL,
ing_aq INTEGER NOT NULL,
delta INTEGER NOT NULL,
is_isometric INTEGER NOT NULL, -- 0 or 1
is_twin_prime INTEGER NOT NULL, -- 0 or 1
division_id TEXT,
volume_pdf TEXT,
definition TEXT NOT NULL
);
CREATE INDEX idx_glossary_ing_aq ON glossary_entries(ing_aq);
CREATE INDEX idx_glossary_eng_aq ON glossary_entries(eng_aq);
CREATE INDEX idx_glossary_cat ON glossary_entries(category);
-- 3. Knowledge Graph Nodes (388 Nodes) & Deduplicated Edges (1,282 Edges)
CREATE TABLE kg_nodes (
node_id TEXT PRIMARY KEY, -- e.g. 'aq:137', 'build:S1', 'spec:envideea'
node_urn TEXT NOT NULL UNIQUE,
node_type TEXT NOT NULL,
label TEXT NOT NULL,
aq_value INTEGER,
degree INTEGER NOT NULL,
is_flex_pivot INTEGER NOT NULL DEFAULT 0,
guild_id TEXT,
metadata_json TEXT NOT NULL
) WITHOUT ROWID;
CREATE INDEX idx_kg_nodes_aq ON kg_nodes(aq_value);
CREATE INDEX idx_kg_nodes_type ON kg_nodes(node_type);
CREATE TABLE kg_edges (
source_id TEXT NOT NULL,
target_id TEXT NOT NULL,
relation TEXT NOT NULL,
weight REAL NOT NULL DEFAULT 1.0,
PRIMARY KEY (source_id, target_id, relation)
) WITHOUT ROWID;
CREATE INDEX idx_kg_edges_target ON kg_edges(target_id);
CREATE INDEX idx_kg_edges_rel ON kg_edges(relation);
-- 4. Archive & Zoology Dossiers (01..71) & Verified Multi-Scale Equations (333 / 666 / 777)
CREATE TABLE dossiers (
dossier_number INTEGER PRIMARY KEY, -- 1..71
file_name TEXT NOT NULL UNIQUE,
title TEXT NOT NULL,
is_periodic_news INTEGER NOT NULL, -- 1 for *-dossier-news-YYYY-MM-DD.md, 0 for static dossiers
date_utc TEXT, -- 'YYYY-MM-DD' if periodic news/quant dossier, else NULL
equation_count INTEGER NOT NULL,
sha256 TEXT NOT NULL
);
CREATE INDEX idx_dossiers_date ON dossiers(date_utc) WHERE date_utc IS NOT NULL;
CREATE TABLE archive_equations (
eq_id TEXT PRIMARY KEY, -- Content-addressed key: e.g. 'eq_333_envideea_0042'
dossier_number INTEGER NOT NULL,
date_utc TEXT, -- Populated if from dated periodic dossier
target_sum INTEGER NOT NULL, -- 333, 666, 777, etc.
ing_phrase TEXT NOT NULL,
eng_gloss TEXT NOT NULL,
breakdown TEXT NOT NULL,
word_count INTEGER NOT NULL,
FOREIGN KEY (dossier_number) REFERENCES dossiers(dossier_number)
) WITHOUT ROWID;
CREATE INDEX idx_eq_target ON archive_equations(target_sum);
CREATE INDEX idx_eq_date ON archive_equations(date_utc) WHERE date_utc IS NOT NULL;
-- 5. Periodic Quantitative Financial Time-Series Bars (24 Tickers x T UTC Days — Strictly Periodic Only)
CREATE TABLE quant_timeseries_bars (
symbol TEXT NOT NULL,
date_utc TEXT NOT NULL,
entity_eng TEXT NOT NULL,
entity_ing TEXT NOT NULL,
entity_ing_aq INTEGER NOT NULL,
guilds_csv TEXT NOT NULL,
tradingview_symbol TEXT NOT NULL,
tradingview_url TEXT NOT NULL,
close_usd REAL NOT NULL,
change_pct REAL NOT NULL,
change_bps INTEGER NOT NULL,
volume_ratio_20d REAL NOT NULL,
market_cap_str TEXT NOT NULL,
close_digit_aq INTEGER NOT NULL,
close_spoken_ing TEXT NOT NULL,
close_spoken_ing_aq INTEGER NOT NULL,
scaled_cap_spoken_ing_aq INTEGER NOT NULL,
bps_spoken_ing_aq INTEGER NOT NULL,
co_present_in_news_wire INTEGER NOT NULL,
contingent_points REAL NOT NULL,
locks_json TEXT NOT NULL,
PRIMARY KEY (symbol, date_utc)
) WITHOUT ROWID;
CREATE INDEX idx_qbars_date ON quant_timeseries_bars(date_utc);
CREATE INDEX idx_qbars_close_aq ON quant_timeseries_bars(close_spoken_ing_aq);
CREATE INDEX idx_qbars_ent_aq ON quant_timeseries_bars(entity_ing_aq);
-- 6. Unified FTS5 Full-Text Search Virtual Table (BM25 Ranked Search Across Glossary, Graph & Equations)
CREATE VIRTUAL TABLE fts_catalog USING fts5(
doc_type, -- 'glossary' | 'equation' | 'node' | 'dossier' | 'instrument'
doc_id, -- Primary key / URI
title_or_ing, -- Headword or Ingglish phrase
gloss_or_body, -- English gloss, definition, or breakdown
aq_coord, -- Integer AQ coordinate(s) as text tokens
guild_tags, -- S1..S6, M1..M7+
tokenize = 'unicode61 remove_diacritics 2'
);
```
### 2.2 Runtime Telemetry & Audit Database (`api-telemetry.db` — WAL Mode, Zero PII)
```sql
PRAGMA journal_mode = WAL;
PRAGMA synchronous = NORMAL;
-- 1. Per-Operation Aggregated Request & Latency Rollups (Bounded to <= 100 rows total!)
CREATE TABLE IF NOT EXISTS api_endpoint_rollups (
protocol TEXT NOT NULL, -- 'python_api' | 'cli' | 'rest_v1' | 'mcp_jsonrpc'
method TEXT NOT NULL, -- 'CALL' | 'GET' | 'POST'
endpoint_pattern TEXT NOT NULL, -- e.g. 'sqlite_meta:query_coordinate_join'
total_requests INTEGER NOT NULL DEFAULT 0,
status_2xx INTEGER NOT NULL DEFAULT 0,
status_304 INTEGER NOT NULL DEFAULT 0,
status_4xx INTEGER NOT NULL DEFAULT 0,
status_5xx INTEGER NOT NULL DEFAULT 0,
total_latency_us INTEGER NOT NULL DEFAULT 0,
max_latency_us INTEGER NOT NULL DEFAULT 0,
last_called_utc TEXT NOT NULL,
PRIMARY KEY (protocol, method, endpoint_pattern)
) WITHOUT ROWID;
-- 2. Ring-Buffer of Last 200 Isolation & Harvest Audit Events (Auto-Pruned via Trigger)
CREATE TABLE IF NOT EXISTS api_audit_ringbuffer (
event_id INTEGER PRIMARY KEY AUTOINCREMENT,
timestamp_utc TEXT NOT NULL,
endpoint TEXT NOT NULL,
status_code INTEGER NOT NULL,
latency_us INTEGER NOT NULL,
isolation_ok INTEGER NOT NULL -- 1 = ReadOnlyIsolationGuard verified
);
```
*(By aggregating telemetry by `(protocol, method, endpoint_pattern)` and capping `api_audit_ringbuffer` at the most recent `200` rows, `api-telemetry.db` never grows past `~64 KB` on disk).*
---
## 3. Python Query & CLI Surface (`hyperstitionstud_io.db.sqlite_meta` & `hs-db-build`)
`hyperstitionstud_io.db.sqlite_meta` exposes a clean, self-contained Python API and CLI (`hs-db-build`) operating strictly over `hyperstition-catalog.db` (`mode=ro` on query) and `api-telemetry.db`:
| Python Function / CLI Flag | Arguments | What It Queries or Builds in SQLite (`< 1 ms`) |
| :--- | :--- | :--- |
| `build_catalog_sqlite_db(db_path=None)` / `hs-db-build --build` | `db_path: Path \| None` | Compiles `registry_manifests`, `glossary_entries`, `kg_nodes`, `kg_edges`, `dossiers`, `archive_equations`, `quant_timeseries_bars`, and `fts_catalog` while verifying source registries remain untouched under `ReadOnlyIsolationGuard`, then runs `PRAGMA optimize; VACUUM;`. |
| `query_registry_manifests(db_path=None, registry=None)` / `hs-db-build --manifests` | `registry: str \| None` | Queries `registry_manifests` for all compiled schemas/registries, their record counts, `raw_sha256`, and `dag_json_cidv1`. |
| `query_fts_catalog(query, doc_type="all", limit=25, db_path=None)` / `hs-db-build --search <q>` | `query: str`, `doc_type: str`, `limit: int` | Executes 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`). |
| `query_coordinate_join(aq_int, db_path=None)` / `hs-db-build --coordinate <N>` | `aq_int: int` (`1..999`, e.g. `137` or `125`) | **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`. |
| `query_timeseries_bars(symbol=None, start_date=None, end_date=None, min_points=0.0, db_path=None)` / `hs-db-build --timeseries` | `symbol`, `start_date`, `end_date`, `min_points` | Executes indexed range queries over `quant_timeseries_bars` (`WHERE symbol = ? AND date_utc BETWEEN ? AND ? AND contingent_points >= ?`). |
| `record_api_telemetry(...)` & `get_api_telemetry_summary(telemetry_db_path=None)` / `hs-db-build --telemetry` | `protocol`, `method`, `endpoint_pattern`, `status_code`, `latency_us`, `isolation_ok` | Writes/reads `api_endpoint_rollups` and the latest 25 rows of `api_audit_ringbuffer` in `api-telemetry.db` (`<= 200` ring-buffer cap). |
---
## 4. Three-Phase Implementation Roadmap (`Phases 1–3`)
### Phase 1: Implement `hyperstitionstud_io.db.sqlite_meta` & `hs-db-build` CLI
1. Create `/workspace/hyperstitionstudio-core/src/hyperstitionstud_io/db/__init__.py` and `sqlite_meta.py` implementing:
- `build_catalog_sqlite_db(db_path)` & `ensure_catalog_sqlite_db(db_path)` (compiles `registry_manifests`, `glossary_entries`, `kg_nodes`, `kg_edges`, `dossiers`, `archive_equations`, `quant_timeseries_bars`, and the `fts_catalog` FTS5 index while verifying source repositories are never mutated, then runs `PRAGMA optimize; VACUUM;`),
- `query_registry_manifests(db_path, registry=None)` (opens `file:...?mode=ro` with `PRAGMA query_only = ON;`),
- `query_fts_catalog(query, doc_type="all", limit=25, db_path=None)`,
- `query_coordinate_join(aq_int, db_path=None)`,
- `query_timeseries_bars(symbol=None, start_date=None, end_date=None, min_points=0.0, db_path=None)`, and
- `record_api_telemetry(protocol, method, endpoint_pattern, status_code, latency_us, isolation_ok, telemetry_db_path=None)` + `get_api_telemetry_summary(telemetry_db_path=None)`.
2. Register `hs-db-build = "hyperstitionstud_io.db.sqlite_meta:main"` in `/workspace/hyperstitionstudio-core/pyproject.toml`.
### Phase 2: Wire Automatic SQLite Population into `dispatch_rest_v1` (`mcp/rest.py`) & `dispatch_jsonrpc` (`mcp/server.py`)
1. In `/workspace/hyperstitionstudio-core/src/hyperstitionstud_io/mcp/rest.py`, wrap `dispatch_rest_v1(method, raw_path, body_bytes)` with high-resolution `time.perf_counter_ns()` timing and a `finally` hook calling `record_api_telemetry(protocol="rest_v1", method=method, endpoint_pattern=normalized_route, status_code=status, latency_us=elapsed_us, isolation_ok=isolation_verified)` so every `/api/v1/*` REST API call automatically populates `api_endpoint_rollups` and `api_audit_ringbuffer` in the SQLite metadata/telemetry database (`api-telemetry.db`).
2. In `/workspace/hyperstitionstudio-core/src/hyperstitionstud_io/mcp/server.py`, wrap `dispatch_jsonrpc(req)` with `time.perf_counter_ns()` timing and a `finally` hook calling `record_api_telemetry(protocol="mcp_jsonrpc", method="POST", endpoint_pattern=rpc_pattern, status_code=status, latency_us=elapsed_us, isolation_ok=isolation_verified)` (e.g. `tools/call:hs_evaluate_aq_and_ingglish`, `resources/read`, `prompts/get`) so every MCP call also populates the SQLite database.
3. Ensure `record_api_telemetry()` writes strictly to a safe writable path (`HYPERSTITION_TELEMETRY_DB_PATH` or `/tmp/hyperstition-api-telemetry.db` fallback when under systemd `ProtectSystem=strict`) and never raises if the filesystem is read-only.
4. Create `/workspace/hyperstitionstudio-core/deploy/logrotate.d/hyperstition-sqlite-meta` (`size 100M` default, `rotate 12`, `compress`, `delaycompress`, configurable via `HYPERSTITION_SQLITE_MAX_MB` / `HYPERSTITION_SQLITE_MAX_BYTES`) with a `prerotate` block calling `python3 -m hyperstitionstud_io.db.sqlite_meta --truncate-quiescent --compress-archive` (`BEGIN EXCLUSIVE` + consistent SQLite snapshot compressed to `<db>.1.gz` + table purge + `PRAGMA wal_checkpoint(TRUNCATE)` + `VACUUM` + `PRAGMA integrity_check == 'ok'`).
### Phase 3: Verification in `tests/test_core_suite.py`
1. Add unit tests in `tests/test_core_suite.py` verifying:
- `build_catalog_sqlite_db()` table row counts (`282+` glossary rows, `388` nodes, `1,282` edges, `71+` dossiers, `720` periodic time-series bars),
- Sub-millisecond FTS5 `BM25` search via `query_fts_catalog("envideea")`,
- Unified coordinate join via `query_coordinate_join(137)`,
- Indexed periodic bar range queries via `query_timeseries_bars(symbol="NVDA", min_points=1.0)`,
- Executing `/api/v1/*` REST API calls (`dispatch_rest_v1`) and `/mcp` JSON-RPC calls (`dispatch_jsonrpc`) automatically populates `api_endpoint_rollups` and `api_audit_ringbuffer` (`<= 200` ring-buffer cap, `status_2xx`, `isolation_ok == 1`) in the SQLite database while leaving all inactive plan routes (`/api/v1/meta/*`, `hs_query_sqlite_catalog`, `/gallery/`) unexposed, and
- Executing `run_logrotate_directive()` / `truncate_telemetry_db_quiescent()` against `/workspace/hyperstitionstudio-core/deploy/logrotate.d/hyperstition-sqlite-meta` verifies the default `100M` (`100 MB`) threshold and quiescently truncates the SQLite database when the threshold is reached (`PRAGMA integrity_check == 'ok'`).
Binary file not shown.
+137
View File
@@ -0,0 +1,137 @@
# Plan: Static Patronage & Signal-Support Subpage (`/donate/`) for `hyperstitionstud.io` (`v2.0.18`)
- **Document ID:** `PLAN-STATIC-DONATE-SUBPAGE` (`v2.0.18`)
- **Target Web Route:** `https://hyperstitionstud.io/donate/` (`/donate/index.html`)
- **Offline `file://` Path:** `/workspace/hyperstitionstudio-core/site/donate/index.html`
- **Editorial Approach:** **Rhetorical, Inquiry-Driven, and Accessible to a General Enthusiast Audience with a Touch of Cybernetic Edge.**
- *Show, Don't Perform:* Rather than talking about its own posture, disclaimers, or lack of paywalls ("you don't need to donate," "the servers are fine"), the page goes straight to the intrigue of the phenomenon itself—inviting the reader into the questions that drive the workbench: *Why do disconnected events in the evening news keep landing on the same coordinates? What happens when you strip away the polite spelling of a corporate filing and listen to the raw phonemic signal underneath? Where are the hidden load-bearing walls of the modern economy?*
- **Global Footer & Portability Compliance:** 100% static HTML/CSS/JS with zero external scripts or third-party payment trackers, automatic `file://` vs. `https://` navigation adaptation, participation in `hs-sync-version`, and the global `"Made with ♥ by Lemurs."` (`&#x2665;`) footer.
---
## 1. Rhetorical Translation: Turning Institutional Proposals into Open Questions That Spark Curiosity
The existing stakeholder proposals (`/workspace/technocapital-singularity-zoology/proposal-*.md`) argue that standard models are blind to structural convergence, hidden bottlenecks, and sudden regime flips. On `/donate/`, we strip away the institutional finance and systems-engineering armor and reframe those ideas as **invitations to look closer**:
| Core Theme from the Proposals | The Technical Trap (Avoided on `/donate/`) | The Rhetorical Hook on `/donate/` (Invoking Curiosity with a Cybernetic Edge) |
| :--- | :--- | :--- |
| **1. Paper Appearance vs. Spoken Signal** | Explaining CMUdict phoneme tables, Base-36 character offsets, and variance-collapse formulas. | **"Have you ever noticed how differently the world looks when you stop reading how it's spelled and start listening to how it sounds?"**<br/>On paper, *synthetic data*, an *abstract machine*, and *asset management* belong to separate professions. Strip away silent letters and score the raw spoken stream, and they snap onto the exact same coordinate. Coincidence is the easy answer—until it happens ten nights in a row. |
| **2. Flashy Surfaces vs. Quiet Bottlenecks** | Listing GICS sector classifications, supply-chain factor loadings, or isometric $\Delta = 0$ equations. | **"Everyone watches the spectacle on the stage. Who owns the floorboards?"**<br/>Every hype cycle has its stars, and every star depends on a handful of quiet, unmovable chokepoints—a single laser maker in the Netherlands, a single wafer foundry in Taiwan, a single clause in a corporate charter—that never budge when the narrative shifts. We map the floorboards. |
| **3. Signal vs. Apophenia (Why Context Matters)** | Detailing Scope 1–3 contingent meaning gates, null-hypothesis baselines, or cron schedules. | **"Anyone can find patterns in a phonebook if they look long enough. What happens when you refuse to look outside the room?"**<br/>We don't go fishing through dictionaries to force a match. We only pay attention when a collision happens inside the same news story, the same supply chain, or the same closing bell—when a chipmaker closes at the exact dollar figure of its own name on the night it leads the wire. |
| **4. Keeping the Cover Off the Circuit** | Listing Brotli-11 compression ratios, HTTP/3 QUIC headers, or self-referential "no paywall" disclaimers. | **"What happens when an instrument leaves the cover off so anyone can inspect the wiring?"**<br/>An instrument is most interesting when the readout is right in front of you—complete with the raw equations, the underlying graph, and the live tape—so you can test your own hypotheses and see what locks together next. |
---
## 2. Page Layout & Narrative Flow (`/donate/index.html`)
Styled in the signature `hyperstitionstud.io` dark-slate monospace palette (`#020617` canvas, `#0f172a` panels, `#22d3ee` cyan, `#f5c630` gold, `#34d399` emerald, `#fb7185` rose):
```text
+---------------------------------------------------------------------------------------------------+
| HEADER: hyperstitionstud.io/donate — Signal Patronage & Open-Instrument Notes |
| [ Portal Home (/) ] [ Time-Series (/quant/) ] [ Knowledge Graph (/graph/) ] [ Calculator (/calc/) ]|
+---------------------------------------------------------------------------------------------------+
| HERO ESSAY: "What If Language, Market Tape, and Breaking News Are Dials on the Same Circuit?" |
| +---------------------------------------------------------------+-----------------------------+ |
| | Opens directly on the phenomenon that caught the visitor's | +-----------------------+ | |
| | eye: watching scattered headlines, supply-chain bottlenecks, | | ( ♥ DONATE ↗ ) | | |
| | and closing-bell prices snap onto identical coordinates once | +-----------------------+ | |
| | silent letters drop away—and why this workbench leaves the | Prominent tactile vector | |
| | cover off the circuit so anyone can trace the signal. | pill button (gold/amber | |
| +---------------------------------------------------------------+ glossy bevel + heart/coin | |
| emblem, anchored to #fuel)| |
+---------------------------------------------------------------------------------------------------+
| SECTION 1: Three Questions That Keep This Workbench Running |
| +-------------------------------+-------------------------------+-----------------------------+ |
| | 01 // The Ghost in the | 02 // The Load-Bearing | 03 // The Discipline of | |
| | Spelling | Chokepoints | the Room | |
| | Written English is a museum | Every gold rush sells picks | Finding a match in a | |
| | of dead letters. What happens | and shovels—until there is | dictionary is a parlor | |
| | when you strip a headline | only one company on earth | trick. Finding it inside | |
| | down to pure spoken sound | that can print the shovel. | the same headline and the | |
| | and watch rival empires land | How do you spot the | same closing bell is a | |
| | on the same number? | unmovable nodes before the | signal worth watching. | |
| | | crowd does? | | |
| +-------------------------------+-------------------------------+-----------------------------+ |
+---------------------------------------------------------------------------------------------------+
| SECTION 2: "Try a Wire Experiment" — Interactive Curiosity Sandbox |
| • "Click a live collision below—or type two things that shouldn't belong together—and watch |
| what happens when the silent letters drop." |
| - Curated Curiosity Prompts: |
| [ The Founder & The Flash Crash ] [ Synthetic Data & Asset Management ] |
| [ The Chip Laser & The Balance Sheet ] [ The War Machine & The Copper Wire ] |
+---------------------------------------------------------------------------------------------------+
| SECTION 3: Backing the Signal (Where Patronage Goes) |
| • Direct, substantive note on what contributions fuel: expanding the daily midnight wire and |
| closing-bell harvests, producing new multi-voice audio expeditions, and extending the |
| open-source graph and encyclopedia volumes. |
+---------------------------------------------------------------------------------------------------+
| SECTION 4: Fuel the Reactor (Direct Contribution Channels) |
| • Centered Primary Tactile Vector Donate Button (`( ♥ DONATE )` — opens/copies active channel) |
| • One-click copyable addresses (`BTC`, `ETH`, `SOL`, `XMR`) & `git.libre.audio` patronage |
| • Open-source exploration paths: test an idea in `/calc/`, trace a bridge in `/graph/`, |
| or fork the repositories and build an instrument of your own. |
+---------------------------------------------------------------------------------------------------+
| FOOTER: hyperstitionstud.io/donate v2.0.18 • Made with ♥ by Lemurs. |
+---------------------------------------------------------------------------------------------------+
```
### 2.1 Prominent, Proportionally Scaled Tactile Vector "Donate" Button Specification (Inspired by Classic Adobe Stock Vector Donate Badges)
To give `/donate/` an unmistakable, tactile visual centerpiece—while keeping `0` external image requests (`100%` inline SVG + CSS3 gradients/bevels for offline `file://` portability)—the page features a **classic glossy vector pill "DONATE" button** situated prominently and proportionally in two places:
1. **Hero Split-Column Anchor (`260px × 68px` desktop / `220px × 58px` mobile):** Positioned in the right-hand column of the Hero Banner (`grid-template-columns: 1fr auto`, vertically centered with generous breathing room) so it immediately anchors the eye without crowding the typography, smooth-scrolling to `#fuel-channels` (and flashing the active patronage drawer) when clicked.
2. **Section 4 Primary Action Centerpiece (`280px × 72px`):** Centered above the contribution address cards, where clicking it copies the selected contribution address or opens the selected patronage URI with tactile press-down feedback (`transform: translateY(2px)`).
**Visual & Proportional Anatomy of the Inline SVG + CSS Tactile Donate Button:**
- **Shape & Proportions:** Classic stadium/pill silhouette (`border-radius: 999px`, `aspect-ratio ~ 3.8 : 1`), framed by a brushed metallic/dark-slate outer bezel (`3px` ring with subtle cyan/gold rim light) so the glossy vector badge sits naturally against the `#0f172a` dark panel.
- **Glossy Vector Surface & Bevel:** Warm amber-gold to crimson-coral multi-stop linear gradient (`linear-gradient(180deg, #ffd86b 0%, #f59e0b 48%, #d97706 52%, #b45309 100%)`) with a crisp top-half specular glass highlight arc (`rgba(255,255,255,0.38)`), inner top bevel (`inset 0 2px 2px rgba(255,255,255,0.6)`), and raised 3D drop shadow (`0 6px 0 #78350f, 0 12px 24px rgba(245, 158, 11, 0.35)`).
- **Left Emblem Badge (Circular Inset Coin/Heart-in-Hand SVG Icon):** A circular recessed badge (`44px × 44px`) on the left inside the pill containing a crisp vector **Heart-and-Signal-Coin SVG emblem**, paired with bold, high-contrast uppercase `DONATE` lettering (`font-size: 1.22rem`, `letter-spacing: 0.08em`, subtle text-emboss shadow) and a micro-subtitle (`TOSS FUEL IN THE REACTOR`).
---
## 3. Revised Full-Page Copy (`/donate/index.html`) — Zero Self-Referential Affect Claims
### 3.1 Hero Essay: *"What If Language, Market Tape, and Breaking News Are Dials on the Same Circuit?"*
> Spend ten minutes exploring the Knowledge Graph, the calculator, or the closing-bell timeline, and you will run into something that makes you pause.
>
> Strip away the silent letters of standard English, and *synthetic data* and *abstract machine* land on the exact same coordinate as written *asset management*. Follow the fault lines of a market selloff, and *Dario Amodei*, *Anthropic*, and *flash crash* lock together across written and spoken scripts—or a trillion-dollar chipmaker closes at the exact dollar price of its own phonemic name on the night it leads the global news wire.
>
> Most instruments are built to smooth those anomalies away—to sort the world into tidy, separate compartments where linguistics stays in one room, supply-chain bottlenecks stay in another, and market prices stay in a third.
>
> `hyperstitionstud.io` was built to see what happens when you wire those rooms together. Every evening at the US market close and the midnight UTC news rollover, our collectors harvest live headlines and core technocapital tickers, decode them into spoken phonemes, and map where the circuits cross—leaving the cover off the machine so anyone curious enough can trace the signal for themselves.
### 3.2 Three Questions That Keep This Workbench Running
1. **`01 // What is English hiding inside its spelling?`**
Written English is an archaeological dig. Every word carries centuries of silent letters, borrowed scribal habits, and visual camouflage. When you decode a sentence into pure spoken sound—one spelling per phoneme—the camouflage drops away. Concepts that look miles apart in a press release or an earnings report suddenly collapse onto the exact same coordinate. Is that just a quirk of information compression, or is language acting like a low-level routing protocol for how culture and capital organize themselves? We'd rather measure it than guess.
2. **`02 // Where are the quiet walls that never move?`**
Every technology boom is loud at the edges and silent at the center. Dozens of labs race to build the flashiest model or the fastest trading desk, while the entire spectacle quietly funnels through a handful of physical and legal bottlenecks—a single extreme-ultraviolet laser builder, a single wafer foundry, a corporate charter, a power grid. In our tables, certain words refuse to drift by a single point between how they are written on paper and how they sound out loud. Watching how the noisy stories orbit those fixed points tells you a lot about where leverage actually sits.
3. **`03 // What happens when you outlaw dictionary fishing?`**
Numerology gets a bad reputation for a simple reason: if you let yourself rummage through a 200,000-word dictionary after the fact, you can connect any number to anything. That's a parlor trick. So we enforce a stricter rule: *stay in the room*. Only evaluate the words, people, and prices that actually showed up together in the same day's news wire, the same supply chain, or the same closing bell. When the locks still fire under that constraint, the question stops being *"can you find a pattern?"* and becomes *"why did these specific pieces fall into place at the same time?"*
### 3.3 Backing the Signal
> Every tool on `hyperstitionstud.io`—the 388-node property graph, the 22-volume encyclopedia, the multi-cipher calculator, the closing-bell time-series workbench, and the public API—is open, downloadable for offline travel, and built to show you the raw readout so you can test your own hypotheses.
>
> Patronage directly fuels the next layer of the instrument: keeping the public HTTP/3 relays fast, expanding the daily midnight wire and closing-bell harvests, synthesizing new full-length episodes of *The Encyclopedia Expeditions*, and charting new divisions of the archive.
>
> If a lock, a dossier, or an hour spent exploring the graph sparked a new line of thought, you can toss fuel into the reactor via the button or addresses below—or fork the repositories on `git.libre.audio` and build an instrument of your own.
---
## 4. Three-Phase Implementation Roadmap (`Phases 1–3`)
### Phase 1: Build `/workspace/hyperstitionstudio-core/site/donate/index.html`
1. Create `/workspace/hyperstitionstudio-core/site/donate/index.html` featuring:
- The inquiry-driven hero essay and 3-question grid in Section 3 above (with zero self-referential "calm/unbothered" or "you don't need to donate" meta-commentary),
- The **Prominent Tactile Vector "DONATE" Button** (classic glossy bevel pill with circular SVG heart/coin emblem, top specular highlight arc, and 3D tactile press state, proportionally situated in the Hero right column and centered above Section 4's contribution channels),
- The **"Try a Wire Experiment"** interactive curiosity sandbox (4 clickable story pills—*The Founder & The Flash Crash*, *Synthetic Data & Asset Management*, *The Chip Laser & The Balance Sheet*, *The War Machine & The Copper Wire*—plus a live input box that reveals how written spelling strips down to spoken sound),
- Zero-tracker contribution cards (`BTC`, `ETH`, `SOL`, `XMR` one-click copy + `git.libre.audio/seasharp` open-source patronage + non-monetary exploration links),
- Automatic `file://` vs. `https://` link resolution, and
- The global `"Made with ♥ by Lemurs."` (`&#x2665;`) footer.
### Phase 2: Wire Right-Justified Stadium-Pill Donate Button (`Option 3`) & `version_sync.py`
1. In `site/index.html`, `site/quant/index.html`, and `site/learn/index.html`, place a right-justified (`margin-left: auto; justify-content: flex-end`), `34px`-tall stadium-pill `( ♥ DONATE )` button (`.btn-donate-pill`, `border-radius: 999px`, preceded by a `1px solid #334155` vertical divider `.nav-donate-sep`, featuring a `20px × 20px` circular inset `.donate-pill-emblem` and warm amber-gold bevel) as the `:last-child` flush with the right inner header padding boundary—without altering the single-row height or modifying existing `.badge` telemetry counters. *(Option 1—folding the 3 passive telemetry counters into `.subtitle`—is preserved as a separate Long-Term Inactive Plan in `docs/PLAN-HEADER-SUBTITLE-TELEMETRY-CONSOLIDATION-ALTERNATIVE.{md,pdf}`; Option 2 is discarded).*
2. Register `core / "site" / "donate" / "index.html"` in `/workspace/hyperstitionstudio-core/src/hyperstitionstud_io/version_sync.py` and in `test_offline_urn_namespaces_and_no_external_https_fonts()` inside `tests/test_core_suite.py`.
### Phase 3: Wire into `deploy/sync-vps-repos.sh` & `deploy/test-first-deployment.sh`
1. Add `${LIVE_SUDO} ln -sfn "hyperstitionstudio-core/site/donate" "${LIVE_REPOS}/donate"` in `/workspace/hyperstitionstudio-core/deploy/sync-vps-repos.sh`.
2. Add `"/donate/index.html"` to `ROUTES` in `/workspace/hyperstitionstudio-core/deploy/test-first-deployment.sh` and verify `HTTP 200 OK`.
Binary file not shown.
+4 -1
View File
@@ -7,7 +7,7 @@
> - **Production VPS & Git Operator Deployment Guide:** `../VPS-AND-GIT-OPERATOR-DEPLOYMENT-GUIDE.pdf` (and `.md`)
> - **Cross-Repository Dependency & Audit Flow Diagram:** `../cross-repo-dependency-and-audit-flow-diagram.html` (and `.png` / `.pdf`)
> - **Concentric ETI Radar (`D Periphery`) Specification:** `../specification-concentric-eti-tier-ring-radar-d-periphery.pdf` (and `.md`)
> - **Active / Deferred Roadmap Plans in `../`:** `../PLAN-LLM-TOKEN-ECONOMIZER-AND-VARIANCE-ROUTING.{md,pdf}` (active outstanding plan) and `../PLAN-MEMETIC-GALLERY-SUBPAGE.{md,pdf}` (long-term deferred plan).
> - **Active / Deferred Roadmap Plans in `../`:** All active `v2.0.19` plans are now implemented and archived below; `../PLAN-HEADER-SUBTITLE-TELEMETRY-CONSOLIDATION-ALTERNATIVE.{md,pdf}`, `../PLAN-SQLITE-META-REST-ENDPOINTS-ETAG-AND-VPS-SYNC.{md,pdf}`, `../PLAN-LLM-TOKEN-ECONOMIZER-AND-VARIANCE-ROUTING.{md,pdf}`, and `../PLAN-MEMETIC-GALLERY-SUBPAGE.{md,pdf}` are preserved in `../` as long-term inactive/deferred plans.
---
@@ -32,3 +32,6 @@
| `PLAN-TIERZOO-AND-POKEDEX-TIMESERIES-SABERMETRICS-ENRICHMENT.{md,pdf}` | Specification for longitudinal time-series moments (`SNAP%`, `WOPR`, `LOE`, `WAR_30d`, `Floor/Ceil/Boom%`, `Optimal Lag τ*`, `Regime Splits`) and deterministic Gen IV Pokédex attributes; now implemented in `hyperstitionstud_io.quant.timeseries` and `classify_technocapital_singularity.py --pokedex-card`. |
| `PLAN-QUANTITATIVE-FINANCE-TIMESERIES-SUBPAGE.{md,pdf}` | Specification for the `/quant/` interactive time-series workbench (`site/quant/{index.html,quant-app.js,quant-timeseries-data.js}`) and TradingView `EXCHANGE:SYMBOL` new-window launcher; now implemented and live at `/quant/`. |
| `PLAN-MCP-REST-API-ADAPTER.{md,pdf}` | Specification for the unified stateless REST API v1 (`/api/v1/*`) and OpenAPI 3.1.0 adapter (`/api/v1/openapi.json`) on `hs-mcp` (`127.0.0.1:8095`); now implemented in `hyperstitionstud_io.mcp.{rest,server}` and `deploy/Caddyfile`. |
| `PLAN-SQLITE-REST-API-METADATA-DB.{md,pdf}` | Specification for the standalone SQLite + FTS5 catalog & telemetry engine (`hyperstitionstud_io.db.sqlite_meta`, `hs-db-build`), automatic `/api/v1/*` and `/mcp` telemetry population (`api-telemetry.db`), and quiescent `logrotate.d` snapshot compression (`deploy/logrotate.d/hyperstition-sqlite-meta`, default `100M`); now implemented and verified in `tests/test_core_suite.py` and `deploy/test-first-deployment.sh`. |
| `PLAN-STATIC-DONATE-SUBPAGE.{md,pdf}` | Specification for the `/donate/` signal patronage & open-instrument subpage (`site/donate/index.html`) and Option 3 right-justified `34px` stadium-pill `( ♥ DONATE )` navbar button across `site/index.html`, `site/learn/index.html`, and `site/quant/index.html`; now implemented and live at `/donate/`. |
| `PLAN-QUANT-TUTORIAL-VIDEO-SERIES-AND-CITATION-DEEP-LINKS.{md,pdf}` | Specification for the Option B Zero-MP4 5-episode, 25-scene interactive HTML5 canvas tutorial player (`site/quant/quant-tutorials.js`), passage-encoded deep links (`#page=N&search=...`, `#:~:text=...`, `/graph/index.html?select=aq:N`, `/api/v1/dossiers/N?highlight=...`), and `site/quant/OPERATORS-MANUAL-QUANT-TIMESERIES-WORKBENCH.{md,pdf}`; now implemented and verified in `tests/test_core_suite.py` and `deploy/test-first-deployment.sh`. |
@@ -120,7 +120,7 @@
<div class="pulse-dot"></div>
<h1>Cross-Repository Dependency Graph &amp; Auditable Build &rarr; Test &rarr; Stage_Commit Pipeline</h1>
</div>
<p class="subtitle">Sibling Repositories under /workspace: ingglish-hyperdope-gematria &bull; technocapital-singularity-zoology (v2.0.18) &bull; encyclopedia-knowledge-graph (v2.0.18)</p>
<p class="subtitle">Sibling Repositories under /workspace: ingglish-hyperdope-gematria &bull; technocapital-singularity-zoology (v2.0.20) &bull; encyclopedia-knowledge-graph (v2.0.20)</p>
</div>
<!-- Main SVG Diagram -->
+1 -1
View File
@@ -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.0.18",
"version": "2.0.20",
"encyclopedia_base_path": "../technocapital-singularity-zoology/encyclopedia",
"upstream_repository": "/workspace/technocapital-singularity-zoology",
"isolation_verified": {
+1 -1
View File
@@ -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.0.18",
"version": "2.0.20",
"encyclopedia_base_path": "../technocapital-singularity-zoology/encyclopedia",
"upstream_repository": "/workspace/technocapital-singularity-zoology",
"isolation_verified": {
+32 -4
View File
@@ -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.0.18)</title>
<title>Encyclopedia of Technocapital Singularity Zoology — Interactive Knowledge Graph (v2.0.20)</title>
<style>
:root {
--bg-canvas: #121318;
@@ -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 &bull; v2.0.18</p>
<p>Standalone Sibling Repository (/workspace/encyclopedia-knowledge-graph) • 388 Nodes • 1,282 Deduplicated Edges • Zero Glossary Leak &bull; v2.0.20</p>
</div>
<div class="toolbar">
<button class="btn active" data-mode="mode2_radar">Mode 2: ETI Radar (S+ -> D Periphery)</button>
@@ -321,7 +321,7 @@
</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.0.18 &bull; Made with <span class="hs-heart" role="img" aria-label="love" style="color:#FB7185;display:inline-block;padding:0 2px;">&#x2665;</span> by Lemurs.</span>
<span class="hs-lemur-credit">hyperstitionstud.io/graph v2.0.20 &bull; Made with <span class="hs-heart" role="img" aria-label="love" style="color:#FB7185;display:inline-block;padding:0 2px;">&#x2665;</span> by Lemurs.</span>
</footer>
<script src="graph-data.js"></script>
@@ -797,7 +797,35 @@
window.addEventListener("resize", resizeCanvas);
resizeCanvas();
selectNode(nodeMap["build:S1"] || DATA.nodes[0]);
// Deep-link query parameter support (?select=aq:137&mode=mode2_radar)
const urlParams = new URLSearchParams(window.location.search || "");
const reqMode = urlParams.get("mode");
if (reqMode && ["mode1_trophic", "mode2_radar", "mode3_bipartite"].includes(reqMode)) {
currentMode = reqMode;
document.querySelectorAll("[data-mode]").forEach(b => {
b.classList.toggle("active", b.getAttribute("data-mode") === reqMode);
});
}
const reqSelect = (urlParams.get("select") || "").trim();
let initialNode = nodeMap["build:S1"] || DATA.nodes[0];
if (reqSelect) {
const selLow = reqSelect.toLowerCase();
const selCoord = selLow.replace(/^aq:/, "");
const matchedNode = nodeMap[reqSelect] || DATA.nodes.find(n =>
String(n.id).toLowerCase() === selLow ||
String(n.ing_aq || "") === selCoord ||
String(n.aq_value || "") === selCoord ||
String(n.label || "").toLowerCase().includes(selLow)
);
if (matchedNode) {
initialNode = matchedNode;
}
}
selectNode(initialNode);
if (reqSelect && initialNode) {
centerOnNode(initialNode);
}
})();
</script>
</body>
@@ -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.0.18",
"version": "2.0.20",
"encyclopedia_base_path": "../technocapital-singularity-zoology/encyclopedia",
"upstream_repository": str(upstream_repo),
"isolation_verified": {