betterwithage Claude Opus 4.7 commited on
Commit
fddf759
·
verified ·
1 Parent(s): f22dddc

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

Browse files

Reusable Dockerfile-COPY-derived deploy from szl-holdings/a11oy 2e0eb8d32d0acc2ca459506d8a5feac0154bb74a.
Files: 1358 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 (2) hide show
  1. a11oy_command_center.py +75 -47
  2. pages/command-v2.html +35 -0
a11oy_command_center.py CHANGED
@@ -6,22 +6,26 @@
6
  Product host: a-11-oy.com (this surface)
7
  Proof host: a11oy.net (do not serve this surface there)
8
 
9
- Additive tabs:
10
  GET+HEAD /command
 
11
  GET+HEAD /command/constellation
12
  GET+HEAD /command/brain
13
- GET+HEAD /constellation (host-root; declared so SPA fallback cannot 404 it)
14
  GET+HEAD /command/ops
15
  GET+HEAD /operator-pane
 
16
  GET+HEAD /command/{rest}
17
 
18
- Host-root /brain is Hickok dual-stream. Do not steal it.
 
 
19
  """
20
  from pathlib import Path
21
  from typing import List
22
 
23
  MOUNTS = ("/command",)
24
  SPECIFIC = (
 
25
  ("/command/constellation", "constellation.html"),
26
  ("/command/brain", "second-brain.html"),
27
  ("/command/ops", "operator-pane.html"),
@@ -29,6 +33,7 @@ SPECIFIC = (
29
  ("/constellation", "constellation.html"),
30
  )
31
  CATCHALL = "/command/{rest:path}"
 
32
 
33
 
34
  def _spa_path() -> Path:
@@ -40,57 +45,54 @@ def _spa_path() -> Path:
40
  Path("/app/pages/command-center.html"),
41
  here / "command-center.html",
42
  )
43
- for cand in candidates:
44
- if cand.is_file():
45
- return cand
46
  return here / "web" / "elite_console.html"
47
 
48
 
49
  def _page(name: str) -> Path:
50
  here = Path(__file__).resolve().parent
51
- for cand in (here / "pages" / name, Path("/app/pages") / name):
52
- if cand.is_file():
53
- return cand
54
  return here / "pages" / name
55
 
56
 
57
  def _existing_paths(app) -> set:
58
  try:
59
  router = getattr(app, "router", app)
60
- return {getattr(r, "path", None) for r in getattr(router, "routes", [])}
61
  except Exception:
62
  return set()
63
 
64
 
65
  def _drop_paths(app, paths: set) -> None:
66
- """Remove exact path registrations so we can replace SPA stubs."""
67
  router = getattr(app, "router", app)
68
  routes = getattr(router, "routes", None)
69
  if not routes:
70
  return
71
- keep = [r for r in list(routes) if getattr(r, "path", None) not in paths]
72
- routes[:] = keep
73
 
74
 
75
  def _front_move(app, paths: list) -> None:
76
- """Park exact routes at the front, in given order. Never include the catch-all."""
77
  router = getattr(app, "router", app)
78
  routes = getattr(router, "routes", None)
79
  if not routes:
80
  return
81
  wanted = set(paths)
82
- chosen = [r for r in routes if getattr(r, "path", None) in wanted]
83
- if not chosen:
84
- return
85
- for r in chosen:
86
  try:
87
- routes.remove(r)
88
  except ValueError:
89
  pass
90
- order = {p: i for i, p in enumerate(paths)}
91
- chosen.sort(key=lambda r: order.get(getattr(r, "path", ""), 99))
92
- for r in reversed(chosen):
93
- routes.insert(0, r)
94
 
95
 
96
  def register(app, ns: str = "a11oy") -> List[str]:
@@ -112,33 +114,37 @@ def register(app, ns: str = "a11oy") -> List[str]:
112
  page = _page(name)
113
  if page.is_file():
114
  return FileResponse(page, media_type="text/html; charset=utf-8")
 
115
  return JSONResponse(
116
  {
117
- "status": "NOT_FOUND",
118
- "reason": "constellation page missing from image",
 
 
 
 
119
  "page": name,
120
  },
121
- status_code=404,
122
  )
 
123
  return _handler
124
 
125
  specific_paths = {path for path, _name in SPECIFIC}
126
  _drop_paths(app, specific_paths)
127
  existing = _existing_paths(app)
128
- mounted: set = set()
129
  router = getattr(app, "router", app)
130
 
131
  def _add(path: str, handler, methods: List[str]) -> None:
132
  if path in existing and path != CATCHALL:
133
- registered.append("%s already registered (skipped)" % path)
134
  return
135
  try:
136
  router.routes.insert(0, Route(path, handler, methods=methods))
137
  except Exception:
138
  app.add_api_route(path, handler, methods=methods, include_in_schema=False)
139
  existing.add(path)
140
- mounted.add(path)
141
- registered.append("GET+HEAD %s" % path)
142
 
143
  for path in MOUNTS:
144
  _add(path, _spa, ["GET", "HEAD"])
@@ -146,7 +152,10 @@ def register(app, ns: str = "a11oy") -> List[str]:
146
  _add(path, _file(name), ["GET", "HEAD"])
147
  _add(CATCHALL, _spa, ["GET", "HEAD"])
148
  _front_move(app, [path for path, _name in SPECIFIC] + list(MOUNTS))
149
- registered.append("command-center on /command (constellation/brain/ops beat catch-all; /brain and /operator host-root untouched)")
 
 
 
150
  return registered
151
 
152
 
@@ -167,39 +176,58 @@ def _selftest() -> None:
167
  assert "cdnjs" not in html and "googleapis" not in html and "jsdelivr" not in html
168
  assert "Conjecture 1" in html
169
 
170
- async def _console(_req):
171
  return HTMLResponse("<html><body>operator console</body></html>")
172
 
173
- async def _hickok(_req):
174
  return HTMLResponse("<html><body>Hickok dual-stream</body></html>")
175
 
176
  app = Starlette(routes=[Route("/console", _console), Route("/brain", _hickok)])
177
- out = register(app, ns="a11oy")
178
- assert any("/command" in row for row in out), out
179
- c = TestClient(app)
 
 
180
  for path in ("/command", "/command/anatomy", "/command/honest"):
181
- r = c.get(path)
182
- assert r.status_code == 200, (path, r.status_code)
 
 
 
 
 
 
 
 
 
 
 
183
  if _page("constellation.html").is_file():
184
  for path in ("/command/constellation", "/constellation"):
185
- body = c.get(path).text
186
  assert "Constellation" in body, path
187
  assert "Control before capability" not in body
 
188
  if _page("second-brain.html").is_file():
189
- br = c.get("/command/brain")
190
- assert br.status_code == 200
191
- assert "Second Brain" in br.text
192
- assert "F1" in br.text
 
193
  pane = _page("operator-pane.html")
194
  if pane.is_file():
195
  for path in ("/command/ops", "/operator-pane"):
196
- body = c.get(path).text
197
  assert "operator pane" in body.lower(), path
198
  assert "Conjecture 1" in body
199
  assert "cdnjs" not in body and "googleapis" not in body
200
- assert "Hickok" in c.get("/brain").text
201
- assert c.get("/console").status_code == 200
202
- print("a11oy_command_center: ALL OK (constellation beats catch-all; /brain host-root untouched)")
 
 
 
 
203
 
204
 
205
  if __name__ == "__main__":
 
6
  Product host: a-11-oy.com (this surface)
7
  Proof host: a11oy.net (do not serve this surface there)
8
 
9
+ Additive routes:
10
  GET+HEAD /command
11
+ GET+HEAD /command-v2
12
  GET+HEAD /command/constellation
13
  GET+HEAD /command/brain
 
14
  GET+HEAD /command/ops
15
  GET+HEAD /operator-pane
16
+ GET+HEAD /constellation
17
  GET+HEAD /command/{rest}
18
 
19
+ The additive router does not steal /console or the host-root /brain route.
20
+ /command remains on elite_console.html; /command-v2 is an independently
21
+ reviewable skin until an explicit, evidence-backed promotion changes that.
22
  """
