Skip to content

Commit c81cb84

Browse files
Merge pull request #77: rewrite the entry documents to the standard (re-anchoring WO 3.4)
docs: rewrite the entry documents to the standard (re-anchoring WO 3.4)
2 parents f778a19 + 7415a1d commit c81cb84

18 files changed

Lines changed: 869 additions & 869 deletions

‎.machine_readable/root-allow.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
# ─── Baseline: every RSR repo has these ──────────────────────────────────────
3030
README.adoc
31+
EXPLAINME.adoc # the evidence for each README claim; the README and EXPLAINME authoring standard puts it at the root
3132
LICENSE
3233
LICENSES/ # REUSE licence texts, dual-licence model (code MPL-2.0 / docs CC-BY-SA-4.0)
3334
CHANGELOG.adoc # AsciiDoc is the estate-standard documentation format

‎EXPLAINME.adoc‎

Lines changed: 279 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,279 @@
1+
// SPDX-License-Identifier: CC-BY-SA-4.0
2+
// Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
3+
= Mathesis: EXPLAINME
4+
:toc: preamble
5+
:icons: font
6+
7+
This file backs each claim of link:README.adoc[the README] with the files
8+
that implement it and an honest caveat. It is for a reader who wants the
9+
evidence before they rely on Mathesis.
10+
11+
Each result below names how it was observed: "run on 2026-11-11" is a local
12+
run in the session that wrote this file, on `main` at `f778a19`; "CI run" is
13+
a GitHub Actions run whose result that session read.
14+
15+
== A census of proof files
16+
17+
[quote, README.adoc]
18+
____
19+
It reads each public repository in the frame
20+
(`docs/atlas/census/repos.jsonl`) and records one row of counts for each
21+
repository that has proof files of its own: provers, declarations, holes,
22+
axioms. Each row names the commit that the census read and when.
23+
____
24+
25+
How this is implemented::
26+
`link:scripts/census/run-census.sh[]` censuses the whole frame, and
27+
`link:scripts/census/update-rows.sh[]` refreshes named repositories or, with
28+
`--frame`, drops entries outside the public frame. `census-repo.sh` clones
29+
each repository blobless and checks out its proof files only;
30+
`build-rows.sh` folds the raw output into one row per repository. The frame
31+
holds 465 public repositories; 249 have rows (54 theory, 195 engineering).
32+
The method and the one-writer rule are in
33+
link:docs/atlas/README.adoc[the atlas README].
34+
35+
Caveat::
36+
Counts are textual: declarations are found by keyword and signature rules,
37+
and hole and axiom counts come from proof-craft's `proof-holes.sh`. The
38+
kernel of each home repository is the authority. "Theory" and "engineering"
39+
is a first-pass heuristic by prover. One public repository could not be
40+
cloned in the last census.
41+
42+
== Generated atlas views
43+
44+
[quote, README.adoc]
45+
____
46+
A catalogue split into theory and engineering, an A-Z view, an organisation
47+
view and a machine-readable index, all generated from the census rows.
48+
____
49+
50+
How this is implemented::
51+
`link:scripts/census/render-catalogue.sh[]` writes
52+
`docs/atlas/generated/catalogue.adoc`; `link:scripts/atlas/census-atlas.mjs[]`
53+
writes `az.adoc`, `organisations.adoc` and `index.json`, and its `check` fails
54+
on a stale view, a non-public frame record or a malformed private count.
55+
`just check-views` passed (run on 2026-11-11), with the 13 atlas tests of
56+
`link:tests/atlas/census-atlas.test.mjs[]`.
57+
58+
Caveat::
59+
None currently known.
60+
61+
== A claims registry
62+
63+
[quote, README.adoc]
64+
____
65+
Claim pins point at one theorem in its home repository,
66+
at a commit and a receipt digest. The canon receipt reader of PROOF-POLICY
67+
§8.5.1 derives each Proof Witness Grade. No grade is typed by hand.
68+
____
69+
70+
How this is implemented::
71+
Pins are authored in `docs/atlas/claims/claims.jsonl` (18 claims from 3
72+
repositories). `link:scripts/registry/claims-registry.mjs[]` fetches each
73+
receipt at its pinned commit, checks its digest, and calls `readProofReceipt`
74+
from a standards checkout whose file digest it also checks. The view is
75+
`docs/atlas/generated/registry.adoc`; ADR 0004 records the design.
76+
`just registry-check` passed with 14 tests (run on 2026-11-11). The `must`
77+
contract clause `no-hand-typed-grade` checks that no pin carries a grade.
78+
79+
Caveat::
80+
Of 13 theorems, 1 is at `PWG-1` (THY-1) and 12 are `ungraded`. The canon
81+
reader refuses the current receipts of two home repositories, so their pins
82+
derive no grade until one side changes (an open finding in
83+
link:docs/status/ROADMAP.adoc[the roadmap]).
84+
85+
== Bridge candidates
86+
87+
[quote, README.adoc]
88+
____
89+
Recorded relations between artefacts in two
90+
repositories, generated into one view.
91+
____
92+
93+
How this is implemented::
94+
`docs/atlas/claims/bridges.jsonl` holds 2 candidate records;
95+
`claims-registry.mjs` renders `docs/atlas/generated/bridges.adoc`, and
96+
`just registry-check` fails on a stale view.
97+
98+
Caveat::
99+
These are candidates. The bridge lock of the re-anchoring plan (WO 5.2) does
100+
not exist yet, so no bridge is checked against both homes.
101+
102+
== Home theory
103+
104+
[quote, README.adoc]
105+
____
106+
THY-1, reachability is monotone under additive features, is
107+
proved in Agda and re-proved in Rocq and Lean. CI checks all three in a
108+
pinned Guix shell.
109+
____
110+
111+
How this is implemented::
112+
The sources are `link:verification/proofs/agda/FeatureReachability.agda[]`,
113+
`link:verification/proofs/coq/FeatureReachability.v[]` and
114+
`link:verification/proofs/lean4/FeatureReachability.lean[]`. The receipt is
115+
`link:verification/receipts/theory_praxis.deed[]`.
116+
`link:scripts/check-proofs.sh[]` compiles each module and audits its axioms;
117+
`.github/workflows/agda-proof-policy.yml` runs it in the Guix shell pinned by
118+
`build/channels.scm` and `build/manifest.scm`, with planted controls
119+
(`tests/proofs/gate_controls_test.sh`). CI run 43057783538 on `main` at
120+
`b2cf524` passed. See the <<proof-ledger>>.
121+
122+
Caveat::
123+
The proof is about a graph model. That the model matches Cargo's feature
124+
resolution is argued, not proved.
125+
126+
== Applied systems
127+
128+
[quote, README.adoc]
129+
____
130+
Methods that apply mathematics to decisions, starting
131+
with accounting and finance. Design documents only so far.
132+
____
133+
134+
How this is implemented::
135+
`link:applied-systems/README.adoc[]` and its subdirectories: a management
136+
accounting design, a decision record, an event map and evidence guidance.
137+
138+
Caveat::
139+
No executable model, data schema or worked example exists yet (WO 4.2).
140+
141+
== Privacy by count
142+
143+
[quote, README.adoc]
144+
____
145+
The frame names public repositories only. The number of
146+
private repositories in the listing is kept as one number.
147+
____
148+
149+
How this is implemented::
150+
`docs/atlas/census/private-count.json` records 40 private repositories in
151+
the listing of 2026-11-09. Both census writers drop any entry outside the
152+
public frame, and `census-atlas.mjs check` refuses a non-public frame record
153+
(`link:tests/census/update_rows_frame_test.sh[]`, 6 cases, passed on
154+
2026-11-11). The `must` clause `no-private-name` states the rule.
155+
156+
Caveat::
157+
The git history still holds the names (owner ruling D-2 (a): no rewrite).
158+
159+
== Dogfooded across the account
160+
161+
[cols="1,2,2",options="header"]
162+
|===
163+
|Technology or pattern |Used here |Also used in
164+
165+
|Repository deed (`*_chora.deed`) with one reader and one writer
166+
|`mathesis_chora.deed`, read by `scripts/deed-field.sh`, written only by
167+
`scripts/deed-clause.sh`
168+
|link:https://github.com/hyperpolymath/rsr-template-repo[rsr-template-repo]
169+
170+
|k9 contractiles and the coaptation receipt
171+
|`.machine_readable/contractiles/`, `.machine_readable/coaptation/`
172+
|link:https://github.com/hyperpolymath/rsr-template-repo[rsr-template-repo]
173+
174+
|Proof receipts read by the canon reader (PROOF-POLICY §8.5.1)
175+
|`verification/receipts/theory_praxis.deed`, `scripts/registry/`
176+
|link:https://github.com/metadatastician/standards[standards]
177+
178+
|I-JSON/JCS data, one record per line
179+
|`docs/atlas/census/*.jsonl`, `docs/atlas/claims/*.jsonl`
180+
|link:https://github.com/hyperpolymath/ijson-jcs[ijson-jcs]
181+
182+
|The postulate scan over the import cone of an Agda module
183+
|`scripts/scan-postulates.sh`, called by `scripts/check-proofs.sh`
184+
|link:https://github.com/hyperpolymath/januskey[januskey]
185+
|===
186+
187+
== Known gaps
188+
189+
[CAUTION]
190+
====
191+
Badges: the authoring standard asks for OpenSSF Best Practices and Scorecard
192+
badges on a public repository. The README carries none, because no Best
193+
Practices project identifier is recorded for Mathesis.
194+
====
195+
196+
[CAUTION]
197+
====
198+
Template example proofs: `verification/proofs/idris2/`,
199+
`verification/proofs/tlaplus/`, `verification/proofs/agda/Properties.agda`,
200+
`verification/proofs/coq/TypeSafety.v` and
201+
`verification/proofs/lean4/ApiTypes.lean` come from the RSR template. They
202+
are not Mathesis obligations. WO 4.1 of the re-anchoring plan removes them.
203+
====
204+
205+
[CAUTION]
206+
====
207+
Contract probes: the `must` contract states six Mathesis invariants with
208+
probes, but no runner executes `must` probes yet. CI enforces the same rules
209+
through `just check`.
210+
====
211+
212+
== Evidence index
213+
214+
[cols="2,3",options="header"]
215+
|===
216+
|Path |Proves
217+
218+
|`tests/census/`
219+
|Row folding, status-document ranking, the proof-holes scanner, the update
220+
guard and the public frame (8 test files, all passed on 2026-11-11)
221+
222+
|`tests/atlas/census-atlas.test.mjs`
223+
|View determinism, row validation, the public frame (13 tests)
224+
225+
|`tests/registry/`
226+
|Registry derivation through fixture receipts (14 tests)
227+
228+
|`tests/proofs/gate_controls_test.sh`
229+
|A planted `postulate`, `Admitted` and `sorry` each fail the proof gate (CI)
230+
231+
|`tests/golden/check_controls_test.sh`
232+
|`just check` fails on a stale view and on a failing proof (CI)
233+
|===
234+
235+
[[proof-ledger]]
236+
== Proof ledger
237+
238+
The receipt `verification/receipts/theory_praxis.deed` is the
239+
machine-readable ledger; this table cites it.
240+
241+
[cols="2,1,2,2,2",options="header"]
242+
|===
243+
|Obligation |Status |Checker (version, flags) |Where |Trust boundary
244+
245+
|THY-1: reachability is monotone under additive features (Agda leg)
246+
|proven
247+
|Agda 2.7.0.1, `--safe --without-K --cubical-compatible`
248+
|`verification/proofs/agda/FeatureReachability.agda:Cargo.absent-under-all-features`
249+
|The graph model only. `Agda.Primitive` postulates `Level`, `lzero`, `lsuc`
250+
and `_⊔_` as builtins.
251+
252+
|THY-1, Rocq leg (re-proved, correspondence `RECONCILED`)
253+
|proven
254+
|Rocq 8.18.0, `coqc`; `Print Assumptions` closed
255+
|`verification/proofs/coq/FeatureReachability.v:absent_under_all_features`
256+
|The graph model only
257+
258+
|THY-1, Lean leg (re-proved, correspondence `RECONCILED`)
259+
|proven
260+
|Lean 4.29.0, `lean`; no axiom
261+
|`verification/proofs/lean4/FeatureReachability.lean:absentUnderAllFeatures`
262+
|The graph model only
263+
264+
|The graph model matches Cargo's feature resolution
265+
|argued
266+
|-
267+
|`docs/status/PROOF-STATUS.adoc`, THY-1 "Why"
268+
|Not formalised
269+
270+
|The token-lattice theorems (owner ruling D-10: their home is Mathesis)
271+
|open
272+
|-
273+
|`docs/proposals/mathesis-research-programme.adoc`
274+
|Not yet stated in a prover (WO 4.1)
275+
|===
276+
277+
Proofs: 3 proven of 5; 1 argued, 1 open. The registry derives `PWG-1` for
278+
THY-1 from the receipt. The checker versions are those that CI asserts in the
279+
Guix shell (CI run 43057783538).

0 commit comments

Comments
 (0)