betterwithage Claude Opus 4.7 commited on
Commit
e28b0df
·
verified ·
1 Parent(s): 90103ce

deploy(hf): sync szl-holdings/a11oy@f02f4978c32665b55c41f1b3f47cfa087c3b69a0 derived COPY set

Browse files

Reusable Dockerfile-COPY-derived deploy from szl-holdings/a11oy f02f4978c32665b55c41f1b3f47cfa087c3b69a0.
Files: 1376 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>

Files changed (4) hide show
  1. pages/killinchu.html +70 -12
  2. serve.py +14 -32
  3. szl_spaces_proxy.py +13 -13
  4. szl_spaces_surface.py +43 -19
pages/killinchu.html CHANGED
@@ -4,6 +4,7 @@
4
  Does not hand canonical to huggingface.co. -->
5
  <html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/>
6
  <title>a11oy · Killinchu</title>
 
7
  <style>
8
  :root{--bg:#0a0a0a;--s1:#111;--ink:#f4f1ea;--dim:#c8c5bc;--mute:#7a776f;--rule:#2a2a2a}
9
  *{box-sizing:border-box;margin:0;padding:0}html,body{background:var(--bg);color:var(--ink);font:16px/1.5 system-ui,sans-serif}
@@ -12,32 +13,89 @@ main{max-width:720px;margin:0 auto;padding:48px 24px}
12
  h1{font-weight:500;font-size:36px;letter-spacing:-.03em;margin:16px 0}
13
  p{color:var(--dim);max-width:60ch;margin:12px 0}
14
  a{color:var(--ink)}
15
- </style></head>
 
 
 
 
 
16
  <body>
17
  <main>
18
- <p><span class="chip" id="st">PROBING</span><span class="chip">ON ORIGIN</span></p>
19
  <h1>Killinchu</h1>
 
 
 
 
 
20
  <p>Eyes and decision. Not the trigger. Effectors stay SIMULATED. This page stays on a-11-oy.com so the product origin does not hand canonical to Hugging Face.</p>
21
- <p>Twin Space runtime is reported honestly. If the Space is down, this page stays up.</p>
22
- <p id="detail" class="chip"></p>
23
  <p><a href="/command-v2#defense">Command · Defense</a> · <a href="/hatun-mcp">Hatun</a></p>
24
  </main>
25
  <script>
26
- const ORIGIN = (location.hostname.endsWith('a-11-oy.com')||location.hostname.includes('hf.space')) ? '' : 'https://a-11-oy.com';
 
 
 
 
 
 
 
 
 
27
  async function boot(){
28
  const el=document.getElementById('st');
29
  const d=document.getElementById('detail');
30
  try{
31
- const r=await fetch(ORIGIN+'/healthz',{headers:{accept:'application/json'}});
 
32
  const j=await r.json();
33
- const sig=(j.signer&&j.signer.status)||'UNKNOWN';
34
- el.textContent='ORIGIN '+ (j.status||r.status);
35
- d.textContent='healthz signer '+sig+' · doctrine '+(j.doctrine||'v11');
36
- }catch(e){
37
- el.textContent='ORIGIN DEGRADED';
38
- d.textContent=String(e);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  }
40
  }
41
  boot();
42
  </script>
 
43
  </body></html>
 
4
  Does not hand canonical to huggingface.co. -->
5
  <html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/>
6
  <title>a11oy · Killinchu</title>
7
+ <link rel="canonical" href="https://a-11-oy.com/killinchu"/>
8
  <style>
9
  :root{--bg:#0a0a0a;--s1:#111;--ink:#f4f1ea;--dim:#c8c5bc;--mute:#7a776f;--rule:#2a2a2a}
10
  *{box-sizing:border-box;margin:0;padding:0}html,body{background:var(--bg);color:var(--ink);font:16px/1.5 system-ui,sans-serif}
 
13
  h1{font-weight:500;font-size:36px;letter-spacing:-.03em;margin:16px 0}
14
  p{color:var(--dim);max-width:60ch;margin:12px 0}
15
  a{color:var(--ink)}
16
+ .showcase-actions{display:flex;flex-wrap:wrap;gap:12px;margin:20px 0}
17
+ .showcase-actions a{display:inline-flex;align-items:center;min-height:44px;max-width:100%;padding:12px 16px;border:1px solid var(--dim);border-radius:6px;text-decoration:none;overflow-wrap:anywhere}
18
+ .showcase-actions a:hover{text-decoration:underline}
19
+ .showcase-actions a:focus-visible{outline:3px solid currentColor;outline-offset:4px}
20
+ </style> <link rel="stylesheet" href="/assets/szl-flow.css" data-szl-flow-asset="style" />
21
+ </head>
22
  <body>
23
  <main>
24
+ <p><span class="chip" id="st">TWIN UNAVAILABLE</span><span class="chip">ON ORIGIN</span></p>
25
  <h1>Killinchu</h1>
26
+ <nav class="showcase-actions" aria-label="Killinchu showcase">
27
+ <a href="https://szlholdings-killinchu.hf.space/elite" rel="external noopener noreferrer">Open interactive Killinchu demo</a>
28
+ <a href="https://huggingface.co/spaces/SZLHOLDINGS/killinchu" rel="external noopener noreferrer">View Hugging Face Space</a>
29
+ </nav>
30
+ <p>Interactive showcase hosted on Hugging Face. Runtime availability is reported separately below.</p>
31
  <p>Eyes and decision. Not the trigger. Effectors stay SIMULATED. This page stays on a-11-oy.com so the product origin does not hand canonical to Hugging Face.</p>
32
+ <p>Twin Space runtime is reported from A11oy's same-origin, server-observed Space inventory. If the Space or the observation is unavailable, this page stays up and fails closed.</p>
33
+ <p id="detail" class="chip">Awaiting observed Space inventory; no runtime claim made.</p>
34
  <p><a href="/command-v2#defense">Command · Defense</a> · <a href="/hatun-mcp">Hatun</a></p>
35
  </main>
36
  <script>
37
+ const INVENTORY_PATH='/api/a11oy/v1/spaces/health';
38
+ const EXPECTED_NAME='killinchu';
39
+ const EXPECTED_URL='https://szlholdings-killinchu.hf.space';
40
+ const ALLOWED_STATES=new Set(['LIVE','DEGRADED','UNAVAILABLE']);
41
+ const ALLOWED_SNAPSHOT_STATES=new Set(['LIVE','DEGRADED','UNAVAILABLE','CACHED']);
42
+ const REQUIRED_CONTRACTS=new Set(['api_health','healthz']);
43
+ function unavailable(detail){
44
+ document.getElementById('st').textContent='TWIN UNAVAILABLE';
45
+ document.getElementById('detail').textContent=detail;
46
+ }
47
  async function boot(){
48
  const el=document.getElementById('st');
49
  const d=document.getElementById('detail');
50
  try{
51
+ const r=await fetch(INVENTORY_PATH,{headers:{accept:'application/json'},cache:'no-store',credentials:'omit'});
52
+ if(!r.ok)throw new Error('inventory transport unavailable');
53
  const j=await r.json();
54
+ if(!j||!Array.isArray(j.spaces))throw new Error('inventory schema unavailable');
55
+ const snapshotRaw=typeof j.state==='string'?j.state.toUpperCase():'UNAVAILABLE';
56
+ const snapshotState=ALLOWED_SNAPSHOT_STATES.has(snapshotRaw)?snapshotRaw:'UNAVAILABLE';
57
+ const observedAt=typeof j.fetchedAt==='string'&&
58
+ /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(j.fetchedAt)&&
59
+ Number.isFinite(Date.parse(j.fetchedAt))?j.fetchedAt:null;
60
+ if(!observedAt)throw new Error('inventory observation time unavailable');
61
+ const observationAgeMs=Date.now()-Date.parse(observedAt);
62
+ if(observationAgeMs < -30000||observationAgeMs > 60000){
63
+ throw new Error('inventory observation stale');
64
+ }
65
+ const twin=j.spaces.find(function(row){
66
+ return row&&typeof row==='object'&&
67
+ (row.name===EXPECTED_NAME||row.slug===EXPECTED_NAME)&&
68
+ row.url===EXPECTED_URL;
69
+ });
70
+ if(!twin)throw new Error('exact twin observation unavailable');
71
+ const rawState=typeof twin.state==='string'?twin.state.toUpperCase():'UNAVAILABLE';
72
+ const state=ALLOWED_STATES.has(rawState)?rawState:'UNAVAILABLE';
73
+ const stage=typeof twin.stage==='string'?twin.stage.toUpperCase():'UNKNOWN';
74
+ const appStatus=Number.isInteger(twin.app_status)?twin.app_status:null;
75
+ const contracts=Array.isArray(twin.contracts)?twin.contracts:[];
76
+ const contractIds=new Set(contracts.map(function(item){return item&&item.id;}));
77
+ const contractsLive=contracts.length===REQUIRED_CONTRACTS.size&&
78
+ contractIds.size===REQUIRED_CONTRACTS.size&&
79
+ contracts.every(function(item){
80
+ return item&&REQUIRED_CONTRACTS.has(item.id)&&item.state==='LIVE';
81
+ });
82
+ const freshSnapshot=snapshotState==='LIVE'||snapshotState==='DEGRADED';
83
+ const live=freshSnapshot&&state==='LIVE'&&stage==='RUNNING'&&
84
+ twin.app_reachable===true&&appStatus===200&&twin.contract_state==='LIVE'&&contractsLive;
85
+ const displayState=live?'LIVE':snapshotState==='CACHED'?'CACHED':
86
+ (snapshotState==='UNAVAILABLE'||state==='UNAVAILABLE')?'UNAVAILABLE':'DEGRADED';
87
+ const cachedRaw=typeof j.cached_state==='string'?j.cached_state.toUpperCase():'UNAVAILABLE';
88
+ const cachedState=ALLOWED_STATES.has(cachedRaw)?cachedRaw:'UNAVAILABLE';
89
+ const cachedDetail=snapshotState==='CACHED'?' (prior '+cachedState+')':'';
90
+ el.textContent='TWIN '+displayState;
91
+ d.textContent='snapshot '+snapshotState+cachedDetail+' · stage '+stage+
92
+ ' · app '+(appStatus===null?'unavailable':String(appStatus))+
93
+ ' · contracts '+(contractsLive?'observed':'unavailable')+' · observed '+observedAt;
94
+ }catch(_error){
95
+ unavailable('Space inventory unavailable; no runtime claim made.');
96
  }
97
  }
98
  boot();
99
  </script>
100
+ <script src="/assets/szl-flow.js" defer data-szl-flow-asset="script"></script>
101
  </body></html>
serve.py CHANGED
@@ -13662,47 +13662,29 @@ async def _elite_redirect() -> Response:
13662
  app.add_api_route("/elite", _elite_redirect, methods=["GET"], include_in_schema=False)
13663
 
13664
 
13665
- # /killinchu path bridge, honestly labelled. Without an explicit route this path
13666
- # falls through to the A11OY SPA shell and returns a misleading HTTP 200. Keep the
13667
- # bridge server-side so it works without JavaScript at every mobile viewport, and
13668
- # preserve subpaths/query strings.
13669
- #
13670
- # HONESTY (identity-lock): the killinchu Space RUNTIME is not up a request to
13671
- # szlholdings-killinchu.hf.space times out / errors, so redirecting a visitor there
13672
- # implies a live product that is not serving. The bridge therefore targets the
13673
- # Hugging Face HUB page for the Space (which is always readable and states the
13674
- # runtime's own state), stamps X-SZL-Route-State: UNAVAILABLE_RUNTIME, and links
13675
- # the hub as rel="alternate" — NEVER rel="canonical" (this app does not hand its
13676
- # canonical to a third-party host; product canonical stays on a-11-oy.com).
13677
- _KILLINCHU_HUB = "https://huggingface.co/spaces/SZLHOLDINGS/killinchu"
13678
- _KILLINCHU_RUNTIME_STATE = "UNAVAILABLE_RUNTIME"
13679
 
13680
 
13681
  async def _killinchu_redirect(request: Request, full_path: str = "") -> Response:
13682
- # Deep links cannot be honoured while the runtime is down (no runtime = no
13683
- # subpath), so every /killinchu/* request lands on the hub page and the
13684
- # requested subpath is echoed in a header instead of being faked upstream.
13685
- response = _PTG_Redirect(url=_KILLINCHU_HUB, status_code=307)
13686
- response.headers["X-SZL-Route-State"] = _KILLINCHU_RUNTIME_STATE
13687
- response.headers["X-SZL-Killinchu-Hub"] = _KILLINCHU_HUB
13688
- if full_path:
13689
- response.headers["X-SZL-Killinchu-Requested-Path"] = f"/{full_path}"
13690
- response.headers["Link"] = f'<{_KILLINCHU_HUB}>; rel="alternate"'
13691
  return response
13692
 
13693
 
13694
- for _killinchu_path in ("/killinchu", "/killinchu/"):
13695
- app.add_api_route(
13696
- _killinchu_path,
13697
- _killinchu_redirect,
13698
- methods=["GET"],
13699
- include_in_schema=False,
13700
- )
13701
-
13702
  app.add_api_route(
13703
  "/killinchu/{full_path:path}",
13704
  _killinchu_redirect,
13705
- methods=["GET"],
13706
  include_in_schema=False,
13707
  )
13708
 
 
13662
  app.add_api_route("/elite", _elite_redirect, methods=["GET"], include_in_schema=False)
13663
 
13664
 
13665
+ # /killinchu and /killinchu/ are owned by a11oy_command_center and serve the
13666
+ # reviewed on-origin status page. Deep links used to redirect to a stale HF Hub
13667
+ # outage page, contradicting the on-origin owner and the current observed Space.
13668
+ # Collapse unknown deep links to the canonical on-origin page. Runtime state is
13669
+ # derived in that page from /api/a11oy/v1/spaces/health; this redirect itself makes
13670
+ # no LIVE claim and never hands product canonical to a third-party host.
13671
+ _KILLINCHU_CANONICAL_PATH = "/killinchu"
13672
+ _KILLINCHU_CANONICAL_URL = "https://a-11-oy.com/killinchu"
13673
+ _KILLINCHU_ROUTE_STATE = "ON_ORIGIN_STATUS"
 
 
 
 
 
13674
 
13675
 
13676
  async def _killinchu_redirect(request: Request, full_path: str = "") -> Response:
13677
+ del request, full_path
13678
+ response = _PTG_Redirect(url=_KILLINCHU_CANONICAL_PATH, status_code=307)
13679
+ response.headers["X-SZL-Route-State"] = _KILLINCHU_ROUTE_STATE
13680
+ response.headers["Link"] = f'<{_KILLINCHU_CANONICAL_URL}>; rel="canonical"'
 
 
 
 
 
13681
  return response
13682
 
13683
 
 
 
 
 
 
 
 
 
13684
  app.add_api_route(
13685
  "/killinchu/{full_path:path}",
13686
  _killinchu_redirect,
13687
+ methods=["GET", "HEAD"],
13688
  include_in_schema=False,
13689
  )
13690
 
szl_spaces_proxy.py CHANGED
@@ -30,7 +30,7 @@ from __future__ import annotations
30
  import html
31
  import sys
32
  from typing import Any
33
- from urllib.parse import quote
34
 
35
  from szl_spaces_surface import FOLD_SPACES as _FOLD_SPACES
36
  from szl_spaces_surface import SPACES as _CANONICAL_SPACES
@@ -137,19 +137,19 @@ def _canonical_target(name: str, subpath: str = "", query: str = "") -> str:
137
  record = _SPACE_BY_SLUG.get(name)
138
  if record is None or name not in HANDOFF_SPACES:
139
  raise ValueError("unknown Space identifier: %s" % name)
140
- dest = _destination_url(name)
141
- if "#" in dest:
142
- # dest already carries a fragment; do not append a path onto #atlas/#verticals
143
- if query:
144
- return dest + ("&" if "?" in dest else "?") + quote(query, safe="=&;%:+,/?@-._~")
145
- return dest
146
- target = dest.rstrip("/")
147
- if subpath:
148
- encoded_path = quote(subpath.lstrip("/"), safe="/:@!$&'()*+,;=-._~")
149
- target += "/" + encoded_path
150
  if query:
151
- target += "?" + quote(query, safe="=&;%:+,/?@-._~")
152
- return target
 
 
153
 
154
 
155
  def _raw_query(request: Any) -> str | None:
 
30
  import html
31
  import sys
32
  from typing import Any
33
+ from urllib.parse import quote, urlsplit, urlunsplit
34
 
35
  from szl_spaces_surface import FOLD_SPACES as _FOLD_SPACES
36
  from szl_spaces_surface import SPACES as _CANONICAL_SPACES
 
137
  record = _SPACE_BY_SLUG.get(name)
138
  if record is None or name not in HANDOFF_SPACES:
139
  raise ValueError("unknown Space identifier: %s" % name)
140
+ dest = urlsplit(_destination_url(name))
141
+ # Fragment destinations are existing document anchors, not path-prefix apps.
142
+ # Keep the anchor last: appending ?query after # would silently lose the
143
+ # request query and change which element the browser navigates to.
144
+ path = dest.path if dest.fragment else dest.path.rstrip("/")
145
+ if subpath and not dest.fragment:
146
+ path += "/" + quote(subpath.lstrip("/"), safe="/:@!$&'()*+,;=-._~")
147
+ merged_query = dest.query
 
 
148
  if query:
149
+ encoded_query = quote(query, safe="=&;%:+,/?@-._~")
150
+ merged_query += ("&" if merged_query else "") + encoded_query
151
+ return urlunsplit((dest.scheme, dest.netloc, path, merged_query, dest.fragment))
152
+
153
 
154
 
155
  def _raw_query(request: Any) -> str | None:
szl_spaces_surface.py CHANGED
@@ -109,7 +109,7 @@ FOLD_SPACES: list[dict[str, str]] = [
109
  "why": "Hologram sprawl. One atlas. Fold into anatomy."},
110
  {"name": "cosmos", "slug": "cosmos", "title": "SZL Cosmos", "sdk": "docker",
111
  "action": "FOLD", "sink": "product", "dest": PRODUCT + "/living-anatomy",
112
- "why": "Unmapped RUNNING Space. Bind as anatomy, not a third map."},
113
  {"name": "khipu-lab", "slug": "khipu-lab", "title": "khipu-lab", "sdk": "docker",
114
  "action": "FOLD", "sink": "product", "dest": PRODUCT + "/khipu",
115
  "why": "Duplicate knot lab. KHIPU already lives on product /khipu. RECORD on a11oy.net/khipu/."},
@@ -183,7 +183,7 @@ FOLD_SPACES: list[dict[str, str]] = [
183
  {"name": "szl-estate-live", "slug": "szl-estate-live", "title": "Khipu Loom — Governed AI Estate", "sdk": "static",
184
  "action": "FOLD", "sink": "proof", "dest": PROOF + "/estate/",
185
  "why": "Estate snapshot already exists on the proof origin."},
186
- {"name": "szl-forge-lab", "slug": "szl-forge-lab", "title": "SZL Forge Lab", "sdk": "static",
187
  "action": "FOLD", "sink": "proof", "dest": PROOF + "/atelier/",
188
  "honesty": "SNAPSHOT — not a trainer, not Serve Studio",
189
  "why": "Cuts belong next to the forty-model walk, not as a sibling Space."},
@@ -196,14 +196,14 @@ FOLD_SPACES: list[dict[str, str]] = [
196
  {"name": "david-leads", "slug": "david-leads", "title": "David Leads — Sovereign Insurance Intelligence", "sdk": "docker",
197
  "action": "FOLD", "sink": "product", "dest": PRODUCT,
198
  "honesty": "PII/leads stay private",
199
- "why": "Insurance vertical is not a flagship. Hub Space is PAUSED+PRIVATE. pause+private, never delete."},
200
  {"name": "anatomy", "slug": "anatomy", "title": "SZL Living Anatomy", "sdk": "docker",
201
  "action": "FOLD", "sink": "product", "dest": PRODUCT + "/anatomy-v5",
202
- "why": "Living map already on product /anatomy-v5 and /living-anatomy. Hub Space re-privatized. Not a second origin."},
203
  {"name": "szl-real-estate", "slug": "szl-real-estate", "title": "SZL Real Estate — public-records underwriting", "sdk": "docker",
204
  "action": "FOLD", "sink": "product", "dest": PRODUCT,
205
  "honesty": "Occupancy UNAVAILABLE",
206
- "why": "Public-records underwriting is not a flagship. Occupancy stays UNAVAILABLE. Hub Space PAUSED+PRIVATE."},
207
  {"name": "sentra", "slug": "sentra", "title": "sentra", "sdk": "docker",
208
  "action": "FOLD", "sink": "vertical-services", "dest": PRODUCT + "/spaces#verticals",
209
  "why": "SENTRA is a vertical, not a flagship. Folds into vertical-services."},
@@ -320,10 +320,16 @@ def proxy_url(name: str) -> str:
320
  return canonical_url(name)
321
 
322
 
323
- # Exact public contracts for the two API-bearing Spaces audited in this repair.
324
  # These are deliberately route-level probes: a 200 root page is not evidence that
325
  # the API consumed by the Space is registered or compatible.
326
  SPACE_API_CONTRACTS: dict[str, tuple[dict[str, Any], ...]] = {
 
 
 
 
 
 
327
  "anatomy": (
328
  {"id": "manifest", "url": hf_url("anatomy") + "/api/anatomy/v1/manifest",
329
  "expected": {"schema": "szl.anatomy-manifest/v1"}},
@@ -344,6 +350,7 @@ SPACE_API_CONTRACTS: dict[str, tuple[dict[str, Any], ...]] = {
344
  "expected": {"ok": True}},
345
  ),
346
  }
 
347
 
348
 
349
  def _resolve_client() -> Any:
@@ -691,6 +698,9 @@ async def _probe_one(client: Any, sp: dict[str, str]) -> dict[str, Any]:
691
  else "UNAVAILABLE" if live_count == 0
692
  else "DEGRADED"
693
  )
 
 
 
694
 
695
  result["state"] = _space_health_state(result)
696
  return result
@@ -700,7 +710,12 @@ def _space_health_state(space: dict[str, Any]) -> str:
700
  """Derive one conservative, user-facing state from observed row evidence."""
701
  reachable = bool(space.get("app_reachable"))
702
  stage = str(space.get("stage") or "unknown").upper()
703
- contract_state = str(space.get("contract_state") or "LIVE").upper()
 
 
 
 
 
704
  custom_domain_state = str(
705
  (space.get("custom_domain") or {}).get("state") or "LIVE"
706
  ).upper()
@@ -759,7 +774,7 @@ async def spaces_health() -> dict[str, Any]:
759
  "labels": {
760
  "state": "Fresh: LIVE only when every app is reachable and HF reports RUNNING; otherwise DEGRADED or UNAVAILABLE. TTL reuse is CACHED with cached_state.",
761
  "space_state": "LIVE requires app_reachable:true plus HF stage RUNNING and every configured exact API contract LIVE; partial evidence is DEGRADED",
762
- "contract_state": "Anatomy and SDA validate exact stable JSON markers on their public dependency routes; a root-page 200 cannot override a failed contract",
763
  "inventory": "LIVE only when the public KEEP-5 FLOCK door set exactly equals the unauthenticated Hub API set; folded and Unify Spaces are destination-ledger only and are not in this set; README is a special organization surface, not an application Space",
764
  "custom_domain": "HF API provider state; PENDING remains DEGRADED even when a separate edge currently routes traffic",
765
  "stage": "HF API runtime.stage (https://huggingface.co/api/spaces/SZLHOLDINGS/<name>)",
@@ -778,11 +793,20 @@ async def spaces_health() -> dict[str, Any]:
778
 
779
 
780
  def _destination_ledger_card(sp: dict[str, str], kind: str) -> str:
781
- """Render a FOLD/UNIFY destination-ledger card. No live Hub probe, no RUNNING."""
 
 
 
 
 
 
 
782
  name = sp["name"]
783
  title = html_escape(sp["title"])
784
  dest = html_escape(sp["dest"], quote=True)
785
- honesty = html_escape(sp.get("honesty") or ("%s · PAUSED · PRIVATE" % kind))
 
 
786
  why = html_escape(sp.get("why") or "")
787
  sink = html_escape(sp.get("sink") or "")
788
  attr = "data-fold" if kind == "FOLD" else "data-unify"
@@ -791,10 +815,10 @@ def _destination_ledger_card(sp: dict[str, str], kind: str) -> str:
791
  '<header class="sp-head"><h2 class="sp-title">%s</h2></header>'
792
  '<div class="sp-kind">%s &middot; %s &middot; %s &rarr; %s</div>'
793
  '<div class="sp-honesty">%s</div>'
794
- '<div class="sp-stage">%s</div>'
795
  '<div class="sp-links">'
796
  '<a class="sp-open" href="%s" rel="noopener">Open destination &#8599;</a>'
797
- '<a class="sp-hf" href="%s" rel="noopener" target="_blank">Hub (private) &#8599;</a>'
798
  '</div></article>'
799
  % (attr, html_escape(name, quote=True), title, html_escape(name),
800
  html_escape(sp["sdk"]), kind, sink, honesty, why, dest, hf_repo_url(name))
@@ -824,7 +848,7 @@ def unify_ledger() -> dict[str, Any]:
824
  "doctrine": _DOCTRINE,
825
  "note": (
826
  "Product tab on a-11-oy.com. GitHub is source. Hub is the registry. "
827
- "a11oy.net is RECORD. Never LIVE/RUNNING/PASS. pause+private, never delete. "
828
  "Do not create Space SZLHOLDINGS/unify."
829
  ),
830
  }
@@ -876,7 +900,7 @@ def _unify_page(ns: str = "a11oy") -> bytes:
876
  ' &middot; winner=null &middot; proven_trust=false</p>'
877
  '<p class="sp-sub"><strong>Product tab on a-11-oy.com.</strong> GitHub is source. '
878
  'Hub is the registry. a11oy.net is RECORD. Never LIVE/RUNNING/PASS. '
879
- 'pause+private, never delete. Do not create Space SZLHOLDINGS/unify.</p>'
880
  '<p class="sp-nav">Nav: <a href="/lyte">/lyte</a> &middot; '
881
  '<a href="/spaces">/spaces</a> &middot; <a href="/console">/console</a></p>'
882
  '<h2>KEEP</h2>'
@@ -888,7 +912,7 @@ def _unify_page(ns: str = "a11oy") -> bytes:
888
  + _rows(ledger["fold"], "into") +
889
  '</tbody></table>'
890
  '<h2>UNIFY stragglers</h2>'
891
- '<p class="sp-sub">Four Spaces sink into a11oy /console. Destination ledger only. '
892
  'Not live-probed. Not a fifth door.</p>'
893
  '<table><thead><tr><th>slug</th><th>act</th><th>into</th></tr></thead><tbody>'
894
  + _rows(ledger["unify"], "into") +
@@ -992,14 +1016,14 @@ def _tiles_page(ns: str) -> bytes:
992
  '<p class="sp-health">Estate health: '
993
  '<strong id="sp-estate-health" class="checking" aria-live="polite">CHECKING</strong></p>'
994
  '<div class="sp-grid">' + "".join(cards) + '</div>'
995
- '<h2 class="sp-h2" id="verticals">Folded · PAUSED + PRIVATE</h2>'
996
- f'<p class="sp-sub">{len(FOLD_SPACES)} Spaces folded into product and proof destinations. '
997
- 'Not public Hub. Reachability of a destination is never quality. '
998
  'sentra, finance, terra fold into vertical-services. '
999
  'second-brain is ARCHIVE / HISTORICAL.</p>'
1000
  '<div class="sp-grid">' + "".join(fold_cards) + '</div>'
1001
  '<h2 class="sp-h2">Unify stragglers &rarr; a11oy</h2>'
1002
- f'<p class="sp-sub">{len(UNIFY_SPACES)} Spaces sink into <a href="/unify">/unify</a> '
1003
  'and a11oy /console. Destination ledger only. Not live-probed.</p>'
1004
  '<div class="sp-grid">' + "".join(unify_cards) + '</div>'
1005
  '<p class="sp-foot">Status dot & stage on KEEP tiles are filled from the same-origin '
 
109
  "why": "Hologram sprawl. One atlas. Fold into anatomy."},
110
  {"name": "cosmos", "slug": "cosmos", "title": "SZL Cosmos", "sdk": "docker",
111
  "action": "FOLD", "sink": "product", "dest": PRODUCT + "/living-anatomy",
112
+ "why": "Plan: bind as anatomy, not a third map. Provider runtime is not observed here."},
113
  {"name": "khipu-lab", "slug": "khipu-lab", "title": "khipu-lab", "sdk": "docker",
114
  "action": "FOLD", "sink": "product", "dest": PRODUCT + "/khipu",
115
  "why": "Duplicate knot lab. KHIPU already lives on product /khipu. RECORD on a11oy.net/khipu/."},
 
183
  {"name": "szl-estate-live", "slug": "szl-estate-live", "title": "Khipu Loom — Governed AI Estate", "sdk": "static",
184
  "action": "FOLD", "sink": "proof", "dest": PROOF + "/estate/",
185
  "why": "Estate snapshot already exists on the proof origin."},
186
+ {"name": "szl-forge-lab", "slug": "szl-forge-lab", "title": "SZL Forge Lab — forty-model walk", "sdk": "static",
187
  "action": "FOLD", "sink": "proof", "dest": PROOF + "/atelier/",
188
  "honesty": "SNAPSHOT — not a trainer, not Serve Studio",
189
  "why": "Cuts belong next to the forty-model walk, not as a sibling Space."},
 
196
  {"name": "david-leads", "slug": "david-leads", "title": "David Leads — Sovereign Insurance Intelligence", "sdk": "docker",
197
  "action": "FOLD", "sink": "product", "dest": PRODUCT,
198
  "honesty": "PII/leads stay private",
199
+ "why": "Insurance vertical is not a flagship. Planned disposition: pause and make private, never delete. Provider state is not observed here."},
200
  {"name": "anatomy", "slug": "anatomy", "title": "SZL Living Anatomy", "sdk": "docker",
201
  "action": "FOLD", "sink": "product", "dest": PRODUCT + "/anatomy-v5",
202
+ "why": "Plan: use product /anatomy-v5 and /living-anatomy, not a second origin. Provider visibility is not observed here."},
203
  {"name": "szl-real-estate", "slug": "szl-real-estate", "title": "SZL Real Estate — public-records underwriting", "sdk": "docker",
204
  "action": "FOLD", "sink": "product", "dest": PRODUCT,
205
  "honesty": "Occupancy UNAVAILABLE",
206
+ "why": "Public-records underwriting is not a flagship. Occupancy stays UNAVAILABLE. Planned disposition: pause and make private; provider state is not observed here."},
207
  {"name": "sentra", "slug": "sentra", "title": "sentra", "sdk": "docker",
208
  "action": "FOLD", "sink": "vertical-services", "dest": PRODUCT + "/spaces#verticals",
209
  "why": "SENTRA is a vertical, not a flagship. Folds into vertical-services."},
 
320
  return canonical_url(name)
321
 
322
 
323
+ # Exact public contracts for API-bearing Spaces audited in this repair.
324
  # These are deliberately route-level probes: a 200 root page is not evidence that
325
  # the API consumed by the Space is registered or compatible.
326
  SPACE_API_CONTRACTS: dict[str, tuple[dict[str, Any], ...]] = {
327
+ "killinchu": (
328
+ {"id": "api_health", "url": hf_url("killinchu") + "/api/health",
329
+ "expected": {"status": "ok", "service": "killinchu", "doctrine": "v11"}},
330
+ {"id": "healthz", "url": hf_url("killinchu") + "/healthz",
331
+ "expected": {"status": "ok", "organ": "killinchu", "doctrine": "v11"}},
332
+ ),
333
  "anatomy": (
334
  {"id": "manifest", "url": hf_url("anatomy") + "/api/anatomy/v1/manifest",
335
  "expected": {"schema": "szl.anatomy-manifest/v1"}},
 
350
  "expected": {"ok": True}},
351
  ),
352
  }
353
+ _CONTRACT_REQUIRED_KEEP_SLUGS = frozenset({"killinchu"})
354
 
355
 
356
  def _resolve_client() -> Any:
 
698
  else "UNAVAILABLE" if live_count == 0
699
  else "DEGRADED"
700
  )