23
  from pathlib import Path
24
  from typing import List
25
 
26
  MOUNTS = ("/command",)
27
  SPECIFIC = (
28
+ ("/command-v2", "command-v2.html"),
29
  ("/command/constellation", "constellation.html"),
30
  ("/command/brain", "second-brain.html"),
31
  ("/command/ops", "operator-pane.html"),
 
33
  ("/constellation", "constellation.html"),
34
  )
35
  CATCHALL = "/command/{rest:path}"
36
+ REQUIRED_PAGES = {"command-v2.html"}
37
 
38
 
39
  def _spa_path() -> Path:
 
45
  Path("/app/pages/command-center.html"),
46
  here / "command-center.html",
47
  )
48
+ for candidate in candidates:
49
+ if candidate.is_file():
50
+ return candidate
51
  return here / "web" / "elite_console.html"
52
 
53
 
54
  def _page(name: str) -> Path:
55
  here = Path(__file__).resolve().parent
56
+ for candidate in (here / "pages" / name, Path("/app/pages") / name):
57
+ if candidate.is_file():
58
+ return candidate
59
  return here / "pages" / name
60
 
61
 
62
  def _existing_paths(app) -> set:
63
  try:
64
  router = getattr(app, "router", app)
65
+ return {getattr(route, "path", None) for route in getattr(router, "routes", [])}
66
  except Exception:
