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
68 changes: 66 additions & 2 deletions .github/workflows/atoma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ jobs:
run: bash scripts/atoma-registry-proof-gate.sh
- name: Borrowed wrapper theory and cleanup control
run: bash scripts/atoma-wrapper-proof-gate.sh
- name: Heap permissions and bounded-span theory
run: bash scripts/atoma-heap-proof-gate.sh
- name: Preserve canonical repository map for review
run: |
bash scripts/gen-repo-map.sh .
Expand All @@ -103,8 +105,55 @@ jobs:
path: build/scalar-proof-evidence/
if-no-files-found: error

soundness:
name: Atoma soundness gate
heap_source:
name: Public boundary and lifetime source
runs-on: ubuntu-24.04
timeout-minutes: 25
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- name: Provision independent Coq checker
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends coq=8.18.0+dfsg-1build2
- name: Actual public header entry
run: bash scripts/atoma-public-header-source-gate.sh
- name: Actual registry destruction and retained regions
if: success() || failure()
run: bash scripts/atoma-registry-lifetime-source-gate.sh
- uses: actions/upload-artifact@v7.0.2
if: always()
with:
name: heap-source-evidence-${{ github.sha }}
path: build/heap-source-evidence/
if-no-files-found: error

heap_consumers:
name: Heap lifetime consumer replay
needs: [scalar, heap_source]
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- name: Provision pinned proof tools
run: bash scripts/atoma-ci-toolchain.sh
- name: Provision independent replay tools
run: bash scripts/atoma-ci-replay-toolchain.sh
- name: Fresh native consumers and source-bound lifetime replay
run: bash scripts/atoma-consumer-heap-gate.sh
- uses: actions/upload-artifact@v7.0.2
if: always()
with:
name: heap-consumer-evidence-${{ github.sha }}
path: build/atoma-evidence/heap-consumers/
if-no-files-found: error
retention-days: 30

core_soundness:
name: Existing source and replay gates
needs: [scalar, word_source, wrapper_source]
runs-on: ubuntu-24.04
timeout-minutes: 45
Expand All @@ -129,6 +178,21 @@ jobs:
if-no-files-found: error
retention-days: 30

soundness:
name: Atoma soundness gate
needs: [core_soundness, heap_consumers]
if: ${{ always() }}
runs-on: ubuntu-24.04
timeout-minutes: 2
steps:
- name: Require both existing and heap-boundary qualification
env:
CORE_RESULT: ${{ needs.core_soundness.result }}
HEAP_RESULT: ${{ needs.heap_consumers.result }}
run: |
test "$CORE_RESULT" = success
test "$HEAP_RESULT" = success

gate:
name: CI/gate
needs: [soundness]
Expand Down
77 changes: 77 additions & 0 deletions docs/decisions/ATOMA-HEAP-BOUNDARY.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// SPDX-License-Identifier: CC-BY-SA-4.0
= Heap permissions and actual public boundaries
:revdate: 2026-11-25

== Shared contract

The region store maps a logical region identity to vacant storage or a live byte
snapshot with retained-reference and active-reader counts. Acquisition requires
vacancy; release requires zero retained references and readers. Borrow/return
preserves bytes; a write during an active read borrow is refused by the protocol.
These counts are ghost obligations, not new fields or runtime checks in either
consumer ABI. A caller cannot obtain allocation authority merely by constructing
a Nat region identity or wrapping a copyable pointer in a linear type.

Compatible Agda, Lean, Coq/coqchk and full Cubical check the scoped laws. The
independent hand re-proofs remain BRIDGE-PENDING. No proof-witness grade or
cross-kernel transport is inferred from successful compilation alone.

== Proven public entry

The profile admits the original complete core.zig and main_refc.zig modules.
Reviewed, fixed byte prefixes and suffixes close the surrounding declarations,
imports, result layout, status constants and error storage. The original public
entry body and exported forwarder are parsed between those contexts; the source
cannot select its own context. This is intentionally restrictive: a change
outside the admitted body must be reviewed and re-qualified.

