Files
XZBT-NGN/public/index.html
T
Labyricorn dcae56a4b6 Step 6.3 Complete — Generic Contract 5.3 Surface Discovery
- src/validation.js: add validateSurfaceCatalog() implementing Contract
  5.3 §§31.2-31.5 normative validation order (validate individuals ->
  discard invalids -> evaluate primary invariant against working set)
- src/host.js: emit xzbt:5.3 advisory (§6.5); store contractMinor;
  add surfaces=[] to resetView(); parse surfaces in refresh(true)
- src/ui.js: add buildSurfaces() for generic descriptor-driven surface
  display; integrate renderedSurfaces tracking into render()
- public/index.html: subtitle updated to Contract 5.2/5.3; add
  surfaces-section with surfaces div
- public/style.css: add .surface, .surface-badge, .surface-meta styles
- tests/surface-validation.test.js: 45 new tests covering all Part 8
  malformed surface cases, lifecycle, registry refresh, 5.2 regression
- docs/reference/XZBT-NGN-Step6.3-Surface-Discovery-Verification.md

Test results: 88/88 pass (43 pre-existing + 45 new)
Genericity scan: zero matches in src/, public/, server/
git diff --check: clean
2026-09-14 14:19:57 -07:00

34 lines
3.0 KiB
HTML

<!doctype html>
<html lang="en">
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>XZBT-NGN Exhibit Engine</title><link rel="stylesheet" href="/public/style.css"></head>
<body>
<header><h1>XZBT-NGN Exhibit Engine</h1><p>Contract 5.2/5.3 · One exhibit at a time</p></header>
<main>
<section><h2>Connection</h2>
<form id="connection"><label for="exhibit-url">Exhibit URL (same origin)</label><div class="connection-row"><input id="exhibit-url" placeholder="/public/exhibits/example/index.html" required><button>Load exhibit</button><button id="reconnect" type="button" disabled>Reconnect</button><button id="disconnect" type="button" disabled>Disconnect</button></div></form>
<p>Enter a trusted exhibit's local served path or a URL on this origin. Load exhibit also switches exhibits. Reconnect starts a new session, or reloads the last exhibit after disconnect.</p>
<p id="status" role="status">Disconnected</p><p id="identity"></p><p id="loaded-url"></p>
<p id="latest-error" role="alert" hidden></p>
<div id="frame-container"></div>
</section>
<section><h2>Exhibit controls <span id="target-count"></span></h2>
<details><summary>Capabilities</summary><ul id="capabilities"></ul><p>Unavailable requirements disable affected controls. Available/loading capabilities may use an exhibit fallback; the exhibit decides whether to accept a request.</p></details>
<p>Reported values are authoritative. New values are drafts; select Set or Invoke to submit. Rediscovery resets drafts.</p>
<div id="catalog">Connect an exhibit to discover its controls.</div>
</section>
<section id="surfaces-section"><h2>Presentation surfaces <span id="surface-count"></span></h2>
<p>Presentation surfaces are optional Contract 5.3 views advertised by the connected exhibit. Discovery is descriptor-driven; opening surfaces is a later phase.</p>
<div id="surfaces"><p>No presentation surfaces advertised.</p></div>
</section>
<section><h2>State and metadata</h2><button id="refresh" disabled>Refresh state</button>
<details><summary>Session and exhibit metadata</summary><pre id="metadata">No negotiated session.</pre></details>
<details><summary>Current persistent state</summary><p>Last reported exhibit values. This host view may be uncertain while resynchronizing.</p><pre id="state">{}</pre></details>
</section>
<section><h2>Protocol diagnostics</h2>
<details><summary>Incoming events</summary><p>Latest 200 session events, including source, sequence, revision, and correlation when supplied.</p><pre id="events" aria-label="Incoming events">[]</pre></details>
<details><summary>Protocol and errors</summary><p>Latest 200 entries across connections in this page. Timestamps identify earlier failures.</p><button id="clear-errors">Clear log</button><pre id="errors" role="log">[]</pre></details>
</section>
</main>
<script type="module" src="/src/ui.js"></script>
</body></html>