Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
82f87d6
proofs(rust): Creusot contracts, laws, controls and mutants for the f…
claude Nov 19, 2026
6b09a68
ci(creusot): record the checkout SHA and the move to the suite gate a…
claude Nov 19, 2026
54e695d
proofs(creusot): apply mutants in pure bash (no Python, per repo rules)
claude Nov 19, 2026
5fc0adf
style(creusot): use [[ ]] tests in run.sh and install.sh (Sonar S7688)
claude Nov 19, 2026
a262b1a
ci(creusot): drop eval of opam env; run under opam exec (Hypatia eval…
claude Nov 19, 2026
65cc324
proofs(creusot): address review: OCaml 5.3.0, Clone derive, SCOPE, wh…
claude Nov 19, 2026
e36ef6f
proofs(creusot): run.sh lint fixes (shellcheck SC2020, Sonar S7679)
claude Nov 19, 2026
428df68
proofs(creusot): count a refusal only on a positive why3find verdict
claude Nov 19, 2026
0c127a8
proofs(creusot): fix install per creusot CI; ruling 13a docs; regen s…
claude Nov 19, 2026
5b23eb0
proofs(creusot): import creusot-std vec! explicitly; push trigger on …
claude Nov 19, 2026
cf9cb01
proofs(creusot): keep out-of-scope code out of the Creusot build
claude Nov 19, 2026
22393bb
proofs(creusot): print prover output for each control/mutant; PROOF-S…
claude Nov 19, 2026
8d9aa50
proofs(creusot): match why3find's real refusal verdict; copy mutants …
claude Nov 19, 2026
77d3d3e
proofs(creusot): executable falsity witness for every control and mutant
claude Nov 19, 2026
b6a3c3e
proofs(creusot): read control names line by line (shellcheck SC2013)
claude Nov 19, 2026
9799101
docs(proof-status): cite Creusot receipt run 44525604501, scope only
claude Nov 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/actions.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ workflows:
'.github/workflows/codeql.yml':
- 'actions/checkout@v7.0.1'
- 'github/codeql-action@v4.39.3'
'.github/workflows/creusot.yml':
- 'actions/checkout@v7.0.1'
'.github/workflows/dependabot-automerge.yml':
- 'dependabot/fetch-metadata@v3.1.0'
'.github/workflows/dogfood-gate.yml':
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/creusot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
#
# Creusot proofs of the Rust fast core (src/rust), with planted controls and
# code mutants that must be refused. See verification/creusot/README.adoc.
#
# Honesty rules for this job:
# - It is never continue-on-error. An install failure is a RED job.
# - run.sh exits 3 if Creusot is missing; that is also RED here.
# - docs/status/PROOF-STATUS.adoc keeps the Rust (Creusot) row OPEN until a
# green run of this job is cited there as the receipt.
# The estate Creusot gate (proven-cicd-and-workflows) is not used yet: it needs
# a detector fix (#143) and does not carry these pins. This job MOVES to the suite
# gate once #143 merges. Toolchain pins live beside it in verification/creusot/PINS.
name: "🔴 Gate: Creusot (Rust core)"

on:
# push: main only. A PR branch is covered by the pull_request event; running on
# both would start two identical long jobs per push in separate concurrency groups.
push:
branches: [main]
paths:
- 'src/rust/**'
- 'verification/creusot/**'
- 'build/just/trope.just'
- '.github/workflows/creusot.yml'
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
creusot:
name: "Creusot: prove, refuse controls, refuse mutants"
runs-on: ubuntu-24.04
timeout-minutes: 150
steps:
# Pinned like every workflow here: tag + actions.lock entry (the linter's
# coverage and resolution checks). v7.0.1 = 3d3c42e5aac5ba805825da76410c181273ba90b1.
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- name: Install opam and libzmq (as creusot's own CI does)
run: sudo apt-get update && sudo apt-get install -y opam libzmq3-dev
- name: Install the pinned Creusot toolchain
run: bash verification/creusot/install.sh
- name: Prove, then require every control and mutant to be refused
env:
CREUSOT_LOG_DIR: ${{ runner.temp }}/creusot-logs
run: |
set -euo pipefail
bash verification/creusot/run.sh
5 changes: 5 additions & 0 deletions build/just/trope.just
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ tropecheck ir:
trope-rust:
cd src/rust && cargo fmt --all --check && cargo clippy --locked --all-targets -- -D warnings -D clippy::pedantic && cargo test --locked && cargo build --locked --release
TROPECHECK_BIN=src/rust/target/release/tropecheck-rs bash tests/conformance/run.sh

# Exit 3 means Creusot is not installed: OPEN, nothing proved. Pins: verification/creusot/PINS.
# Creusot proofs of the Rust fast core, with planted controls and mutants
creusot:
bash verification/creusot/run.sh
47 changes: 45 additions & 2 deletions docs/status/PROOF-STATUS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,48 @@ toc::[]
| Agda `TB.Reduction`, `TB.Substitution.cut-preserves-grade`.
|===

The Rust fast core (`src/rust/`) is not a proof; it agrees with the Idris2
reference over the whole conformance corpus (`just trope-rust`).
The Rust fast core (`src/rust/`) agrees with the Idris2 reference over the whole
conformance corpus (`just trope-rust`). That agreement is testing, not proof. The
only Rust code with a proof is the Creusot scope in the next paragraph.

*Rust (Creusot): PROVED on its stated scope, CI receipt run 44525604501 (head
b6a3c3e, 19 Nov 2026).* Creusot v0.15.0 discharged every file named in
`verification/creusot/SCOPE`. Those are the contracts on `dkey`, `dadd`,
`fate_*`, `bond_*`, `merge_*`, `epsilon`, `grade_compose`, `grade_meet`,
`grade_le` and `violations`, and the lemmas in `creusot_spec.rs`: L1, L2, L3, L5,
L6, L4 (with non-negative attenuation), A2, wf preservation, preorder laws, meet
as glb and correspondence with the Agda order (both on the honest fragment).
"Verdict soundness" there is a spec lemma about the order only (floor ⊑ g and
g ⊑ ρ imply floor ⊑ ρ). It is not a proof about the shipped `check` function. In
the same run, all 9 planted false contracts and all 7 code mutants were refused.
Each of the 16 also has an executable witness, which holds on the shipped code,
and each mutant's witness broke on its mutant. Assumptions are rows CR-A1 to
CR-A3 in the README: creusot-std specs and solver soundness. A refusal is "not
proved within budget", which the witnesses back with a concrete counterexample.
OPEN by name, and not translated by Creusot (`#[cfg(not(creusot))]`, not
trusted): `check`, `acc`, `topo_witness_order`, `validate_graph`, the decoder
(`dec_*`, `req`, `str_list`) and the JSON parser (`Json`, `P`, `parse_json`).
Also OPEN: the 13 derived `Clone` and `PartialEq` files, which are translated
but not proved (assumed under CR-A1). One recorded divergence: on deceptive
inputs the Rust order is not the Agda/Idris2 order (next paragraph). See
`verification/creusot/README.adoc`.

*Rust order on deceptive values (divergence): RECORDED, owner ruling 13a
(19 Nov 2026).* Agda (`TB/Order.agda`) and Idris2 (`Trope/Coords.idr`) put each
deceptive value at the bottom of its order: `fateLte Falsified _`, `bondLte
Misbound _` and `mergeLte Conflated _` are all true. The Rust `fate_le`,
`bond_le` and `merge_le` make a deceptive value comparable only with itself, so
`grade_le` agrees with `gradeLte` on the honest fragment only, and `fate_meet`
is not a lower bound when one side is deceptive (`meet(Falsified, Present) =
Dropped`). The prevent-profile decoder rejects deceptive writes, so the CLI
cannot reach this. Direct library callers can. Options:
(A) keep the Rust order and state the scope in the `grade_le` documentation;
(B) change Rust to the Agda/Idris2 order, a behaviour change for library callers;
(C) change Agda/Idris2 to the Rust order, which reopens proved rows.
Ruling 13a chose (A) for this week; the `grade_le` documentation now states the
scope. Aligning the orders, (B) or (C), is next week's decision. The Creusot
correspondence and glb lemmas are stated on the honest fragment, and controls
`c03`, `c05` and `c07` must be refused, which keeps the divergence measured.

== Proof Witness Grades

Expand Down Expand Up @@ -387,6 +427,9 @@ Each is specified; none is asserted. Status words follow `spec/calculus.adoc §1
mechanising O5-1 as a side condition on an `Oracle`-indexed verdict is OPEN.
* *O6* — the ceiling verdict, stem:[\rho \sqsubseteq g_{\mathrm{ceiling}}], for
the privacy direction (`spec/calculus.adoc §5` note on T-Sub, `§10`).
* *Rust (Creusot) remainder* — `check`, `acc`, `topo_witness_order`,
`validate_graph`, the decoder and the JSON parser have no Creusot proof. They
are excluded from translation, not trusted (`verification/creusot/README.adoc`).

== Modelling notes

Expand Down
5 changes: 5 additions & 0 deletions src/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ path = "src/main.rs"

[profile.release]
opt-level = 3

# `cfg(creusot)` is set only by creusot-rustc (verification/creusot). Declaring it
# here keeps plain builds free of the unexpected-cfg warning.
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(creusot)'] }
Loading
Loading