Skip to content

Commit f7b952c

Browse files
committed
Add public verification workflow
1 parent 9c55283 commit f7b952c

3 files changed

Lines changed: 107 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Public Verification
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
public-verification:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.12"
24+
25+
- name: Install Lua parser
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install -y lua5.4
29+
30+
- name: Run public verification gate
31+
run: bash scripts/verify_public.sh

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# MPlusForm
22

3+
[![Public Verification](https://github.com/AlexGerlitz/MPlusForm/actions/workflows/public-verification.yml/badge.svg?branch=main)](https://github.com/AlexGerlitz/MPlusForm/actions/workflows/public-verification.yml)
4+
35
MPlusForm is a validation-boundary and desktop-automation proof project: untrusted local files,
46
an optional Python sync pipeline, server-side approval, generated public snapshots, Windows
57
operations scripts, and clear trust-model documentation.
@@ -29,6 +31,7 @@ snapshots, Windows install/operate scripts, and clear user-facing docs.
2931
| [Windows operations](windows/README.md) | Shows install/status/sync/uninstall workflows for a non-developer environment. |
3032
| [Server trust layer](server_patch/mplusform_trust_layer.py) | Shows the reference validation boundary on the server side. |
3133
| [Troubleshooting](docs/TROUBLESHOOTING.md) | Shows operational handoff and failure-mode documentation. |
34+
| [Public verification gate](scripts/verify_public.sh) | Checks the public package contract, Python syntax, Lua syntax when available, and required proof docs. |
3235

3336
Best-fit evidence:
3437

scripts/verify_public.sh

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5+
cd "$ROOT"
6+
7+
echo "== Required public proof files =="
8+
required_files=(
9+
"README.md"
10+
"MPlusForm.toc"
11+
"MPlusForm.lua"
12+
"Data/Snapshot.lua"
13+
"docs/TRUST_MODEL.md"
14+
"docs/INSTALL_SYNC.md"
15+
"docs/TROUBLESHOOTING.md"
16+
"sync/mplusform_sync_service.py"
17+
"server_patch/mplusform_trust_layer.py"
18+
"windows/README.md"
19+
)
20+
21+
for path in "${required_files[@]}"; do
22+
test -f "$path"
23+
echo "ok $path"
24+
done
25+
26+
echo "== Python syntax =="
27+
python3 -m py_compile \
28+
sync/mplusform_sync_service.py \
29+
server_patch/mplusform_trust_layer.py \
30+
tools/trust_probe_rc10_6.py \
31+
legacy/server_work_rc10_6/main.py \
32+
legacy/server_work_rc10_6/mplusform_trust_layer.py
33+
34+
echo "== Lua syntax =="
35+
lua_compiler=""
36+
if command -v luac >/dev/null 2>&1; then
37+
lua_compiler="luac"
38+
elif command -v luac5.4 >/dev/null 2>&1; then
39+
lua_compiler="luac5.4"
40+
fi
41+
42+
if [[ -n "$lua_compiler" ]]; then
43+
"$lua_compiler" -p MPlusForm.lua Data/Snapshot.lua
44+
echo "ok lua parse via $lua_compiler"
45+
else
46+
echo "skip lua parse: luac not installed"
47+
fi
48+
49+
echo "== Public package contract =="
50+
python3 - <<'PY'
51+
from pathlib import Path
52+
53+
toc = Path("MPlusForm.toc").read_text(encoding="utf-8")
54+
addon = Path("MPlusForm.lua").read_text(encoding="utf-8")
55+
snapshot = Path("Data/Snapshot.lua").read_text(encoding="utf-8")
56+
trust_model = Path("docs/TRUST_MODEL.md").read_text(encoding="utf-8")
57+
58+
checks = {
59+
"toc loads snapshot before addon": toc.index("Data\\Snapshot.lua") < toc.index("MPlusForm.lua"),
60+
"snapshot is server-approved shaped": "serverApproved" in snapshot,
61+
"addon exposes public truth boundary": "server-approved-snapshot-only" in addon,
62+
"trust model documents local evidence boundary": "local evidence" in trust_model.lower(),
63+
}
64+
65+
failed = [name for name, ok in checks.items() if not ok]
66+
if failed:
67+
raise SystemExit("failed public package contract: " + ", ".join(failed))
68+
69+
for name in checks:
70+
print(f"ok {name}")
71+
PY
72+
73+
echo "public verification passed"

0 commit comments

Comments
 (0)