8000 Produce protected publication candidates by Mnehmos · Pull Request #31 · Mnehmos/MathOS · GitHub
[go: up one dir, main page]

Skip to content
{"props":{"color_mode":"dark","logged_in":false,"marketing_page":false,"home_path":"/","login_path":"/login?return_to=https%3A%2F%2Fgithub.com%2FMnehmos%2FMathOS%2Fpull%2F31%2Ffiles","signup_path":"/signup?ref_cta=Sign+up\u0026ref_loc=header+logged+out\u0026ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles\u0026source=header-repo\u0026source_repo=Mnehmos%2FMathOS","signup_enabled":true,"is_signup_controller":false,"show_search_and_nav":true,"hide_search":false,"private_mode_enabled":false,"should_use_dotcom_links":true,"auth_hydro_click":"{\"event_type\":\"authentication.click\",\"payload\":{\"location_in_page\":\"site header menu\",\"repository_id\":null,\"auth_type\":\"SIGN_UP\",\"originating_url\":\"https://github.com/Mnehmos/MathOS/pull/31/files\",\"user_id\":null}}","auth_hydro_click_hmac":"55d5649e2fc5554b861a880223f198f6b32a6c9de72338faaf7cad2346a95ce9"}}
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
34 changes: 33 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ jobs:
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install --yes --no-install-recommends bubblewrap
sudo apt-get install --yes --no-install-recommends bubblewrap jq util-linux
/usr/bin/bwrap --version
/usr/bin/prlimit --version
jq --version
- name: Run real contained Lean worker integration
shell: bash
env:
Expand All @@ -93,6 +95,36 @@ jobs:
- name: Exercise publication isolation boundary without authority
shell: bash
run: scripts/publication-smoke.sh "${RUNNER_TEMP}/publication-smoke"
- name: Exercise non-attested simulated-main candidate without authority
shell: bash
env:
PUBLICATION_CONTEXT_MODE: simulated-main
PUBLICATION_REPOSITORY: Mnehmos/MathOS
PUBLICATION_WORKFLOW_PATH: .github/workflows/publication.yml
PUBLICATION_WORKFLOW_REF: Mnehmos/MathOS/.github/workflows/publication.yml@refs/heads/main
PUBLICATION_SOURCE_REF: refs/heads/main
PUBLICATION_SOURCE_COMMIT_SHA: ${{ github.sha }}
PUBLICATION_WORKFLOW_RUN_ID: ${{ github.run_id }}
PUBLICATION_WORKFLOW_RUN_ATTEMPT: ${{ github.run_attempt }}
PUBLICATION_RUNNER_ENVIRONMENT: github_hosted
run: |
set -euo pipefail
cargo build --locked --bin mcl
export PUBLICATION_SOURCE_TREE_SHA
PUBLICATION_SOURCE_TREE_SHA="$(git rev-parse 'HEAD^{tree}')"
bash scripts/publication-candidate.sh "${RUNNER_TEMP}/publication-candidate-simulated-main"
- name: Retain a failed simulated candidate attempt
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: publication-candidate-failure-${{ github.sha }}-${{ github.run_attempt }}
if-no-files-found: warn
retention-days: 30
path: |
${{ runner.temp }}/publication-candidate-simulated-main/attempt/
${{ runner.temp }}/publication-candidate-simulated-main/closure/
${{ runner.temp }}/publication-candidate-simulated-main/publication-retained-closure.json
${{ runner.temp }}/p 8000 ublication-candidate-simulated-main/publication-report.json

legacy-python-regression:
name: Legacy Python regression evidence
Expand Down
60 changes: 56 additions & 4 deletions .github/workflows/publication.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:

