Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 31 additions & 0 deletions .github/workflows/agda-proofs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,34 @@ jobs:
lean --version | grep -q "^Lean (version ${LEAN_VERSION}, "
- name: Recheck legs, no axioms, expected rejections
run: bash scripts/check-recheck.sh
receipt:
# PROOF-POLICY §8.5.1 and §8.5.3: the machine-readable proof receipt
# (verification/receipts/januskey_praxis.deed) is what the ledgers and git
# give, the pinned standards reader derives every grade from it, and the
# commits it names hold what it says. Local run: just test-receipt.
name: Proof receipt, derived grades, git checks
runs-on: ubuntu-24.04
timeout-minutes: 10
env:
BUN_VERSION: 1.4.4
BUN_SHA256: bf8ccbfb2b0b80159e0f9a6d15c55317add8077534dbc6130a3edb52fccb395c
steps:
- name: Install the pinned Bun
run: |
curl --proto '=https' --tlsv1.2 -sSfL -o bun.zip \
"https://github.com/oven-sh/bun/releases/download/bun-v${BUN_VERSION}/bun-linux-x64.zip"
echo "${BUN_SHA256} bun.zip" | sha256sum -c -
unzip -q bun.zip -d "$RUNNER_TEMP"
rm bun.zip
echo "$RUNNER_TEMP/bun-linux-x64" >> "$GITHUB_PATH"
- name: Checkout (full history; the git checks refuse a shallow clone)
uses: actions/checkout@v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- name: Verify the checked Bun version
run: test "$(bun --version)" = "${BUN_VERSION}"
- name: Receipt, reader, git checks, freshness
run: |
bash scripts/fetch-siblings.sh
bash scripts/proof-receipt.sh --check
5 changes: 5 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ test-agda:
test-recheck:
bash scripts/check-recheck.sh

# Proof receipt (PROOF-POLICY §8.5): regenerate and compare, derive grades with the pinned reader, git checks.
test-receipt:
bash scripts/fetch-siblings.sh
bash scripts/proof-receipt.sh --check