67
  return set()
68
 
69
 
70
  def _drop_paths(app, paths: set) -> None:
71
+ """Remove exact path registrations so reviewed pages replace SPA stubs."""
72
  router = getattr(app, "router", app)
73
  routes = getattr(router, "routes", None)
74
  if not routes:
75
  return
76
+ routes[:] = [route for route in list(routes) if getattr(route, "path", None) not in paths]
 
77
 
78
 
79
  def _front_move(app, paths: list) -> None:
80
+ """Park exact routes at the front, in the requested order."""
81
  router = getattr(app, "router", app)
82
  routes = getattr(router, "routes", None)
83
  if not routes:
84
  return
85
  wanted = set(paths)
86
+ chosen = [route for route in routes if getattr(route, "path", None) in wanted]
87
+ order = {path: index for index, path in enumerate(paths)}
88
+ for route in chosen:
 
89
  try:
90
+ routes.remove(route)
91
  except ValueError:
92
  pass
93
+ chosen.sort(key=lambda route: order.get(getattr(route, "path", ""), 99))
94
+ for route in reversed(chosen):
95
+ routes.insert(0, route)
 
96
 
97
 
98
  def register(app, ns: str = "a11oy") -> List[str]:
 
114
  page = _page(name)
115
  if page.is_file():
116
  return FileResponse(page, media_type="text/html; charset=utf-8")
117
+ required = name in REQUIRED_PAGES
118
  return JSONResponse(
119
  {
120
+ "status": "UNAVAILABLE" if required else "NOT_FOUND",
121
+ "reason": (
122
+ f"{name} missing from deployed pages closure"
123
+ if required
124
+ else f"{name} missing from image"
125
+ ),
126
  "page": name,
127
  },
128
+ status_code=503 if required else 404,
129
  )
130
+
131
  return _handler
132
 
133
  specific_paths = {path for path, _name in SPECIFIC}
134
  _drop_paths(app, specific_paths)
135
  existing = _existing_paths(app)
 
136
  router = getattr(app, "router", app)
137
 
138
  def _add(path: str, handler, methods: List[str]) -> None:
139
  if path in existing and path != CATCHALL:
140
+ registered.append(f"{path} already registered (skipped)")
141
  return
142
  try:
143
  router.routes.insert(0, Route(path, handler, methods=methods))
144
  except Exception:
145
  app.add_api_route(path, handler, methods=methods, include_in_schema=False)
146
  existing.add(path)
147
+ registered.append(f"GET+HEAD {path}")
 
148
 
149
  for path in MOUNTS:
150
  _add(path, _spa, ["GET", "HEAD"])
 
152
  _add(path, _file(name), ["GET", "HEAD"])
153
  _add(CATCHALL, _spa, ["GET", "HEAD"])
154
  _front_move(app, [path for path, _name in SPECIFIC] + list(MOUNTS))
155
+ registered.append(
156
+ "command-center on /command; /command-v2 additive; "
157
+ "constellation/brain/ops beat catch-all; /console and host-root /brain untouched"
158
+ )
159
  return registered
