SOL-PV-002 // aprender-contracts
SHACL Core Zero-JS Website Conformance Gate
Extract RDF N-Triples from built HTML pages and judge zero-JS, S-A11Y, and token-palette shapes deterministically.
Measured delta: 0 hand-written JS leaks across 163 built HTML pages
Before (Failing Anti-Pattern)
// Unchecked HTML template with inline onclick="..." and unverified <script>
After (Verified Code)
pub fn conforms(findings: &[String]) -> bool {
findings.is_empty()
}
Verification Contract
metadata:
version: "1.0.0"
kind: pattern
description: "Zero-JS static website SHACL conformance contract"
references:
- "W3C Shapes Constraint Language (SHACL) Recommendation"
equations:
zero_js:
formula: "script_count(non_live_page) == 0"
proof_obligations:
- id: PO-SITE-001
type: invariant
property: "Zero hand-written script elements on non-live pages"
falsification_tests:
- id: FALSIFY-SITE-001
rule: "zero_handwritten_js"
prediction: "script_count == 0 on static routes"
if_fails: "Hand-written script leaked into HTML"
Verified CLI Command & Output
$ pv validate contracts/site-conformance.yaml 0 error(s), 0 warning(s) — Contract is valid.