|
| 1 | +# SPDX-License-Identifier: PMPL-1.0-or-later |
| 2 | +# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk> |
| 3 | +# |
| 4 | +# K9 Validator: Typed Wasm Guard |
| 5 | +# Ensures the Typed Wasm project keeps its memory-safety contracts and parser invariants intact. |
| 6 | + |
| 7 | +let typed_wasm_guard = { |
| 8 | + name = "typed-wasm-guard", |
| 9 | + version = "1.0.0", |
| 10 | + description = "Validates the core invariants for Typed Wasm (multi-module safety, lifetime tracking, parser integrity, and no template placeholders).", |
| 11 | + |
| 12 | + checks = { |
| 13 | + multi_module = { |
| 14 | + description = "The Idris2 MultiModule proof exists in the ABI folder.", |
| 15 | + severity = "error", |
| 16 | + check_type = "file-exists", |
| 17 | + file = "src/abi/TypedWasm/ABI/MultiModule.idr", |
| 18 | + }, |
| 19 | + |
| 20 | + lifetime_proof = { |
| 21 | + description = "The Lifetime proof provides region-lifetime semantics.", |
| 22 | + severity = "error", |
| 23 | + check_type = "file-exists", |
| 24 | + file = "src/abi/TypedWasm/ABI/Lifetime.idr", |
| 25 | + }, |
| 26 | + |
| 27 | + levels_semantics = { |
| 28 | + description = "The Levels semantics file is present for the 10-level lattice.", |
| 29 | + severity = "warning", |
| 30 | + check_type = "file-exists", |
| 31 | + file = "src/abi/TypedWasm/ABI/Levels.idr", |
| 32 | + }, |
| 33 | + |
| 34 | + parser_integrity = { |
| 35 | + description = "The ReScript parser definition is included.", |
| 36 | + severity = "error", |
| 37 | + check_type = "file-exists", |
| 38 | + file = "src/parser/Parser.res", |
| 39 | + }, |
| 40 | + |
| 41 | + no_template_placeholders = { |
| 42 | + description = "No {{PROJECT}}/ {{PLACEHOLDER}} tokens remain in the source base.", |
| 43 | + severity = "error", |
| 44 | + check_type = "file-pattern-guard", |
| 45 | + scope = ".", |
| 46 | + reject_patterns = ["{{PROJECT}}", "{{PLACEHOLDER}}", "rsr-template-repo"], |
| 47 | + }, |
| 48 | + |
| 49 | + placeholder_fuzz_absent = { |
| 50 | + description = "The placeholder fuzz file must not exist—it gives false security.", |
| 51 | + severity = "warning", |
| 52 | + check_type = "file-not-exists", |
| 53 | + file = "tests/fuzz/placeholder.txt", |
| 54 | + }, |
| 55 | + }, |
| 56 | +} |
| 57 | +in typed_wasm_guard |
0 commit comments