Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/TRUST-CENTER-en.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</head>
<body><div class="wrap">
<header><div><h1>CoreGuard Trust Center</h1><p class="sub">Every number on this page is measured from a committed artifact, and every claim is classified honestly — no slogans.</p></div>
<div class="meta"><div>Measured: <span class="mono">2026-12-02T21:25:59Z</span></div><div>Commit: <span class="mono">83ece794</span></div><div><a href="docs/state-snapshot.json">State snapshot</a></div></div></header>
<div class="meta"><div>Measured: <span class="mono">2026-12-02T21:25:59Z</span></div><div>Commit: <span class="mono">83ece794</span></div><div><a href="docs/state-snapshot.json">State snapshot</a></div><div><a href="TRUST-CENTER.html">Arabic</a></div></div></header>
<div class="grid"><div class="kpi"><div class="k">Tests</div><div class="v">2,489</div><div class="n">machine-pinned pass total</div></div>
<div class="kpi"><div class="k">Boundary audit</div><div class="v">1,915 files</div><div class="n">0 violations</div></div>
<div class="kpi"><div class="k">Docs contract</div><div class="v">140 / 91 / 34</div><div class="n">executed / skip-listed / docs covered</div></div>
Expand Down
2 changes: 1 addition & 1 deletion docs/TRUST-CENTER.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</head>
<body><div class="wrap">
<header><div><h1>مركز الثقة — CoreGuard</h1><p class="sub">كل رقم في هذه الصفحة مقيس من مستودع مُلتزَم، وكل ادعاء مصنّف بصدق — لا شعارات.</p></div>
<div class="meta"><div>قياس: <span class="mono">2026-12-02T21:25:59Z</span></div><div>الالتزام: <span class="mono">83ece794</span></div><div><a href="docs/state-snapshot.json">لقطة الحالة</a></div></div></header>
<div class="meta"><div>قياس: <span class="mono">2026-12-02T21:25:59Z</span></div><div>الالتزام: <span class="mono">83ece794</span></div><div><a href="docs/state-snapshot.json">لقطة الحالة</a></div><div><a href="TRUST-CENTER-en.html">English</a></div></div></header>
<div class="grid"><div class="kpi"><div class="k">الاختبارات</div><div class="v">2,489</div><div class="n">مجموع النجاح المثبّت في اللقطة</div></div>
<div class="kpi"><div class="k">تدقيق الحدود</div><div class="v">1,915 ملفًا</div><div class="n">0 مخالفة</div></div>
<div class="kpi"><div class="k">عقد الوثائق</div><div class="v">140 / 91 / 34</div><div class="n">مُنفّذ / مستثنى بسبب / وثائق مغطّاة</div></div>
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-trust-center.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ footer{margin-top:44px;border-top:1px solid var(--line);padding-top:16px;color:v
</head>
<body><div class="wrap">
<header><div><h1>${esc(T.title)}</h1><p class="sub">${esc(T.sub)}</p></div>
<div class="meta"><div>${esc(T.measured)}: <span class="mono">${esc(s.measuredAtUtc ?? "")}</span></div><div>${esc(T.commit)}: <span class="mono">${esc(shortCommit(s.gitCommit))}</span></div><div><a href="${ARTIFACTS.snapshot}">${esc(T.snapshot)}</a></div></div></header>
<div class="meta"><div>${esc(T.measured)}: <span class="mono">${esc(s.measuredAtUtc ?? "")}</span></div><div>${esc(T.commit)}: <span class="mono">${esc(shortCommit(s.gitCommit))}</span></div><div><a href="${ARTIFACTS.snapshot}">${esc(T.snapshot)}</a></div><div><a href="${ar ? "TRUST-CENTER-en.html" : "TRUST-CENTER.html"}">${ar ? "English" : "Arabic"}</a></div></div></header>
<div class="grid">${kpis}</div>
<section class="not"><h2>${esc(T.notTitle)}</h2><ul>${not}</ul></section>
<section><h2>${esc(T.claimsTitle)}</h2><table><thead><tr>${T.claimHead.map((h) => `<th>${esc(h)}</th>`).join("")}</tr></thead><tbody>${claims}</tbody></table><p class="mono">${esc(T.statusNote)}</p></section>
Expand Down
13 changes: 12 additions & 1 deletion scripts/smoke-pages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,19 @@ const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
export function checkPage({ url, status, body, expectedTotal }) {
const errors = [];
if (status !== 200) errors.push(`${url}: HTTP ${status}`);
if (!/<title>[^<]*CoreGuard/i.test(body)) errors.push(`${url}: title does not name CoreGuard`);
if (/\?\?\?/.test(body)) errors.push(`${url}: contains a ??? run (encoding damage)`);
if (url.endsWith(".json")) {
try {
const data = JSON.parse(body);
if (expectedTotal && data.testsTotal !== expectedTotal) {
errors.push(`${url}: testsTotal ${data.testsTotal} != ${expectedTotal}`);
}
} catch {
errors.push(`${url}: invalid JSON`);
}
return errors;
}
if (!/<title>[^<]*CoreGuard/i.test(body)) errors.push(`${url}: title does not name CoreGuard`);
if (url.endsWith("/NUMBERS.html") && expectedTotal && !body.includes(String(expectedTotal))) {
errors.push(`${url}: does not state the snapshot total ${expectedTotal}`);
}
Expand Down
4 changes: 4 additions & 0 deletions test/ci/smoke-pages.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { checkPage } from "../../scripts/smoke-pages.mjs";

test("Pages smoke: a good page passes", () => {
assert.deepEqual(checkPage({ url: "https://x/", status: 200, body: "<title>CoreGuard</title>", expectedTotal: 2470 }), []);
const json = JSON.stringify({ testsTotal: 2470 });
assert.deepEqual(checkPage({ url: "https://x/state-snapshot.json", status: 200, body: json, expectedTotal: 2470 }), []);
assert.match(checkPage({ url: "https://x/state-snapshot.json", status: 200, body: "{}", expectedTotal: 2470 })[0], /testsTotal/);
assert.match(checkPage({ url: "https://x/state-snapshot.json", status: 200, body: "{", expectedTotal: 2470 })[0], /invalid JSON/);
});

test("Pages smoke: negative controls — status, title, encoding, total and mirror link bite", () => {
Expand Down
Loading