8000 Pilot A: prove the repaired claim through the protected boundary by Mnehmos · Pull Request #47 · Mnehmos/MathOS · GitHub
[go: up one dir, main page]

Skip to content

Pilot A: prove the repaired claim through the protected boundary - #47

Merged
Mnehmos merged 3 commits into
mainfrom
issue-46-repaired-proof
Jul 21, 2026
Merged

Mnehmos merged 3 commits into
mainfrom
issue-46-repaired-proof

Conversation

@Mnehmos
@Mnehmos Mnehmos commented Jul 21, 2026 •
Copy link
Copy Markdown
Owner

Summary

Prove the independently versioned Pilot A repair, “Every prime number other than 2 is odd,” and carry it through a second protected publication candidate in the same canonical state as the refutation and atomic repair.

The candidate generator now has an explicit repaired-proof mode. It must load the exact repaired object/version from the retained repair, observe not_started with no witnesses, reuse the original registered module and environment, and keep its retained closure inside the original instance. The publication workflow separately attests and ingests that proof candidate, creates distinct proof authority and claim-relation fidelity, derives proved, then re-reads the original claim/package/repair and requires byte-identical results.

Refs #46, #44, #25.

Change class

Select one:

  • Class 0: Administrative or documentation
  • Class 1: Standard implementation
  • Class 2: Verifier-critical
  • Class 3: Release, migration, or security-sensitive

Affected trust boundary: protected candidate construction, retained-closure containment, attestation ingestion, proof-authority promotion, role-separated statement fidelity, and derived claim status.

TDD evidence

  • Acceptance criteria were defined before implementation
  • A focused test or formal obligation failed firs 8000 t for the expected reason
  • The smallest coherent implementation made it pass
  • Refactoring preserved passing behavior
  • Relevant unit and integration suites pass
  • Failure paths and boundary cases are covered
  • Documentation-only exception applies and is explained below

Red evidence: the first elaborating proof used Nat.mod_two_eq_zero_or_one; the real CLI axiom audit reported [propext], which the protected no-axiom boundary correctly rejects. The first remote simulated candidate also rejected an array-valued semantic metadata field as outside the closed artifact_metadata/1 contract.

Green evidence: the proof now reasons from Nat.mod_lt, eliminates the only impossible remainder structurally, and #print axioms MathOS.PilotA.every_prime_other_than_two_is_odd reports no axioms. The module metadata uses separate schema-valid string fields and a real CLI ingest confirms the exact snapshot. PR CI also attempts a repaired candidate before repair and requires a closed failure. A real Windows CLI lifecycle elaborated and audited the exact declaration, prepared a canonical proof request, kept the non-authoritative claim open, and rejected a mismatched refutation request.

Commands and results:

cargo fmt --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test --workspace --all-targets
PYTHONPATH=src PYTHONWARNINGS=error::ResourceWarning python -m unittest discover -s tests -v
lake env lean -DwarningAsError=true fixtures/publication/PilotARefutation.lean
#print axioms MathOS.PilotA.every_prime_other_than_two_is_odd  # no axioms
bash -n scripts/publication-candidate.sh scripts/publication-ingest.sh
go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12 -color=false
git diff --check

Local results: 140 unit, 12 CLI integration, 3 MCP integration, the Lean worker baseline, and 39 legacy Python tests passed.

Mathematical verification

  • No mathematical trust boundary is affected
  • Candidate output was checked independently from its generator
  • Formal proof passes the pinned kernel or checker
  • Counterexample premises and violated conclusion were checked
  • Assumptions, domains, tolerances, and dependency pins are recorded
  • Claim, theorem, witness, or artifact identifiers are linked

Verifier and result: pinned Lean 4.32.0 elaborates the no-import theorem and reports an empty axiom surface. Current-head local CLI request 6a4b6cebdc61631f59e86a158f2cb2e89760904647d66c12bd14065a12e68941 is non-authoritative evidence only. Independent candidate/attestation evidence remains intentionally unchecked until the protected merged-tree artifact exists.

Provenance and licensing

  • No new third-party code, data, model output, or dependency
  • New third-party material has source, license, and attribution recorded
  • Generated artifacts include tool, version, configuration, seed, and hash as applicable
  • MathCorpus and RL export implications are documented
  • No credentials, private data, or access-controlled material are included

Provenance references: repository-owned theorem, scripts, workflows, and documentation only; existing pinned Lean, GitHub Actions, GitHub CLI, audit, and publication policies remain unchanged.

Risk and recovery