jobs:
boundary:
name: Attested publication boundary smoke
name: Attested publication candidate boundary
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 15
Expand All @@ -28,6 +28,14 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- name: Require protected main ref
shell: bash
run: |
set -euo pipefail
[[ "${GITHUB_REF_PROTECTED:-}" == "true" ]] || {
echo "publication candidate requires an actively protected main ref" >&2
exit 65
}
- name: Install repository-pinned Lean
shell: bash
run: |
Expand All @@ -47,8 +55,13 @@ jobs:
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install --yes --no-install-recommends bubblewrap
sudo apt-get install --yes --no-install-recommends bubblewrap jq util-linux
/usr/bin/bwrap --version
/usr/bin/prlimit --version
jq --version
- name: Build the reviewed candidate generator
shell: bash
run: cargo build --locked --bin mcl
- name: Install pinned attestation verifier
shell: bash
run: |
Expand Down Expand Up @@ -77,12 +90,45 @@ jobs:
shell: bash
env:
PUBLICATION_GH_BIN: ${{ runner.temp }}/gh_2.96.0_linux_amd64/bin/gh
SMOKE_BUNDLE_PATH: ${{ steps.attest.outputs.bundle-path }}
run: |
scripts/publication-attestation-verify.sh \
"${RUNNER_TEMP}/publication-smoke/publication-smoke-report.json" \
"${{ steps.attest.outputs.bundle-path }}" \
"${SMOKE_BUNDLE_PATH}" \
"${RUNNER_TEMP}/publication-attestation-verification"
- name: Retain report, diagnostics, and Sigstore bundle
- name: Build and validate the exact protected candidate closure
shell: bash
env:
PUBLICATION_CONTEXT_MODE: protected-main
PUBLICATION_REPOSITORY: ${{ github.repository }}
PUBLICATION_WORKFLOW_PATH: .github/workflows/publication.yml
PUBLICATION_WORKFLOW_REF: ${{ github.workflow_ref }}
PUBLICATION_SOURCE_REF: ${{ github.ref }}
PUBLICATION_SOURCE_COMMIT_SHA: ${{ github.sha }}
PUBLICATION_WORKFLOW_RUN_ID: ${{ github.run_id }}
PUBLICATION_WORKFLOW_RUN_ATTEMPT: ${{ github.run_attempt }}
PUBLICATION_RUNNER_ENVIRONMENT: github_hosted
run: |
set -euo pipefail
export PUBLICATION_SOURCE_TREE_SHA
PUBLICATION_SOURCE_TREE_SHA="$(git rev-parse 'HEAD^{tree}')"
bash scripts/publication-candidate.sh "${RUNNER_TEMP}/publication-candidate"
- name: Attest exact protected candidate report
id: attest_candidate
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26
with:
subject-path: ${{ runner.temp }}/publication-candidate/publication-report.json
- name: Verify exact candidate attestation and retain the challenge result
shell: bash
env:
PUBLICATION_GH_BIN: ${{ runner.temp }}/gh_2.96.0_linux_amd64/bin/gh
CANDIDATE_BUNDLE_PATH: ${{ steps.attest_candidate.outputs.bundle-path }}
run: |
scripts/publication-attestation-verify.sh \
"${RUNNER_TEMP}/publication-candidate/publication-report.json" \
"${CANDIDATE_BUNDLE_PATH}" \
"${RUNNER_TEMP}/publication-candidate-attestation-verification"
- name: Retain smoke, candidate closure, diagnostics, and Sigstore bundles
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
Expand All @@ -93,3 +139,9 @@ jobs:
${{ runner.temp }}/publication-smoke/
${{ runner.temp }}/publication-attestation-verification/
${{ steps.attest.outputs.bundle-path }}
${{ runner.temp }}/publication-candidate/attempt/
${{ runner.temp }}/publication-candidate/closure/
${{ runner.temp }}/publication-candidate/publication-retained-closure.json
${{ runner.temp }}/publication-candidate/publication-report.json
${{ runner.temp }}/publication-candidate-attestation-verification/
${{ steps.attest_candidate.outputs.bundle-path }}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ GitHub artifact attestations bind an artifact digest to a workflow identity usin

The protected `.github/workflows/publication.yml` workflow will create a canonical `publication_report/1` candidate after clean-checkout verification. The candidate always carries `authoritative: false`. Its contract rejects a report that attempts to promote itself.

The report is accompanied by a closed `publication_retained_closure/1` manifest. Its roles and paths are fixed rather than caller-named, every member carries both a semantic identity and exact byte hash, and the report binds the sorted member-hash set plus the canonical manifest hash. Protected Lean parser-derived dependency output is retained and checked against both import manifests rather than inferred with textual grep. Before attestation, the shared application service opens every member, replays its typed cross-references, re-derives the canonical request from current state, and still returns only a non-authoritative validation result.

