|
| 1 | +<!-- |
| 2 | +SPDX-License-Identifier: MPL-2.0 |
| 3 | +SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) |
| 4 | +--> |
| 5 | + |
| 6 | +# Proof Debt — standards |
| 7 | + |
| 8 | +**Schema**: [`docs/TRUSTED-BASE-REDUCTION-POLICY.adoc`](./TRUSTED-BASE-REDUCTION-POLICY.adoc) — the canonical policy, originally landed via this repo at PR#203. |
| 9 | + |
| 10 | +This file is the schema-conformant per-repo proof-debt index for |
| 11 | +`hyperpolymath/standards` itself. The broader strategic proof goals |
| 12 | +across the standards monorepo live in [`PROOF-NEEDS.md`](../PROOF-NEEDS.md); |
| 13 | +this file enumerates the *specific* soundness-relevant escape hatches |
| 14 | +the [`scripts/check-trusted-base.sh`](../scripts/check-trusted-base.sh) |
| 15 | +CI gate (PR#211) detects in source. |
| 16 | + |
| 17 | +## Marker count (2026-05-26) |
| 18 | + |
| 19 | +15 syntactic markers detected by `check-trusted-base.sh`. 4 of those are |
| 20 | +already covered by [`PROOF-NEEDS.md`](../PROOF-NEEDS.md) references |
| 21 | +(matched by file path). The remaining 11 are enumerated below. |
| 22 | + |
| 23 | +## (a) DISCHARGED in this repo |
| 24 | + |
| 25 | +*(None yet — entries move here when a marker is removed or replaced by |
| 26 | +a total/proven counterpart.)* |
| 27 | + |
| 28 | +## (b) BUDGETED — tested with a refutation budget |
| 29 | + |
| 30 | +*(None yet. Candidates for §(b) classification: the `a2ml/src/A2ML/` |
| 31 | +test/parser code listed in §(d) below if any of it is covered by |
| 32 | +property tests at a documented budget. Audit pending.)* |
| 33 | + |
| 34 | +## (c) NECESSARY AXIOM |
| 35 | + |
| 36 | +*(None — standards does not introduce metatheoretic axioms.)* |
| 37 | + |
| 38 | +## (d) DEBT — actively to be closed |
| 39 | + |
| 40 | +All entries are Idris2 top-level `partial` pragmas. The pragma waives the |
| 41 | +Idris2 totality check on a definition. These are *not* in the same |
| 42 | +disposition class as `believe_me` (which is a soundness break) — `partial` |
| 43 | +is a *correctness-relevant* signal that "this function may not terminate |
| 44 | +or may be incomplete" rather than an unconditional logical escape. |
| 45 | + |
| 46 | +The recommended disposition for these is one of: |
| 47 | + |
| 48 | +- Discharge by adding a `%hint` for totality OR rewriting to be |
| 49 | + structurally recursive on a fuel argument. (Most of the entries below |
| 50 | + are mutually-recursive descents over `Doc`/`Block`/`Section`/`Inline` |
| 51 | + types where Idris2's totality checker can't see through the |
| 52 | + mutual-recursion bundle.) |
| 53 | +- Re-classify as §(b) by adding a property test that covers terminations |
| 54 | + empirically (e.g. Hedgehog over generated `Doc` ASTs to N=1e5). |
| 55 | +- Re-classify as §(c) if the recursion is genuinely on a quotient that |
| 56 | + no Idris2-expressible measure terminates. |
| 57 | + |
| 58 | +### `a2ml/src/A2ML/Converters.idr:339` — `testMarkdownRoundTrip` |
| 59 | + |
| 60 | +- **Function**: `testMarkdownRoundTrip : Doc -> Bool` |
| 61 | +- **Purpose**: tests that A2ML → Markdown → A2ML preserves structural |
| 62 | + block count. |
| 63 | +- **Why partial**: invokes `parseDocument` which is the parser combinator |
| 64 | + return type and not currently total. |
| 65 | +- **Owner**: @hyperpolymath |
| 66 | +- **Deadline**: undeclared. |
| 67 | + |
| 68 | +### `a2ml/src/A2ML/Converters.idr:349` — `testJSONRoundTrip` (or similar) |
| 69 | + |
| 70 | +- **Function**: companion roundtrip test in the same file. |
| 71 | +- **Same disposition** as the entry above. |
| 72 | + |
| 73 | +### `a2ml/src/A2ML/TypedCore.idr:66` — `collectIds` |
| 74 | + |
| 75 | +- **Function**: `collectIds : Doc -> List Id` |
| 76 | +- **Why partial**: recursive descent over `MkDoc blocks` with mutually |
| 77 | + recursive `collectBlock : Block -> List Id`. The mutual bundle isn't |
| 78 | + visible to Idris2's totality check. |
| 79 | +- **Owner**: @hyperpolymath |
| 80 | +- **Deadline**: undeclared. |
| 81 | + |
| 82 | +### `a2ml/src/A2ML/TypedCore.idr:77`, `:102`, `:107`, `:112`, `:121`, `:130`, `:135`, `:140` — mutual-recursion siblings |
| 83 | + |
| 84 | +- Each of these is part of the same mutual-recursion family (`collectBlock`, |
| 85 | + `collectInline`, `collectSection`, etc.). All have the same root cause as |
| 86 | + `collectIds` above: Idris2's totality checker doesn't see through the |
| 87 | + mutual bundle on the `Doc`/`Block`/`Inline` AST. |
| 88 | +- **Disposition**: collectively dischargeable by either (a) refactoring the |
| 89 | + mutual bundle into a single fuel-indexed recursion, or (b) re-classifying |
| 90 | + as §(b) BUDGETED with a property-test covering termination. |
| 91 | +- **Owner**: @hyperpolymath |
| 92 | +- **Deadline**: undeclared. |
| 93 | + |
| 94 | +## How to update this file |
| 95 | + |
| 96 | +When markers in source change: |
| 97 | + |
| 98 | +1. Re-run `bash scripts/check-trusted-base.sh .` from the repo root. |
| 99 | +2. If the count drops, move the resolved entries from §(d) → §(a). |
| 100 | +3. If new markers appear, add them to §(d) with an owner + deadline. |
| 101 | +4. The `check-trusted-base` CI job (governance-reusable's `trusted-base` |
| 102 | + step, landed in PR#211) will fail on un-annotated AND un-enumerated |
| 103 | + markers — so every change in source MUST be reflected here. |
| 104 | + |
| 105 | +## Self-referential note |
| 106 | + |
| 107 | +`standards` is both the **publisher** of the trusted-base reduction |
| 108 | +policy and a **consumer** of it. This file demonstrates the schema |
| 109 | +in-action; the eleven `partial` entries above are this repo's own debt |
| 110 | +in §(d), exactly as downstream repos will record theirs. |
| 111 | + |
| 112 | +The pattern: every estate repo with proof-bearing files seeds a |
| 113 | +`docs/proof-debt.md` of this shape, then the maintainer triages each |
| 114 | +§(d) entry into §(a)/(b)/(c) over time. |
| 115 | + |
| 116 | +## Companion documents |
| 117 | + |
| 118 | +- [`docs/TRUSTED-BASE-REDUCTION-POLICY.adoc`](./TRUSTED-BASE-REDUCTION-POLICY.adoc) — the canonical schema (PR#203 introduced this). |
| 119 | +- [`scripts/check-trusted-base.sh`](../scripts/check-trusted-base.sh) — the CI gate (PR#211 introduced this). |
| 120 | +- [`PROOF-NEEDS.md`](../PROOF-NEEDS.md) — the broader strategic proof-debt narrative for standards as a monorepo. |
| 121 | +- [`docs/audits/2026-05-26-estate-proof-debt.md`](./audits/2026-05-26-estate-proof-debt.md) — the audit that motivated this whole policy chain (PR#195). |
| 122 | + |
| 123 | +--- |
| 124 | + |
| 125 | +🤖 Initial seed by Claude Code, 2026-05-26. Replaces the implicit "we'll |
| 126 | +get to it" debt with explicit §(d) entries that the trusted-base CI gate |
| 127 | +can affirm. |
0 commit comments