160
 
161
 
 
176
  assert "cdnjs" not in html and "googleapis" not in html and "jsdelivr" not in html
177
  assert "Conjecture 1" in html
178
 
179
+ async def _console(_request):
180
  return HTMLResponse("<html><body>operator console</body></html>")
181
 
182
+ async def _hickok(_request):
183
  return HTMLResponse("<html><body>Hickok dual-stream</body></html>")
184
 
185
  app = Starlette(routes=[Route("/console", _console), Route("/brain", _hickok)])
186
+ output = register(app, ns="a11oy")
187
+ assert any("/command" in row for row in output), output
188
+ assert any("/command-v2" in row for row in output), output
189
+ client = TestClient(app)
190
+
191
  for path in ("/command", "/command/anatomy", "/command/honest"):
192
+ response = client.get(path)
193
+ assert response.status_code == 200, (path, response.status_code)
194
+
195
+ command_v2 = _page("command-v2.html")
196
+ if command_v2.is_file():
197
+ response = client.get("/command-v2")
198
+ assert response.status_code == 200
199
+ assert "A11oy Command" in response.text
200
+ assert "Conjecture 1" in response.text
201
+ assert "cdnjs" not in response.text
202
+ assert "googleapis" not in response.text
203
+ assert "jsdelivr" not in response.text
204
+
205
  if _page("constellation.html").is_file():
206
  for path in ("/command/constellation", "/constellation"):
207
+ body = client.get(path).text
208
  assert "Constellation" in body, path
209
  assert "Control before capability" not in body
210
+
211
  if _page("second-brain.html").is_file():
212
+ response = client.get("/command/brain")
213
+ assert response.status_code == 200
214
+ assert "Second Brain" in response.text
215
+ assert "F1" in response.text
216
+
217
  pane = _page("operator-pane.html")
218
  if pane.is_file():
219
  for path in ("/command/ops", "/operator-pane"):
220
+ body = client.get(path).text
221
  assert "operator pane" in body.lower(), path
222
  assert "Conjecture 1" in body
223
  assert "cdnjs" not in body and "googleapis" not in body
224
+
225
+ assert "Hickok" in client.get("/brain").text
226
+ assert client.get("/console").status_code == 200
227
+ print(
228
+ "a11oy_command_center: ALL OK "
229
+ "(v2 additive; exact pages beat catch-all; /console and /brain untouched)"
230
+ )
231
 
232
 
233
  if __name__ == "__main__":