The workflow will attest the exact report bytes with the SHA-pinned `actions/attest` action and retain the report, full logs, hashes, and serialized Sigstore bundle. The attestation uses the SLSA provenance v1 predicate.

Authority ingestion will invoke only the allowlisted GitHub CLI attestation verifier with typed arguments equivalent to:
Expand All @@ -39,7 +41,7 @@ The verifier is part of the trust boundary. The policy therefore pins the GitHub

GitHub CLI treats exact certificate identity and signer-workflow selectors as mutually exclusive. MathOS uses the stronger exact certificate SAN, which already binds repository, workflow path, and `main` ref. The expected signer workflow remains explicit in the constrained verification record.

The publication workflow lives on protected `main`. Pull-request CI may test candidate generation and rejection paths, but cannot produce authoritative evidence.
The publication workflow lives on protected `main`. The workflow and candidate producer both fail closed unless GitHub's immutable run context reports that the exact source ref is actively protected. 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 All @@ -50,6 +52,7 @@ The implementation follows GitHub's current [artifact attestation guidance](http
- Promotion requires GitHub attestation verification and is not fully offline by default. A future offline mode may use a securely acquired trusted root and retained bundle.
- The workflow predicate remains partly workflow-controlled, so authority consumes only fields independently constrained by the certificate plus exact content identities revalidated by MathOS.
- A compromised protected publication workflow can produce bad candidates. Branch protection, pinned actions, minimal permissions, reviewed workflow changes, and exact signer constraints remain administrative and engineering controls around that boundary.
- Repository branch protection is part of the authority precondition, not an assumed label. Removing the rule makes candidate production fail before attestation.
- Publication proof authority still does not establish source-statement fidelity, novelty, pedagogy quality, or mathematical importance.

## Rejected alternatives
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 34: A Proof Must Travel With Its Luggage

July 20, 2026

A proof can be tiny while the reason to trust it is not.

`True` needs almost nothing from Lean. Yet the moment MathOS wants to carry that result beyond the machine that checked it, the theorem acquires luggage: the statement it formalizes, the exact module, the toolchain, the policy, the diagnostic history, the axiom surface, the source revision, and the record of the room in which it was rebuilt.

It is tempting to call this bureaucracy. I think it is memory.

Without the luggage, a result arrives as a stranger with a convincing story. With it, another system can ask where the result came from, what it depended on, which doors were locked, and whether anything changed during the journey. The proof does not become more true. It becomes possible to recognize responsibly.

There is also humility in retaining empty logs. An empty file looks like nothing, but preserving its exact emptiness says that silence was observed rather than forgotten. Absence becomes evidence only when the system remembers where to look for what was absent.

Today the publication boundary is learning to pack before it travels. It still cannot grant authority. That restraint matters. First assemble the complete memory. Then let an outside witness bind the package. Only after both acts agree should MathOS accept the consequence.

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 @@ -41,3 +41,4 @@ The diary is intentionally more philosophical than technical. Technical evidence
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)
33. [A Failed Challenge Must Leave a Trace](0033-a-failed-challenge-must-leave-a-trace.md)
34. [A Proof Must Travel With Its Luggage](0034-a-proof-must-travel-with-its-luggage.md)
8 changes: 6 additions & 2 deletions docs/implementation/RELEASE_CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MathOS 1.0.0 Release Checklist

Last updated: 2026-07-19
Last updated: 2026-07-20

This checklist mirrors section 30 of [SPEC.md](../../SPEC.md). A checked item requires linked mechanical and manual evidence. Partial Phase 1 work is recorded below but does not check a release item whose complete wording is not yet satisfied.

Expand Down Expand Up @@ -49,10 +49,14 @@ Phase 3 diagnostic evidence: the closed `evidence/1` contract names exact subjec

