betterwithage commited on
Commit
a2e6679
·
verified ·
1 Parent(s): 6a9e3b6

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): Dockerfile, 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 (2) hide show
  1. Dockerfile +9 -0
  2. serve.py +26 -0
Dockerfile CHANGED
@@ -1192,6 +1192,15 @@ COPY static/3d/ ./static/3d/
1192
  # module above via the same-origin importmap. Per-file served assets -> image_only_assets.
1193
  COPY web/energy-holographic.html ./web/energy-holographic.html
1194
  COPY web/energy.html ./web/energy.html
 
 
 
 
 
 
 
 
 
1195
  # Immune (Hukulla) honest egress-gate page (/immune, /a11oy/immune). Standalone
1196
  # sovereign page (0 runtime CDN), binds to live /api/a11oy/v1/immune/* (status/
1197
  # gates/feed + a live inspect->verdict box showing real deny/allow + signed Khipu
 
1192
  # module above via the same-origin importmap. Per-file served assets -> image_only_assets.
1193
  COPY web/energy-holographic.html ./web/energy-holographic.html
1194
  COPY web/energy.html ./web/energy.html
1195
+ # 3D Holographic Energy View (/energy-3d, /a11oy/energy-3d): standalone sovereign
1196
+ # WebGL page + its ES module. The page (web/energy-3d.html) is served via _ptg_serve
1197
+ # from /app/web/; its Three.js GPGPU particle + node-edge module (static/energy_3d.js)
1198
+ # is served at /energy-3d/app.js. Binds LIVE to /api/a11oy/v1/energy/mesh; reuses the
1199
+ # vendor3d Three.js r160 (MIT) above via the page importmap — 0 runtime CDN. Per-file
1200
+ # served assets -> declared image_only in copy-sync-lockstep.json. Without these COPYs
1201
+ # the route falls through to the SPA shell and the module 404s. Doctrine v11.
1202
+ COPY web/energy-3d.html ./web/energy-3d.html
1203
+ COPY static/energy_3d.js ./static/energy_3d.js
1204
  # Immune (Hukulla) honest egress-gate page (/immune, /a11oy/immune). Standalone
1205
  # sovereign page (0 runtime CDN), binds to live /api/a11oy/v1/immune/* (status/
1206
  # gates/feed + a live inspect->verdict box showing real deny/allow + signed Khipu
serve.py CHANGED
@@ -1484,6 +1484,16 @@ try:
1484
  # page binds to live /code/healthz, /v1/energy/budget, /v1/qbio/coherence.
1485
  app.add_api_route("/energy", _ptg_serve("energy.html"), methods=["GET"], include_in_schema=False)
1486
  app.add_api_route("/a11oy/energy", _ptg_serve("energy.html"), methods=["GET"], include_in_schema=False)
 
 
 
 
 
 
 
 
 
 
1487
  # IMMUNE (Hukulla) tab (2026-06-15): the honest, user-visible egress-gate surface.
1488
  # Standalone sovereign page (0 runtime CDN), binds to live /api/a11oy/v1/immune/*
1489
  # (status/gates/feed) + a live "inspect an action" box that POSTs to
@@ -8119,6 +8129,22 @@ async def _landing_app_js() -> Response:
8119
  return JSONResponse({"error": "landing app.js missing"}, status_code=404)
8120
 
8121
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8122
 
8123
  # --- Doctrine v13 organ page routes (ADDITIVE; explicit, win over SPA catch-all) ---
8124
  PAGES_DIR = Path("/app/pages")
 
1484
  # page binds to live /code/healthz, /v1/energy/budget, /v1/qbio/coherence.
1485
  app.add_api_route("/energy", _ptg_serve("energy.html"), methods=["GET"], include_in_schema=False)
1486
  app.add_api_route("/a11oy/energy", _ptg_serve("energy.html"), methods=["GET"], include_in_schema=False)
1487
+ # 3D HOLOGRAPHIC ENERGY VIEW (2026-06-29): real, operational WebGL scene of the
1488
+ # sovereign mesh — glowing nodes + energy-flow particles bound LIVE to
1489
+ # /api/a11oy/v1/energy/mesh (particle speed/density ∝ live watts/draw; node
1490
+ # brightness ∝ live watts; DOWN nodes dark; UNAVAILABLE -> posture-only, NO
1491
+ # fabricated flow). Standalone sovereign page (Three.js r160 vendored at
1492
+ # /hero/vendor3d, 0 runtime CDN); its ES module is served at /energy-3d/app.js
1493
+ # (see below). Replaces the prior SPA-shell fall-through. Registered BEFORE the
1494
+ # SPA catch-all so the explicit route wins. Doctrine v11 — honest labels only.
1495
+ app.add_api_route("/energy-3d", _ptg_serve("energy-3d.html"), methods=["GET"], include_in_schema=False)
1496
+ app.add_api_route("/a11oy/energy-3d", _ptg_serve("energy-3d.html"), methods=["GET"], include_in_schema=False)
1497
  # IMMUNE (Hukulla) tab (2026-06-15): the honest, user-visible egress-gate surface.
1498
  # Standalone sovereign page (0 runtime CDN), binds to live /api/a11oy/v1/immune/*
1499
  # (status/gates/feed) + a live "inspect an action" box that POSTs to
 
8129
  return JSONResponse({"error": "landing app.js missing"}, status_code=404)
8130
 
8131
 
8132
+ # === ADDITIVE: /energy-3d ES module (3D Holographic Energy View) ===
8133
+ # /energy-3d/app.js serves the Three.js GPGPU particle + Vizceral-style node-edge
8134
+ # scene that binds LIVE to /api/a11oy/v1/energy/mesh. ES module; imports "three" via
8135
+ # the importmap in web/energy-3d.html -> /hero/vendor3d/three.module.min.js (vendored
8136
+ # r160, MIT, 0 CDN). Registered BEFORE the SPA /{full_path:path} catch-all so it wins
8137
+ # the ordered match (a missing file degrades honestly to a 404, never a fabricated stub).
8138
+ # Signed-off-by: Stephen Lutar <stephenlutar2@gmail.com>
8139
+ @app.get("/energy-3d/app.js")
8140
+ async def _energy3d_app_js() -> Response:
8141
+ f = Path("/app/static/energy_3d.js")
8142
+ if f.is_file():
8143
+ return FileResponse(str(f), media_type="application/javascript; charset=utf-8",
8144
+ headers={"Cache-Control": "public, max-age=3600"})
8145
+ return JSONResponse({"error": "energy-3d app.js missing"}, status_code=404)
8146
+
8147
+
8148
 
8149
  # --- Doctrine v13 organ page routes (ADDITIVE; explicit, win over SPA catch-all) ---
8150
  PAGES_DIR = Path("/app/pages")