Skip to content

Commit 2d9e3cd

Browse files
Merge pull request #26 from hyperpolymath/reinforce/vclut-25-phase5a-rust-parser
vcl-ut #25 P5a: trusted Rust/SPARK-grade String->Statement parser
2 parents 5214629 + 598df32 commit 2d9e3cd

10 files changed

Lines changed: 1984 additions & 2 deletions

File tree

.github/workflows/parse-gate.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
# parse-gate.yml — Gates the trusted String->Statement parser
5+
# (`vcltotal-parse`, P5a of #25 reinforcing the verified-corpus
6+
# boundary). vcl-ut is the doubly-trusted hypatia<->verisim interface,
7+
# so the boundary parser must stay panic-free / total: clippy's
8+
# SPARK-grade lint set (no unsafe / unwrap / expect / panic / indexing /
9+
# unchecked arithmetic) is a HARD gate, and the proptest panic-free
10+
# invariant must pass. Tracked: hyperpolymath/standards#124, vcl-ut#25.
11+
12+
name: Parse Gate
13+
14+
on:
15+
pull_request:
16+
branches: ['**']
17+
push:
18+
branches: [main, master]
19+
20+
permissions:
21+
contents: read
22+
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.ref }}
25+
cancel-in-progress: true
26+
27+
jobs:
28+
parse-gate:
29+
name: vcltotal-parse — panic-free / clippy / tests
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
35+
36+
# rustup is preinstalled on ubuntu-latest; no third-party action
37+
# (avoids the action-pinning / deprecated-cache hazards).
38+
- name: Pin toolchain + components
39+
run: |
40+
set -euo pipefail
41+
rustup show active-toolchain || rustup default stable
42+
rustup component add clippy
43+
cargo --version && cargo clippy --version
44+
45+
# `vcltotal-parse` is its own workspace root (see its Cargo.toml).
46+
# Operate via its manifest path so CI never traverses the parent
47+
# virtual workspace (whose pre-existing `src/interface` member has
48+
# an external path-dep that does not resolve in a standalone
49+
# checkout). Self-contained: no external path-deps here.
50+
- name: Clippy — SPARK-grade lint set as a hard gate
51+
run: |
52+
set -euo pipefail
53+
cargo clippy --manifest-path src/interface/parse/Cargo.toml \
54+
--all-targets --locked -- -D warnings
55+
56+
- name: Tests + panic-free proptest invariant
57+
run: |
58+
set -euo pipefail
59+
cargo test --manifest-path src/interface/parse/Cargo.toml --locked

Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,12 @@ members = [
3434
"src/interface/lsp",
3535
"src/interface/dap",
3636
]
37+
# NOTE: `src/interface/parse` (vcltotal-parse, #25 P5a) is deliberately
38+
# NOT a member here. The pre-existing `src/interface` member carries an
39+
# external path-dependency (`echidna-core = { path =
40+
# "../../../echidna/..." }`) that only resolves on the estate's
41+
# sibling-repo layout, so the whole virtual workspace fails to load in a
42+
# standalone checkout (e.g. CI). The trusted boundary parser must build
43+
# and gate in isolation, so it is its own workspace root (see
44+
# src/interface/parse/Cargo.toml `[workspace]`). Tracked separately:
45+
# the parent-workspace external-path-dep breakage is NOT a #25 concern.

PROOF-NEEDS.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,19 @@
3434
- Debug adapter and formatter — lower priority but should preserve query semantics
3535

3636
### ReScript Bridge (src/bridges/)
37-
- `VclTotalParser.res`, `VclTotalBridge.res` — bridge between ReScript frontend and Idris2/Rust core
38-
- Prove: bridge faithfully translates between ReScript and core representations
37+
- `VclTotalParser.res`, `VclTotalBridge.res` — a **standalone ReScript
38+
frontend** (a working recursive-descent parser producing a *ReScript*
39+
AST). It is **not** on the verified path: it does not connect to, or
40+
marshal into, the Idris2 `Statement` the proof corpus certifies, nor
41+
the Rust core. (`VERIFICATION-STANCE.adoc` "no string→`Statement`
42+
parser exists" is precise — it means no parser whose output is the
43+
*certified* Idris2 `Statement`.)
44+
- The *trusted* boundary parser is the Rust/SPARK-grade
45+
`src/interface/parse` crate (`vcltotal-parse`, P5a of vcl-ut#25),
46+
which mirrors `Grammar.idr` and feeds the certifier across the C-ABI.
47+
- Optional future work: prove the ReScript frontend faithfully tracks
48+
the Idris2 grammar (low priority; it is a convenience frontend, not a
49+
trust anchor).
3950

4051
## Recommended Prover
4152

0 commit comments

Comments
 (0)