Skip to content

Commit 7a4f0e4

Browse files
committed
P-037 B0: the proof-boundary manifest, its checker, and the #368 witness
The audit instrument for the contract pre-registered in ee73dd1. No semantic change; the only kernel change is one new #[test]. scripts/p037_proof_boundary.py derives from source everything a hand-kept list would let drift: - the Kani inventory (23 #[kani::proof]); - the CI partition (15 fast in ci.yml formal-p037, 8 heavy in formal-p037-gate.yml; each loop must really run cargo kani); - the load-bearing assumptions of each harness, from the generators and predicates in its body. It then audits formal/p037-kernel/proof-boundary.json: - every harness has a claim, concrete kernel subjects, assumptions and a CI class; - every assumption has exactly one class, and a PRODUCTION_GUARANTOR names an existing mechanism with a production-seam control; - the bounded adapter matches lib.rs and claims no production bound; - A8 orders fin before select/collapse/lower; - A7 carries a fairness contract; - A11 reads NO_GUARDED_EVIDENCE. Two production-seam rules scan rust/, ownlang/ and frontend/: - no kernel-importing file calls solve_with / elect_with / lfp_chaotic (#368 option C, made executable); - none lowers or collapses cells outside apply (the F2 bypass). --selftest fires F1-F4 and F6-F10 as in-memory mutants. --mutants runs F5 on a temp copy of the crate: removing fin from apply or lower is killed by the k7_ twins. The #368 witness issue_368_unfair_schedule_returns_a_non_fixpoint pins Some(non-fixpoint) for solve_with and elect_with under a schedule that skips a live coordinate; #368 is not fixed. Wiring: - tests/test_p037_proof_boundary.py runs --check and --selftest in every tests/run_tests.py; - ci.yml formal-p037 gains a --mutants step; - the kernel README drops its stale hand-kept "22 harnesses" (the source has 23). docs/evidence/p037-b0-probes/ holds the three extractor probe programs and their observed bodies/sidecars (the A15 join cases). The dogfood scan covers frontend/roslyn/samples only, so they are inert for CI. Refs #304 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KmiyfrkaG9sJruTcshM2oq
1 parent ee73dd1 commit 7a4f0e4

10 files changed

Lines changed: 1743 additions & 1 deletion

File tree

‎.github/workflows/ci.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ jobs:
105105
run: cargo clippy --all-targets
106106
- name: cargo test (the exhaustive / randomized twins)
107107
run: cargo test
108+
# P-037 B0 (docs/notes/p037-phase-b-proof-boundary.md): F5, the
109+
# finalize-before-apply controls must go red when apply/lower stop
110+
# finalizing (temp copy of the crate), and the #368 witness must hold.
111+
- name: proof-boundary kernel mutants (B0 F5 / F7)
112+
run: python3 ../../scripts/p037_proof_boundary.py --mutants
108113
- name: install Kani (pinned) and its toolchain bundle
109114
run: |
110115
cargo install --locked kani-verifier --version 0.68.0
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using System.IO;
2+
3+
static class Probe
4+
{
5+
static void Inner(Stream s, bool keep)
6+
{
7+
if (!keep)
8+
{
9+
s.Dispose();
10+
}
11+
}
12+
13+
static void Sink(Stream s) { s.Dispose(); }
14+
15+
// forward under the positive literal, statement-level (no body op)
16+
static void Branchy(Stream s, bool keep)
17+
{
18+
if (keep)
19+
{
20+
Inner(s, true);
21+
}
22+
else
23+
{
24+
Sink(s);
25+
}
26+
}
27+
28+
// two eligible ifs on ONE line
29+
static void TwoIfs(Stream s, bool a, bool b)
30+
{
31+
if (a) { Inner(s, true); } if (b) { Sink(s); }
32+
}
33+
34+
// early-return guard
35+
static void Early(Stream s, bool keep)
36+
{
37+
if (keep) return;
38+
Sink(s);
39+
}
40+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System.IO;
2+
3+
class Probe2
4+
{
5+
bool ready;
6+
static void Inner(Stream s, bool keep)
7+
{
8+
if (!keep)
9+
{
10+
s.Dispose();
11+
}
12+
}
13+
static void Log(Stream s) { long n = s.Length; }
14+
15+
// A: forward inside the positive branch
16+
static void InBranch(Stream s, bool keep)
17+
{
18+
if (keep) {
19+
Log(s);
20+
}
21+
}
22+
23+
// B: same lines, forward AFTER the if
24+
static void AfterIf(Stream s, bool keep)
25+
{
26+
if (keep) {
27+
} Log(s);
28+
}
29+
30+
// C: wrapper forward behind an INELIGIBLE condition
31+
void Behind(Stream s, bool keep)
32+
{
33+
if (ready)
34+
{
35+
Inner(s, keep);
36+
}
37+
}
38+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using System;
2+
using System.IO;
3+
4+
static class Probe3
5+
{
6+
static void Sink(Stream s) { s.Dispose(); }
7+
static bool Ok(Stream s) { s.Dispose(); return true; }
8+
9+
static void Ternary(Stream s, bool c)
10+
{
11+
int x = c ? Use(s) : 0;
12+
}
13+
static int Use(Stream s) { s.Dispose(); return 1; }
14+
15+
static void ShortCircuit(Stream s, bool c)
16+
{
17+
if (c && Ok(s)) { }
18+
}
19+
20+
static void Switch(Stream s, int k)
21+
{
22+
switch (k)
23+
{
24+
case 1: Sink(s); break;
25+
default: break;
26+
}
27+
}
28+
29+
static void TryCatch(Stream s)
30+
{
31+
try { s.Flush(); }
32+
catch (IOException) { Sink(s); }
33+
}
34+
35+
static void Loop(Stream s, int n)
36+
{
37+
for (int i = 0; i < n; i++) { Sink(s); }
38+
}
39+
}

0 commit comments

Comments
 (0)