Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3a77c1bf5 | ||
|
|
e27952cc0a |
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,77 @@
|
||||
# Plan: Rotating Completed Archives (`docs/archive/`) Into Compressed Cold-Storage Bundles (`.tar.gz`) to Economize Stylistic Refreshes, Revisions & Search Sweeps (`v2.0.28`)
|
||||
|
||||
- **Document ID:** `PLAN-ARCHIVE-ROTATION-AND-COMPRESSION-ECONOMIZER` (`v2.0.28`)
|
||||
- **Roadmap Status:** **ACTIVE / READY**
|
||||
- **Target Directories & Modules:**
|
||||
- `/workspace/encyclopedia-knowledge-graph/docs/archive/` (`56` loose `.md`/`.pdf` files = `3,215,398` bytes -> compressed `completed-plans-archive.tar.gz` + `archive-manifest.json` + `README.md`)
|
||||
- `/workspace/technocapital-singularity-zoology/docs/archive/` (`6` completed loose `.md`/`.pdf` files -> compressed `completed-plans-archive.tar.gz` + `archive-manifest.json`; moving the deferred `podcast-series-plan-encyclopedia-of-technocapital-singularity-zoology.{md,pdf}` for `Episodes 06–09` up to `technocapital-singularity-zoology/docs/` so `docs/archive/` holds strictly completed cold records)
|
||||
- `/workspace/hyperstitionstudio-core/src/hyperstitionstud_io/publishing/archive_rotator.py` (`hs-archive-rotate` CLI & deterministic `.tar.gz` rotator)
|
||||
- `/workspace/hyperstitionstudio-core/src/hyperstitionstud_io/publishing/pdf_compiler.py` (Excluding `docs/archive/` from `discover_web_and_repo_pdf_pairs()`)
|
||||
- `/workspace/hyperstitionstudio-core/tests/test_core_suite.py`
|
||||
|
||||
---
|
||||
|
||||
## 1. Problem Statement & Empirical Economy Analysis
|
||||
|
||||
Currently, completed planning documents and historical audits are stored as **uncompressed loose `.md` and `.pdf` files** inside `/workspace/encyclopedia-knowledge-graph/docs/archive/` (`28` `.md` + `28` `.pdf` = `56` files, `3.22 MB`) and `/workspace/technocapital-singularity-zoology/docs/archive/` (`4` `.md` + `4` `.pdf` = `8` files, `351 KB`):
|
||||
|
||||
| Overhead Dimension | Current Uncompressed Loose `docs/archive/` State | After Compressed `.tar.gz` Rotation & Archive Exclusion | Measured Savings |
|
||||
| :--- | :--- | :--- | :---: |
|
||||
| **1. Stylistic PDF Refreshes (`hs-pdf-build --refresh-all-web-pdfs`)** | `84` total `.md -> .pdf` compilations (`32` of which are historical `docs/archive/` files never linked from the web UI). | **`52` active/web-linked `.md -> .pdf` compilations** (`0` compilations inside `docs/archive/`). | **`-38.1%` fewer PDFs compiled** (`32` redundant PDF builds eliminated on every refresh) |
|
||||
| **2. Repository Content Search (`search_files` / `rglob("*.md")`)** | Every content search or glob sweep scans `31` historical `.md` files (`~410,000` chars / `~128,000` BPE tokens of superseded specs), polluting search matches and context windows. | Loose `.md` and `.pdf` files are packed inside `completed-plans-archive.tar.gz`; only `docs/archive/README.md` and `archive-manifest.json` remain unpacked. | **`-100%` (`~128K` BPE tokens) of stale plan prose excluded from `search_files` & glob sweeps** |
|
||||
| **3. Disk & `tmpfs` Webroot Footprint (`/var/www/hyperstitionstud.io/repos`)** | `3,566,151` bytes (`3.57 MB`) across `64` loose files (`128` files after `.gz`/`.br` pre-compression in `sync-vps-repos.sh`). | Single deterministic `completed-plans-archive.tar.gz` per `docs/archive/` directory + `README.md` + `archive-manifest.json` (and `sync-vps-repos.sh` `--exclude='docs/archive/*.tar.gz'`). | **`62` loose files consolidated into `2` cold `.tar.gz` bundles** |
|
||||
|
||||
---
|
||||
|
||||
## 2. Boundary Guardrail: What Gets Rotated vs. What Must Never Be Compressed
|
||||
|
||||
1. **Rotated Into Cold Storage (`docs/archive/completed-plans-archive.tar.gz`):**
|
||||
- `/workspace/encyclopedia-knowledge-graph/docs/archive/*.{md,pdf}` (excluding `README.md`, which stays unpacked as the human-readable index).
|
||||
- `/workspace/technocapital-singularity-zoology/docs/archive/*.{md,pdf}` (after moving the still-deferred `podcast-series-plan-encyclopedia-of-technocapital-singularity-zoology.{md,pdf}` for `Episodes 06–09` to `/workspace/technocapital-singularity-zoology/docs/` so no deferred plan is buried in cold storage).
|
||||
2. **Never Rotated / Always Kept Live & Uncompressed:**
|
||||
- `/workspace/ingglish-hyperdope-gematria/ingglish-aq-archive/dossiers/*.md` (`71` verified dossiers & `21` dated `00:00 UTC` news-wire dossiers served live at `/archive/*` and `/api/v1/dossiers/{number}` and ingested by `timeseries.py` and `sqlite_meta.py`).
|
||||
- All 22 Encyclopedia PDF volumes (`/workspace/technocapital-singularity-zoology/encyclopedia/00..08/*.{md,pdf}`) and top-level `/zoology/*.{md,pdf}` manuals/proposals.
|
||||
- Active and long-term deferred plans in top-level `/workspace/encyclopedia-knowledge-graph/docs/PLAN-*.{md,pdf}`.
|
||||
|
||||
---
|
||||
|
||||
## 3. Architecture of `hyperstitionstud_io.publishing.archive_rotator` (`hs-archive-rotate`)
|
||||
|
||||
### 3.1 Deterministic `.tar.gz` Rotation & Manifest Schema (`docs/archive/archive-manifest.json`)
|
||||
|
||||
The new module `/workspace/hyperstitionstudio-core/src/hyperstitionstud_io/publishing/archive_rotator.py` (registered in `pyproject.toml` as `hs-archive-rotate = "hyperstitionstud_io.publishing.archive_rotator:main"`) implements:
|
||||
|
||||
1. **`rotate_docs_archive_directory(archive_dir: Path) -> dict[str, Any]`:**
|
||||
- If `completed-plans-archive.tar.gz` already exists in `archive_dir`, extracts its existing members into a temporary staging directory first so newly archived `.md`/`.pdf` files are **merged** into the bundle without losing any previously rotated files.
|
||||
- Collects all loose `*.md` (except `README.md`) and `*.pdf` files in `archive_dir`.
|
||||
- Writes a deterministic gzip-compressed tarball `completed-plans-archive.tar.gz` (`gzip.GzipFile(mtime=0)`, sorted member names, normalized `TarInfo` permissions `0644` and `mtime=0` so identical contents always produce the exact same SHA-256 digest).
|
||||
- Writes `archive_dir / "archive-manifest.json"` recording:
|
||||
- `bundle_filename`: `"completed-plans-archive.tar.gz"`,
|
||||
- `bundle_size_bytes` and `bundle_sha256`,
|
||||
- `member_count` and `total_uncompressed_bytes`,
|
||||
- `members`: sorted array of `{name, size_bytes, sha256}` for every `.md` and `.pdf` stored inside the `.tar.gz` archive.
|
||||
- Unlinks the loose `.md` (except `README.md`) and `.pdf` files from `archive_dir` only after verifying that every member in `archive-manifest.json` can be read back from `completed-plans-archive.tar.gz` with matching SHA-256 digests.
|
||||
2. **Inspection & On-Demand Extraction CLI (`hs-archive-rotate`):**
|
||||
- `hs-archive-rotate`: Rotates any loose `.md`/`.pdf` files in `encyclopedia-knowledge-graph/docs/archive/` and `technocapital-singularity-zoology/docs/archive/` into their `completed-plans-archive.tar.gz` bundles.
|
||||
- `hs-archive-rotate --list`: Lists all members and SHA-256 hashes from `archive-manifest.json`.
|
||||
- `hs-archive-rotate --extract <filename> --out-dir <dir>`: Extracts a specific historical `.md` or `.pdf` on demand without unpacking the rest of the archive.
|
||||
|
||||
### 3.2 Hardening `discover_web_and_repo_pdf_pairs()` in `src/hyperstitionstud_io/publishing/pdf_compiler.py`
|
||||
- Update `discover_web_and_repo_pdf_pairs()` to explicitly skip any path whose parent directory is named `archive` (`if "archive" in p.parts: continue`), guaranteeing that even before `hs-archive-rotate` runs, `hs-pdf-build --refresh-all-web-pdfs` **never** wastes cycles recompiling archived documents.
|
||||
|
||||
---
|
||||
|
||||
## 4. Three-Phase Implementation Roadmap (`Phases 1–3`)
|
||||
|
||||
### Phase 1: Build `src/hyperstitionstud_io/publishing/archive_rotator.py` & Update `pdf_compiler.py`
|
||||
1. Create `/workspace/hyperstitionstudio-core/src/hyperstitionstud_io/publishing/archive_rotator.py` implementing `rotate_docs_archive_directory()`, `rotate_all_docs_archives()`, `list_archive_members()`, and `extract_archive_member()`.
|
||||
2. Register `hs-archive-rotate = "hyperstitionstud_io.publishing.archive_rotator:main"` in `pyproject.toml`.
|
||||
3. Update `discover_web_and_repo_pdf_pairs()` in `src/hyperstitionstud_io/publishing/pdf_compiler.py` to exclude `/docs/archive/` paths.
|
||||
|
||||
### Phase 2: Relocate Deferred Podcast Plan & Rotate Both `docs/archive/` Directories
|
||||
1. Move `/workspace/technocapital-singularity-zoology/docs/archive/podcast-series-plan-encyclopedia-of-technocapital-singularity-zoology.{md,pdf}` (`Episodes 06–09` deferred plan) up to `/workspace/technocapital-singularity-zoology/docs/` so it remains an accessible deferred plan outside cold storage.
|
||||
2. Archive `PLAN-ARCHIVE-ROTATION-AND-COMPRESSION-ECONOMIZER.{md,pdf}` into `/workspace/encyclopedia-knowledge-graph/docs/archive/`, update `docs/archive/README.md`, and run `hs-archive-rotate` across both repositories so all loose historical `.md` and `.pdf` files in `docs/archive/` are rotated into `completed-plans-archive.tar.gz` + `archive-manifest.json`.
|
||||
|
||||
### Phase 3: Update Skill Procedure & Verify in `tests/test_core_suite.py`
|
||||
1. Update `hyperstitionstudio-roadmap-and-release` (`SKILL.md` Procedure 3: Archiving Completed Plans) so archiving a completed plan moves the `.md`/`.pdf` pair into `docs/archive/`, updates `docs/archive/README.md`, and runs `hs-archive-rotate` to fold the pair into `completed-plans-archive.tar.gz`.
|
||||
2. Add unit assertions in `tests/test_core_suite.py` verifying that `docs/archive/completed-plans-archive.tar.gz` and `docs/archive/archive-manifest.json` exist, contain `0` loose `.pdf` files in `docs/archive/`, and that `discover_web_and_repo_pdf_pairs()` returns `0` paths inside `docs/archive/`.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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.0.27) • encyclopedia-knowledge-graph (v2.0.27)</p>
|
||||
<p class="subtitle">Sibling Repositories under /workspace: ingglish-hyperdope-gematria • technocapital-singularity-zoology (v2.0.29) • encyclopedia-knowledge-graph (v2.0.29)</p>
|
||||
</div>
|
||||
|
||||
<!-- Main SVG Diagram -->
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -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.27",
|
||||
"version": "2.0.29",
|
||||
"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.0.27",
|
||||
"version": "2.0.29",
|
||||
"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.0.27)</title>
|
||||
<title>Encyclopedia of Technocapital Singularity Zoology — Interactive Knowledge Graph (v2.0.29)</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.0.27</p>
|
||||
<p>Standalone Sibling Repository (/workspace/encyclopedia-knowledge-graph) • 388 Nodes • 1,282 Deduplicated Edges • Zero Glossary Leak • v2.0.29</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.0.27 • 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.0.29 • 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.0.27"></script>
|
||||
<script src="graph-data.js?v=2.0.29"></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.0.27",
|
||||
"version": "2.0.29",
|
||||
"encyclopedia_base_path": "../technocapital-singularity-zoology/encyclopedia",
|
||||
"upstream_repository": str(upstream_repo),
|
||||
"isolation_verified": {
|
||||
|
||||
Reference in new issue
Block a user