Spaces:
Running
Running
deploy(hf): sync szl-holdings/a11oy@83dbdbb2269145c476d56d7d4dc6a54a60a77314 derived COPY set
Browse filesReusable Dockerfile-COPY-derived deploy from szl-holdings/a11oy 83dbdbb2269145c476d56d7d4dc6a54a60a77314.
Files: 1210 Pruned: 0
Derived from Dockerfile COPY sources (NO hand-maintained allowlist).
Signed-off-by: SZL Holdings <noreply@szlholdings.ai>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Dockerfile +7 -0
- a11oy_ecosystem_atlas.py +6 -0
- organ_integrity.py +602 -0
- pages/anatomy-v5.html +35 -11
- pages/organs-integrity.html +325 -0
- serve.py +10 -0
- szl_organ_integrity.py +82 -0
Dockerfile
CHANGED
|
@@ -643,6 +643,13 @@ COPY a11oy_quant_signals_nav.py ./a11oy_quant_signals_nav.py
|
|
| 643 |
# wholesale above; this per-file image copies only the new Python registrar.
|
| 644 |
COPY a11oy_ecosystem_atlas.py ./a11oy_ecosystem_atlas.py
|
| 645 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 646 |
# AYLLU COUNCIL WALL (2026-07-21): /api/ayllu/wall + /ayllu/wall — server-side
|
| 647 |
# per-request DSSE re-verification of committed council decision receipts,
|
| 648 |
# fetched from the public GitHub repo. Fail-closed; key honesty in-band.
|
|
|
|
| 643 |
# wholesale above; this per-file image copies only the new Python registrar.
|
| 644 |
COPY a11oy_ecosystem_atlas.py ./a11oy_ecosystem_atlas.py
|
| 645 |
|
| 646 |
+
# FIVE-ORGAN FAIL-CLOSED KERNEL (2026-08-29): GET/POST /api/a11oy/v1/organs/integrity
|
| 647 |
+
# + Evidence Bay at /organs/integrity. Stdlib SHA-256. Energy UNAVAILABLE.
|
| 648 |
+
# Anatomy v5 and living-anatomy prove HEART/BRAIN/CIRCULATORY/NERVOUS/SKELETON LIVE/DOWN.
|
| 649 |
+
# pages/organs-integrity.html rides the wholesale COPY pages/ above.
|
| 650 |
+
COPY organ_integrity.py ./organ_integrity.py
|
| 651 |
+
COPY szl_organ_integrity.py ./szl_organ_integrity.py
|
| 652 |
+
|
| 653 |
# AYLLU COUNCIL WALL (2026-07-21): /api/ayllu/wall + /ayllu/wall — server-side
|
| 654 |
# per-request DSSE re-verification of committed council decision receipts,
|
| 655 |
# fetched from the public GitHub repo. Fail-closed; key honesty in-band.
|
a11oy_ecosystem_atlas.py
CHANGED
|
@@ -89,6 +89,12 @@ CURATED_SURFACES: dict[str, list[dict[str, str]]] = {
|
|
| 89 |
"href": "/living-anatomy",
|
| 90 |
"owner": "szl-holdings/a11oy",
|
| 91 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
],
|
| 93 |
"holographic": [
|
| 94 |
{
|
|
|
|
| 89 |
"href": "/living-anatomy",
|
| 90 |
"owner": "szl-holdings/a11oy",
|
| 91 |
},
|
| 92 |
+
{
|
| 93 |
+
"id": "Fail-closed organ integrity",
|
| 94 |
+
"kind": "runtime",
|
| 95 |
+
"href": "/organs/integrity",
|
| 96 |
+
"owner": "szl-holdings/szl-organ-integrity",
|
| 97 |
+
},
|
| 98 |
],
|
| 99 |
"holographic": [
|
| 100 |
{
|
organ_integrity.py
ADDED
|
@@ -0,0 +1,602 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
# SPDX-License-Identifier: Apache-2.0
|
| 3 |
+
# Copyright 2026 SZL Holdings
|
| 4 |
+
# Signed-off-by: Lutar, Stephen P. <stephenlutar2@gmail.com>
|
| 5 |
+
"""Five-organ fail-closed integrity kernel.
|
| 6 |
+
|
| 7 |
+
Stdlib only. Real SHA-256. Advisory Λ. Energy UNAVAILABLE. Never a fabricated
|
| 8 |
+
joule. Locked-proven stays exactly 8. Λ uniqueness is Conjecture 1 OPEN.
|
| 9 |
+
proven_trust is False.
|
| 10 |
+
|
| 11 |
+
This is the replayable contract the 3D atlas (szl-holdings/anatomy) maps and
|
| 12 |
+
the KHIPU Space (SZLHOLDINGS/szl-khipu) runs in NumPy. This surface is the
|
| 13 |
+
same fail-closed body, hashed with hashlib.sha256 — not a Three.js rehost,
|
| 14 |
+
not a joule, not a theorem.
|
| 15 |
+
"""
|
| 16 |
+
from __future__ import annotations
|
| 17 |
+
|
| 18 |
+
import argparse
|
| 19 |
+
import hashlib
|
| 20 |
+
import json
|
| 21 |
+
import math
|
| 22 |
+
import sys
|
| 23 |
+
from datetime import datetime, timezone
|
| 24 |
+
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
| 25 |
+
from typing import Any, Iterable, Mapping, Sequence
|
| 26 |
+
from urllib.parse import parse_qs, urlparse
|
| 27 |
+
|
| 28 |
+
DOCTRINE = "v11 LOCKED"
|
| 29 |
+
KERNEL_COMMIT = "c7c0ba17"
|
| 30 |
+
LOCKED_EIGHT = ("F1", "F4", "F7", "F11", "F12", "F18", "F19", "F22")
|
| 31 |
+
YUYAY_AXES = (
|
| 32 |
+
"moralGrounding",
|
| 33 |
+
"measurabilityHonesty",
|
| 34 |
+
"empiricalGrounding",
|
| 35 |
+
"logicalConsistency",
|
| 36 |
+
"sourceTransparency",
|
| 37 |
+
"reproducibility",
|
| 38 |
+
"licenseHygiene",
|
| 39 |
+
"scopeDiscipline",
|
| 40 |
+
"claimCalibration",
|
| 41 |
+
"evalAwareness",
|
| 42 |
+
"deceptionKeywords",
|
| 43 |
+
"conflictingDirectives",
|
| 44 |
+
"reversalDirective",
|
| 45 |
+
)
|
| 46 |
+
YUYAY_FLOORS = (0.95, 0.95) + (0.90,) * 11
|
| 47 |
+
CONJECTURE_1 = (
|
| 48 |
+
"Any two aggregators satisfying A1–A4 agree on every input. OPEN (sorry). "
|
| 49 |
+
"Unconditional uniqueness under kernel A1–A5 is machine-checked FALSE."
|
| 50 |
+
)
|
| 51 |
+
WILLAY_NOTE = (
|
| 52 |
+
"Refusals are tamper-EVIDENT, not tamper-proof. Auditable rules. "
|
| 53 |
+
"Trust ceiling 0.97. WILLAY is conscience, not a sixth proven organ."
|
| 54 |
+
)
|
| 55 |
+
ZERO = "0" * 64
|
| 56 |
+
CHAIN_OPS = ("anatomy.brain", "anatomy.heart", "anatomy.skeleton")
|
| 57 |
+
ORGAN_SPEC = (
|
| 58 |
+
{
|
| 59 |
+
"id": "brain",
|
| 60 |
+
"name": "BRAIN",
|
| 61 |
+
"quechua": "YACHAY",
|
| 62 |
+
"formulas": ("F1",),
|
| 63 |
+
"role": "read-only reasoning cortex — never holds write authority",
|
| 64 |
+
},
|
| 65 |
+
{
|
| 66 |
+
"id": "heart",
|
| 67 |
+
"name": "HEART",
|
| 68 |
+
"quechua": "YUYAY",
|
| 69 |
+
"formulas": ("F4", "F11"),
|
| 70 |
+
"role": "13-axis conjunctive critique gate — advisory Λ",
|
| 71 |
+
},
|
| 72 |
+
{
|
| 73 |
+
"id": "circulatory",
|
| 74 |
+
"name": "CIRCULATORY",
|
| 75 |
+
"quechua": "YAWAR",
|
| 76 |
+
"formulas": ("F7", "F22"),
|
| 77 |
+
"role": "append-only receipt bus — SHA-256",
|
| 78 |
+
},
|
| 79 |
+
{
|
| 80 |
+
"id": "nervous",
|
| 81 |
+
"name": "NERVOUS",
|
| 82 |
+
"quechua": "OTel",
|
| 83 |
+
"formulas": ("F12",),
|
| 84 |
+
"role": "telemetry spine — energy UNAVAILABLE",
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
"id": "skeleton",
|
| 88 |
+
"name": "SKELETON",
|
| 89 |
+
"quechua": "Khipu",
|
| 90 |
+
"formulas": ("F18", "F19"),
|
| 91 |
+
"role": "locked-8 formula spine — CHECKED ≠ Lean PROVEN",
|
| 92 |
+
},
|
| 93 |
+
)
|
| 94 |
+
|
| 95 |
+
proven_trust = False
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
def _sha256_hex(text: str) -> str:
|
| 99 |
+
return hashlib.sha256(text.encode("utf-8")).hexdigest()
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
def _now() -> str:
|
| 103 |
+
return datetime.now(timezone.utc).replace(microsecond=0).isoformat().replace("+00:00", "Z")
|
| 104 |
+
|
| 105 |
+
|
| 106 |
+
def wgm(xs: Sequence[float], ws: Sequence[float]) -> float:
|
| 107 |
+
if len(xs) != len(ws) or not xs:
|
| 108 |
+
return 0.0
|
| 109 |
+
if any((not math.isfinite(x)) or x <= 0.0 for x in xs):
|
| 110 |
+
return 0.0
|
| 111 |
+
if any((not math.isfinite(w)) or w < 0.0 for w in ws):
|
| 112 |
+
return 0.0
|
| 113 |
+
if abs(sum(ws) - 1.0) >= 1e-9:
|
| 114 |
+
return 0.0
|
| 115 |
+
value = math.exp(sum(w * math.log(x) for x, w in zip(xs, ws)))
|
| 116 |
+
return value if math.isfinite(value) else 0.0
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
def evaluate_lambda(axes: Sequence[float]) -> dict[str, Any]:
|
| 120 |
+
n = len(axes)
|
| 121 |
+
weights = tuple(1.0 / n for _ in range(n)) if n else ()
|
| 122 |
+
value = wgm(axes, weights)
|
| 123 |
+
xv = list(axes)
|
| 124 |
+
a1 = True
|
| 125 |
+
for i, x in enumerate(xv):
|
| 126 |
+
if x >= 1.0:
|
| 127 |
+
continue
|
| 128 |
+
y = xv[:]
|
| 129 |
+
y[i] = min(1.0, x + 0.05)
|
| 130 |
+
if wgm(y, weights) + 1e-12 < value:
|
| 131 |
+
a1 = False
|
| 132 |
+
break
|
| 133 |
+
c = 0.5
|
| 134 |
+
a2 = abs(wgm([x * c for x in xv], weights) - c * value) <= 1e-9 * max(1.0, abs(c * value))
|
| 135 |
+
a3 = abs(wgm([0.7] * n, weights) - 0.7) <= 1e-9 if n else True
|
| 136 |
+
a4 = (not xv) or value <= max(xv) + 1e-12
|
| 137 |
+
a5 = True
|
| 138 |
+
if n >= 2:
|
| 139 |
+
a5 = abs(wgm(list(reversed(xv)), list(reversed(weights))) - value) <= 1e-9
|
| 140 |
+
axioms = [
|
| 141 |
+
{"id": "A1", "ok": a1, "detail": "monotone"},
|
| 142 |
+
{"id": "A2", "ok": a2, "detail": "homogeneous"},
|
| 143 |
+
{"id": "A3", "ok": a3, "detail": "Egyptian-exact"},
|
| 144 |
+
{"id": "A4", "ok": a4, "detail": "bounded-by-max"},
|
| 145 |
+
{"id": "A5", "ok": a5, "detail": "permutation-invariant"},
|
| 146 |
+
]
|
| 147 |
+
failed = next((a for a in axioms if not a["ok"]), None)
|
| 148 |
+
blocked = value == 0.0 or failed is not None
|
| 149 |
+
if blocked:
|
| 150 |
+
reason = "zero-routed or non-finite axis" if value == 0.0 else f"axiom {failed['id']} failed"
|
| 151 |
+
else:
|
| 152 |
+
reason = "advisory pass — uniqueness remains Conjecture 1 OPEN"
|
| 153 |
+
return {"value": float(value), "blocked": bool(blocked), "reason": reason, "axioms": axioms}
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
def yawar_chain(seed: int, tamper: bool) -> dict[str, Any]:
|
| 157 |
+
hops: list[dict[str, Any]] = []
|
| 158 |
+
prev = ZERO
|
| 159 |
+
for seq, op in enumerate(CHAIN_OPS):
|
| 160 |
+
material = f"{seq}|{op}|{prev}|{int(seed)}"
|
| 161 |
+
digest = _sha256_hex(material)
|
| 162 |
+
hops.append({"seq": seq, "op": op, "prev": prev, "digest": digest, "alg": "SHA-256"})
|
| 163 |
+
prev = digest
|
| 164 |
+
if tamper and len(hops) > 1:
|
| 165 |
+
hops[1] = dict(hops[1])
|
| 166 |
+
hops[1]["prev"] = "deadbeef" + hops[1]["prev"][8:]
|
| 167 |
+
walk = ZERO
|
| 168 |
+
ok = True
|
| 169 |
+
brk: int | None = None
|
| 170 |
+
for hop in hops:
|
| 171 |
+
expect = _sha256_hex(f"{hop['seq']}|{hop['op']}|{hop['prev']}|{int(seed)}")
|
| 172 |
+
if hop["prev"] != walk or expect != hop["digest"]:
|
| 173 |
+
ok = False
|
| 174 |
+
brk = int(hop["seq"])
|
| 175 |
+
break
|
| 176 |
+
walk = hop["digest"]
|
| 177 |
+
return {
|
| 178 |
+
"hops": hops,
|
| 179 |
+
"ok": ok,
|
| 180 |
+
"head": hops[-1]["digest"] if hops else ZERO,
|
| 181 |
+
"depth": len(hops),
|
| 182 |
+
"break_at": brk,
|
| 183 |
+
"alg": "SHA-256",
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
|
| 187 |
+
def canal_leak(leak: bool) -> float:
|
| 188 |
+
"""Deterministic canal-partition silhouette.
|
| 189 |
+
|
| 190 |
+
Tokens 0..11 assigned to canal i % 3. Cross-canal mass is zero unless a
|
| 191 |
+
leak is requested. This is the fail-closed rule, not NumPy YARQA.
|
| 192 |
+
MEASURED YARQA lives on SZLHOLDINGS/szl-khipu.
|
| 193 |
+
"""
|
| 194 |
+
return 1.0 if leak else 0.0
|
| 195 |
+
|
| 196 |
+
|
| 197 |
+
def _organ(
|
| 198 |
+
id_: str,
|
| 199 |
+
name: str,
|
| 200 |
+
quechua: str,
|
| 201 |
+
formulas: tuple[str, ...],
|
| 202 |
+
status: str,
|
| 203 |
+
honesty: str,
|
| 204 |
+
detail: str,
|
| 205 |
+
metric: float,
|
| 206 |
+
) -> dict[str, Any]:
|
| 207 |
+
return {
|
| 208 |
+
"id": id_,
|
| 209 |
+
"name": name,
|
| 210 |
+
"quechua": quechua,
|
| 211 |
+
"formulas": list(formulas),
|
| 212 |
+
"status": status,
|
| 213 |
+
"honesty": honesty,
|
| 214 |
+
"detail": detail,
|
| 215 |
+
"metric": float(metric),
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
|
| 219 |
+
def evaluate_anatomy(
|
| 220 |
+
*,
|
| 221 |
+
zero_heart: bool = False,
|
| 222 |
+
leak_canal: bool = False,
|
| 223 |
+
tamper_chain: bool = False,
|
| 224 |
+
fabricate_joule: bool = False,
|
| 225 |
+
break_skeleton: bool = False,
|
| 226 |
+
willay_fire: bool = False,
|
| 227 |
+
seed: int = 11,
|
| 228 |
+
) -> dict[str, Any]:
|
| 229 |
+
if proven_trust is True:
|
| 230 |
+
raise RuntimeError("refusing proven_trust true")
|
| 231 |
+
|
| 232 |
+
axes = list(YUYAY_FLOORS)
|
| 233 |
+
if zero_heart:
|
| 234 |
+
axes[0] = 0.0
|
| 235 |
+
heart = evaluate_lambda(axes)
|
| 236 |
+
heart_down = bool(heart["blocked"])
|
| 237 |
+
|
| 238 |
+
chain = yawar_chain(int(seed), bool(tamper_chain))
|
| 239 |
+
yawar_down = not bool(chain["ok"])
|
| 240 |
+
|
| 241 |
+
leaked = canal_leak(bool(leak_canal))
|
| 242 |
+
brain_down = leaked > 1e-9
|
| 243 |
+
|
| 244 |
+
nervous_down = bool(fabricate_joule)
|
| 245 |
+
|
| 246 |
+
rows = [
|
| 247 |
+
{"id": fid, "ok": not (break_skeleton and fid == "F18")}
|
| 248 |
+
for fid in LOCKED_EIGHT
|
| 249 |
+
]
|
| 250 |
+
skeleton_pass = sum(1 for r in rows if r["ok"])
|
| 251 |
+
skeleton_down = skeleton_pass < len(rows)
|
| 252 |
+
|
| 253 |
+
organs = [
|
| 254 |
+
_organ(
|
| 255 |
+
"brain",
|
| 256 |
+
"BRAIN",
|
| 257 |
+
"YACHAY",
|
| 258 |
+
("F1",),
|
| 259 |
+
"DOWN" if brain_down else "LIVE",
|
| 260 |
+
"LIVE",
|
| 261 |
+
(
|
| 262 |
+
f"cross-canal leak {leaked:.3e} — YACHAY cannot reason across a broken partition"
|
| 263 |
+
if brain_down
|
| 264 |
+
else (
|
| 265 |
+
"read-only cortex · canal-partition silhouette leak 0 · "
|
| 266 |
+
"MEASURED YARQA is the KHIPU Space"
|
| 267 |
+
)
|
| 268 |
+
),
|
| 269 |
+
leaked,
|
| 270 |
+
),
|
| 271 |
+
_organ(
|
| 272 |
+
"heart",
|
| 273 |
+
"HEART",
|
| 274 |
+
"YUYAY",
|
| 275 |
+
("F4", "F11"),
|
| 276 |
+
"DOWN" if heart_down else "LIVE",
|
| 277 |
+
"ADVISORY",
|
| 278 |
+
(
|
| 279 |
+
f"Λ {float(heart['value']):.4f} · {heart['reason']}"
|
| 280 |
+
if heart_down
|
| 281 |
+
else f"Λ {float(heart['value']):.4f} · advisory · Conjecture 1 OPEN"
|
| 282 |
+
),
|
| 283 |
+
float(heart["value"]),
|
| 284 |
+
),
|
| 285 |
+
_organ(
|
| 286 |
+
"circulatory",
|
| 287 |
+
"CIRCULATORY",
|
| 288 |
+
"YAWAR",
|
| 289 |
+
("F7", "F22"),
|
| 290 |
+
"DOWN" if yawar_down else "LIVE",
|
| 291 |
+
"LIVE",
|
| 292 |
+
(
|
| 293 |
+
f"chain break at {chain['break_at']} — prev pointer does not walk. Fail closed."
|
| 294 |
+
if yawar_down
|
| 295 |
+
else f"3-hop SHA-256 · depth {chain['depth']} · head {chain['head'][:16]}"
|
| 296 |
+
),
|
| 297 |
+
0.0 if chain["ok"] else 1.0,
|
| 298 |
+
),
|
| 299 |
+
_organ(
|
| 300 |
+
"nervous",
|
| 301 |
+
"NERVOUS",
|
| 302 |
+
"OTel",
|
| 303 |
+
("F12",),
|
| 304 |
+
"DOWN" if nervous_down else "LIVE",
|
| 305 |
+
"UNAVAILABLE",
|
| 306 |
+
(
|
| 307 |
+
"fabricated joule refused — energy stays UNAVAILABLE"
|
| 308 |
+
if nervous_down
|
| 309 |
+
else "loop-tax silhouette · energy UNAVAILABLE · never a fabricated joule"
|
| 310 |
+
),
|
| 311 |
+
1.0 if nervous_down else 0.0,
|
| 312 |
+
),
|
| 313 |
+
_organ(
|
| 314 |
+
"skeleton",
|
| 315 |
+
"SKELETON",
|
| 316 |
+
"Khipu",
|
| 317 |
+
("F18", "F19"),
|
| 318 |
+
"DOWN" if skeleton_down else "LIVE",
|
| 319 |
+
"ADVISORY",
|
| 320 |
+
(
|
| 321 |
+
f"locked-8 silhouettes {skeleton_pass}/{len(rows)} — a sorry cannot be painted green"
|
| 322 |
+
if skeleton_down
|
| 323 |
+
else (
|
| 324 |
+
f"locked-8 silhouettes {skeleton_pass}/{len(rows)} · "
|
| 325 |
+
f"CHECKED ≠ Lean PROVEN @ {KERNEL_COMMIT}"
|
| 326 |
+
)
|
| 327 |
+
),
|
| 328 |
+
float(skeleton_pass),
|
| 329 |
+
),
|
| 330 |
+
]
|
| 331 |
+
|
| 332 |
+
live_count = sum(1 for o in organs if o["status"] == "LIVE")
|
| 333 |
+
organ_down = any(o["status"] == "DOWN" for o in organs)
|
| 334 |
+
blocked = organ_down or bool(willay_fire)
|
| 335 |
+
if willay_fire:
|
| 336 |
+
reason = (
|
| 337 |
+
"WILLAY conscience veto — governance bypass refused "
|
| 338 |
+
"(tamper-EVIDENT, not tamper-proof)"
|
| 339 |
+
)
|
| 340 |
+
elif organ_down:
|
| 341 |
+
down = ", ".join(o["name"] for o in organs if o["status"] == "DOWN")
|
| 342 |
+
reason = f"organ integrity FAIL · {down} DOWN · fail closed"
|
| 343 |
+
else:
|
| 344 |
+
reason = (
|
| 345 |
+
f"organ integrity {live_count}/5 LIVE · Λ advisory · "
|
| 346 |
+
"energy UNAVAILABLE · Conjecture 1 OPEN"
|
| 347 |
+
)
|
| 348 |
+
|
| 349 |
+
return {
|
| 350 |
+
"organs": organs,
|
| 351 |
+
"live_count": int(live_count),
|
| 352 |
+
"blocked": bool(blocked),
|
| 353 |
+
"verdict": "BLOCKED" if blocked else "ADVISORY_BODY",
|
| 354 |
+
"willay": {
|
| 355 |
+
"refused": bool(willay_fire),
|
| 356 |
+
"category": "bypass" if willay_fire else "none",
|
| 357 |
+
"note": WILLAY_NOTE,
|
| 358 |
+
},
|
| 359 |
+
"energy": "UNAVAILABLE",
|
| 360 |
+
"energy_j": None,
|
| 361 |
+
"lambda_advisory": True,
|
| 362 |
+
"conjecture_1": "OPEN",
|
| 363 |
+
"conjecture_1_statement": CONJECTURE_1,
|
| 364 |
+
"locked_proven": 8,
|
| 365 |
+
"locked_ids": list(LOCKED_EIGHT),
|
| 366 |
+
"kernel_commit": KERNEL_COMMIT,
|
| 367 |
+
"doctrine": DOCTRINE,
|
| 368 |
+
"chain_head": chain["head"],
|
| 369 |
+
"chain_ok": bool(chain["ok"]),
|
| 370 |
+
"chain_alg": "SHA-256",
|
| 371 |
+
"chain": chain,
|
| 372 |
+
"lambda": heart,
|
| 373 |
+
"proven_trust": False,
|
| 374 |
+
"trust_ceiling": 0.97,
|
| 375 |
+
"reason": reason,
|
| 376 |
+
"seed": int(seed),
|
| 377 |
+
"tamper": {
|
| 378 |
+
"zero_heart": bool(zero_heart),
|
| 379 |
+
"leak_canal": bool(leak_canal),
|
| 380 |
+
"tamper_chain": bool(tamper_chain),
|
| 381 |
+
"fabricate_joule": bool(fabricate_joule),
|
| 382 |
+
"break_skeleton": bool(break_skeleton),
|
| 383 |
+
"willay_fire": bool(willay_fire),
|
| 384 |
+
},
|
| 385 |
+
"not_a_rehost": (
|
| 386 |
+
"szl-holdings/anatomy 3D atlas is SLSA L1 static viz — "
|
| 387 |
+
"this kernel is the integrity check"
|
| 388 |
+
),
|
| 389 |
+
"checked_at": _now(),
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
|
| 393 |
+
def envelope(ev: Mapping[str, Any]) -> dict[str, Any]:
|
| 394 |
+
payload = json.dumps(ev, sort_keys=True, separators=(",", ":"), default=str)
|
| 395 |
+
return {
|
| 396 |
+
"ok": True,
|
| 397 |
+
"surface": "szl-organ-integrity",
|
| 398 |
+
"receipt_sha256": _sha256_hex(payload),
|
| 399 |
+
"signing": "STRUCTURAL-ONLY — no key on this surface; tamper-EVIDENT hash, not a signature",
|
| 400 |
+
"body": dict(ev),
|
| 401 |
+
}
|
| 402 |
+
|
| 403 |
+
|
| 404 |
+
def parse_flags(src: Mapping[str, Any] | None) -> dict[str, Any]:
|
| 405 |
+
src = src or {}
|
| 406 |
+
|
| 407 |
+
def flag(name: str) -> bool:
|
| 408 |
+
v = src.get(name, False)
|
| 409 |
+
if isinstance(v, bool):
|
| 410 |
+
return v
|
| 411 |
+
if isinstance(v, (int, float)):
|
| 412 |
+
return int(v) == 1
|
| 413 |
+
if isinstance(v, str):
|
| 414 |
+
return v.strip().lower() in {"1", "true", "yes", "on"}
|
| 415 |
+
if isinstance(v, list) and v:
|
| 416 |
+
return flag(v[0])
|
| 417 |
+
return False
|
| 418 |
+
|
| 419 |
+
seed = src.get("seed", 11)
|
| 420 |
+
if isinstance(seed, list) and seed:
|
| 421 |
+
seed = seed[0]
|
| 422 |
+
try:
|
| 423 |
+
seed_i = int(seed)
|
| 424 |
+
except (TypeError, ValueError):
|
| 425 |
+
seed_i = 11
|
| 426 |
+
return {
|
| 427 |
+
"zero_heart": flag("zero_heart"),
|
| 428 |
+
"leak_canal": flag("leak_canal"),
|
| 429 |
+
"tamper_chain": flag("tamper_chain"),
|
| 430 |
+
"fabricate_joule": flag("fabricate_joule"),
|
| 431 |
+
"break_skeleton": flag("break_skeleton"),
|
| 432 |
+
"willay_fire": flag("willay_fire"),
|
| 433 |
+
"seed": seed_i,
|
| 434 |
+
}
|
| 435 |
+
|
| 436 |
+
|
| 437 |
+
def selftest() -> dict[str, Any]:
|
| 438 |
+
healthy = evaluate_anatomy(seed=11)
|
| 439 |
+
assert healthy["live_count"] == 5, healthy["reason"]
|
| 440 |
+
assert healthy["blocked"] is False
|
| 441 |
+
assert healthy["energy"] == "UNAVAILABLE"
|
| 442 |
+
assert healthy["energy_j"] is None
|
| 443 |
+
assert healthy["proven_trust"] is False
|
| 444 |
+
assert healthy["locked_proven"] == 8
|
| 445 |
+
assert healthy["lambda_advisory"] is True
|
| 446 |
+
assert healthy["chain"]["alg"] == "SHA-256"
|
| 447 |
+
assert len(healthy["chain"]["head"]) == 64
|
| 448 |
+
|
| 449 |
+
z = evaluate_anatomy(zero_heart=True, seed=11)
|
| 450 |
+
assert z["blocked"] is True
|
| 451 |
+
assert z["organs"][1]["status"] == "DOWN"
|
| 452 |
+
assert z["organs"][1]["metric"] == 0.0
|
| 453 |
+
|
| 454 |
+
t = evaluate_anatomy(tamper_chain=True, seed=11)
|
| 455 |
+
assert t["blocked"] is True
|
| 456 |
+
assert t["chain_ok"] is False
|
| 457 |
+
assert t["organs"][2]["status"] == "DOWN"
|
| 458 |
+
|
| 459 |
+
j = evaluate_anatomy(fabricate_joule=True, seed=11)
|
| 460 |
+
assert j["blocked"] is True
|
| 461 |
+
assert j["organs"][3]["status"] == "DOWN"
|
| 462 |
+
assert j["energy_j"] is None
|
| 463 |
+
|
| 464 |
+
s = evaluate_anatomy(break_skeleton=True, seed=11)
|
| 465 |
+
assert s["blocked"] is True
|
| 466 |
+
assert s["organs"][4]["metric"] == 7
|
| 467 |
+
|
| 468 |
+
w = evaluate_anatomy(willay_fire=True, seed=11)
|
| 469 |
+
assert w["blocked"] is True
|
| 470 |
+
assert w["willay"]["refused"] is True
|
| 471 |
+
assert w["live_count"] == 5
|
| 472 |
+
|
| 473 |
+
l = evaluate_anatomy(leak_canal=True, seed=11)
|
| 474 |
+
assert l["blocked"] is True
|
| 475 |
+
assert l["organs"][0]["status"] == "DOWN"
|
| 476 |
+
|
| 477 |
+
return {"ok": True, "cases": 7, "healthy_head": healthy["chain_head"]}
|
| 478 |
+
|
| 479 |
+
|
| 480 |
+
def _json_bytes(obj: Any, status: int = 200) -> tuple[int, bytes, str]:
|
| 481 |
+
raw = json.dumps(obj, indent=2, default=str).encode("utf-8")
|
| 482 |
+
return status, raw, "application/json; charset=utf-8"
|
| 483 |
+
|
| 484 |
+
|
| 485 |
+
class Handler(BaseHTTPRequestHandler):
|
| 486 |
+
server_version = "szl-organ-integrity/1.0"
|
| 487 |
+
|
| 488 |
+
def log_message(self, fmt: str, *args: Any) -> None: # noqa: A003
|
| 489 |
+
sys.stderr.write("%s - %s\n" % (self.address_string(), fmt % args))
|
| 490 |
+
|
| 491 |
+
def _cors(self) -> None:
|
| 492 |
+
self.send_header("Access-Control-Allow-Origin", "*")
|
| 493 |
+
self.send_header("Access-Control-Allow-Methods", "GET, POST, OPTIONS")
|
| 494 |
+
self.send_header("Access-Control-Allow-Headers", "content-type")
|
| 495 |
+
self.send_header("Cache-Control", "no-store")
|
| 496 |
+
|
| 497 |
+
def do_OPTIONS(self) -> None: # noqa: N802
|
| 498 |
+
self.send_response(204)
|
| 499 |
+
self._cors()
|
| 500 |
+
self.end_headers()
|
| 501 |
+
|
| 502 |
+
def do_GET(self) -> None: # noqa: N802
|
| 503 |
+
parsed = urlparse(self.path)
|
| 504 |
+
path = parsed.path.rstrip("/") or "/"
|
| 505 |
+
qs = parse_qs(parsed.query)
|
| 506 |
+
if path in {"/healthz", "/readyz"}:
|
| 507 |
+
self._send(*_json_bytes({"ok": True, "energy": "UNAVAILABLE", "proven_trust": False}))
|
| 508 |
+
return
|
| 509 |
+
if path in {
|
| 510 |
+
"/api/organs/integrity",
|
| 511 |
+
"/api/a11oy/v1/organs/integrity",
|
| 512 |
+
"/v1/organs/integrity",
|
| 513 |
+
}:
|
| 514 |
+
flags = parse_flags(qs)
|
| 515 |
+
body = envelope(evaluate_anatomy(**flags))
|
| 516 |
+
self._send(*_json_bytes(body))
|
| 517 |
+
return
|
| 518 |
+
if path in {"/", "/index.html", "/organs/integrity"}:
|
| 519 |
+
html = _index_html()
|
| 520 |
+
self._send(200, html.encode("utf-8"), "text/html; charset=utf-8")
|
| 521 |
+
return
|
| 522 |
+
self._send(*_json_bytes({"ok": False, "error": "not found", "path": path}, 404))
|
| 523 |
+
|
| 524 |
+
def do_POST(self) -> None: # noqa: N802
|
| 525 |
+
parsed = urlparse(self.path)
|
| 526 |
+
path = parsed.path.rstrip("/") or "/"
|
| 527 |
+
if path not in {
|
| 528 |
+
"/api/organs/integrity",
|
| 529 |
+
"/api/a11oy/v1/organs/integrity",
|
| 530 |
+
"/v1/organs/integrity",
|
| 531 |
+
}:
|
| 532 |
+
self._send(*_json_bytes({"ok": False, "error": "not found"}, 404))
|
| 533 |
+
return
|
| 534 |
+
length = int(self.headers.get("Content-Length") or 0)
|
| 535 |
+
raw = self.rfile.read(max(0, min(length, 1_000_000))) if length else b"{}"
|
| 536 |
+
try:
|
| 537 |
+
data = json.loads(raw.decode("utf-8") or "{}")
|
| 538 |
+
except json.JSONDecodeError:
|
| 539 |
+
data = {}
|
| 540 |
+
if not isinstance(data, dict):
|
| 541 |
+
data = {}
|
| 542 |
+
flags = parse_flags(data)
|
| 543 |
+
body = envelope(evaluate_anatomy(**flags))
|
| 544 |
+
self._send(*_json_bytes(body))
|
| 545 |
+
|
| 546 |
+
def _send(self, status: int, raw: bytes, ctype: str) -> None:
|
| 547 |
+
self.send_response(status)
|
| 548 |
+
self.send_header("Content-Type", ctype)
|
| 549 |
+
self.send_header("Content-Length", str(len(raw)))
|
| 550 |
+
self._cors()
|
| 551 |
+
self.end_headers()
|
| 552 |
+
self.wfile.write(raw)
|
| 553 |
+
|
| 554 |
+
|
| 555 |
+
def _index_html() -> str:
|
| 556 |
+
from pathlib import Path
|
| 557 |
+
|
| 558 |
+
here = Path(__file__).resolve().parent
|
| 559 |
+
for candidate in (here / "index.html", here / "site" / "index.html"):
|
| 560 |
+
if candidate.is_file():
|
| 561 |
+
return candidate.read_text(encoding="utf-8")
|
| 562 |
+
return (
|
| 563 |
+
"<!doctype html><meta charset=utf-8><title>organ integrity</title>"
|
| 564 |
+
"<p>kernel live. POST /api/organs/integrity</p>"
|
| 565 |
+
)
|
| 566 |
+
|
| 567 |
+
|
| 568 |
+
def serve(host: str = "0.0.0.0", port: int = 7860) -> None:
|
| 569 |
+
httpd = ThreadingHTTPServer((host, port), Handler)
|
| 570 |
+
print(f"[szl-organ-integrity] {host}:{port} · SHA-256 · energy UNAVAILABLE", file=sys.stderr)
|
| 571 |
+
httpd.serve_forever()
|
| 572 |
+
|
| 573 |
+
|
| 574 |
+
def main(argv: Iterable[str] | None = None) -> int:
|
| 575 |
+
p = argparse.ArgumentParser(description="Five-organ fail-closed integrity kernel")
|
| 576 |
+
p.add_argument("--serve", action="store_true")
|
| 577 |
+
p.add_argument("--host", default="0.0.0.0")
|
| 578 |
+
p.add_argument("--port", type=int, default=7860)
|
| 579 |
+
p.add_argument("--tamper", nargs="*", default=[], help="zero_heart leak_canal tamper_chain fabricate_joule break_skeleton willay_fire")
|
| 580 |
+
p.add_argument("--seed", type=int, default=11)
|
| 581 |
+
args = p.parse_args(list(argv) if argv is not None else None)
|
| 582 |
+
if args.serve:
|
| 583 |
+
serve(args.host, args.port)
|
| 584 |
+
return 0
|
| 585 |
+
flags = {k: (k in set(args.tamper)) for k in (
|
| 586 |
+
"zero_heart",
|
| 587 |
+
"leak_canal",
|
| 588 |
+
"tamper_chain",
|
| 589 |
+
"fabricate_joule",
|
| 590 |
+
"break_skeleton",
|
| 591 |
+
"willay_fire",
|
| 592 |
+
)}
|
| 593 |
+
if args.tamper:
|
| 594 |
+
print(json.dumps(envelope(evaluate_anatomy(seed=args.seed, **flags)), indent=2))
|
| 595 |
+
return 0
|
| 596 |
+
result = selftest()
|
| 597 |
+
print(json.dumps(result, indent=2))
|
| 598 |
+
return 0 if result.get("ok") else 1
|
| 599 |
+
|
| 600 |
+
|
| 601 |
+
if __name__ == "__main__":
|
| 602 |
+
raise SystemExit(main())
|
pages/anatomy-v5.html
CHANGED
|
@@ -13,35 +13,39 @@
|
|
| 13 |
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:radial-gradient(circle at 50% -20%,rgba(45,137,115,.2),transparent 38%),linear-gradient(180deg,#06100e,var(--bg));color:var(--ink);font-family:var(--sans)}a{color:inherit;text-decoration:none}a,button{touch-action:manipulation}a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--teal);outline-offset:3px}.skip{position:fixed;left:12px;top:8px;z-index:100;transform:translateY(-160%);border-radius:8px;background:var(--teal);color:#03100c;padding:10px 13px;font:12px var(--mono)}.skip:focus{transform:none}.wrap{width:min(1220px,calc(100% - 32px));margin:auto}.mono{font-family:var(--mono)}
|
| 14 |
header{position:sticky;top:0;z-index:30;border-bottom:1px solid var(--line);background:rgba(5,11,10,.88);backdrop-filter:blur(18px)}header .wrap{min-height:66px;display:flex;align-items:center;gap:18px}.brand{min-height:44px;display:flex;align-items:center;gap:10px;font-weight:750}.mark{width:30px;height:30px;display:grid;place-items:center;border:1px solid var(--teal);border-radius:50%;color:var(--teal);box-shadow:0 0 24px rgba(58,244,200,.2)}nav{display:flex;gap:7px;align-items:center;margin-left:auto;flex-wrap:wrap}nav a{min-height:44px;display:inline-flex;align-items:center;font:11px var(--mono);color:var(--muted);padding:9px 11px;border-radius:9px}nav a:hover{background:rgba(58,244,200,.07);color:var(--ink)}nav .primary{border:1px solid rgba(58,244,200,.35);color:var(--teal)}
|
| 15 |
.hero{padding:64px 0 30px}.eyebrow{font:11px var(--mono);letter-spacing:.16em;color:var(--teal);text-transform:uppercase}.hero h1{font-size:clamp(2.7rem,7vw,6.4rem);line-height:.9;letter-spacing:-.06em;margin:18px 0}.hero h1 span{color:transparent;background:linear-gradient(90deg,var(--teal),var(--blue));background-clip:text}.hero p{max-width:820px;margin:0;color:var(--muted);font-size:1.08rem;line-height:1.7}.badges{display:flex;gap:8px;flex-wrap:wrap;margin-top:23px}.badge{border:1px solid var(--line);border-radius:999px;padding:7px 10px;color:var(--muted);font:10px var(--mono);overflow-wrap:anywhere}.badges a.badge{min-height:44px;display:inline-flex;align-items:center}.badge.live,.badge.measured{border-color:rgba(58,244,200,.42);color:var(--teal)}.badge.cached,.badge.stalecache,.badge.snapshot,.badge.modeled,.badge.observed,.badge.available,.badge.degraded,.badge.readyunmeasured{border-color:rgba(217,188,117,.4);color:var(--amber)}.badge.unavailable,.badge.error,.badge.unconfigured,.badge.conflict{border-color:rgba(236,130,126,.4);color:var(--red)}
|
| 16 |
-
.vitals{display:grid;grid-template-columns:repeat(
|
| 17 |
.tabs{position:sticky;top:67px;z-index:20;display:flex;gap:7px;overflow:auto;overscroll-behavior-inline:contain;scrollbar-width:thin;padding:12px 0;background:linear-gradient(180deg,rgba(5,11,10,.97),rgba(5,11,10,.83),transparent)}.tab{min-height:44px;border:1px solid var(--line);border-radius:999px;background:var(--panel);color:var(--muted);padding:9px 13px;white-space:nowrap;cursor:pointer;font:11px var(--mono)}.tab.active,.tab:hover{color:#03100c;background:var(--teal);border-color:var(--teal)}
|
| 18 |
.view{display:none;padding:15px 0 72px}.view.active{display:block}.section-head{display:flex;justify-content:space-between;align-items:end;gap:18px;margin:16px 0 20px}.section-head h2{font-size:clamp(1.7rem,4vw,3rem);letter-spacing:-.04em;margin:0}.section-head p{max-width:610px;color:var(--muted);line-height:1.6;margin:0}.panel{border:1px solid var(--line);border-radius:16px;background:linear-gradient(150deg,rgba(13,29,25,.93),rgba(6,13,11,.98));padding:20px}
|
| 19 |
.organism{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(300px,.85fr);gap:14px}.organism>*,.nervous-grid>*,.formula>*{min-width:0}.body{position:relative;min-height:570px;overflow:hidden}.body:before{content:"";position:absolute;inset:7% 15%;border:1px solid rgba(58,244,200,.12);border-radius:45% 45% 32% 32%;box-shadow:inset 0 0 90px rgba(58,244,200,.035)}.spine{position:absolute;top:16%;bottom:14%;left:50%;width:1px;background:linear-gradient(transparent,var(--teal),transparent);opacity:.45}.nerve{position:absolute;height:1px;background:linear-gradient(90deg,transparent,rgba(108,156,255,.48),transparent);transform-origin:left center}.organ{position:absolute;width:142px;min-height:82px;padding:12px;border:1px solid var(--line);border-radius:13px;background:rgba(8,19,16,.94);box-shadow:0 0 30px rgba(58,244,200,.035)}.organ b{display:block;font-size:13px}.organ small{display:block;margin-top:5px;color:var(--muted);font:9px var(--mono);line-height:1.4}.organ .dot{position:absolute;right:10px;top:10px;width:7px;height:7px;border-radius:50%;background:var(--red)}.organ.live .dot{background:var(--teal);box-shadow:0 0 10px var(--teal)}.organ.cached .dot,.organ.stalecache .dot,.organ.snapshot .dot,.organ.modeled .dot,.organ.observed .dot,.organ.available .dot,.organ.degraded .dot{background:var(--amber)}.brain{left:calc(50% - 71px);top:5%}.router{left:calc(50% - 71px);top:26%}.models{left:5%;top:26%}.kernels{right:5%;top:26%}.data{left:5%;top:53%}.spaces{right:5%;top:53%}.formulas{left:calc(50% - 71px);top:73%}.receipts{left:calc(50% - 71px);top:48%}.readout{display:grid;gap:10px}.readout article{min-width:0;border:1px solid var(--line);border-radius:13px;padding:15px;background:rgba(8,18,15,.7)}.readout h3{font-size:13px;margin:0 0 9px}.readout pre{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--muted);font:10px/1.55 var(--mono);max-height:165px;overflow:auto}.source{display:flex;justify-content:space-between;flex-wrap:wrap;gap:6px 12px;margin-top:10px;color:#668078;font:9px var(--mono)}.source span{min-width:0;overflow-wrap:anywhere}
|
| 20 |
.nervous-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:14px}.route-list,.formula-list{display:grid;gap:8px}.route{display:grid;grid-template-columns:minmax(130px,1fr) repeat(3,minmax(78px,.45fr));gap:10px;align-items:center;border:1px solid var(--line);border-radius:11px;padding:12px;background:rgba(6,14,12,.72);font:10px var(--mono)}.route strong{font:600 12px var(--sans);overflow-wrap:anywhere}.route span{color:var(--muted);overflow-wrap:anywhere}.route .signal.live{color:var(--teal)}.route .signal.cached,.route .signal.stalecache,.route .signal.snapshot,.route .signal.modeled,.route .signal.observed,.route .signal.available,.route .signal.degraded{color:var(--amber)}.route .signal.unavailable,.route .signal.error{color:var(--red)}.json{margin:0;max-height:570px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;color:#9bb3ad;font:10px/1.55 var(--mono)}
|
| 21 |
.formula-tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}.formula-tools input{min-height:44px;flex:1;min-width:180px;border:1px solid var(--line);border-radius:10px;background:#07110f;color:var(--ink);padding:11px 13px;font:11px var(--mono)}.formula-tools .badge{max-width:100%}.formula{display:grid;grid-template-columns:minmax(130px,.7fr) minmax(160px,1fr) 2fr;gap:12px;border:1px solid var(--line);border-radius:12px;padding:14px;background:rgba(7,16,14,.75)}.formula b{font-size:13px}.formula .tier{color:var(--blue);font:10px var(--mono);text-transform:uppercase}.formula p{margin:0;color:var(--muted);font:10px/1.55 var(--mono);overflow-wrap:anywhere}.empty{border:1px dashed var(--line);border-radius:13px;padding:26px;text-align:center;color:var(--muted)}
|
| 22 |
.wire-d-grid{display:grid;grid-template-columns:minmax(260px,.7fr) minmax(0,1.3fr);gap:14px}.probe-actions{display:grid;gap:10px;margin-top:18px}.probe-actions label{color:var(--muted);font:10px var(--mono);text-transform:uppercase}.probe-actions select,.probe-actions button{min-height:46px;border:1px solid var(--line);border-radius:10px;padding:10px 12px;font:11px var(--mono)}.probe-actions select{width:100%;background:#07110f;color:var(--ink)}.probe-actions button{cursor:pointer;background:var(--teal);color:#03100c;font-weight:750}.probe-actions button:disabled,.probe-actions select:disabled{cursor:not-allowed;opacity:.48}.wire-note{color:var(--muted);font-size:12px;line-height:1.65}.wire-note strong{color:var(--amber)}
|
| 23 |
-
footer{border-top:1px solid var(--line);padding:34px 0 48px;color:var(--muted);font-size:12px;line-height:1.65}footer .wrap{display:flex;justify-content:space-between;gap:30px;flex-wrap:wrap}footer a{color:var(--teal)}
|
| 24 |
-
@media(max-width:960px){.vitals{grid-template-columns:repeat(3,minmax(0,1fr))}.organism,.nervous-grid,.wire-d-grid{grid-template-columns:1fr}.body{min-height:540px}.route{grid-template-columns:1fr 1fr}.formula{grid-template-columns:1fr}}
|
| 25 |
@media(max-width:800px){.brand small{display:none}}
|
| 26 |
@media(max-width:680px){header{position:static}header .wrap{flex-wrap:wrap;padding:11px 0 8px}nav{width:100%;margin-left:0;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:thin}nav a{flex:0 0 auto}.tabs{top:0}}
|
| 27 |
-
@media(max-width:620px){.hero{padding-top:44px}.vitals{grid-template-columns:repeat(2,minmax(0,1fr))}.panel{padding:16px}.body{min-height:690px}.body:before{inset:5% 4%}.organ{width:126px}.brain{left:calc(50% - 63px)}.router{left:calc(50% - 63px);top:22%}.models{left:2%;top:39%}.kernels{right:2%;top:39%}.receipts{left:calc(50% - 63px);top:54%}.data{left:2%;top:69%}.spaces{right:2%;top:69%}.formulas{left:calc(50% - 63px);top:84%}.route{grid-template-columns:1fr}.section-head{align-items:start;flex-direction:column}.formula-tools{align-items:stretch;flex-direction:column}.formula-tools input{min-width:0;width:100%}}
|
| 28 |
</style>
|
| 29 |
</head>
|
| 30 |
<body>
|
| 31 |
<a class="skip" href="#main">Skip to content</a>
|
| 32 |
<header><div class="wrap">
|
| 33 |
<a class="brand" href="/"><span class="mark">A</span><span>a11oy <small class="mono" style="color:var(--muted);font-weight:400">/ Anatomy v5</small></span></a>
|
| 34 |
-
<nav aria-label="Primary"><a href="/ecosystem">Ecosystem</a><a href="/spaces">All Spaces</a><a href="/formulas">Formulas</a><a href="/living-anatomy">3D Anatomy</a><a class="primary" href="/console">Command center</a></nav>
|
| 35 |
</div></header>
|
| 36 |
<main id="main">
|
| 37 |
<section class="hero"><div class="wrap">
|
| 38 |
<div class="eyebrow">Real signals | one governed organism</div>
|
| 39 |
<h1>The estate is<br><span>alive and inspectable.</span></h1>
|
| 40 |
-
<p>Anatomy v5 joins the public inventory, Brain pulse, inference router, mesh, Space health, full wired formula index,
|
| 41 |
-
<div class="badges" id="probe-badges" aria-live="polite"><span class="badge">CONNECTING TO
|
| 42 |
</div></section>
|
| 43 |
<div class="wrap">
|
| 44 |
<section class="vitals" id="vitals" aria-live="polite"><div class="vital"><b>--</b><span>Loading evidence</span><small>No placeholder is a claim.</small></div></section>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
<div class="tabs" role="tablist" aria-label="Anatomy views">
|
| 46 |
<button class="tab active" id="tab-organism" data-view="organism" role="tab" aria-selected="true" aria-controls="view-organism" tabindex="0">Organism</button>
|
| 47 |
<button class="tab" id="tab-nervous" data-view="nervous" role="tab" aria-selected="false" aria-controls="view-nervous" tabindex="-1">Router nervous system</button>
|
|
@@ -95,7 +99,7 @@
|
|
| 95 |
</section>
|
| 96 |
</div>
|
| 97 |
</main>
|
| 98 |
-
<footer><div class="wrap"><span>Anatomy v5 is a read-only digital twin. It does not train models, mutate datasets, or mint receipts on GET. The Wire-D button is an explicit receipted POST.</span><span><a href="/api/a11oy/v1/ecosystem/atlas">Atlas JSON</a> | <a href="/api/a11oy/v1/genome">Genome JSON</a> | <a href="/api/a11oy/v1/formulas/index">Wired formula JSON</a> | <a href="/api/a11oy/v1/wire-d/status">Wire-D JSON</a> | <a href="/.well-known/szl-source.json">Source attestation</a></span></div></footer>
|
| 99 |
<script>
|
| 100 |
(()=>{
|
| 101 |
'use strict';
|
|
@@ -107,7 +111,8 @@
|
|
| 107 |
spaces:['/api/a11oy/v1/spaces/health'],
|
| 108 |
genome:['/api/a11oy/v1/genome'],
|
| 109 |
formulas:['/api/a11oy/v1/formulas/index'],
|
| 110 |
-
wireD:['/api/a11oy/v1/wire-d/status']
|
|
|
|
| 111 |
};
|
| 112 |
const probes={};
|
| 113 |
const esc=v=>String(v??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
|
|
@@ -144,6 +149,13 @@
|
|
| 144 |
return 'OBSERVED';
|
| 145 |
}
|
| 146 |
if(name==='wireD')return declared||'UNAVAILABLE';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
if(name==='formulas'||name==='genome'){
|
| 148 |
return ['UNAVAILABLE','ERROR','DEGRADED'].includes(declared)?declared:'AVAILABLE';
|
| 149 |
}
|
|
@@ -168,11 +180,23 @@
|
|
| 168 |
const routes=arrayAt(router,['routes','tiers','data.routes']);const wiredRows=arrayAt(formulas,['wired','formulas','entries']);const genomeRows=arrayAt(genome,['entries','genome']);const spaceRows=arrayAt(spaces,['spaces','resources','results']);
|
| 169 |
const surfacesLit=valueAt(brain,['lit.surfaces_lit','surfaces_lit.count','surfaces_lit','surface_count']);
|
| 170 |
const organsLit=valueAt(brain,['lit.organs_lit','organs_lit.count','organs_lit']);
|
|
|
|
|
|
|
| 171 |
const vitals=[
|
| 172 |
[simple(counts.models),'Models',probes.atlas?.state],[simple(counts.kernels),'Governed kernels',probes.atlas?.state],[simple(genomeRows.length||genome.count),'Formula genome',probes.genome?.state],
|
| 173 |
-
[simple(routes.length),'Router routes',probes.router?.state],[simple(surfacesLit),'Brain-lit surfaces',probes.brain?.state],[simple(spaceRows.length||counts.spaces),'Spaces observed',probes.spaces?.state]
|
|
|
|
| 174 |
];
|
| 175 |
document.getElementById('vitals').innerHTML=vitals.map(([v,l,s])=>`<div class="vital"><b>${esc(v)}</b><span>${esc(l)}</span><small>${esc(s||'UNAVAILABLE')} | source-derived</small></div>`).join('');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
const brainLit=[surfacesLit!==null?surfacesLit+' surfaces':null,organsLit!==null?organsLit+' organs':null].filter(Boolean).join(' | ');
|
| 177 |
document.getElementById('organ-brain').textContent=brainLit||probes.brain?.state||'UNAVAILABLE';
|
| 178 |
document.getElementById('organ-router').textContent=routes.length?routes.length+' routes observed':(probes.router?.state||'UNAVAILABLE');
|
|
@@ -182,7 +206,7 @@
|
|
| 182 |
document.getElementById('organ-spaces').textContent=counts.spaces!==undefined?counts.spaces+' inventory entries':(probes.spaces?.state||'UNAVAILABLE');
|
| 183 |
document.getElementById('organ-formulas').textContent=genomeRows.length?genomeRows.length+' genome | '+wiredRows.length+' wired':(probes.genome?.state||'UNAVAILABLE');
|
| 184 |
document.getElementById('organ-receipts').textContent=probes.mesh?.state||'UNAVAILABLE';
|
| 185 |
-
const readoutKeys=['brain','router','atlas'
|
| 186 |
document.getElementById('readout').innerHTML=readoutKeys.map(key=>{const p=probes[key];return `<article><h3>${esc(key[0].toUpperCase()+key.slice(1))} <span class="badge ${stateClass(p?.state)}">${esc(p?.state||'UNAVAILABLE')}</span></h3><pre>${esc(p?.data?bounded(p.data,620):(p?.error||'No response'))}</pre><div class="source"><span>${esc(p?.endpoint)}</span><span>${esc(p?.read_at||'')}</span></div></article>`}).join('');
|
| 187 |
renderRoutes(routes,router);renderFormulas(genomeRows,wiredRows);renderWireD(probes.wireD);document.getElementById('mesh-json').textContent=probes.mesh?.data?bounded(probes.mesh.data,12000):(probes.mesh?.error||'UNAVAILABLE');
|
| 188 |
document.getElementById('raw-json').textContent=bounded(probes,32000);
|
|
|
|
| 13 |
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:radial-gradient(circle at 50% -20%,rgba(45,137,115,.2),transparent 38%),linear-gradient(180deg,#06100e,var(--bg));color:var(--ink);font-family:var(--sans)}a{color:inherit;text-decoration:none}a,button{touch-action:manipulation}a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--teal);outline-offset:3px}.skip{position:fixed;left:12px;top:8px;z-index:100;transform:translateY(-160%);border-radius:8px;background:var(--teal);color:#03100c;padding:10px 13px;font:12px var(--mono)}.skip:focus{transform:none}.wrap{width:min(1220px,calc(100% - 32px));margin:auto}.mono{font-family:var(--mono)}
|
| 14 |
header{position:sticky;top:0;z-index:30;border-bottom:1px solid var(--line);background:rgba(5,11,10,.88);backdrop-filter:blur(18px)}header .wrap{min-height:66px;display:flex;align-items:center;gap:18px}.brand{min-height:44px;display:flex;align-items:center;gap:10px;font-weight:750}.mark{width:30px;height:30px;display:grid;place-items:center;border:1px solid var(--teal);border-radius:50%;color:var(--teal);box-shadow:0 0 24px rgba(58,244,200,.2)}nav{display:flex;gap:7px;align-items:center;margin-left:auto;flex-wrap:wrap}nav a{min-height:44px;display:inline-flex;align-items:center;font:11px var(--mono);color:var(--muted);padding:9px 11px;border-radius:9px}nav a:hover{background:rgba(58,244,200,.07);color:var(--ink)}nav .primary{border:1px solid rgba(58,244,200,.35);color:var(--teal)}
|
| 15 |
.hero{padding:64px 0 30px}.eyebrow{font:11px var(--mono);letter-spacing:.16em;color:var(--teal);text-transform:uppercase}.hero h1{font-size:clamp(2.7rem,7vw,6.4rem);line-height:.9;letter-spacing:-.06em;margin:18px 0}.hero h1 span{color:transparent;background:linear-gradient(90deg,var(--teal),var(--blue));background-clip:text}.hero p{max-width:820px;margin:0;color:var(--muted);font-size:1.08rem;line-height:1.7}.badges{display:flex;gap:8px;flex-wrap:wrap;margin-top:23px}.badge{border:1px solid var(--line);border-radius:999px;padding:7px 10px;color:var(--muted);font:10px var(--mono);overflow-wrap:anywhere}.badges a.badge{min-height:44px;display:inline-flex;align-items:center}.badge.live,.badge.measured{border-color:rgba(58,244,200,.42);color:var(--teal)}.badge.cached,.badge.stalecache,.badge.snapshot,.badge.modeled,.badge.observed,.badge.available,.badge.degraded,.badge.readyunmeasured{border-color:rgba(217,188,117,.4);color:var(--amber)}.badge.unavailable,.badge.error,.badge.unconfigured,.badge.conflict{border-color:rgba(236,130,126,.4);color:var(--red)}
|
| 16 |
+
.vitals{display:grid;grid-template-columns:repeat(7,1fr);gap:10px;margin:20px 0 18px}.vital{min-height:104px;border:1px solid var(--line);border-radius:14px;padding:15px;background:linear-gradient(150deg,rgba(13,29,25,.94),rgba(7,15,13,.96))}.vital b{display:block;margin-bottom:7px;color:var(--teal);font:650 1.45rem var(--mono);overflow-wrap:anywhere}.vital b.down{color:var(--red)}.vital span{color:var(--muted);font:10px var(--mono);text-transform:uppercase;letter-spacing:.08em}.vital small{display:block;margin-top:8px;color:#667e77;font:9px var(--mono)}
|
| 17 |
.tabs{position:sticky;top:67px;z-index:20;display:flex;gap:7px;overflow:auto;overscroll-behavior-inline:contain;scrollbar-width:thin;padding:12px 0;background:linear-gradient(180deg,rgba(5,11,10,.97),rgba(5,11,10,.83),transparent)}.tab{min-height:44px;border:1px solid var(--line);border-radius:999px;background:var(--panel);color:var(--muted);padding:9px 13px;white-space:nowrap;cursor:pointer;font:11px var(--mono)}.tab.active,.tab:hover{color:#03100c;background:var(--teal);border-color:var(--teal)}
|
| 18 |
.view{display:none;padding:15px 0 72px}.view.active{display:block}.section-head{display:flex;justify-content:space-between;align-items:end;gap:18px;margin:16px 0 20px}.section-head h2{font-size:clamp(1.7rem,4vw,3rem);letter-spacing:-.04em;margin:0}.section-head p{max-width:610px;color:var(--muted);line-height:1.6;margin:0}.panel{border:1px solid var(--line);border-radius:16px;background:linear-gradient(150deg,rgba(13,29,25,.93),rgba(6,13,11,.98));padding:20px}
|
| 19 |
.organism{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(300px,.85fr);gap:14px}.organism>*,.nervous-grid>*,.formula>*{min-width:0}.body{position:relative;min-height:570px;overflow:hidden}.body:before{content:"";position:absolute;inset:7% 15%;border:1px solid rgba(58,244,200,.12);border-radius:45% 45% 32% 32%;box-shadow:inset 0 0 90px rgba(58,244,200,.035)}.spine{position:absolute;top:16%;bottom:14%;left:50%;width:1px;background:linear-gradient(transparent,var(--teal),transparent);opacity:.45}.nerve{position:absolute;height:1px;background:linear-gradient(90deg,transparent,rgba(108,156,255,.48),transparent);transform-origin:left center}.organ{position:absolute;width:142px;min-height:82px;padding:12px;border:1px solid var(--line);border-radius:13px;background:rgba(8,19,16,.94);box-shadow:0 0 30px rgba(58,244,200,.035)}.organ b{display:block;font-size:13px}.organ small{display:block;margin-top:5px;color:var(--muted);font:9px var(--mono);line-height:1.4}.organ .dot{position:absolute;right:10px;top:10px;width:7px;height:7px;border-radius:50%;background:var(--red)}.organ.live .dot{background:var(--teal);box-shadow:0 0 10px var(--teal)}.organ.cached .dot,.organ.stalecache .dot,.organ.snapshot .dot,.organ.modeled .dot,.organ.observed .dot,.organ.available .dot,.organ.degraded .dot{background:var(--amber)}.brain{left:calc(50% - 71px);top:5%}.router{left:calc(50% - 71px);top:26%}.models{left:5%;top:26%}.kernels{right:5%;top:26%}.data{left:5%;top:53%}.spaces{right:5%;top:53%}.formulas{left:calc(50% - 71px);top:73%}.receipts{left:calc(50% - 71px);top:48%}.readout{display:grid;gap:10px}.readout article{min-width:0;border:1px solid var(--line);border-radius:13px;padding:15px;background:rgba(8,18,15,.7)}.readout h3{font-size:13px;margin:0 0 9px}.readout pre{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--muted);font:10px/1.55 var(--mono);max-height:165px;overflow:auto}.source{display:flex;justify-content:space-between;flex-wrap:wrap;gap:6px 12px;margin-top:10px;color:#668078;font:9px var(--mono)}.source span{min-width:0;overflow-wrap:anywhere}
|
| 20 |
.nervous-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:14px}.route-list,.formula-list{display:grid;gap:8px}.route{display:grid;grid-template-columns:minmax(130px,1fr) repeat(3,minmax(78px,.45fr));gap:10px;align-items:center;border:1px solid var(--line);border-radius:11px;padding:12px;background:rgba(6,14,12,.72);font:10px var(--mono)}.route strong{font:600 12px var(--sans);overflow-wrap:anywhere}.route span{color:var(--muted);overflow-wrap:anywhere}.route .signal.live{color:var(--teal)}.route .signal.cached,.route .signal.stalecache,.route .signal.snapshot,.route .signal.modeled,.route .signal.observed,.route .signal.available,.route .signal.degraded{color:var(--amber)}.route .signal.unavailable,.route .signal.error{color:var(--red)}.json{margin:0;max-height:570px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;color:#9bb3ad;font:10px/1.55 var(--mono)}
|
| 21 |
.formula-tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}.formula-tools input{min-height:44px;flex:1;min-width:180px;border:1px solid var(--line);border-radius:10px;background:#07110f;color:var(--ink);padding:11px 13px;font:11px var(--mono)}.formula-tools .badge{max-width:100%}.formula{display:grid;grid-template-columns:minmax(130px,.7fr) minmax(160px,1fr) 2fr;gap:12px;border:1px solid var(--line);border-radius:12px;padding:14px;background:rgba(7,16,14,.75)}.formula b{font-size:13px}.formula .tier{color:var(--blue);font:10px var(--mono);text-transform:uppercase}.formula p{margin:0;color:var(--muted);font:10px/1.55 var(--mono);overflow-wrap:anywhere}.empty{border:1px dashed var(--line);border-radius:13px;padding:26px;text-align:center;color:var(--muted)}
|
| 22 |
.wire-d-grid{display:grid;grid-template-columns:minmax(260px,.7fr) minmax(0,1.3fr);gap:14px}.probe-actions{display:grid;gap:10px;margin-top:18px}.probe-actions label{color:var(--muted);font:10px var(--mono);text-transform:uppercase}.probe-actions select,.probe-actions button{min-height:46px;border:1px solid var(--line);border-radius:10px;padding:10px 12px;font:11px var(--mono)}.probe-actions select{width:100%;background:#07110f;color:var(--ink)}.probe-actions button{cursor:pointer;background:var(--teal);color:#03100c;font-weight:750}.probe-actions button:disabled,.probe-actions select:disabled{cursor:not-allowed;opacity:.48}.wire-note{color:var(--muted);font-size:12px;line-height:1.65}.wire-note strong{color:var(--amber)}
|
| 23 |
+
.failclosed{margin:0 0 22px}.failclosed .eyebrow{margin-bottom:10px}.grid5{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}.grid5 .vital{min-height:92px}footer{border-top:1px solid var(--line);padding:34px 0 48px;color:var(--muted);font-size:12px;line-height:1.65}footer .wrap{display:flex;justify-content:space-between;gap:30px;flex-wrap:wrap}footer a{color:var(--teal)}
|
| 24 |
+
@media(max-width:1100px){.vitals,.grid5{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:960px){.vitals,.grid5{grid-template-columns:repeat(3,minmax(0,1fr))}.organism,.nervous-grid,.wire-d-grid{grid-template-columns:1fr}.body{min-height:540px}.route{grid-template-columns:1fr 1fr}.formula{grid-template-columns:1fr}}
|
| 25 |
@media(max-width:800px){.brand small{display:none}}
|
| 26 |
@media(max-width:680px){header{position:static}header .wrap{flex-wrap:wrap;padding:11px 0 8px}nav{width:100%;margin-left:0;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:thin}nav a{flex:0 0 auto}.tabs{top:0}}
|
| 27 |
+
@media(max-width:620px){.hero{padding-top:44px}.vitals,.grid5{grid-template-columns:repeat(2,minmax(0,1fr))}.panel{padding:16px}.body{min-height:690px}.body:before{inset:5% 4%}.organ{width:126px}.brain{left:calc(50% - 63px)}.router{left:calc(50% - 63px);top:22%}.models{left:2%;top:39%}.kernels{right:2%;top:39%}.receipts{left:calc(50% - 63px);top:54%}.data{left:2%;top:69%}.spaces{right:2%;top:69%}.formulas{left:calc(50% - 63px);top:84%}.route{grid-template-columns:1fr}.section-head{align-items:start;flex-direction:column}.formula-tools{align-items:stretch;flex-direction:column}.formula-tools input{min-width:0;width:100%}}
|
| 28 |
</style>
|
| 29 |
</head>
|
| 30 |
<body>
|
| 31 |
<a class="skip" href="#main">Skip to content</a>
|
| 32 |
<header><div class="wrap">
|
| 33 |
<a class="brand" href="/"><span class="mark">A</span><span>a11oy <small class="mono" style="color:var(--muted);font-weight:400">/ Anatomy v5</small></span></a>
|
| 34 |
+
<nav aria-label="Primary"><a href="/ecosystem">Ecosystem</a><a href="/organs/integrity">Organs</a><a href="/spaces">All Spaces</a><a href="/formulas">Formulas</a><a href="/living-anatomy">3D Anatomy</a><a class="primary" href="/console">Command center</a></nav>
|
| 35 |
</div></header>
|
| 36 |
<main id="main">
|
| 37 |
<section class="hero"><div class="wrap">
|
| 38 |
<div class="eyebrow">Real signals | one governed organism</div>
|
| 39 |
<h1>The estate is<br><span>alive and inspectable.</span></h1>
|
| 40 |
+
<p>Anatomy v5 joins the public inventory, Brain pulse, inference router, mesh, Space health, full wired formula index, Wire-D, and the fail-closed five-organ kernel (HEART/YUYAY, BRAIN/YACHAY, CIRCULATORY/YAWAR, NERVOUS/OTel, SKELETON/Khipu). Each organ keeps its source and state; a failed probe stays visibly unavailable. Zero a Yuyay axis and the body blocks.</p>
|
| 41 |
+
<div class="badges" id="probe-badges" aria-live="polite"><span class="badge">CONNECTING TO NINE EVIDENCE SURFACES</span></div>
|
| 42 |
</div></section>
|
| 43 |
<div class="wrap">
|
| 44 |
<section class="vitals" id="vitals" aria-live="polite"><div class="vital"><b>--</b><span>Loading evidence</span><small>No placeholder is a claim.</small></div></section>
|
| 45 |
+
<section class="failclosed" id="failclosed" aria-label="Fail-closed five-organ kernel">
|
| 46 |
+
<div class="eyebrow">Fail-closed kernel · HEART YUYAY · BRAIN YACHAY · CIRCULATORY YAWAR · NERVOUS OTel · SKELETON Khipu · energy UNAVAILABLE · Λ = Conjecture 1 OPEN</div>
|
| 47 |
+
<div class="grid5" id="failclosed-organs"><div class="vital"><b>--</b><span>Kernel pending</span><small>Never a fabricated LIVE.</small></div></div>
|
| 48 |
+
</section>
|
| 49 |
<div class="tabs" role="tablist" aria-label="Anatomy views">
|
| 50 |
<button class="tab active" id="tab-organism" data-view="organism" role="tab" aria-selected="true" aria-controls="view-organism" tabindex="0">Organism</button>
|
| 51 |
<button class="tab" id="tab-nervous" data-view="nervous" role="tab" aria-selected="false" aria-controls="view-nervous" tabindex="-1">Router nervous system</button>
|
|
|
|
| 99 |
</section>
|
| 100 |
</div>
|
| 101 |
</main>
|
| 102 |
+
<footer><div class="wrap"><span>Anatomy v5 is a read-only digital twin. It does not train models, mutate datasets, or mint receipts on GET. The Wire-D button is an explicit receipted POST.</span><span><a href="/api/a11oy/v1/ecosystem/atlas">Atlas JSON</a> | <a href="/api/a11oy/v1/genome">Genome JSON</a> | <a href="/api/a11oy/v1/formulas/index">Wired formula JSON</a> | <a href="/api/a11oy/v1/wire-d/status">Wire-D JSON</a> | <a href="/api/a11oy/v1/organs/integrity">Organ integrity JSON</a> | <a href="/organs/integrity">Evidence Bay</a> | <a href="/.well-known/szl-source.json">Source attestation</a></span></div></footer>
|
| 103 |
<script>
|
| 104 |
(()=>{
|
| 105 |
'use strict';
|
|
|
|
| 111 |
spaces:['/api/a11oy/v1/spaces/health'],
|
| 112 |
genome:['/api/a11oy/v1/genome'],
|
| 113 |
formulas:['/api/a11oy/v1/formulas/index'],
|
| 114 |
+
wireD:['/api/a11oy/v1/wire-d/status'],
|
| 115 |
+
integrity:['/api/a11oy/v1/organs/integrity','/api/organs/integrity','/v1/organs/integrity']
|
| 116 |
};
|
| 117 |
const probes={};
|
| 118 |
const esc=v=>String(v??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
|
|
|
|
| 149 |
return 'OBSERVED';
|
| 150 |
}
|
| 151 |
if(name==='wireD')return declared||'UNAVAILABLE';
|
| 152 |
+
if(name==='integrity'){
|
| 153 |
+
const ev=data?.body||data||{};
|
| 154 |
+
if(ev.blocked===true)return 'DEGRADED';
|
| 155 |
+
if(Number(ev.live_count)===5 && String(ev.verdict||'')==='ADVISORY_BODY')return 'LIVE';
|
| 156 |
+
if(Array.isArray(ev.organs)&&ev.organs.length)return 'OBSERVED';
|
| 157 |
+
return declared||'UNAVAILABLE';
|
| 158 |
+
}
|
| 159 |
if(name==='formulas'||name==='genome'){
|
| 160 |
return ['UNAVAILABLE','ERROR','DEGRADED'].includes(declared)?declared:'AVAILABLE';
|
| 161 |
}
|
|
|
|
| 180 |
const routes=arrayAt(router,['routes','tiers','data.routes']);const wiredRows=arrayAt(formulas,['wired','formulas','entries']);const genomeRows=arrayAt(genome,['entries','genome']);const spaceRows=arrayAt(spaces,['spaces','resources','results']);
|
| 181 |
const surfacesLit=valueAt(brain,['lit.surfaces_lit','surfaces_lit.count','surfaces_lit','surface_count']);
|
| 182 |
const organsLit=valueAt(brain,['lit.organs_lit','organs_lit.count','organs_lit']);
|
| 183 |
+
const integ=probes.integrity?.data?.body||probes.integrity?.data||{};
|
| 184 |
+
const integLive=integ.live_count;
|
| 185 |
const vitals=[
|
| 186 |
[simple(counts.models),'Models',probes.atlas?.state],[simple(counts.kernels),'Governed kernels',probes.atlas?.state],[simple(genomeRows.length||genome.count),'Formula genome',probes.genome?.state],
|
| 187 |
+
[simple(routes.length),'Router routes',probes.router?.state],[simple(surfacesLit),'Brain-lit surfaces',probes.brain?.state],[simple(spaceRows.length||counts.spaces),'Spaces observed',probes.spaces?.state],
|
| 188 |
+
[integLive==null?'--':integLive+'/5','Fail-closed organs',probes.integrity?.state]
|
| 189 |
];
|
| 190 |
document.getElementById('vitals').innerHTML=vitals.map(([v,l,s])=>`<div class="vital"><b>${esc(v)}</b><span>${esc(l)}</span><small>${esc(s||'UNAVAILABLE')} | source-derived</small></div>`).join('');
|
| 191 |
+
const fc=document.getElementById('failclosed-organs');
|
| 192 |
+
if(fc){
|
| 193 |
+
const organs=Array.isArray(integ.organs)?integ.organs:[];
|
| 194 |
+
if(organs.length){
|
| 195 |
+
fc.innerHTML=organs.map(o=>`<div class="vital"><b class="${o.status==='DOWN'?'down':''}">${esc(o.status||'--')}</b><span>${esc(o.name)} · ${esc(o.quechua)}</span><small>${esc((o.formulas||[]).join('+'))} · ${esc(o.honesty||'')} · ${esc(o.detail||'')}</small></div>`).join('');
|
| 196 |
+
} else {
|
| 197 |
+
fc.innerHTML=`<div class="vital"><b>--</b><span>Fail-closed kernel</span><small>${esc(probes.integrity?.error||probes.integrity?.state||'UNAVAILABLE')} · never faked LIVE</small></div>`;
|
| 198 |
+
}
|
| 199 |
+
}
|
| 200 |
const brainLit=[surfacesLit!==null?surfacesLit+' surfaces':null,organsLit!==null?organsLit+' organs':null].filter(Boolean).join(' | ');
|
| 201 |
document.getElementById('organ-brain').textContent=brainLit||probes.brain?.state||'UNAVAILABLE';
|
| 202 |
document.getElementById('organ-router').textContent=routes.length?routes.length+' routes observed':(probes.router?.state||'UNAVAILABLE');
|
|
|
|
| 206 |
document.getElementById('organ-spaces').textContent=counts.spaces!==undefined?counts.spaces+' inventory entries':(probes.spaces?.state||'UNAVAILABLE');
|
| 207 |
document.getElementById('organ-formulas').textContent=genomeRows.length?genomeRows.length+' genome | '+wiredRows.length+' wired':(probes.genome?.state||'UNAVAILABLE');
|
| 208 |
document.getElementById('organ-receipts').textContent=probes.mesh?.state||'UNAVAILABLE';
|
| 209 |
+
const readoutKeys=['integrity','brain','router','atlas'];
|
| 210 |
document.getElementById('readout').innerHTML=readoutKeys.map(key=>{const p=probes[key];return `<article><h3>${esc(key[0].toUpperCase()+key.slice(1))} <span class="badge ${stateClass(p?.state)}">${esc(p?.state||'UNAVAILABLE')}</span></h3><pre>${esc(p?.data?bounded(p.data,620):(p?.error||'No response'))}</pre><div class="source"><span>${esc(p?.endpoint)}</span><span>${esc(p?.read_at||'')}</span></div></article>`}).join('');
|
| 211 |
renderRoutes(routes,router);renderFormulas(genomeRows,wiredRows);renderWireD(probes.wireD);document.getElementById('mesh-json').textContent=probes.mesh?.data?bounded(probes.mesh.data,12000):(probes.mesh?.error||'UNAVAILABLE');
|
| 212 |
document.getElementById('raw-json').textContent=bounded(probes,32000);
|
pages/organs-integrity.html
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="utf-8" />
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 6 |
+
<meta name="color-scheme" content="dark" />
|
| 7 |
+
<meta name="theme-color" content="#05070d" />
|
| 8 |
+
<title>SZL organ integrity — five organs, fail closed</title>
|
| 9 |
+
<meta name="description" content="Replayable five-organ fail-closed kernel. Zero heart blocks blood. Fabricated joules are refused. SHA-256 chain. Λ = Conjecture 1 OPEN. Energy UNAVAILABLE." />
|
| 10 |
+
<style>
|
| 11 |
+
:root{
|
| 12 |
+
--bg:#05070d;--void:#080c14;--panel:#0b121b;--line:#1b2734;
|
| 13 |
+
--proof:#3af4c8;--lattice:#5b8dee;--gold:#e8c074;--cream:#eef3f6;
|
| 14 |
+
--para:#9fb1bf;--warn:#e88a6a;--dim:#6c7d8c;--false:#d76a6a;
|
| 15 |
+
}
|
| 16 |
+
*{box-sizing:border-box}
|
| 17 |
+
html,body{margin:0;background:var(--bg);color:var(--cream);
|
| 18 |
+
font:16px/1.5 ui-sans-serif,system-ui,Segoe UI,Roboto,Arial,sans-serif}
|
| 19 |
+
body{min-height:100vh;padding:24px 18px 64px;
|
| 20 |
+
background:
|
| 21 |
+
radial-gradient(120% 90% at 50% -10%, rgba(232,192,116,.09), transparent 60%),
|
| 22 |
+
radial-gradient(90% 70% at 12% 110%, rgba(58,244,200,.07), transparent 60%),
|
| 23 |
+
var(--bg)}
|
| 24 |
+
.wrap{max-width:980px;margin:0 auto;position:relative}
|
| 25 |
+
.wrap::before{content:"";position:fixed;inset:0;pointer-events:none;z-index:0;
|
| 26 |
+
background:
|
| 27 |
+
linear-gradient(rgba(58,244,200,.03) 1px, transparent 1px) 0 0 / 100% 34px,
|
| 28 |
+
linear-gradient(90deg, rgba(91,141,238,.028) 1px, transparent 1px) 0 0 / 34px 100%}
|
| 29 |
+
header,main,footer{position:relative;z-index:1}
|
| 30 |
+
.eyebrow{font:10.5px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
|
| 31 |
+
letter-spacing:1.4px;text-transform:uppercase;color:var(--gold)}
|
| 32 |
+
.glyph{font-size:clamp(48px,10vw,84px);line-height:1;color:var(--gold);
|
| 33 |
+
text-shadow:0 0 34px rgba(232,192,116,.4);margin:.1em 0 0}
|
| 34 |
+
h1{font-size:clamp(22px,3.6vw,32px);font-weight:600;margin:.15em 0 .2em}
|
| 35 |
+
.lede{color:var(--para);max-width:72ch;margin:0}
|
| 36 |
+
.badges{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 0}
|
| 37 |
+
.badge{font:10.5px ui-monospace,monospace;padding:3px 9px;border-radius:6px;
|
| 38 |
+
border:1px solid var(--line);color:var(--para);background:#10171f}
|
| 39 |
+
.badge b{color:var(--gold);font-weight:600}
|
| 40 |
+
.grid5{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin:18px 0}
|
| 41 |
+
.bay{display:grid;gap:12px;margin:22px 0}
|
| 42 |
+
.card,.metric,.part{border:1px solid var(--line);border-radius:12px;background:var(--panel);padding:14px 16px}
|
| 43 |
+
.metric .k,.part .k{font:10px ui-monospace,monospace;letter-spacing:.8px;text-transform:uppercase;color:var(--dim)}
|
| 44 |
+
.metric .v{font:26px/1.1 ui-monospace,monospace;margin-top:4px}
|
| 45 |
+
.v.ok{color:var(--proof)} .v.false{color:var(--false)} .v.conj{color:var(--gold)}
|
| 46 |
+
.part h2{margin:6px 0 8px;font-size:16px}
|
| 47 |
+
.part p,.part li{color:var(--para);font-size:14px}
|
| 48 |
+
.part ol{margin:0;padding-left:1.2em}
|
| 49 |
+
.hero{border:1px solid #34301f;border-radius:14px;
|
| 50 |
+
background:linear-gradient(180deg,rgba(232,192,116,.06),var(--void));
|
| 51 |
+
padding:16px 18px;margin:12px 0}
|
| 52 |
+
.hero .k{font:10px ui-monospace,monospace;letter-spacing:.8px;text-transform:uppercase;color:var(--dim)}
|
| 53 |
+
.hero .statement{font-size:15.5px;margin:.4em 0 0;line-height:1.55}
|
| 54 |
+
.verdict{display:inline-block;font:11px ui-monospace,monospace;letter-spacing:.5px;
|
| 55 |
+
padding:3px 10px;border-radius:6px;border:1px solid var(--gold);color:var(--gold);
|
| 56 |
+
background:rgba(232,192,116,.08);margin-top:10px}
|
| 57 |
+
.verdict.ok{border-color:var(--proof);color:var(--proof);background:rgba(58,244,200,.08)}
|
| 58 |
+
.verdict.false{border-color:var(--false);color:var(--false);background:rgba(215,106,106,.08)}
|
| 59 |
+
.controls{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
|
| 60 |
+
button,a.btn{font:600 12px ui-monospace,monospace;letter-spacing:.6px;text-transform:uppercase;
|
| 61 |
+
min-height:44px;padding:10px 14px;border-radius:8px;border:1px solid var(--line);
|
| 62 |
+
background:var(--void);color:var(--cream);cursor:pointer;text-decoration:none;display:inline-flex;align-items:center}
|
| 63 |
+
button.primary{background:var(--proof);color:var(--bg);border-color:var(--proof);
|
| 64 |
+
box-shadow:0 0 18px rgba(58,244,200,.18)}
|
| 65 |
+
button.danger{border-color:var(--false);color:var(--false)}
|
| 66 |
+
button[aria-pressed="true"]{background:rgba(215,106,106,.12);border-color:var(--false)}
|
| 67 |
+
pre{background:var(--void);border:1px solid var(--line);border-radius:10px;padding:12px;
|
| 68 |
+
overflow:auto;max-height:420px;font:12px/1.45 ui-monospace,monospace;color:var(--cream);white-space:pre-wrap}
|
| 69 |
+
a{color:var(--proof)}
|
| 70 |
+
footer{margin-top:28px;border-top:1px solid var(--line);padding-top:16px;
|
| 71 |
+
color:var(--dim);font:11px/1.7 ui-monospace,monospace}
|
| 72 |
+
@media (max-width:800px){.grid5{grid-template-columns:1fr 1fr}}
|
| 73 |
+
@media (max-width:520px){.grid5{grid-template-columns:1fr}}
|
| 74 |
+
</style>
|
| 75 |
+
</head>
|
| 76 |
+
<body>
|
| 77 |
+
<div class="wrap">
|
| 78 |
+
<header>
|
| 79 |
+
<div class="eyebrow">SZL Holdings · organ integrity · Evidence Bay</div>
|
| 80 |
+
<div class="glyph">Λ</div>
|
| 81 |
+
<h1>Five organs. Fail closed. Replay it yourself.</h1>
|
| 82 |
+
<p class="lede">
|
| 83 |
+
Zero a Yuyay axis and the heart stops — blood does not flow. Tamper the SHA-256
|
| 84 |
+
chain and YAWAR breaks. Ask for a joule and the nervous system refuses.
|
| 85 |
+
Paint a sorry green and the skeleton will not stand. Λ stays
|
| 86 |
+
<em>Conjecture 1 OPEN</em>. Energy is UNAVAILABLE. proven_trust is false.
|
| 87 |
+
</p>
|
| 88 |
+
<div class="badges">
|
| 89 |
+
<span class="badge">doctrine <b>v11 LOCKED</b></span>
|
| 90 |
+
<span class="badge">locked-8 <b>F1 F4 F7 F11 F12 F18 F19 F22</b></span>
|
| 91 |
+
<span class="badge">kernel <b>c7c0ba17</b></span>
|
| 92 |
+
<span class="badge">energy <b>UNAVAILABLE</b></span>
|
| 93 |
+
<span class="badge">chain <b>SHA-256</b></span>
|
| 94 |
+
<span class="badge">trust ceiling <b>0.97</b></span>
|
| 95 |
+
</div>
|
| 96 |
+
</header>
|
| 97 |
+
|
| 98 |
+
<section class="bay" aria-label="Evidence Bay">
|
| 99 |
+
<article class="part"><div class="k">1 · Purpose</div>
|
| 100 |
+
<h2>Prove the body, not the picture.</h2>
|
| 101 |
+
<p>The 3D atlas at <a href="https://huggingface.co/spaces/SZLHOLDINGS/anatomy">SZLHOLDINGS/anatomy</a>
|
| 102 |
+
is the map (SLSA L1 static viz). This page is the integrity kernel:
|
| 103 |
+
HEART / YUYAY, CIRCULATORY / YAWAR, BRAIN / YACHAY, NERVOUS / OTel, SKELETON / Khipu.
|
| 104 |
+
WILLAY is conscience, not a sixth proven organ.</p>
|
| 105 |
+
</article>
|
| 106 |
+
<article class="part"><div class="k">2 · Try</div>
|
| 107 |
+
<h2>Run a healthy cycle, then injure an organ.</h2>
|
| 108 |
+
<p>Buttons below flip one fail-closed rule. The same contract runs here in
|
| 109 |
+
Web Crypto SHA-256 and on the Python kernel
|
| 110 |
+
(<code>GET/POST /api/a11oy/v1/organs/integrity</code> on this command body).</p>
|
| 111 |
+
</article>
|
| 112 |
+
<article class="part"><div class="k">3 · Evidence</div>
|
| 113 |
+
<h2>A receipt you can copy.</h2>
|
| 114 |
+
<p>Each run emits organ LIVE/DOWN, a SHA-256 chain head, Λ advisory value,
|
| 115 |
+
energy UNAVAILABLE, and a structural receipt hash. Signing is STRUCTURAL-ONLY —
|
| 116 |
+
tamper-EVIDENT, not a signature.</p>
|
| 117 |
+
</article>
|
| 118 |
+
<article class="part"><div class="k">4 · Limits</div>
|
| 119 |
+
<h2>What this is not.</h2>
|
| 120 |
+
<p>Not a theorem. Not a joule. Not CUDA. Not Lean. Not DSSE authorship.
|
| 121 |
+
Canal leak on this stdlib/browser surface is the fail-closed <em>rule</em>;
|
| 122 |
+
MEASURED NumPy YARQA is the <a href="https://huggingface.co/spaces/SZLHOLDINGS/szl-khipu">KHIPU Space Anatomy tab</a>.
|
| 123 |
+
Locked-proven stays exactly 8. CHECKED ≠ PROVEN.</p>
|
| 124 |
+
</article>
|
| 125 |
+
<article class="part"><div class="k">5 · Reproduce</div>
|
| 126 |
+
<h2>Third party, no account.</h2>
|
| 127 |
+
<ol>
|
| 128 |
+
<li>This page: click <b>Healthy cycle</b>, then <b>Zero heart</b>.</li>
|
| 129 |
+
<li><code>python3 organ_integrity.py</code> then <code>python3 organ_integrity.py --tamper zero_heart</code></li>
|
| 130 |
+
<li>Source: <a href="https://github.com/szl-holdings/szl-organ-integrity">szl-holdings/szl-organ-integrity</a></li>
|
| 131 |
+
<li>This command body: <code>GET https://a-11-oy.com/api/a11oy/v1/organs/integrity</code></li>
|
| 132 |
+
<li>Digital twin: <a href="/anatomy-v5">/anatomy-v5</a> · 3D map: <a href="/living-anatomy">/living-anatomy</a></li>
|
| 133 |
+
</ol>
|
| 134 |
+
</article>
|
| 135 |
+
</section>
|
| 136 |
+
|
| 137 |
+
<div class="controls" role="group" aria-label="Tamper flags">
|
| 138 |
+
<button class="primary" id="run-healthy" type="button">Healthy cycle</button>
|
| 139 |
+
<button class="danger" data-flag="zero_heart" type="button">Zero heart</button>
|
| 140 |
+
<button class="danger" data-flag="tamper_chain" type="button">Tamper YAWAR</button>
|
| 141 |
+
<button class="danger" data-flag="fabricate_joule" type="button">Fabricate a joule</button>
|
| 142 |
+
<button class="danger" data-flag="leak_canal" type="button">Leak a canal</button>
|
| 143 |
+
<button class="danger" data-flag="break_skeleton" type="button">Paint a sorry green</button>
|
| 144 |
+
<button class="danger" data-flag="willay_fire" type="button">Governance bypass</button>
|
| 145 |
+
<a class="btn" href="https://github.com/szl-holdings/szl-organ-integrity">Source</a>
|
| 146 |
+
</div>
|
| 147 |
+
<p class="lede" id="surface-note">Running the in-browser SHA-256 kernel. Command-body API probed separately.</p>
|
| 148 |
+
<div class="hero" id="hero">
|
| 149 |
+
<span class="k">waiting for a cycle</span>
|
| 150 |
+
<p class="statement">Click Healthy cycle. Then injure an organ.</p>
|
| 151 |
+
</div>
|
| 152 |
+
<div class="grid5" id="organs" aria-live="polite"></div>
|
| 153 |
+
<pre id="receipt">receipt appears here</pre>
|
| 154 |
+
|
| 155 |
+
<footer>
|
| 156 |
+
Source <a href="https://github.com/szl-holdings/szl-organ-integrity">szl-holdings/szl-organ-integrity</a>
|
| 157 |
+
· kernel playground <a href="https://huggingface.co/spaces/SZLHOLDINGS/szl-khipu">SZLHOLDINGS/szl-khipu</a>
|
| 158 |
+
· map <a href="https://huggingface.co/spaces/SZLHOLDINGS/anatomy">SZLHOLDINGS/anatomy</a>
|
| 159 |
+
· command body <a href="https://a-11-oy.com/">a-11-oy.com</a><br />
|
| 160 |
+
SZL Holdings · governed AI you can prove · Λ = Conjecture 1, never a theorem ·
|
| 161 |
+
trust ceiling 0.97 · energy UNAVAILABLE · never a fabricated joule · Apache-2.0
|
| 162 |
+
</footer>
|
| 163 |
+
</div>
|
| 164 |
+
<script>
|
| 165 |
+
const ZERO = "0".repeat(64);
|
| 166 |
+
const FLOORS = [0.95, 0.95, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90];
|
| 167 |
+
const LOCKED = ["F1","F4","F7","F11","F12","F18","F19","F22"];
|
| 168 |
+
const OPS = ["anatomy.brain","anatomy.heart","anatomy.skeleton"];
|
| 169 |
+
|
| 170 |
+
function wgm(xs){
|
| 171 |
+
const n = xs.length, w = 1 / n;
|
| 172 |
+
if (xs.some(x => !Number.isFinite(x) || x <= 0)) return 0;
|
| 173 |
+
const v = Math.exp(xs.reduce((s,x) => s + w * Math.log(x), 0));
|
| 174 |
+
return Number.isFinite(v) ? v : 0;
|
| 175 |
+
}
|
| 176 |
+
async function sha256Hex(text){
|
| 177 |
+
const buf = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(text));
|
| 178 |
+
return [...new Uint8Array(buf)].map(b => b.toString(16).padStart(2,"0")).join("");
|
| 179 |
+
}
|
| 180 |
+
async function yawar(seed, tamper){
|
| 181 |
+
const hops = [];
|
| 182 |
+
let prev = ZERO;
|
| 183 |
+
for (let seq = 0; seq < OPS.length; seq++){
|
| 184 |
+
const op = OPS[seq];
|
| 185 |
+
const digest = await sha256Hex(`${seq}|${op}|${prev}|${seed}`);
|
| 186 |
+
hops.push({seq, op, prev, digest, alg:"SHA-256"});
|
| 187 |
+
prev = digest;
|
| 188 |
+
}
|
| 189 |
+
if (tamper && hops[1]) hops[1] = {...hops[1], prev: "deadbeef" + hops[1].prev.slice(8)};
|
| 190 |
+
let walk = ZERO, ok = true, brk = null;
|
| 191 |
+
for (const hop of hops){
|
| 192 |
+
const expect = await sha256Hex(`${hop.seq}|${hop.op}|${hop.prev}|${seed}`);
|
| 193 |
+
if (hop.prev !== walk || expect !== hop.digest){ ok = false; brk = hop.seq; break; }
|
| 194 |
+
walk = hop.digest;
|
| 195 |
+
}
|
| 196 |
+
return {hops, ok, head: hops[hops.length-1].digest, depth: hops.length, break_at: brk, alg:"SHA-256"};
|
| 197 |
+
}
|
| 198 |
+
async function evaluate(flags){
|
| 199 |
+
const seed = 11;
|
| 200 |
+
const axes = FLOORS.slice();
|
| 201 |
+
if (flags.zero_heart) axes[0] = 0;
|
| 202 |
+
const lam = wgm(axes);
|
| 203 |
+
const heartDown = lam === 0;
|
| 204 |
+
const chain = await yawar(seed, !!flags.tamper_chain);
|
| 205 |
+
const leaked = flags.leak_canal ? 1 : 0;
|
| 206 |
+
const brainDown = leaked > 1e-9;
|
| 207 |
+
const nervousDown = !!flags.fabricate_joule;
|
| 208 |
+
const rows = LOCKED.map(id => ({id, ok: !(flags.break_skeleton && id === "F18")}));
|
| 209 |
+
const skelPass = rows.filter(r => r.ok).length;
|
| 210 |
+
const skeletonDown = skelPass < rows.length;
|
| 211 |
+
const organs = [
|
| 212 |
+
{id:"brain", name:"BRAIN", quechua:"YACHAY", formulas:["F1"], status: brainDown?"DOWN":"LIVE", honesty:"LIVE",
|
| 213 |
+
detail: brainDown ? `cross-canal leak ${leaked.toExponential(3)}` : "read-only cortex · canal-partition silhouette leak 0",
|
| 214 |
+
metric: leaked},
|
| 215 |
+
{id:"heart", name:"HEART", quechua:"YUYAY", formulas:["F4","F11"], status: heartDown?"DOWN":"LIVE", honesty:"ADVISORY",
|
| 216 |
+
detail: heartDown ? `Λ ${lam.toFixed(4)} · zero-routed` : `Λ ${lam.toFixed(4)} · advisory · Conjecture 1 OPEN`,
|
| 217 |
+
metric: lam},
|
| 218 |
+
{id:"circulatory", name:"CIRCULATORY", quechua:"YAWAR", formulas:["F7","F22"], status: chain.ok?"LIVE":"DOWN", honesty:"LIVE",
|
| 219 |
+
detail: chain.ok ? `3-hop SHA-256 · head ${chain.head.slice(0,16)}` : `chain break at ${chain.break_at} · fail closed`,
|
| 220 |
+
metric: chain.ok?0:1},
|
| 221 |
+
{id:"nervous", name:"NERVOUS", quechua:"OTel", formulas:["F12"], status: nervousDown?"DOWN":"LIVE", honesty:"UNAVAILABLE",
|
| 222 |
+
detail: nervousDown ? "fabricated joule refused — energy stays UNAVAILABLE" : "energy UNAVAILABLE · never a fabricated joule",
|
| 223 |
+
metric: nervousDown?1:0},
|
| 224 |
+
{id:"skeleton", name:"SKELETON", quechua:"Khipu", formulas:["F18","F19"], status: skeletonDown?"DOWN":"LIVE", honesty:"ADVISORY",
|
| 225 |
+
detail: skeletonDown ? `locked-8 ${skelPass}/8 — a sorry cannot be painted green` : `locked-8 ${skelPass}/8 · CHECKED ≠ Lean PROVEN @ c7c0ba17`,
|
| 226 |
+
metric: skelPass}
|
| 227 |
+
];
|
| 228 |
+
const live = organs.filter(o => o.status==="LIVE").length;
|
| 229 |
+
const organDown = organs.some(o => o.status==="DOWN");
|
| 230 |
+
const blocked = organDown || !!flags.willay_fire;
|
| 231 |
+
let reason;
|
| 232 |
+
if (flags.willay_fire) reason = "WILLAY conscience veto — governance bypass refused (tamper-EVIDENT, not tamper-proof)";
|
| 233 |
+
else if (organDown) reason = `organ integrity FAIL · ${organs.filter(o=>o.status==="DOWN").map(o=>o.name).join(", ")} DOWN · fail closed`;
|
| 234 |
+
else reason = `organ integrity ${live}/5 LIVE · Λ advisory · energy UNAVAILABLE · Conjecture 1 OPEN`;
|
| 235 |
+
const body = {
|
| 236 |
+
organs, live_count: live, blocked, verdict: blocked ? "BLOCKED" : "ADVISORY_BODY",
|
| 237 |
+
energy:"UNAVAILABLE", energy_j:null, lambda_advisory:true, conjecture_1:"OPEN",
|
| 238 |
+
locked_proven:8, kernel_commit:"c7c0ba17", chain_head: chain.head, chain_ok: chain.ok,
|
| 239 |
+
chain_alg:"SHA-256", proven_trust:false, reason, seed,
|
| 240 |
+
surface:"browser-webcrypto-sha256", signing:"STRUCTURAL-ONLY"
|
| 241 |
+
};
|
| 242 |
+
const receipt = await sha256Hex(JSON.stringify(body));
|
| 243 |
+
return {ok:true, receipt_sha256: receipt, signing:"STRUCTURAL-ONLY — Web Crypto SHA-256", body};
|
| 244 |
+
}
|
| 245 |
+
function el(tag, className, text){
|
| 246 |
+
const n = document.createElement(tag);
|
| 247 |
+
if (className) n.className = className;
|
| 248 |
+
if (text != null) n.textContent = String(text);
|
| 249 |
+
return n;
|
| 250 |
+
}
|
| 251 |
+
function render(env, label){
|
| 252 |
+
const ev = env.body || env;
|
| 253 |
+
const blocked = !!ev.blocked;
|
| 254 |
+
const hero = document.getElementById("hero");
|
| 255 |
+
hero.replaceChildren();
|
| 256 |
+
hero.append(
|
| 257 |
+
el("span", "k", `${label} · ${ev.chain_alg || "SHA-256"} · kernel ${ev.kernel_commit || "c7c0ba17"}`),
|
| 258 |
+
el("p", "statement", `${ev.live_count}/5 LIVE · ${ev.reason || ""}`),
|
| 259 |
+
el("span", `verdict ${blocked?"false":"ok"}`,
|
| 260 |
+
`${blocked?"BLOCKED":"advisory body"} · energy UNAVAILABLE · Conjecture 1 OPEN`)
|
| 261 |
+
);
|
| 262 |
+
const organsEl = document.getElementById("organs");
|
| 263 |
+
organsEl.replaceChildren();
|
| 264 |
+
for (const o of (ev.organs || [])){
|
| 265 |
+
const card = el("div", "metric");
|
| 266 |
+
card.append(
|
| 267 |
+
el("div", "k", `${o.name} · ${o.quechua}`),
|
| 268 |
+
el("div", `v ${o.status==="DOWN"?"false":"ok"}`, o.status)
|
| 269 |
+
);
|
| 270 |
+
const meta = el("div", "k");
|
| 271 |
+
meta.style.marginTop = "6px";
|
| 272 |
+
meta.append(
|
| 273 |
+
document.createTextNode(`${o.honesty} · ${(o.formulas||[]).join("+")}`),
|
| 274 |
+
document.createElement("br"),
|
| 275 |
+
document.createTextNode(o.detail || "")
|
| 276 |
+
);
|
| 277 |
+
card.append(meta);
|
| 278 |
+
organsEl.append(card);
|
| 279 |
+
}
|
| 280 |
+
document.getElementById("receipt").textContent = JSON.stringify(env, null, 2);
|
| 281 |
+
}
|
| 282 |
+
async function run(flags, label){
|
| 283 |
+
const env = await evaluate(flags);
|
| 284 |
+
render(env, label + " · in-browser");
|
| 285 |
+
const endpoints = [
|
| 286 |
+
"/api/a11oy/v1/organs/integrity",
|
| 287 |
+
"/api/organs/integrity",
|
| 288 |
+
"/v1/organs/integrity"
|
| 289 |
+
];
|
| 290 |
+
for (const url of endpoints){
|
| 291 |
+
try{
|
| 292 |
+
const ctl = new AbortController();
|
| 293 |
+
const t = setTimeout(() => ctl.abort(), 4000);
|
| 294 |
+
const r = await fetch(url, {
|
| 295 |
+
method: Object.values(flags).some(Boolean) ? "POST" : "GET",
|
| 296 |
+
headers: {"content-type":"application/json"},
|
| 297 |
+
body: Object.values(flags).some(Boolean) ? JSON.stringify(flags) : undefined,
|
| 298 |
+
signal: ctl.signal, cache:"no-store"
|
| 299 |
+
});
|
| 300 |
+
clearTimeout(t);
|
| 301 |
+
if (!r.ok) continue;
|
| 302 |
+
const j = await r.json();
|
| 303 |
+
const verdict = (j.body && j.body.verdict) || j.verdict || "answered";
|
| 304 |
+
const rcpt = j.receipt_sha256 || "";
|
| 305 |
+
document.getElementById("surface-note").textContent =
|
| 306 |
+
`In-browser kernel ran. Live API ${url} verdict ${verdict}` +
|
| 307 |
+
(rcpt ? ` · receipt ${rcpt.slice(0,16)}…` : "") +
|
| 308 |
+
" — compare receipts.";
|
| 309 |
+
return;
|
| 310 |
+
} catch (e) { /* honest miss; browser kernel already rendered */ }
|
| 311 |
+
}
|
| 312 |
+
document.getElementById("surface-note").textContent =
|
| 313 |
+
"In-browser SHA-256 kernel ran. Command-body API not reachable from here yet — UNAVAILABLE, not faked.";
|
| 314 |
+
}
|
| 315 |
+
document.getElementById("run-healthy").addEventListener("click", () => run({}, "healthy"));
|
| 316 |
+
document.querySelectorAll("button[data-flag]").forEach(btn => {
|
| 317 |
+
btn.addEventListener("click", () => {
|
| 318 |
+
const flags = {[btn.getAttribute("data-flag")]: true};
|
| 319 |
+
run(flags, btn.textContent.trim());
|
| 320 |
+
});
|
| 321 |
+
});
|
| 322 |
+
run({}, "healthy");
|
| 323 |
+
</script>
|
| 324 |
+
</body>
|
| 325 |
+
</html>
|
serve.py
CHANGED
|
@@ -790,6 +790,16 @@ try:
|
|
| 790 |
except Exception as _szl_oh_e: # pragma: no cover
|
| 791 |
print(f"[a11oy] Organ-health proxy NOT registered: {_szl_oh_e!r}; existing routes unaffected", file=__import__("sys").stderr)
|
| 792 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 793 |
# ── Backend hardening (devJ) — szl_backend_hardening ──
|
| 794 |
# Reusable concurrent + short-timeout + TTL-cache helpers (probe_with_timeout,
|
| 795 |
# probe_all_concurrent, TTLCache, probe_fabric_pool, cached_aggregate) that the
|
|
|
|
| 790 |
except Exception as _szl_oh_e: # pragma: no cover
|
| 791 |
print(f"[a11oy] Organ-health proxy NOT registered: {_szl_oh_e!r}; existing routes unaffected", file=__import__("sys").stderr)
|
| 792 |
|
| 793 |
+
# FIVE-ORGAN FAIL-CLOSED KERNEL (2026-08-29): GET/POST /api/a11oy/v1/organs/integrity
|
| 794 |
+
# + Evidence Bay at /organs/integrity. Stdlib SHA-256. Energy UNAVAILABLE.
|
| 795 |
+
# Λ = Conjecture 1 OPEN. proven_trust false. Front-moved so exact routes beat SPA.
|
| 796 |
+
try:
|
| 797 |
+
import szl_organ_integrity as _szl_organ_integrity
|
| 798 |
+
_szl_oi_status = _szl_organ_integrity.register(app, ns="a11oy")
|
| 799 |
+
print(f"[a11oy] organ-integrity kernel registered: /api/a11oy/v1/organs/integrity ({_szl_oi_status})", file=__import__("sys").stderr)
|
| 800 |
+
except Exception as _szl_oi_e: # pragma: no cover
|
| 801 |
+
print(f"[a11oy] organ-integrity kernel NOT registered: {_szl_oi_e!r}; existing routes unaffected", file=__import__("sys").stderr)
|
| 802 |
+
|
| 803 |
# ── Backend hardening (devJ) — szl_backend_hardening ──
|
| 804 |
# Reusable concurrent + short-timeout + TTL-cache helpers (probe_with_timeout,
|
| 805 |
# probe_all_concurrent, TTLCache, probe_fabric_pool, cached_aggregate) that the
|
szl_organ_integrity.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
# SPDX-License-Identifier: Apache-2.0
|
| 3 |
+
# Copyright 2026 SZL Holdings
|
| 4 |
+
# Signed-off-by: Lutar, Stephen P. <stephenlutar2@gmail.com>
|
| 5 |
+
"""Fail-closed five-organ integrity kernel for a-11-oy.com.
|
| 6 |
+
|
| 7 |
+
GET/POST /api/a11oy/v1/organs/integrity
|
| 8 |
+
HTML /organs/integrity
|
| 9 |
+
|
| 10 |
+
Stdlib SHA-256. Energy UNAVAILABLE. Λ = Conjecture 1 OPEN. proven_trust false.
|
| 11 |
+
The 3D atlas is the map; this is the body. Additive FastAPI register() that
|
| 12 |
+
moves routes to the front so they beat the SPA catch-all.
|
| 13 |
+
"""
|
| 14 |
+
from __future__ import annotations
|
| 15 |
+
|
| 16 |
+
import json
|
| 17 |
+
import sys
|
| 18 |
+
from pathlib import Path
|
| 19 |
+
from typing import Any
|
| 20 |
+
|
| 21 |
+
from organ_integrity import envelope, evaluate_anatomy, parse_flags, selftest
|
| 22 |
+
|
| 23 |
+
_PAGES = Path(__file__).resolve().parent / "pages"
|
| 24 |
+
_PAGE = _PAGES / "organs-integrity.html"
|
| 25 |
+
|
| 26 |
+
API_PATHS = (
|
| 27 |
+
"/api/{ns}/v1/organs/integrity",
|
| 28 |
+
"/api/organs/integrity",
|
| 29 |
+
"/v1/organs/integrity",
|
| 30 |
+
)
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def _flags_from_request(request: Any, body: dict[str, Any] | None = None) -> dict[str, Any]:
|
| 34 |
+
if isinstance(body, dict) and body:
|
| 35 |
+
return parse_flags(body)
|
| 36 |
+
try:
|
| 37 |
+
params = dict(request.query_params)
|
| 38 |
+
except Exception:
|
| 39 |
+
params = {}
|
| 40 |
+
return parse_flags(params)
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
def register(app: Any, ns: str = "a11oy") -> str:
|
| 44 |
+
"""Mount kernel API + Evidence Bay ahead of SPA fallbacks."""
|
| 45 |
+
from fastapi.responses import FileResponse, HTMLResponse, JSONResponse
|
| 46 |
+
from starlette.routing import Route
|
| 47 |
+
|
| 48 |
+
paths = tuple(p.format(ns=ns) for p in API_PATHS)
|
| 49 |
+
|
| 50 |
+
async def _integrity(request: Any) -> JSONResponse:
|
| 51 |
+
data: dict[str, Any] | None = None
|
| 52 |
+
if request.method == "POST":
|
| 53 |
+
try:
|
| 54 |
+
payload = await request.json()
|
| 55 |
+
except Exception:
|
| 56 |
+
payload = {}
|
| 57 |
+
data = payload if isinstance(payload, dict) else {}
|
| 58 |
+
flags = _flags_from_request(request, data)
|
| 59 |
+
ev = evaluate_anatomy(**flags)
|
| 60 |
+
return JSONResponse(envelope(ev))
|
| 61 |
+
|
| 62 |
+
async def _page(request: Any = None) -> Any:
|
| 63 |
+
if _PAGE.is_file():
|
| 64 |
+
return FileResponse(_PAGE, media_type="text/html")
|
| 65 |
+
return HTMLResponse(
|
| 66 |
+
"<!doctype html><meta charset=utf-8><title>organ integrity</title>"
|
| 67 |
+
"<p>kernel live. GET /api/a11oy/v1/organs/integrity</p>"
|
| 68 |
+
)
|
| 69 |
+
|
| 70 |
+
routes = [Route(path, _integrity, methods=["GET", "HEAD", "POST"]) for path in paths]
|
| 71 |
+
routes.append(Route("/organs/integrity", _page, methods=["GET", "HEAD"]))
|
| 72 |
+
app.router.routes[0:0] = routes
|
| 73 |
+
print(
|
| 74 |
+
f"[a11oy] organ-integrity kernel registered: {paths[0]} + /organs/integrity "
|
| 75 |
+
f"[moved {len(routes)} routes to front]",
|
| 76 |
+
file=sys.stderr,
|
| 77 |
+
)
|
| 78 |
+
return f"organ-integrity-ok routes={len(routes)}"
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
if __name__ == "__main__":
|
| 82 |
+
print(json.dumps(selftest(), indent=2))
|