The interpretation covers null refusal before backend invocation, exact
pointer-to-slice span forwarding, backend status mapping and the thread-local
error effect. The actual header_refc.zig source is separately admitted. A native
dispatch double observes the unchanged public function; the real Idris-backed
export is still exercised independently. Those evidence categories remain
distinct.

The caller owes live readable memory, pointer-to-region correspondence, physical
separation where required, usize/address representability and synchronous input
lifetime. Non-nullness is not a bound or liveness proof. Backend heap effects
remain in the semantics; preservation requires an explicit frame premise.

== UAA retained lifetimes

Registration retains callback/code and optional context references across calls.
Multiple slots referencing one region contribute multiple retentions. Removing
one registration releases only that registration's obligations. Idle destroy
releases the registry allocation and detaches its registrations; it does not
destroy callback/context allocations.

The source interpretation derives the actual null/busy/free sequence from the
closed registry module. Source-facing theorems require a live mapped allocation;
idle free additionally requires ownership authority and accounted retentions.
A distinct logical region is only physically separate under the explicit
native correspondence premise. No stale pointer is dereferenced in tests.

The existing raw-alias counterexample remains part of qualification. Serialized
access, valid retained callback/context lifetimes, input readability and normal,
frame-preserving callback return remain obligations of native callers.

== Required evidence and remaining work

The required soundness context depends on both the existing replay campaign and
the new heap/public-boundary campaign. Both use fresh pinned consumers and
native checks, original-source capsules, ECHIDNA results, regenerated Coq audits,
coqchk and input-hash rechecks. Missing, failed or skipped qualification cannot
produce a successful soundness context. Operational proof mutations, native
source mutants and zero-exit compiler diagnostics must be refused.

Exact-head results are recorded in
https://github.com/hyperpolymath/atoma/pull/34[the implementation PR], alongside
https://github.com/hyperpolymath/proven/pull/249[Proven] and
https://github.com/hyperpolymath/unified-api-adapter/pull/25[UAA].
The presence of this decision is not a qualification receipt.

Receipts remain INCOMPLETE. General Zig parsing/compiler refinement, native
allocation authority, arbitrary-pointer validity, concurrent/non-local effects,
foreign-call contracts and cross-kernel statement transport are not discharged
by this bounded slice. Checked generation handles would be a separate,
versioned Idris2 ABI decision; this work preserves the current ABI.
14 changes: 9 additions & 5 deletions docs/plan/ULTRAPLAN.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: CC-BY-SA-4.0
// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
= Atoma — soundness-first plan to v1
:revdate: 2026-11-24
:revdate: 2026-11-25
:toc:

Atoma is experimental. The release objective is a useful verifier for an
Expand Down Expand Up @@ -57,8 +57,11 @@ Whole-boundary receipts remain INCOMPLETE.
This milestone precedes v1; it does not discharge memory, state, compiler
refinement or the full checker chain. #28 merged on 2026-11-24 after its required
soundness and CI checks passed; consumer source checking and its evidence are
in #30. Next, prove the full-word decoder relation and the registry state/effect
contract before extending source interpretation to calls, memory or ownership.
in #30. The full-word decoder, registry state kernel and conditional wrapper
profiles followed in #31–#33. The raw-alias counterexample is now explicit.
The next bounded extension, #34, connects heap/borrow obligations to Proven's
public entry and UAA's retained registration/destruction effects. Its source
and native receipts remain subject to exact-head qualification.

All applicable rows must pass on the release commit. They are conjunctive
gates, not a readiness percentage.
Expand Down Expand Up @@ -110,8 +113,9 @@ Re-estimate after R1, with compiler/formal-methods expertise available.

R1 progress: the source-bound u8 function now has a generated Coq model
theorem and a real ECHIDNA/coqchk path with adversarial replay controls.
This closes a narrow replay experiment, not R1: the alias counterexample,
typed-subset expansion and source-to-model refinement argument remain open.
The alias counterexample and conditional wrapper framing are now checked by
the #33 campaign. R1 is still partial: typed-subset expansion and the
source-to-model refinement argument remain open.
Do those before expanding features or shortening the v1 estimate. See
`docs/audit/2026-11-07-source-replay.adoc`.

