betterwithage commited on
Commit
dd5ca00
·
verified ·
1 Parent(s): c0a3aed

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 +56 -8
serve.py CHANGED
@@ -1453,14 +1453,8 @@ try:
1453
  try:
1454
  import szl_energy_operator as _eo_wire
1455
  import szl_energy_ledger as _el_wire
1456
- # Wire the operator's per-job emit stream into the ledger so every completed
1457
- # JobRecord mints a signed JouleCharge receipt onto the hash chain. Backfills
1458
- # the running daemon's in-memory recent jobs so receipts show immediately;
1459
- # idempotency makes the replay safe. (Plain subscribe alone left the live box
1460
- # at 0 receipts: it crashed on SAMPLE jobs' joules_measured=None and never
1461
- # backfilled jobs the already-running operator had completed.)
1462
- _eo_wire_result = _el_wire.wire_operator_to_ledger(_eo_wire.get_operator())
1463
- print(f"[a11oy] energy operator->ledger receipts hook wired: {_eo_wire_result}", file=sys.stderr)
1464
  except Exception as _eo_led_exc:
1465
  print(f"[a11oy] energy operator->ledger hook NOT wired: {_eo_led_exc!r}", file=sys.stderr)
1466
  except Exception as _ledger_exc: # additive: never break the Space
@@ -3954,6 +3948,60 @@ except Exception as _a11oy_nav_e:
3954
  _a11oy_nav_tb.print_exc()
3955
  # ── end NAV WIRE-UP (QA10) ──
3956
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3957
  # ===========================================================================
3958
  # ADDITIVE — Parity Gap Closure + Differentiators (Yachay / Parity Squad, 2026-06-04)
3959
  # Co-Authored-By: Perplexity Computer Agent <agent@perplexity.ai>
 
1453
  try:
1454
  import szl_energy_operator as _eo_wire
1455
  import szl_energy_ledger as _el_wire
1456
+ _eo_wire.get_operator().subscribe(_el_wire.record_job)
1457
+ print("[a11oy] energy operator->ledger receipts hook wired", file=sys.stderr)
 
 
 
 
 
 
1458
  except Exception as _eo_led_exc:
1459
  print(f"[a11oy] energy operator->ledger hook NOT wired: {_eo_led_exc!r}", file=sys.stderr)
1460
  except Exception as _ledger_exc: # additive: never break the Space
 
3948
  _a11oy_nav_tb.print_exc()
3949
  # ── end NAV WIRE-UP (QA10) ──
3950
 
3951
+ # ===========================================================================
3952
+ # WILLAY — the GOVERNED INVERSE of Anthropic's Fable 5 / Mythos 5 split.
3953
+ # ---------------------------------------------------------------------------
3954
+ # Anthropic shipped Fable 5 (capable model WITH safety classifiers that decline)
3955
+ # and Mythos 5 (SAME capability, classifiers REMOVED, hidden chain-of-thought,
3956
+ # limited Project Glasswing access). We do NOT clone Mythos. WILLAY is the honest
3957
+ # inverse: where Mythos REMOVES the governor and HIDES the reasoning, WILLAY makes
3958
+ # the safety/governance verdict INSPECTABLE and SIGNED — "they hide the governor;
3959
+ # we sign and show it." Every model call routed through a11oy passes inspectable
3960
+ # classifiers built on the EXISTING Restraint gate + Constitution + Khipu 3-of-4
3961
+ # consensus; the verdict AND its reasoning are returned as a SIGNED DSSE receipt.
3962
+ # Adopts (interface patterns only, fair game) the public Fable/Mythos API
3963
+ # ergonomics: refusal as a SUCCESSFUL non-billed 200 with stop_reason="refusal",
3964
+ # adaptive effort / task budgets, the memory tool, context compaction — wired into
3965
+ # a11oy-Code's API surface honestly (the gateway gates + signs; it does not itself
3966
+ # run a model). A WILLAY /console tab shows: request -> verdict (allow/decline +
3967
+ # reason) -> signed receipt -> which model served it. 0 CDN, holo-kit vendored
3968
+ # locally. Doctrine: locked=8 @ c7c0ba17; Λ = Conjecture 1; Khipu = Conjecture 2;
3969
+ # trust NEVER 100% (tamper-evident, fallible by design); no visible codenames;
3970
+ # never weakens a gate. Mounts BEFORE the SPA catch-all; try/except-guarded so a
3971
+ # missing dep can NEVER take the Space down.
3972
+ # GET /willay — the WILLAY operator tab
3973
+ # GET /api/a11oy/v1/willay/classifiers — the inspectable classifier set
3974
+ # POST /api/a11oy/v1/willay/inspect — classify a request -> verdict + reasons
3975
+ # POST /api/a11oy/v1/willay/messages — Fable-shaped gated turn (refusal => 200)
3976
+ # GET /api/a11oy/v1/willay/receipts — last N signed verdict receipts (audit)
3977
+ # POST /api/a11oy/v1/willay/verify — verify a signed WILLAY receipt
3978
+ # GET /api/a11oy/v1/willay/doctrine — doctrine + honesty self-statement
3979
+ # ===========================================================================
3980
+ try:
3981
+ import szl_willay_gateway as _szl_willay
3982
+ _willay_status = _szl_willay.register(app, ns="a11oy")
3983
+ print(f"[a11oy] WILLAY safety gateway registered: {_willay_status['registered']} "
3984
+ f"(classifiers: {_willay_status['classifiers']}, trust_ceiling="
3985
+ f"{_willay_status['trust_ceiling']} <1.0 by doctrine) — governed inverse of "
3986
+ f"Mythos: verdicts signed & shown, refusal-as-200", file=sys.stderr)
3987
+ except Exception as _willay_e:
3988
+ import traceback as _willay_tb
3989
+ print(f"[a11oy] WILLAY safety gateway NOT registered: {_willay_e!r}; SPA + API "
3990
+ f"unaffected", file=sys.stderr)
3991
+ _willay_tb.print_exc()
3992
+ try:
3993
+ import a11oy_willay_nav as _a11oy_willay_nav
3994
+ _willay_nav_status = _a11oy_willay_nav.register(app, ns="a11oy")
3995
+ print(f"[a11oy] WILLAY nav wire-up registered: {_willay_nav_status['registered']} "
3996
+ f"(tab: {_willay_nav_status['tab_route']}) — idempotent, additive, /console "
3997
+ f"SPA source NOT edited", file=sys.stderr)
3998
+ except Exception as _willay_nav_e:
3999
+ import traceback as _willay_nav_tb
4000
+ print(f"[a11oy] WILLAY nav wire-up NOT registered: {_willay_nav_e!r}", file=sys.stderr)
4001
+ _willay_nav_tb.print_exc()
4002
+ # ── end WILLAY (governed inverse of Mythos) ──
4003
+
4004
+
4005
  # ===========================================================================
4006
  # ADDITIVE — Parity Gap Closure + Differentiators (Yachay / Parity Squad, 2026-06-04)
4007
  # Co-Authored-By: Perplexity Computer Agent <agent@perplexity.ai>