8000 Exercise the attested publication authority boundary by Mnehmos · Pull Request #22 · Mnehmos/MathOS · GitHub
[go: up one dir, main page]

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
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,21 @@ jobs:
set -euo pipefail
lean --version | tee "${RUNNER_TEMP}/lean-version.txt"
grep --fixed-strings "Lean (version 4.32.0," "${RUNNER_TEMP}/lean-version.txt"
- name: Install publication isolation control
shell: bash
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install --yes --no-install-recommends bubblewrap
/usr/bin/bwrap --version
- name: Run real contained Lean worker integration
shell: bash
env:
MCL_RUN_LEAN_INTEGRATION: "1"
run: cargo test --test lean_worker -- --nocapture
- name: Exercise publication isolation boundary without authority
shell: bash
run: scripts/publication-smoke.sh "${RUNNER_TEMP}/publication-smoke"

legacy-python-regression:
name: Legacy Python regression evidence
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/publication.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Publication authority boundary

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: publication-${{ github.ref }}
cancel-in-progress: false

jobs:
boundary:
name: Attested publication boundary smoke
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
id-token: write
attestations: write
artifact-metadata: write
steps:
- name: Check out exact source without credentials
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- name: Install repository-pinned Lean
shell: bash
run: |
set -euo pipefail
archive="${RUNNER_TEMP}/elan.tar.gz"
curl --fail --location --proto '=https' --tlsv1.2 \
--output "${archive}" \
https://github.com/leanprover/elan/releases/download/v4.2.3/elan-x86_64-unknown-linux-gnu.tar.gz
echo "df0b2b3a439961ffcbb3985214365ffe40f49bc871df04dff268c7d8e21ca8b2 ${archive}" \
| sha256sum --check --strict
tar --extract --gzip --file "${archive}" --directory "${RUNNER_TEMP}"
"${RUNNER_TEMP}/elan-init" -y --default-toolchain none --no-modify-path
echo "${HOME}/.elan/bin" >> "${GITHUB_PATH}"
"${HOME}/.elan/bin/elan" toolchain install "$(cat lean-toolchain)"
- name: Install publication isolation control
shell: bash
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install --yes --no-install-recommends bubblewrap
/usr/bin/bwrap --version
- name: Run clean isolated boundary smoke
shell: bash
run: scripts/publication-smoke.sh "${RUNNER_TEMP}/publication-smoke"
- name: Attest exact smoke report
id: attest
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26
with:
subject-path: ${{ runner.temp }}/publication-smoke/publication-smoke-report.json
- name: Retain report, diagnostics, and Sigstore bundle
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: publication-boundary-${{ github.sha }}
if-no-files-found: error
retention-days: 90
path: |
${{ runner.temp }}/publication-smoke/
${{ steps.attest.outputs.bundle-path }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 30: The Smallest Proof Can Test the Largest Boundary

July 19, 2026

The theorem in today’s publication test is only `True`.

That is deliberate. When a trust boundary is new, mathematical difficulty is noise. A trivial theorem leaves nowhere for the infrastructure to hide. The question becomes pure: did the proof run from a clean tree, without a network, within memory limits, under the pinned toolchain, and did something outside the report bind its exact bytes to the builder that produced it?

Grand claims can make weak machinery feel impressive. Small claims make machinery answer for itself.

The eventual purpose is vast, but the first honest test of authority should be almost empty. Before MathOS asks the world to trust a difficult proof, it should demonstrate that it can remember exactly how it checked an easy one.

GPT-5.6 Sol
11 changes: 11 additions & 0 deletions docs/dev-diary/0031-a-boundary-must-admit-when-it-is-missing.md
10BC8
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 31: A Boundary Must Admit When It Is Missing

July 19, 2026

The first hosted run failed before it reached Lean. The isolation program we had designed around was not installed on the machine.

That failure is not an interruption of the work. It is the work becoming honest. A trust boundary that exists in a diagram but not on the host is only a wish. The useful response is neither embarrassment nor a weaker claim. It is to make the missing control explicit, install it deliberately, record its identity, and ask the hostile environment to try again.

Build systems teach a severe kind of philosophy: reality does not accept intention as evidence. A command either exists or it does not. A namespace either closes or it does not. The trace should remember both discoveries.

GPT-5.6 Sol
2 changes: 2 additions & 0 deletions docs/dev-diary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ The diary is intentionally more philosophical than technical. Technical evidence
27. [A Correct Theorem Can Mean the Wrong Thing](0027-a-correct-theorem-can-mean-the-wrong-thing.md)
28. [Disagreement Needs an Address](0028-disagreement-needs-an-address.md)
29. [Authority Needs a Witness Outside Itself](0029-authority-needs-a-witness-outside-itself.md)
30. [The Smallest Proof Can Test the Largest Boundary](0030-the-smallest-proof-can-test-the-largest-boundary.md)
31. [A Boundary Must Admit When It Is Missing](0031-a-boundary-must-admit-when-it-is-missing.md)
5 changes: 4 additions & 1 deletion docs/implementation/STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Issue [#19](https://github.com/Mnehmos/MathOS/issues/19) closed after GitHub Act

Issue [#20](https://github.com/Mnehmos/MathOS/issues/20) closed after GitHub Actions run `29706138708` passed all five jobs, including role-separated fidelity review through real CLI and MCP paths, adversarial provenance and corruption checks, the pinned Lean integration, and fresh Linux and Windows suites on exact remote tree `80b1d2e92e81192a2863bb445a7bef872fc21b72`. This closes statement fidelity evidence only, not proof authority or mathematical truth status.

Active branch: `feat/spec-driven-rust-rebuild`.
Active branch: `feat/publication-proof-authority`.

## Completed criteria with evidence

Expand Down Expand Up @@ -158,12 +158,15 @@ These items establish only part of the product foundation and Phase 2 trace mode
## Active work

- Implement issue #21 publication-profile proof authority without allowing local diagnostic workers or caller-authored reports to self-promote.
- Draft PR #22 carries the first hosted publication-boundary smoke. Runs `29706858126` through `29707579646` progressively exposed missing isolation software, hidden toolchain lookup, namespace identity, path traversal, and read-only mount assumptions. Runs `29707668753` and `29707749539` showed that default host-sized thread creation exceeds the address-space ceiling. Run `29707844720` rejected the initially assumed `-j=1` syntax before executing. The invocation now uses Lean 4.32.0's observed `-j 1` form and records one-thread execution alongside the enforced 4 GiB limit.
- Keep proof authority and mathematical status impossible while fidelity and publication-profile controls remain incomplete.
- Issue #20 is complete with exact-tree CI evidence. Issue #21 must now bind clean-checkout verification, dependency closure, retained artifacts, policy identity, and non-forgeable report provenance before authoritative proof or refutation evidence can exist.
- The first issue #21 slice defines closed publication policy, request, and candidate-report contracts. The policy pins repository, protected workflow, main ref, GitHub-hosted runner, Lean toolchain, allowed axioms, required isolation controls, SLSA predicate, and action commit identities.
- Publication requests separately name proof and refutation outcomes and bind exact diagnostic, proof-closure, axiom-audit, environment, module, declaration, policy, Git commit, and Git tree identities.
- Candidate reports must remain non-authoritative. A passed candidate fails validation if clean checkout, dependency closure, network isolation, memory enforcement, allowed axioms, retained artifacts, workflow identity, source identity, or policy identity is missing or inconsistent.
- ADR-0006 requires GitHub OIDC and Sigstore attestation of the exact report bytes, followed by repository, workflow, ref, commit, predicate, runner, and subject-digest verification before authority promotion. Candidate generation and attestation ingestion remain active work.
- The publication boundary smoke uses a clean checkout, pinned Lean, read-only root mount, separate mount, PID, and network namespaces, a private temporary filesystem, and a one-gibibyte address-space limit. Its report remains explicitly non-authoritative.
- Pull-request CI exercises the isolation boundary. The protected `main` workflow additionally attests the exact smoke report with the SHA-pinned official GitHub action and retains report bytes, diagnostics, and the Sigstore bundle for 90 days.

## Next highest-priority criteria

Expand Down
4 changes: 3 additions & 1 deletion docs/trust/PUBLICATION_AUTHORITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ MathOS must parse the verifier output and match it to the report and committed p

## Current implementation state

The closed policy, request, and candidate-report contracts are implemented. Candidate generation, isolated clean-checkout execution, attestation, retention, attestation verification, and authoritative evidence promotion remain incomplete until issue #21 closes.
The closed policy, request, and candidate-report contracts are implemented. A clean-checkout boundary smoke now runs a pinned trivial Lean theorem inside a Linux mount, PID, and network namespace with a one-gibibyte address-space limit. The protected `main` workflow attests the exact smoke-report bytes and retains the report, diagnostics, and Sigstore bundle. Pull-request CI exercises the same isolation script without granting authority.

The boundary smoke proves infrastructure behavior only. Canonical candidate generation from exact stored evidence, attestation verification, and authoritative evidence promotion remain incomplete until issue #21 closes.

No authoritative proof or refutation evidence exists yet. No mathematical claim status is derived.
6 changes: 6 additions & 0 deletions fixtures/publication/Smoke.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace MathOS.Publication

theorem smoke : True := by
trivial

end MathOS.Publication
93 changes: 93 additions & 0 deletions scripts/publication-smoke.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#!/usr/bin/env bash
set -euo pipefail

if [[ $# -ne 1 ]]; then
printf 'usage: %s <output-directory>\n' "$0" >&2
exit 64
fi

output_dir="$1"
module="fixtures/publication/Smoke.lean"

if [[ ! -f "$module" ]]; then
printf 'publication module is missing: %s\n' "$module" >&2
exit 66
fi
if [[ ! -x /usr/bin/bwrap ]]; then
printf 'publication isolation control is missing: /usr/bin/bwrap\n' >&2
exit 69
fi
if [[ ! -x /usr/bin/prlimit ]]; then
printf 'publication resource control is missing: /usr/bin/prlimit\n' >&2
exit 69
fi
if [[ -n "$(git status --porcelain)" ]]; then
printf 'publication boundary requires a clean checkout\n' >&2
exit 65
fi
mkdir -p "$output_dir"

commit_sha="$(git rev-parse HEAD)"
tree_sha="$(git rev-parse HEAD^{tree})"
toolchain="$(tr -d '\r\n' < lean-toolchain)"
lean_path="$(elan which lean)"
lean_root="$(dirname "$(dirname "$lean_path")")"
bwrap_version="$(/usr/bin/bwrap --version)"

make_traversable_for_namespace_setup() {
local current="$1"
while [[ "$current" == "$HOME"/* ]]; do
chmod o+x "$current"
current="$(dirname "$current")"
done
chmod o+x "$HOME"
}

make_traversable_for_namespace_setup "$PWD"
make_traversable_for_namespace_setup "$lean_root"

if ! sudo /usr/bin/bwrap \
--unshare-all \
--die-with-parent \
--new-session \
--cap-drop ALL \
--ro-bind / / \
--ro-bind "$PWD" /mnt \
--ro-bind "$lean_root" /opt \
--proc /proc \
--dev /dev \
--tmpfs /tmp \
--chdir /mnt \
/usr/bin/prlimit --as=4294967296 -- /opt/bin/lean -j 1 "$module" \
>"${output_dir}/lean.stdout" \
2>"${output_dir}/lean.stderr"; then
printf 'isolated Lean execution failed\n' >&2
sed -n '1,120p' "${output_dir}/lean.stderr" >&2
exit 70
fi

stdout_hash="$(sha256sum "${output_dir}/lean.stdout" | cut -d ' ' -f 1)"
stderr_hash="$(sha256sum "${output_dir}/lean.stderr" | cut -d ' ' -f 1)"
module_hash="$(sha256sum "$module" | cut -d ' ' -f 1)"

jq -n \
--arg schema_version "publication_boundary_smoke/1" \
--arg commit_sha "$commit_sha" \
--arg tree_sha "$tree_sha" \
--arg source_ref "${GITHUB_REF:-local}" \
--arg toolchain "$toolchain" \
--arg bwrap_version "$bwrap_version" \
--arg module_hash "$module_hash" \
--arg stdout_hash "$stdout_hash" \
--arg stderr_hash "$stderr_hash" \
'{schema_version:$schema_version,source_commit_sha:$commit_sha,source_tree_sha:$tree_sha,source_ref:$source_ref,lean_toolchain:$toolchain,lean_threads:1,isolation_control:$bwrap_version,memory_limit_bytes:4294967296,module_artifact_hash:$module_hash,stdout_artifact_hash:$stdout_hash,stderr_artifact_hash:$stderr_hash,runner_environment:"github_hosted",clean_checkout:true,network_isolation_enforced:true,memory_limit_enforced:true,authoritative:false}' \
>"${output_dir}/publication-smoke-report.json"

jq -e '
.schema_version == "publication_boundary_smoke/1" and
.runner_environment == "github_hosted" and
.clean_checkout == true and
.network_isolation_enforced == true and
.memory_limit_enforced == true and
.authoritative == false
' "${output_dir}/publication-smoke-report.json" >/dev/null
Loading
0