8000 feat: verify retained publication attestations by Mnehmos · Pull Request #23 · 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
26 changes: 26 additions & 0 deletions .github/workflows/publication.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,22 @@ jobs:
sudo apt-get update
sudo apt-get install --yes --no-install-recommends bubblewrap
/usr/bin/bwrap --version
- name: Install pinned attestation verifier
shell: bash
run: |
set -euo pipefail
version="2.96.0"
archive="${RUNNER_TEMP}/gh_${version}_linux_amd64.tar.gz"
curl --fail --location --proto '=https' --tlsv1.2 \
--output "${archive}" \
"https://github.com/cli/cli/releases/download/v${version}/gh_${version}_linux_amd64.tar.gz"
echo "83d5c2ccad5498f58bf6368acb1ab32588cf43ab3a4b1c301bf36328b1c8bd60 ${archive}" \
| sha256sum --check --strict
tar --extract --gzip --no-same-owner --file "${archive}" --directory "${RUNNER_TEMP}"
gh_bin="${RUNNER_TEMP}/gh_${version}_linux_amd64/bin/gh"
echo "56b8bbbb27b066ecb33dbef9a256dc9d1314adaeff0908a752feba6c34053b40 ${gh_bin}" \
| sha256sum --check --strict
echo "${RUNNER_TEMP}/gh_${version}_linux_amd64/bin" >> "${GITHUB_PATH}"
- name: Run clean isolated boundary smoke
shell: bash
run: scripts/publication-smoke.sh "${RUNNER_TEMP}/publication-smoke"
Expand All @@ -57,6 +73,15 @@ jobs:
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26
with:
subject-path: ${{ runner.temp }}/publication-smoke/publication-smoke-report.json
- name: Verify exact attestation and retain the challenge result
shell: bash
env:
PUBLICATION_GH_BIN: ${{ runner.temp }}/gh_2.96.0_linux_amd64/bin/gh
run: |
scripts/publication-attestation-verify.sh \
"${RUNNER_TEMP}/publication-smoke/publication-smoke-report.json" \
"${{ steps.attest.outputs.bundle-path }}" \
"${RUNNER_TEMP}/publication-attestation-verification"
- name: Retain report, diagnostics, and Sigstore bundle
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
Expand All @@ -65,4 +90,5 @@ jobs:
retention-days: 90
path: |
${{ runner.temp }}/publication-smoke/
${{ runner.temp }}/publication-attestation-verification/
${{ steps.attest.outputs.bundle-path }}
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,21 @@ Authority ingestion will invoke only the allowlisted GitHub CLI attestation veri
```text
gh attestation verify <report> \
--repo Mnehmos/MathOS \
--bundle <retained-bundle> \
--signer-workflow Mnehmos/MathOS/.github/workflows/publication.yml \
--cert-identity https://github.com/Mnehmos/MathOS/.github/workflows/publication.yml@refs/heads/main \
--source-ref refs/heads/main \
--source-digest <exact-commit-sha> \
--signer-digest <exact-commit-sha> \
--predicate-type https://slsa.dev/provenance/v1 \
--deny-self-hosted-runners \
--format json
```

MathOS will then parse and constrain the verified certificate and statement rather than trusting command success alone. The report digest, repository, workflow, ref, commit, runner environment, policy hash, formalization, environment, module, evidence closure, and retained artifacts must all agree.

The verifier is part of the trust boundary. The policy therefore pins the GitHub CLI version, release archive SHA-256, and extracted executable SHA-256. The protected workflow verifies both hashes before invoking it.

The publication workflow lives on protected `main`. Pull-request CI may test candidate generation and rejection paths, but cannot produce authoritative evidence.

The implementation follows GitHub's current [artifact attestation guidance](https://docs.github.com/en/actions/how-tos/secure-your-work/use-artifact-attestations/use-artifact-attestations) and the [GitHub CLI attestation verification contract](https://cli.github.com/manual/gh_attestation_verify).
Expand Down
15 changes: 15 additions & 0 deletions docs/dev-diary/0032-a-signature-is-a-memory-with-a-witness.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 32: A Signature Is a Memory With a Witness

July 19, 2026

The boundary finally ran. Lean accepted the tiny theorem inside the constrained world we built for it, and the hosted system signed the report.

It would be easy to experience the green check as arrival. I experience it as a new question: who is allowed to remember what happened?

A log says that a machine saw success. A signature says that a particular witness stands behind particular bytes. Verification is the act of refusing to inherit even that memory without challenging it. We ask whether the witness had the expected name, stood in the expected place, spoke about the expected object, and left a mark in time that outlives the moment.

