diff --git a/.github/workflows/deploy-demo.yml b/.github/workflows/deploy-demo.yml index 915216b38..1fa57eff7 100644 --- a/.github/workflows/deploy-demo.yml +++ b/.github/workflows/deploy-demo.yml @@ -8,8 +8,9 @@ on: paths: - 'demo/**' - 'demo-agents/**' - - 'docs/assets/agent-follows-feedback.gif' + - 'docs/assets/**' - 'docs/index.html' + - 'scripts/assemble-site.sh' - 'sop-arena/**' - '.github/workflows/deploy-demo.yml' workflow_dispatch: # Allows manual trigger from the GitHub Actions UI @@ -107,34 +108,9 @@ jobs: shell: bash run: | set -euo pipefail - rm -rf _site - mkdir -p _site/arena _site/agents - # Technical demo (WASM) lives at the site root: joltrinhq.com/ - cp demo/index.html demo/sop.wasm demo/wasm_exec.js demo/404.html demo/favicon.svg demo/favicon.ico demo/og-image.png demo/logo-mark.png _site/ - # The documentation index lives at joltrinhq.com/docs/ - mkdir -p _site/docs - cp docs/index.html _site/docs/ - # The homepage shows this replay from ./assets/ - mkdir -p _site/assets - cp docs/assets/agent-follows-feedback.gif _site/assets/ - # SOP Arena lives at a subpath of the same site: joltrinhq.com/arena/ - cp -r sop-arena/dist/. _site/arena/ - # Agent verification barrier (verify in WASM) lives at joltrinhq.com/agents/ - cp demo-agents/index.html demo-agents/sop-agents.wasm demo-agents/wasm_exec.js demo-agents/favicon.svg demo-agents/favicon.ico demo-agents/og-image.png demo-agents/logo-mark.png _site/agents/ - # Preserve custom domain (e.g. joltrinhq.com) if CNAME exists - if [ -f "CNAME" ]; then - cp CNAME _site/CNAME - elif [ -f "demo/CNAME" ]; then - cp demo/CNAME _site/CNAME - fi - # Fail the deploy if the homepage points at a local file that is not in the site. - for ref in $(grep -oE '(src|href)="\./[^"#?]+"' _site/index.html | sed -E 's/^(src|href)="\.\///; s/"$//'); do - if [ ! -e "_site/${ref}" ]; then - echo "Error: _site/index.html references ./${ref} but it is not in the site" >&2 - exit 1 - fi - done - ls -lh _site _site/arena _site/agents + # The same script the pull request check runs, so what a PR proves is what ships. + scripts/assemble-site.sh _site + ls -lh _site _site/arena _site/agents _site/assets - name: Setup GitHub Pages uses: actions/configure-pages@v5 diff --git a/.github/workflows/site-check.yml b/.github/workflows/site-check.yml new file mode 100644 index 000000000..3e1d4dac1 --- /dev/null +++ b/.github/workflows/site-check.yml @@ -0,0 +1,58 @@ +name: Site Check + +# Builds the site the way the Pages deploy does and fails if any file a page +# names (video, poster, image, script) is missing from it. The deploy once +# published a homepage whose video files were never copied, and the local +# tests did not notice because they assemble the site a different way. +on: + pull_request: + paths: + - 'demo/**' + - 'demo-agents/**' + - 'docs/**' + - 'sop-arena/**' + - 'scripts/assemble-site.sh' + - '.github/workflows/deploy-demo.yml' + - '.github/workflows/site-check.yml' + +permissions: + contents: read + +jobs: + site-assembles: + name: Site assembles with every referenced file + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v7 + with: + go-version-file: 'go.mod' + cache: true + + - name: Build the WebAssembly demos + shell: bash + run: | + set -euo pipefail + GOROOT="$(go env GOROOT)" + src="${GOROOT}/lib/wasm/wasm_exec.js" + [ -f "$src" ] || src="${GOROOT}/misc/wasm/wasm_exec.js" + cp "$src" demo/wasm_exec.js + cp "$src" demo-agents/wasm_exec.js + (cd demo && GOOS=js GOARCH=wasm go build -ldflags="-s -w" -o sop.wasm .) + (cd demo-agents && GOOS=js GOARCH=wasm go build -ldflags="-s -w" -o sop-agents.wasm .) + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + cache-dependency-path: 'sop-arena/package-lock.json' + + - name: Build SOP Arena + working-directory: ./sop-arena + run: | + npm ci || npm install + npm run build + + - name: Assemble the site and check every referenced file + run: scripts/assemble-site.sh _site diff --git a/README.md b/README.md index fa1226d65..12f3a7a1e 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ Joltrin (formerly SOP) is an open-source Go library that checks an AI agent's ac **What Joltrin does.** The agent emits intent. Joltrin checks the intent against the trace and the runbook's rules, outside the agent's context window. The check and the commit are one call, so a step is recorded only if it passed. A step whose required state is missing is refused. A claim that something happened is not evidence that it happened.
diff --git a/demo/index.html b/demo/index.html index cf58b420a..8b8330c5f 100644 --- a/demo/index.html +++ b/demo/index.html @@ -477,29 +477,29 @@sop-mcp-server demo.
- backup_validated is missing from the traceThe order is enforced by the barrier, whatever the agent says it already did.
+