# Idris2 ABI <-> januskey.h <-> ffi/zig agreement (sizes, status codes, enums, symbols); no compiler needed.
abi-layout-check:
bash scripts/check-abi-layout.sh
Expand Down
50 changes: 28 additions & 22 deletions PROOF-NEEDS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ tables must agree.
| E-1 | An attacker cannot recover obliterated content or use a revoked key | OPEN | `+Types.adversaryCannotKnow+` holds only because `+Knows+` has no Adversary constructor; the *model-level* half is now proved in Agda as row E-1m (#145 item 3)
| E-1m | In a world model, an adversary whose observation excludes the store does not know what it holds; obliteration leaves nothing to recover; rotation to a different key leaves no agent able to use the old one (premise `+old ≠ new+`; true by the definition of `+rotate+` in the model; that an unusable key cannot decrypt is X-1) | PROVEN | `+verification/proofs/agda/Epistemic.agda+`; `+tests/reject-agda/{AdversaryKnows,OldKeyStillUsable}.agda+` refused
| X-1 | Hash one-wayness; physical erasure (cryptographic and physical assumptions, external to this repository) | ASSUMED | not theorems of this repo
| T-1 | Undoing a fully executed transaction's operations in reverse order restores the state it began in, given each step's undo restores its execute (the sequential Theorem 3.4) | PROVEN | `+TransactionAtomicity.rollback-restores+`; rechecked in Rocq and Lean (`+verification/proofs/{rocq,lean}/Rollback+`, `+PWG-2ii+`); `+tests/reject-agda/ForwardRollback.agda+` refused
| T-1 | Undoing a fully executed transaction's operations in reverse order restores the state it began in, given each step's undo restores its execute (the sequential Theorem 3.4) | PROVEN | `+TransactionAtomicity.rollback-restores+`; rechecked in Rocq and Lean (`+verification/proofs/{rocq,lean}/Rollback+`, `+PWG-1+`); `+tests/reject-agda/ForwardRollback.agda+` refused
| T-2 | In any single-active log (records with a decidable key and an active or settled phase), opening a fresh active record, a key- and phase-preserving edit, and a settling transition each preserve the invariant and rewrite only the active record, so a settled one is never modified | PROVEN | `+SingleActiveLog.{begin-good,modify-good,finish-good,update-active}+`; `+tests/reject-agda/SettleWithoutSettling.agda+` refused; januskey's instance is `+TransactionAtomicity.lifecycle-preserves-good+`; `+tests/reject-agda/CommitWhenIdle.agda+` refused
| T-3 | In any single-active log satisfying the invariant, at most one record is active, and exactly one when the pointer is set | PROVEN | `+SingleActiveLog.at-most-one-active+` (januskey's transactions are an instance)
| T-4 | A rollback that fails part-way can be retried to completion | TESTED | `+rollback_resume_test+` drives the real `+jk+`: after one undo error and a repair, `+jk rollback+` skips the already undone operation and finishes (before the fix the retry stopped at it every time, reproduced 2026-10-26); fixed in `+cmd_rollback+`
Expand Down Expand Up @@ -126,26 +126,29 @@ and is kept for provenance only. Neither uses a confidence percentage and this
repository does not publish one.

Of the 12 PROVEN rows, five are the theory rows — **G-1, T-1, T-2, T-3, E-1m** — and
their artefact is Agda (`+verification/proofs/agda/+`). They are **`+PWG-3+`,
receipt pending re-run** (PROOF-POLICY §8, owner ruling 2026-11-04, which
governs over the mathesis brief):
each is `+PROVEN+` under the §2.1 invocation and no Rocq or Lean leg exists. The
last receipt for the modules is a green `+agda-proofs.yml+` run
(https://github.com/hyperpolymath/januskey/actions/runs/42076969251[42076969251])
at commit `+23bc8c3+`, Agda 2.6.4.3, with `+resource-algebra+` pinned at
`+cf9235c+`, running `+Reversibility+`, `+TransactionAtomicity+` and
`+Epistemic+` under `+--safe --without-K --cubical-compatible+`. The gate gained
an import-cone postulate scan after it, so the first green run of the changed
gate on `+main+` is the receipt that replaces it. The cone, the axioms (none in
the development; the prover's four universe-level primitives are checked by
name and reported) and the superseded receipts (runs 41687715055 at
`+fc188c4+` and 40867211509 at
`+4afb710+`) are recorded in
their artefact is Agda (`+verification/proofs/agda/+`). Their grades are derived,
not typed (PROOF-POLICY §8, owner ruling 2026-11-04, which governs over the
mathesis brief): the receipt of record is
link:verification/receipts/januskey_praxis.deed[`+verification/receipts/januskey_praxis.deed+`]
(§8.5.1, profile `+proof-receipt+`), written by `+scripts/proof-receipt.sh+` and
checked by `+just test-receipt+` and CI with the standards reader pinned by
commit, which derives each grade and refuses one the receipts do not support.
It describes commit `+b503488+` on `+main+`, where green `+agda-proofs.yml+` run
https://github.com/hyperpolymath/januskey/actions/runs/43213340167[43213340167]
checked `+Reversibility+`, `+TransactionAtomicity+`, `+Epistemic+` and
`+SingleActiveLog+` under `+--safe --without-K --cubical-compatible+` (Agda
2.6.4.3, `+resource-algebra+` pinned at `+cf9235c+`, import cone 7 first-party
modules and 8 supplied with the prover, 0 postulates) and T-1's Rocq and Lean
legs. Each of the five is `+PROVEN+` under the §2.1 invocation with
correspondence state `+AGDA-VERIFIED+`. The superseded receipts (runs 42736066407
at `+e165438+`, 42076969251 at `+23bc8c3+`, 41687715055 at `+fc188c4+` and
40867211509 at `+4afb710+`), the cone and the axioms (none in the development;
the prover's four universe-level primitives are checked by name and binding and
listed as its trusted base) are recorded in the receipt and in
link:docs/theory/PROOF-GRADES.adoc[`+docs/theory/PROOF-GRADES.adoc+`].
Correspondence state for them: `+AGDA-VERIFIED+`.

*PWG census, theory theorems of this repository (denominator 5):* `+PWG-3+` 4
(G-1, T-2, T-3, E-1m) · `+PWG-2i+` 0 · `+PWG-2ii+` 1 (T-1) · `+PWG-1+` 0 ·
(G-1, T-2, T-3, E-1m) · `+PWG-2i+` 0 · `+PWG-2ii+` 0 · `+PWG-1+` 1 (T-1) ·
`+ungraded+` 0. G-3 names this repository's FFI bridge, so PROOF-POLICY §1
classes it as engineering and it is outside the ladder. T-1's Rocq and Lean legs are re-proved and reconciled
(`+docs/theory/PROOF-GRADES.adoc+`, §T-1); the other four have not been
Expand All @@ -160,12 +163,15 @@ contracts, and **Verus** (PROOF-POLICY §1.2, owner ruling 2026-11-07; not SPARK
and not Idris2); neither verifier has a contract or proof in this tree yet,
which is why no Rust row is proved.

Only T-1 is above `+PWG-3+`: it is `+PWG-2ii+`, with Rocq and Lean legs re-proved
and reconciled. No row is `+PWG-2i+` or `+PWG-1+`, and none is claimed to be. The row-by-row mapping and the receipt in full are in
Only T-1 is above `+PWG-3+`: it is `+PWG-1+`. Its Rocq and Lean legs are re-proved
and reconciled, and all three witnesses have current receipts from pinned CI
checkers run on the receipt's source commit (§8.2). No row is `+PWG-2i+` or
`+PWG-2ii+`. A later change to a leg's inputs makes the receipt stale (the CI job
warns), and the grade then holds for `+b503488+` until a run of the new commit is
recorded (§8.4, "regression drops the grade"). The row-by-row mapping is in
`+docs/theory/PROOF-GRADES.adoc+`. Since 2026-11-01 the gate runs
PROOF-POLICY §2.1's canonical invocation
(`+--safe --without-K --cubical-compatible …+`); the CI receipt for that flag
set is run 42076969251 above.
(`+--safe --without-K --cubical-compatible …+`).

=== Current State

Expand Down
Loading
Loading