|
1 | | -= VCL-total Verification Stance |
| 1 | += VCL-total Verification Stance (moved) |
2 | 2 | :toc: |
3 | 3 | :sectnums: |
4 | 4 |
|
5 | 5 | // SPDX-License-Identifier: MPL-2.0 |
6 | 6 | // Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk> |
7 | 7 |
|
8 | | -WARNING: vcl-ut is the interface between *hypatia* and *verisim*. Both sides |
9 | | -trust safety claims made here. This document states *precisely* what is and is |
10 | | -not currently proven, so that neither consumer over-trusts the boundary. It |
11 | | -takes precedence over any "verified" / "type-safe" / "proven" phrasing in |
12 | | -`README.adoc`, `PROOF-NEEDS.md`, or module doc-comments. |
| 8 | +NOTE: This file is a pointer only. The canonical, current verification stance |
| 9 | +for vcl-ut now lives at `verification/proofs/VERIFICATION-STANCE.adoc`. |
13 | 10 |
|
14 | | -== Summary |
| 11 | +The canonical document is proof-backed and supersedes this `docs/` copy. As of |
| 12 | +2026-06-14, the Idris2 proof corpus is machine-checked: all ten safety levels |
| 13 | +(L1–L10) carry genuine soundness, and |
| 14 | +`idris2 0.8.0 --build verification/proofs/vclut-core.ipkg` exits 0. |
15 | 15 |
|
16 | | -The 10-level safety story is, at present, *architecturally typed but not |
17 | | -end-to-end proven*. The dependent-type apparatus exists but is *not connected* |
18 | | -to the runtime checker or the FFI boundary that hypatia/verisim consume. |
| 16 | +The earlier text of this `docs/` file (which described the apparatus as |
| 17 | +architecturally typed but not end-to-end proven, with vacuous level predicates) |
| 18 | +is no longer accurate and has been removed. This copy is retained only as a |
| 19 | +redirect so existing links do not break. |
19 | 20 |
|
20 | | -== What IS genuinely established |
| 21 | +See `verification/proofs/VERIFICATION-STANCE.adoc` for the authoritative, |
| 22 | +detail-complete stance. |
21 | 23 |
|
22 | | -* `src/interface/abi/Types.idr` — `SafetyLevel`, `VclTotalError`, `QueryMode` |
23 | | - are real ADTs with total `DecEq` instances and total int<->tag round-trip |
24 | | - functions. The `Verify` namespace proves tag ranges with `So`. These are |
25 | | - sound, non-vacuous proofs. |
26 | | -* `QueryHandle` is a genuine opaque type with an `So (ptr /= 0)` non-null |
27 | | - witness; it cannot be constructed null through the public API. |
28 | | -* `src/core/Levels.idr` `SafetyCertificate` / `CanWeaken` define a real |
29 | | - subsumption lattice *at the type level*. |
30 | | - |
31 | | -== What is NOT proven (the honest gaps) |
32 | | - |
33 | | -. *The certificate is disconnected from the checker.* `src/core/Checker.idr` |
34 | | - decides every level with `Bool`-returning `checkLevelN` functions and never |
35 | | - constructs a `SafetyCertificate`. A query reported "Level 10" carries *no* |
36 | | - `Levels.idr` proof object. The dependent types are decorative w.r.t. the |
37 | | - actual decision procedure. |
38 | | -. *Several level predicates are vacuous.* `NoRawUserInput` has the single |
39 | | - constructor `AllParameterised : NoRawUserInput stmt` (provable for *any* |
40 | | - statement, including injection-bearing ones); `AllNullableFieldsGuarded`'s |
41 | | - `GuardedNull` accepts *any* expression; `AllSelectItemsTyped`'s `ConsTyped` |
42 | | - requires no actual per-item typing evidence. As written, Levels 3, 4 and 5 |
43 | | - prove nothing about the property they name. |
44 | | -. *The FFI boundary is stringly/int-typed.* `src/interface/abi/Foreign.idr` |
45 | | - returns a bare `Bits32` error tag; the `parse` wrapper is an explicit |
46 | | - placeholder (returns `Left InternalError` on success). hypatia/verisim |
47 | | - receive an *asserted* level integer, not a transported proof. |
48 | | -. *Layout/size proofs are vacuous.* `HasSize` / `HasAlignment` constructors |
49 | | - accept any `n`; `queryPlanHeaderSize : ... HasSize QueryPlanHeader 24` type- |
50 | | - checks regardless of the real layout. The 24-byte/8-align claim is unverified. |
51 | | - |
52 | | -== Consumer guidance |
53 | | - |
54 | | -* *hypatia / verisim*: treat the FFI level integer as an *advisory claim*, not |
55 | | - a proof carrier. Do not weaken your own checks on the strength of a VCL-total |
56 | | - level tag until gap (1) and (3) are closed. |
57 | | -* Do not cite vcl-ut as "formally verified query safety" in downstream docs. |
58 | | - |
59 | | -== Closing the gaps |
60 | | - |
61 | | -The high-value, low-risk path (per `PROOF-NEEDS.md`): make `checkLevelN` return |
62 | | -`Dec (Ln_... )` instead of `Bool`, give the vacuous predicates real |
63 | | -constructors carrying evidence, and have the checker emit a `SafetyCertificate` |
64 | | -that the Zig FFI transports as an opaque proof token. Tracked under |
65 | | -hyperpolymath/standards#124. |
66 | | - |
67 | | -== Provenance |
68 | | - |
69 | | -Audit 2026-05-18 (corpus grep + read; no proof-escape symbols |
70 | | -`believe_me`/`assert_total`/`postulate`/`sorry` are *applied* anywhere in |
71 | | -`src/**` — the only match is a self-attesting comment in `Composition.idr`). |
72 | | -The risk here is *not* proof escapes; it is *absent* proof masquerading as |
73 | | -present proof at a trusted interface. |
0 commit comments