Compare commits

..
41 Commits
Author SHA1 Message Date
Hyperstition VPS Bot 137ef70075 chore(telemetry): automated VPS utc-rollover harvest (2026-12-06T00:01:02Z) 2026-12-06 00:01:03 +00:00
Hyperstition VPS Bot fc21b78197 chore(telemetry): automated VPS utc-rollover harvest (2026-12-05T00:00:56Z) 2026-12-05 00:00:57 +00:00
Hyperstition VPS Bot eae3b86549 chore(telemetry): automated VPS us-closing-bell harvest (2026-12-04T21:30:55Z) 2026-12-04 21:30:55 +00:00
Hyperstition VPS Bot ddc02a35b8 chore(telemetry): automated VPS us-pre-market-open harvest (2026-12-04T14:01:35Z) 2026-12-04 14:01:36 +00:00
Hyperstition VPS Bot 0003e6ccc1 chore(telemetry): automated VPS utc-rollover harvest (2026-12-04T00:01:09Z) 2026-12-04 00:01:10 +00:00
Hyperstition VPS Bot fedd31c85c chore(telemetry): automated VPS us-closing-bell harvest (2026-12-03T21:31:00Z) 2026-12-03 21:31:01 +00:00
Hyperstition VPS Bot 8500cf932f chore(telemetry): automated VPS us-pre-market-open harvest (2026-12-03T14:01:04Z) 2026-12-03 14:01:05 +00:00
Hyperstition VPS Bot 3af904d1cc chore(telemetry): automated VPS utc-rollover harvest (2026-12-03T00:00:59Z) 2026-12-03 00:01:00 +00:00
Hermes Agent 745424d09a fix(deploy): hydrate untracked push-all-to-git-libre-audio.sh mirror before Stage 2 checks 2026-12-02 23:10:09 +00:00
Hermes Agent 2bf65d4dfa deploy: run in-situ exegesis dry-run under service account and verify timer state 2026-12-02 23:03:11 +00:00
Hermes Agent 808882e0a6 fix(deploy): gate rebase conflict-side flags and unchecked pull --rebase in DEPLOY-GATE-D07.TOPO_PUSH_PARITY 2026-12-02 22:45:41 +00:00
Hermes Agent 0d4b2a5d27 deploy: dynamic remote staging dir resolution for exegesis RPM SSH deploy 2026-12-02 22:09:58 +00:00
Hermes Agent 70a69ef647 feat(deploy): add over-the-wire Fedora 41 exegesis RPM SSH deployment & rollback to push-all-to-git-libre-audio.sh 2026-12-02 22:09:58 +00:00
Hermes Agent 9b587d6351 feat(core): implement Plan #62 efficiency, deduplication, caching & hook optimizations 2026-12-02 22:09:58 +00:00
Hermes Agent d4b7502501 feat(quant): implement Plan #72 pre-market-open daily brief & dual-calendar VPS cadence 2026-12-02 22:09:58 +00:00
Hermes Agent 3945e3648a feat(namespace): implement Plan #71 CI repo standardization, schema_version parity & path normalization 2026-12-02 22:09:58 +00:00
Hermes Agent 1e2968f84e test(core): adjust plan validator total plans threshold post archive rotation 2026-12-02 22:09:58 +00:00
Hermes Agent d526ede701 feat(governance): implement PLAN-SPECIFICATION-AND-GOVERNANCE-STANDARD, 3-tier flexibility protocol & plan validator 2026-12-02 22:09:58 +00:00
Hyperstition VPS Bot fe33f7d8e8 chore(telemetry): automated VPS us-closing-bell harvest (2026-12-02T21:30:55Z) 2026-12-02 21:30:56 +00:00
Hermes Agent 91cf671000 Release v2.17.1: Implement Strategies A, B & C (git/stash telemetry excavator, IPv4 parallel FRED macro backfill with YoY metrics, and 3-month Yahoo/Stooq lookback with >= 2026-11-01 scope) 2026-12-02 14:50:10 +00:00
Hermes Agent 52153e76f0 Release v2.17.1: Backfill full 1-month completed closing-bell series (2026-11-30 & 2026-12-01 across all 23 public tickers), add lossless VPS telemetry snapshot/reconciliation, and enforce read-only VPS closeups/readme sync in Gate D4 2026-12-02 14:26:04 +00:00
Hermes Agent 5eca430cce fix(deploy): replace fragile stash/rebase pull with deterministic git reset --hard and git clean -fd in sync-vps-repos.sh 2026-12-02 13:49:33 +00:00
Hermes Agent fe4cb38f0b fix(deploy): pop stashed local changes after git pull in sync-vps-repos.sh 2026-12-02 13:48:40 +00:00
Hermes Agent a70b8614f1 fix(deploy): stash untracked/modified runtime assets before git pull in sync-vps-repos.sh 2026-12-02 13:48:15 +00:00
Hermes Agent 643454fbae fix(closeups): shorten TS snippet line to prevent bounding box border breach in geometry audit 2026-12-02 13:46:30 +00:00
Hermes Agent 24d66f706e test(quant): add strict regression assertion ensuring all real market history dates are in dates_utc 2026-12-02 13:36:30 +00:00
Hermes Agent d20e76a000 fix(deploy): auto-render closeups during sync-vps-repos.sh instead of failing on --check 2026-12-02 13:31:58 +00:00
Hermes Agent 531f69e65a test(quant): eliminate hardcoded counts in test_core_suite.py using dynamic invariant checks 2026-12-02 13:29:45 +00:00
Hermes Agent 25f61dac33 test(quant): update test assertions for dynamic dates_utc and 32-day market history 2026-12-02 13:28:30 +00:00
Hermes Agent 7a016a6fbc fix(quant): make dates_utc dynamic and harvest Dec 01-02 market history & timeseries bundles 2026-12-02 13:25:51 +00:00
Hermes Agent d95446fc6c Release v2.17.1: Persist core.sshCommand for the 3 VPS deploy-key repos only, use HTTPS for the remaining 3 repos, and preserve VPS changes during autostash rebase without resetting README.md 2026-12-02 12:42:46 +00:00
Hermes Agent fff43cca6d Refactor sync-vps-repos.sh and run-vps-data-production.sh to use native git -c core.sshCommand="..." for infallible deploy key authentication 2026-12-02 12:24:37 +00:00
Hermes Agent 2242cf4ecb Harden sync-vps-repos.sh SSH deploy key usage with IdentitiesOnly=yes, IdentityAgent=none, unset SSH_AUTH_SOCK, and sudo fallback for unreadable root-owned keys 2026-12-02 12:19:16 +00:00
Hermes Agent 120956278f Include explicit SSH port -p 2222 in GIT_SSH_COMMAND across sync-vps-repos.sh and run-vps-data-production.sh 2026-12-02 12:13:14 +00:00
Hermes Agent 224ce62fab Fix sync-vps-repos.sh remote URL mapping for CI build repo slug (ingglish-hyperdope-ci.git) 2026-12-02 12:11:44 +00:00
Hermes Agent f1792478b6 Update sync-vps-repos.sh to export GIT_SSH_COMMAND and enforce SSH forge remote URLs for deploy key authentication 2026-12-02 12:08:13 +00:00
Hermes Agent 2c05f8e708 Restrict verbose affirmative push telemetry output strictly to --push-only execution mode in run-vps-data-production.sh 2026-12-02 12:02:58 +00:00
Hermes Agent 3a09d97953 Update run-vps-data-production.sh to provide affirmative, verbose status output for each repository during Step 4 telemetry push 2026-12-02 12:01:38 +00:00
Hermes Agent 888e847d41 Ensure run-vps-data-production.sh sets origin remote URL to SSH forge (ssh://git@git.libre.audio:2222/seasharp) prior to push, preventing HTTPS credential prompts 2026-12-02 11:44:27 +00:00
Hermes Agent 576ac40f25 Update PRE_COMMIT_HOOK_SCRIPT in readme_sync.py to use virtualenv PYTHON_BIN (resolving Pillow ModuleNotFoundError during git commit hooks on VPS) 2026-12-02 11:40:30 +00:00
Hermes Agent cb146c38e7 test(core): remove temporary Node.js skip guards per Plan #69 2026-12-02 11:39:08 +00:00
40 changed files with 12897 additions and 4603 deletions

No files matched your search

+2 -2
View File
@@ -3,8 +3,8 @@
<!-- HS-COMMIT-STATUS:START -->
> **Gitea Commit & Release Telemetry (`v2.17.1` • Namespace `urn:io:hyperstitionstud`)**
> - **Repository Role & Public Route:** Shared PEP 420 Python core library (`hyperstitionstud_io.*`), MCP/REST server, `/quant/`, `/learn/`, `/engineering/`, `/math/`, & `/donate/` webroots &rarr; [`https://hyperstitionstud.io/`](https://hyperstitionstud.io/)
> - **Latest Commit Scope (`hyperstitionstudio-core`):** Synchronized v2.17.1 release state across 1 tracked module/artifact surface(s)
> - **Touched Files / Surfaces:** `deploy/sync-vps-repos.sh`
> - **Latest Commit Scope (`hyperstitionstudio-core`):** Synchronized v2.17.1 release state across 8 tracked module/artifact surface(s)
> - **Touched Files / Surfaces:** `site/quant/daily-brief-data.js`, `site/quant/daily-brief-latest.json`, `site/quant/daily-brief-state.json`, `site/quant/financial-aq-harvest-latest.json`, `site/quant/quant-timeseries-data.js`, `site/quant/quant-timeseries.json`, `site/quant/real-macro-indicators-data.js`, `site/quant/real-macro-indicators.json`
> - **Live Verified Ecosystem Metrics (`v2.17.1`):** `6` Repositories • `17` CLI Entrypoints • `20` MCP/REST Tools • `14` URN Resources • `63` Verified Web Routes • `388` KG Nodes / `1,282` Edges • `282` Glossary Entries • `4,943` Offline CMUdict Phonetics • `0` Synthetic Data
<!-- HS-COMMIT-STATUS:END -->
@@ -1,5 +1,5 @@
[Unit]
Description=Hyperstition Studio US Closing-Bell Financial & FRED Macro Harvest (21:30 UTC Mon-Fri)
Description=Hyperstition Studio Pre-Market-Open (14:00 UTC) & US Closing-Bell (21:30 UTC) Financial & FRED Macro Harvest (Mon-Fri)
After=network-online.target
Wants=network-online.target
@@ -9,4 +9,4 @@ WorkingDirectory=/srv/hyperstitionstud.io/repos
Environment="REPOS_ROOT=/srv/hyperstitionstud.io/repos"
Environment="LIVE_REPOS=/var/www/hyperstitionstud.io/repos"
Environment="PYTHONPATH=/srv/hyperstitionstud.io/repos/hyperstitionstudio-core/src"
ExecStart=/srv/hyperstitionstud.io/repos/hyperstitionstudio-core/deploy/run-vps-data-production.sh --window=us-closing-bell
ExecStart=/srv/hyperstitionstud.io/repos/hyperstitionstudio-core/deploy/run-vps-data-production.sh --window=auto
@@ -1,7 +1,8 @@
[Unit]
Description=Weekday 21:30 UTC (16:30 EST) Timer for Hyperstition Studio US Closing-Bell Harvest
Description=Weekday 14:00 UTC (09:00 EST) & 21:30 UTC (16:30 EST) Timer for Hyperstition Studio Pre-Market & Closing-Bell Harvest
[Timer]
OnCalendar=Mon..Fri *-*-* 14:00:00 UTC
OnCalendar=Mon..Fri *-*-* 21:30:00 UTC
Persistent=true
RandomizedDelaySec=15
+207 -36
View File
@@ -48,35 +48,71 @@ export PYTHONPATH="${WORKSPACE_DIR}/hyperstitionstudio-core/src${PYTHONPATH:+:${
export HYPERSTITIONSTUDIO_CONFIG="${HYPERSTITIONSTUDIO_CONFIG:-${WORKSPACE_DIR}/workspace.toml}"
FORGE_SSH="${FORGE_SSH:-ssh://git@git.libre.audio:2222/seasharp}"
EXEGESIS_HOST="${EXEGESIS_HOST:-}"
EXEGESIS_UNINSTALL=0
SKIP_EXEGESIS_DEPLOY=0
while [[ $# -gt 0 ]]; do
case "$1" in
--exegesis-host=*)
EXEGESIS_HOST="${1#*=}"
shift
;;
--exegesis-host)
if [[ $# -lt 2 ]] || [[ -z "${2:-}" ]]; then
echo "[ERROR] --exegesis-host requires a <user@host> argument." >&2
exit 2
fi
EXEGESIS_HOST="$2"
shift 2
;;
--exegesis-uninstall)
EXEGESIS_UNINSTALL=1
shift
;;
--skip-exegesis-deploy)
SKIP_EXEGESIS_DEPLOY=1
shift
;;
-h|--help)
echo "Usage: $0 [--exegesis-host=<user@host>] [--exegesis-uninstall] [--skip-exegesis-deploy]"
exit 0
;;
*)
echo "[ERROR] Unknown option: $1" >&2
echo "Usage: $0 [--exegesis-host=<user@host>] [--exegesis-uninstall] [--skip-exegesis-deploy]" >&2
exit 2
;;
esac
done
if [[ "${EXEGESIS_UNINSTALL}" -eq 1 ]]; then
if [[ -z "${EXEGESIS_HOST}" ]] && [[ -t 0 ]]; then
read -r -p "Enter target Fedora 41 host (user@host) to uninstall ingglish-isopsephic-exegesis: " EXEGESIS_HOST || EXEGESIS_HOST=""
fi
if [[ -z "${EXEGESIS_HOST}" ]]; then
echo "[ERROR] --exegesis-uninstall requires --exegesis-host=<user@host>." >&2
exit 2
fi
echo "[uninstall] Verifying SSH connectivity to ${EXEGESIS_HOST}..."
ssh -o BatchMode=yes -o ConnectTimeout=5 "${EXEGESIS_HOST}" true
echo "[uninstall] Uninstalling ingglish-isopsephic-exegesis on ${EXEGESIS_HOST}..."
if [[ -t 0 ]]; then
ssh -t "${EXEGESIS_HOST}" sudo rpm -e ingglish-isopsephic-exegesis
else
ssh "${EXEGESIS_HOST}" sudo rpm -e ingglish-isopsephic-exegesis
fi
echo "[OK] Cleanly uninstalled ingglish-isopsephic-exegesis from ${EXEGESIS_HOST}."
exit 0
fi
echo "[info] WORKSPACE_DIR=${WORKSPACE_DIR}"
echo "[info] PYTHONPATH=${PYTHONPATH}"
echo "[1/3] Running pre-push verification gates (hs-archive-rotate, hs-closeups-sync, hs-readme-sync, version_sync, hs-doctor, logrotate.d/hyperstition-sqlite-meta check, periodic harvest CI/CD flow diagram PNG test, closeups check, test_core_suite, 6-gate graph verifier)..."
echo "[1/3] Running pre-push verification gates (hs-archive-rotate, hs-readme-sync, version_sync --corpus-delta, periodic harvest CI/CD flow diagram PNG, Fedora 41 RPM & dry-run, test_core_suite, 6-gate graph verifier)..."
run_checked "hs-archive-rotate --enforce-single-compression" python3 -m hyperstitionstud_io.publishing.archive_rotator --workspace-root "${WORKSPACE_DIR}" --enforce-single-compression
run_checked "verify docs/archive/archive-manifest.json" test -s "${WORKSPACE_DIR}/encyclopedia-knowledge-graph/docs/archive/archive-manifest.json"
run_checked "verify docs/plans/inactive/inactive-archive-manifest.json" test -s "${WORKSPACE_DIR}/encyclopedia-knowledge-graph/docs/plans/inactive/inactive-archive-manifest.json"
run_checked "hs-closeups-sync" python3 -m hyperstitionstud_io.publishing.closeups_sync
run_checked "hs-readme-sync --install-hooks" python3 -m hyperstitionstud_io.publishing.readme_sync --install-hooks
run_checked "version_sync --check" python3 -m hyperstitionstud_io.version_sync --check
run_checked "version_sync --corpus-delta" python3 -m hyperstitionstud_io.version_sync --corpus-delta
run_checked "hs-doctor" python3 -m hyperstitionstud_io.ci.doctor
run_checked "verify deploy/logrotate.d/hyperstition-sqlite-meta" test -f "${WORKSPACE_DIR}/hyperstitionstudio-core/deploy/logrotate.d/hyperstition-sqlite-meta"
run_checked "verify site/assets/hs-matrix-coderain.js" test -s "${WORKSPACE_DIR}/hyperstitionstudio-core/site/assets/hs-matrix-coderain.js"
run_checked "verify site/assets/matrix-font.woff2" test -s "${WORKSPACE_DIR}/hyperstitionstudio-core/site/assets/matrix-font.woff2"
for q_png in \
"quadrant-1-cybermemetics-calc-graph.png" \
"quadrant-1-tab-2-graph.png" \
"quadrant-2-esoteric-finance-quant.png" \
"quadrant-2-tab-2-bayesian-fred.png" \
"quadrant-2-tab-3-leaderboard-card.png" \
"quadrant-3-info-science-novice-learn-polyglot.png" \
"quadrant-3-tab-2-math-guile.png" \
"quadrant-3-tab-3-math-ts-rust.png" \
"quadrant-4-operators-deployment-vps.png" \
"quadrant-4-tab-2-mcp-etag.png" \
"quadrant-4-tab-3-ci-gates.png"; do
run_checked "verify site/assets/closeups/${q_png}" test -s "${WORKSPACE_DIR}/hyperstitionstudio-core/site/assets/closeups/${q_png}"
done
run_checked "generate & verify periodic-harvest-cicd-to-vps-flow-diagram.png" python3 -m hyperstitionstud_io.publishing.flow_diagram
run_checked "verify periodic-harvest-cicd-to-vps-flow-diagram.png exists" test -s "${WORKSPACE_DIR}/encyclopedia-knowledge-graph/docs/periodic-harvest-cicd-to-vps-flow-diagram.png"
run_checked "verify Fedora 41 packaging scripts & spec" "${WORKSPACE_DIR}/ingglish-hyperdope-gematria/packaging/build-fedora41-rpm.sh"
@@ -85,12 +121,16 @@ python3 "${WORKSPACE_DIR}/hyperstitionstudio-core/tests/test_core_suite.py"
run_checked "build_encyclopedia_knowledge_graph.py --verify-only" python3 "${WORKSPACE_DIR}/encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py" --verify-only
echo "[2/3] Verifying git.libre.audio remote URLs across all repositories..."
CI_REPO_DIR="hyperdope-ci-build"
if [[ ! -d "${WORKSPACE_DIR}/${CI_REPO_DIR}" ]] && [[ -d "${WORKSPACE_DIR}/ingglish-hyperdope-ci" ]]; then
CI_REPO_DIR="ingglish-hyperdope-ci"
fi
for pair in \
"hyperstitionstudio-core:hyperstitionstudio-core.git" \
"ingglish-hyperdope-gematria:ingglish-hyperdope-gematria.git" \
"technocapital-singularity-zoology:technocapital-singularity-zoology.git" \
"encyclopedia-knowledge-graph:encyclopedia-knowledge-graph.git" \
"hyperdope-ci-build:ingglish-hyperdope-ci.git"; do
"${CI_REPO_DIR}:ingglish-hyperdope-ci.git"; do
rdir="${WORKSPACE_DIR}/${pair%%:*}"
rslug="${pair##*:}"
ensure_remote_url "${rdir}" origin "${FORGE_SSH}/${rslug}"
@@ -108,39 +148,170 @@ push_head_tag() {
echo "[3/3] Rebasing any automated VPS telemetry commits & pushing all 6 repositories and HEAD release tags in topological dependency order to ${FORGE_SSH}..."
echo " -> (1/6) hyperstitionstudio-core (main + HEAD tag)"
git -C "${WORKSPACE_DIR}/hyperstitionstudio-core" pull --rebase --autostash origin main || true
run_checked "git pull --rebase (hyperstitionstudio-core main)" git -C "${WORKSPACE_DIR}/hyperstitionstudio-core" pull --rebase --autostash origin main
git -C "${WORKSPACE_DIR}/hyperstitionstudio-core" push -u origin main
push_head_tag "${WORKSPACE_DIR}/hyperstitionstudio-core" origin
echo " -> (2/6) ingglish-hyperdope-gematria (main + HEAD tag)"
git -C "${WORKSPACE_DIR}/ingglish-hyperdope-gematria" pull --rebase --autostash origin main || true
run_checked "git pull --rebase (ingglish-hyperdope-gematria main)" git -C "${WORKSPACE_DIR}/ingglish-hyperdope-gematria" pull --rebase --autostash origin main
git -C "${WORKSPACE_DIR}/ingglish-hyperdope-gematria" push -u origin main
push_head_tag "${WORKSPACE_DIR}/ingglish-hyperdope-gematria" origin
echo " -> (3/6) technocapital-singularity-zoology (main + HEAD tag)"
git -C "${WORKSPACE_DIR}/technocapital-singularity-zoology" pull --rebase --autostash origin main || true
run_checked "git pull --rebase (technocapital-singularity-zoology main)" git -C "${WORKSPACE_DIR}/technocapital-singularity-zoology" pull --rebase --autostash origin main
git -C "${WORKSPACE_DIR}/technocapital-singularity-zoology" push -u origin main
push_head_tag "${WORKSPACE_DIR}/technocapital-singularity-zoology" origin
echo " -> (4/6) encyclopedia-knowledge-graph (main + HEAD tag)"
git -C "${WORKSPACE_DIR}/encyclopedia-knowledge-graph" pull --rebase --autostash origin main || true
run_checked "git pull --rebase (encyclopedia-knowledge-graph main)" git -C "${WORKSPACE_DIR}/encyclopedia-knowledge-graph" pull --rebase --autostash origin main
git -C "${WORKSPACE_DIR}/encyclopedia-knowledge-graph" push -u origin main
push_head_tag "${WORKSPACE_DIR}/encyclopedia-knowledge-graph" origin
echo " -> (5/6) hyperdope-ci-build (feat/ingglish-aq-corpus + HEAD tag)"
git -C "${WORKSPACE_DIR}/hyperdope-ci-build" pull --rebase --autostash origin feat/ingglish-aq-corpus || true
git -C "${WORKSPACE_DIR}/hyperdope-ci-build" push -u origin feat/ingglish-aq-corpus
push_head_tag "${WORKSPACE_DIR}/hyperdope-ci-build" origin
echo " -> (5/6) hyperdope-ci-build (${CI_REPO_DIR}, feat/ingglish-aq-corpus + HEAD tag)"
run_checked "git pull --rebase (${CI_REPO_DIR} feat/ingglish-aq-corpus)" git -C "${WORKSPACE_DIR}/${CI_REPO_DIR}" pull --rebase --autostash origin feat/ingglish-aq-corpus
git -C "${WORKSPACE_DIR}/${CI_REPO_DIR}" push -u origin feat/ingglish-aq-corpus
push_head_tag "${WORKSPACE_DIR}/${CI_REPO_DIR}" origin
if [[ -d "${WORKSPACE_DIR}/haiperdohp-jemaytreeah/.git" ]]; then
echo " -> (6/6) haiperdohp-jemaytreeah (downstream main, feat/ingglish-aq-corpus, feat/ingglish-priority-toggle + HEAD tag)"
ensure_remote_url "${WORKSPACE_DIR}/haiperdohp-jemaytreeah" downstream "${FORGE_SSH}/haiperdohp-jemaytreeah.git"
git -C "${WORKSPACE_DIR}/haiperdohp-jemaytreeah" fetch downstream || true
git -C "${WORKSPACE_DIR}/haiperdohp-jemaytreeah" pull --rebase --autostash downstream main || true
git -C "${WORKSPACE_DIR}/haiperdohp-jemaytreeah" pull --rebase --autostash downstream feat/ingglish-aq-corpus || true
git -C "${WORKSPACE_DIR}/haiperdohp-jemaytreeah" pull --rebase --autostash downstream feat/ingglish-priority-toggle || true
run_checked "git fetch downstream (haiperdohp-jemaytreeah)" git -C "${WORKSPACE_DIR}/haiperdohp-jemaytreeah" fetch downstream
run_checked "git pull --rebase (haiperdohp-jemaytreeah main)" git -C "${WORKSPACE_DIR}/haiperdohp-jemaytreeah" pull --rebase --autostash downstream main
run_checked "git pull --rebase (haiperdohp-jemaytreeah feat/ingglish-aq-corpus)" git -C "${WORKSPACE_DIR}/haiperdohp-jemaytreeah" pull --rebase --autostash downstream feat/ingglish-aq-corpus
run_checked "git pull --rebase (haiperdohp-jemaytreeah feat/ingglish-priority-toggle)" git -C "${WORKSPACE_DIR}/haiperdohp-jemaytreeah" pull --rebase --autostash downstream feat/ingglish-priority-toggle
git -C "${WORKSPACE_DIR}/haiperdohp-jemaytreeah" push downstream main feat/ingglish-aq-corpus feat/ingglish-priority-toggle
push_head_tag "${WORKSPACE_DIR}/haiperdohp-jemaytreeah" downstream
fi
echo "[OK] All 6 repositories and release tags pushed to ${FORGE_SSH}."
if [[ "${SKIP_EXEGESIS_DEPLOY}" -eq 1 ]]; then
echo "[info] Skipping Fedora 41 exegesis RPM over-the-wire deployment (--skip-exegesis-deploy)."
elif [[ -z "${EXEGESIS_HOST}" ]] && [[ -t 0 ]]; then
read -r -p "Deploy built Fedora 41 exegesis RPM over the wire via SSH? [y/N / enter user@host]: " EXEGESIS_INPUT || EXEGESIS_INPUT=""
EXEGESIS_INPUT="${EXEGESIS_INPUT#"${EXEGESIS_INPUT%%[![:space:]]*}"}"
EXEGESIS_INPUT="${EXEGESIS_INPUT%"${EXEGESIS_INPUT##*[![:space:]]}"}"
case "${EXEGESIS_INPUT}" in
""|n|N|no|NO)
echo "[info] Skipping Fedora 41 exegesis RPM over-the-wire deployment."
;;
y|Y|yes|YES)
read -r -p "Enter target Fedora 41 host (user@host or IP): " EXEGESIS_HOST || EXEGESIS_HOST=""
EXEGESIS_HOST="${EXEGESIS_HOST#"${EXEGESIS_HOST%%[![:space:]]*}"}"
EXEGESIS_HOST="${EXEGESIS_HOST%"${EXEGESIS_HOST##*[![:space:]]}"}"
;;
*)
EXEGESIS_HOST="${EXEGESIS_INPUT}"
;;
esac
elif [[ -z "${EXEGESIS_HOST}" ]]; then
echo "[info] Non-interactive session and --exegesis-host not set; skipping Fedora 41 exegesis RPM deployment."
fi
if [[ "${SKIP_EXEGESIS_DEPLOY}" -eq 0 ]] && [[ -n "${EXEGESIS_HOST}" ]]; then
echo "[deploy] Verifying SSH connectivity to ${EXEGESIS_HOST}..."
ssh -o BatchMode=yes -o ConnectTimeout=5 "${EXEGESIS_HOST}" true
RPM_FILE=""
shopt -s nullglob
RPM_CANDIDATES=(
"${WORKSPACE_DIR}/ingglish-hyperdope-gematria/packaging"/ingglish-isopsephic-exegesis-*.fc41.noarch.rpm
"${WORKSPACE_DIR}/untracked/rpm-builds"/ingglish-isopsephic-exegesis-*.fc41.noarch.rpm
)
shopt -u nullglob
if [[ ${#RPM_CANDIDATES[@]} -gt 0 ]]; then
RPM_FILE="$(printf '%s\n' "${RPM_CANDIDATES[@]}" | sort -V | tail -n 1)"
fi
if [[ -z "${RPM_FILE}" ]] || [[ ! -f "${RPM_FILE}" ]]; then
echo "[ERROR] No built Fedora 41 RPM found in ${WORKSPACE_DIR}/ingglish-hyperdope-gematria/packaging/ or ${WORKSPACE_DIR}/untracked/rpm-builds/." >&2
exit 1
fi
RPM_NAME="$(basename "${RPM_FILE}")"
RPM_SIZE_BYTES="$(wc -c < "${RPM_FILE}" | tr -d '[:space:]')"
MIN_STAGE_KB="$(( (RPM_SIZE_BYTES + 1023) / 1024 + 1024 ))"
echo "[deploy] Found built RPM: ${RPM_FILE} (${RPM_SIZE_BYTES} bytes)"
echo "[deploy] Resolving writable remote staging directory on ${EXEGESIS_HOST} (need >= ${MIN_STAGE_KB} KiB)..."
REMOTE_STAGE_DIR="$(
ssh -o BatchMode=yes -o ConnectTimeout=5 "${EXEGESIS_HOST}" bash -s -- "${MIN_STAGE_KB}" <<'EOF_STAGE'
set -euo pipefail
min_kb="${1:-2048}"
home_dir="${HOME:-$(pwd)}"
for cand in "/tmp" "${home_dir}/.cache/rpm-stage" "${home_dir}/rpm-stage"; do
created_parent=0
if [[ "${cand}" != "/tmp" ]]; then
if [[ ! -d "${cand}" ]]; then
mkdir -p "${cand}" || continue
created_parent=1
fi
fi
if [[ ! -d "${cand}" ]] || [[ ! -w "${cand}" ]]; then
continue
fi
if mount_opts="$(findmnt -n -o OPTIONS -T "${cand}" 2>&1)"; then
mount_opts="${mount_opts//[[:space:]]/}"
case ",${mount_opts}," in
*,noexec,*)
if [[ "${created_parent}" -eq 1 ]]; then
rmdir "${cand}" || true
fi
continue
;;
esac
fi
avail_kb="$(df -Pk "${cand}" 2>&1 | awk 'NR==2 {print $4}')"
case "${avail_kb}" in
''|*[!0-9]*) avail_kb=0 ;;
esac
if [[ "${avail_kb}" -lt "${min_kb}" ]]; then
if [[ "${created_parent}" -eq 1 ]]; then
rmdir "${cand}" || true
fi
continue
fi
if stage_dir="$(mktemp -d "${cand}/ingglish-exegesis-stage.XXXXXX" 2>&1)"; then
if [[ -d "${stage_dir}" ]] && [[ -w "${stage_dir}" ]]; then
printf '%s\n' "${stage_dir}"
exit 0
fi
fi
if [[ "${created_parent}" -eq 1 ]]; then
rmdir "${cand}" || true
fi
done
echo "[ERROR] Failed to resolve a writable remote staging directory with >= ${min_kb} KiB free and without noexec." >&2
exit 1
EOF_STAGE
)"
if [[ -z "${REMOTE_STAGE_DIR}" ]]; then
echo "[ERROR] Remote staging directory resolution returned an empty path on ${EXEGESIS_HOST}." >&2
exit 1
fi
REMOTE_RPM_PATH="${REMOTE_STAGE_DIR}/${RPM_NAME}"
echo "[deploy] Using remote staging directory: ${REMOTE_STAGE_DIR}"
cleanup_remote_stage() {
ssh -o BatchMode=yes -o ConnectTimeout=5 "${EXEGESIS_HOST}" "rm -rf '${REMOTE_STAGE_DIR}'; if [ -d \"\${HOME}/.cache/rpm-stage\" ]; then rmdir --ignore-fail-on-non-empty \"\${HOME}/.cache/rpm-stage\" || true; fi; if [ -d \"\${HOME}/rpm-stage\" ]; then rmdir --ignore-fail-on-non-empty \"\${HOME}/rpm-stage\" || true; fi" || true
}
echo "[deploy] Transferring ${RPM_NAME} to ${EXEGESIS_HOST}:${REMOTE_RPM_PATH}..."
if ! scp "${RPM_FILE}" "${EXEGESIS_HOST}:${REMOTE_RPM_PATH}"; then
cleanup_remote_stage
exit 1
fi
echo "[deploy] Installing/upgrading ${RPM_NAME} on ${EXEGESIS_HOST}..."
INSTALL_CMD="rc=0; sudo rpm -Uvh --replacepkgs '${REMOTE_RPM_PATH}' || rc=\$?; rm -rf '${REMOTE_STAGE_DIR}'; if [ -d \"\${HOME}/.cache/rpm-stage\" ]; then rmdir --ignore-fail-on-non-empty \"\${HOME}/.cache/rpm-stage\" || true; fi; if [ -d \"\${HOME}/rpm-stage\" ]; then rmdir --ignore-fail-on-non-empty \"\${HOME}/rpm-stage\" || true; fi; exit \${rc}"
if [[ -t 0 ]]; then
ssh -t "${EXEGESIS_HOST}" "${INSTALL_CMD}"
else
ssh "${EXEGESIS_HOST}" "${INSTALL_CMD}"
fi
echo "[deploy] Running in-situ dry-run verification on ${EXEGESIS_HOST}..."
ssh -t "${EXEGESIS_HOST}" "sudo -u ingglish /usr/bin/ingglish-exegesis-push --dry-run || sudo /usr/bin/ingglish-exegesis-push --dry-run"
echo "[deploy] Verifying systemd timer state on ${EXEGESIS_HOST}..."
ssh "${EXEGESIS_HOST}" "systemctl is-enabled ingglish-exegesis.timer || true"
echo "[OK] Verified in-situ execution of /usr/bin/ingglish-exegesis-push --dry-run on ${EXEGESIS_HOST}."
echo "[rollback] To reverse this installation on ${EXEGESIS_HOST}, run: ssh ${EXEGESIS_HOST} sudo rpm -e ingglish-isopsephic-exegesis"
fi
+74 -14
View File
@@ -69,6 +69,24 @@ for arg in "$@"; do
esac
done
if [[ "${WINDOW_MODE}" == "auto" ]]; then
UTC_HOUR="$(date -u +%H)"
case "${UTC_HOUR}" in
13|14|15)
WINDOW_MODE="us-pre-market-open"
;;
21|22|23)
WINDOW_MODE="us-closing-bell"
;;
00|01|02)
WINDOW_MODE="utc-rollover"
;;
*)
WINDOW_MODE="us-closing-bell"
;;
esac
fi
LOCK_FILE="${HYPERSTITION_HARVEST_LOCK:-/tmp/hyperstition-vps-harvest.lock}"
if [[ -n "$(type -P flock || true)" ]]; then
exec 9>"${LOCK_FILE}"
@@ -90,9 +108,9 @@ if [[ "${PUSH_ONLY}" -eq 0 ]]; then
run_checked "hs-macro-harvest (live FRED CSV)" "${PYTHON_BIN}" -m hyperstitionstud_io.quant.macro
fi
if [[ "${WINDOW_MODE}" == "utc-rollover" ]] && [[ -f "${REPOS_ROOT}/ingglish-hyperdope-gematria/ingglish-aq-archive/scripts/ci_provision_ingglish.py" ]]; then
CI_OUT_DIR="${REPOS_ROOT}/ingglish-hyperdope-ci"
if [[ ! -d "${CI_OUT_DIR}" ]] && [[ -d "${REPOS_ROOT}/hyperdope-ci-build" ]]; then
CI_OUT_DIR="${REPOS_ROOT}/hyperdope-ci-build"
CI_OUT_DIR="${REPOS_ROOT}/hyperdope-ci-build"
if [[ ! -d "${CI_OUT_DIR}" ]] && [[ -d "${REPOS_ROOT}/ingglish-hyperdope-ci" ]]; then
CI_OUT_DIR="${REPOS_ROOT}/ingglish-hyperdope-ci"
fi
if [[ -d "${CI_OUT_DIR}" ]]; then
run_checked "ci_provision_ingglish.py (--tier 2)" "${PYTHON_BIN}" "${REPOS_ROOT}/ingglish-hyperdope-gematria/ingglish-aq-archive/scripts/ci_provision_ingglish.py" \
@@ -102,7 +120,7 @@ if [[ "${PUSH_ONLY}" -eq 0 ]]; then
fi
fi
run_checked "quant.timeseries" "${PYTHON_BIN}" -m hyperstitionstud_io.quant.timeseries
run_checked "hs-daily-brief" "${PYTHON_BIN}" -m hyperstitionstud_io.quant.daily_brief
run_checked "hs-daily-brief" "${PYTHON_BIN}" -m hyperstitionstud_io.quant.daily_brief --window "${WINDOW_MODE}"
run_checked "build_encyclopedia_knowledge_graph.py" "${PYTHON_BIN}" "${REPOS_ROOT}/encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py" --verify-only
echo "[2/5] Running Stage 3 transactional verification gates (hs-doctor, ReadOnlyIsolationGuard, test_core_suite)..."
@@ -128,20 +146,62 @@ fi
if [[ "${DO_PUSH}" -eq 1 ]] && [[ -f "/etc/hyperstitionstud.io/id_ed25519_git_libre_audio" ]]; then
echo "[4/5] Committing and pushing automated VPS telemetry updates to git.libre.audio..."
run_checked "hs-readme-sync --all" "${PYTHON_BIN}" -m hyperstitionstud_io.publishing.readme_sync --all
export GIT_SSH_COMMAND="ssh -i /etc/hyperstitionstud.io/id_ed25519_git_libre_audio -o StrictHostKeyChecking=accept-new"
run_checked "hs-readme-sync --hooks-only" "${PYTHON_BIN}" -m hyperstitionstud_io.publishing.readme_sync --hooks-only
DEPLOY_KEY="/etc/hyperstitionstud.io/id_ed25519_git_libre_audio"
GIT_SSH_CMD="ssh -i ${DEPLOY_KEY} -p 2222 -o IdentitiesOnly=yes -o IdentityAgent=none -o BatchMode=yes -o StrictHostKeyChecking=accept-new"
export GIT_SSH_COMMAND="${GIT_SSH_CMD}"
unset SSH_AUTH_SOCK || true
GIT_SSH_FLAGS=(-c "core.sshCommand=${GIT_SSH_CMD}")
STAMP_UTC="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
for r in hyperstitionstudio-core ingglish-hyperdope-gematria encyclopedia-knowledge-graph; do
if [[ -d "${REPOS_ROOT}/${r}/.git" ]]; then
if ! git -C "${REPOS_ROOT}/${r}" config user.name 2>&1; then
git -C "${REPOS_ROOT}/${r}" config user.name "Hyperstition VPS Bot"
git -C "${REPOS_ROOT}/${r}" config user.email "vps-bot@hyperstitionstud.io"
if [[ "${PUSH_ONLY}" -eq 1 ]]; then
echo " -> Inspecting ${r} for telemetry updates..."
fi
git -C "${REPOS_ROOT}/${r}" add -A
if ! git -C "${REPOS_ROOT}/${r}" diff --cached --quiet; then
run_checked "git commit (${r})" git -C "${REPOS_ROOT}/${r}" commit -m "chore(telemetry): automated VPS ${WINDOW_MODE} harvest (${STAMP_UTC})" || true
run_checked "git pull --rebase --autostash (${r})" git -C "${REPOS_ROOT}/${r}" pull --rebase --autostash origin main || true
run_checked "git push (${r})" git -C "${REPOS_ROOT}/${r}" push origin main || true
if [[ -z "$(git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" config user.name || true)" ]]; then
git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" config user.name "Hyperstition VPS Bot"
git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" config user.email "vps-bot@hyperstitionstud.io"
fi
forge_ssh="ssh://git@git.libre.audio:2222/seasharp"
git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" config core.sshCommand "${GIT_SSH_CMD}" || true
git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" remote set-url origin "${forge_ssh}/${r}.git" || true
if [[ "${r}" == "hyperstitionstudio-core" ]]; then
TELEMETRY_SNAP_DIR="/tmp/hyperstition-vps-prod-telemetry-snap"
rm -rf "${TELEMETRY_SNAP_DIR}"
run_checked "snapshot telemetry (${r})" "${PYTHON_BIN}" -m hyperstitionstud_io.quant.collector --snapshot-telemetry "${TELEMETRY_SNAP_DIR}"
run_checked "git fetch (${r})" git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" fetch --force origin main --tags
local_head="$(git -C "${REPOS_ROOT}/${r}" rev-parse HEAD)"
remote_head="$(git -C "${REPOS_ROOT}/${r}" rev-parse origin/main)"
if [[ "${local_head}" != "${remote_head}" ]]; then
if [[ "${PUSH_ONLY}" -eq 1 ]]; then
echo " [sync] Advancing ${r} base to origin/main and reconciling telemetry snapshot..."
fi
run_checked "git reset --hard origin/main (${r})" git -C "${REPOS_ROOT}/${r}" reset --hard origin/main
git -C "${REPOS_ROOT}/${r}" stash clear || true
run_checked "reconcile telemetry (${r})" "${PYTHON_BIN}" -m hyperstitionstud_io.quant.collector --reconcile-telemetry "${TELEMETRY_SNAP_DIR}"
fi
rm -rf "${TELEMETRY_SNAP_DIR}"
else
run_checked "git fetch (${r})" git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" fetch --force origin main --tags
run_checked "git pull --rebase --autostash (${r})" git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" pull --rebase -X theirs --autostash origin main
fi
git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" add -A
if ! git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" diff --cached --quiet; then
if [[ "${PUSH_ONLY}" -eq 1 ]]; then
echo " [commit] Committing new telemetry changes in ${r}..."
fi
run_checked "git commit (${r})" git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" commit -m "chore(telemetry): automated VPS ${WINDOW_MODE} harvest (${STAMP_UTC})"
if [[ "${PUSH_ONLY}" -eq 1 ]]; then
echo " [push] Pushing ${r} to git.libre.audio..."
fi
run_checked "git push (${r})" git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" push origin main
if [[ "${PUSH_ONLY}" -eq 1 ]]; then
echo " [ok] Repository ${r} successfully pushed to git.libre.audio ($(git -C "${REPOS_ROOT}/${r}" rev-parse --short HEAD))."
fi
else
if [[ "${PUSH_ONLY}" -eq 1 ]]; then
echo " [clean] Repository ${r} working tree is clean and in sync with origin/main ($(git -C "${REPOS_ROOT}/${r}" rev-parse --short HEAD))."
fi
fi
fi
done
+77 -11
View File
@@ -44,6 +44,17 @@ DEFAULT_REPOS_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
export REPOS_ROOT="${REPOS_ROOT:-${DEFAULT_REPOS_ROOT}}"
export LIVE_REPOS="${LIVE_REPOS:-/var/www/hyperstitionstud.io/repos}"
DEPLOY_KEY="/etc/hyperstitionstud.io/id_ed25519_git_libre_audio"
GIT_SSH_CMD=""
GIT_SSH_FLAGS=()
if [[ -f "${DEPLOY_KEY}" ]]; then
# Force OpenSSH to use only the deploy key (ignore forwarded ssh-agent / default ~/.ssh keys that exhaust MaxAuthTries)
GIT_SSH_CMD="ssh -i ${DEPLOY_KEY} -p 2222 -o IdentitiesOnly=yes -o IdentityAgent=none -o BatchMode=yes -o StrictHostKeyChecking=accept-new"
export GIT_SSH_COMMAND="${GIT_SSH_CMD}"
unset SSH_AUTH_SOCK || true
GIT_SSH_FLAGS=(-c "core.sshCommand=${GIT_SSH_CMD}")
fi
TARGET_REPO="all"
DO_PULL=1
DO_CADDY=1
@@ -84,10 +95,10 @@ if [[ -f "${REPOS_ROOT}/workspace.toml" ]]; then
export HYPERSTITIONSTUDIO_CONFIG="${REPOS_ROOT}/workspace.toml"
fi
# Detect whether the CI artifact repository is cloned as ingglish-hyperdope-ci or hyperdope-ci-build
CI_REPO_DIR="ingglish-hyperdope-ci"
if [[ ! -d "${REPOS_ROOT}/${CI_REPO_DIR}" ]] && [[ -d "${REPOS_ROOT}/hyperdope-ci-build" ]]; then
CI_REPO_DIR="hyperdope-ci-build"
# Detect whether the CI artifact repository is cloned as hyperdope-ci-build (canonical) or ingglish-hyperdope-ci
CI_REPO_DIR="hyperdope-ci-build"
if [[ ! -d "${REPOS_ROOT}/${CI_REPO_DIR}" ]] && [[ -d "${REPOS_ROOT}/ingglish-hyperdope-ci" ]]; then
CI_REPO_DIR="ingglish-hyperdope-ci"
fi
REPOS=(
@@ -100,6 +111,15 @@ REPOS=(
)
if [[ "${DO_PULL}" -eq 1 ]]; then
GIT_PULL_PREFIX=()
if [[ -f "${DEPLOY_KEY}" ]] && [[ ! -r "${DEPLOY_KEY}" ]]; then
if [[ -n "${SUDO}" ]]; then
GIT_PULL_PREFIX=("${SUDO}")
else
echo "[ERROR] Deploy key ${DEPLOY_KEY} is not readable by $(id -un) and sudo is unavailable." >&2
exit 1
fi
fi
for entry in "${REPOS[@]}"; do
repo="${entry%%:*}"
branch="${entry##*:}"
@@ -108,18 +128,58 @@ if [[ "${DO_PULL}" -eq 1 ]]; then
fi
if [[ -d "${REPOS_ROOT}/${repo}/.git" ]]; then
remote_name="origin"
if [[ "${repo}" == "haiperdohp-jemaytreeah" ]] && git -C "${REPOS_ROOT}/${repo}" remote | grep -qx "downstream"; then
if [[ "${repo}" == "haiperdohp-jemaytreeah" ]] && git ${GIT_SSH_FLAGS[@]+"${GIT_SSH_FLAGS[@]}"} -C "${REPOS_ROOT}/${repo}" remote | grep -qx "downstream"; then
remote_name="downstream"
fi
echo "[1/5] Updating ${REPOS_ROOT}/${repo} (${remote_name}/${branch}) with autostash rebase..."
prev_head="$(git -C "${REPOS_ROOT}/${repo}" rev-parse HEAD)"
run_checked "git pull --rebase --autostash ${repo}" git -C "${REPOS_ROOT}/${repo}" pull --rebase --autostash "${remote_name}" "${branch}"
new_head="$(git -C "${REPOS_ROOT}/${repo}" rev-parse HEAD)"
slug="${repo}"
if [[ "${repo}" == "hyperdope-ci-build" || "${repo}" == "ingglish-hyperdope-ci" ]]; then
slug="ingglish-hyperdope-ci"
fi
if [[ -f "${DEPLOY_KEY}" ]]; then
if [[ "${repo}" == "hyperstitionstudio-core" || "${repo}" == "ingglish-hyperdope-gematria" || "${repo}" == "encyclopedia-knowledge-graph" ]]; then
git ${GIT_SSH_FLAGS[@]+"${GIT_SSH_FLAGS[@]}"} -C "${REPOS_ROOT}/${repo}" config core.sshCommand "${GIT_SSH_CMD}" || true
git ${GIT_SSH_FLAGS[@]+"${GIT_SSH_FLAGS[@]}"} -C "${REPOS_ROOT}/${repo}" remote set-url "${remote_name}" "ssh://git@git.libre.audio:2222/seasharp/${slug}.git" || true
else
git -C "${REPOS_ROOT}/${repo}" config --unset core.sshCommand || true
git -C "${REPOS_ROOT}/${repo}" remote set-url "${remote_name}" "https://git.libre.audio/seasharp/${slug}.git" || true
fi
fi
echo "[1/5] Updating ${REPOS_ROOT}/${repo} (${remote_name}/${branch}) with lossless telemetry snapshot & clean remote sync..."
TELEMETRY_SNAP_DIR="/tmp/hyperstition-vps-telemetry-snap"
if [[ "${repo}" == "hyperstitionstudio-core" && ! -d "${TELEMETRY_SNAP_DIR}" ]]; then
"${PYTHON_BIN}" -m hyperstitionstud_io.quant.collector --snapshot-telemetry "${TELEMETRY_SNAP_DIR}" || true
fi
prev_head="$(git ${GIT_SSH_FLAGS[@]+"${GIT_SSH_FLAGS[@]}"} -C "${REPOS_ROOT}/${repo}" rev-parse HEAD)"
if [[ "${#GIT_PULL_PREFIX[@]}" -gt 0 ]]; then
run_checked "git fetch ${repo}" "${GIT_PULL_PREFIX[@]}" git ${GIT_SSH_FLAGS[@]+"${GIT_SSH_FLAGS[@]}"} -c "safe.directory=${REPOS_ROOT}/${repo}" -C "${REPOS_ROOT}/${repo}" fetch --force "${remote_name}" "${branch}" --tags
else
run_checked "git fetch ${repo}" git ${GIT_SSH_FLAGS[@]+"${GIT_SSH_FLAGS[@]}"} -C "${REPOS_ROOT}/${repo}" fetch --force "${remote_name}" "${branch}" --tags
fi
git -C "${REPOS_ROOT}/${repo}" rebase --abort 2>&1 | grep -v "No rebase in progress" || true
git -C "${REPOS_ROOT}/${repo}" merge --abort 2>&1 | grep -v "There is no merge to abort" || true
run_checked "git reset --hard ${remote_name}/${branch} (${repo})" git -C "${REPOS_ROOT}/${repo}" reset --hard "${remote_name}/${branch}"
git -C "${REPOS_ROOT}/${repo}" stash clear || true
new_head="$(git ${GIT_SSH_FLAGS[@]+"${GIT_SSH_FLAGS[@]}"} -C "${REPOS_ROOT}/${repo}" rev-parse HEAD)"
if [[ "${repo}" == "hyperstitionstudio-core" && "${prev_head}" != "${new_head}" && -z "${HYPERSTITION_SYNC_REEXEC:-}" ]]; then
echo "[1/5] hyperstitionstudio-core updated (${prev_head:0:7} -> ${new_head:0:7}); re-executing updated sync-vps-repos.sh..."
export HYPERSTITION_SYNC_REEXEC=1
exec "${REPOS_ROOT}/hyperstitionstudio-core/deploy/sync-vps-repos.sh" "$@"
fi
if [[ "${repo}" == "hyperstitionstudio-core" && -d "${TELEMETRY_SNAP_DIR}" ]]; then
run_checked "reconcile VPS telemetry snapshot" "${PYTHON_BIN}" -m hyperstitionstud_io.quant.collector --reconcile-telemetry "${TELEMETRY_SNAP_DIR}"
rm -rf "${TELEMETRY_SNAP_DIR}"
if [[ -n "$(git -C "${REPOS_ROOT}/hyperstitionstudio-core" status --porcelain || true)" ]] && [[ -f "${DEPLOY_KEY}" ]]; then
echo "[1/5] Committing and pushing reconciled VPS harvest telemetry to ${remote_name}/${branch}..."
run_checked "hs-readme-sync --hooks-only" "${PYTHON_BIN}" -m hyperstitionstud_io.publishing.readme_sync --hooks-only
if [[ -z "$(git -C "${REPOS_ROOT}/hyperstitionstudio-core" config user.name || true)" ]]; then
git -C "${REPOS_ROOT}/hyperstitionstudio-core" config user.name "Hyperstition VPS Bot"
git -C "${REPOS_ROOT}/hyperstitionstudio-core" config user.email "vps-bot@hyperstitionstud.io"
fi
git -C "${REPOS_ROOT}/hyperstitionstudio-core" add -A
run_checked "git commit reconciled telemetry" git ${GIT_SSH_FLAGS[@]+"${GIT_SSH_FLAGS[@]}"} -C "${REPOS_ROOT}/hyperstitionstudio-core" commit -m "chore(telemetry): reconcile VPS harvest telemetry with origin/main"
run_checked "git push reconciled telemetry" git ${GIT_SSH_FLAGS[@]+"${GIT_SSH_FLAGS[@]}"} -C "${REPOS_ROOT}/hyperstitionstudio-core" push "${remote_name}" "${branch}"
fi
fi
fi
done
fi
@@ -153,6 +213,10 @@ if p.is_file():
p.write_text(u, encoding="utf-8")
'
fi
if [[ -f "${REPOS_ROOT}/hyperstitionstudio-core/deploy/push-all-to-git-libre-audio.sh" ]]; then
cp -f "${REPOS_ROOT}/hyperstitionstudio-core/deploy/push-all-to-git-libre-audio.sh" "${REPOS_ROOT}/push-all-to-git-libre-audio.sh"
chmod 0755 "${REPOS_ROOT}/push-all-to-git-libre-audio.sh"
fi
run_checked "hs-readme-sync --hooks-only" "${PYTHON_BIN}" -m hyperstitionstud_io.publishing.readme_sync --hooks-only
run_checked "hs-deploy-scripts-sync --check" "${PYTHON_BIN}" -m hyperstitionstud_io.ci.deploy_scripts_sync --workspace-root "${REPOS_ROOT}" --check
run_checked "hs-closeups-sync --check" "${PYTHON_BIN}" -m hyperstitionstud_io.publishing.closeups_sync --check
@@ -188,8 +252,10 @@ for entry in "${REPOS[@]}"; do
fi
done
if [[ "${CI_REPO_DIR}" == "hyperdope-ci-build" ]] && [[ -d "${LIVE_REPOS}/hyperdope-ci-build" ]] && [[ ! -e "${LIVE_REPOS}/ingglish-hyperdope-ci" ]]; then
if [[ "${CI_REPO_DIR}" == "hyperdope-ci-build" ]] && [[ -d "${LIVE_REPOS}/hyperdope-ci-build" ]]; then
${LIVE_SUDO} ln -sfn "hyperdope-ci-build" "${LIVE_REPOS}/ingglish-hyperdope-ci"
elif [[ "${CI_REPO_DIR}" == "ingglish-hyperdope-ci" ]] && [[ -d "${LIVE_REPOS}/ingglish-hyperdope-ci" ]]; then
${LIVE_SUDO} ln -sfn "ingglish-hyperdope-ci" "${LIVE_REPOS}/hyperdope-ci-build"
fi
# Create relative route symlinks inside LIVE_REPOS so both Caddy and standalone HTTP servers resolve all active routes
@@ -227,7 +293,7 @@ ${LIVE_SUDO} ln -sfn "technocapital-singularity-zoology/encyclopedia" "${LIVE_RE
${LIVE_SUDO} ln -sfn "technocapital-singularity-zoology" "${LIVE_REPOS}/zoology"
${LIVE_SUDO} ln -sfn "ingglish-hyperdope-gematria/ingglish-aq-archive" "${LIVE_REPOS}/archive"
${LIVE_SUDO} ln -sfn "haiperdohp-jemaytreeah" "${LIVE_REPOS}/calc"
${LIVE_SUDO} ln -sfn "ingglish-hyperdope-ci" "${LIVE_REPOS}/ci"
${LIVE_SUDO} ln -sfn "${CI_REPO_DIR}" "${LIVE_REPOS}/ci"
${LIVE_SUDO} ln -sfn "hyperstitionstudio-core/schemas" "${LIVE_REPOS}/schemas"
echo "[4/5] Pre-compressing static HTML, JS, JSON, XML, Canvas, MD & CSS assets (< 5 MB) (.br / .gz) incrementally in parallel & enforcing single-layer (1x) compression..."
@@ -0,0 +1,136 @@
# Global Plan Specification, Operational Governance & Flexibility Standard
**Document ID:** `PLAN-SPECIFICATION-AND-GOVERNANCE-STANDARD`
**Plan Reference:** `PLAN-QUANT-PRE-MARKET-OPEN-DAILY-BRIEF-AND-REGIME-CADENCE` (`Plan #72`)
**Scope:** Architectural planning, technical project management, release lifecycle governance, and operational execution across all 6 `hyperstitionstud.io` repositories.
---
## 1. Purpose & Foundational Invariants
This standard formalizes the operational and architectural planning methodology across the `hyperstitionstud.io` ecosystem to ensure that all project management deliverables are legible, understandable, and comprehensively sound.
### Core Invariants
1. **Strict Planning vs. Implementation Boundary:** When asked to plan, the deliverable is strictly the architectural planning artifact (`.md` and compiled Dark-Mode ReportLab `.pdf` under `docs/plans/active/` or `docs/plans/piecewise/`, plus `references/roadmap-plan-ledger.md`), never unverified production code, partial stubs, or uncommitted working tree mutations.
2. **First-Resort Infrastructure Audit:** Existing automation infrastructure (systemd timers, cron rules, collector modules, cache tables) must be evaluated and prioritized before proposing net-new services or files. Creating new services or cron files is strictly a last resort.
3. **Comprehensive Lifecycle Scope:** Every plan must address end-to-end downstream impacts: data pipeline integrity, state archiving, single-layer (1x) compression, git repository commit cadence, and deployment script readiness (`DEPLOY-GATE-D01.MIRROR_PARITY` through `DEPLOY-GATE-D08.PRE_COMMIT_STAGE`).
4. **Disambiguated Prose & Comments:** All shorthand references in prose and comments must comply with `<PREFIX><NN>.<DOMAIN_TAG>` (e.g., `PANEL-P06.DAILY_BRIEF`, `REGIME-R01.BULL_RISK_ON`), while executable code remains globally exempt.
5. **Dual-Artifact Delivery:** Every active or piecewise plan is authored as version-controlled Markdown and immediately compiled to an offline-accessible Dark-Mode PDF via `hs-pdf-build`.
---
## 2. Three-Tier Flexibility Protocol ("Strict by Default, Flexible on Demand")
To provide institutional rigor without creating bureaucratic bottlenecks during rapid prototyping or ad-hoc analysis, planning follows a 3-tier flexibility protocol:
```
Planning Tier Selection Model
+----------------------------------------------------------------------------------------------------+
| Tier 1: Standard Production Architectural Plan [DEFAULT] |
| Trigger: "plan to ...", "architect ...", or standard feature/release requests |
| Scope: Full 8-section specification, Dark-Mode PDF, ledger entry, VPS audit, gates, rollout |
| Target: docs/plans/active/PLAN-<SLUG>.{md,pdf} or docs/plans/piecewise/PLAN-<SLUG>.{md,pdf} |
+----------------------------------------------------------------------------------------------------+
|
(If explicitly requested)
v
+----------------------------------------------------------------------------------------------------+
| Tier 2: Lightweight Tactical Memo [EXPLICIT OVERRIDE] |
| Trigger: "lightweight plan", "brief plan", "memo: ...", "draft outline only" |
| Scope: Focused 1–2 page technical delta, core trade-offs, and verification commands |
| Skips: Full VPS infrastructure audit, compression analysis, PDF compilation (unless requested) |
| Target: docs/plans/active/PLAN-<SLUG>.md or inline CLI delivery |
+----------------------------------------------------------------------------------------------------+
|
(If explicitly requested)
v
+----------------------------------------------------------------------------------------------------+
| Tier 3: Exploratory Scratchpad / Spike [EXPLICIT OVERRIDE] |
| Trigger: "spike:", "scratchpad:", "throwaway spike:", "ad-hoc exploration:" |
| Scope: Unformatted notes, quick spikes, throwaway experiment scripts |
| Invariants: Written strictly to /workspace/untracked/; 0 ledger entries; 0 git commits |
+----------------------------------------------------------------------------------------------------+
```
### Protocol Rules
- **Default Behavior:** The agent always operates at **Tier 1** unless an explicit prompt marker matches Tier 2 or Tier 3.
- **Override Handling:** When an override is requested, the agent acknowledges the lighter tier in a single line (e.g., `[Tier 2 Lightweight Memo requested; skipping PDF compilation and VPS scheduling audit]`) and proceeds immediately with the focused delta.
---
## 3. Mandatory Sections for Tier 1 Production Architectural Plans
Tier 1 Production Plans must contain the following standard sections:
### 1. Document Metadata & Header
- Document ID: `PLAN-<TOPIC-SLUG>`
- Status: `ACTIVE (docs/plans/active/)` or `PIECEWISE (docs/plans/piecewise/)`
- Target Ecosystem Version: `vX.Y.Z` (with baseline)
- Target Repositories: Specific repository slugs
- Target Surfaces: Affected web routes, CLI tools, or background timers
- Web Route: Canonical public HTTPS URL for the compiled companion PDF
- Author & Date
### 2. Operational Objective & Motivation
- Plain-statement summary of the deliverable.
- Domain motivation and measurable delta (e.g., information asymmetry advantage, memory reduction, latency bounds).
### 3. Existing Infrastructure Audit & Scheduling Hierarchy
- Exhaustive audit of all existing automation surfaces (timers, cron, modules).
- Explicit 3-stage candidate hierarchy:
- **Strategy A (First Resort):** Maximally reuses existing units (e.g., multi-calendar systemd timer).
- **Strategy B (Second Resort):** Reuses existing files (e.g., cron multiplexing).
- **Strategy C (Strict Last Resort):** Dedicated net-new services/files, evaluated only if A and B are blocked.
### 4. Data Pipeline Integrity & Transactional Rollback Safety
- End-to-end data flow: Harvesters -> Compilers -> Verification -> RAM Hydration -> Push.
- Zero-synthetic-data compliance (`PLAN-GATE-G01.EXTANT_DATA`).
- Transactional rollback on verification failure (`git checkout -- .` without touching tmpfs).
### 5. Archiving & Historical Ledger Evolution
- Ledger format, storage path, and schema definition.
- Deduplication semantics and session-window discrimination (`session_window`).
- Retention window capacity and quiescent SQLite compaction (`sqlite_meta.py --compress-archive`).
### 6. Compression Standards & Optimization Guarantees
- Single-Layer (1x) Compression Invariant (`PLAN-SINGLE-LAYER-COMPRESSION-ENFORCEMENT-AND-MULTI-COMPRESSED-FILE-REMEDIATION`).
- Webroot pre-compression (`.gz` via `gzip -9` and `.br` via `brotli -q 11`).
- Server-side bundle size caps (`--max-bundle-kb 256`).
### 7. Git Repository Commit Cadence & Telemetry Reconciliation
- Automated commit frequency and commit message templates (`chore(telemetry): ...`).
- Gating: commits occur strictly when `git diff --cached` detects substantive changes.
- Lossless telemetry reconciliation (`DEPLOY-GATE-D04.LOSSLESS_TELEMETRY` via `--snapshot-telemetry` and `--reconcile-telemetry`).
### 8. Stepwise Verification Gates & Acceptance Criteria
- Tabulated binary verification gates with explicit command-line invocations.
### 9. Implementation Rollout Sequence
- Phased, non-breaking rollout steps.
---
## 4. 5-Tier Plan Classification & Lifecycle Hierarchy
Plans reside in designated filesystem locations under `encyclopedia-knowledge-graph/docs/plans/`:
| Tier | Classification | Filesystem Directory | PDF Compilation Policy |
| :--- | :--- | :--- | :--- |
| **Tier 1** | Active Non-Piecewise | `docs/plans/active/` | Mandatory Dark-Mode `.pdf` |
| **Tier 2** | Fully Affirmed Piecewise | `docs/plans/piecewise/` | Mandatory Dark-Mode `.pdf` |
| **Tier 3** | Partially Affirmed Piecewise | `docs/plans/piecewise/` | Mandatory Dark-Mode `.pdf` |
| **Tier 4** | Pending Audit Piecewise | `docs/plans/piecewise/` | Mandatory Dark-Mode `.pdf` |
| **Tier 5.1** | Retained Inactive / Deferred | `docs/plans/inactive/` | Zero PDF compilation/recompilation |
| **Tier 5.2** | Cold-Archived Inactive | `docs/plans/inactive/inactive-plans-archive.tar.gz` | Zero PDF; manifests record SHA-256 |
| **Tier 5.3** | Cold-Archived Completed | `docs/archive/completed-plans-archive.tar.gz` | `.md`-only tarball; manifest records SHA-256 |
---
## 5. Automated Plan Verification (`hs-plan-lint`)
The plan specification validator (`hyperstitionstud_io.ci.plan_validator`) enforces:
1. Every `.md` in `docs/plans/active/` and `docs/plans/piecewise/` has a matching `.pdf` in the same directory.
2. Every active and piecewise plan has an entry in `references/roadmap-plan-ledger.md`.
3. All mandatory metadata fields (`Document ID:`, `Status:`, `Target Ecosystem Version:`, `Target Repositories:`) are present.
4. Shorthands comply with `hs-shorthand-lint`.
5. No bare container host paths are serialized.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 25 KiB

@@ -1,6 +1,6 @@
{
"$id": "urn:io:hyperstitionstud:closeups-ui-manifest",
"ui_elements_fingerprint_sha256": "55133af5b8662fcd4db68781d8002a6f931891143123e7f3e8c9b7e91faf9103",
"ui_elements_fingerprint_sha256": "575a5ef8137b8145fdaf914e28f29c06cd0fdec8ed2e0e68a4e0067837e277d9",
"closeup_images": [
"quadrant-1-cybermemetics-calc-graph.png",
"quadrant-1-tab-2-graph.png",
@@ -16,7 +16,7 @@
],
"live_metrics": {
"calc_db_entries": 233815,
"quant_total_real_bars": 472,
"quant_total_real_bars": 514,
"quant_bayesian_posteriors": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
@@ -804,7 +804,7 @@
}
},
"ipld_dag_json_cidv1": {
"/": "baguqeerakt6axr7t6xup2i6zp6xqdpwn3m4yzhidockgwzw3nyvqu3rqf4lq"
"/": "baguqeera6nnx7kkrf3vmvixyazmic5gnnq2vnps5stmsyenduuvudc7qbnya"
},
"geometry_audit": {
"all_clean": true,
+1 -1
View File
@@ -1,2 +1,2 @@
// Auto-generated by hyperstitionstud_io.quant.daily_brief — DO NOT EDIT MANUALLY
window.HYPERSTITION_DAILY_BRIEF = {"$schema": "./schemas/v1/daily-portfolio-brief.schema.json", "$id": "urn:io:hyperstitionstud:schema:v1:daily-portfolio-brief", "version": "2.4.0", "run_number": 18, "generated_at_utc": "2026-12-01T03:15:46Z", "synthetic_data_eliminated": true, "agenda_1_executive_summary": {"headline_finding": "Late-November tape is governed by Vector G1/G4 Isometric Pinning (Dose 2, Posterior P(R2) = 0.0%), compressing median daily moves by -58% (101.0 bps vs. 240.5 bps baseline), while sovereign rates (US10Y 4.85%-4.94%, EFFR 3.88% == 388 KG nodes) cap long-duration multiple expansion.", "high_impact_findings_ranked": [{"rank": 1, "theme": "Dose 2 Isometric Pinning Dominance vs. Dose 3+ Tail Exhaustion", "durability_score": 0.84, "severity_score": 0.78, "portfolio_impact_probability": 0.81, "evidence": "Across 440 real Nov 2026 bars, Dose 2 (n=39) cut median moves to 101.0 bps (P90=292 bps, 60.6% next-day continuation), while all 8 Dose 3+ triple-confluence events were 100% downside selloffs averaging 1.98x volume and 377.5 bps next-day moves."}, {"rank": 2, "theme": "FRED Overnight Rate & Pipeline Margin Lock (EFFR = 388 bps, PPI MoM = -19 bps -> 137)", "durability_score": 0.88, "severity_score": 0.72, "portfolio_impact_probability": 0.79, "evidence": "EFFR holds at 3.88% (388 bps == 388 Knowledge Graph nodes) with SOFR at 3.98% (+10 bps repo spread), while PPI MoM (-19 bps -> 'nineteen'/'nainteen' = 137 [G4 Isometric]) undercuts CPI MoM (+35 bps -> 166) by -54 bps."}, {"rank": 3, "theme": "Synchronous Crypto & AI Hardware Coordinate Locks (BTC/ETH -91 bps, GOOGL -108 bps -> 292, SOL $73.07 == 73)", "durability_score": 0.76, "severity_score": 0.74, "portfolio_impact_probability": 0.75, "evidence": "SOL-USD locked onto its own ticker AQ ($73.07 == SOL=73) before surging +536 bps next day; GOOGL -108 bps locked onto Gen 0 292 (Dossier 62); BTC-USD and ETH-USD posted a simultaneous -91 bps (kampyoot=91) lock on 2026-11-26/28."}], "risk_on_off_barometers": {"vix_close": 23.81, "us10y_yield_pct": 4.94, "btc_latest_change_bps": -44, "copper_hg_latest_change_bps": 181, "effr_overnight_pct": 3.88, "sofr_overnight_pct": 3.98, "sofr_minus_effr_spread_bps": 10, "real_m2_mom_growth_bps": 16}, "bayesian_regime_inference": {"extant_priors": {"R1_BULL_RISK_ON": 0.0, "R2_PINNED_ISOMETRIC": 0.0, "R3_TAIL_DRAWDOWN_RISK_OFF": 1.0}, "likelihood_factors": {"R1_BULL_RISK_ON": 0.6354, "R2_PINNED_ISOMETRIC": 0.805, "R3_TAIL_DRAWDOWN_RISK_OFF": 3.5063}, "posterior_probabilities": {"R1_BULL_RISK_ON": 0.0, "R2_PINNED_ISOMETRIC": 0.0, "R3_TAIL_DRAWDOWN_RISK_OFF": 1.0}, "scenarios": {"best_case_r1_bull_risk_on": {"probability": 0.0, "label": "Best Case — Risk-On Expansion & Smooth Trend Continuation", "expected_daily_excursion_bps": "P50: +180 to +240 bps (Up-skewed S1/S2 leadership)", "drivers": "Real M2 positive growth (+16 bps MoM), easing PPI pipeline (-19 bps MoM), and VIX compression."}, "base_case_r2_pinned_isometric": {"probability": 0.0, "label": "Base Case — Vector G1/G4 Isometric Attractor Pinning (Dose 2 Regime)", "expected_daily_excursion_bps": "P50: 101.0 bps | P90 Tail: 292.0 bps (-58% variance compression vs. Dose 0)", "drivers": "Cross-species Market Ring × Same-Day Dossier Coordinate locks without headline shocks (60.6% next-day continuation)."}, "worst_case_r3_tail_drawdown": {"probability": 1.0, "label": "Worst Case — Dose 3+ Phase-Transition Drawdown & Sovereign Yield Tightening", "expected_daily_excursion_bps": "Next-Day Mean: -377.5 bps | 3-Day Cumulative Excursion: 1,395.0 bps (~13.95%)", "drivers": "US10Y near 4.85%-4.94% + triple-species Dose 3+ collisions (100% downside skew & 1.98x mean volume in Nov 2026)."}}}}, "agenda_2_confirming_signals": {"summary": "Macro liquidity expansion (Real M2 +16 bps MoM, M1 +52 bps MoM) and easing producer input costs (PPI -19 bps MoM) support S1/S3 operating margins, while Dose 2 dossier-tape locks confirm quiet accumulation.", "active_dose2_confirmations": [{"date_utc": "2026-11-30", "symbol": "BTC-USD", "entity_ing": "bitkoin", "close_usd": 59696.43, "change_bps": -44, "volume_ratio_20d": 0.77, "shared_dossier_coordinates": [189], "dose_taxon_label": "Dose 2: G1/G4 Pinning Well"}, {"date_utc": "2026-11-29", "symbol": "SOL-USD", "entity_ing": "sohlana", "close_usd": 71.34, "change_bps": 125, "volume_ratio_20d": 0.73, "shared_dossier_coordinates": [71, 125], "dose_taxon_label": "Dose 2: G1/G4 Pinning Well"}, {"date_utc": "2026-11-28", "symbol": "BTC-USD", "entity_ing": "bitkoin", "close_usd": 59321.42, "change_bps": -91, "volume_ratio_20d": 0.38, "shared_dossier_coordinates": [91], "dose_taxon_label": "Dose 2: G1/G4 Pinning Well"}, {"date_utc": "2026-11-28", "symbol": "ETH-USD", "entity_ing": "edheroom", "close_usd": 1645.99, "change_bps": -91, "volume_ratio_20d": 0.52, "shared_dossier_coordinates": [91], "dose_taxon_label": "Dose 2: G1/G4 Pinning Well"}, {"date_utc": "2026-11-28", "symbol": "SOL-USD", "entity_ing": "sohlana", "close_usd": 70.46,Line truncated
window.HYPERSTITION_DAILY_BRIEF = {"$schema": "./schemas/v1/daily-portfolio-brief.schema.json", "$id": "urn:io:hyperstitionstud:schema:v1:daily-portfolio-brief", "version": "2.17.1", "run_number": 17, "session_window": "utc-rollover", "generated_at_utc": "2026-12-06T00:00:24Z", "synthetic_data_eliminated": true, "agenda_1_executive_summary": {"headline_finding": "Late-November tape is governed by Vector G1/G4 Isometric Pinning (Dose 2, Posterior P(R2) = 0.0%), compressing median daily moves by -58% (101.0 bps vs. 240.5 bps baseline), while sovereign rates (US10Y 4.85%-4.94%, EFFR 3.88% == 388 KG nodes) cap long-duration multiple expansion.", "high_impact_findings_ranked": [{"rank": 1, "theme": "Dose 2 Isometric Pinning Dominance vs. Dose 3+ Tail Exhaustion", "durability_score": 0.84, "severity_score": 0.78, "portfolio_impact_probability": 0.81, "evidence": "Across 440 real Nov 2026 bars, Dose 2 (n=44) cut median moves to 101.0 bps (P90=292 bps, 60.6% next-day continuation), while all 9 Dose 3+ triple-confluence events were 100% downside selloffs averaging 1.98x volume and 377.5 bps next-day moves."}, {"rank": 2, "theme": "FRED Overnight Rate & Pipeline Margin Lock (EFFR = 388 bps, PPI MoM = -19 bps -> 137)", "durability_score": 0.88, "severity_score": 0.72, "portfolio_impact_probability": 0.79, "evidence": "EFFR holds at 3.88% (388 bps == 388 Knowledge Graph nodes) with SOFR at 3.98% (+10 bps repo spread), while PPI MoM (-19 bps -> 'nineteen'/'nainteen' = 137 [G4 Isometric]) undercuts CPI MoM (+35 bps -> 166) by -54 bps."}, {"rank": 3, "theme": "Synchronous Crypto & AI Hardware Coordinate Locks (BTC/ETH -91 bps, GOOGL -108 bps -> 292, SOL $73.07 == 73)", "durability_score": 0.76, "severity_score": 0.74, "portfolio_impact_probability": 0.75, "evidence": "SOL-USD locked onto its own ticker AQ ($73.07 == SOL=73) before surging +536 bps next day; GOOGL -108 bps locked onto Gen 0 292 (Dossier 62); BTC-USD and ETH-USD posted a simultaneous -91 bps (kampyoot=91) lock on 2026-11-26/28."}], "risk_on_off_barometers": {"vix_close": 21.67, "us10y_yield_pct": 5.02, "btc_latest_change_bps": -925, "copper_hg_latest_change_bps": 104, "effr_overnight_pct": 3.89, "sofr_overnight_pct": 3.93, "sofr_minus_effr_spread_bps": 4, "real_m2_mom_growth_bps": 16}, "bayesian_regime_inference": {"extant_priors": {"R1_BULL_RISK_ON": 0.0, "R2_PINNED_ISOMETRIC": 0.0, "R3_TAIL_DRAWDOWN_RISK_OFF": 1.0}, "likelihood_factors": {"R1_BULL_RISK_ON": 0.9775, "R2_PINNED_ISOMETRIC": 1.0465, "R3_TAIL_DRAWDOWN_RISK_OFF": 2.8687}, "posterior_probabilities": {"R1_BULL_RISK_ON": 0.0, "R2_PINNED_ISOMETRIC": 0.0, "R3_TAIL_DRAWDOWN_RISK_OFF": 1.0}, "scenarios": {"best_case_r1_bull_risk_on": {"probability": 0.0, "label": "Best Case — Risk-On Expansion & Smooth Trend Continuation", "expected_daily_excursion_bps": "P50: +180 to +240 bps (Up-skewed S1/S2 leadership)", "drivers": "Real M2 positive growth (+16 bps MoM), easing PPI pipeline (-19 bps MoM), and VIX compression."}, "base_case_r2_pinned_isometric": {"probability": 0.0, "label": "Base Case — Vector G1/G4 Isometric Attractor Pinning (Dose 2 Regime)", "expected_daily_excursion_bps": "P50: 101.0 bps | P90 Tail: 292.0 bps (-58% variance compression vs. Dose 0)", "drivers": "Cross-species Market Ring × Same-Day Dossier Coordinate locks without headline shocks (60.6% next-day continuation)."}, "worst_case_r3_tail_drawdown": {"probability": 1.0, "label": "Worst Case — Dose 3+ Phase-Transition Drawdown & Sovereign Yield Tightening", "expected_daily_excursion_bps": "Next-Day Mean: -377.5 bps | 3-Day Cumulative Excursion: 1,395.0 bps (~13.95%)", "drivers": "US10Y near 4.85%-4.94% + triple-species Dose 3+ collisions (100% downside skew & 1.98x mean volume in Nov 2026)."}}}}, "agenda_2_confirming_signals": {"summary": "Macro liquidity expansion (Real M2 +16 bps MoM, M1 +52 bps MoM) and easing producer input costs (PPI -19 bps MoM) support S1/S3 operating margins, while Dose 2 dossier-tape locks confirm quiet accumulation.", "active_dose2_confirmations": [{"date_utc": "2026-12-03", "symbol": "ORCL", "entity_ing": "orakal", "close_usd": 107.69, "change_bps": 47, "volume_ratio_20d": 0.78, "shared_dossier_coordinates": [], "dose_taxon_label": "Dose 2: G1/G4 Pinning Well"}, {"date_utc": "2026-12-02", "symbol": "AMD", "entity_ing": "ayemdee", "close_usd": 457.75, "change_bps": -128, "volume_ratio_20d": 0.49, "shared_dossier_coordinates": [128], "dose_taxon_label": "Dose 2: G1/G4 Pinning Well"}, {"date_utc": "2026-12-01", "symbol": "RTX", "entity_ing": "raytheeon", "close_usd": 200.21, "change_bps": 60, "volume_ratio_20d": 0.71, "shared_dossier_coordinates": [], "dose_taxon_label": "Dose 2: G1/G4 Pinning Well"}, {"date_utc": "2026-11-30", "symbol": "MSFT", "entity_ing": "maikrohsawft", "close_usd": 487.2, "change_bps": -115, "volume_ratio_20d": 1.39, "shared_dossier_coordinates": [115], "dose_taxon_label": "Dose 2: G1/G4 Pinning Well"}, {"date_utc": "2026-11-30", "symbol": "LMT", "entity_ing": "lokheed", "close_usLine truncated
+131 -150
View File
@@ -1,9 +1,10 @@
{
"$schema": "./schemas/v1/daily-portfolio-brief.schema.json",
"$id": "urn:io:hyperstitionstud:schema:v1:daily-portfolio-brief",
"version": "2.4.0",
"run_number": 18,
"generated_at_utc": "2026-12-01T03:15:46Z",
"version": "2.17.1",
"run_number": 17,
"session_window": "utc-rollover",
"generated_at_utc": "2026-12-06T00:00:24Z",
"synthetic_data_eliminated": true,
"agenda_1_executive_summary": {
"headline_finding": "Late-November tape is governed by Vector G1/G4 Isometric Pinning (Dose 2, Posterior P(R2) = 0.0%), compressing median daily moves by -58% (101.0 bps vs. 240.5 bps baseline), while sovereign rates (US10Y 4.85%-4.94%, EFFR 3.88% == 388 KG nodes) cap long-duration multiple expansion.",
@@ -14,7 +15,7 @@
"durability_score": 0.84,
"severity_score": 0.78,
"portfolio_impact_probability": 0.81,
"evidence": "Across 440 real Nov 2026 bars, Dose 2 (n=39) cut median moves to 101.0 bps (P90=292 bps, 60.6% next-day continuation), while all 8 Dose 3+ triple-confluence events were 100% downside selloffs averaging 1.98x volume and 377.5 bps next-day moves."
"evidence": "Across 440 real Nov 2026 bars, Dose 2 (n=44) cut median moves to 101.0 bps (P90=292 bps, 60.6% next-day continuation), while all 9 Dose 3+ triple-confluence events were 100% downside selloffs averaging 1.98x volume and 377.5 bps next-day moves."
},
{
"rank": 2,
@@ -34,13 +35,13 @@
}
],
"risk_on_off_barometers": {
"vix_close": 23.81,
"us10y_yield_pct": 4.94,
"btc_latest_change_bps": -44,
"copper_hg_latest_change_bps": 181,
"effr_overnight_pct": 3.88,
"sofr_overnight_pct": 3.98,
"sofr_minus_effr_spread_bps": 10,
"vix_close": 21.67,
"us10y_yield_pct": 5.02,
"btc_latest_change_bps": -925,
"copper_hg_latest_change_bps": 104,
"effr_overnight_pct": 3.89,
"sofr_overnight_pct": 3.93,
"sofr_minus_effr_spread_bps": 4,
"real_m2_mom_growth_bps": 16
},
"bayesian_regime_inference": {
@@ -50,9 +51,9 @@
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"likelihood_factors": {
"R1_BULL_RISK_ON": 0.6354,
"R2_PINNED_ISOMETRIC": 0.805,
"R3_TAIL_DRAWDOWN_RISK_OFF": 3.5063
"R1_BULL_RISK_ON": 0.9775,
"R2_PINNED_ISOMETRIC": 1.0465,
"R3_TAIL_DRAWDOWN_RISK_OFF": 2.8687
},
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
@@ -84,6 +85,60 @@
"agenda_2_confirming_signals": {
"summary": "Macro liquidity expansion (Real M2 +16 bps MoM, M1 +52 bps MoM) and easing producer input costs (PPI -19 bps MoM) support S1/S3 operating margins, while Dose 2 dossier-tape locks confirm quiet accumulation.",
"active_dose2_confirmations": [
{
"date_utc": "2026-12-03",
"symbol": "ORCL",
"entity_ing": "orakal",
"close_usd": 107.69,
"change_bps": 47,
"volume_ratio_20d": 0.78,
"shared_dossier_coordinates": [],
"dose_taxon_label": "Dose 2: G1/G4 Pinning Well"
},
{
"date_utc": "2026-12-02",
"symbol": "AMD",
"entity_ing": "ayemdee",
"close_usd": 457.75,
"change_bps": -128,
"volume_ratio_20d": 0.49,
"shared_dossier_coordinates": [
128
],
"dose_taxon_label": "Dose 2: G1/G4 Pinning Well"
},
{
"date_utc": "2026-12-01",
"symbol": "RTX",
"entity_ing": "raytheeon",
"close_usd": 200.21,
"change_bps": 60,
"volume_ratio_20d": 0.71,
"shared_dossier_coordinates": [],
"dose_taxon_label": "Dose 2: G1/G4 Pinning Well"
},
{
"date_utc": "2026-11-30",
"symbol": "MSFT",
"entity_ing": "maikrohsawft",
"close_usd": 487.2,
"change_bps": -115,
"volume_ratio_20d": 1.39,
"shared_dossier_coordinates": [
115
],
"dose_taxon_label": "Dose 2: G1/G4 Pinning Well"
},
{
"date_utc": "2026-11-30",
"symbol": "LMT",
"entity_ing": "lokheed",
"close_usd": 610.65,
"change_bps": 79,
"volume_ratio_20d": 1.91,
"shared_dossier_coordinates": [],
"dose_taxon_label": "Dose 2: G1/G4 Pinning Well"
},
{
"date_utc": "2026-11-30",
"symbol": "BTC-USD",
@@ -120,69 +175,25 @@
91
],
"dose_taxon_label": "Dose 2: G1/G4 Pinning Well"
},
{
"date_utc": "2026-11-28",
"symbol": "ETH-USD",
"entity_ing": "edheroom",
"close_usd": 1645.99,
"change_bps": -91,
"volume_ratio_20d": 0.52,
"shared_dossier_coordinates": [
91
],
"dose_taxon_label": "Dose 2: G1/G4 Pinning Well"
},
{
"date_utc": "2026-11-28",
"symbol": "SOL-USD",
"entity_ing": "sohlana",
"close_usd": 70.46,
"change_bps": -156,
"volume_ratio_20d": 0.48,
"shared_dossier_coordinates": [
163
],
"dose_taxon_label": "Dose 2: G1/G4 Pinning Well"
},
{
"date_utc": "2026-11-27",
"symbol": "NVDA",
"entity_ing": "envideea",
"close_usd": 150.49,
"change_bps": 80,
"volume_ratio_20d": 0.53,
"shared_dossier_coordinates": [
128
],
"dose_taxon_label": "Dose 2: G1/G4 Pinning Well"
},
{
"date_utc": "2026-11-26",
"symbol": "SOL-USD",
"entity_ing": "sohlana",
"close_usd": 70.93,
"change_bps": 77,
"volume_ratio_20d": 0.57,
"shared_dossier_coordinates": [
71
],
"dose_taxon_label": "Dose 2: G1/G4 Pinning Well"
},
{
"date_utc": "2026-11-25",
"symbol": "MSFT",
"entity_ing": "maikrohsawft",
"close_usd": 489.93,
"change_bps": -125,
"volume_ratio_20d": 0.87,
"shared_dossier_coordinates": [
125
],
"dose_taxon_label": "Dose 2: G1/G4 Pinning Well"
}
],
"active_dose3_breakout_confirmations": [
{
"date_utc": "2026-11-30",
"symbol": "NVDA",
"entity_ing": "envideea",
"close_usd": 152.55,
"change_bps": 137,
"volume_ratio_20d": 0.77,
"scope1_locks": [
"BPS_SELF_LOCK (137==envideea)"
],
"shared_dossier_coordinates": [
137,
153
],
"dose_taxon_label": "Dose 3+: Phase-Transition Surge"
},
{
"date_utc": "2026-11-25",
"symbol": "BLK",
@@ -251,19 +262,6 @@
166
],
"dose_taxon_label": "Dose 3+: Phase-Transition Surge"
},
{
"date_utc": "2026-11-12",
"symbol": "MSFT",
"entity_ing": "maikrohsawft",
"close_usd": 523.0,
"change_bps": 36,
"volume_ratio_20d": 0.7,
"scope1_locks": [
"BPS_REPDIGIT_ATTRACTOR (222)"
],
"shared_dossier_coordinates": [],
"dose_taxon_label": "Dose 3+: Phase-Transition Surge"
}
],
"macro_support_vectors": [
@@ -294,7 +292,7 @@
{
"challenge_type": "SOVEREIGN_TERM_YIELD_HEADWIND",
"indicator": "US10Y (DGS10 / ^TNX) & Term Slope (10Y - EFFR)",
"observation": "US10Y = 4.85% / 4.94% (+97 bps above EFFR 3.88% -> 'naintee sevan' = 237 == kansorsheeam)",
"observation": "US10Y = 5.08% / 5.02% (+97 bps above EFFR 3.88% -> 'naintee sevan' = 237 == kansorsheeam)",
"impact": "Sustained ~4.85%-4.94% 10-year yields compress equity risk premia and penalize high-multiple S1 software names on any headline miss."
},
{
@@ -319,6 +317,14 @@
"change_bps": 3148,
"explanation": "NVDA appeared in the 00:00 UTC news wire on 2026-11-23 with zero market coordinate locks (Dose 1 unconfirmed stub)."
},
{
"date_utc": "2026-12-03",
"symbol": "NVDA",
"type": "NARRATIVE_TAPE_DIVERGENCE",
"close_usd": 150.57,
"change_bps": -76,
"explanation": "NVDA appeared in the 00:00 UTC news wire on 2026-12-03 with zero market coordinate locks (Dose 1 unconfirmed stub)."
},
{
"date_utc": "2026-11-13",
"symbol": "MSFT",
@@ -327,6 +333,22 @@
"change_bps": 17,
"explanation": "MSFT appeared in the 00:00 UTC news wire on 2026-11-13 with zero market coordinate locks (Dose 1 unconfirmed stub)."
},
{
"date_utc": "2026-12-03",
"symbol": "META",
"type": "NARRATIVE_TAPE_DIVERGENCE",
"close_usd": 627.51,
"change_bps": -291,
"explanation": "META appeared in the 00:00 UTC news wire on 2026-12-03 with zero market coordinate locks (Dose 1 unconfirmed stub)."
},
{
"date_utc": "2026-12-02",
"symbol": "ORCL",
"type": "NARRATIVE_TAPE_DIVERGENCE",
"close_usd": 107.19,
"change_bps": -187,
"explanation": "ORCL appeared in the 00:00 UTC news wire on 2026-12-02 with zero market coordinate locks (Dose 1 unconfirmed stub)."
},
{
"date_utc": "2026-11-19",
"symbol": "ARM",
@@ -350,74 +372,33 @@
"close_usd": 176.67,
"change_bps": 1608,
"explanation": "ARM appeared in the 00:00 UTC news wire on 2026-11-23 with zero market coordinate locks (Dose 1 unconfirmed stub)."
},
{
"date_utc": "2026-11-24",
"symbol": "ARM",
"type": "NARRATIVE_TAPE_DIVERGENCE",
"close_usd": 161.56,
"change_bps": -855,
"explanation": "ARM appeared in the 00:00 UTC news wire on 2026-11-24 with zero market coordinate locks (Dose 1 unconfirmed stub)."
},
{
"date_utc": "2026-11-25",
"symbol": "ARM",
"type": "NARRATIVE_TAPE_DIVERGENCE",
"close_usd": 161.51,
"change_bps": -3,
"explanation": "ARM appeared in the 00:00 UTC news wire on 2026-11-25 with zero market coordinate locks (Dose 1 unconfirmed stub)."
},
{
"date_utc": "2026-11-27",
"symbol": "ARM",
"type": "NARRATIVE_TAPE_DIVERGENCE",
"close_usd": 171.55,
"change_bps": 622,
"explanation": "ARM appeared in the 00:00 UTC news wire on 2026-11-27 with zero market coordinate locks (Dose 1 unconfirmed stub)."
}
]
},
"agenda_4_delta_since_last_run": {
"prior_run_number": 17,
"current_run_number": 18,
"prior_run_number": 16,
"current_run_number": 17,
"latest_wire_dossier": {
"date_utc": "2026-11-30",
"dossier_number": 72,
"dossier_file": "72-dossier-news-2026-11-30.md",
"date_utc": "2026-12-03",
"dossier_number": 75,
"dossier_file": "75-dossier-news-2026-12-03.md",
"equation_counts": {
"eq_333": 80,
"eq_666": 40,
"eq_777": 40,
"total": 160
"eq_333": 9,
"eq_666": 10,
"eq_777": 10,
"total": 29
},
"active_ring_coordinates": [
71,
81,
91,
95,
96,
115,
128,
129,
135,
136,
137,
153,
160,
163,
189,
191,
193,
197,
211,
222,
256
135
]
},
"macro_releases_ingested": {
"cpi_latest": "2026-10-01: 337.476 (35 bps MoM)",
"ppi_latest": "2026-10-01: 293.921 (-19 bps MoM)",
"effr_sofr_latest": "2026-11-27: EFFR=3.88%, SOFR=3.98%",
"effr_sofr_latest": "2026-12-03: EFFR=3.89%, SOFR=3.93%",
"m2_real_m2_latest": "2026-10-01: M2=$23532.8B, Real M2=$6973.2B",
"gdp_gnp_latest": "2026-07-01: GDP=$33056.204B, GNP=$33026.509B"
},
@@ -432,13 +413,13 @@
},
"agenda_5_daily_key_macro_question_and_rigor": {
"prior_question_grading": {
"prior_question_id": "Q-RUN-0017",
"prior_question_id": "Q-RUN-0016",
"prior_question_text": "Will the synchronous -91 bps (kampyoot / kleenroom) Dose 2 pinning wave across BTC-USD and ETH-USD and NVDA's +80 bps ('eighty' = 128 [S3]) lock hold inside the P50 <= 150 bps isometric corridor, or will US10Y yields near 4.85%-4.94% and SOFR-EFFR (+10 bps) trigger a Dose 3+ high-volume (>1.5x Vol20d) breakout?",
"status": "EVALUATED_ON_REAL_TAPE",
"evidence_summary": "Late-November real tape logged 12 Dose 2 isometric pinning sessions (including 2026-11-24 GOOGL -108 bps -> 292 and 2026-11-28 BTC/ETH -91 bps sync wave) with 0 new Dose 3+ drawdown shocks after Nov 19, confirming Base-Case R2 variance compression."
"evidence_summary": "Late-November real tape logged 17 Dose 2 isometric pinning sessions (including 2026-11-24 GOOGL -108 bps -> 292 and 2026-11-28 BTC/ETH -91 bps sync wave) with 0 new Dose 3+ drawdown shocks after Nov 19, confirming Base-Case R2 variance compression."
},
"active_daily_question": {
"question_id": "Q-RUN-0018",
"question_id": "Q-RUN-0017",
"question_text": "Will the synchronous -91 bps (kampyoot / kleenroom) Dose 2 pinning wave across BTC-USD and ETH-USD and NVDA's +80 bps ('eighty' = 128 [S3]) lock hold inside the P50 <= 150 bps isometric corridor, or will US10Y yields near 4.85%-4.94% and SOFR-EFFR (+10 bps) trigger a Dose 3+ high-volume (>1.5x Vol20d) breakout?",
"confirmation_threshold_r2_pin": "Next-session median displacement across locked S1/S2/S3 leaders remains <= 150 bps with Vol20d < 1.15x.",
"falsification_threshold_r3_breakout": "Any S1/S2/S3 keystone logs a Dose 3+ headline-coupled session with Vol20d >= 1.50x or change_bps <= -300 bps."
@@ -452,10 +433,10 @@
"total_real_bars_n": 440,
"valid_change_bps_n": 433,
"next_day_pairs_n": 412,
"dose_0_n": 345,
"dose_1_n": 80,
"dose_2_n": 39,
"dose_3_plus_n": 8
"dose_0_n": 421,
"dose_1_n": 109,
"dose_2_n": 44,
"dose_3_plus_n": 9
},
"methodological_applicability_and_significance": "1. Nonparametric Order Statistics (Median P50 & Tail P90) vs. Parametric Means: Because cross-asset basis-point returns exhibit heavy right-tail kurtosis (crypto & VIX bars vs. low-beta equities), Median P50 (Dose 2 = 101.0 bps vs. Dose 0 = 240.5 bps, -58%) and P90 (Dose 2 = 292 bps vs. Dose 0 = 665 bps, -56%) are the primary applicable location/scale estimators. 2. Small-Sample Exploratory Guardrail on Tail Regimes: While Dose 3+ (n=4) exhibits a 100% downside skew, 1.98x mean volume, and 100% next-day continuation (377.5 bps), n=4 (df=2) is below the n>=10 threshold for standalone parametric inference and is explicitly badged as a Small-Sample Tail Alert rather than an asymptotic parametric law."
}
@@ -464,12 +445,12 @@
"namespace_urn": "urn:io:hyperstitionstud:isolation-receipt:v1",
"all_unchanged": true,
"files": {
"/workspace/technocapital-singularity-zoology/taxonomy/glossary-registry.json": {
"/srv/hyperstitionstud.io/repos/technocapital-singularity-zoology/taxonomy/glossary-registry.json": {
"pre_sha256": "7564ef40fb3e0e18d1d8547522db431b6a369c40139713b573df6e58b972d43d",
"post_sha256": "7564ef40fb3e0e18d1d8547522db431b6a369c40139713b573df6e58b972d43d",
"unchanged": true
},
"/workspace/technocapital-singularity-zoology/encyclopedia/encyclopedia-manifest.json": {
"/srv/hyperstitionstud.io/repos/technocapital-singularity-zoology/encyclopedia/encyclopedia-manifest.json": {
"pre_sha256": "0d7ce833bb0aa0eea069bf764b2e3b0b36ac2631821c42f3d6bcb897335f8a7d",
"post_sha256": "0d7ce833bb0aa0eea069bf764b2e3b0b36ac2631821c42f3d6bcb897335f8a7d",
"unchanged": true
@@ -477,6 +458,6 @@
}
},
"ipld_dag_json_cidv1": {
"/": "baguqeera6yv3xbdw7lqkus3jrvykxl67ayxmbhsuy6oimpu6e722rbp6zweq"
"/": "baguqeerappdfxjzk5xaxvvluny3a2k5bzxhtco7rng3dfvulpm62d3tfavwa"
}
}
+113 -115
View File
@@ -1,14 +1,15 @@
{
"version": "2.4.0",
"run_number": 18,
"updated_at_utc": "2026-12-01T03:15:46Z",
"version": "2.17.1",
"run_number": 17,
"session_window": "utc-rollover",
"updated_at_utc": "2026-12-06T00:00:24Z",
"latest_posteriors": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"active_daily_question": {
"question_id": "Q-RUN-0018",
"question_id": "Q-RUN-0017",
"question_text": "Will the synchronous -91 bps (kampyoot / kleenroom) Dose 2 pinning wave across BTC-USD and ETH-USD and NVDA's +80 bps ('eighty' = 128 [S3]) lock hold inside the P50 <= 150 bps isometric corridor, or will US10Y yields near 4.85%-4.94% and SOFR-EFFR (+10 bps) trigger a Dose 3+ high-volume (>1.5x Vol20d) breakout?",
"confirmation_threshold_r2_pin": "Next-session median displacement across locked S1/S2/S3 leaders remains <= 150 bps with Vol20d < 1.15x.",
"falsification_threshold_r3_breakout": "Any S1/S2/S3 keystone logs a Dose 3+ headline-coupled session with Vol20d >= 1.50x or change_bps <= -300 bps."
@@ -93,124 +94,121 @@
},
{
"run_number": 8,
"generated_at_utc": "2026-12-01T00:05:55Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0008",
"cidv1": "baguqeerautuzfnmivmbc2fzxbwrc5sgftzcct22n4mezvac4ggjyrbvg5g5a"
},
{
"run_number": 9,
"generated_at_utc": "2026-12-01T00:19:28Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0009",
"cidv1": "baguqeerawfns3y6ytluwupzkepk35hrnvxj4jvjsphebjkr4ssl5alsq7ubq"
},
{
"run_number": 10,
"generated_at_utc": "2026-12-01T00:20:26Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0010",
"cidv1": "baguqeeranwkmzt6gli6f4i4c2uoelda4edgwqajimr65cz7t3bfj4bat3fta"
},
{
"run_number": 11,
"generated_at_utc": "2026-12-01T00:34:19Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0011",
"cidv1": "baguqeeral24w6gneqk7n4ule4pu2kknmdxrja46iz5dujnbabjv6cng6ttua"
},
{
"run_number": 12,
"generated_at_utc": "2026-12-01T01:01:54Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0012",
"cidv1": "baguqeeratalw7a3v4wps5vffanzkikbrk32tgjlrkyx3d64jfivp3raku4oq"
},
{
"run_number": 13,
"generated_at_utc": "2026-12-01T01:07:49Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0013",
"cidv1": "baguqeerazwuha42cyefdtfljfycwsv34nsmhowvcfnhk7uxall2y7od5wbjq"
},
{
"run_number": 14,
"generated_at_utc": "2026-12-01T01:15:27Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0014",
"cidv1": "baguqeeragj7pkqauxnfhazh3xufyvsj5m7glzt5ey74tf7e2opl4mrw5k46a"
},
{
"run_number": 15,
"generated_at_utc": "2026-12-01T02:24:09Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0015",
"cidv1": "baguqeerad3auisgfth3tuuqkaljf65huof765uwocq7vxxkbp3an46rpjcva"
},
{
"run_number": 16,
"generated_at_utc": "2026-12-01T02:45:08Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0016",
"cidv1": "baguqeeradofb4vbejhjmvqzdbk3ej6maztsvpzh374uog267wj3x3sni7nxa"
},
{
"run_number": 17,
"generated_at_utc": "2026-12-01T03:12:39Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0017",
"cidv1": "baguqeeralanwxvgzcp2vr6mjezengwreiqnszi6pqs27pxyll6ydg244chna"
},
{
"run_number": 18,
"generated_at_utc": "2026-12-01T03:15:46Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0018",
"question_id": "Q-RUN-0008",
"cidv1": "baguqeera6yv3xbdw7lqkus3jrvykxl67ayxmbhsuy6oimpu6e722rbp6zweq"
},
{
"run_number": 9,
"generated_at_utc": "2026-12-02T21:30:19Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0009",
"cidv1": "baguqeeraqwdlii6fxho2jagvuo4fcvqcbghgd4dgcht3dd3gvghcgyqlbhia"
},
{
"run_number": 10,
"session_window": "utc-rollover",
"generated_at_utc": "2026-12-03T00:00:18Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0010",
"cidv1": "baguqeerasvcwns5cclvlxftue3fokc77daelrpqklneq45lgdoidgsr2brma"
},
{
"run_number": 11,
"session_window": "us-pre-market-open",
"generated_at_utc": "2026-12-03T14:00:22Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0011",
"cidv1": "baguqeerafekoudj4fyjw5sgjqqgqs4ab6ycvexp6lu44yltxc465q5fnqf4a"
},
{
"run_number": 12,
"session_window": "us-closing-bell",
"generated_at_utc": "2026-12-03T21:30:19Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0012",
"cidv1": "baguqeerad6ke6lm57rsq2fwhxuclgdtn7szxdz6jzszzo4yy52ls4oipnoaa"
},
{
"run_number": 13,
"session_window": "utc-rollover",
"generated_at_utc": "2026-12-04T00:00:29Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0013",
"cidv1": "baguqeerafkom6oy5ph2wo7lf62ahzyxju4rk6hgqjzmgr5d3h7hfpbtsannq"
},
{
"run_number": 14,
"session_window": "us-pre-market-open",
"generated_at_utc": "2026-12-04T14:00:54Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0014",
"cidv1": "baguqeeravipzzbfsnhuupv3ndsbaynurje5zktzynvrg2wd35b5z5zuwndfa"
},
{
"run_number": 15,
"session_window": "us-closing-bell",
"generated_at_utc": "2026-12-04T21:30:16Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0015",
"cidv1": "baguqeeragsgfxpwrqjfiq23sjhp673syxtvefvxzdbltclndofukcnywspxq"
},
{
"run_number": 16,
"session_window": "utc-rollover",
"generated_at_utc": "2026-12-05T00:00:17Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0016",
"cidv1": "baguqeeraioc64yauaem2mbhezgwqehacb5yjbyp2tzkeka763tg4ge7tirda"
},
{
"run_number": 17,
"session_window": "utc-rollover",
"generated_at_utc": "2026-12-06T00:00:24Z",
"posterior_probabilities": {
"R1_BULL_RISK_ON": 0.0,
"R2_PINNED_ISOMETRIC": 0.0,
"R3_TAIL_DRAWDOWN_RISK_OFF": 1.0
},
"question_id": "Q-RUN-0017",
"cidv1": "baguqeerappdfxjzk5xaxvvluny3a2k5bzxhtco7rng3dfvulpm62d3tfavwa"
}
]
}
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1,3 +1,3 @@
// Auto-generated synchronous time-series bundle for file:// and https:// portability
window.HyperstitionStudio = window.HyperstitionStudio || {};
window.HyperstitionStudio.QuantTimeSeries = {"$schema": "./schemas/v1/quant-timeseries.schema.json", "$id": "urn:io:hyperstitionstud:schema:v1:quant-timeseries", "version": "2.4.0", "namespace_urn": "urn:io:hyperstitionstud:quant-timeseries:2.4.0", "generated_at_utc": "2026-12-01T03:15:42Z", "synthetic_data_eliminated": true, "periodicity_gate": {"enforced": true, "allowed_cadences": ["1d-us-closing-bell-2130-utc", "24h-news-wire-rollover-0000-utc"], "dated_news_dossiers_ingested": 22, "excluded_non_periodic_sources": ["01-ingglish-aq-lexicon.md", "10-19-ledger-*.md", "20-24-dossier-*.md", "26-45-dossier-*.md", "65-69-dossier-technocapital-singularity-*.md", "technocapital-singularity-zoology/encyclopedia/*", "proposal-*.md", "lecture-*.md", "podcast-ep*.md", "haiperdohp-jemaytreeah/db.json"], "non_periodic_records_ingested": 0, "missing_data_policy": "No data available (never synthesized or interpolated)"}, "enabled_lenses": ["fund_manager", "neutral_math", "corporate_board", "tierzoo_ecology", "fantasy_sabermetrics", "pokedex_scanner"], "default_lens": "fund_manager", "lens_registry_meta": {"fund_manager": {"lens_id": "fund_manager", "title": "Quantitative Hedge Fund & Factor Risk", "short_label": "Quant Factor", "structural_labels": {"struct_isometric_armor": "Chokepoint Moat", "struct_drift_velocity": "Signal Velocity", "struct_variance_collapse": "Convergence Power", "struct_trophic_capture": "Institutional Coupling", "struct_prime_density": "Idiosyncratic Asymmetry", "struct_repricing_resilience": "Regime Robustness"}, "timeseries_labels": {"ts_duty_cycle_pct": "Signal Duty Cycle / Hit Rate (%)", "ts_weighted_resonance": "Conviction-Weighted Exposure (0-100)", "ts_excess_over_replacement": "Information Ratio / Alpha Over Benchmark", "ts_quantile_profile": "Downside VaR_20 / Upside P90 / Convexity CV", "ts_optimal_lag_days": "Granger Lead-Lag Horizon τ* (Days)", "ts_regime_splits": "Regime-Conditional Beta Split (M1/M2/M3)"}}, "neutral_math": {"lens_id": "neutral_math", "title": "Neutral Mathematical & Statistical Invariants", "short_label": "Neutral Math", "structural_labels": {"struct_isometric_armor": "G4 Isometric Ratio (Δ=0)", "struct_drift_velocity": "G3 Inverse Phonemic Drift", "struct_variance_collapse": "G1 Log Variance Collapse", "struct_trophic_capture": "Bipartite S×S6 Coupling Degree", "struct_prime_density": "G5 Prime & Twin-Prime Density", "struct_repricing_resilience": "Repricing Counter-Swap Closure"}, "timeseries_labels": {"ts_duty_cycle_pct": "Active Duty Cycle Pr[X_t > 0] (%)", "ts_weighted_resonance": "Weighted Resonance Index (0-100)", "ts_excess_over_replacement": "Excess Value Over Baseline (σ-Units)", "ts_quantile_profile": "Quantile Spread (P20 / P90 / CV)", "ts_optimal_lag_days": "Peak Cross-Correlation Lag τ* (Days)", "ts_regime_splits": "Conditional Regime Delta E[X|S_t] - μ"}}, "corporate_board": {"lens_id": "corporate_board", "title": "Corporate Strategy & Balance-Sheet Governance", "short_label": "Corporate Board", "structural_labels": {"struct_isometric_armor": "Supply-Chain Moat", "struct_drift_velocity": "Execution Agility", "struct_variance_collapse": "Cross-Unit Synergy", "struct_trophic_capture": "Governance & Balance-Sheet Integration", "struct_prime_density": "Proprietary IP Density", "struct_repricing_resilience": "Stress-Test Resilience"}, "timeseries_labels": {"ts_duty_cycle_pct": "Operational Utilization Cadence (%)", "ts_weighted_resonance": "Strategic Capital Share (0-100)", "ts_excess_over_replacement": "Net Economic Value Added (EVA)", "ts_quantile_profile": "Base-Case Floor / Upside Case / Variance", "ts_optimal_lag_days": "Guidance-to-Market Lead Time τ* (Days)", "ts_regime_splits": "Macro Stress-Scenario Delta (Halt/Surge/Cap)"}}, "tierzoo_ecology": {"lens_id": "tierzoo_ecology", "title": "TierZoo Ecological Trophic Index (ETI)", "short_label": "TierZoo (ETI)", "structural_labels": {"struct_isometric_armor": "ARM (G4 Isometric Chokepoint Armor)", "struct_drift_velocity": "VEL (Teleoplexic Escape Velocity)", "struct_variance_collapse": "COL (G1 Variance-Collapse Compression)", "struct_trophic_capture": "CAP (S×S6 Double-Articulation & Capture)", "struct_prime_density": "PRM (Prime & G5 Twin-Prime Mutation IQ)", "struct_repricing_resilience": "RES (Tri-Modal Repricing & State Resilience)"}, "timeseries_labels": {"ts_duty_cycle_pct": "Foraging Activity Duty Cycle (%)", "ts_weighted_resonance": "Trophic Dominance Rating (0-100)", "ts_excess_over_replacement": "Apex Surplus Over Extinction Floor", "ts_quantile_profile": "Metabolic Floor / Burst Ceiling / Niche CV", "ts_optimal_lag_days": "Predator-Prey Phase Lead τ* (Days)", "ts_regime_splits": "Biome Weather Adaptation Split (M1/M2/M3)"}}, "fantasy_sabermetrics": {"lens_id": "fantasy_sabermetrics", "title": "Fantasy Football & Sabermetric Roster Engine", "short_label": "Fantasy Sabermetrics", "structural_labels": {"struct_isometric_armor": "Pass Protection (OL Chokepoint Block)", "struct_drift_veLine truncated
window.HyperstitionStudio.QuantTimeSeries = {"$schema": "./schemas/v1/quant-timeseries.schema.json", "$id": "urn:io:hyperstitionstud:schema:v1:quant-timeseries", "version": "2.17.1", "namespace_urn": "urn:io:hyperstitionstud:quant-timeseries:2.17.1", "generated_at_utc": "2026-12-06T00:00:19Z", "synthetic_data_eliminated": true, "periodicity_gate": {"enforced": true, "allowed_cadences": ["1d-us-closing-bell-2130-utc", "24h-news-wire-rollover-0000-utc"], "dated_news_dossiers_ingested": 25, "excluded_non_periodic_sources": ["01-ingglish-aq-lexicon.md", "10-19-ledger-*.md", "20-24-dossier-*.md", "26-45-dossier-*.md", "65-69-dossier-technocapital-singularity-*.md", "technocapital-singularity-zoology/encyclopedia/*", "proposal-*.md", "lecture-*.md", "podcast-ep*.md", "haiperdohp-jemaytreeah/db.json"], "non_periodic_records_ingested": 0, "missing_data_policy": "No data available (never synthesized or interpolated)"}, "enabled_lenses": ["fund_manager", "neutral_math", "corporate_board", "tierzoo_ecology", "fantasy_sabermetrics", "pokedex_scanner"], "default_lens": "fund_manager", "lens_registry_meta": {"fund_manager": {"lens_id": "fund_manager", "title": "Quantitative Hedge Fund & Factor Risk", "short_label": "Quant Factor", "structural_labels": {"struct_isometric_armor": "Chokepoint Moat", "struct_drift_velocity": "Signal Velocity", "struct_variance_collapse": "Convergence Power", "struct_trophic_capture": "Institutional Coupling", "struct_prime_density": "Idiosyncratic Asymmetry", "struct_repricing_resilience": "Regime Robustness"}, "timeseries_labels": {"ts_duty_cycle_pct": "Signal Duty Cycle / Hit Rate (%)", "ts_weighted_resonance": "Conviction-Weighted Exposure (0-100)", "ts_excess_over_replacement": "Information Ratio / Alpha Over Benchmark", "ts_quantile_profile": "Downside VaR_20 / Upside P90 / Convexity CV", "ts_optimal_lag_days": "Granger Lead-Lag Horizon τ* (Days)", "ts_regime_splits": "Regime-Conditional Beta Split (M1/M2/M3)"}}, "neutral_math": {"lens_id": "neutral_math", "title": "Neutral Mathematical & Statistical Invariants", "short_label": "Neutral Math", "structural_labels": {"struct_isometric_armor": "G4 Isometric Ratio (Δ=0)", "struct_drift_velocity": "G3 Inverse Phonemic Drift", "struct_variance_collapse": "G1 Log Variance Collapse", "struct_trophic_capture": "Bipartite S×S6 Coupling Degree", "struct_prime_density": "G5 Prime & Twin-Prime Density", "struct_repricing_resilience": "Repricing Counter-Swap Closure"}, "timeseries_labels": {"ts_duty_cycle_pct": "Active Duty Cycle Pr[X_t > 0] (%)", "ts_weighted_resonance": "Weighted Resonance Index (0-100)", "ts_excess_over_replacement": "Excess Value Over Baseline (σ-Units)", "ts_quantile_profile": "Quantile Spread (P20 / P90 / CV)", "ts_optimal_lag_days": "Peak Cross-Correlation Lag τ* (Days)", "ts_regime_splits": "Conditional Regime Delta E[X|S_t] - μ"}}, "corporate_board": {"lens_id": "corporate_board", "title": "Corporate Strategy & Balance-Sheet Governance", "short_label": "Corporate Board", "structural_labels": {"struct_isometric_armor": "Supply-Chain Moat", "struct_drift_velocity": "Execution Agility", "struct_variance_collapse": "Cross-Unit Synergy", "struct_trophic_capture": "Governance & Balance-Sheet Integration", "struct_prime_density": "Proprietary IP Density", "struct_repricing_resilience": "Stress-Test Resilience"}, "timeseries_labels": {"ts_duty_cycle_pct": "Operational Utilization Cadence (%)", "ts_weighted_resonance": "Strategic Capital Share (0-100)", "ts_excess_over_replacement": "Net Economic Value Added (EVA)", "ts_quantile_profile": "Base-Case Floor / Upside Case / Variance", "ts_optimal_lag_days": "Guidance-to-Market Lead Time τ* (Days)", "ts_regime_splits": "Macro Stress-Scenario Delta (Halt/Surge/Cap)"}}, "tierzoo_ecology": {"lens_id": "tierzoo_ecology", "title": "TierZoo Ecological Trophic Index (ETI)", "short_label": "TierZoo (ETI)", "structural_labels": {"struct_isometric_armor": "ARM (G4 Isometric Chokepoint Armor)", "struct_drift_velocity": "VEL (Teleoplexic Escape Velocity)", "struct_variance_collapse": "COL (G1 Variance-Collapse Compression)", "struct_trophic_capture": "CAP (S×S6 Double-Articulation & Capture)", "struct_prime_density": "PRM (Prime & G5 Twin-Prime Mutation IQ)", "struct_repricing_resilience": "RES (Tri-Modal Repricing & State Resilience)"}, "timeseries_labels": {"ts_duty_cycle_pct": "Foraging Activity Duty Cycle (%)", "ts_weighted_resonance": "Trophic Dominance Rating (0-100)", "ts_excess_over_replacement": "Apex Surplus Over Extinction Floor", "ts_quantile_profile": "Metabolic Floor / Burst Ceiling / Niche CV", "ts_optimal_lag_days": "Predator-Prey Phase Lead τ* (Days)", "ts_regime_splits": "Biome Weather Adaptation Split (M1/M2/M3)"}}, "fantasy_sabermetrics": {"lens_id": "fantasy_sabermetrics", "title": "Fantasy Football & Sabermetric Roster Engine", "short_label": "Fantasy Sabermetrics", "structural_labels": {"struct_isometric_armor": "Pass Protection (OL Chokepoint Block)", "struct_drift_Line truncated
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1,2 +1,2 @@
// Auto-generated by hyperstitionstud_io.quant.macro — DO NOT EDIT MANUALLY
window.HYPERSTITION_MACRO_DATA = {"$schema": "./schemas/v1/macro-indicators.schema.json", "$id": "urn:io:hyperstitionstud:schema:v1:macro-indicators", "version": "2.4.0", "generated_at_utc": "2026-12-01T03:15:44Z", "synthetic_data_eliminated": true, "cadence_policy": "native_cadence_preserved_no_interpolation_null_when_unavailable", "source": "fred_stlouisfed_keyless_csv", "series_count": 14, "series": {"cpi": {"series_id": "CPIAUCSL", "slug": "cpi", "label": "CPI (Consumer Price Index: All Urban Consumers)", "cadence": "1mo", "unit": "Index (1982-84=100)", "guilds": ["S6", "S2"], "data_available": true, "status": "ok", "latest_date_utc": "2026-10-01", "latest_value": 337.476, "prior_date_utc": "2026-09-01", "prior_value": 336.298, "period_change_bps": 35, "period_change_pct": 0.35, "yoy_change_pct": null, "yoy_change_bps": null, "aq_evaluation": {"face_int": 337, "digit_aq": 13, "spoken_eng": "three hundred thirty seven", "spoken_eng_aq": 502, "spoken_ing": "three huhndrad therdee sevan", "spoken_ing_aq": 485, "prime_rank_face": 68, "prime_rank_spoken_ing": null, "ring_coordinates": [], "ring_partners": {}}, "change_aq_evaluation": {"face_int": 35, "digit_aq": 8, "spoken_eng": "thirty five", "spoken_eng_aq": 232, "spoken_ing": "therdee faiv", "spoken_ing_aq": 202, "prime_rank_face": null, "prime_rank_spoken_ing": null, "ring_coordinates": [], "ring_partners": {}}, "missing_observation_dates": [], "recent_observations": [{"date_utc": "2026-09-01", "data_available": true, "status": "ok", "value": 336.298}, {"date_utc": "2026-10-01", "data_available": true, "status": "ok", "value": 337.476}]}, "ppi": {"series_id": "PPIACO", "slug": "ppi", "label": "PPI (Producer Price Index: All Commodities)", "cadence": "1mo", "unit": "Index (1982=100)", "guilds": ["S3", "S6"], "data_available": true, "status": "ok", "latest_date_utc": "2026-10-01", "latest_value": 293.921, "prior_date_utc": "2026-09-01", "prior_value": 294.473, "period_change_bps": -19, "period_change_pct": -0.19, "yoy_change_pct": null, "yoy_change_bps": null, "aq_evaluation": {"face_int": 294, "digit_aq": 15, "spoken_eng": "two hundred ninety four", "spoken_eng_aq": 459, "spoken_ing": "too huhndrad naintee for", "spoken_ing_aq": 424, "prime_rank_face": null, "prime_rank_spoken_ing": null, "ring_coordinates": [], "ring_partners": {}}, "change_aq_evaluation": {"face_int": 19, "digit_aq": 10, "spoken_eng": "nineteen", "spoken_eng_aq": 158, "spoken_ing": "nainteen", "spoken_ing_aq": 154, "prime_rank_face": 8, "prime_rank_spoken_ing": null, "ring_coordinates": [], "ring_partners": {}}, "missing_observation_dates": [], "recent_observations": [{"date_utc": "2026-09-01", "data_available": true, "status": "ok", "value": 294.473}, {"date_utc": "2026-10-01", "data_available": true, "status": "ok", "value": 293.921}]}, "us10y": {"series_id": "DGS10", "slug": "us10y", "label": "US10Y (10-Year US Treasury Constant Maturity Yield)", "cadence": "1d", "unit": "Percent (%)", "guilds": ["S6", "S1"], "data_available": true, "status": "ok", "latest_date_utc": "2026-11-25", "latest_value": 4.85, "prior_date_utc": "2026-11-24", "prior_value": 4.91, "period_change_bps": -6, "period_change_pct": -0.06, "yoy_change_pct": null, "yoy_change_bps": null, "aq_evaluation": {"face_int": 485, "digit_aq": 17, "spoken_eng": "four hundred eighty five", "spoken_eng_aq": 439, "spoken_ing": "for huhndrad aytee faiv", "spoken_ing_aq": 391, "prime_rank_face": null, "prime_rank_spoken_ing": null, "ring_coordinates": [], "ring_partners": {}}, "change_aq_evaluation": {"face_int": 6, "digit_aq": 6, "spoken_eng": "six", "spoken_eng_aq": 79, "spoken_ing": "siks", "spoken_ing_aq": 94, "prime_rank_face": null, "prime_rank_spoken_ing": null, "ring_coordinates": [], "ring_partners": {}}, "missing_observation_dates": ["2026-11-26"], "recent_observations": [{"date_utc": "2026-11-24", "data_available": true, "status": "ok", "value": 4.91}, {"date_utc": "2026-11-25", "data_available": true, "status": "ok", "value": 4.85}, {"date_utc": "2026-11-26", "data_available": false, "status": "No data available", "value": null}]}, "effr": {"series_id": "EFFR", "slug": "effr", "label": "EFFR (Effective Federal Funds Overnight Lending Rate)", "cadence": "1d", "unit": "Percent (%)", "guilds": ["S6", "S2"], "data_available": true, "status": "ok", "latest_date_utc": "2026-11-27", "latest_value": 3.88, "prior_date_utc": "2026-11-25", "prior_value": 3.88, "period_change_bps": 0, "period_change_pct": 0.0, "yoy_change_pct": null, "yoy_change_bps": null, "aq_evaluation": {"face_int": 388, "digit_aq": 19, "spoken_eng": "three hundred eighty eight", "spoken_eng_aq": 460, "spoken_ing": "three huhndrad aytee ayt", "spoken_ing_aq": 425, "prime_rank_face": null, "prime_rank_spoken_ing": null, "ring_coordinates": [], "ring_partners": {}}, "change_aq_evaluation": {"face_int": 0, "digit_aq": 0, "spoken_eng": "zero", "spoken_eng_aq": 100, "spoken_ing": "zeeroh", "spoken_ing_aq": 131, "prime_rank_face": null, "prime_rank_spoken_ing": 32, "Line truncated
window.HYPERSTITION_MACRO_DATA = {"$schema": "./schemas/v1/macro-indicators.schema.json", "$id": "urn:io:hyperstitionstud:schema:v1:macro-indicators", "version": "2.17.1", "generated_at_utc": "2026-12-06T00:00:22Z", "synthetic_data_eliminated": true, "cadence_policy": "native_cadence_preserved_no_interpolation_null_when_unavailable", "source": "fred_stlouisfed_keyless_csv", "series_count": 14, "series": {"cpi": {"series_id": "CPIAUCSL", "slug": "cpi", "label": "CPI (Consumer Price Index: All Urban Consumers)", "cadence": "1mo", "unit": "Index (1982-84=100)", "guilds": ["S6", "S2"], "data_available": true, "status": "ok", "latest_date_utc": "2026-10-01", "latest_value": 337.476, "prior_date_utc": "2026-09-01", "prior_value": 336.298, "period_change_bps": 35, "period_change_pct": 0.35, "yoy_change_pct": 4.08, "yoy_change_bps": 408, "aq_evaluation": {"face_int": 337, "digit_aq": 13, "spoken_eng": "three hundred thirty seven", "spoken_eng_aq": 502, "spoken_ing": "three huhndrad therdee sevan", "spoken_ing_aq": 485, "prime_rank_face": 68, "prime_rank_spoken_ing": null, "ring_coordinates": [], "ring_partners": {}}, "change_aq_evaluation": {"face_int": 35, "digit_aq": 8, "spoken_eng": "thirty five", "spoken_eng_aq": 232, "spoken_ing": "therdee faiv", "spoken_ing_aq": 202, "prime_rank_face": null, "prime_rank_spoken_ing": null, "ring_coordinates": [], "ring_partners": {}}, "missing_observation_dates": ["2025-10-01"], "recent_observations": [{"date_utc": "2025-10-01", "data_available": false, "status": "No data available", "value": null}, {"date_utc": "2025-11-01", "data_available": true, "status": "ok", "value": 325.063}, {"date_utc": "2025-12-01", "data_available": true, "status": "ok", "value": 326.031}, {"date_utc": "2026-01-01", "data_available": true, "status": "ok", "value": 326.588}, {"date_utc": "2026-02-01", "data_available": true, "status": "ok", "value": 327.46}, {"date_utc": "2026-03-01", "data_available": true, "status": "ok", "value": 330.293}, {"date_utc": "2026-04-01", "data_available": true, "status": "ok", "value": 332.407}, {"date_utc": "2026-05-01", "data_available": true, "status": "ok", "value": 333.979}, {"date_utc": "2026-06-01", "data_available": true, "status": "ok", "value": 332.568}, {"date_utc": "2026-07-01", "data_available": true, "status": "ok", "value": 332.813}, {"date_utc": "2026-08-01", "data_available": true, "status": "ok", "value": 334.131}, {"date_utc": "2026-09-01", "data_available": true, "status": "ok", "value": 336.298}, {"date_utc": "2026-10-01", "data_available": true, "status": "ok", "value": 337.476}]}, "ppi": {"series_id": "PPIACO", "slug": "ppi", "label": "PPI (Producer Price Index: All Commodities)", "cadence": "1mo", "unit": "Index (1982=100)", "guilds": ["S3", "S6"], "data_available": true, "status": "ok", "latest_date_utc": "2026-10-01", "latest_value": 293.921, "prior_date_utc": "2026-09-01", "prior_value": 294.473, "period_change_bps": -19, "period_change_pct": -0.19, "yoy_change_pct": 12.79, "yoy_change_bps": 1279, "aq_evaluation": {"face_int": 294, "digit_aq": 15, "spoken_eng": "two hundred ninety four", "spoken_eng_aq": 459, "spoken_ing": "too huhndrad naintee for", "spoken_ing_aq": 424, "prime_rank_face": null, "prime_rank_spoken_ing": null, "ring_coordinates": [], "ring_partners": {}}, "change_aq_evaluation": {"face_int": 19, "digit_aq": 10, "spoken_eng": "nineteen", "spoken_eng_aq": 158, "spoken_ing": "nainteen", "spoken_ing_aq": 154, "prime_rank_face": 8, "prime_rank_spoken_ing": null, "ring_coordinates": [], "ring_partners": {}}, "missing_observation_dates": [], "recent_observations": [{"date_utc": "2025-10-01", "data_available": true, "status": "ok", "value": 260.591}, {"date_utc": "2025-11-01", "data_available": true, "status": "ok", "value": 261.914}, {"date_utc": "2025-12-01", "data_available": true, "status": "ok", "value": 261.333}, {"date_utc": "2026-01-01", "data_available": true, "status": "ok", "value": 263.608}, {"date_utc": "2026-02-01", "data_available": true, "status": "ok", "value": 269.535}, {"date_utc": "2026-03-01", "data_available": true, "status": "ok", "value": 276.109}, {"date_utc": "2026-04-01", "data_available": true, "status": "ok", "value": 282.722}, {"date_utc": "2026-05-01", "data_available": true, "status": "ok", "value": 290.281}, {"date_utc": "2026-06-01", "data_available": true, "status": "ok", "value": 285.795}, {"date_utc": "2026-07-01", "data_available": true, "status": "ok", "value": 284.837}, {"date_utc": "2026-08-01", "data_available": true, "status": "ok", "value": 287.522}, {"date_utc": "2026-09-01", "data_available": true, "status": "ok", "value": 294.473}, {"date_utc": "2026-10-01", "data_available": true, "status": "ok", "value": 293.921}]}, "us10y": {"series_id": "DGS10", "slug": "us10y", "label": "US10Y (10-Year US Treasury Constant Maturity Yield)", "cadence": "1d", "unit": "Percent (%)", "guilds": ["S6", "S1"], "data_available": true, "status": "ok", "latest_date_utc": "2026-12-03", "latest_value": 5.08, Line truncated
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -24,7 +24,7 @@ import time
from pathlib import Path
from typing import Any, Iterable
from hyperstitionstud_io.config import load_workspace_config
from hyperstitionstud_io.config import load_json_cached, load_workspace_config
SCHEMA_VERSION = 1
@@ -100,7 +100,7 @@ def load_ledger(path: Path) -> dict[str, Any]:
if not path.exists():
return {"version": SCHEMA_VERSION, "sources": []}
try:
data = json.loads(path.read_text(encoding="utf-8"))
data = load_json_cached(path, copy_result=True)
except (json.JSONDecodeError, OSError) as exc:
raise SystemExit(f"error: ledger at {path} is unreadable ({exc}); run `reset` to start over")
if not isinstance(data, dict) or not isinstance(data.get("sources"), list):
@@ -20,16 +20,29 @@ from pathlib import Path
from typing import Any
from hyperstitionstud_io import __version__ as CURRENT_VERSION
from hyperstitionstud_io.config import load_workspace_config
from hyperstitionstud_io.config import load_workspace_config, normalize_workspace_relpath
def _norm_ws_path(p: Path | str, workspace_root: str | Path | None = None) -> str:
cfg = load_workspace_config(workspace_root=workspace_root)
ws_res = str(cfg.workspace_root.resolve())
s = str(Path(p).resolve())
if s.startswith(ws_res):
return "/workspace" + s[len(ws_res):]
return str(p)
FORBIDDEN_CONFLICT_SIDE_RE = re.compile(r"(?:^|\s)(?:--theirs|--ours|-X\s*(?:theirs|ours))\b")
FORBIDDEN_UNCHECKED_REBASE_RE = re.compile(r"pull\s+--rebase[^\n]*\|\|\s*true")
def validate_push_script_rebase_gating(push_txt: str) -> list[str]:
"""
Gate DEPLOY-GATE-D07.TOPO_PUSH_PARITY: Reject conflict-side resolution flags
(--theirs, --ours, -X theirs, -X ours) and unchecked pull --rebase ... || true
suppressions in push-all-to-git-libre-audio.sh.
"""
violations: list[str] = []
for m_flag in FORBIDDEN_CONFLICT_SIDE_RE.finditer(push_txt):
violations.append(
f"Gate DEPLOY-GATE-D07.TOPO_PUSH_PARITY: Forbidden conflict-side flag {m_flag.group(0).strip()!r} in push-all-to-git-libre-audio.sh"
)
for m_reb in FORBIDDEN_UNCHECKED_REBASE_RE.finditer(push_txt):
violations.append(
f"Gate DEPLOY-GATE-D07.TOPO_PUSH_PARITY: Forbidden unchecked rebase suppression {m_reb.group(0)!r} in push-all-to-git-libre-audio.sh"
)
return violations
def prepare_and_verify_deploy_scripts(
@@ -68,7 +81,7 @@ def prepare_and_verify_deploy_scripts(
else:
ws_push_sh.write_text(upd_push, encoding="utf-8")
ws_push_sh.chmod(0o755)
modified_files.append(_norm_ws_path(ws_push_sh, workspace_root=ws_root))
modified_files.append(normalize_workspace_relpath(ws_push_sh, workspace_root=ws_root))
push_txt = upd_push
tracked_txt = tracked_push_sh.read_text(encoding="utf-8") if tracked_push_sh.is_file() else ""
@@ -79,7 +92,7 @@ def prepare_and_verify_deploy_scripts(
tracked_push_sh.parent.mkdir(parents=True, exist_ok=True)
tracked_push_sh.write_text(push_txt, encoding="utf-8")
tracked_push_sh.chmod(0o755)
modified_files.append(_norm_ws_path(tracked_push_sh, workspace_root=ws_root))
modified_files.append(normalize_workspace_relpath(tracked_push_sh, workspace_root=ws_root))
elif tracked_push_sh.is_file():
push_txt = tracked_push_sh.read_text(encoding="utf-8")
upd_push = re.sub(r"^#\s*Release\s+v\d+\.\d+\.\d+:", f"# Release v{ver}:", push_txt, count=1, flags=re.M)
@@ -89,7 +102,7 @@ def prepare_and_verify_deploy_scripts(
else:
tracked_push_sh.write_text(upd_push, encoding="utf-8")
tracked_push_sh.chmod(0o755)
modified_files.append(_norm_ws_path(tracked_push_sh, workspace_root=ws_root))
modified_files.append(normalize_workspace_relpath(tracked_push_sh, workspace_root=ws_root))
push_txt = upd_push
if not check_only:
try:
@@ -116,7 +129,7 @@ def prepare_and_verify_deploy_scripts(
else:
sync_vps_sh.write_text(upd_sync, encoding="utf-8")
sync_vps_sh.chmod(0o755)
modified_files.append(_norm_ws_path(sync_vps_sh, workspace_root=ws_root))
modified_files.append(normalize_workspace_relpath(sync_vps_sh, workspace_root=ws_root))
sync_txt = upd_sync
else:
errors.append(f"Gate D1: Missing {sync_vps_sh}")
@@ -160,6 +173,24 @@ def prepare_and_verify_deploy_scripts(
if "generate_db_json.py" not in sync_txt_cur or "config.default.js" not in sync_txt_cur:
gate_d4_ok = False
errors.append("Gate D4: haiperdohp-jemaytreeah untracked artifact hydration missing in deploy/sync-vps-repos.sh")
if (
"--snapshot-telemetry" not in sync_txt_cur
or "--reconcile-telemetry" not in sync_txt_cur
or "prev_head=" not in sync_txt_cur
):
gate_d4_ok = False
errors.append(
"Gate D4: Lossless VPS telemetry snapshot/reconciliation (--snapshot-telemetry / --reconcile-telemetry) or prev_head missing in deploy/sync-vps-repos.sh"
)
if (
"closeups_sync --check" not in sync_txt_cur
or "readme_sync --hooks-only" not in sync_txt_cur
or "readme_sync --install-hooks" in sync_txt_cur
):
gate_d4_ok = False
errors.append(
"Gate D4: deploy/sync-vps-repos.sh must use read-only 'closeups_sync --check' and 'readme_sync --hooks-only' so tracked PNGs and README.md files are never dirtied on the VPS"
)
# Gate DEPLOY-GATE-D05.TAR_EXCLUSION: Cold *.tar.gz Archive Exclusion & Explicit rm -f Safety in sync-vps-repos.sh
gate_d5_ok = (
@@ -185,7 +216,7 @@ def prepare_and_verify_deploy_scripts(
if not gate_d6_ok:
errors.append("Gate D6: Single-layer compression enforcement or Caddyfile media extension parity missing")
# Gate DEPLOY-GATE-D07.TOPO_PUSH_PARITY: Topological 6-Repository Push & Force-Tag Sync Parity in push-all-to-git-libre-audio.sh
# Gate DEPLOY-GATE-D07.TOPO_PUSH_PARITY: Topological 6-Repository Push, Force-Tag Sync & Fail-Fast Rebase Parity in push-all-to-git-libre-audio.sh
required_push_markers = (
"hyperstitionstudio-core",
"ingglish-hyperdope-gematria",
@@ -196,10 +227,15 @@ def prepare_and_verify_deploy_scripts(
'push --force "${remote_name}" "refs/tags/${head_tag}"',
"build-fedora41-rpm.sh",
"run_exegesis_and_push_fedora41.sh",
"--exegesis-host",
"--exegesis-uninstall",
"--skip-exegesis-deploy",
)
gate_d7_ok = all(m in push_txt_cur for m in required_push_markers)
if not gate_d7_ok:
errors.append("Gate D7: Missing required repository, force-tag, or verification marker in push-all-to-git-libre-audio.sh")
d7_rebase_violations = validate_push_script_rebase_gating(push_txt_cur)
gate_d7_ok = all(m in push_txt_cur for m in required_push_markers) and len(d7_rebase_violations) == 0
if not all(m in push_txt_cur for m in required_push_markers):
errors.append("Gate DEPLOY-GATE-D07.TOPO_PUSH_PARITY: Missing required repository, force-tag, or verification marker in push-all-to-git-libre-audio.sh")
errors.extend(d7_rebase_violations)
# Gate DEPLOY-GATE-D08.PRE_COMMIT_STAGE: Automatic Git Staging Prior to Commit (--stage)
staged_files: list[str] = []
+2 -2
View File
@@ -10,7 +10,7 @@ import json
from pathlib import Path
from typing import Any
from hyperstitionstud_io.config import load_workspace_config
from hyperstitionstud_io.config import load_json_cached, load_workspace_config
from hyperstitionstud_io.glossary import sha256_file
from hyperstitionstud_io.publishing.fonts import resolve_font_path
@@ -55,7 +55,7 @@ def run_diagnostics(workspace_root: str | Path | None = None) -> dict[str, Any]:
}
fb_path = Path(__file__).resolve().parent.parent / "phonetics" / "cmudict_fallback.json"
fb_count = len(json.loads(fb_path.read_text(encoding="utf-8"))) if fb_path.is_file() else 0
fb_count = len(load_json_cached(fb_path, copy_result=False)) if fb_path.is_file() else 0
lr_path = cfg.core_dir / "deploy" / "logrotate.d" / "hyperstition-sqlite-meta"
lr_txt = lr_path.read_text(encoding="utf-8") if lr_path.is_file() else ""
@@ -0,0 +1,125 @@
#!/usr/bin/env python3
"""
src/hyperstitionstud_io/ci/plan_validator.py
Plan Specification & Governance Validator (`hs-plan-lint`).
Enforces PLAN-SPECIFICATION-AND-GOVERNANCE-STANDARD across docs/plans/{active,piecewise}/:
1. Mandatory companion ReportLab Dark-Mode PDF (.pdf) for every active/piecewise Markdown plan (.md).
2. Required metadata fields (Document ID, Status, Target Ecosystem Version, Target Repositories).
3. Registration in roadmap-plan-ledger.md.
4. Zero container host path serialization.
5. Shorthand disambiguation compliance (<PREFIX><NN>.<DOMAIN_TAG>).
"""
from __future__ import annotations
import argparse
import json
import re
import sys
from pathlib import Path
from typing import Any
from hyperstitionstud_io.config import load_workspace_config
REQUIRED_METADATA_KEYS = [
"Document ID",
"Status",
"Target Ecosystem Version",
"Target Repositories",
]
CONTAINER_HOST_PATH_PATTERNS = [
re.compile(r"/home/[a-zA-Z0-9_-]+/\.hermes"),
re.compile(r"/var/lib/docker"),
re.compile(r"/tmp/docker"),
]
def verify_plan_specifications(workspace_root: str | Path | None = None) -> dict[str, Any]:
cfg = load_workspace_config(workspace_root=workspace_root)
plans_dir = cfg.knowledge_graph_dir / "docs" / "plans"
active_dir = plans_dir / "active"
piecewise_dir = plans_dir / "piecewise"
active_mds = sorted([p for p in active_dir.glob("PLAN-*.md") if p.is_file()])
piecewise_mds = sorted([p for p in piecewise_dir.glob("PLAN-*.md") if p.is_file()])
all_target_mds = active_mds + piecewise_mds
ledger_candidates = [
Path.home() / ".hermes" / "skills" / "software-development" / "hyperstitionstudio-roadmap-and-release" / "references" / "roadmap-plan-ledger.md",
Path("/root/.hermes/skills/software-development/hyperstitionstudio-roadmap-and-release/references/roadmap-plan-ledger.md"),
]
ledger_text = ""
for lc in ledger_candidates:
if lc.is_file():
ledger_text = lc.read_text(encoding="utf-8")
break
missing_pdfs: list[str] = []
missing_ledger_entries: list[str] = []
metadata_errors: list[dict[str, Any]] = []
host_path_errors: list[dict[str, Any]] = []
errors: list[str] = []
for md_p in all_target_mds:
rel_p = md_p.relative_to(cfg.workspace_root).as_posix()
pdf_p = md_p.with_suffix(".pdf")
if not pdf_p.is_file():
missing_pdfs.append(rel_p)
txt = md_p.read_text(encoding="utf-8")
# Check metadata fields
missing_keys = []
for key in REQUIRED_METADATA_KEYS:
if not re.search(rf"\*\*{re.escape(key)}:\*\*", txt):
missing_keys.append(key)
if missing_keys:
metadata_errors.append({"file": rel_p, "missing_keys": missing_keys})
# Check host path leakage
for pat in CONTAINER_HOST_PATH_PATTERNS:
m = pat.search(txt)
if m:
host_path_errors.append({"file": rel_p, "leakage": m.group(0)})
# Check ledger presence if ledger is found
if ledger_text:
plan_stem = md_p.stem
if plan_stem not in ledger_text:
missing_ledger_entries.append(plan_stem)
if missing_pdfs:
errors.append(f"Missing companion Dark-Mode PDFs for: {', '.join(missing_pdfs)}")
if metadata_errors:
errors.append(f"Metadata errors: {metadata_errors}")
if host_path_errors:
errors.append(f"Host path leakage detected: {host_path_errors}")
if missing_ledger_entries:
errors.append(f"Plans missing from roadmap-plan-ledger.md: {missing_ledger_entries}")
return {
"ok": len(errors) == 0,
"active_plans_checked": len(active_mds),
"piecewise_plans_checked": len(piecewise_mds),
"total_plans_checked": len(all_target_mds),
"missing_pdfs": missing_pdfs,
"missing_ledger_entries": missing_ledger_entries,
"metadata_errors": metadata_errors,
"host_path_errors": host_path_errors,
"errors": errors,
}
def main(argv: list[str] | None = None) -> int:
ap = argparse.ArgumentParser(prog="hs-plan-lint", description="Validate active/piecewise architectural plans against governance standard.")
ap.add_argument("--workspace-root", default=None, help="Root directory of hyperstitionstud.io workspace.")
args = ap.parse_args(argv)
res = verify_plan_specifications(workspace_root=args.workspace_root)
print(json.dumps(res, indent=2))
return 0 if res["ok"] else 1
if __name__ == "__main__":
sys.exit(main())
@@ -27,7 +27,7 @@ from pathlib import Path
from typing import Any
from hyperstitionstud_io import __version__ as CURRENT_VERSION
from hyperstitionstud_io.config import load_workspace_config
from hyperstitionstud_io.config import load_json_cached, load_workspace_config
from hyperstitionstud_io.glossary import sha256_file
from hyperstitionstud_io.ipld import compute_dag_json_cidv1
from hyperstitionstud_io.mcp.tools import MCP_TOOLS_SCHEMA
@@ -60,9 +60,7 @@ def _resolve_web_route_to_disk(route: str, cfg: Any) -> Path:
core = cfg.core_dir
zoo = cfg.zoology_dir
kg = cfg.knowledge_graph_dir
ci = cfg.paths.get("ci_build_dir") or (cfg.workspace_root / "hyperdope-ci-build")
if not ci.is_dir() and (cfg.workspace_root / "ingglish-hyperdope-ci").is_dir():
ci = cfg.workspace_root / "ingglish-hyperdope-ci"
ci = cfg.ci_build_dir
if route == "/":
return core / "site" / "index.html"
@@ -93,10 +91,10 @@ def build_internal_test_baseline_snapshot(workspace_root: str | Path | None = No
brf_p = cfg.core_dir / "site" / "quant" / "daily-brief-latest.json"
kg_p = cfg.knowledge_graph_dir / "encyclopedia-graph.json"
ts_obj = json.loads(ts_p.read_text(encoding="utf-8"))
mac_obj = json.loads(mac_p.read_text(encoding="utf-8"))
brf_obj = json.loads(brf_p.read_text(encoding="utf-8"))
kg_obj = json.loads(kg_p.read_text(encoding="utf-8"))
ts_obj = load_json_cached(ts_p, copy_result=False)
mac_obj = load_json_cached(mac_p, copy_result=False)
brf_obj = load_json_cached(brf_p, copy_result=False)
kg_obj = load_json_cached(kg_p, copy_result=False)
nvda_inst = next(i for i in ts_obj["instruments"] if i["symbol"] == "NVDA")
nvda_nov27 = next(b for b in nvda_inst["bars"] if b["date_utc"] == "2026-11-27")
@@ -206,7 +204,7 @@ def run_public_regression_suite(
bp = Path(baseline_path) if baseline_path else get_default_baseline_cache_path()
if bp.is_file():
baseline = json.loads(bp.read_text(encoding="utf-8"))
baseline = load_json_cached(bp, copy_result=False)
else:
baseline = build_internal_test_baseline_snapshot()
+4 -2
View File
@@ -17,6 +17,8 @@ from dataclasses import dataclass, field
from pathlib import Path
from typing import Any
from hyperstitionstud_io import __version__ as _PKG_VERSION
CORE_REPO_ROOT = Path(__file__).resolve().parents[3]
WORKSPACE_ROOT = CORE_REPO_ROOT.parent
USER_WORKSPACE_TOML = Path.home() / ".config" / "hyperstitionstud.io" / "workspace.toml"
@@ -173,7 +175,7 @@ def load_json_cached(path: str | Path, *, copy_result: bool = True) -> Any:
@dataclass(frozen=True)
class WorkspaceConfig:
schema_version: str = "1.2.0"
schema_version: str = _PKG_VERSION
namespace_urn: str = "urn:io:hyperstitionstud"
workspace_root: Path = WORKSPACE_ROOT
paths: dict[str, Path] = field(default_factory=dict)
@@ -288,7 +290,7 @@ def load_workspace_config(
resolved_mounts = {str(_rebase_path(k, ws_root)): str(v) for k, v in raw_cit.items()}
return WorkspaceConfig(
schema_version=str(raw.get("schema_version", "1.2.0")),
schema_version=str(raw.get("schema_version", _PKG_VERSION)),
namespace_urn=str(raw.get("namespace_urn", "urn:io:hyperstitionstud")),
workspace_root=ws_root,
paths=resolved_paths,
+4 -4
View File
@@ -36,7 +36,7 @@ if _SRC_DIR.is_dir() and str(_SRC_DIR) not in sys.path:
sys.path.insert(0, str(_SRC_DIR))
from hyperstitionstud_io import __version__ as CURRENT_VERSION # noqa: E402
from hyperstitionstud_io.config import load_workspace_config # noqa: E402
from hyperstitionstud_io.config import load_json_cached, load_workspace_config # noqa: E402
from hyperstitionstud_io.glossary import ReadOnlyIsolationGuard # noqa: E402
from hyperstitionstud_io.ipld import compute_dag_json_cidv1 # noqa: E402
from hyperstitionstud_io.quant.timeseries import build_quant_timeseries_bundle # noqa: E402
@@ -403,7 +403,7 @@ def build_catalog_sqlite_db(db_path: Path | str | None = None) -> dict[str, Any]
# 2. Glossary Entries & Bilingual Specimens
gl_path = cfg.zoology_dir / "taxonomy" / "glossary-registry.json"
gl_data = json.loads(gl_path.read_text(encoding="utf-8"))
gl_data = load_json_cached(gl_path, copy_result=False)
seen_terms: set[str] = set()
glossary_rows = 0
@@ -500,7 +500,7 @@ def build_catalog_sqlite_db(db_path: Path | str | None = None) -> dict[str, Any]
# 3. Knowledge Graph Nodes & Edges
kg_path = cfg.knowledge_graph_dir / "encyclopedia-graph.json"
kg_data = json.loads(kg_path.read_text(encoding="utf-8"))
kg_data = load_json_cached(kg_path, copy_result=False)
deg_map: dict[str, int] = {}
edge_rows = 0
for e in kg_data.get("edges", []):
@@ -619,7 +619,7 @@ def build_catalog_sqlite_db(db_path: Path | str | None = None) -> dict[str, Any]
# 5. Periodic Quantitative Financial Time-Series Bars (24 Tickers x 30 UTC Days = 720 bars)
ts_path = cfg.core_dir / "site" / "quant" / "quant-timeseries.json"
if ts_path.is_file():
ts_bundle = json.loads(ts_path.read_text(encoding="utf-8"))
ts_bundle = load_json_cached(ts_path, copy_result=False)
else:
ts_bundle = build_quant_timeseries_bundle(write_files=False)
+4 -4
View File
@@ -187,7 +187,7 @@ MCP_TOOLS_SCHEMA: list[dict[str, Any]] = [
"inputSchema": {
"type": "object",
"properties": {
"harvest_mode": {"type": "string", "enum": ["us-closing-bell", "utc-rollover"], "default": "us-closing-bell"},
"harvest_mode": {"type": "string", "enum": ["us-pre-market-open", "us-closing-bell", "utc-rollover"], "default": "us-closing-bell"},
"symbol_filter": {"type": "string", "default": "", "description": "Optional ticker symbol filter (e.g. 'NVDA', 'ASML', 'BTC-USD')."},
},
},
@@ -683,7 +683,7 @@ def call_mcp_tool(name: str, arguments: dict[str, Any]) -> dict[str, Any]:
b_path = cfg.core_dir / "site" / "quant" / "daily-brief-latest.json"
if bool(arguments.get("refresh")) or not b_path.is_file():
return build_daily_portfolio_brief(allow_live_network=False, write_files=False)
return load_json_cached(b_path)
return load_json_cached(b_path, copy_result=False)
if name == "hs_inspect_engineering_and_math_docs":
from hyperstitionstud_io.publishing.engineering_docs import (
@@ -760,7 +760,7 @@ def call_mcp_tool(name: str, arguments: dict[str, Any]) -> dict[str, Any]:
{
"id": "ONBOARDING-INGGLISH-AQ",
"category": "manuals",
"md_path": (cfg.paths.get("ci_repo_dir") or (cfg.workspace_root / "hyperdope-ci-build")) / "ONBOARDING-INGGLISH-AQ.md",
"md_path": cfg.ci_build_dir / "ONBOARDING-INGGLISH-AQ.md",
"web_pdf_route": "/ci/ONBOARDING-INGGLISH-AQ.pdf",
},
{
@@ -1036,7 +1036,7 @@ def call_mcp_tool(name: str, arguments: dict[str, Any]) -> dict[str, Any]:
if inc_base:
bp = get_default_baseline_cache_path()
if bp.is_file():
b_obj = json.loads(bp.read_text(encoding="utf-8"))
b_obj = load_json_cached(bp, copy_result=False)
out_cat["internal_test_baseline"] = {
"expected_version": b_obj.get("expected_version"),
"expected_mcp_tool_count": b_obj.get("expected_mcp_tool_count"),
@@ -32,7 +32,7 @@ from pathlib import Path
from typing import Any
from hyperstitionstud_io import __version__ as CURRENT_VERSION
from hyperstitionstud_io.config import load_json_cached, load_workspace_config
from hyperstitionstud_io.config import load_json_cached, load_workspace_config, normalize_workspace_relpath
from hyperstitionstud_io.db.sqlite_meta import ensure_single_layer_gzip_file, parse_size_spec_bytes
from hyperstitionstud_io.glossary import ReadOnlyIsolationGuard, sha256_file
from hyperstitionstud_io.ipld import compute_dag_json_cidv1
@@ -47,15 +47,6 @@ INACTIVE_MANIFEST_FILENAME = "inactive-archive-manifest.json"
DEFAULT_MAX_ARCHIVE_BUNDLE_BYTES = 256 * 1024 # 262,144 bytes (256 KB)
def _norm_ws_path(p: Path | str, workspace_root: str | Path | None = None) -> str:
cfg = load_workspace_config(workspace_root=workspace_root)
ws_res = str(cfg.workspace_root.resolve())
s = str(Path(p).resolve())
if s.startswith(ws_res):
return "/workspace" + s[len(ws_res):]
return str(p)
def assert_not_gematria_pipeline_source(target_path: str | Path, workspace_root: str | Path | None = None) -> Path:
"""
Hard programmatic block guaranteeing that NO file supplying any gematria, phonemic,
@@ -571,7 +562,7 @@ def _load_existing_manifest_maps(manifest_p: Path) -> tuple[dict[str, dict[str,
existing_manifest: dict[str, Any] = {}
if manifest_p.is_file():
try:
existing_manifest = load_json_cached(manifest_p)
existing_manifest = load_json_cached(manifest_p, copy_result=False)
except Exception:
existing_manifest = {}
@@ -690,8 +681,8 @@ def rotate_docs_archive_directory(
staged_files = sorted(p for p in stage_dir.iterdir() if p.is_file() and p.suffix == ".md")
if not staged_files and not long_term_by_name:
return {
"archive_dir": _norm_ws_path(arc_p),
"bundle_path": _norm_ws_path(bundle_p),
"archive_dir": normalize_workspace_relpath(arc_p),
"bundle_path": normalize_workspace_relpath(bundle_p),
"member_count": 0,
"rotated_loose_files": 0,
"preserved_standalone_pdfs": preserved_standalone_pdfs,
@@ -720,9 +711,9 @@ def rotate_docs_archive_directory(
lp.unlink()
return {
"archive_dir": _norm_ws_path(arc_p),
"bundle_path": _norm_ws_path(bundle_p),
"manifest_path": _norm_ws_path(manifest_p),
"archive_dir": normalize_workspace_relpath(arc_p),
"bundle_path": normalize_workspace_relpath(bundle_p),
"manifest_path": normalize_workspace_relpath(manifest_p),
"manifest_dag_json_cid": manifest_cid,
"max_bundle_bytes": eff_max_bytes,
"bundle_size_bytes": bundle_p.stat().st_size,
@@ -815,8 +806,8 @@ def rotate_inactive_plans_marked_for_archival(
if not staged_files and not long_term_by_name:
return {
"ok": True,
"inactive_dir": _norm_ws_path(inactive_dir, workspace_root=workspace_root),
"bundle_path": _norm_ws_path(bundle_p, workspace_root=workspace_root),
"inactive_dir": normalize_workspace_relpath(inactive_dir, workspace_root=workspace_root),
"bundle_path": normalize_workspace_relpath(bundle_p, workspace_root=workspace_root),
"member_count": 0,
"rotated_loose_files": 0,
"retained_inactive_plans": retained_inactive_plans,
@@ -843,9 +834,9 @@ def rotate_inactive_plans_marked_for_archival(
return {
"ok": True,
"version": CURRENT_VERSION,
"inactive_dir": _norm_ws_path(inactive_dir, workspace_root=workspace_root),
"bundle_path": _norm_ws_path(bundle_p, workspace_root=workspace_root),
"manifest_path": _norm_ws_path(manifest_p, workspace_root=workspace_root),
"inactive_dir": normalize_workspace_relpath(inactive_dir, workspace_root=workspace_root),
"bundle_path": normalize_workspace_relpath(bundle_p, workspace_root=workspace_root),
"manifest_path": normalize_workspace_relpath(manifest_p, workspace_root=workspace_root),
"manifest_dag_json_cid": manifest_cid,
"bundle_size_bytes": bundle_p.stat().st_size,
"bundle_sha256": bundle_sha,
@@ -949,7 +940,7 @@ def audit_and_fix_multi_compressed_files(
cfg.zoology_dir,
cfg.knowledge_graph_dir,
cfg.paths["gematria_js_dir"],
cfg.paths.get("ci_repo_dir", cfg.workspace_root / "hyperdope-ci-build"),
cfg.ci_build_dir,
]
for ed in extra_dirs or []:
ep = Path(ed)
@@ -981,10 +972,10 @@ def audit_and_fix_multi_compressed_files(
fp.unlink()
else:
fp.rename(base_p)
removed_double_sidecars.append(_norm_ws_path(fp, workspace_root=workspace_root))
removed_double_sidecars.append(normalize_workspace_relpath(fp, workspace_root=workspace_root))
continue
else:
removed_double_sidecars.append(_norm_ws_path(fp, workspace_root=workspace_root))
removed_double_sidecars.append(normalize_workspace_relpath(fp, workspace_root=workspace_root))
if fn.endswith((".gz", ".tgz")):
scanned_gz_count += 1
@@ -996,7 +987,7 @@ def audit_and_fix_multi_compressed_files(
if head.startswith((b"\x1f\x8b", b"\xfd7zXZ\x00")):
if fix:
ensure_single_layer_gzip_file(fp)
peeled_gzip_files.append(_norm_ws_path(fp, workspace_root=workspace_root))
peeled_gzip_files.append(normalize_workspace_relpath(fp, workspace_root=workspace_root))
if fn.endswith((".tar.gz", ".tgz", ".tar.xz")):
scanned_tar_count += 1
@@ -1025,12 +1016,12 @@ def audit_and_fix_multi_compressed_files(
elif bad_members and fix and fn.startswith("ingglish-isopsephic-exegesis-") and fn.endswith((".tar.gz", ".tar.xz")):
# Remove legacy 2x-compressed packaging wrapper if still present in an unpulled/live directory
fp.unlink()
removed_double_sidecars.append(_norm_ws_path(fp, workspace_root=workspace_root))
removed_double_sidecars.append(normalize_workspace_relpath(fp, workspace_root=workspace_root))
bad_members = []
if bad_members:
nested_archive_violations.append(
{
"archive": _norm_ws_path(fp, workspace_root=workspace_root),
"archive": normalize_workspace_relpath(fp, workspace_root=workspace_root),
"nested_compressed_members": bad_members,
}
)
@@ -1150,7 +1141,7 @@ def main(argv: list[str] | None = None) -> int:
):
mp = d / mf
if mp.is_file():
out[_norm_ws_path(d, workspace_root=args.workspace_root)] = load_json_cached(mp)
out[normalize_workspace_relpath(d, workspace_root=args.workspace_root)] = load_json_cached(mp, copy_result=False)
print(json.dumps(out, indent=2))
return 0
@@ -30,12 +30,15 @@ from typing import Any
from PIL import Image, ImageDraw
from hyperstitionstud_io import __version__ as CURRENT_VERSION
from hyperstitionstud_io.config import load_json_cached, load_workspace_config
from hyperstitionstud_io.config import count_file_lines_cached, load_json_cached, load_workspace_config
from hyperstitionstud_io.glossary import ReadOnlyIsolationGuard
from hyperstitionstud_io.ipld import compute_dag_json_cidv1
from hyperstitionstud_io.publishing.fonts import (
GROUP3_PALETTE,
draw_bounded_box_text,
draw_bounded_kv_row,
draw_group3_chamfered_plate,
fit_pillow_text_to_width,
load_pillow_font,
)
@@ -126,17 +129,15 @@ def _fit_font_for_width(
min_size: int = 8,
bold: bool = False,
) -> tuple[Any, int, int]:
font_file = FONT_MONO_B if bold else FONT_MONO
for sz in range(preferred_size, min_size - 1, -1):
f = _fnt(font_file, sz)
tb = d.textbbox((0, 0), text, font=f)
w = int(tb[2] - tb[0])
h = int(tb[3] - tb[1])
if w <= max_width:
return f, w, h
f = _fnt(font_file, min_size)
tb = d.textbbox((0, 0), text, font=f)
return f, int(tb[2] - tb[0]), int(tb[3] - tb[1])
return fit_pillow_text_to_width(
d,
text,
max_width,
preferred_size=preferred_size,
min_size=min_size,
bold=bold,
font_filename=FONT_MONO_B if bold else FONT_MONO,
)
def _draw_box_text(
@@ -152,18 +153,19 @@ def _draw_box_text(
bold: bool = False,
y_pos: int | None = None,
) -> tuple[int, int, int, int]:
bx1, by1, bx2, by2 = box
avail_w = max(16, (bx2 - bx1) - 2 * pad_x)
f, tw, th = _fit_font_for_width(d, text, avail_w, preferred_size=preferred_size, min_size=min_size, bold=bold)
if align == "center":
tx = bx1 + max(pad_x, ((bx2 - bx1) - tw) // 2)
elif align == "right":
tx = max(bx1 + pad_x, bx2 - pad_x - tw)
else:
tx = bx1 + pad_x
ty = y_pos if y_pos is not None else (by1 + max(2, ((by2 - by1) - th) // 2 - 1))
d.text((tx, ty), text, font=f, fill=fill)
return d.texts[-1][2]
return draw_bounded_box_text(
d,
box,
text,
fill,
pad_x=pad_x,
align=align,
preferred_size=preferred_size,
min_size=min_size,
bold=bold,
y_pos=y_pos,
font_filename=FONT_MONO_B if bold else FONT_MONO,
)
def _draw_kv_row(
@@ -181,22 +183,20 @@ def _draw_kv_row(
val_bold: bool = False,
min_val_x: int | None = None,
) -> None:
bx1, by1, bx2, by2 = box
d.rectangle([bx1, by1, bx2, by2], fill=fill_bg, outline=outline)
total_inner = (bx2 - bx1) - 16
kf, kw, kh = _fit_font_for_width(d, key_text, max(40, int(total_inner * 0.52)), preferred_size=key_size, min_size=8, bold=True)
ky = by1 + max(2, ((by2 - by1) - kh) // 2 - 1)
kx = bx1 + 8
d.text((kx, ky), key_text, font=kf, fill=key_fill)
key_tb = d.texts[-1][2]
vx_start = max(key_tb[2] + 8, min_val_x if min_val_x is not None else (key_tb[2] + 10))
avail_val_w = max(24, (bx2 - 6) - vx_start)
vf, vw, vh = _fit_font_for_width(d, val_text, avail_val_w, preferred_size=val_size, min_size=8, bold=val_bold)
if vx_start + vw > bx2 - 6:
vx_start = max(key_tb[2] + 6, (bx2 - 6) - vw)
vy = by1 + max(2, ((by2 - by1) - vh) // 2 - 1)
d.text((vx_start, vy), val_text, font=vf, fill=val_fill)
draw_bounded_kv_row(
d,
box,
key_text,
val_text,
fill_bg=fill_bg,
outline=outline,
key_fill=key_fill,
val_fill=val_fill,
key_size=key_size,
val_size=val_size,
val_bold=val_bold,
min_val_x=min_val_x,
)
def verify_closeup_geometry(tracked_by_filename: dict[str, _TrackedCanvasDraw]) -> dict[str, Any]:
@@ -348,7 +348,7 @@ def introspect_live_ui_elements(workspace_root: str | Path | None = None) -> dic
core = cfg.core_dir
kg = cfg.knowledge_graph_dir
calc_dir = cfg.paths["gematria_js_dir"]
ci_dir = cfg.paths.get("ci_repo_dir") or (cfg.workspace_root / "hyperdope-ci-build")
ci_dir = cfg.ci_build_dir
surfaces: dict[str, Path] = {
"home": core / "site" / "index.html",
@@ -408,7 +408,7 @@ def introspect_live_ui_elements(workspace_root: str | Path | None = None) -> dic
}
db_txt_p = calc_dir / "db.txt"
db_entries_count = sum(1 for _ in db_txt_p.open(encoding="utf-8")) if db_txt_p.is_file() else 231615
db_entries_count = count_file_lines_cached(db_txt_p) if db_txt_p.is_file() else 231615
ci_rep_p = ci_dir / "ci-audit-report.json"
ci_obj = load_json_cached(ci_rep_p, copy_result=False) if ci_rep_p.is_file() else {}
@@ -419,8 +419,6 @@ def introspect_live_ui_elements(workspace_root: str | Path | None = None) -> dic
"layout_engine": "bounded_box_v2_plan61",
"surfaces": {k: v["ui_structure_sha256"] for k, v in sorted(surface_sigs.items())},
"js_surfaces": {k: v["js_ui_sha256"] for k, v in sorted(js_sigs.items())},
"total_bars": total_bars,
"db_entries_count": db_entries_count,
"mcp_tools": eng_counts.get("mcp_tools", 20),
},
sort_keys=True,
@@ -488,7 +486,7 @@ def render_all_quadrant_closeups(
prev_fp = ""
if manifest_path.is_file():
try:
prev_obj = json.loads(manifest_path.read_text(encoding="utf-8"))
prev_obj = load_json_cached(manifest_path, copy_result=False)
prev_fp = prev_obj.get("ui_elements_fingerprint_sha256", "")
except Exception:
prev_fp = ""
@@ -839,7 +837,7 @@ def render_all_quadrant_closeups(
_draw_chamfer_box(d, (24, 46, 334, 240), WELL, CYAN, chamfer=8, pip=CYAN)
d.text((38, 56), "TS TypeScript (Strict ESM AST)", font=f_mono_b, fill=CYAN)
ts_lines = [
"export const charAq = (c: string): number =>",
"export const charAq = (c: string) =>",
" /[0-9]/.test(c) ? c.charCodeAt(0) - 48",
" : c.charCodeAt(0) - 55;",
"",
@@ -850,7 +848,8 @@ def render_all_quadrant_closeups(
]
for idx, ln in enumerate(ts_lines):
col = EMERALD if ln.startswith("//") else (TEXT if "=>" not in ln else GOLD)
d.text((38, 84 + idx * 18), ln, font=f_mono_xs, fill=col)
f_ts, _, _ = _fit_font_for_width(d, ln, 286, preferred_size=10, min_size=7)
d.text((38, 84 + idx * 18), ln, font=f_ts, fill=col)
_draw_chamfer_box(d, (346, 46, 656, 240), WELL, ROSE, chamfer=8, pip=ROSE)
d.text((360, 56), "Rs Rust (Zero-Alloc Iterator AST)", font=f_mono_b, fill=ROSE)
rs_lines = [
@@ -865,7 +864,8 @@ def render_all_quadrant_closeups(
]
for idx, ln in enumerate(rs_lines):
col = EMERALD if ln.startswith("//") else TEXT
d.text((360, 84 + idx * 18), ln, font=f_mono_xs, fill=col)
f_rs, _, _ = _fit_font_for_width(d, ln, 286, preferred_size=10, min_size=7)
d.text((360, 84 + idx * 18), ln, font=f_rs, fill=col)
im.save(out_dir / "quadrant-3-tab-3-math-ts-rust.png", "PNG")
tracked_draws["quadrant-3-tab-3-math-ts-rust.png"] = d
@@ -9,6 +9,7 @@ clamping (`breach_count == 0`).
from __future__ import annotations
import hashlib
import json
import os
from pathlib import Path
@@ -20,6 +21,7 @@ from hyperstitionstud_io.publishing.fonts import (
GROUP3_PALETTE,
chamfer_polygon_points as _chamfer_pts,
draw_group3_chamfered_plate as _draw_group3_plate,
fit_pillow_text_to_width,
load_pillow_font,
)
@@ -55,18 +57,48 @@ def _draw_arrow_right(draw: Any, x0: int, x1: int, y: int, color: tuple[int, int
draw.polygon([(x1 - 10, y - 5), (x1 - 10, y + 5), (x1, y)], fill=color)
def _compute_flow_diagram_sha256() -> str:
src_bytes = Path(__file__).resolve().read_bytes()
h = hashlib.sha256()
h.update(f"v{CURRENT_VERSION}:{DIAGRAM_WIDTH}x{DIAGRAM_HEIGHT}:".encode("utf-8"))
h.update(src_bytes)
return h.hexdigest()
def render_periodic_harvest_cicd_flow_diagram_png(
output_path: str | Path | None = None,
*,
if_changed: bool = True,
) -> dict[str, Any]:
"""
Render the 5-Stage End-to-End Periodic Data Harvest -> CI/CD -> Deployed VPS Infrastructure Flow Diagram
to `/workspace/encyclopedia-knowledge-graph/docs/periodic-harvest-cicd-to-vps-flow-diagram.png`.
When `if_changed=True` and the existing PNG embeds a matching `hs_diagram_sha256` tEXt chunk,
skips rewriting the file.
"""
from PIL import Image, ImageDraw
from PIL.PngImagePlugin import PngInfo
cfg = load_workspace_config()
out_p = Path(output_path) if output_path else (cfg.knowledge_graph_dir / "docs" / "periodic-harvest-cicd-to-vps-flow-diagram.png")
out_p = out_p.resolve()
diagram_sha256 = _compute_flow_diagram_sha256()
if if_changed and out_p.is_file():
try:
with Image.open(out_p) as existing_im:
if existing_im.info.get("hs_diagram_sha256") == diagram_sha256:
return {
"png_path": str(out_p),
"dimensions": [DIAGRAM_WIDTH, DIAGRAM_HEIGHT],
"size_bytes": out_p.stat().st_size,
"breach_count": 0,
"skipped_unchanged": True,
"hs_diagram_sha256": diagram_sha256,
}
except Exception:
pass
out_p.parent.mkdir(parents=True, exist_ok=True)
tmp_p = out_p.with_suffix(f".tmp.{os.getpid()}.png")
@@ -381,13 +413,17 @@ def render_periodic_harvest_cicd_flow_diagram_png(
fit_text(bbox[0] + 12, ly, ln, TXT_PRI, [f_m11, f_m10], max_x=bbox[2] - 10)
ly += 20
img.save(tmp_p, format="PNG")
pnginfo = PngInfo()
pnginfo.add_text("hs_diagram_sha256", diagram_sha256)
img.save(tmp_p, format="PNG", pnginfo=pnginfo)
os.replace(tmp_p, out_p)
return {
"png_path": str(out_p),
"dimensions": [DIAGRAM_WIDTH, DIAGRAM_HEIGHT],
"size_bytes": out_p.stat().st_size,
"breach_count": breach_count,
"skipped_unchanged": False,
"hs_diagram_sha256": diagram_sha256,
}
@@ -20,7 +20,7 @@ from pathlib import Path
from typing import Any
from hyperstitionstud_io import __version__ as CURRENT_VERSION
from hyperstitionstud_io.config import load_workspace_config
from hyperstitionstud_io.config import load_json_cached, load_workspace_config
from hyperstitionstud_io.glossary import ReadOnlyIsolationGuard
from hyperstitionstud_io.ipld import compute_dag_json_cidv1
from hyperstitionstud_io.mcp.tools import MCP_TOOLS_SCHEMA
@@ -44,7 +44,7 @@ def compute_corpus_delta_report(workspace_root: str | Path | None = None) -> dic
prior_snap = cur_snap
if cache_p.is_file():
try:
prior_snap = json.loads(cache_p.read_text(encoding="utf-8"))
prior_snap = load_json_cached(cache_p, copy_result=False)
except Exception:
prior_snap = cur_snap
@@ -639,9 +639,7 @@ def discover_web_and_repo_pdf_pairs(workspace_root: str | Path | None = None) ->
core = cfg.core_dir
zoo = cfg.zoology_dir
kg = cfg.knowledge_graph_dir
ci = cfg.paths.get("ci_build_dir") or (cfg.workspace_root / "hyperdope-ci-build")
if not ci.is_dir() and (cfg.workspace_root / "ingglish-hyperdope-ci").is_dir():
ci = cfg.workspace_root / "ingglish-hyperdope-ci"
ci = cfg.ci_build_dir
web_surfaces = [
core / "site" / "index.html",
@@ -39,7 +39,7 @@ from pathlib import Path
from typing import Any
from hyperstitionstud_io import __version__ as CURRENT_VERSION
from hyperstitionstud_io.config import load_workspace_config
from hyperstitionstud_io.config import load_json_cached, load_workspace_config
from hyperstitionstud_io.glossary import ReadOnlyIsolationGuard
from hyperstitionstud_io.phonetics import translate_batch
@@ -393,7 +393,7 @@ def build_quant_tour_voice_assets(
prev_clips_by_id: dict[str, dict[str, Any]] = {}
if not force and manifest_p.is_file():
try:
prev_man = json.loads(manifest_p.read_text(encoding="utf-8"))
prev_man = load_json_cached(manifest_p, copy_result=False)
for c_item in prev_man.get("clips") or []:
cid = str(c_item.get("clip_id") or "")
if cid and (target_dir / f"{cid}.wav").is_file():
@@ -34,7 +34,7 @@ if _SRC_DIR.is_dir() and str(_SRC_DIR) not in sys.path:
sys.path.insert(0, str(_SRC_DIR))
from hyperstitionstud_io import __version__ as CURRENT_VERSION # noqa: E402
from hyperstitionstud_io.config import load_workspace_config # noqa: E402
from hyperstitionstud_io.config import load_workspace_config, resolve_workspace_repo_dir, run_git_stdout # noqa: E402
STATUS_START = "<!-- HS-COMMIT-STATUS:START -->"
STATUS_END = "<!-- HS-COMMIT-STATUS:END -->"
@@ -73,29 +73,8 @@ REPO_SPECS: dict[str, dict[str, str]] = {
}
def _git_out(repo_dir: Path, args: list[str], strip_leading: bool = True) -> str:
try:
res = subprocess.run(
["git", "-C", str(repo_dir), *args],
capture_output=True,
text=True,
timeout=5,
check=False,
)
if res.returncode == 0:
return res.stdout.strip() if strip_leading else res.stdout.rstrip("\r\n")
except Exception:
pass
return ""
def _resolve_repo_dir(ws_root: Path, repo_key: str) -> Path:
cand = ws_root / repo_key
if cand.is_dir():
return cand
if repo_key == "hyperdope-ci-build" and (ws_root / "ingglish-hyperdope-ci").is_dir():
return ws_root / "ingglish-hyperdope-ci"
return cand
return resolve_workspace_repo_dir(ws_root, repo_key)
def _introspect_repo_commit_context(repo_dir: Path, version: str) -> dict[str, Any]:
@@ -111,11 +90,11 @@ def _introspect_repo_commit_context(repo_dir: Path, version: str) -> dict[str, A
}
# Check staged files first (for pre-commit hook)
staged_raw = _git_out(repo_dir, ["diff", "--cached", "--name-only"])
staged_raw = run_git_stdout(repo_dir, ["diff", "--cached", "--name-only"])
staged = [ln.strip() for ln in staged_raw.splitlines() if ln.strip() and ln.strip() != "README.md"]
# Check working-tree modified files next (preserve leading status column on line 1!)
status_raw = _git_out(repo_dir, ["status", "--porcelain"], strip_leading=False)
status_raw = run_git_stdout(repo_dir, ["status", "--porcelain"], strip_leading=False)
dirty: list[str] = []
for ln in status_raw.splitlines():
if not ln.strip():
@@ -124,7 +103,7 @@ def _introspect_repo_commit_context(repo_dir: Path, version: str) -> dict[str, A
if p and p != "README.md" and not p.startswith("untracked/"):
dirty.append(p)
head_files_raw = _git_out(repo_dir, ["diff-tree", "--no-commit-id", "--name-only", "-r", "HEAD"])
head_files_raw = run_git_stdout(repo_dir, ["diff-tree", "--no-commit-id", "--name-only", "-r", "HEAD"])
head_files = [ln.strip() for ln in head_files_raw.splitlines() if ln.strip() and ln.strip() != "README.md"]
active_files = staged if staged else (dirty if dirty else head_files)
@@ -493,8 +472,8 @@ def sync_all_repo_readmes(
PRE_COMMIT_HOOK_SCRIPT = """#!/usr/bin/env bash
# Auto-installed by hyperstitionstud_io.publishing.readme_sync (hs-readme-sync --install-hooks)
# Prepares & validates push-all-to-git-libre-audio.sh and deploy/sync-vps-repos.sh (Gates D1-D8),
# re-renders homepage UI closeups when page UI elements change, and synchronizes root README.md before every commit.
# Path-aware pre-commit hook: runs deploy_scripts_sync & closeups_sync only when staged files
# affect their respective surfaces, and synchronizes root README.md + shorthand_lint before every commit.
set -euo pipefail
REPO_ROOT="$(git rev-parse --show-toplevel)"
@@ -502,19 +481,31 @@ REPO_NAME="$(basename "${REPO_ROOT}")"
WS_ROOT="$(cd "${REPO_ROOT}/.." && pwd)"
CORE_SRC="${WS_ROOT}/hyperstitionstudio-core/src"
PYTHON_BIN="python3"
if [[ -x "${WS_ROOT}/.venv/bin/python3" ]]; then
PYTHON_BIN="${WS_ROOT}/.venv/bin/python3"
elif [[ -x "${WS_ROOT}/hyperstitionstudio-core/.venv/bin/python3" ]]; then
PYTHON_BIN="${WS_ROOT}/hyperstitionstudio-core/.venv/bin/python3"
fi
if [[ -d "${CORE_SRC}" ]]; then
export PYTHONPATH="${CORE_SRC}${PYTHONPATH:+:${PYTHONPATH}}"
STAGED_FILES="$(git -C "${REPO_ROOT}" diff --cached --name-only || true)"
if [[ "${REPO_NAME}" == "hyperstitionstudio-core" ]]; then
python3 -m hyperstitionstud_io.ci.deploy_scripts_sync --workspace-root "${WS_ROOT}" --stage
else
python3 -m hyperstitionstud_io.ci.deploy_scripts_sync --workspace-root "${WS_ROOT}"
if printf '%s\n' "${STAGED_FILES}" | grep -Eq '^(deploy/|pyproject\\.toml|src/hyperstitionstud_io/__init__\\.py)'; then
"${PYTHON_BIN}" -m hyperstitionstud_io.ci.deploy_scripts_sync --workspace-root "${WS_ROOT}" --stage
else
"${PYTHON_BIN}" -m hyperstitionstud_io.ci.deploy_scripts_sync --workspace-root "${WS_ROOT}" --check
fi
fi
python3 -m hyperstitionstud_io.publishing.closeups_sync
if [[ -d "${WS_ROOT}/hyperstitionstudio-core/site/assets/closeups" ]] && [[ "${REPO_NAME}" == "hyperstitionstudio-core" ]]; then
git -C "${REPO_ROOT}" add site/assets/closeups/
if printf '%s\n' "${STAGED_FILES}" | grep -Eq '(^site/|^index\\.html$|^config\\.default\\.js$|^ci-audit-report\\.json$|^src/hyperstitionstud_io/(publishing|quant)/)'; then
"${PYTHON_BIN}" -m hyperstitionstud_io.publishing.closeups_sync
if [[ -d "${WS_ROOT}/hyperstitionstudio-core/site/assets/closeups" ]] && [[ "${REPO_NAME}" == "hyperstitionstudio-core" ]]; then
git -C "${REPO_ROOT}" add site/assets/closeups/
fi
fi
python3 -m hyperstitionstud_io.publishing.readme_sync --repo "${REPO_NAME}" --stage
python3 -m hyperstitionstud_io.ci.shorthand_lint --staged-diff --repo "${REPO_ROOT}"
"${PYTHON_BIN}" -m hyperstitionstud_io.publishing.readme_sync --repo "${REPO_NAME}" --stage
"${PYTHON_BIN}" -m hyperstitionstud_io.ci.shorthand_lint --staged-diff --repo "${REPO_ROOT}"
fi
"""
+477 -73
View File
@@ -20,6 +20,7 @@ import datetime
import io
import json
import os
import re
import sys
import time
import urllib.parse
@@ -38,7 +39,7 @@ from hyperstitionstud_io.ciphers import ( # noqa: E402
is_repdigit_37,
prime_rank,
)
from hyperstitionstud_io.config import load_workspace_config # noqa: E402
from hyperstitionstud_io.config import load_json_cached, load_workspace_config # noqa: E402
from hyperstitionstud_io.glossary import ReadOnlyIsolationGuard # noqa: E402
from hyperstitionstud_io.ipld import ( # noqa: E402
compute_dag_json_cidv1,
@@ -166,12 +167,37 @@ _EQ_CLOSURES_333: dict[int, list[str]] = {
}
def _fetch_yahoo_chart(symbol: str, timeout: float = 6.0) -> dict[str, Any] | None:
"""Source 1: Keyless Yahoo Finance v8 Chart JSON API (using actual prior trading day close)."""
MIN_SCOPE_DATE_UTC = "2026-11-01"
def latest_completed_closing_bell_date_utc(now_utc: datetime.datetime | None = None) -> str:
"""
Return the latest UTC calendar date `YYYY-MM-DD` whose 16:00 EST / 21:00 UTC
US closing bell has completed. Before 21:00 UTC on day T, the latest completed
closing-bell session date is T - 1 day; at or after 21:00 UTC on day T, it is T.
"""
dt = now_utc or datetime.datetime.now(datetime.timezone.utc)
if dt.hour < 21:
dt = dt - datetime.timedelta(days=1)
return dt.strftime("%Y-%m-%d")
def _fetch_yahoo_chart_series(
symbol: str,
min_date_utc: str | None = MIN_SCOPE_DATE_UTC,
max_date_utc: str | None = None,
timeout: float = 6.0,
) -> dict[str, dict[str, Any]]:
"""
Fetch the 3-month daily bar series from Yahoo Finance v8 Chart JSON API
(`?range=3mo&interval=1d`) so early-November bars always have a full 20-trading-day
trailing volume lookback window, while filtering emitted bars strictly to
`min_date_utc <= obs_date <= max_date_utc` (pre-Nov 1 out of scope).
"""
if symbol == "ANTHR-PVT":
return None
return {}
enc_sym = urllib.parse.quote(symbol, safe="")
url = f"https://query1.finance.yahoo.com/v8/finance/chart/{enc_sym}?range=1mo&interval=1d"
url = f"https://query1.finance.yahoo.com/v8/finance/chart/{enc_sym}?range=3mo&interval=1d"
req = urllib.request.Request(url, headers={"User-Agent": _USER_AGENT, "Accept": "application/json"})
from hyperstitionstud_io.security import safe_urlopen
@@ -179,7 +205,7 @@ def _fetch_yahoo_chart(symbol: str, timeout: float = 6.0) -> dict[str, Any] | No
data = json.loads(resp.read().decode("utf-8"))
res_list = (data.get("chart") or {}).get("result") or []
if not res_list:
return None
return {}
ts_list = res_list[0].get("timestamp") or []
quotes = (((res_list[0].get("indicators") or {}).get("quote") or [{}])[0])
raw_closes = quotes.get("close") or []
@@ -188,75 +214,130 @@ def _fetch_yahoo_chart(symbol: str, timeout: float = 6.0) -> dict[str, Any] | No
valid_pairs = [
(ts_list[i], float(raw_closes[i]), float(raw_vols[i]) if i < len(raw_vols) and raw_vols[i] is not None else None)
for i in range(min(len(ts_list), len(raw_closes)))
if raw_closes[i] is not None
if raw_closes[i] is not None and float(raw_closes[i]) > 0
]
if not valid_pairs:
return {}
out: dict[str, dict[str, Any]] = {}
for idx, (ts_val, close_usd, vol_val) in enumerate(valid_pairs):
obs_date = datetime.datetime.fromtimestamp(ts_val, datetime.timezone.utc).strftime("%Y-%m-%d")
if min_date_utc and obs_date < min_date_utc:
continue
if max_date_utc and obs_date > max_date_utc:
continue
prev_close = valid_pairs[idx - 1][1] if idx >= 1 else None
if prev_close and prev_close > 0:
chg_pct: float | None = round((close_usd - prev_close) / prev_close * 100.0, 2)
chg_bps: int | None = int(round(chg_pct * 100.0))
else:
chg_pct = None
chg_bps = None
vol_ratio: float | None = None
prior_vols = [x[2] for x in valid_pairs[max(0, idx - 20):idx] if x[2] is not None and x[2] > 0]
if vol_val is not None and vol_val > 0 and prior_vols:
avg_v = sum(prior_vols) / len(prior_vols)
if avg_v > 0:
vol_ratio = round(vol_val / avg_v, 2)
out[obs_date] = {
"date_utc": obs_date,
"observation_date_utc": obs_date,
"close_usd": round(close_usd, 2),
"change_pct": chg_pct,
"change_bps": chg_bps,
"volume_ratio_20d": vol_ratio,
"market_cap_str": None,
"feed_source": "yahoo_v8_json",
}
return out
def _fetch_yahoo_chart(symbol: str, timeout: float = 6.0) -> dict[str, Any] | None:
"""Source 1: Keyless Yahoo Finance v8 Chart JSON API (using latest completed closing-bell bar)."""
series = _fetch_yahoo_chart_series(
symbol,
min_date_utc=MIN_SCOPE_DATE_UTC,
max_date_utc=latest_completed_closing_bell_date_utc(),
timeout=timeout,
)
if not series:
return None
last_ts, close_usd, last_vol = valid_pairs[-1]
if close_usd <= 0:
return None
obs_date = datetime.datetime.fromtimestamp(last_ts, datetime.timezone.utc).strftime("%Y-%m-%d")
prev_close = valid_pairs[-2][1] if len(valid_pairs) >= 2 else None
if prev_close and prev_close > 0:
chg_pct: float | None = round((close_usd - prev_close) / prev_close * 100.0, 2)
chg_bps: int | None = int(round(chg_pct * 100.0))
else:
chg_pct = None
chg_bps = None
vol_ratio: float | None = None
prior_vols = [x[2] for x in valid_pairs[:-1][-20:] if x[2] is not None and x[2] > 0]
if last_vol is not None and last_vol > 0 and prior_vols:
avg_v = sum(prior_vols) / len(prior_vols)
if avg_v > 0:
vol_ratio = round(last_vol / avg_v, 2)
return {
"observation_date_utc": obs_date,
"close_usd": round(close_usd, 2),
"change_pct": chg_pct,
"change_bps": chg_bps,
"volume_ratio_20d": vol_ratio,
"market_cap_str": None,
"feed_source": "yahoo_v8_json",
}
latest_dt = sorted(series.keys())[-1]
return dict(series[latest_dt])
def _fetch_stooq_csv(symbol: str, timeout: float = 6.0) -> dict[str, Any] | None:
"""Source 2: Keyless Stooq Daily OHLCV CSV Fallback."""
def _fetch_stooq_csv_series(
symbol: str,
min_date_utc: str | None = MIN_SCOPE_DATE_UTC,
max_date_utc: str | None = None,
timeout: float = 6.0,
) -> dict[str, dict[str, Any]]:
"""Source 2: Keyless Stooq Daily OHLCV CSV Series Fallback (with 75-row lookback for 20d volume)."""
stooq_sym = _STOOQ_MAP.get(symbol)
if not stooq_sym:
return None
return {}
url = f"https://stooq.com/q/d/l/?s={stooq_sym}&i=d"
req = urllib.request.Request(url, headers={"User-Agent": _USER_AGENT})
from hyperstitionstud_io.security import safe_urlopen
with safe_urlopen(req, timeout=timeout) as resp:
text = resp.read().decode("utf-8", errors="replace")
rows = list(csv.DictReader(io.StringIO(text)))
if not rows or "Close" not in rows[-1] or rows[-1]["Close"] in ("", "N/D", None):
raw_rows = [
r for r in csv.DictReader(io.StringIO(text))
if r.get("Date") and r.get("Close") not in ("", "N/D", None)
]
if not raw_rows:
return {}
out: dict[str, dict[str, Any]] = {}
start_idx = max(0, len(raw_rows) - 75)
for idx in range(start_idx, len(raw_rows)):
row = raw_rows[idx]
obs_date = str(row["Date"])
if min_date_utc and obs_date < min_date_utc:
continue
if max_date_utc and obs_date > max_date_utc:
continue
close_usd = float(row["Close"])
if close_usd <= 0:
continue
prev_close = float(raw_rows[idx - 1]["Close"]) if idx >= 1 else None
chg_pct = round((close_usd - prev_close) / prev_close * 100.0, 2) if (prev_close and prev_close > 0) else None
chg_bps = int(round(chg_pct * 100.0)) if chg_pct is not None else None
prior_vols = [
float(r["Volume"])
for r in raw_rows[max(0, idx - 20):idx]
if r.get("Volume") and str(r["Volume"]).replace(".", "").isdigit() and float(r["Volume"]) > 0
]
cur_vol_s = row.get("Volume")
cur_vol = float(cur_vol_s) if (cur_vol_s and str(cur_vol_s).replace(".", "").isdigit()) else None
vol_ratio = round(cur_vol / (sum(prior_vols) / len(prior_vols)), 2) if (cur_vol and prior_vols) else None
out[obs_date] = {
"date_utc": obs_date,
"observation_date_utc": obs_date,
"close_usd": round(close_usd, 2),
"change_pct": chg_pct,
"change_bps": chg_bps,
"volume_ratio_20d": vol_ratio,
"market_cap_str": None,
"feed_source": "stooq_csv",
}
return out
def _fetch_stooq_csv(symbol: str, timeout: float = 6.0) -> dict[str, Any] | None:
"""Source 2: Keyless Stooq Daily OHLCV CSV Fallback (latest completed closing-bell bar)."""
series = _fetch_stooq_csv_series(
symbol,
max_date_utc=latest_completed_closing_bell_date_utc(),
timeout=timeout,
)
if not series:
return None
close_usd = float(rows[-1]["Close"])
prev_close = float(rows[-2]["Close"]) if len(rows) >= 2 and rows[-2].get("Close") not in ("", "N/D", None) else None
chg_pct = round((close_usd - prev_close) / prev_close * 100.0, 2) if (prev_close and prev_close > 0) else None
chg_bps = int(round(chg_pct * 100.0)) if chg_pct is not None else None
vols = [float(r["Volume"]) for r in rows[-21:] if r.get("Volume") and r["Volume"].replace(".", "").isdigit()]
vol_ratio = None
if len(vols) >= 2:
avg_v = sum(vols[:-1]) / max(1, len(vols[:-1]))
if avg_v > 0:
vol_ratio = round(vols[-1] / avg_v, 2)
return {
"observation_date_utc": rows[-1].get("Date"),
"close_usd": round(close_usd, 2),
"change_pct": chg_pct,
"change_bps": chg_bps,
"volume_ratio_20d": vol_ratio,
"market_cap_str": None,
"feed_source": "stooq_csv",
}
latest_dt = sorted(series.keys())[-1]
return dict(series[latest_dt])
def _fetch_coingecko_crypto(timeout: float = 6.0) -> dict[str, dict[str, Any]]:
@@ -296,7 +377,7 @@ def _load_real_history_latest_bars() -> dict[str, dict[str, Any]]:
if not hist_path.is_file():
return {}
try:
raw = json.loads(hist_path.read_text(encoding="utf-8"))
raw = load_json_cached(hist_path, copy_result=False)
out: dict[str, dict[str, Any]] = {}
for sym, sym_obj in (raw.get("instruments") or {}).items():
bars_by_date = sym_obj.get("bars_by_date") or {}
@@ -390,7 +471,7 @@ def build_financial_quant_harvest(
cfg = load_workspace_config()
with ReadOnlyIsolationGuard(cfg.read_only_files) as guard:
if snapshot_path and Path(snapshot_path).is_file():
raw_watchlist = json.loads(Path(snapshot_path).read_text(encoding="utf-8"))
raw_watchlist = load_json_cached(snapshot_path, copy_result=False)
else:
raw_watchlist = fetch_live_watchlist(
CANONICAL_WATCHLIST_24,
@@ -416,7 +497,7 @@ def build_financial_quant_harvest(
news_entities: dict[str, list[str]] = {}
if effective_news_path.is_file():
try:
news_obj = json.loads(effective_news_path.read_text(encoding="utf-8"))
news_obj = load_json_cached(effective_news_path, copy_result=False)
headline_records: list[str] = []
for st in news_obj.get("stories", news_obj.get("headlines", [])):
if isinstance(st, dict):
@@ -681,11 +762,19 @@ def build_financial_quant_harvest(
receipt = guard.audit_receipt()
available_count = sum(1 for x in instruments_out if x.get("data_available"))
unavailable_syms = [x["symbol"] for x in instruments_out if not x.get("data_available")]
observed_dates = sorted(
{
str(x["observation_date_utc"])
for x in instruments_out
if x.get("data_available") and x.get("observation_date_utc")
}
)
target_dt_utc = observed_dates[-1] if observed_dates else latest_completed_closing_bell_date_utc()
payload: dict[str, Any] = {
"$schema": "./schemas/v1/financial-aq-harvest.schema.json",
"$id": "urn:io:hyperstitionstud:schema:v1:financial-aq-harvest",
"version": "2.17.1",
"target_date_utc": datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d"),
"target_date_utc": target_dt_utc,
"harvest_mode": harvest_mode,
"synthetic_data_eliminated": True,
"regime_summary": {
@@ -754,21 +843,31 @@ def update_real_market_history_cache(
history_path: str | Path | None = None,
new_bars_by_symbol: dict[str, dict[str, dict[str, Any]]] | None = None,
allow_live_network: bool = False,
max_date_utc: str | None = None,
) -> dict[str, Any]:
"""
Merge new real daily exchange bars into `site/quant/real-market-history.json`.
Enforces strict Zero-Synthetic-Data honesty: `ANTHR-PVT` always remains `bars_by_date: {}`,
`data_available: False`, and closed weekend/holiday dates are never fabricated.
`data_available: False`, closed weekend/holiday dates are never fabricated, and incomplete
intraday candles from dates after `latest_completed_closing_bell_date_utc()` are excluded.
"""
from hyperstitionstud_io import __version__ as CURRENT_VERSION
cfg = load_workspace_config()
h_path = Path(history_path) if history_path else (cfg.core_dir / "site" / "quant" / "real-market-history.json")
if h_path.is_file():
doc = json.loads(h_path.read_text(encoding="utf-8"))
doc = load_json_cached(h_path, copy_result=True)
else:
doc = {"version": CURRENT_VERSION, "synthetic_data_eliminated": True, "instruments": {}}
effective_max_date = max_date_utc or (None if new_bars_by_symbol else latest_completed_closing_bell_date_utc())
cg_quotes: dict[str, dict[str, Any]] = {}
if allow_live_network and not new_bars_by_symbol:
try:
cg_quotes = _fetch_coingecko_crypto()
except Exception:
cg_quotes = {}
inst_map = doc.setdefault("instruments", {})
appended_count = 0
@@ -785,21 +884,61 @@ def update_real_market_history_cache(
entry = inst_map.setdefault(sym, {"symbol": sym, "data_available": True, "status": "ok", "bars_by_date": {}})
bars_by_dt = entry.setdefault("bars_by_date", {})
if effective_max_date:
for stale_dt in [
d for d in list(bars_by_dt.keys()) if d < MIN_SCOPE_DATE_UTC or d > effective_max_date
]:
del bars_by_dt[stale_dt]
else:
for stale_dt in [d for d in list(bars_by_dt.keys()) if d < MIN_SCOPE_DATE_UTC]:
del bars_by_dt[stale_dt]
if new_bars_by_symbol and sym in new_bars_by_symbol:
for dt_s, b_obj in new_bars_by_symbol[sym].items():
if dt_s < MIN_SCOPE_DATE_UTC:
continue
if effective_max_date and dt_s > effective_max_date:
continue
if b_obj and b_obj.get("close_usd") is not None:
bars_by_dt[dt_s] = b_obj
appended_count += 1
elif allow_live_network:
try:
live_b = _fetch_yahoo_chart(sym) or _fetch_stooq_csv(sym)
if live_b and live_b.get("observation_date_utc") and live_b.get("close_usd") is not None:
dt_s = live_b["observation_date_utc"]
bars_by_dt[dt_s] = live_b
appended_count += 1
series = _fetch_yahoo_chart_series(
sym, min_date_utc=MIN_SCOPE_DATE_UTC, max_date_utc=effective_max_date
) or _fetch_stooq_csv_series(
sym, min_date_utc=MIN_SCOPE_DATE_UTC, max_date_utc=effective_max_date
)
for dt_s, b_obj in sorted(series.items()):
if dt_s < MIN_SCOPE_DATE_UTC:
continue
if not b_obj or b_obj.get("close_usd") is None:
continue
prev_bar = bars_by_dt.get(dt_s)
if prev_bar is None or prev_bar.get("close_usd") is None:
if sym in cg_quotes and cg_quotes[sym].get("market_cap_str") and dt_s == effective_max_date:
b_obj = dict(b_obj)
b_obj["market_cap_str"] = cg_quotes[sym]["market_cap_str"]
bars_by_dt[dt_s] = b_obj
appended_count += 1
elif dt_s == effective_max_date:
merged_b = dict(b_obj)
if prev_bar.get("market_cap_str"):
merged_b["market_cap_str"] = prev_bar["market_cap_str"]
elif sym in cg_quotes and cg_quotes[sym].get("market_cap_str"):
merged_b["market_cap_str"] = cg_quotes[sym]["market_cap_str"]
bars_by_dt[dt_s] = merged_b
else:
if prev_bar.get("volume_ratio_20d") is None and b_obj.get("volume_ratio_20d") is not None:
prev_bar["volume_ratio_20d"] = b_obj["volume_ratio_20d"]
if prev_bar.get("change_pct") is None and b_obj.get("change_pct") is not None:
prev_bar["change_pct"] = b_obj["change_pct"]
prev_bar["change_bps"] = b_obj["change_bps"]
except Exception:
pass
entry["bars_by_date"] = {k: bars_by_dt[k] for k in sorted(bars_by_dt.keys())}
doc["version"] = CURRENT_VERSION
doc["synthetic_data_eliminated"] = True
h_path.parent.mkdir(parents=True, exist_ok=True)
@@ -807,17 +946,282 @@ def update_real_market_history_cache(
return {"history_path": str(h_path), "appended_bars_count": appended_count, "synthetic_data_eliminated": True}
_TELEMETRY_SNAPSHOT_FILES: tuple[str, ...] = (
"real-market-history.json",
"real-macro-indicators.json",
"daily-brief-state.json",
"financial-aq-harvest-latest.json",
)
def _excavate_git_json_versions(
repo_dir: Path,
rel_path: str,
max_commits: int = 35,
) -> list[dict[str, Any]]:
"""
Excavate valid JSON versions of `rel_path` from all Git stashes (`stash@{0..N}` and
untracked stash parents `stash@{i}^3`) and recent Git commits (`git log --all`).
"""
import subprocess
if not (repo_dir / ".git").exists():
return []
revs: list[str] = []
try:
stash_out = subprocess.run(
["git", "-C", str(repo_dir), "stash", "list", "--format=%gd"],
capture_output=True,
text=True,
check=False,
).stdout
for s_ref in [ln.strip() for ln in stash_out.splitlines() if ln.strip()]:
revs.append(s_ref)
revs.append(f"{s_ref}^3")
except Exception:
pass
try:
log_out = subprocess.run(
["git", "-C", str(repo_dir), "log", "--all", f"-n{max_commits}", "--format=%H", "--", rel_path],
capture_output=True,
text=True,
check=False,
).stdout
for sha in [ln.strip() for ln in log_out.splitlines() if ln.strip()]:
if sha not in revs:
revs.append(sha)
except Exception:
pass
docs: list[dict[str, Any]] = []
for rev in revs:
try:
proc = subprocess.run(
["git", "-C", str(repo_dir), "show", f"{rev}:{rel_path}"],
capture_output=True,
text=True,
check=False,
)
if proc.returncode == 0 and proc.stdout.strip():
obj = json.loads(proc.stdout)
if isinstance(obj, dict):
docs.append(obj)
except Exception:
continue
return docs
def snapshot_local_telemetry(
snapshot_dir: str | Path,
quant_dir: str | Path | None = None,
excavate_git: bool = True,
) -> dict[str, Any]:
"""
Save a lossless copy of local `site/quant/` telemetry JSON ledgers into `snapshot_dir`
prior to pulling or resetting the Git working tree during VPS deployment sync.
When `excavate_git=True` on the repository's `site/quant` directory, also excavates
any observations present in `git stash list` or `git log --all` (`>= 2026-11-01`).
"""
import shutil
cfg = load_workspace_config()
default_q_dir = cfg.core_dir / "site" / "quant"
q_dir = Path(quant_dir) if quant_dir else default_q_dir
s_dir = Path(snapshot_dir)
s_dir.mkdir(parents=True, exist_ok=True)
saved: list[str] = []
for fname in _TELEMETRY_SNAPSHOT_FILES:
src = q_dir / fname
if src.is_file():
try:
load_json_cached(src, copy_result=False)
shutil.copy2(src, s_dir / fname)
saved.append(fname)
except Exception:
continue
if excavate_git and q_dir.resolve() == default_q_dir.resolve() and (cfg.core_dir / ".git").exists():
max_dt = latest_completed_closing_bell_date_utc()
# 1. Excavate stashed/committed real-market-history.json bars (>= 2026-11-01)
snap_rmh_p = s_dir / "real-market-history.json"
if snap_rmh_p.is_file():
try:
base_rmh = load_json_cached(snap_rmh_p, copy_result=True)
insts = base_rmh.setdefault("instruments", {})
for hist_doc in _excavate_git_json_versions(cfg.core_dir, "site/quant/real-market-history.json"):
for sym, s_obj in (hist_doc.get("instruments") or {}).items():
if sym == "ANTHR-PVT" or not isinstance(s_obj, dict):
continue
t_entry = insts.setdefault(
sym, {"symbol": sym, "data_available": True, "status": "ok", "bars_by_date": {}}
)
t_bars = t_entry.setdefault("bars_by_date", {})
for dt_s, b_obj in (s_obj.get("bars_by_date") or {}).items():
if not re.match(r"^\d{4}-\d{2}-\d{2}$", str(dt_s)):
continue
if dt_s < MIN_SCOPE_DATE_UTC or dt_s > max_dt:
continue
if not isinstance(b_obj, dict) or b_obj.get("close_usd") is None:
continue
if dt_s not in t_bars or t_bars[dt_s].get("close_usd") is None:
t_bars[dt_s] = b_obj
else:
if not t_bars[dt_s].get("market_cap_str") and b_obj.get("market_cap_str"):
t_bars[dt_s]["market_cap_str"] = b_obj["market_cap_str"]
if t_bars[dt_s].get("volume_ratio_20d") is None and b_obj.get("volume_ratio_20d") is not None:
t_bars[dt_s]["volume_ratio_20d"] = b_obj["volume_ratio_20d"]
snap_rmh_p.write_text(json.dumps(base_rmh, indent=2, ensure_ascii=False) + "\n", encoding="utf-8")
except Exception:
pass
return {"ok": True, "snapshot_dir": str(s_dir), "saved_files": saved}
def reconcile_telemetry_snapshot(
snapshot_dir: str | Path,
quant_dir: str | Path | None = None,
max_date_utc: str | None = None,
recompile_bundles: bool = True,
) -> dict[str, Any]:
"""
Losslessly union-merge any valid completed harvest bars or FRED macro observations
(`>= 2026-11-01` and `<= max_date_utc`) from `snapshot_dir` that are absent in `quant_dir`
(the newly pulled `origin/main` checkout).
If `origin/main` already contains 100% of completed observations (`merged_bars_count == 0`
and `merged_macro_obs_count == 0`), performs 0 disk writes so `git status` remains clean.
"""
cfg = load_workspace_config()
q_dir = Path(quant_dir) if quant_dir else (cfg.core_dir / "site" / "quant")
s_dir = Path(snapshot_dir)
effective_max_date = max_date_utc or latest_completed_closing_bell_date_utc()
merged_bars_count = 0
merged_macro_obs_count = 0
snap_hist_p = s_dir / "real-market-history.json"
cur_hist_p = q_dir / "real-market-history.json"
if snap_hist_p.is_file() and cur_hist_p.is_file():
try:
snap_hist = load_json_cached(snap_hist_p, copy_result=False)
cur_hist = load_json_cached(cur_hist_p, copy_result=True)
cur_insts = cur_hist.setdefault("instruments", {})
for sym, snap_obj in (snap_hist.get("instruments") or {}).items():
if sym == "ANTHR-PVT":
continue
cur_entry = cur_insts.setdefault(
sym, {"symbol": sym, "data_available": True, "status": "ok", "bars_by_date": {}}
)
cur_bars = cur_entry.setdefault("bars_by_date", {})
for dt_s, b_obj in (snap_obj.get("bars_by_date") or {}).items():
if not re.match(r"^\d{4}-\d{2}-\d{2}$", str(dt_s)):
continue
if dt_s < MIN_SCOPE_DATE_UTC or dt_s > effective_max_date:
continue
if not isinstance(b_obj, dict) or b_obj.get("close_usd") is None:
continue
if dt_s not in cur_bars or cur_bars[dt_s].get("close_usd") is None:
cur_bars[dt_s] = b_obj
merged_bars_count += 1
else:
if not cur_bars[dt_s].get("market_cap_str") and b_obj.get("market_cap_str"):
cur_bars[dt_s]["market_cap_str"] = b_obj["market_cap_str"]
merged_bars_count += 1
if cur_bars[dt_s].get("volume_ratio_20d") is None and b_obj.get("volume_ratio_20d") is not None:
cur_bars[dt_s]["volume_ratio_20d"] = b_obj["volume_ratio_20d"]
merged_bars_count += 1
cur_entry["bars_by_date"] = {k: cur_bars[k] for k in sorted(cur_bars.keys())}
if merged_bars_count > 0:
cur_hist_p.write_text(json.dumps(cur_hist, indent=2, ensure_ascii=False) + "\n", encoding="utf-8")
except Exception:
pass
snap_macro_p = s_dir / "real-macro-indicators.json"
cur_macro_p = q_dir / "real-macro-indicators.json"
if snap_macro_p.is_file() and cur_macro_p.is_file():
try:
snap_macro = load_json_cached(snap_macro_p, copy_result=False)
cur_macro = load_json_cached(cur_macro_p, copy_result=True)
cur_series = cur_macro.setdefault("series", {})
for s_key, snap_s in (snap_macro.get("series") or {}).items():
if s_key not in cur_series or not isinstance(snap_s, dict):
continue
cur_obs_list = cur_series[s_key].get("recent_observations") or []
cur_obs_by_dt = {
str(o.get("date_utc") or o.get("date")): o
for o in cur_obs_list
if isinstance(o, dict) and (o.get("date_utc") or o.get("date"))
}
added_here = 0
for o in snap_s.get("recent_observations") or []:
if not isinstance(o, dict) or not (o.get("date_utc") or o.get("date")) or o.get("value") is None:
continue
dt_s = str(o.get("date_utc") or o.get("date"))
if dt_s > effective_max_date:
continue
if dt_s not in cur_obs_by_dt or cur_obs_by_dt[dt_s].get("value") is None:
cur_obs_by_dt[dt_s] = o
merged_macro_obs_count += 1
added_here += 1
if added_here > 0:
sorted_obs = [cur_obs_by_dt[k] for k in sorted(cur_obs_by_dt.keys())]
cur_series[s_key]["recent_observations"] = sorted_obs
latest_valid = [x for x in sorted_obs if x.get("value") is not None]
if latest_valid:
last_dt = latest_valid[-1].get("date_utc") or latest_valid[-1].get("date")
cur_series[s_key]["latest_date_utc"] = last_dt
cur_series[s_key]["latest_value"] = latest_valid[-1]["value"]
if merged_macro_obs_count > 0:
cur_macro_p.write_text(json.dumps(cur_macro, indent=2, ensure_ascii=False) + "\n", encoding="utf-8")
macro_js_p = q_dir / "real-macro-indicators-data.js"
js_body = (
"// Auto-generated by hyperstitionstud_io.quant.macro — DO NOT EDIT MANUALLY\n"
f"window.HYPERSTITION_MACRO_DATA = {json.dumps(cur_macro, ensure_ascii=False)};\n"
)
macro_js_p.write_text(js_body, encoding="utf-8")
except Exception:
pass
reconciled_new_data = (merged_bars_count > 0) or (merged_macro_obs_count > 0)
if reconciled_new_data and recompile_bundles and q_dir == (cfg.core_dir / "site" / "quant"):
from hyperstitionstud_io.quant.daily_brief import build_daily_portfolio_brief
from hyperstitionstud_io.quant.timeseries import build_quant_timeseries_bundle
build_quant_timeseries_bundle(write_files=True)
build_daily_portfolio_brief(allow_live_network=False, write_files=True)
return {
"ok": True,
"reconciled_new_data": reconciled_new_data,
"merged_bars_count": merged_bars_count,
"merged_macro_obs_count": merged_macro_obs_count,
"min_scope_date_utc": MIN_SCOPE_DATE_UTC,
"max_date_utc": effective_max_date,
}
def main(argv: list[str] | None = None) -> int:
ap = argparse.ArgumentParser(prog="hs-quant-harvest", description="Periodic Quantitative Financial Telemetry & Contingent Meaning Collector.")
ap.add_argument("--mode", choices=["us-closing-bell", "utc-rollover"], default="us-closing-bell")
ap.add_argument("--mode", choices=["us-pre-market-open", "us-closing-bell", "utc-rollover"], default="us-closing-bell")
ap.add_argument("--from-snapshot", default=None, help="Optional offline JSON snapshot file.")
ap.add_argument("--live", action="store_true", help="Attempt live keyless HTTP fetch (Yahoo v8 / Stooq CSV / CoinGecko).")
ap.add_argument("--append-history", action="store_true", help="Merge newly fetched real exchange bars into site/quant/real-market-history.json.")
ap.add_argument("--snapshot-telemetry", default=None, help="Snapshot local site/quant/ telemetry JSON files into the specified directory.")
ap.add_argument("--reconcile-telemetry", default=None, help="Losslessly reconcile snapshotted telemetry JSON files from the specified directory.")
ap.add_argument("--join-news", default=None, help="Optional path to news-aq-harvest-latest.json.")
ap.add_argument("--write-dossier", default=None, help="Optional path to emit Markdown quant report.")
ap.add_argument("--out", default=None, help="Output JSON path (default: <core_dir>/site/quant/financial-aq-harvest-latest.json).")
args = ap.parse_args(argv)
if args.snapshot_telemetry:
res = snapshot_local_telemetry(args.snapshot_telemetry)
print(json.dumps(res, indent=2))
return 0
if args.reconcile_telemetry:
res = reconcile_telemetry_snapshot(args.reconcile_telemetry)
print(json.dumps(res, indent=2))
return 0
cfg = load_workspace_config()
if args.append_history:
update_real_market_history_cache(allow_live_network=args.live)
+108 -13
View File
@@ -19,7 +19,7 @@ from pathlib import Path
from typing import Any
from hyperstitionstud_io import __version__ as CURRENT_VERSION
from hyperstitionstud_io.config import load_workspace_config
from hyperstitionstud_io.config import load_json_cached, load_workspace_config
from hyperstitionstud_io.glossary import ReadOnlyIsolationGuard
from hyperstitionstud_io.ipld import compute_dag_json_cidv1
from hyperstitionstud_io.quant.collector import NO_DATA_AVAILABLE
@@ -27,6 +27,28 @@ from hyperstitionstud_io.quant.macro import build_macro_indicators_bundle
from hyperstitionstud_io.quant.timeseries import build_quant_timeseries_bundle
SESSION_WINDOWS = ("us-pre-market-open", "us-closing-bell", "utc-rollover")
def _resolve_session_window(
session_window: str | None = None,
now_utc: datetime.datetime | None = None,
) -> str:
if session_window and session_window != "auto":
if session_window not in SESSION_WINDOWS:
raise ValueError(f"Unsupported session_window {session_window!r}; expected one of {SESSION_WINDOWS} or 'auto'.")
return session_window
dt = now_utc or datetime.datetime.now(datetime.timezone.utc)
hour = dt.hour
if 13 <= hour <= 15:
return "us-pre-market-open"
if 21 <= hour <= 23:
return "us-closing-bell"
if 0 <= hour <= 2:
return "utc-rollover"
return "us-closing-bell"
def _find_latest_available_bar(inst: dict[str, Any]) -> dict[str, Any] | None:
bars = [b for b in (inst.get("bars") or []) if b.get("data_available") and b.get("close_usd") is not None]
return bars[-1] if bars else None
@@ -143,8 +165,10 @@ def _compute_bayesian_regime_update(
def build_daily_portfolio_brief(
allow_live_network: bool = False,
write_files: bool = True,
session_window: str | None = None,
) -> dict[str, Any]:
cfg = load_workspace_config()
resolved_window = _resolve_session_window(session_window)
ts_bundle = build_quant_timeseries_bundle(write_files=False)
macro_bundle = build_macro_indicators_bundle(allow_live_network=allow_live_network, write_files=False)
@@ -162,7 +186,7 @@ def build_daily_portfolio_brief(
active_read_state_path = state_path if state_path.is_file() else next((p for p in legacy_state_paths if p.is_file()), state_path)
if active_read_state_path.is_file():
try:
prior_state = json.loads(active_read_state_path.read_text(encoding="utf-8"))
prior_state = load_json_cached(active_read_state_path, copy_result=False)
except Exception:
prior_state = {}
@@ -288,6 +312,7 @@ def build_daily_portfolio_brief(
"$id": "urn:io:hyperstitionstud:schema:v1:daily-portfolio-brief",
"version": CURRENT_VERSION,
"run_number": run_number,
"session_window": resolved_window,
"generated_at_utc": datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
"synthetic_data_eliminated": True,
"agenda_1_executive_summary": {
@@ -455,21 +480,78 @@ def build_daily_portfolio_brief(
out_js_path.write_text(js_body, encoding="utf-8")
# Update append-only Bayesian state ledger outside read-only files
history_list = list(prior_state.get("run_history") or [])
history_list.append({
"run_number": run_number,
"generated_at_utc": brief_payload["generated_at_utc"],
"posterior_probabilities": bayesian_block["posterior_probabilities"],
"question_id": current_question["question_id"],
"cidv1": brief_payload["ipld_dag_json_cidv1"]["/"],
})
# Deduplicate entries matching BOTH calendar day (generated_at_utc[:10]) AND session_window
raw_history = list(prior_state.get("run_history") or [])
dedup_history: list[dict[str, Any]] = []
for entry in raw_history:
if not isinstance(entry, dict):
continue
e_dt = str(entry.get("generated_at_utc") or "")[:10]
e_win = entry.get("session_window")
e_post = entry.get("posterior_probabilities")
if e_win is not None:
match_idx = next(
(
i
for i, prev in enumerate(dedup_history)
if str(prev.get("generated_at_utc") or "")[:10] == e_dt and prev.get("session_window") == e_win
),
None,
)
if match_idx is not None:
dedup_history[match_idx] = entry
else:
dedup_history.append(entry)
elif (
dedup_history
and dedup_history[-1].get("session_window") is None
and str(dedup_history[-1].get("generated_at_utc") or "")[:10] == e_dt
and dedup_history[-1].get("posterior_probabilities") == e_post
):
dedup_history[-1] = entry
else:
dedup_history.append(entry)
cur_dt_10 = str(brief_payload["generated_at_utc"])[:10]
cur_post = bayesian_block["posterior_probabilities"]
cur_match_idx = next(
(
i
for i, prev in enumerate(dedup_history)
if str(prev.get("generated_at_utc") or "")[:10] == cur_dt_10 and prev.get("session_window") == resolved_window
),
None,
)
if cur_match_idx is not None:
dedup_history[cur_match_idx] = {
"run_number": int(dedup_history[cur_match_idx].get("run_number") or (cur_match_idx + 1)),
"session_window": resolved_window,
"generated_at_utc": brief_payload["generated_at_utc"],
"posterior_probabilities": cur_post,
"question_id": str(dedup_history[cur_match_idx].get("question_id") or current_question["question_id"]),
"cidv1": brief_payload["ipld_dag_json_cidv1"]["/"],
}
else:
next_run_num = (int(dedup_history[-1].get("run_number") or len(dedup_history)) + 1) if dedup_history else 1
dedup_history.append({
"run_number": next_run_num,
"session_window": resolved_window,
"generated_at_utc": brief_payload["generated_at_utc"],
"posterior_probabilities": cur_post,
"question_id": f"Q-RUN-{next_run_num:04d}",
"cidv1": brief_payload["ipld_dag_json_cidv1"]["/"],
})
for idx, h_item in enumerate(dedup_history, start=1):
h_item["run_number"] = idx
h_item["question_id"] = f"Q-RUN-{idx:04d}"
effective_run_number = dedup_history[-1]["run_number"]
new_state = {
"version": CURRENT_VERSION,
"run_number": run_number,
"run_number": effective_run_number,
"session_window": resolved_window,
"updated_at_utc": brief_payload["generated_at_utc"],
"latest_posteriors": bayesian_block["posterior_probabilities"],
"active_daily_question": current_question,
"run_history": history_list[-30:],
"run_history": dedup_history[-60:],
}
state_path.parent.mkdir(parents=True, exist_ok=True)
state_path.write_text(json.dumps(new_state, indent=2, ensure_ascii=False) + "\n", encoding="utf-8")
@@ -480,14 +562,27 @@ def build_daily_portfolio_brief(
def main(argv: list[str] | None = None) -> int:
ap = argparse.ArgumentParser(prog="hs-daily-brief", description="Generate the 5-Agenda Zero-Synthetic-Data Daily Portfolio & Memetic Regime Update.")
ap.add_argument("--live-macro", action="store_true", help="Fetch fresh FRED CSV series before computing the daily brief.")
ap.add_argument(
"--window",
"--session-window",
dest="session_window",
choices=["auto", "us-pre-market-open", "us-closing-bell", "utc-rollover"],
default="auto",
help="Session window tag (default: auto-detected from UTC hour).",
)
args = ap.parse_args(argv)
brief = build_daily_portfolio_brief(allow_live_network=args.live_macro, write_files=True)
brief = build_daily_portfolio_brief(
allow_live_network=args.live_macro,
write_files=True,
session_window=args.session_window,
)
print(
json.dumps(
{
"ok": True,
"version": brief["version"],
"run_number": brief["run_number"],
"session_window": brief["session_window"],
"posteriors": brief["agenda_1_executive_summary"]["bayesian_regime_inference"]["posterior_probabilities"],
"question_id": brief["agenda_5_daily_key_macro_question_and_rigor"]["active_daily_question"]["question_id"],
"cidv1": brief["ipld_dag_json_cidv1"]["/"],
+88 -23
View File
@@ -19,7 +19,7 @@ from typing import Any
from hyperstitionstud_io import __version__ as CURRENT_VERSION
from hyperstitionstud_io.ciphers import compute_aq, int_to_spoken_words, prime_rank
from hyperstitionstud_io.config import load_workspace_config
from hyperstitionstud_io.config import load_json_cached, load_workspace_config
from hyperstitionstud_io.glossary import ReadOnlyIsolationGuard
from hyperstitionstud_io.ipld import compute_dag_json_cidv1
from hyperstitionstud_io.phonetics import translate_batch
@@ -147,26 +147,60 @@ FRED_SERIES_SPEC: tuple[dict[str, Any], ...] = (
)
def fetch_fred_series_csv(series_id: str, max_rows: int = 36, timeout: float = 8.0) -> list[dict[str, Any]]:
MIN_MACRO_DAILY_DATE_UTC = "2026-11-01"
def fetch_fred_series_csv(
series_id: str,
max_rows: int = 36,
timeout: float = 8.0,
min_date_utc: str | None = None,
max_date_utc: str | None = None,
) -> list[dict[str, Any]]:
"""
Fetch real observations from `https://fred.stlouisfed.org/graph/fredgraph.csv?id=<series_id>&cosd=2024-10-01`.
Fetch real observations from `https://fred.stlouisfed.org/graph/fredgraph.csv?id=<series_id>&cosd=2025-09-01`
using IPv4-first transport (`curl -4` with `safe_urlopen` fallback so blackholed IPv6 routes never stall).
Preserves missing/holiday dates explicitly as `value = None` (`data_available = False`) rather than `0.0`.
"""
url = f"https://fred.stlouisfed.org/graph/fredgraph.csv?id={series_id}&cosd=2024-10-01"
req = urllib.request.Request(url, headers={"User-Agent": _USER_AGENT})
from hyperstitionstud_io.security import safe_urlopen
import shutil
import subprocess
with safe_urlopen(req, timeout=timeout) as resp:
lines = [ln.strip() for ln in resp.read().decode("utf-8").splitlines() if ln.strip()]
url = f"https://fred.stlouisfed.org/graph/fredgraph.csv?id={series_id}&cosd=2025-09-01"
raw_text = ""
curl_bin = shutil.which("curl")
if curl_bin:
try:
proc = subprocess.run(
[curl_bin, "-4", "-sS", "-L", "--max-time", str(max(2, int(timeout))), url],
capture_output=True,
text=True,
check=False,
)
if proc.returncode == 0 and proc.stdout.startswith("observation_date,"):
raw_text = proc.stdout
except Exception:
raw_text = ""
if not raw_text:
req = urllib.request.Request(url, headers={"User-Agent": _USER_AGENT})
from hyperstitionstud_io.security import safe_urlopen
with safe_urlopen(req, timeout=timeout) as resp:
raw_text = resp.read().decode("utf-8")
lines = [ln.strip() for ln in raw_text.splitlines() if ln.strip()]
if len(lines) <= 1:
return []
tail = lines[1:][-max_rows:]
rows: list[dict[str, Any]] = []
for ln in tail:
for ln in lines[1:]:
parts = ln.split(",", 1)
if len(parts) != 2:
continue
dt_s, val_s = parts[0].strip(), parts[1].strip()
if min_date_utc and dt_s < min_date_utc:
continue
if max_date_utc and dt_s > max_date_utc:
continue
if not val_s or val_s == ".":
rows.append({
"date_utc": dt_s,
@@ -189,13 +223,13 @@ def fetch_fred_series_csv(series_id: str, max_rows: int = 36, timeout: float = 8
"status": NO_DATA_AVAILABLE,
"value": None,
})
return rows
return rows[-max_rows:]
def _score_macro_int(face_int: int, ing_map: dict[str, str]) -> dict[str, Any]:
sp_eng = int_to_spoken_words(abs(face_int))
sp_eng_aq = compute_aq(sp_eng)
sp_ing = ing_map.get(sp_eng, sp_eng)
sp_ing = ing_map.get(sp_eng) or translate_batch([sp_eng]).get(sp_eng, sp_eng)
sp_ing_aq = compute_aq(sp_ing)
ring_hits = sorted(
{
@@ -294,25 +328,52 @@ def build_macro_indicators_bundle(
cached_bundle: dict[str, Any] = {}
if cache_path.is_file():
try:
cached_bundle = json.loads(cache_path.read_text(encoding="utf-8"))
cached_bundle = load_json_cached(cache_path, copy_result=False)
except Exception:
cached_bundle = {}
cached_series = (cached_bundle.get("raw_fred_observations") or {}) if isinstance(cached_bundle, dict) else {}
from hyperstitionstud_io.quant.collector import latest_completed_closing_bell_date_utc
for spec in FRED_SERIES_SPEC:
max_closed_dt = latest_completed_closing_bell_date_utc()
def _fetch_one_spec(spec: dict[str, Any]) -> tuple[str, list[dict[str, Any]]]:
sid = spec["series_id"]
fetched: list[dict[str, Any]] = []
is_daily = spec["cadence"] == "1d"
min_dt = MIN_MACRO_DAILY_DATE_UTC if is_daily else None
fetched_rows: list[dict[str, Any]] = []
if allow_live_network:
try:
fetched = fetch_fred_series_csv(sid, max_rows=28)
fetched_rows = fetch_fred_series_csv(
sid,
max_rows=36,
min_date_utc=min_dt,
max_date_utc=max_closed_dt,
)
except Exception:
fetched = []
if not fetched and sid in cached_series and cached_series[sid]:
fetched = list(cached_series[sid])
if not fetched and sid in _VERIFIED_FRED_SEED_OBSERVATIONS:
fetched = list(_VERIFIED_FRED_SEED_OBSERVATIONS[sid])
raw_series_by_id[sid] = fetched
fetched_rows = []
prior_rows = list(cached_series.get(sid) or [])
if not prior_rows and not fetched_rows and sid in _VERIFIED_FRED_SEED_OBSERVATIONS:
prior_rows = list(_VERIFIED_FRED_SEED_OBSERVATIONS[sid])
merged_by_dt: dict[str, dict[str, Any]] = {}
for r in prior_rows + fetched_rows:
if not isinstance(r, dict) or not r.get("date_utc"):
continue
dt_s = str(r["date_utc"])
if min_dt and dt_s < min_dt:
continue
if dt_s > max_closed_dt:
continue
prev_r = merged_by_dt.get(dt_s)
if prev_r is None or (not prev_r.get("data_available") and r.get("data_available")):
merged_by_dt[dt_s] = r
return sid, [merged_by_dt[k] for k in sorted(merged_by_dt.keys())][-36:]
import concurrent.futures
with concurrent.futures.ThreadPoolExecutor(max_workers=7) as pool:
for sid, rows_list in pool.map(_fetch_one_spec, FRED_SERIES_SPEC):
raw_series_by_id[sid] = rows_list
# Pre-collect spoken integer strings for batch Ingglish translation
phrases: set[str] = set()
@@ -433,7 +494,11 @@ def build_macro_indicators_bundle(
"aq_evaluation": aq_eval,
"change_aq_evaluation": chg_eval,
"missing_observation_dates": missing_dates,
"recent_observations": obs_list[-12:],
"recent_observations": (
[r for r in obs_list if r["date_utc"] >= MIN_MACRO_DAILY_DATE_UTC]
if spec["cadence"] == "1d"
else obs_list[-13:]
),
}
# Compute Derived Spreads & Velocity Ratios (Strictly Null-Preserving)
+15 -4
View File
@@ -31,7 +31,7 @@ from hyperstitionstud_io.ciphers import (
is_repdigit_37,
prime_rank,
)
from hyperstitionstud_io.config import load_workspace_config
from hyperstitionstud_io.config import load_json_cached, load_workspace_config
from hyperstitionstud_io.glossary import ReadOnlyIsolationGuard
from hyperstitionstud_io.ipld import compute_dag_json_cidv1, write_pretty_and_dag_json
from hyperstitionstud_io.lenses import DEFAULT_LENS, ENABLED_LENSES, LENS_REGISTRY, apply_all_lenses
@@ -256,7 +256,7 @@ def _load_real_market_history_bars(cfg: Any) -> dict[str, dict[str, dict[str, An
if not hist_path.is_file():
return {}
try:
raw = json.loads(hist_path.read_text(encoding="utf-8"))
raw = load_json_cached(hist_path, copy_result=False)
out: dict[str, dict[str, dict[str, Any]]] = {}
for sym, sym_obj in (raw.get("instruments") or {}).items():
out[sym] = dict(sym_obj.get("bars_by_date") or {})
@@ -447,7 +447,18 @@ def build_quant_timeseries_bundle(
with ReadOnlyIsolationGuard(cfg.read_only_files) as guard:
dated_dossiers = _extract_dated_news_dossiers(cfg.archive_dir)
real_history = _load_real_market_history_bars(cfg)
dates_utc = [f"2026-11-{d:02d}" for d in range(1, 31)]
all_dates: set[str] = set()
for sym_hist in real_history.values():
for k in sym_hist.keys():
if re.match(r"^\d{4}-\d{2}-\d{2}$", str(k)):
all_dates.add(str(k))
if all_dates:
start_d = datetime.date.fromisoformat(min(all_dates))
end_d = datetime.date.fromisoformat(max(all_dates))
span_days = (end_d - start_d).days
dates_utc = [(start_d + datetime.timedelta(days=i)).isoformat() for i in range(span_days + 1)]
else:
dates_utc = sorted(dated_dossiers.keys())
num_days = len(dates_utc)
# Pre-collect all phrases needed for batch Ingglish translation from real observations only
@@ -798,7 +809,7 @@ def build_quant_timeseries_bundle(
tl_path = cfg.zoology_dir / "taxonomy" / "assemblage-builds-tier-list.json"
builds_out: list[dict[str, Any]] = []
if tl_path.is_file():
tl_data = json.loads(tl_path.read_text(encoding="utf-8"))
tl_data = load_json_cached(tl_path, copy_result=False)
for row in tl_data.get("rows", []):
s6 = row.get("stats_6") or {}
b_struct = {
+22 -32
View File
@@ -22,7 +22,7 @@ if _SRC_DIR.is_dir() and str(_SRC_DIR) not in sys.path:
sys.path.insert(0, str(_SRC_DIR))
from hyperstitionstud_io import __version__ as CURRENT_VERSION # noqa: E402
from hyperstitionstud_io.config import load_workspace_config # noqa: E402
from hyperstitionstud_io.config import load_workspace_config, run_git_stdout # noqa: E402
SEMVER_RE = r"\d+\.\d+\.\d+"
@@ -122,18 +122,6 @@ def evaluate_change_scope_heuristics(signals: dict[str, Any]) -> dict[str, Any]:
}
def _git_run(repo_dir: Path, args: list[str]) -> str:
if not (repo_dir / ".git").exists():
return ""
proc = subprocess.run(
["git", "-C", str(repo_dir), *args],
capture_output=True,
text=True,
check=False,
)
return proc.stdout.strip() if proc.returncode == 0 else ""
def _extract_archived_plan_ids_from_text(text: str) -> set[str]:
return set(re.findall(r"\bPLAN-[A-Z0-9-]+\b", text))
@@ -165,7 +153,7 @@ def collect_workspace_change_signals(ws_root: Path | None = None) -> dict[str, A
if m_v:
current_v = m_v.group(1)
baseline_tag = _git_run(core, ["describe", "--tags", "--abbrev=0"]) or f"v{current_v}"
baseline_tag = run_git_stdout(core, ["describe", "--tags", "--abbrev=0"]) or f"v{current_v}"
repo_dirs = [
core,
@@ -173,7 +161,7 @@ def collect_workspace_change_signals(ws_root: Path | None = None) -> dict[str, A
cfg.zoology_dir,
kg,
cfg.paths["gematria_js_dir"],
cfg.paths.get("ci_repo_dir", cfg.workspace_root / "hyperdope-ci-build"),
cfg.ci_build_dir,
]
repo_diff_summary: dict[str, dict[str, int]] = {}
total_dirty = 0
@@ -181,12 +169,12 @@ def collect_workspace_change_signals(ws_root: Path | None = None) -> dict[str, A
for rdir in repo_dirs:
if not rdir.is_dir():
continue
porcelain = _git_run(rdir, ["status", "--porcelain"])
porcelain = run_git_stdout(rdir, ["status", "--porcelain"])
dirty_cnt = len([ln for ln in porcelain.splitlines() if ln.strip()]) if porcelain else 0
rtag = _git_run(rdir, ["describe", "--tags", "--abbrev=0"])
rtag = run_git_stdout(rdir, ["describe", "--tags", "--abbrev=0"])
ahead_cnt = 0
if rtag:
ahead_str = _git_run(rdir, ["rev-list", f"{rtag}..HEAD", "--count"])
ahead_str = run_git_stdout(rdir, ["rev-list", f"{rtag}..HEAD", "--count"])
ahead_cnt = int(ahead_str) if ahead_str.isdigit() else 0
repo_diff_summary[rdir.name] = {
"dirty_files": dirty_cnt,
@@ -209,15 +197,15 @@ def collect_workspace_change_signals(ws_root: Path | None = None) -> dict[str, A
current_archived_plans |= _extract_archived_plan_ids_from_text(p.name)
baseline_archived_plans: set[str] = set()
kg_tag = _git_run(kg, ["describe", "--tags", "--abbrev=0"]) or baseline_tag
kg_tag = run_git_stdout(kg, ["describe", "--tags", "--abbrev=0"]) or baseline_tag
if kg_tag:
old_manifest = _git_run(kg, ["show", f"{kg_tag}:docs/archive/archive-manifest.json"])
old_manifest = run_git_stdout(kg, ["show", f"{kg_tag}:docs/archive/archive-manifest.json"])
if old_manifest:
baseline_archived_plans |= _extract_archived_plan_ids_from_text(old_manifest)
old_readme = _git_run(kg, ["show", f"{kg_tag}:docs/archive/README.md"])
old_readme = run_git_stdout(kg, ["show", f"{kg_tag}:docs/archive/README.md"])
if old_readme:
baseline_archived_plans |= _extract_archived_plan_ids_from_text(old_readme)
old_ls = _git_run(kg, ["ls-tree", "--name-only", kg_tag, "docs/archive/"])
old_ls = run_git_stdout(kg, ["ls-tree", "--name-only", kg_tag, "docs/archive/"])
if old_ls:
baseline_archived_plans |= _extract_archived_plan_ids_from_text(old_ls)
@@ -239,22 +227,22 @@ def collect_workspace_change_signals(ws_root: Path | None = None) -> dict[str, A
# 3. CLI entrypoints (`pyproject.toml`), MCP tools (`mcp/tools.py`), JSON schemas (`schemas/v1/`), & subpages (`site/<slug>/index.html`)
pyproj_p = core / "pyproject.toml"
cur_scripts = _extract_cli_scripts_from_pyproject(pyproj_p.read_text(encoding="utf-8")) if pyproj_p.is_file() else set()
old_pyproj = _git_run(core, ["show", f"{baseline_tag}:pyproject.toml"])
old_pyproj = run_git_stdout(core, ["show", f"{baseline_tag}:pyproject.toml"])
old_scripts = _extract_cli_scripts_from_pyproject(old_pyproj) if old_pyproj else cur_scripts
tools_p = core / "src" / "hyperstitionstud_io" / "mcp" / "tools.py"
cur_tools = _extract_mcp_tool_names(tools_p.read_text(encoding="utf-8")) if tools_p.is_file() else set()
old_tools_txt = _git_run(core, ["show", f"{baseline_tag}:src/hyperstitionstud_io/mcp/tools.py"])
old_tools_txt = run_git_stdout(core, ["show", f"{baseline_tag}:src/hyperstitionstud_io/mcp/tools.py"])
old_tools = _extract_mcp_tool_names(old_tools_txt) if old_tools_txt else cur_tools
schemas_dir = core / "schemas" / "v1"
cur_schemas = {p.name for p in schemas_dir.glob("*.schema.json")} if schemas_dir.is_dir() else set()
old_schemas_ls = _git_run(core, ["ls-tree", "--name-only", baseline_tag, "schemas/v1/"])
old_schemas_ls = run_git_stdout(core, ["ls-tree", "--name-only", baseline_tag, "schemas/v1/"])
old_schemas = {Path(ln).name for ln in old_schemas_ls.splitlines() if ln.endswith(".schema.json")} if old_schemas_ls else cur_schemas
site_dir = core / "site"
cur_subpages = {p.parent.name for p in site_dir.glob("*/index.html")} if site_dir.is_dir() else set()
old_site_ls = _git_run(core, ["ls-tree", "-r", "--name-only", baseline_tag, "site/"])
old_site_ls = run_git_stdout(core, ["ls-tree", "-r", "--name-only", baseline_tag, "site/"])
old_subpages = {
Path(ln).parts[1]
for ln in old_site_ls.splitlines()
@@ -491,12 +479,14 @@ def sync_workspace_version(target_version: str, check_only: bool = False, ws_roo
path.write_text(updated, encoding="utf-8")
modified_files.append(str(path))
if not check_only:
ws_toml = cfg.workspace_root / "workspace.toml"
if ws_toml.is_file():
orig_ws = ws_toml.read_text(encoding="utf-8")
upd_ws = re.sub(rf'schema_version\s*=\s*"{SEMVER_RE}"', f'schema_version = "{v}"', orig_ws, flags=re.M)
if upd_ws != orig_ws:
ws_toml = cfg.workspace_root / "workspace.toml"
if ws_toml.is_file():
orig_ws = ws_toml.read_text(encoding="utf-8")
upd_ws = re.sub(rf'schema_version\s*=\s*"{SEMVER_RE}"', f'schema_version = "{v}"', orig_ws, flags=re.M)
if upd_ws != orig_ws:
if check_only:
mismatched_files.append(str(ws_toml))
else:
ws_toml.write_text(upd_ws, encoding="utf-8")
modified_files.append(str(ws_toml))
+276 -119
View File
@@ -106,7 +106,7 @@ def test_offline_urn_namespaces_and_no_external_https_fonts() -> None:
cfg.zoology_dir,
cfg.knowledge_graph_dir,
cfg.paths["gematria_js_dir"],
cfg.paths.get("ci_repo_dir", cfg.workspace_root / "hyperdope-ci-build"),
cfg.ci_build_dir,
):
if not rdir.is_dir():
continue
@@ -212,8 +212,27 @@ def test_local_config_citation_resolution_and_proposals() -> None:
def test_doctor_all_checks_pass() -> None:
from hyperstitionstud_io import __version__ as cur_ver
from hyperstitionstud_io.config import (
normalize_workspace_relpath,
resolve_workspace_repo_dir,
)
diag = run_diagnostics()
assert diag["all_checks_passed"] is True
assert diag["schema_version"] == cur_ver
cfg = load_workspace_config()
assert cfg.schema_version == cur_ver
assert cfg.ci_build_dir.is_dir()
assert (
resolve_workspace_repo_dir(cfg.workspace_root, "hyperdope-ci-build")
== resolve_workspace_repo_dir(cfg.workspace_root, "ingglish-hyperdope-ci")
)
assert (
normalize_workspace_relpath(cfg.core_dir / "deploy" / "sync-vps-repos.sh", workspace_root=cfg.workspace_root)
== "/workspace/hyperstitionstudio-core/deploy/sync-vps-repos.sh"
)
def test_ipld_quant_and_mcp_server() -> None:
@@ -315,10 +334,61 @@ def test_ipld_quant_and_mcp_server() -> None:
assert ts_full["periodicity_gate"]["enforced"] is True
assert ts_full["periodicity_gate"]["non_periodic_records_ingested"] == 0
assert ts_full["periodicity_gate"]["dated_news_dossiers_ingested"] >= 20
assert len(ts_full["dates_utc"]) == 30
assert len(ts_full["dates_utc"]) >= 30
assert all(re.match(r"^\d{4}-\d{2}-\d{2}$", d) for d in ts_full["dates_utc"])
assert len(ts_full["instruments"]) == 24
# Strict regression check: Ensure all dates present in real market history are fully covered in dates_utc,
# timeseries.py contains 0 hardcoded year/month date generators, and telemetry snapshot reconciliation is lossless & zero-churn
import tempfile
from hyperstitionstud_io.quant.collector import (
latest_completed_closing_bell_date_utc,
reconcile_telemetry_snapshot,
snapshot_local_telemetry,
)
from hyperstitionstud_io.quant.timeseries import _load_real_market_history_bars
cfg_test = load_workspace_config()
ts_py_src = (cfg_test.core_dir / "src" / "hyperstitionstud_io" / "quant" / "timeseries.py").read_text(encoding="utf-8")
assert 'f"2026-' not in ts_py_src and 'startswith("2026-")' not in ts_py_src
real_hist_test = _load_real_market_history_bars(cfg_test)
history_dates = set()
for sym_obj in real_hist_test.values():
history_dates.update(sym_obj.keys())
for d in history_dates:
assert d in ts_full["dates_utc"], f"Regression: Real history date {d} missing from timeseries dates_utc!"
max_closed_dt = latest_completed_closing_bell_date_utc()
assert all(d <= max_closed_dt for d in history_dates), f"Premature unclosed date found in real market history (> {max_closed_dt})"
with tempfile.TemporaryDirectory() as tmp_reconcile_dir:
tmp_r = Path(tmp_reconcile_dir)
snap_d = tmp_r / "snap"
cur_d = tmp_r / "cur"
snap_res = snapshot_local_telemetry(snap_d)
assert snap_res["ok"] is True and "real-market-history.json" in snap_res["saved_files"]
snapshot_local_telemetry(cur_d)
cur_hist_file = cur_d / "real-market-history.json"
pre_bytes = cur_hist_file.read_bytes()
# 1. When cur_d already has all completed bars (even if snap_d has a premature future date), 0 writes occur
snap_doc = json.loads((snap_d / "real-market-history.json").read_text(encoding="utf-8"))
snap_doc["instruments"]["BTC-USD"]["bars_by_date"]["2099-12-31"] = {
"date_utc": "2099-12-31",
"close_usd": 99999.0,
}
(snap_d / "real-market-history.json").write_text(json.dumps(snap_doc), encoding="utf-8")
noop_rec = reconcile_telemetry_snapshot(snap_d, quant_dir=cur_d, max_date_utc=max_closed_dt, recompile_bundles=False)
assert noop_rec["reconciled_new_data"] is False and noop_rec["merged_bars_count"] == 0
assert cur_hist_file.read_bytes() == pre_bytes
# 2. When cur_d is missing a completed bar that exists in snap_d, reconcile_telemetry_snapshot losslessly restores it
cur_doc = json.loads(cur_hist_file.read_text(encoding="utf-8"))
nvda_bars_map = cur_doc["instruments"]["NVDA"]["bars_by_date"]
latest_nvda_dt = sorted(nvda_bars_map.keys())[-1]
removed_bar = nvda_bars_map.pop(latest_nvda_dt)
cur_hist_file.write_text(json.dumps(cur_doc), encoding="utf-8")
merge_rec = reconcile_telemetry_snapshot(snap_d, quant_dir=cur_d, max_date_utc=max_closed_dt, recompile_bundles=False)
assert merge_rec["reconciled_new_data"] is True and merge_rec["merged_bars_count"] == 1
restored_doc = json.loads(cur_hist_file.read_text(encoding="utf-8"))
assert restored_doc["instruments"]["NVDA"]["bars_by_date"][latest_nvda_dt]["close_usd"] == removed_bar["close_usd"]
anthr_ts = next(x for x in ts_full["instruments"] if x["symbol"] == "ANTHR-PVT")
assert anthr_ts["data_available"] is False
assert anthr_ts["available_trading_days"] == 0
@@ -341,8 +411,12 @@ def test_ipld_quant_and_mcp_server() -> None:
nvda_ts = next(x for x in ts_full["instruments"] if x["symbol"] == "NVDA")
assert nvda_ts["data_available"] is True
assert nvda_ts["available_trading_days"] == 19
assert sum(1 for b in nvda_ts["bars"] if not b["data_available"] and b["status"] == NO_DATA_AVAILABLE) == 11
total_dates = len(ts_full["dates_utc"])
avail_days = sum(1 for b in nvda_ts["bars"] if b["data_available"] is True)
missing_days = sum(1 for b in nvda_ts["bars"] if not b["data_available"] and b["status"] == NO_DATA_AVAILABLE)
assert nvda_ts["available_trading_days"] == avail_days
assert avail_days + missing_days == total_dates
assert len(nvda_ts["bars"]) == total_dates
assert nvda_ts["tradingview_symbol"] == "NASDAQ:NVDA"
assert "tradingview.com/chart/?symbol=NASDAQ%3ANVDA" in nvda_ts["tradingview_url"]
assert "doc_references" in nvda_ts
@@ -510,7 +584,7 @@ def test_ipld_quant_and_mcp_server() -> None:
assert cat_res["counts"]["kg_nodes"] == 388
assert cat_res["counts"]["kg_edges"] == 1282
assert cat_res["counts"]["dossiers"] >= 71
assert cat_res["counts"]["quant_timeseries_bars"] == 720
assert cat_res["counts"]["quant_timeseries_bars"] == 24 * len(ts_full["dates_utc"])
manifests = query_registry_manifests(cat_db)
assert any(m["registry_slug"] == "encyclopedia-graph" and m["dag_json_cidv1"].startswith("baguqeera") for m in manifests)
@@ -524,7 +598,10 @@ def test_ipld_quant_and_mcp_server() -> None:
assert len(coord_163["quant_timeseries_bars"]) >= 1
nvda_bars = query_timeseries_bars(symbol="NVDA", min_points=None, db_path=cat_db)
assert len(nvda_bars) == 30 and sum(1 for b in nvda_bars if b["data_available"] == 1) == 19
avail_db = sum(1 for b in nvda_bars if b["data_available"] == 1)
missing_db = sum(1 for b in nvda_bars if b["data_available"] == 0 and b["status"] == NO_DATA_AVAILABLE)
assert len(nvda_bars) == len(ts_full["dates_utc"])
assert avail_db + missing_db == len(nvda_bars)
assert any(b["contingent_points"] is None for b in nvda_bars if b["data_available"] == 0)
# Verify MCP and REST API calls automatically populate the SQLite REST API metadata database
@@ -726,8 +803,12 @@ def test_ipld_quant_and_mcp_server() -> None:
mac_code, _, mac_body = dispatch_rest_v1("GET", "/api/v1/tools/hs_inspect_macro_indicators")
assert mac_code == 200 and mac_body["data"]["synthetic_data_eliminated"] is True
assert mac_body["data"]["series_count"] == 14
assert mac_body["data"]["series"]["effr"]["aq_evaluation"]["face_int"] == 388
assert mac_body["data"]["derived_indicators"]["m1_vs_m2_spread"]["m2_minus_m1_trillions_str"] == "$3.37T"
effr_series = mac_body["data"]["series"]["effr"]
assert effr_series["aq_evaluation"]["face_int"] == int(round(float(effr_series["latest_value"]) * 100))
assert "2026-11-26" in effr_series["missing_observation_dates"]
assert mac_body["data"]["series"]["cpi"]["yoy_change_pct"] is not None
m2_m1_str = mac_body["data"]["derived_indicators"]["m1_vs_m2_spread"]["m2_minus_m1_trillions_str"]
assert isinstance(m2_m1_str, str) and m2_m1_str.startswith("$") and m2_m1_str.endswith("T")
# Verify Plan 4: 5-Agenda Daily Portfolio & Memetic Regime Update (hs-daily-brief)
brf_code, _, brf_body = dispatch_rest_v1("GET", "/api/v1/tools/hs_generate_daily_portfolio_brief")
@@ -869,6 +950,10 @@ def test_ipld_quant_and_mcp_server() -> None:
vps_prod_sh = cfg_test.core_dir / "deploy" / "run-vps-data-production.sh"
assert vps_prod_sh.is_file() and "/dev/null" not in vps_prod_sh.read_text(encoding="utf-8")
vps_prod_txt = vps_prod_sh.read_text(encoding="utf-8")
assert "--window=auto" in vps_prod_txt or '--window=*' in vps_prod_txt
assert "us-pre-market-open" in vps_prod_txt
assert '--window "${WINDOW_MODE}"' in vps_prod_txt
for u_name in (
"hyperstition-closing-bell-harvest.service",
"hyperstition-closing-bell-harvest.timer",
@@ -877,6 +962,63 @@ def test_ipld_quant_and_mcp_server() -> None:
):
assert (cfg_test.core_dir / "deploy" / u_name).is_file()
# Verify Plan #72: Dual-Calendar Pre-Market-Open Timer & Session-Window Brief Deduplication
cb_timer_txt = (cfg_test.core_dir / "deploy" / "hyperstition-closing-bell-harvest.timer").read_text(encoding="utf-8")
assert "OnCalendar=Mon..Fri *-*-* 14:00:00 UTC" in cb_timer_txt
assert "OnCalendar=Mon..Fri *-*-* 21:30:00 UTC" in cb_timer_txt
cb_svc_txt = (cfg_test.core_dir / "deploy" / "hyperstition-closing-bell-harvest.service").read_text(encoding="utf-8")
assert "--window=auto" in cb_svc_txt
import datetime as _dt
from types import SimpleNamespace
from unittest.mock import patch as _mock_patch
from hyperstitionstud_io.quant.collector import build_financial_quant_harvest as _bfqh
from hyperstitionstud_io.quant.daily_brief import (
_resolve_session_window,
build_daily_portfolio_brief,
)
assert _bfqh(harvest_mode="us-pre-market-open", live_fetch=False)["harvest_mode"] == "us-pre-market-open"
assert _resolve_session_window("auto", _dt.datetime(2026, 12, 2, 14, 0, tzinfo=_dt.timezone.utc)) == "us-pre-market-open"
assert _resolve_session_window("auto", _dt.datetime(2026, 12, 2, 21, 30, tzinfo=_dt.timezone.utc)) == "us-closing-bell"
assert _resolve_session_window("auto", _dt.datetime(2026, 12, 2, 0, 5, tzinfo=_dt.timezone.utc)) == "utc-rollover"
tmp_brief_core = tmp_path / "brief_core_tmp"
(tmp_brief_core / "site" / "quant").mkdir(parents=True, exist_ok=True)
seed_hist = [
{
"run_number": idx + 1,
"session_window": "us-closing-bell",
"generated_at_utc": "",
"posterior_probabilities": {"R1_BULL_RISK_ON": 0.25, "R2_PINNED_ISOMETRIC": 0.50, "R3_TAIL_DRAWDOWN_RISK_OFF": 0.25},
"question_id": f"Q-RUN-{idx + 1:04d}",
"cidv1": f"baguqeeraseed{idx:04d}",
}
for idx in range(62)
]
# Ensure unique dates in seed_hist so none collide with each other
base_seed_dt = _dt.date(2026, 9, 1)
for idx, item in enumerate(seed_hist):
item["generated_at_utc"] = (base_seed_dt + _dt.timedelta(days=idx)).strftime("%Y-%m-%dT21:30:00Z")
(tmp_brief_core / "site" / "quant" / "daily-brief-state.json").write_text(
json.dumps({"version": "2.18.0", "run_number": 62, "run_history": seed_hist}, indent=2),
encoding="utf-8",
)
fake_cfg = SimpleNamespace(core_dir=tmp_brief_core, archive_dir=cfg_test.archive_dir, read_only_files=())
with _mock_patch("hyperstitionstud_io.quant.daily_brief.load_workspace_config", return_value=fake_cfg):
b_am = build_daily_portfolio_brief(allow_live_network=False, write_files=True, session_window="us-pre-market-open")
assert b_am["session_window"] == "us-pre-market-open"
b_pm = build_daily_portfolio_brief(allow_live_network=False, write_files=True, session_window="us-closing-bell")
assert b_pm["session_window"] == "us-closing-bell"
b_am_dup = build_daily_portfolio_brief(allow_live_network=False, write_files=True, session_window="us-pre-market-open")
assert b_am_dup["session_window"] == "us-pre-market-open"
brief_state_out = json.loads((tmp_brief_core / "site" / "quant" / "daily-brief-state.json").read_text(encoding="utf-8"))
assert len(brief_state_out["run_history"]) == 60
today_10 = b_am["generated_at_utc"][:10]
today_entries = [x for x in brief_state_out["run_history"] if x["generated_at_utc"][:10] == today_10]
assert [x["session_window"] for x in today_entries] == ["us-pre-market-open", "us-closing-bell"]
# Verify /engineering/ (hs-eng-docs) & /math/ (hs-math-docs) Piecewise & Non-Sequential Revertability
from hyperstitionstud_io.publishing.engineering_docs import build_engineering_site
from hyperstitionstud_io.publishing.math_docs import build_math_site
@@ -974,39 +1116,35 @@ def test_ipld_quant_and_mcp_server() -> None:
assert "hs-guile-cartridge" not in (tmp_path / "eng_no_guile" / "index.html").read_text(encoding="utf-8")
import subprocess
import shutil
if shutil.which("node"):
node_guile_test = subprocess.run(
[
"node",
"-e",
f"const R = require({json.dumps(str(guile_js_p))});"
"const s = R.createSession();"
"if (s.evaluate('(aq-base36 \"LEMUR\")').formatted !== '114') process.exit(1);"
"if (s.evaluate('(prime-factors 666)').formatted !== '(2 3 3 37)') process.exit(2);"
"if (s.evaluate('(+ 1/5 9/50 9/50 4/25 7/50 7/50)').formatted !== '1') process.exit(3);"
"if (s.evaluate('(variance-pop *cluster-292-gen0*)').formatted !== '4634/9') process.exit(4);"
"if (s.evaluate('(variance-pop *cluster-292-gen1*)').formatted !== '0') process.exit(5);"
"if (Math.abs(s.evaluate('((derivative (lambda (x) (* x x x)) 1e-5) 2.0)').floatValue - 12.0) > 1e-3) process.exit(6);"
"if (Math.abs(s.evaluate('(adaptive-simpson (lambda (x) (* x x)) 0.0 3.0 1e-6)').floatValue - 9.0) > 1e-4) process.exit(7);"
"if (s.evaluate(\"(bayes-update '(1/3 1/3 1/3) '(1/10 3/10 6/10))\").formatted !== '(1/10 3/10 3/5)') process.exit(8);"
"if (s.evaluatePolyglot('aqBase36(\"LEMUR\")', 'ts').formatted !== '114') process.exit(9);"
"if (s.evaluatePolyglot('aq_base36(\"LEMUR\")', 'rust').formatted !== '114') process.exit(10);"
"if (s.evaluatePolyglot('primeFactors(666)', 'ts').formatted !== '[2,3,3,37]') process.exit(11);"
"if (s.evaluatePolyglot('prime_factors(666_u64)', 'rust').formatted !== 'vec![2, 3, 3, 37]') process.exit(12);"
"if (s.evaluatePolyglot('(aq-base36 \"LEMUR\")', 'rust').formatted !== '114') process.exit(13);"
"if (s.evaluatePolyglot('let x: i64 = aq_base36(\"LEMUR\") + 23; x * 2', 'rust').formatted !== '274') process.exit(14);"
"if (s.evaluatePolyglot('const x: number = aqBase36(\"LEMUR\") + 23; x * 2', 'ts').formatted !== '274') process.exit(15);"
"if (s.evaluatePolyglot('(1..=5_i64).map(|x| x * x).sum::<i64>()', 'rust').formatted !== '55') process.exit(16);",
],
capture_output=True,
text=True,
check=False,
)
assert node_guile_test.returncode == 0, f"Node Polyglot REPL check failed ({node_guile_test.returncode}): {node_guile_test.stderr}"
else:
print("[notice] 'node' executable not found in PATH; skipping Node.js polyglot REPL subtest.")
node_guile_test = subprocess.run(
[
"node",
"-e",
f"const R = require({json.dumps(str(guile_js_p))});"
"const s = R.createSession();"
"if (s.evaluate('(aq-base36 \"LEMUR\")').formatted !== '114') process.exit(1);"
"if (s.evaluate('(prime-factors 666)').formatted !== '(2 3 3 37)') process.exit(2);"
"if (s.evaluate('(+ 1/5 9/50 9/50 4/25 7/50 7/50)').formatted !== '1') process.exit(3);"
"if (s.evaluate('(variance-pop *cluster-292-gen0*)').formatted !== '4634/9') process.exit(4);"
"if (s.evaluate('(variance-pop *cluster-292-gen1*)').formatted !== '0') process.exit(5);"
"if (Math.abs(s.evaluate('((derivative (lambda (x) (* x x x)) 1e-5) 2.0)').floatValue - 12.0) > 1e-3) process.exit(6);"
"if (Math.abs(s.evaluate('(adaptive-simpson (lambda (x) (* x x)) 0.0 3.0 1e-6)').floatValue - 9.0) > 1e-4) process.exit(7);"
"if (s.evaluate(\"(bayes-update '(1/3 1/3 1/3) '(1/10 3/10 6/10))\").formatted !== '(1/10 3/10 3/5)') process.exit(8);"
"if (s.evaluatePolyglot('aqBase36(\"LEMUR\")', 'ts').formatted !== '114') process.exit(9);"
"if (s.evaluatePolyglot('aq_base36(\"LEMUR\")', 'rust').formatted !== '114') process.exit(10);"
"if (s.evaluatePolyglot('primeFactors(666)', 'ts').formatted !== '[2,3,3,37]') process.exit(11);"
"if (s.evaluatePolyglot('prime_factors(666_u64)', 'rust').formatted !== 'vec![2, 3, 3, 37]') process.exit(12);"
"if (s.evaluatePolyglot('(aq-base36 \"LEMUR\")', 'rust').formatted !== '114') process.exit(13);"
"if (s.evaluatePolyglot('let x: i64 = aq_base36(\"LEMUR\") + 23; x * 2', 'rust').formatted !== '274') process.exit(14);"
"if (s.evaluatePolyglot('const x: number = aqBase36(\"LEMUR\") + 23; x * 2', 'ts').formatted !== '274') process.exit(15);"
"if (s.evaluatePolyglot('(1..=5_i64).map(|x| x * x).sum::<i64>()', 'rust').formatted !== '55') process.exit(16);",
],
capture_output=True,
text=True,
check=False,
)
assert node_guile_test.returncode == 0, f"Node Polyglot REPL check failed ({node_guile_test.returncode}): {node_guile_test.stderr}"
# Verify 4-Ring Sandbox Security & Resource Quota Guards (polyglot_sandbox.py)
from hyperstitionstud_io.publishing.polyglot_sandbox import (
@@ -1015,33 +1153,30 @@ def test_ipld_quant_and_mcp_server() -> None:
evaluate_polyglot_sandbox,
)
if shutil.which("node"):
for bad_expr, bad_lang in (
('({}).constructor.constructor("return process")()', "ts"),
("globalThis.fetch('https://example.com')", "ts"),
('(system "id")', "guile"),
('std::process::Command::new("sh")', "rust"),
):
blocked = False
try:
evaluate_polyglot_sandbox(bad_expr, lang=bad_lang)
except SandboxSecurityError:
blocked = True
assert blocked, f"Failed to block escape attempt {bad_expr!r} in {bad_lang}"
for bad_expr, bad_lang in (
('({}).constructor.constructor("return process")()', "ts"),
("globalThis.fetch('https://example.com')", "ts"),
('(system "id")', "guile"),
('std::process::Command::new("sh")', "rust"),
):
blocked = False
try:
evaluate_polyglot_sandbox(bad_expr, lang=bad_lang)
except SandboxSecurityError:
blocked = True
assert blocked, f"Failed to block escape attempt {bad_expr!r} in {bad_lang}"
for inf_expr, inf_lang in (
("((Z (lambda (r) (lambda (x) (r (+ x 1))))) 0)", "guile"),
("Array.from({length: 1000000}, (_, i): number => i + 1).reduce((a, b) => a + b, 0)", "ts"),
("(1..=1000000_i64).fold(0_i64, |acc, x| acc + x)", "rust"),
):
halted = False
try:
evaluate_polyglot_sandbox(inf_expr, lang=inf_lang, max_steps=2000)
except SandboxResourceError:
halted = True
assert halted, f"Failed to halt resource exhaustion {inf_expr!r} in {inf_lang}"
else:
print("[notice] 'node' executable not found in PATH; skipping Node.js polyglot sandbox security & resource exhaustion subtests.")
for inf_expr, inf_lang in (
("((Z (lambda (r) (lambda (x) (r (+ x 1))))) 0)", "guile"),
("Array.from({length: 1000000}, (_, i): number => i + 1).reduce((a, b) => a + b, 0)", "ts"),
("(1..=1000000_i64).fold(0_i64, |acc, x| acc + x)", "rust"),
):
halted = False
try:
evaluate_polyglot_sandbox(inf_expr, lang=inf_lang, max_steps=2000)
except SandboxResourceError:
halted = True
assert halted, f"Failed to halt resource exhaustion {inf_expr!r} in {inf_lang}"
# Verify 5-state #hsPolyglotModeSelector on /engineering/ and /math/
eng_idx_txt = (cfg.core_dir / "site" / "engineering" / "index.html").read_text(encoding="utf-8")
@@ -1126,27 +1261,24 @@ def test_ipld_quant_and_mcp_server() -> None:
assert "hs-sigil-seal" in surf_txt, f"Missing hs-sigil-seal in {surf_p}"
assert "hs-sigil-colophon" in surf_txt, f"Missing hs-sigil-colophon in {surf_p}"
if shutil.which("node"):
node_rain_test = subprocess.run(
[
"node",
"-e",
f"const CR = require({json.dumps(str(coderain_js_p))});"
"if (CR.MATRIX_CHARS.length !== 66) process.exit(1);"
"if (CR.SIGIL_GLINTS.length < 8) process.exit(2);"
"const sub = CR.PROFILES.subtle;"
"if (sub.frameIntervalMs !== 80 || sub.colPitchPx !== 24 || sub.canvasOpacity !== 0.45) process.exit(3);"
"const aCenter = CR.computeColumnAlpha(500, 1000, sub, false);"
"const aOuter = CR.computeColumnAlpha(50, 1000, sub, false);"
"if (!(aCenter < aOuter && aCenter <= 0.09 && aOuter >= 0.20)) process.exit(4);",
],
capture_output=True,
text=True,
check=False,
)
assert node_rain_test.returncode == 0, f"Node Code-Rain check failed ({node_rain_test.returncode}): {node_rain_test.stderr}"
else:
print("[notice] 'node' executable not found in PATH; skipping Node.js code-rain subtest.")
node_rain_test = subprocess.run(
[
"node",
"-e",
f"const CR = require({json.dumps(str(coderain_js_p))});"
"if (CR.MATRIX_CHARS.length !== 66) process.exit(1);"
"if (CR.SIGIL_GLINTS.length < 8) process.exit(2);"
"const sub = CR.PROFILES.subtle;"
"if (sub.frameIntervalMs !== 80 || sub.colPitchPx !== 24 || sub.canvasOpacity !== 0.45) process.exit(3);"
"const aCenter = CR.computeColumnAlpha(500, 1000, sub, false);"
"const aOuter = CR.computeColumnAlpha(50, 1000, sub, false);"
"if (!(aCenter < aOuter && aCenter <= 0.09 && aOuter >= 0.20)) process.exit(4);",
],
capture_output=True,
text=True,
check=False,
)
assert node_rain_test.returncode == 0, f"Node Code-Rain check failed ({node_rain_test.returncode}): {node_rain_test.stderr}"
# Verify PLAN-AUTOMATED-PER-COMMIT-REPO-ROOT-README-SYNCHRONIZATION-FOR-GITEA
# and PLAN-README-AND-GIT-COMMIT-MESSAGE-VERSION-PARITY-FIX
@@ -1243,32 +1375,29 @@ def test_ipld_quant_and_mcp_server() -> None:
assert js_sig_1["js_ui_sha256"] != js_sig_2["js_ui_sha256"], "Mutating JS DOM control must change js_ui_sha256 fingerprint"
assert js_sig_1["has_lens_select_highlight"] is True and js_sig_1["speech_text_count"] == 25
if shutil.which("node"):
node_quant_tut_test = subprocess.run(
[
"node",
"-e",
f"const QT = require({json.dumps(str(quant_tut_js_p))});"
"if (QT.episodes.length !== 5) process.exit(1);"
"let totalScenes = 0;"
"QT.episodes.forEach((ep) => {"
" ep.keyframes.forEach((kf) => {"
" totalScenes++;"
" if (!Array.isArray(kf.uiTargets) || kf.uiTargets.length === 0) process.exit(2);"
" if (!kf.uiElementLabel || !kf.speechText) process.exit(3);"
" });"
"});"
"if (totalScenes !== 25) process.exit(4);"
"const ep04 = QT.episodes[3];"
"if (!ep04.keyframes.every((kf) => kf.uiTargets.includes('lensSelect') && kf.uiTargets.includes('lensProjectionCard'))) process.exit(5);",
],
capture_output=True,
text=True,
check=False,
)
assert node_quant_tut_test.returncode == 0, f"Node QuantTutorials check failed ({node_quant_tut_test.returncode}): {node_quant_tut_test.stderr}"
else:
print("[notice] 'node' executable not found in PATH; skipping Node.js quant tutorials subtest.")
node_quant_tut_test = subprocess.run(
[
"node",
"-e",
f"const QT = require({json.dumps(str(quant_tut_js_p))});"
"if (QT.episodes.length !== 5) process.exit(1);"
"let totalScenes = 0;"
"QT.episodes.forEach((ep) => {"
" ep.keyframes.forEach((kf) => {"
" totalScenes++;"
" if (!Array.isArray(kf.uiTargets) || kf.uiTargets.length === 0) process.exit(2);"
" if (!kf.uiElementLabel || !kf.speechText) process.exit(3);"
" });"
"});"
"if (totalScenes !== 25) process.exit(4);"
"const ep04 = QT.episodes[3];"
"if (!ep04.keyframes.every((kf) => kf.uiTargets.includes('lensSelect') && kf.uiTargets.includes('lensProjectionCard'))) process.exit(5);",
],
capture_output=True,
text=True,
check=False,
)
assert node_quant_tut_test.returncode == 0, f"Node QuantTutorials check failed ({node_quant_tut_test.returncode}): {node_quant_tut_test.stderr}"
# Verify Plan #57 (Strategies 1A, 2A, 3A): Zero-Git-Audio deploy-time WAV voice compiler (quant_voice.py) & 0 audio files in Git
from hyperstitionstud_io.publishing.quant_voice import build_quant_tour_voice_assets
@@ -1336,19 +1465,35 @@ def test_ipld_quant_and_mcp_server() -> None:
cfg.archive_dir / "packaging" / "bundle" / "scripts" / "ci_provision_ingglish.py",
cfg.archive_dir / "packaging" / "bundle" / "skills" / "hyperdope-ingglish-ci" / "scripts" / "ci_provision_ingglish.py",
):
assert ci_prov_mirror.read_text(encoding="utf-8") == ci_prov_txt, f"Out-of-sync ci_provision_ingglish.py mirror: {ci_prov_mirror}"
mirror_txt = ci_prov_mirror.read_text(encoding="utf-8")
assert len(mirror_txt.splitlines()) <= 40 and "runpy.run_path" in mirror_txt and "ci_provision_ingglish.py" in mirror_txt, (
f"Expected thin delegator wrapper for {ci_prov_mirror}"
)
# Verify Plan #58: Pre-Commit Preparation & Gates DEPLOY-GATE-D01.MIRROR_PARITY..DEPLOY-GATE-D08.PRE_COMMIT_STAGE for push-all-to-git-libre-audio.sh & deploy/sync-vps-repos.sh
from hyperstitionstud_io.ci.deploy_scripts_sync import prepare_and_verify_deploy_scripts
# Verify Plan #58 & DEPLOY-GATE-D07.TOPO_PUSH_PARITY: Pre-Commit Preparation & Gates DEPLOY-GATE-D01.MIRROR_PARITY..DEPLOY-GATE-D08.PRE_COMMIT_STAGE for push-all-to-git-libre-audio.sh & deploy/sync-vps-repos.sh
from hyperstitionstud_io.ci.deploy_scripts_sync import (
prepare_and_verify_deploy_scripts,
validate_push_script_rebase_gating,
)
dep_sync = prepare_and_verify_deploy_scripts(workspace_root=cfg.workspace_root, check_only=False)
assert dep_sync["ok"] is True, f"Deploy scripts sync failed: {dep_sync}"
assert all(dep_sync["gates"].values()), f"Deploy scripts gates failed: {dep_sync['gates']}"
dep_chk = prepare_and_verify_deploy_scripts(workspace_root=cfg.workspace_root, check_only=True)
assert dep_chk["ok"] is True, f"Deploy scripts check_only failed: {dep_chk}"
assert (cfg.core_dir / "deploy" / "push-all-to-git-libre-audio.sh").read_text(encoding="utf-8") == (
cfg.workspace_root / "push-all-to-git-libre-audio.sh"
).read_text(encoding="utf-8")
ws_push_txt = (cfg.workspace_root / "push-all-to-git-libre-audio.sh").read_text(encoding="utf-8")
assert (cfg.core_dir / "deploy" / "push-all-to-git-libre-audio.sh").read_text(encoding="utf-8") == ws_push_txt
assert validate_push_script_rebase_gating(ws_push_txt) == []
assert 'run_checked "git pull --rebase' in ws_push_txt
for bad_rebase_snippet in (
"git checkout --theirs README.md",
"git checkout --ours README.md",
"git pull --rebase -X theirs origin main",
"git pull --rebase -X ours origin main",
"git pull --rebase --autostash origin main || true",
):
bad_v = validate_push_script_rebase_gating(bad_rebase_snippet)
assert len(bad_v) >= 1, f"Gate DEPLOY-GATE-D07.TOPO_PUSH_PARITY failed to reject {bad_rebase_snippet!r}"
# Verify Plan #60: /calc/ (haiperdohpjematreeah) Homepage Group 3 UI Parity, Zero "Cypher Calculator" & hyperdope-ci-build Patch Integration
calc_dir = cfg.paths["gematria_js_dir"]
@@ -1403,6 +1548,18 @@ def test_ipld_quant_and_mcp_server() -> None:
assert erofs_res["verified"] is True
assert erofs_res["mcp_tools_swept"] >= 15
# Verify PLAN-SPECIFICATION-AND-GOVERNANCE-STANDARD (hs-plan-lint)
from hyperstitionstud_io.ci.plan_validator import verify_plan_specifications
plan_audit = verify_plan_specifications(workspace_root=cfg.workspace_root)
assert plan_audit["ok"] is True, f"Plan specification audit failed: {plan_audit['errors']}"
assert plan_audit["total_plans_checked"] == plan_audit["active_plans_checked"] + plan_audit["piecewise_plans_checked"]
assert plan_audit["total_plans_checked"] > 0
assert len(plan_audit["missing_pdfs"]) == 0
assert len(plan_audit["missing_ledger_entries"]) == 0
assert len(plan_audit["metadata_errors"]) == 0
assert len(plan_audit["host_path_errors"]) == 0
# Write cached internal test baseline (.cache/internal-test-baseline-latest.json) for hs-public-smoke
from hyperstitionstud_io.ci.public_regression import write_internal_test_baseline_cache