Skip to content

Commit 25d8fcf

Browse files
committed
Add vql-ut contractile invariants and k9 guard
1 parent 8f9fbf0 commit 25d8fcf

2 files changed

Lines changed: 101 additions & 0 deletions

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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: VQL-UT Guard
5+
# Ensures the VQL-UT language invariants stay provable and the bridges stay in sync with Idris2.
6+
7+
let vql_ut_guard = {
8+
name = "vql-ut-guard",
9+
version = "1.0.0",
10+
description = "Checks that the core Idris2 proofs, parser bridges, and schema artifacts exist and that no template placeholders remain.",
11+
12+
checks = {
13+
checker_present = {
14+
description = "Idris2 Checker definition exists.",
15+
severity = "error",
16+
check_type = "file-exists",
17+
file = "src/core/Checker.idr",
18+
},
19+
20+
grammar_present = {
21+
description = "Grammar specification file is present.",
22+
severity = "error",
23+
check_type = "file-exists",
24+
file = "src/core/Grammar.idr",
25+
},
26+
27+
levels_present = {
28+
description = "Levels lattice file remains tracked.",
29+
severity = "warning",
30+
check_type = "file-exists",
31+
file = "src/core/Levels.idr",
32+
},
33+
34+
schema_present = {
35+
description = "Schema validation proof exists.",
36+
severity = "warning",
37+
check_type = "file-exists",
38+
file = "src/core/Schema.idr",
39+
},
40+
41+
bridge_present = {
42+
description = "ReScript bridge parser file is available.",
43+
severity = "error",
44+
check_type = "file-exists",
45+
file = "src/bridges/VqlUtParser.res",
46+
},
47+
48+
no_template_placeholders = {
49+
description = "Template markers cannot creep into the codebase.",
50+
severity = "error",
51+
check_type = "file-pattern-guard",
52+
scope = ".",
53+
reject_patterns = ["{{PROJECT}}", "{{PLACEHOLDER}}"],
54+
},
55+
56+
placeholder_fuzz_absent = {
57+
description = "Placeholder fuzz harnesses must be removed.",
58+
severity = "warning",
59+
check_type = "file-not-exists",
60+
file = "tests/fuzz/placeholder.txt",
61+
},
62+
},
63+
}
64+
in vql_ut_guard

contractiles/must/Mustfile.a2ml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,40 @@ that MUST hold at all times.
4040
- description: No Makefiles (use Justfile)
4141
- run: test ! -f Makefile
4242
- severity: warning
43+
44+
## Invariants
45+
46+
### checker-proof
47+
- description: Idris2 checker core is present and maintained.
48+
- run: test -f src/core/Checker.idr
49+
- severity: critical
50+
51+
### grammar-proof
52+
- description: The Idris2 grammar definition is available for parser alignment.
53+
- run: test -f src/core/Grammar.idr
54+
- severity: critical
55+
56+
### levels-proof
57+
- description: The 10-level lattice file exists for the type safety hierarchy.
58+
- run: test -f src/core/Levels.idr
59+
- severity: warning
60+
61+
### schema-proof
62+
- description: Schema validation semantics are captured.
63+
- run: test -f src/core/Schema.idr
64+
- severity: warning
65+
66+
### bridge-parser
67+
- description: The ReScript parser bridge file remains tracked.
68+
- run: test -f src/bridges/VqlUtParser.res
69+
- severity: critical
70+
71+
### no-template-placeholders
72+
- description: Template tokens ({{PROJECT}}, {{PLACEHOLDER}}) must not appear in the source tree.
73+
- run: "! rg '{{PROJECT}}\\|{{PLACEHOLDER}}' -n src -g'*.*' 2>/dev/null | head -1 | grep -q ."
74+
- severity: error
75+
76+
### placeholder-fuzz
77+
- description: Remove placeholder fuzz harnesses.
78+
- run: test ! -f tests/fuzz/placeholder.txt
79+
- severity: warning

0 commit comments

Comments
 (0)