Known limitations: pull-request CI can elaborate and axiom-audit the repaired theorem and prove that repair is required, but only protected main can ingest the first attestation, create the canonical repair, and construct the positive child candidate.

Rollback or recovery plan: revert this commit to restore the single refutation candidate. Existing refutation authority, package, claim versions, and repair edges are immutable and are not rewritten by this change.

Follow-up work: independently audit the merged protected artifact before closing #46, then implement Pilot A pedagogy and export.

Review readiness

  • The branch is current with main
  • The pull request addresses one coherent concern
  • Required checks pass
  • Review threads are resolved
  • I have not represented generated output as independently verified evidence

@coderabbitai
coderabbitai Bot commented Jul 21, 2026 •
Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds a repaired Pilot A theorem and extends publication scripts and workflows to support separate refutation and repaired-proof candidates, shared canonical state, retained artifacts, protected ingestion, CI validation, and updated implementation and authority documentation.

Changes

Pilot A repaired publication

Layer / File(s) Summary
Repaired theorem and candidate modes
fixtures/publication/PilotARefutation.lean, scripts/publication-candidate.sh
Adds the repaired prime theorem and mode-dependent candidate setup with canonical state-root and CAS handling.
Candidate evidence and publication wiring
scripts/publication-candidate.sh
Reuses retained repair data for repaired-proof candidates and parameterizes formalization, verification, audit, and publication requests.
State-root ingestion and repair validation
scripts/publication-ingest.sh
Roots ingestion and repair operations in a validated state directory and checks retained artifacts, statuses, lineage, and evidence separation.
Protected workflow and CI validation
.github/workflows/ci.yml, .github/workflows/publication.yml
Runs the repaired-proof candidate, validates the no-axiom theorem and missing-repair failure, and retains candidate diagnostics and attestation artifacts.
Publication scope and implementation status
docs/implementation/STATUS.md, docs/trust/PUBLICATION_AUTHORITY.md
Documents the two-candidate protected flow and updates the Pilot A completion and follow-up checkpoints.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ProtectedWorkflow
  participant publication_candidate as publication-candidate.sh
  participant publication_ingest as publication-ingest.sh
  participant MCL
  ProtectedWorkflow->>publication_candidate: build refutation candidate
  publication_candidate->>MCL: create and attest refutation evidence
  ProtectedWorkflow->>publication_ingest: ingest and repair refutation candidate
  publication_ingest->>MCL: retain repaired claim and repair lineage
  ProtectedWorkflow->>publication_candidate: build repaired-proof candidate
  publication_candidate->>MCL: formalize and attest repaired proof
  ProtectedWorkflow->>publication_ingest: ingest repaired-proof candidate
  publication_ingest->>MCL: verify proof authority and separated evidence
Loading

Possibly related issues

Possibly related PRs

  • Mnehmos/MathOS#45 — Introduces the atomic counterexample repair contracts and endpoints exercised by the repaired-proof flow.
  • Mnehmos/MathOS#34 — Establishes the publication staging and ingestion pipeline extended with state-root and repaired-proof handling.
  • Mnehmos/MathOS#31 — Provides the protected candidate boundary execution around the publication candidate script.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the main change: proving the repaired Pilot A claim through the protected boundary.
Description check ✅ Passed The description follows the template and fills the required sections with specific implementation, testing, verification, provenance, and recovery details.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-46-repaired-proof

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Mnehmos
Mnehmos marked this pull request as ready for review July 21, 2026 21:25
@Mnehmos
Mnehmos commented Jul 21, 2026
Copy link
Copy Markdown
Owner Author

@codex review

@coderabbitai coderabbitai Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
.github/workflows/publication.yml (2)

20-20: 🩺 Stability & Availability | 🔵 Trivial

Timeout bump may be tight for two sequential closures.

This job now runs two full protected candidate closures (original + repaired-proof) plus two ingestions and two attestation verifications sequentially. A 5-minute bump (15→20) may be insufficient if a single closure already takes a meaningful fraction of that budget; worth confirming against observed run times.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/publication.yml at line 20, Reassess the timeout-minutes
setting for the publication job to account for two sequential protected
candidate closures, ingestions, and attestation verifications. Use observed
workflow runtimes to select a timeout with sufficient headroom rather than
retaining the potentially tight 20-minute limit.

99-159: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate env blocks for the two candidate closures.

The env block for the original candidate build (Lines 101-110) is duplicated verbatim for the repaired-proof candidate build (Lines 143-151). Hoisting these shared publication context vars to job-level env: would remove the duplication and eliminate the risk of the two closures silently drifting apart if one block is edited without the other.

