diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a1f2a4..33c9c7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,15 +53,39 @@ jobs: # The site's Content-Security-Policy says script-src 'none'. If a build # ever emits a script this fails here rather than in a browser console # on a page that has already shipped. + # + # One exception, and only one: a `type="application/ld+json"` block is a + # data block that never executes, so script-src has nothing to act on. + # It is allowed, and each one is parsed here to prove it really is data + # rather than something wearing the type attribute. run: | if find dist -name '*.js' -o -name '*.mjs' | grep -q .; then echo "A JavaScript file was emitted, which the CSP forbids:" >&2 find dist -name '*.js' -o -name '*.mjs' >&2 exit 1 fi - if grep -rl '', + re.S | re.I, + ) + problems = [] + for page in sorted(Path("dist").rglob("*.html")): + html = page.read_text(encoding="utf-8") + for block in LD.findall(html): + try: + json.loads(block) + except json.JSONDecodeError as bad: + problems.append(f"{page}: the JSON-LD block does not parse: {bad}") + if " + )}
@@ -130,8 +160,8 @@ const year = new Date().getFullYear();
This page describes agent-chaperone {CURRENT_VERSION}. The measured numbers are one run of{' '}
- {RUN.model} against {RUN.toolVersion} on {RUN.date}. Copyright {year},
- Apache-2.0.
+ {RUN.model} against {RUN.toolVersion} on{' '}
+ . Copyright {year}, Apache-2.0.
diff --git a/src/pages/results.astro b/src/pages/results.astro
index 7a53d2f..c564c7c 100644
--- a/src/pages/results.astro
+++ b/src/pages/results.astro
@@ -1,6 +1,7 @@
---
import Base from '../layouts/Base.astro';
import { RUN, SETS, SHIPPED, RELIABILITY, REPO } from '../data/benchmark';
+import { resultsSchema } from '../data/schema';
const pct = (v: number | null): string => (v === null ? '-' : v.toFixed(3));
const n = (v: number): string => v.toLocaleString('en-US');
@@ -8,7 +9,12 @@ const title = 'Measured results | agent-chaperone';
const description = `One run of ${RUN.model} on ${RUN.date}: what the screening questions caught, what they missed, and what they flagged in error.`;
---
-
Measured results