Spaces:
Running
Running
deploy(hf): sync szl-holdings/a11oy@db8e5cb3fbc20cd429bcc6aad81165fa51a87026 derived COPY set
Browse filesReusable Dockerfile-COPY-derived deploy from szl-holdings/a11oy db8e5cb3fbc20cd429bcc6aad81165fa51a87026.
Files: 1161 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>
routers/series_a_web/app.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
"use strict";
|
| 3 |
+
const API = "/api/a11oy/v1/series-a";
|
| 4 |
+
const terminal = (value) => value == null ? "UNKNOWN" : String(value);
|
| 5 |
+
const set = (key, value) => {
|
| 6 |
+
const node = document.querySelector(`[data-key="${key}"]`);
|
| 7 |
+
if (node) node.textContent = terminal(value);
|
| 8 |
+
};
|
| 9 |
+
const sha256 = async (text) => {
|
| 10 |
+
const bytes = new TextEncoder().encode(text);
|
| 11 |
+
const digest = await crypto.subtle.digest("SHA-256", bytes);
|
| 12 |
+
return [...new Uint8Array(digest)].map(value => value.toString(16).padStart(2, "0")).join("");
|
| 13 |
+
};
|
| 14 |
+
const request = async (path, options = {}) => {
|
| 15 |
+
const controller = new AbortController();
|
| 16 |
+
const timer = setTimeout(() => controller.abort(), 8000);
|
| 17 |
+
try {
|
| 18 |
+
const response = await fetch(API + path, {cache: "no-store", ...options, signal: controller.signal});
|
| 19 |
+
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
| 20 |
+
return await response.json();
|
| 21 |
+
} finally { clearTimeout(timer); }
|
| 22 |
+
};
|
| 23 |
+
const load = async () => {
|
| 24 |
+
try {
|
| 25 |
+
const [status, trust, receipts] = await Promise.all([
|
| 26 |
+
request("/status"), request("/trust"), request("/receipts")
|
| 27 |
+
]);
|
| 28 |
+
set("estate", status.state);
|
| 29 |
+
set("repos", status.counts?.github_repositories);
|
| 30 |
+
set("prs", status.counts?.github_open_pull_requests);
|
| 31 |
+
set("spaces", status.counts?.spaces);
|
| 32 |
+
set("models", status.counts?.models);
|
| 33 |
+
set("datasets", status.counts?.datasets);
|
| 34 |
+
set("trust", trust.score_0_to_100);
|
| 35 |
+
set("signer", status.signature_status || status.signing_key_source);
|
| 36 |
+
document.getElementById("updated").textContent = status.observed_at ? `Observed ${status.observed_at}` : status.detail || "Terminal state reached";
|
| 37 |
+
const list = document.getElementById("receipts");
|
| 38 |
+
list.replaceChildren(...(receipts.items || []).slice(0, 8).map(item => {
|
| 39 |
+
const li = document.createElement("li");
|
| 40 |
+
li.textContent = `${item.kind} · ${item.receipt_hash.slice(0, 14)}… · ${item.envelope.signature_status}`;
|
| 41 |
+
return li;
|
| 42 |
+
}));
|
| 43 |
+
if (!list.children.length) list.innerHTML = "<li>OBSERVED · no receipts yet</li>";
|
| 44 |
+
} catch (error) {
|
| 45 |
+
["estate", "trust", "signer"].forEach(key => set(key, error.name === "AbortError" ? "TIMED_OUT" : "UNAVAILABLE"));
|
| 46 |
+
document.getElementById("updated").textContent = error.name === "AbortError" ? "Timed out after 8 seconds" : String(error.message || error);
|
| 47 |
+
}
|
| 48 |
+
};
|
| 49 |
+
document.getElementById("refresh").addEventListener("click", async () => {
|
| 50 |
+
const button = document.getElementById("refresh");
|
| 51 |
+
button.disabled = true;
|
| 52 |
+
try {
|
| 53 |
+
await request("/refresh", {method: "POST", headers: {"content-type": "application/json"}, body: JSON.stringify({actor: "series-a-ui"})});
|
| 54 |
+
} catch (error) {
|
| 55 |
+
document.getElementById("updated").textContent = String(error.message || error);
|
| 56 |
+
} finally { button.disabled = false; await load(); }
|
| 57 |
+
});
|
| 58 |
+
document.getElementById("passport").addEventListener("submit", async (event) => {
|
| 59 |
+
event.preventDefault();
|
| 60 |
+
const form = new FormData(event.currentTarget);
|
| 61 |
+
const evidenceStatement = JSON.stringify({
|
| 62 |
+
source: "series-a-ui",
|
| 63 |
+
target: form.get("target"),
|
| 64 |
+
label: form.get("label"),
|
| 65 |
+
observed_at: new Date().toISOString()
|
| 66 |
+
});
|
| 67 |
+
const body = {
|
| 68 |
+
principal_id: "series-a-ui",
|
| 69 |
+
action: {type: form.get("type"), target: form.get("target"), impact: "MODERATE", irreversible: false},
|
| 70 |
+
evidence: [{evidence_id: "ui-observation", label: form.get("label"), content_digest: await sha256(evidenceStatement)}],
|
| 71 |
+
expected_if_withheld: "Current state persists",
|
| 72 |
+
expected_if_acted: "Bounded action completes or fails closed"
|
| 73 |
+
};
|
| 74 |
+
const output = document.getElementById("passport-result");
|
| 75 |
+
output.textContent = "EVALUATING";
|
| 76 |
+
try {
|
| 77 |
+
const value = await request("/passports/evaluate", {method: "POST", headers: {"content-type": "application/json"}, body: JSON.stringify(body)});
|
| 78 |
+
output.textContent = JSON.stringify({decision: value.passport.decision, reason_codes: value.passport.reason_codes, passport_digest: value.passport_digest, signature_status: value.decision_receipt.envelope.signature_status}, null, 2);
|
| 79 |
+
} catch (error) { output.textContent = `UNAVAILABLE: ${error.message || error}`; }
|
| 80 |
+
await load();
|
| 81 |
+
});
|
| 82 |
+
load();
|
| 83 |
+
window.setInterval(load, 60000);
|
| 84 |
+
})();
|
routers/series_a_web/index.html
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!doctype html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="utf-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
| 6 |
+
<title>A11oy Series-A Live Control Plane</title>
|
| 7 |
+
<link rel="stylesheet" href="/series-a/styles.css">
|
| 8 |
+
</head>
|
| 9 |
+
<body>
|
| 10 |
+
<a class="skip" href="#main">Skip to control plane</a>
|
| 11 |
+
<header>
|
| 12 |
+
<p class="eyebrow">A11OY · ACTION ASSURANCE</p>
|
| 13 |
+
<h1>Series‑A Live Control Plane</h1>
|
| 14 |
+
<p>Current estate truth, counterfactual action passports, signed receipts, and one-attempt execution—observed, not assumed.</p>
|
| 15 |
+
</header>
|
| 16 |
+
<main id="main" tabindex="-1">
|
| 17 |
+
<section class="toolbar" aria-label="Control plane actions">
|
| 18 |
+
<button id="refresh" type="button">Refresh live estate</button>
|
| 19 |
+
<span id="updated" aria-live="polite">Not observed yet</span>
|
| 20 |
+
</section>
|
| 21 |
+
<section class="grid" id="cards" aria-label="Live status">
|
| 22 |
+
<article><h2>Estate</h2><strong data-key="estate">CHECKING</strong><p>Signed current observation.</p></article>
|
| 23 |
+
<article><h2>GitHub repos</h2><strong data-key="repos">—</strong><p>Complete paginated census.</p></article>
|
| 24 |
+
<article><h2>Open PRs</h2><strong data-key="prs">—</strong><p>Current public queue.</p></article>
|
| 25 |
+
<article><h2>HF Spaces</h2><strong data-key="spaces">—</strong><p>One canonical A11oy required.</p></article>
|
| 26 |
+
<article><h2>Models</h2><strong data-key="models">—</strong><p>Official Hub listing.</p></article>
|
| 27 |
+
<article><h2>Datasets</h2><strong data-key="datasets">—</strong><p>Official Hub listing.</p></article>
|
| 28 |
+
<article><h2>Trust factor</h2><strong data-key="trust">CHECKING</strong><p>Derived from signed local decisions.</p></article>
|
| 29 |
+
<article><h2>Receipt signer</h2><strong data-key="signer">CHECKING</strong><p>Persistent P‑256 preferred.</p></article>
|
| 30 |
+
</section>
|
| 31 |
+
<section class="panel">
|
| 32 |
+
<h2>Counterfactual Action Passport</h2>
|
| 33 |
+
<form id="passport">
|
| 34 |
+
<label>Action
|
| 35 |
+
<select name="type"><option value="estate.refresh">Refresh estate truth</option><option value="probe.public_surface">Probe public surface</option></select>
|
| 36 |
+
</label>
|
| 37 |
+
<label>Target <input name="target" value="https://a-11-oy.com/healthz" required></label>
|
| 38 |
+
<label>Evidence label <select name="label"><option>MEASURED</option><option>REPORTED</option><option>UNKNOWN</option></select></label>
|
| 39 |
+
<button type="submit">Evaluate passport</button>
|
| 40 |
+
</form>
|
| 41 |
+
<pre id="passport-result" aria-live="polite">No passport evaluated.</pre>
|
| 42 |
+
</section>
|
| 43 |
+
<section class="panel">
|
| 44 |
+
<h2>Latest signed receipts</h2>
|
| 45 |
+
<ol id="receipts"><li>CHECKING</li></ol>
|
| 46 |
+
</section>
|
| 47 |
+
</main>
|
| 48 |
+
<footer>MEASURED · REPORTED · MODELED · UNKNOWN · UNAVAILABLE · no private reasoning collected</footer>
|
| 49 |
+
<script src="/series-a/app.js" defer></script>
|
| 50 |
+
</body>
|
| 51 |
+
</html>
|
routers/series_a_web/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
:root{color-scheme:dark;--bg:#07101e;--card:#0d192a;--line:#24344d;--text:#eef5ff;--muted:#9db0c9;--accent:#83d6ff;--good:#7ce7ba}*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at top,#13223a 0,#07101e 42%);color:var(--text);font:16px/1.5 system-ui,-apple-system,Segoe UI,sans-serif}.skip{position:absolute;left:-9999px}.skip:focus{left:1rem;top:1rem;background:white;color:black;padding:.7rem;z-index:5}header,main,footer{width:min(1180px,calc(100% - 2rem));margin:auto}header{padding:4rem 0 2rem}.eyebrow{color:var(--accent);letter-spacing:.16em;font-weight:800}h1{font-size:clamp(2.2rem,6vw,5rem);line-height:1;margin:.3rem 0}header>p:last-child{max-width:760px;color:var(--muted);font-size:1.12rem}.toolbar{display:flex;gap:1rem;align-items:center;justify-content:space-between;margin-bottom:1rem}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem}.grid article,.panel{background:linear-gradient(180deg,rgba(18,34,57,.96),rgba(10,22,38,.96));border:1px solid var(--line);border-radius:18px;padding:1.2rem;box-shadow:0 16px 60px rgba(0,0,0,.25)}.grid h2{font-size:.92rem;color:var(--muted);margin:0 0 .5rem}.grid strong{font-size:1.7rem;color:var(--good)}.grid p{color:var(--muted);margin:.4rem 0 0}.panel{margin-top:1rem}form{display:grid;grid-template-columns:1fr 2fr 1fr auto;gap:.8rem;align-items:end}label{display:grid;gap:.35rem;color:var(--muted)}input,select,button{font:inherit;border-radius:10px;border:1px solid var(--line);padding:.7rem .8rem;background:#071321;color:var(--text)}button{background:#dff5ff;color:#06101b;font-weight:800;cursor:pointer}button:disabled{opacity:.55}pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#06101b;border-radius:12px;padding:1rem}footer{padding:2rem 0 4rem;color:var(--muted)}@media(max-width:900px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}form{grid-template-columns:1fr 1fr}}@media(max-width:560px){header{padding-top:2.5rem}.grid,form{grid-template-columns:1fr}.toolbar{align-items:flex-start;flex-direction:column}.grid article{min-height:130px}}
|