♻️ Proposed refactor: hoist shared env to job level
   boundary:
     name: Attested publication candidate boundary
     if: github.ref == 'refs/heads/main'
     runs-on: ubuntu-latest
     timeout-minutes: 20
+    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
     permissions:
       contents: read
       ...
       - name: Build and validate the exact protected candidate closure
         shell: bash
-        env:
-          PUBLICATION_CONTEXT_MODE: protected-main
-          ...
         run: |
           ...
       - name: Build and validate the repaired claim proof in canonical state
         shell: bash
-        env:
-          PUBLICATION_CONTEXT_MODE: protected-main
-          ...
         run: |
           ...
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/publication.yml around lines 99 - 159, Hoist the shared
PUBLICATION_* context variables currently repeated in the “Build and validate
the exact protected candidate closure” and “Build and validate the repaired
claim proof in canonical state” steps into the job-level env configuration.
Remove both step-level duplicate env blocks while preserving the existing
step-specific shell commands and variable values.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/trust/PUBLICATION_AUTHORITY.md`:
- Around line 63-65: Update the “Current implementation state” section to
include the repaired-proof candidate’s publication flow, proof authority,
claim-relation fidelity evidence, and derived proved status. Align it with the
implemented behavior described in the protected workflow, removing any wording
that presents repaired-proof publication as absent while preserving the existing
refutation and counterexample-repair details.

---

Nitpick comments:
In @.github/workflows/publication.yml:
- Line 20: Reassess the timeout-minutes setting for the publication job to
account for two sequential protected candidate closures, ingestions, and
attestation verifications. Use observed workflow runtimes to select a timeout
with sufficient headroom rather than retaining the potentially tight 20-minute
limit.
- Around line 99-159: Hoist the shared PUBLICATION_* context variables currently
repeated in the “Build and validate the exact protected candidate closure” and
“Build and validate the repaired claim proof in canonical state” steps into the
job-level env configuration. Remove both step-level duplicate env blocks while
preserving the existing step-specific shell commands and variable values.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2ece7537-3838-46bc-b021-ab1db6a10c3e

📥 Commits

Reviewing files that changed from the base of the PR and between 1e9066f and 67032b0.

📒 Files selected for processing (7)
  • .github/workflows/ci.yml
  • .github/workflows/publication.yml
  • docs/implementation/STATUS.md
  • docs/trust/PUBLICATION_AUTHORITY.md
  • fixtures/publication/PilotARefutation.lean
  • scripts/publication-candidate.sh
  • scripts/publication-ingest.sh

Comment thread docs/trust/PUBLICATION_AUTHORITY.md Resolved
@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 67032b0bc0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/publication-candidate.sh Resolved
@Mnehmos
Mnehmos commented Jul 21, 2026 •
Copy link
Copy Markdown
Owner Author

Review follow-up on the two CodeRabbit nitpicks:

  • Kept timeout-minutes: 20 based on protected runs 29860588969 (1m35s) and 29866704122 (1m44s). Even allowing a second candidate closure, the limit retains roughly an order of magnitude of headroom.
  • Kept PUBLICATION_* at candidate-step scope deliberately so install, attestation, verification, and ingestion steps do not inherit candidate-construction identity context. The two closures receive the same explicit bindings without widening ambient workflow state.

@Mnehmos
Mnehmos commented Jul 21, 2026
Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: c9a557f99c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Mnehmos
Mnehmos merged commit 12fceda into main Jul 21, 2026
6 checks passed
@Mnehmos
Mnehmos commented Jul 21, 2026
Copy link
Copy Markdown
Owner Author

Merged-tree audit passed for 12fceda50ab430da79d66cd23e747720f4624f4e.

  • CI 29871210765: success
  • Protected publication 29871210845: success
  • Artifact 8511238265: 193 retained files; all 14 stderr files empty
  • Repaired claim dec1b7e7c633967af2b007e8c434ac7f7498cfc7cc58abe257bdc4305c0b52f4 derives not_started -> open -> proved
  • Proof authority 8b35030b90de39e3196822eb86842ac2902cbd32fa2c01baf2de0d64e69334f4 and claim-fidelity 470dd6a97bbe0fc537f9ee90d57559199b584a73a6ae0b10bd3f3f6f1537d3cf are role-separated
  • Fresh pinned Lean replay reports no axioms
  • Original disproved status, counterexample package/repair edge, and claim version are byte-identical after proof ingestion

Full exact identifiers and audit details are recorded on #46.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0