Spaces:
Running
Running
chore(sync): mirror backend .py + Dockerfile to Space (hf-sync-backend)
Browse filesAutomated backend sync from szl-holdings/a11oy main via hf-sync-backend.
Updated (differed from the Space): src/a11oy/formulas/allodial_gate.py, src/a11oy/harvest/wasted_energy_harvest.py, szl_evidence_research.py
Deleted (gone from the repo + Dockerfile COPY set): (none)
Keeps the Space-built backend (serve.py + the Dockerfile-COPY'd .py
modules) identical to GitHub main so the Space never rebuilds from a
stale backend, new endpoints don't 404 there, and orphaned modules
removed from the repo don't linger in the Space tree.
src/a11oy/formulas/allodial_gate.py
CHANGED
|
@@ -170,25 +170,25 @@ if __name__ == "__main__":
|
|
| 170 |
checks = 0
|
| 171 |
|
| 172 |
# 1. local_node_serving=True → sovereign:true, half_state:false
|
| 173 |
-
r = sovereign_verdict("a11oy-node-0", "https://
|
| 174 |
assert r["sovereign"] is True, "local serving must yield sovereign:true"
|
| 175 |
assert r["half_state"] is False, "local serving must not be a half-state"
|
| 176 |
checks += 2
|
| 177 |
|
| 178 |
# 2. Banner sovereign (non-external served_by) + local_node_serving=False → half_state:true, sovereign:false
|
| 179 |
-
r2 = sovereign_verdict("a11oy-node-0", "https://
|
| 180 |
assert r2["sovereign"] is False, "external routing must yield sovereign:false"
|
| 181 |
assert r2["half_state"] is True, "banner+no-local-serving must be half_state:true"
|
| 182 |
checks += 2
|
| 183 |
|
| 184 |
# 3. Explicit external router + local_node_serving=False → sovereign:false, half_state:false (honest)
|
| 185 |
-
r3 = sovereign_verdict("external-router", "https://
|
| 186 |
assert r3["sovereign"] is False, "explicit external must yield sovereign:false"
|
| 187 |
assert r3["half_state"] is False, "explicit external with no claim must not be half-state"
|
| 188 |
checks += 2
|
| 189 |
|
| 190 |
# 4. CDN variant: served_by contains "cloudflare", local_node_serving=False
|
| 191 |
-
r4 = sovereign_verdict("cloudflare-cdn", "https://
|
| 192 |
assert r4["half_state"] is False, "known external CDN must not be half-state"
|
| 193 |
assert r4["sovereign"] is False, "CDN serving must yield sovereign:false"
|
| 194 |
checks += 2
|
|
|
|
| 170 |
checks = 0
|
| 171 |
|
| 172 |
# 1. local_node_serving=True → sovereign:true, half_state:false
|
| 173 |
+
r = sovereign_verdict("a11oy-node-0", "https://a-11-oy.com", True)
|
| 174 |
assert r["sovereign"] is True, "local serving must yield sovereign:true"
|
| 175 |
assert r["half_state"] is False, "local serving must not be a half-state"
|
| 176 |
checks += 2
|
| 177 |
|
| 178 |
# 2. Banner sovereign (non-external served_by) + local_node_serving=False → half_state:true, sovereign:false
|
| 179 |
+
r2 = sovereign_verdict("a11oy-node-0", "https://a-11-oy.com", False)
|
| 180 |
assert r2["sovereign"] is False, "external routing must yield sovereign:false"
|
| 181 |
assert r2["half_state"] is True, "banner+no-local-serving must be half_state:true"
|
| 182 |
checks += 2
|
| 183 |
|
| 184 |
# 3. Explicit external router + local_node_serving=False → sovereign:false, half_state:false (honest)
|
| 185 |
+
r3 = sovereign_verdict("external-router", "https://a-11-oy.com", False)
|
| 186 |
assert r3["sovereign"] is False, "explicit external must yield sovereign:false"
|
| 187 |
assert r3["half_state"] is False, "explicit external with no claim must not be half-state"
|
| 188 |
checks += 2
|
| 189 |
|
| 190 |
# 4. CDN variant: served_by contains "cloudflare", local_node_serving=False
|
| 191 |
+
r4 = sovereign_verdict("cloudflare-cdn", "https://a-11-oy.com", False)
|
| 192 |
assert r4["half_state"] is False, "known external CDN must not be half-state"
|
| 193 |
assert r4["sovereign"] is False, "CDN serving must yield sovereign:false"
|
| 194 |
checks += 2
|
src/a11oy/harvest/wasted_energy_harvest.py
CHANGED
|
@@ -28,7 +28,7 @@ import datetime
|
|
| 28 |
from dataclasses import dataclass, field, asdict
|
| 29 |
from typing import Optional
|
| 30 |
|
| 31 |
-
UA = {"User-Agent": "szl-wasted-energy-harvest/1.0 (+https://
|
| 32 |
# Per-feed outbound timeout. Was 12s: with ~6 feeds fetched SEQUENTIALLY per posture
|
| 33 |
# call, a single slow/dead public feed could stall the request past the edge proxy's
|
| 34 |
# deadline -> intermittent HTTP 000. Bounded to <=3s so the worst case stays well
|
|
|
|
| 28 |
from dataclasses import dataclass, field, asdict
|
| 29 |
from typing import Optional
|
| 30 |
|
| 31 |
+
UA = {"User-Agent": "szl-wasted-energy-harvest/1.0 (+https://a-11-oy.com)"}
|
| 32 |
# Per-feed outbound timeout. Was 12s: with ~6 feeds fetched SEQUENTIALLY per posture
|
| 33 |
# call, a single slow/dead public feed could stall the request past the edge proxy's
|
| 34 |
# deadline -> intermittent HTTP 000. Bounded to <=3s so the worst case stays well
|
szl_evidence_research.py
CHANGED
|
@@ -53,7 +53,7 @@ _ARXIV = "https://export.arxiv.org/api/query"
|
|
| 53 |
_OPENALEX = "https://api.openalex.org/works"
|
| 54 |
_GH_REPO = "https://api.github.com/repos/"
|
| 55 |
# OpenAlex "polite pool" wants a contact; overridable via env, never a secret.
|
| 56 |
-
_MAILTO = os.environ.get("SZL_EVIDENCE_MAILTO", "research@
|
| 57 |
|
| 58 |
# ---------------------------------------------------------------------------
|
| 59 |
# Curated claim -> evidence map. Every URL below is a real, resolvable source:
|
|
|
|
| 53 |
_OPENALEX = "https://api.openalex.org/works"
|
| 54 |
_GH_REPO = "https://api.github.com/repos/"
|
| 55 |
# OpenAlex "polite pool" wants a contact; overridable via env, never a secret.
|
| 56 |
+
_MAILTO = os.environ.get("SZL_EVIDENCE_MAILTO", "research@a-11-oy.com")
|
| 57 |
|
| 58 |
# ---------------------------------------------------------------------------
|
| 59 |
# Curated claim -> evidence map. Every URL below is a real, resolvable source:
|