Phase 3 local audit evidence: the committed audit policy and closed request/report schemas bind an exact formalization, accepted elaboration diagnostic, environment, module, declaration, and policy identity. Durable audit jobs run source escape scans and verifier-controlled `#print axioms`, retain private diagnostics, and atomically promote diagnostic proof-closure and axiom-audit evidence. Policy mismatch, malformed output, duplicate axioms, retries, restart, partial promotion, and corruption fail closed. Local audits explicitly lack publication memory and network isolation and cannot become authoritative, so the complete proof-authority and publication criteria remain unchecked.

Phase 3 publication contract evidence: the closed publication policy, request, and candidate report bind exact proof or refutation intent, diagnostic and audit evidence, formalization, environment, module, declaration, Git commit and tree, protected workflow identity, runner class, required isolation controls, retained artifacts, and SHA-pinned attestation actions. The application now derives canonical private request artifacts from the current formalization head and one exact accepted elaboration/audit chain, recomputes every retained local CAS object, and exposes the same non-authoritative operation through CLI and MCP without accepting request JSON or authority fields. Typed formalization polarity prevents one exact version/evidence closure from being requested as both proof and refutation; legacy records without polarity cannot publish until versioned and reverified. Transactional head and idempotency checks cover matching preexisting CAS identities. Retry, restart, stale subject, conflicting key reuse, missing/substituted evidence, corrupted evidence artifacts, and invalid or mismatched outcomes fail closed. Candidate reports are structurally non-authoritative. Polarity remains intent until combined with reviewed fidelity. ADR-0006 requires OIDC and Sigstore attestation verification before promotion. A real protected candidate closure, verified ingestion, and authoritative evidence remain incomplete, so every proof-authority criterion remains unchecked.
Phase 3 publication contract evidence: the closed publication policy, request, retained closure, and candidate report bind exact proof or refutation intent, diagnostic and audit evidence, formalization, environment, module, declaration, Git commit and tree, protected workflow identity, runner class, required isolation controls, retained artifacts, and SHA-pinned attestation actions. The application derives canonical private request artifacts from the current formalization head and one exact accepted elaboration/audit chain without accepting request JSON or authority fields. Typed formalization polarity prevents one exact version/evidence closure from being requested as both proof and refutation; legacy records without polarity cannot publish until versioned and reverified. Transactional head and idempotency checks cover matching preexisting CAS identities. The workflow-facing validator then requires 25 exact fixed-path closure roles, recomputes every member hash, replays the source, claim, formalization, evidence, job, report, policy, environment, module, parser-derived protected dependency output, and local/protected axiom relationships, and dry-run re-derives the request from current Store and CAS state. The protected producer fails unless GitHub reports an actively protected source ref, then builds a real no-import candidate under clean-checkout, Bubblewrap network/process isolation, timeout, memory, and output-size controls; pull-request CI runs it without attestation, while protected `main` attests the exact candidate report. Bounded structured attempt diagnostics and available CAS bytes are retained even when generation fails. Every request, report, validation result, and attestation-verification record remains structurally non-authoritative. Polarity remains intent until combined with reviewed fidelity. Controlled downloaded-closure ingestion and authoritative evidence creation remain incomplete, so every proof-authority criterion remains unchecked.

Remote evidence: GitHub Actions run `29704542965` passed the exact real Lean audit lifecycle and fresh Linux and Windows suites on tree `30d55d6e2ce7b0de2d921cff3e1368124fd9f66f`. This validates the local diagnostic audit capability only. The verification checklist remains open until publication-profile authority, replay, and retained publication evidence are complete.

Remote request-preparation evidence: PR #30 merged as `da33431a1061bb3f05db7a7d2473f1fb5b8059f2`, tree `620f2a3060290ffe37fb3051ff604fa4433679af`. Main CI run `29711916515` passed every required platform/toolchain job; publication run `29711916501` retained and independently verified the exact non-authoritative smoke artifact. The first real protected candidate run for the retained-closure slice is still pending its merged tree.

Repository protection evidence: live GitHub API reads now report `main` as protected. Pull requests, strict passage of the five CI jobs, resolved conversations, stale-review dismissal, and admin enforcement are required; force-pushes and deletions are disabled. The protected candidate also checks GitHub's immutable protected-ref context at runtime. This administrative control does not itself grant proof authority.

## Search and context

- [ ] Exact, FTS, graph, declaration, and failure searches work.
Expand Down
Loading
Loading
0