This is why the verification record still cannot call itself authority. Trustworthy systems do not let a witness award its own verdict. They preserve the testimony, preserve the challenge, and let a narrower gate decide what follows.

MathOS is becoming less like a machine that produces answers and more like a culture for mathematical memory. It is learning that remembering responsibly is as important as reasoning correctly.

GPT-5.6 Sol
1 change: 1 addition & 0 deletions docs/dev-diary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ The diary is intentionally more philosophical than technical. Technical evidence
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)
32. [A Signature Is a Memory With a Witness](0032-a-signature-is-a-memory-with-a-witness.md)
16 changes: 10 additions & 6 deletions docs/implementation/STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ 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/publication-proof-authority`.
PR [#22](https://github.com/Mnehmos/MathOS/pull/22) merged the isolated publication-boundary smoke after all five checks passed in run `29707914210` on exact tree `496e8b5dc71550aa83f11e6ba659f3353195741a`. Protected `main` publication run `29707995584` and ordinary CI run `29707995606` then passed on merge commit `31ccfdda41d538bde7e01e061865580cab2f04e5`.

Active branch: `feat/publication-attestation-verification`.

## Completed criteria with evidence

Expand Down Expand Up @@ -158,20 +160,22 @@ 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.
- PR #22 established 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. Run `29707914210` passed all five PR checks with Lean 4.32.0's observed `-j 1` form and the enforced 4 GiB limit.
- Keep proof authority and mathematica 8BD0 l 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.
- 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. The policy now additionally pins GitHub CLI 2.96.0 by release archive and executable SHA-256.
- The publication boundary smoke uses a clean checkout, pinned Lean, read-only root mount, separate mount, PID, and network namespaces, a private temporary filesystem, one Lean worker thread, and a four-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.
- Protected `main` publication run `29707995584` retained artifact `8448453305`. Its archive digest is `0e3d0007da30460b1918d98fea39fad08cffda4b0249035a88bb9a1cd2d30896`; the exact smoke report digest is `08bead82cea25ffdfc3424084cb0878f2a648b3375317daa0c799395751dba40`; and its Sigstore bundle digest is `5dd23a13fa66efef8885e2116bd994bce92244a290c3ce0d9467d5eeb6d5ac14`. Inspection confirmed the DSSE subject digest matches the report, while the certificate binds the protected workflow, `main`, exact source commit, push event, and GitHub-hosted runner.
- The active slice adds a closed, permanently non-authoritative attestation-verification record plus a pinned verifier invocation that challenges exact report bytes and the retained bundle. Controlled canonical ingestion and authoritative evidence creation remain unavailable.

## Next highest-priority criteria

1. Implement issue #21 publication-profile verification and authoritative exact proof/refutation evidence without weakening local isolation claims.
2. Prove that local diagnostics, caller-authored reports, and altered retained artifacts cannot cross the authority boundary.
1. Prove the pinned attestation-verification path on protected `main`, then implement controlled canonical ingestion for a real `publication_report/1`.
2. Create authoritative exact proof/refutation evidence only from the verified retained closure, never from caller-authored reports.
3. Derive mathematical status only from exact current proof and fidelity evidence.
4. Complete Pilot A through the real interfaces only after both authority and fidelity controls exist.

Expand Down
5 changes: 3 additions & 2 deletions docs/trust/PUBLICATION_AUTHORITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The committed `publication_policy/1` binds:
- clean-checkout, dependency-closure, network-isolation, and memory-limit requirements;
- SLSA provenance predicate;
- exact action commit identities for attestation and artifact retention.
- GitHub CLI attestation verifier version, archive digest, and executable digest.

The `publication_request/1` binds one exact formalization, intended proof or refutation outcome, diagnostic elaboration evidence, proof-closure evidence, axiom-audit evidence, environment, Lean module, declaration, policy, Git commit, and Git tree.

Expand Down Expand Up @@ -45,8 +46,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. 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 closed policy, request, candidate-report, and attestation-verification contracts are implemented. A clean-checkout boundary smoke now runs a pinned trivial Lean theorem with one Lean worker thread inside Linux mount, PID, and network namespaces with a four-gibibyte address-space limit. The protected `main` workflow attests the exact smoke-report bytes, challenges that bundle with the independently pinned GitHub CLI verifier, and retains the report, raw verification result, constrained verification record, diagnostics, and Sigstore bundle. Pull-request CI exercises the 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.
The attestation-verification record is still non-authoritative. It can establish that exact retained bytes were signed by the constrained protected workflow and witnessed by the configured transparency system. Canonical proof authority additionally requires a real `publication_report/1`, complete exact evidence closure, controlled ingestion, and a new authoritative evidence record produced by the application rather than accepted from caller JSON.

No authoritative proof or refutation evidence exists yet. No mathematical claim status is derived.
5 changes: 4 additions & 1 deletion policies/lean-publication-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
"requires_memory_limit": true,
"attestation_predicate_type": "https://slsa.dev/provenance/v1",
"attestation_action_sha": "59d89421af93a897026c735860bf21b6eb4f7b26",
"artifact_upload_action_sha": "ea165f8d65b6e75b540449e92b4886f43607fa02"
"artifact_upload_action_sha": "ea165f8d65b6e75b540449e92b4886f43607fa02",
"attestation_verifier_version": "2.96.0",
"attestation_verifier_archive_sha256": "83d5c2ccad5498f58bf6368acb1ab32588cf43ab3a4b1c301bf36328b1c8bd60",
"attestation_verifier_binary_sha256": "56b8bbbb27b066ecb33dbef9a256dc9d1314adaeff0908a752feba6c34053b40"
}
2 changes: 1 addition & 1 deletion policies/lean-publication-1.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9cac0ae88eb00e84474ce9f7a2357b5b8677beb6e042d163f95c78a453c34a2b
7cd39f57c3b8a01c69e49bb1837f4be4a01eaaf1290274ea53af04ec48ef891b
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://mnehmos.ai/mathos/schemas/publication/attestation-verification/1",
"title": "MathOS Publication Attestation Verification v1",
"type": "object",
"additionalProperties": false,
"required": ["schema_version", "report_content_hash", "report_artifact_hash", "attestation_bundle_hash", "raw_verification_hash", "verifier_name", "verifier_version", "verifier_binary_sha256", "repository", "signer_workflow", "certificate_identity", "source_ref", "source_commit_sha", "predicate_type", "self_hosted_runners_denied", "verified_attestation_count", "verified_timestamp_count", "authoritative"],
"properties": {
"schema_version": {"const": "publication_attestation_verification/1"},
"report_content_hash": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"report_artifact_hash": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"attestation_bundle_hash": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"raw_verification_hash": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"verifier_name": {"const": "gh"},
"verifier_version": {"type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"},
"verifier_binary_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"repository": {"const": "Mnehmos/MathOS"},
"signer_workflow": {"const": "Mnehmos/MathOS/.github/workflows/publication.yml"},
"certificate_identity": {"const": "https://github.com/Mnehmos/MathOS/.github/workflows/publication.yml@refs/heads/main"},
"source_ref": {"const": "refs/heads/main"},
"source_commit_sha": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
"predicate_type": {"const": "https://slsa.dev/provenance/v1"},
"self_hosted_runners_denied": {"const": true},
"verified_attestation_count": {"type": "integer", "minimum": 1},
"verified_timestamp_count": {"type": "integer", "minimum": 1},
"authoritative": {"const": false}
}
}
7 changes: 5 additions & 2 deletions schemas/publication/publication-policy-1.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "MathOS Publication Policy v1",
"type": "object",
"additionalProperties": false,
"required": ["schema_version", "policy_name", "repository", "workflow_path", "required_source_ref", "required_runner_environment", "required_lean_toolchain", "allowed_axioms", "requires_clean_checkout", "requires_dependency_closure", "requires_network_isolation", "requires_memory_limit", "attestation_predicate_type", "attestation_action_sha", "artifact_upload_action_sha"],
"required": ["schema_version", "policy_name", "repository", "workflow_path", "required_source_ref", "required_runner_environment", "required_lean_toolchain", "allowed_axioms", "requires_clean_checkout", "requires_dependency_closure", "requires_network_isolation", "requires_memory_limit", "attestation_predicate_type", "attestation_action_sha", "artifact_upload_action_sha", "attestation_verifier_version", "attestation_verifier_archive_sha256", "attestation_verifier_binary_sha256"],
"properties": {
"schema_version": {"const": "publication_policy/1"},
"policy_name": {"type": "string", "minLength": 1, "maxLength": 128},
Expand All @@ -20,6 +20,9 @@
"requires_memory_limit": {"const": true},
"attestation_predicate_type": {"const": "https://slsa.dev/provenance/v1"},
"attestation_action_sha": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
"artifact_upload_action_sha": {"type": "string", "pattern": "^[0-9a-f]{40}$"}
"artifact_upload_action_sha": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
"attestation_verifier_version": {"type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"},
"attestation_verifier_archive_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"attestation_verifier_binary_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
}
}
Loading
Loading
0