701
+ elif slug in _CONTRACT_REQUIRED_KEEP_SLUGS:
702
+ result["contracts"] = []
703
+ result["contract_state"] = "UNAVAILABLE"
704
 
705
  result["state"] = _space_health_state(result)
706
  return result
 
710
  """Derive one conservative, user-facing state from observed row evidence."""
711
  reachable = bool(space.get("app_reachable"))
712
  stage = str(space.get("stage") or "unknown").upper()
713
+ default_contract_state = (
714
+ "UNAVAILABLE"
715
+ if str(space.get("slug") or "") in _CONTRACT_REQUIRED_KEEP_SLUGS
716
+ else "LIVE"
717
+ )
718
+ contract_state = str(space.get("contract_state") or default_contract_state).upper()
719
  custom_domain_state = str(
720
  (space.get("custom_domain") or {}).get("state") or "LIVE"
721
  ).upper()
 
774
  "labels": {
775
  "state": "Fresh: LIVE only when every app is reachable and HF reports RUNNING; otherwise DEGRADED or UNAVAILABLE. TTL reuse is CACHED with cached_state.",
776
  "space_state": "LIVE requires app_reachable:true plus HF stage RUNNING and every configured exact API contract LIVE; partial evidence is DEGRADED",
777
+ "contract_state": "Killinchu, Anatomy, and SDA validate exact stable JSON markers on their public dependency routes; a root-page 200 cannot override a failed contract",
778
  "inventory": "LIVE only when the public KEEP-5 FLOCK door set exactly equals the unauthenticated Hub API set; folded and Unify Spaces are destination-ledger only and are not in this set; README is a special organization surface, not an application Space",
779
  "custom_domain": "HF API provider state; PENDING remains DEGRADED even when a separate edge currently routes traffic",
780
  "stage": "HF API runtime.stage (https://huggingface.co/api/spaces/SZLHOLDINGS/<name>)",
 
793
 
794
 
795
  def _destination_ledger_card(sp: dict[str, str], kind: str) -> str:
796
+ """Render a consolidation PLAN; this function has no provider observation.
797
+
798
+ A declared FOLD/UNIFY action is not a successful mutation. Keep destination
799
+ navigation usable without implying that a Space is private, paused or live.
800
+ Scope notes cannot suppress the explicit unobserved-provider label.
801
+ """
802
+ if kind not in {"FOLD", "UNIFY"}:
803
+ raise ValueError("destination ledger kind must be FOLD or UNIFY")
804
  name = sp["name"]
805
  title = html_escape(sp["title"])
806
  dest = html_escape(sp["dest"], quote=True)
807
+ honesty = html_escape("%s · PLANNED · provider state UNOBSERVED" % kind)
808
+ if sp.get("honesty"):
809
+ honesty += " · Scope note: " + html_escape(sp["honesty"])
810
  why = html_escape(sp.get("why") or "")
811
  sink = html_escape(sp.get("sink") or "")
812
  attr = "data-fold" if kind == "FOLD" else "data-unify"
 
815
  '<header class="sp-head"><h2 class="sp-title">%s</h2></header>'
816
  '<div class="sp-kind">%s &middot; %s &middot; %s &rarr; %s</div>'
817
  '<div class="sp-honesty">%s</div>'
818
+ '<div class="sp-stage">Plan rationale: %s</div>'
819
  '<div class="sp-links">'
820
  '<a class="sp-open" href="%s" rel="noopener">Open destination &#8599;</a>'
821
+ '<a class="sp-hf" href="%s" rel="noopener" target="_blank">View Hub repository &#8599;</a>'
822
  '</div></article>'
823
  % (attr, html_escape(name, quote=True), title, html_escape(name),
824
  html_escape(sp["sdk"]), kind, sink, honesty, why, dest, hf_repo_url(name))
 
848
  "doctrine": _DOCTRINE,
849
  "note": (
850
  "Product tab on a-11-oy.com. GitHub is source. Hub is the registry. "
851
+ "a11oy.net is RECORD. Never LIVE/RUNNING/PASS. This is a consolidation plan, not a provider observation. Planned disposition: pause+private, never delete. "
852
  "Do not create Space SZLHOLDINGS/unify."
853
  ),
854
  }
 