Expand Down
22 changes: 19 additions & 3 deletions docs/status/PROOF-STATUS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,33 @@ The manifests in `verification/proofs/` declare exact checked/quarantined scope.
See link:../plan/ULTRAPLAN.adoc[the stable task register] and
link:../audit/2026-11-07-soundness-sprint.adoc[the repair evidence].

== Source-binding milestone (under qualification)
== Source-binding and conditional wrapper milestones

The decoder/import and registry-kernel source capsules passed their independent
Coq interpretation, assumption audits, coqchk and rejecting source mutations in
https://github.com/hyperpolymath/atoma/actions/runs/45527831101[run 45527831101]
at head 1cc383c1ff2e747cb96d13a49638326ee75823f7. Registry compatible Agda,
Lean and full Cubical witnesses passed in the same run. Combined consumer and
ECHIDNA qualification was still pending when this entry was prepared.
Lean and full Cubical witnesses passed in the same run. Subsequent complete
qualification, including the actual wrapper call/scan profiles, passed at
head 6823ff07297ca015a2461c00adc2ee2215633d1a in
https://github.com/hyperpolymath/atoma/actions/runs/45580361419[run 45580361419].
Downloaded evidence includes fresh native consumers, verified ECHIDNA results,
independent regenerated audits and coqchk; all 31 wrapper replay files matched
their evidence hashes. Native ownership and foreign-call premises remain open.

The existing proof-policy claims table and grades above are not promoted by
these observations. Cross-kernel statement correspondence is BRIDGE-PENDING.
See link:../decisions/ATOMA-BOUNDARY-SOURCE.adoc[the source-profile decision]
for the exact interpretation, compiler, wrapper and ownership boundaries.

== Heap/public-boundary extension

PR #34 adds a ghost region/permission protocol, original public header-entry
interpretation and source-bound registry destruction/retention effects.
Compatible Agda, Lean, Coq/coqchk, full Cubical, rejecting operational mutations
and fresh native consumer campaigns are required. The exact PR head and its
artifacts own the execution status; implementation alone is not a pass.
The policy claims table is not promoted by these additions.
See link:../decisions/ATOMA-HEAP-BOUNDARY.adoc[scope and native correspondence
premises]. All hand re-proof correspondence remains BRIDGE-PENDING.

36 changes: 19 additions & 17 deletions docs/status/ROADMAP.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: CC-BY-SA-4.0
// Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
= Atoma roadmap
:revdate: 2026-11-24
:revdate: 2026-11-25

The active link:../plan/ULTRAPLAN.adoc[v1 plan] owns milestone acceptance and
estimates. Atoma is experimental. There is no overall readiness percentage.
Expand Down Expand Up @@ -39,25 +39,27 @@ The scalar MVP merged in PR #30 at `c59fe78fceeaf284c0beab96300c9ad392150598`.
The next theory slice has checked universal decoder models in strict safe
Agda, full safe Cubical, Lean and Coq/coqchk; see
link:../theory/UNIVERSAL-DECODER.adoc[the statements, hosted evidence and limits].
These independent models do not yet establish cross-model correspondence or
prove the real decoder source. UAA PR #22 separately checks its total Idris2
state contract and existing native campaign, with ownership/lifetime assumptions
explicit. Its source refinement and Agda/Lean/Coq state witnesses remain open.
PR #32 subsequently bound the actual decoder/import and registry-kernel source.
PR #33 added the original wrapper call/scan profiles and an explicit raw-alias
counterexample. Its complete hosted campaign passed at head
`6823ff07297ca015a2461c00adc2ee2215633d1a` in
https://github.com/hyperpolymath/atoma/actions/runs/45580361419[run 45580361419],
including fresh Proven/UAA native checks and independent ECHIDNA/Coq replay.
Cross-kernel correspondence and native pointer/lifetime premises remain open.