pages/command-v2.html ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <!-- SPDX-License-Identifier: Apache-2.0 · A11oy Command v2 · additive source-derived surface -->
3
+ <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><meta name="theme-color" content="#070a0e"><meta name="referrer" content="strict-origin-when-cross-origin"><meta http-equiv="Content-Security-Policy" content="default-src 'self';connect-src 'self';img-src 'self' data:;font-src 'self';style-src 'unsafe-inline';script-src 'unsafe-inline';object-src 'none';base-uri 'none';form-action 'none'"><title>A11oy Command v2</title><style>
4
+ :root{color-scheme:dark;--bg:#070a0e;--p:#0d1219;--p2:#121a24;--ink:#f3f7fa;--m:#94a1b2;--f:#667487;--line:#263445;--a:#c9f3ff;--rail:228px;--top:60px;--dock:66px;--r:14px;font-family:Inter,"Helvetica Neue",Arial,system-ui,sans-serif}*{box-sizing:border-box}html,body{height:100%;margin:0;background:var(--bg);color:var(--ink)}body{overflow:hidden;font-size:14px;line-height:1.5}button,input{font:inherit;color:inherit}button,a{min-height:44px}button{cursor:pointer}a{color:inherit;text-decoration:none}:focus-visible{outline:2px solid var(--a);outline-offset:3px}.shell{height:100dvh;display:grid;grid-template:var(--top) minmax(0,1fr)/var(--rail) minmax(0,1fr)}header{grid-column:1/-1;display:flex;align-items:center;gap:12px;padding:0 16px;border-bottom:1px solid var(--line);background:rgba(7,10,14,.96);z-index:5}.brand{display:flex;align-items:baseline;gap:8px;white-space:nowrap}.brand b{font-size:15px}.brand span,.eyebrow,.label{font:10px/1.2 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.12em;text-transform:uppercase;color:var(--m)}.key{display:grid;place-items:center;min-width:48px;padding:0 12px;border:1px solid var(--line);border-radius:10px;background:var(--p)}.chips{display:flex;gap:6px;margin-left:auto;overflow:auto;scrollbar-width:none}.chips::-webkit-scrollbar{display:none}.chip{flex:0 0 auto;padding:7px 9px;border:1px solid var(--line);border-radius:999px;font:10px/1 ui-monospace,SFMono-Regular,Consolas,monospace;color:var(--m);white-space:nowrap}.chip[data-state=measured]{color:var(--a);border-color:#426675}.chip[data-state=unavailable]{color:#e0aaaa;border-color:#70454b}aside{min-height:0;overflow:auto;padding:16px 10px 84px;border-right:1px solid var(--line);background:linear-gradient(180deg,var(--bg),#090d13)}.rail-title{padding:8px 10px 12px;font:10px/1 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.14em;text-transform:uppercase;color:var(--f)}.room{display:block;width:100%;min-height:54px;margin:2px 0;padding:9px 10px;border:1px solid transparent;border-radius:11px;background:transparent;text-align:left;color:var(--m)}.room:hover{background:var(--p);color:var(--ink)}.room[aria-current=page]{background:var(--p2);border-color:var(--line);color:var(--ink)}.room small{display:block;color:var(--f);font:10px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace}main{min-width:0;min-height:0;overflow:auto;padding:clamp(22px,4vw,48px) clamp(16px,4vw,56px) 100px}.inner{width:min(1120px,100%);margin:auto}h1{max-width:16ch;margin:8px 0 12px;font-size:clamp(34px,6vw,68px);font-weight:500;line-height:.98;letter-spacing:-.055em}.lede{max-width:62ch;margin:0 0 22px;color:var(--m);font-size:15px}.actions{display:flex;flex-wrap:wrap;gap:9px;margin:20px 0 26px}.action{display:inline-flex;align-items:center;justify-content:center;padding:0 15px;border:1px solid var(--line);border-radius:11px;background:var(--p);font-weight:650}.action.primary{background:var(--ink);border-color:var(--ink);color:var(--bg)}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:14px 0 24px}.card{min-width:0;padding:17px;border:1px solid var(--line);border-radius:var(--r);background:linear-gradient(145deg,var(--p),#090e14)}.value{margin:8px 0 5px;font:clamp(22px,3vw,34px)/1.1 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:-.04em;overflow-wrap:anywhere}.detail{color:var(--f);font-size:12px;overflow-wrap:anywhere}.section{margin:27px 0 10px;font:10px/1.2 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.14em;text-transform:uppercase;color:var(--f)}.rows{display:grid;gap:8px}.row,.rows a{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:52px;padding:11px 13px;border:1px solid var(--line);border-radius:11px;background:var(--p);color:var(--m);overflow-wrap:anywhere}.rows a:hover{color:var(--ink);border-color:#405166}.empty{padding:20px;border:1px dashed var(--line);border-radius:var(--r);color:var(--m)}.dock{display:none;position:fixed;right:0;bottom:0;left:0;height:var(--dock);border-top:1px solid var(--line);background:rgba(7,10,14,.98);z-index:10}.dock button{flex:1;border:0;background:transparent;color:var(--f);font:10px/1.15 ui-monospace,SFMono-Regular,Consolas,monospace;text-transform:uppercase}.dock button[aria-current=page]{color:var(--a)}dialog{width:min(640px,calc(100% - 32px));padding:0;border:1px solid var(--line);border-radius:16px;background:var(--p);color:var(--ink)}dialog::backdrop{background:rgba(0,0,0,.74)}dialog input{width:100%;min-height:56px;padding:0 16px;border:0;border-bottom:1px solid var(--line);background:transparent;outline:0}.hits{max-height:55vh;overflow:auto}.hit{display:block;width:100%;min-height:50px;padding:10px 16px;border:0;border-bottom:1px solid var(--line);background:transparent;text-align:left;color:var(--m)}.hit:hover{background:var(--p2);color:var(--ink)}.sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:980px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:760px){body{overflow:auto}.shell{display:block;height:auto;min-height:100dvh}header{position:sticky;top:0;height:var(--top)}aside{display:none}main{min-height:calc(100dvh - var(--top));padding-bottom:92px}.dock{display:flex}.chips .chip:nth-child(n+4){display:none}}@media(max-width:520px){.grid{grid-template-columns:1fr}.brand span{display:none}main{padding-left:14px;padding-right:14px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}@media(forced-colors:active){.chip,.room,.card,.action,.row,.rows a,dialog{border-color:CanvasText}}
5
+ </style></head><body><div class="shell"><header><div class="brand"><b>A11oy</b><span>Command v2</span></div><button class="key" id="open" type="button" aria-haspopup="dialog" aria-controls="palette" aria-label="Open command palette">⌘K</button><div class="chips" aria-label="Source status"><span class="chip" id="release">Release · checking</span><span class="chip" id="lambda">Λ · checking</span><span class="chip" id="signer">Signer · checking</span><span class="chip" id="receipts">Receipts · checking</span></div></header><aside id="rail" aria-label="Command rooms"></aside><main id="canvas" tabindex="-1"><div class="inner" id="content"></div></main></div><nav class="dock" id="dock" aria-label="Mobile command rooms"></nav><dialog id="palette" aria-modal="true" aria-labelledby="palette-title"><h2 class="sr" id="palette-title">Open a command room</h2><label class="sr" for="query">Search rooms</label><input id="query" type="search" placeholder="Open a room…" autocomplete="off"><div class="hits" id="hits" role="listbox"></div></dialog><script>
6
+ "use strict";
7
+ const rooms=[{id:"command",label:"Command",brief:"readiness · health",dock:1},{id:"evidence",label:"Evidence",brief:"receipts · verify",dock:1},{id:"governance",label:"Governance",brief:"Hatun · gates"},{id:"telemetry",label:"Telemetry",brief:"mesh · signals"},{id:"defense",label:"Defense",brief:"Killinchu · boundary",dock:1},{id:"markets",label:"Markets",brief:"Finance · Terra · Counsel",dock:1},{id:"models",label:"Models",brief:"registry · kernels"},{id:"diligence",label:"Diligence",brief:"release · proof"}];
8
+ const endpoints={honest:"/api/a11oy/v1/honest",lambda:"/api/a11oy/v1/lambda",version:"/api/a11oy/v1/version",ledger:"/api/a11oy/v1/ledger",signing:"/api/a11oy/v1/signing-status",mesh:"/api/a11oy/v1/mesh/state",series:"/api/a11oy/v1/series-a/status",hatun:"/api/hatun/evidence",health:"/healthz",readiness:"/api/a11oy/v1/readiness/tab-matrix?view=summary",build:"/api/build-info"};
9
+ const state={room:"command",data:{},returnFocus:null},$=id=>document.getElementById(id),txt=(v,f="UNAVAILABLE")=>v===null||v===undefined||v===""?f:String(v),num=v=>Number.isFinite(Number(v))?Number(v):null;
10
+ function node(tag,props={},children=[]){const n=document.createElement(tag);for(const[k,v]of Object.entries(props)){if(k==="class")n.className=v;else if(k==="text")n.textContent=v;else if(k==="href")n.href=v;else n.setAttribute(k,v)}for(const c of [].concat(children))n.append(c);return n}
11
+ async function probe(path){const c=new AbortController(),t=setTimeout(()=>c.abort(),9000);try{const r=await fetch(path,{cache:"no-store",credentials:"omit",headers:{Accept:"application/json"},signal:c.signal}),raw=await r.text();let json=null;try{json=JSON.parse(raw)}catch{}return{ok:r.ok,status:r.status,json}}catch(error){return{ok:false,status:0,json:null,error:error?.name||"Error"}}finally{clearTimeout(t)}}
12
+ const get=name=>state.data[name]||{ok:false,status:0,json:null};
13
+ function chip(id,label,value,ok){const n=$(id);n.textContent=`${label} · ${txt(value)}`;n.dataset.state=ok?"measured":"unavailable"}
14
+ function updateChips(){const v=get("version"),l=get("lambda"),s=get("signing"),r=get("ledger"),lv=num(l.json?.lambda);chip("release","Release",v.json?.release_state||v.json?.version,v.ok&&!!v.json);chip("lambda","Λ",lv===null?null:`${lv.toFixed(3)} · conjecture`,l.ok&&lv!==null);chip("signer","Signer",s.json?.key_persistent?"persistent":s.json?.non_repudiation===false?"partial":"absent",s.ok&&!!s.json);chip("receipts","Receipts",r.json?.count??0,r.ok&&!!r.json)}
15
+ function button(room,compact=false){const b=node("button",{type:"button",class:compact?"":"room","aria-current":state.room===room.id?"page":"false"});if(compact)b.textContent=room.label;else b.append(document.createTextNode(room.label),node("small",{text:room.brief}));b.addEventListener("click",()=>openRoom(room.id));return b}
16
+ function navigation(){const rail=$("rail");rail.replaceChildren(node("div",{class:"rail-title",text:"Operate"}),...rooms.map(r=>button(r)));$("dock").replaceChildren(...rooms.filter(r=>r.dock).map(r=>button(r,true)))}
17
+ function title(eye,heading,lede){return[node("div",{class:"eyebrow",text:eye}),node("h1",{text:heading}),node("p",{class:"lede",text:lede})]}
18
+ function card(label,value,detail=""){return node("article",{class:"card"},[node("div",{class:"label",text:label}),node("div",{class:"value",text:txt(value)}),node("div",{class:"detail",text:detail})])}
19
+ function link(href,label,primary=false){const allowed=href.startsWith("/")||href==="https://a11oy.net",a=node("a",{class:`action${primary?" primary":""}`,href:allowed?href:"#",text:label});if(href.startsWith("https://")){a.target="_blank";a.rel="noopener noreferrer"}return a}
20
+ function grid(cards){return node("div",{class:"grid"},cards)}function actions(items){return node("div",{class:"actions"},items)}function section(text){return node("div",{class:"section",text})}function empty(text){return node("div",{class:"empty",text})}
21
+ function command(){const l=get("lambda").json||{},v=get("version").json||{},r=get("ledger").json||{},s=get("signing").json||{},m=get("readiness").json?.matrix_summary||{},q=get("readiness").json?.verdict_summary||{},health=get("health");return[...title("Command · source-derived","Control before capability.","Eight rooms. One proof boundary. Λ remains Conjecture 1."),actions([link("/verify","Verify receipt",1),link("/console","Open console"),link("https://a11oy.net","Proof registry")]),grid([card("Λ trust",num(l.lambda)===null?null:Number(l.lambda).toFixed(3),`floor ${txt(l.lambda_floor,"0.900")} · Conjecture 1`),card("Receipts",r.count??0,txt(r.signature_state,"UNSIGNED")),card("Signer",s.key_persistent?"PERSISTENT":s.non_repudiation===false?"PARTIAL":"ABSENT",txt(s.hmac_layer,"no persistent key proved")),card("Release",v.release_state||v.version,health.ok?"runtime reachable":"runtime unavailable")]),grid([card("Readiness",m.tabs?`${m.tabs} tabs`:null,`${txt(m.staticTabs,"0")} static · ${txt(q.ok,"0")} OK · ${txt(q.lies,"0")} lies`),card("Health",health.ok?"MEASURED":"UNAVAILABLE",health.status?`HTTP ${health.status}`:"no response")]) ]}
22
+ function evidence(){const r=get("ledger").json||{};return[...title("Evidence","Receipts, not rhetoric.","A zero-count ledger is valid when the source reports zero."),grid([card("Minted",r.count??0,"current operator ledger"),card("Signature",r.signature_state,"UNSIGNED is honest"),card("Chain",r.chain_verified===true?"VERIFIED":null,"source-derived")]),actions([link("/verify","Open verifier",1),link(endpoints.ledger,"Ledger JSON")])]}
23
+ function governance(){const h=get("hatun").json||{};return[...title("Governance","Admission before action.",txt(h.honesty,"Hatun evidence unavailable.")),grid([card("Runtime",h.runtime?.status,h.runtime?.mcp_endpoint||"/mcp/"),card("Tools",h.tool_catalog?.count,h.tool_catalog?.status||""),card("Invocations",h.invocations?.count??0,h.invocations?.status||"UNKNOWN")]),actions([link("/mcp/","Open MCP",1),link(endpoints.hatun,"Evidence JSON")])]}
24
+ function telemetry(){const wires=get("mesh").json?.wires||{},entries=Object.entries(wires),rows=node("div",{class:"rows"},entries.map(([name,value])=>node("div",{class:"row"},[node("span",{text:name}),node("span",{text:`${txt(value?.status)} · ${txt(value?.edge)}`})])));return[...title("Telemetry","Observe the fabric.","No synthetic green state."),entries.length?rows:empty("Mesh evidence unavailable.")]}
25
+ function defense(){return[...title("Defense","Eyes and decision. Not the trigger.","Killinchu stays inside the legal and human-authorization boundary."),node("div",{class:"rows"},[link("/killinchu","Open Killinchu",1),link("/elite","Legal boundary"),link("/console#cuas_fusion","Fusion view")])]}
26
+ function markets(){return[...title("Markets","Three desks. One room.","Each desk remains source-labeled and independently verifiable."),grid([card("PURIQ Finance","DESK","market evidence"),card("Terra","DESK","property evidence"),card("PRISM Counsel","DESK","matter evidence")]),actions([link("/lyte","Lyte"),link("/estate","Estate")])]}
27
+ function models(){const items=Array.isArray(get("version").json?.capabilities)?get("version").json.capabilities:[],rows=node("div",{class:"rows"},items.map(i=>node("div",{class:"row"},[node("span",{text:txt(i?.name)}),node("span",{text:txt(i?.label)})])));return[...title("Models","Registry over theater.","A capability appears only when the version contract reports it."),items.length?rows:empty("Capability registry unavailable.")]}
28
+ function diligence(){const s=get("series").json||{},v=get("version").json||{},r=get("readiness").json||{},fail=Array.isArray(s.critical_failures)?s.critical_failures.join(", "):"";return[...title("Diligence","Proved. Blocked. Unknown.","Reachability is not release readiness."),grid([card("Series-A",s.state,fail||"source contract"),card("Tab matrix",r.available===true?"AVAILABLE":null,"current runtime"),card("Release",v.release_state,"current version contract")]),actions([link(endpoints.honest,"Honesty JSON",1),link(endpoints.build,"Build identity")])]}
29
+ const painters={command,evidence,governance,telemetry,defense,markets,models,diligence};
30
+ function render(){navigation();const c=$("content");c.replaceChildren(...(painters[state.room]||command)());document.title=`A11oy Command · ${rooms.find(r=>r.id===state.room)?.label||"Command"}`}
31
+ function openRoom(id,focus=true){state.room=rooms.some(r=>r.id===id)?id:"command";history.replaceState(null,"",`#${state.room}`);render();if(focus)$("canvas").focus({preventScroll:true})}
32
+ function hits(value=""){const q=value.trim().toLowerCase(),choices=rooms.filter(r=>!q||r.label.toLowerCase().includes(q)||r.brief.toLowerCase().includes(q));$("hits").replaceChildren(...choices.map(r=>{const b=node("button",{type:"button",class:"hit",role:"option",text:`${r.label} — ${r.brief}`});b.addEventListener("click",()=>{$("palette").close();openRoom(r.id)});return b}))}
33
+ async function boot(){const hash=(location.hash||"#command").slice(1);state.room=rooms.some(r=>r.id===hash)?hash:"command";render();const data=await Promise.all(Object.entries(endpoints).map(async([name,path])=>[name,await probe(path)]));state.data=Object.fromEntries(data);updateChips();render()}
34
+ $("open").addEventListener("click",()=>{state.returnFocus=document.activeElement;hits();$("palette").showModal();$("query").focus()});$("query").addEventListener("input",e=>hits(e.target.value));$("palette").addEventListener("close",()=>state.returnFocus?.focus());document.addEventListener("keydown",e=>{if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="k"){e.preventDefault();$("open").click()}});boot();
35
+ </script></body></html>