9.6 KiB
9.6 KiB
Plan: Scheduled Archive Rotation Cronjob (00:20 UTC / 19:20 EST Daily) on hyperstitionstud.io — Coordinating hs-archive-rotate (docs/archive/*.tar.gz) & Quiescent SQLite Telemetry Rotation Across /etc/cron.d/, systemd Timers & Hermes Cron (v2.0.29)
- Document ID:
PLAN-CRONJOB-ARCHIVE-ROTATION-ON-HYPERSTITIONSTUD-IO(v2.0.29) - Roadmap Status: ACTIVE / READY
- Strict Zero-LLM-Token / Zero-API-Key VPS Mandate:
No cronjob or timer requiring metered LLM tokens or an LLM/OpenRouter API key will ever run on
hyperstitionstud.io. All scheduled jobs installed on thehyperstitionstud.ioVPS (/etc/cron.d/hyperstition-archive-rotate,hyperstition-archive-rotate.{service,timer},hyperstition-closing-bell-harvest.{service,timer},hyperstition-utc-rollover-harvest.{service,timer}, and/etc/logrotate.d/hyperstition-sqlite-meta) execute 100% deterministic, keyless local Python and Bash scripts (0LLM tokens,0API keys) and explicitlyunset OPENROUTER_API_KEY OPENAI_API_KEY ANTHROPIC_API_KEY. All LLM-token-dependent agent cronjobs remain strictly onlocalhost. - Target Schedule (
00:20 UTC/19:20 ESTDaily — Window C onhyperstitionstud.ioVPS Only): Runs daily at00:20 UTCvia/etc/cron.d/hyperstition-archive-rotate(andhyperstition-archive-rotate.timer) on thehyperstitionstud.ioweb host. - Target Modules & Deployment Files:
/workspace/hyperstitionstudio-core/deploy/cron.d/hyperstition-archive-rotate(Installed to/etc/cron.d/hyperstition-archive-rotatebydeploy/sync-vps-repos.shStep 5)/workspace/hyperstitionstudio-core/deploy/hyperstition-archive-rotate.{service,timer}(systemdtimer unit for00:20:00 UTCdaily execution onhyperstitionstud.io)/workspace/hyperstitionstudio-core/deploy/run-vps-archive-rotation.sh(Flock-guarded, zero-/dev/null, zero-API-key wrapper script executinghs-archive-rotate,sqlite_meta --run-logrotate-directive,tmpfssync when loose files were rotated, and optionalgit.libre.audiopush)
1. Unified Daily Cron Topology (21:30 UTC -> 00:00 UTC -> 00:20 UTC)
With 29c871eb6b78 and 7effa9679803 decommissioned under PLAN-MIGRATE-PERIODIC-DATA-PRODUCTION-FROM-LOCALHOST-TO-VPS (leaving d28b479ec217 as the sole localhost exegesis cronjob), PLAN-CRONJOB-ARCHIVE-ROTATION-ON-HYPERSTITIONSTUD-IO is scoped strictly to Window C (00:20 UTC Cold-Archive & SQLite Telemetry Rotation on hyperstitionstud.io):
| Window | Schedule (UTC / EST) |
Execution Surface & Unit Name | What It Executes | Metered LLM Token Cost |
|---|---|---|---|---|
| Window A | 21:30 UTC / 16:30 EST (Mon–Fri) |
• VPS hyperstition-closing-bell-harvest.timer(Implemented in PLAN-MIGRATE-PERIODIC-DATA-PRODUCTION-FROM-LOCALHOST-TO-VPS; 29c871eb6b78 decommissioned) |
US Closing-Bell Financial (hs-quant-harvest --append-history --live), FRED Macro (hs-macro-harvest), 14-point timeseries.py, 5-Agenda Bayesian hs-daily-brief, tmpfs RAM hydration, & git.libre.audio push. |
0 LLM tokens & 0 API keys |
| Window B | 00:00 UTC / 19:00 EST (Daily) |
• localhost Hermes d28b479ec217 (Sole Remaining LLM Cronjob)• VPS hyperstition-utc-rollover-harvest.timer (Implemented in PLAN-MIGRATE-PERIODIC-DATA-PRODUCTION-FROM-LOCALHOST-TO-VPS; 7effa9679803 decommissioned) |
• localhost (d28b479ec217): LLM-assisted narrative exegesis prose synthesis for <NN>-dossier-news-YYYY-MM-DD.md.• VPS ( 00:00 UTC timer): Deterministic ci_provision_ingglish.py --tier 2, timeseries.py, hs-daily-brief, and build_encyclopedia_knowledge_graph.py. |
Metered only on localhost d28b479ec217; 0 tokens on VPS |
| Window C (This Plan — VPS Archive Rotation Only) |
00:20 UTC / 19:20 EST (Daily) |
• VPS /etc/cron.d/hyperstition-archive-rotate• VPS hyperstition-archive-rotate.timer |
1. Explicitly unsets OPENROUTER_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY (0 API keys).2. Runs hs-archive-rotate (publishing.archive_rotator): rotates any loose completed docs/archive/*.{md,pdf} pairs (require_companion_md=True) into completed-plans-archive.tar.gz + archive-manifest.json while enforcing assert_not_gematria_pipeline_source() and verify_gematria_pipeline_richness_invariant().3. Runs python3 -m hyperstitionstud_io.db.sqlite_meta --run-logrotate-directive: checks /var/lib/hyperstitionstud.io/api-telemetry.db against the 100M limit and performs quiescent BEGIN EXCLUSIVE .1.gz compression + truncation when >= 100M.4. If loose docs/archive/ files were rotated, refreshes /var/www/hyperstitionstud.io/repos (tmpfs RAM) via sync-vps-repos.sh --no-pull --no-caddy. |
0 LLM tokens & 0 API keys (100% local Python/Bash on VPS) |
2. Specification of the Three Coordinated Components
2.1 Flock-Guarded Execution Script (deploy/run-vps-archive-rotation.sh)
- Contains
0/dev/nullredirections, usesset -euo pipefail,trap 'on_error ${LINENO}' ERR, andrun_checked(), and acquires/tmp/hyperstition-vps-harvest.lockviaflock -n 9so it never collides withrun-vps-data-production.shorsync-vps-repos.sh. - Executes:
python3 -m hyperstitionstud_io.publishing.archive_rotator(hs-archive-rotate), verifyinggematria_richness_invariant_verified == true(0gematria/dossier/lexicon/graph/quant/calc files ever touched; standalone.pdfs withhas_md == Falsepreserved).python3 -m hyperstitionstud_io.db.sqlite_meta --run-logrotate-directiveon/var/lib/hyperstitionstud.io/api-telemetry.db(or$HYPERSTITION_TELEMETRY_DB_PATH).- Checks if
git status -sinencyclopedia-knowledge-graphortechnocapital-singularity-zoologyshows newly rotateddocs/archive/files; if so, runsdeploy/sync-vps-repos.sh --no-pull --no-caddyto remove the unlinked loose files from/var/www/hyperstitionstud.io/repos(tmpfsRAM) and (when/etc/hyperstitionstud.io/id_ed25519_git_libre_audiois present) commits and pushes the updatedcompleted-plans-archive.tar.gzandarchive-manifest.jsontogit.libre.audio.
2.2 VPS System Cron & systemd Timer (deploy/cron.d/hyperstition-archive-rotate & deploy/hyperstition-archive-rotate.{service,timer})
/workspace/hyperstitionstudio-core/deploy/cron.d/hyperstition-archive-rotate:Installed idempotently to# /etc/cron.d/hyperstition-archive-rotate — Daily 00:20 UTC Cold-Archive & SQLite Telemetry Rotation SHELL=/bin/bash PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 20 0 * * * root /srv/hyperstitionstud.io/repos/hyperstitionstudio-core/deploy/run-vps-archive-rotation.sh >> /var/log/hyperstition-archive-rotate.log 2>&1/etc/cron.d/hyperstition-archive-rotate(chmod 0644) in Step[5/5]ofdeploy/sync-vps-repos.sh(right alongside/etc/logrotate.d/hyperstition-sqlite-meta)./workspace/hyperstitionstudio-core/deploy/hyperstition-archive-rotate.{service,timer}: Provides the matchingsystemdtimer (OnCalendar=*-*-* 00:20:00 UTC,Persistent=true) installed bydeploy/sync-vps-repos.shStep[5/5].
2.3 Strict Host & Plan Scope Boundary (PLAN-CRONJOB-ARCHIVE-ROTATION-ON-HYPERSTITIONSTUD-IO Is Scoped Strictly to Archive Rotation)
- Why
29c871eb6b78&7effa9679803Decommissioning Belonged toPLAN-MIGRATE-PERIODIC-DATA-PRODUCTION-FROM-LOCALHOST-TO-VPS:- Decommissioning the two non-exegesis
localhostdata-production cronjobs (29c871eb6b78and7effa9679803) is the source-decommissioning half ofPLAN-MIGRATE-PERIODIC-DATA-PRODUCTION-FROM-LOCALHOST-TO-VPS(deploy/run-vps-data-production.sh), and has now been executed directly as part of that migration (cronjob_manage(action="remove")on29c871eb6b78and7effa9679803, leavingd28b479ec217as the solelocalhostexegesis cronjob).
- Decommissioning the two non-exegesis
- Scoped Responsibility of
PLAN-CRONJOB-ARCHIVE-ROTATION-ON-HYPERSTITIONSTUD-IO:- This plan is responsible solely for daily
00:20 UTCcold-archive rotation (hs-archive-rotate) and SQLite telemetry logrotate (sqlite_meta --run-logrotate-directive) onhyperstitionstud.iovia/etc/cron.d/hyperstition-archive-rotate,deploy/hyperstition-archive-rotate.{service,timer}, anddeploy/run-vps-archive-rotation.sh(0LLM tokens,0API keys).
- This plan is responsible solely for daily
3. Test-Suite Appropriateness Analysis & Guardrails
- Appropriate for
tests/test_core_suite.py(Offline & Deterministic):- Assert that
deploy/run-vps-archive-rotation.sh,deploy/cron.d/hyperstition-archive-rotate,deploy/hyperstition-archive-rotate.service, anddeploy/hyperstition-archive-rotate.timerexist on disk, contain0/dev/nullredirections, and specify20 0 * * */00:20:00 UTC. - Assert that
deploy/sync-vps-repos.shinstalls/etc/cron.d/hyperstition-archive-rotateandhyperstition-archive-rotate.{service,timer}in Step[5/5]. - Execute
deploy/run-vps-archive-rotation.sh --skip-hydrate --no-pushintest_core_suite.py(using a temporary telemetry DB path) to verify end-to-end execution ofhs-archive-rotate+sqlite_meta --run-logrotate-directivewith0errors.
- Assert that
- Appropriate for
deploy/test-first-deployment.sh:- Verify that
sync-vps-repos.sh --no-pullinstalls/etc/cron.d/hyperstition-archive-rotatewhen/etc/cron.dis writable, and thatrun-vps-archive-rotation.sh --skip-hydrate --no-pushexits0.
- Verify that
- Inappropriate for Test Suites (Excluded):
- Never wait on a live cron tick or require a running
crond/systemddaemon insidetests/test_core_suite.py.
- Never wait on a live cron tick or require a running