* Proven: prove decoder acceptance iff the entire 64-bit word is a canonical
byte encoding, then bind the actual raw-word decoder source and its encoder
dependency. Immediate tagged words are not allocated objects; pointer-carrier
correspondence and later buffer leases remain separate obligations.
* UAA: prove state-preserving refusals, selected callback/context identity,
busy-state framing and restoration after a normally returning callback.
State the serialized access and borrowed-lifetime preconditions explicitly.
* Extend checked source interpretation to these operations, with an explicit
memory/alias counterexample before admitting pointer-bearing effects. The
ECHIDNA/coqchk path does not establish general Zig/compiler refinement.
* Proven: qualify the actual public pointer-to-slice entry against bounded
borrowed spans, null refusal and backend effects. Immediate tagged words are
not allocated objects; pointer-carrier correspondence remains separate.
* UAA: qualify retained callback/context lifetimes, shared registrations,
unregister and idle/busy destruction against the actual Zig declarations.
* The shared heap/permission protocol and both source-bound pilot extensions are
implemented by PR #34; its exact head must pass the full required campaign.
See link:../decisions/ATOMA-HEAP-BOUNDARY.adoc[acceptance and remaining premises].
* Second-language transfer spike before choosing the full sibling sequence.

Store, loops, permissions, compiler refinement and the complete required
kernel chain remain open. A passing scoped gate is not production readiness.
General store/loop/permission refinement, native allocation authority, compiler
refinement and the complete required kernel chain remain open. A passing scoped
gate is not production readiness.

== Dogfooding status

Expand Down
46 changes: 46 additions & 0 deletions scripts/atoma-consumer-heap-gate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: MPL-2.0
set -euo pipefail
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
parent="$root/build/atoma-evidence/heap-consumers"
mkdir -p "$parent"
out=$(mktemp -d "$parent/run.XXXXXXXX")
work=$(mktemp -d)
echo INCOMPLETE > "$out/result.txt"
trap 'status=$?; if ((status)); then echo FAIL > "$out/result.txt"; fi; rm -rf "$work"' EXIT
for profile in public-header registry-lifetime; do
if [[ $profile == public-header ]]; then
repo=proven; pin=proven.pin
source=ffi/zig/src/core.zig; dependency=ffi/zig/src/main_refc.zig
else
repo=unified-api-adapter; pin=uaa.pin
source=src/interface/ffi/src/registry.zig; dependency=src/interface/ffi/src/registry_state.zig
fi
revision=$(cat "$root/tests/consumer-heap/$pin")
[[ $revision =~ ^[0-9a-f]{40}$ ]]
checkout="$work/$repo"
git init -q "$checkout"
git -C "$checkout" remote add origin "https://github.com/hyperpolymath/$repo.git"
git -C "$checkout" fetch -q --depth 1 origin "$revision"
git -C "$checkout" checkout -q --detach FETCH_HEAD
[[ $(git -C "$checkout" rev-parse HEAD) == "$revision" ]]
git -C "$checkout" diff --exit-code "$revision" --
mkdir "$out/$profile"
echo "$revision" > "$out/$profile/revision.txt"
if [[ $profile == public-header ]]; then
EVIDENCE_DIR="$out/$profile/native" bash "$checkout/scripts/test-header-bridge.sh"
for marker in result.txt ownership/result.txt ownership-controls/result.txt boundary/result.txt boundary-controls/result.txt; do
[[ $(cat "$out/$profile/native/$marker") == PASS ]]
done
else
for slice in ownership ownership-controls lifetime lifetime-controls; do
EVIDENCE_DIR="$out/$profile/$slice" bash "$checkout/scripts/check-registry-$slice.sh"
[[ $(cat "$out/$profile/$slice/result.txt") == PASS ]]
done
fi
git -C "$checkout" diff --exit-code "$revision" -- > "$out/$profile/native-recheck.txt"
bash "$root/scripts/atoma-source-profile-replay.sh" "$profile" "$checkout/$source" "$checkout/$dependency" "$out/$profile/replay"
git -C "$checkout" diff --exit-code "$revision" -- > "$out/$profile/replay-recheck.txt"
done
echo PASS > "$out/result.txt"
echo 'HEAP CONSUMERS PASS: actual public entry and registry lifetime profiles; native authority and lifetime correspondence remain premises'
Loading
Loading