betterwithage commited on
Commit
cb09193
·
verified ·
1 Parent(s): 5226b54

chore(sync): mirror backend .py + Dockerfile to Space (hf-sync-backend)

Browse files

Automated backend sync from szl-holdings/a11oy main via hf-sync-backend.
Updated (differed from the Space): serve.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.

Files changed (1) hide show
  1. serve.py +16 -0
serve.py CHANGED
@@ -1027,6 +1027,22 @@ except Exception as _formulas_exc: # additive: never break the Space
1027
  _a11oy_formulas_status = f"formulas-not-wired:{_formulas_exc!r}"
1028
  print(f"[a11oy] formula endpoints NOT mounted ({_formulas_exc!r}); SPA + API unaffected", file=sys.stderr)
1029
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1030
 
1031
  # ---------------------------------------------------------------------------
1032
  # ADDITIVE (Formulas SECTION for the SPA navigation — closeout, A11oy Full-Stack
 
1027
  _a11oy_formulas_status = f"formulas-not-wired:{_formulas_exc!r}"
1028
  print(f"[a11oy] formula endpoints NOT mounted ({_formulas_exc!r}); SPA + API unaffected", file=sys.stderr)
1029
 
1030
+ # ---------------------------------------------------------------------------
1031
+ # ADDITIVE (Harvest API, feat/harvest-api 2026-06): real wasted-energy harvest
1032
+ # posture + formula-bounded soak plan via FREE no-key public feeds (aWATTar,
1033
+ # Energy-Charts/Fraunhofer, UK Carbon Intensity, Open-Meteo, CAISO).
1034
+ # joules_label ALWAYS "sample" off-box; MEASURED only on-box NVML.
1035
+ # Reactive turns NEVER gated. Locked-8 untouched. NO MOCKS.
1036
+ # Registered BEFORE the SPA catch-all. try/except so a11oy boots if import fails.
1037
+ # ---------------------------------------------------------------------------
1038
+ try:
1039
+ import a11oy_harvest_endpoints as _a11oy_harvest
1040
+ _a11oy_harvest_status = _a11oy_harvest.register(app, ns="a11oy")
1041
+ print(f"[a11oy] harvest API wired ({_a11oy_harvest_status}): /api/a11oy/v1/harvest/*", file=sys.stderr)
1042
+ except Exception as _harvest_exc: # additive: never break the Space
1043
+ _a11oy_harvest_status = f"harvest-not-wired:{_harvest_exc!r}"
1044
+ print(f"[a11oy] harvest endpoints NOT mounted ({_harvest_exc!r}); SPA + API unaffected", file=sys.stderr)
1045
+
1046
 
1047
  # ---------------------------------------------------------------------------
1048
  # ADDITIVE (Formulas SECTION for the SPA navigation — closeout, A11oy Full-Stack