900
  ' &middot; winner=null &middot; proven_trust=false</p>'
901
  '<p class="sp-sub"><strong>Product tab on a-11-oy.com.</strong> GitHub is source. '
902
  'Hub is the registry. a11oy.net is RECORD. Never LIVE/RUNNING/PASS. '
903
+ 'Planned disposition: pause+private, never delete. Provider state UNOBSERVED. Do not create Space SZLHOLDINGS/unify.</p>'
904
  '<p class="sp-nav">Nav: <a href="/lyte">/lyte</a> &middot; '
905
  '<a href="/spaces">/spaces</a> &middot; <a href="/console">/console</a></p>'
906
  '<h2>KEEP</h2>'
 
912
  + _rows(ledger["fold"], "into") +
913
  '</tbody></table>'
914
  '<h2>UNIFY stragglers</h2>'
915
+ '<p class="sp-sub">Four Spaces are planned to fold into a11oy /console. Destination ledger only. '
916
  'Not live-probed. Not a fifth door.</p>'
917
  '<table><thead><tr><th>slug</th><th>act</th><th>into</th></tr></thead><tbody>'
918
  + _rows(ledger["unify"], "into") +
 
1016
  '<p class="sp-health">Estate health: '
1017
  '<strong id="sp-estate-health" class="checking" aria-live="polite">CHECKING</strong></p>'
1018
  '<div class="sp-grid">' + "".join(cards) + '</div>'
1019
+ '<h2 class="sp-h2" id="verticals">Fold plan · provider state UNOBSERVED</h2>'
1020
+ f'<p class="sp-sub">{len(FOLD_SPACES)} planned folds into product and proof destinations. '
1021
+ 'Current Hub visibility and runtime are not observed by this ledger. Reachability of a destination is never quality. '
1022
  'sentra, finance, terra fold into vertical-services. '
1023
  'second-brain is ARCHIVE / HISTORICAL.</p>'
1024
  '<div class="sp-grid">' + "".join(fold_cards) + '</div>'
1025
  '<h2 class="sp-h2">Unify stragglers &rarr; a11oy</h2>'
1026
+ f'<p class="sp-sub">{len(UNIFY_SPACES)} Spaces are planned to fold into <a href="/unify">/unify</a> '
1027
  'and a11oy /console. Destination ledger only. Not live-probed.</p>'
1028
  '<div class="sp-grid">' + "".join(unify_cards) + '</div>'
1029
  '<p class="sp-foot">Status dot & stage on KEEP tiles are filled from the same-origin '