8000 feat: add deterministic Comparator-ready package boundary by Mnehmos · Pull Request #61 · Mnehmos/MathOS · GitHub
[go: up one dir, main page]

Skip to content

feat: add deterministic Comparator-ready package boundary - #61

Merged
Mnehmos merged 2 commits into
mainfrom
feat/60-comparator-package
Jul 22, 2026
Merged

Mnehmos merged 2 commits into
mainfrom
feat/60-comparator-package

Conversation

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

Tracks #60. Issue #60 intentionally remains open until merged-tree protected evidence is audited. ## Summary Adds a deterministic, offline boundary that projects one verified frozen release into exactly Challenge.lean, Solution.lean, config.json, formalization.yaml, and verification.json. The package is independently reproducible and can encode only ready, comparator_verified: false, and authoritative: false. ## Change class Select one: - [ ] Class 0: Administrative or documentation - [ ] Class 1: Standard implementation - [ ] Class 2: Verifier-critical - [x] Class 3: Release, migration, or security-sensitive Affected trust boundary: portable-release projection into official Comparator input shape. Construction and reprojection establish package integrity only; they do not execute Comparator, create evidence, or grant mathematical authority. ## TDD evidence - [x] Acceptance criteria were defined before implementation - [ ] A focused test or formal obligation failed first for the expected reason - [x] The smallest coherent implementation made it pass - [x] Refactoring preserved passing behavior - [x] Relevant unit and integration suites pass - [x] Failure paths and boundary cases are covered - [ ] Documentation-only exception applies and is explained below Red evidence: issue #60 defined the closed contracts and adversarial acceptance criteria before implementation; no separate retained red-run artifact is claimed. Green evidence: 176 library tests, 19 CLI tests, four MCP tests, the opt-in real Lean integration, and 39 Python regressions pass. Comparator tests cover canonicality, deterministic five-file projection, authority constants, stale inputs, substitution, inventory/tamper, trusted hashes, immutable output, schemas, malformed fields/names/pins, and oversized inputs. Commands and results: - cargo fmt --all -- --check — pass - cargo clippy --workspace --all-targets --all-features -- -D warnings — pass - cargo test --workspace --all-targets — pass - MCL_RUN_LEAN_INTEGRATION=1 cargo test --test lean_worker -- --nocapture — pass - PYTHONPATH=src PYTHONWARNINGS=error::ResourceWarning python -m unittest discover -s tests -v — 39 pass - bash -n scripts/release-pilot-a.sh — pass - Actionlint 1.7.12 — pass - git diff --check — pass - exact-head CI run 29893380402 — all five jobs pass on 36ae9586dc7985785501474c53e1ee3d6067b5f5 ## Mathematical verification - [ ] No mathemat 8000 ical trust boundary is affected - [x] Candidate output was checked independently from its generator - [x] Formal proof passes the pinned kernel or checker - [ ] Counterexample premises and violated conclusion were checked - [x] Assumptions, domains, tolerances, and dependency pins are recorded - [x] Claim, theorem, witness, or artifact identifiers are linked Verifier and result: offline verify-comparator-package reproduced the local five-file Pilot A package from downloaded protected release manifest 47c72887ebb5421c021c1ed71212e4b4d298f8c02e3d4623223721c2a858f567 with verification hash ec36212e00e255de770109a44e5bdce2e0e4922491f1a5ae950f93e6ad50ecae; both Lean files elaborate with Lean 4.32.0. The challenge contains an intentional sorry, and neither result is represented as Comparator verification. ## Provenance and licensing - [x] No new third-party code, data, model output, or dependency - [ ] New third-party material has source, license, and attribution recorded - [x] Generated artifacts include tool, version, configuration, seed, and hash as applicable - [x] MathCorpus and RL export implications are documented - [x] No credentials, private data, or access-controlled material are included Provenance references: official repository/full-commit pins are Comparator 68a064109f01c08f47c8edc9f51d6a2bbffaa188, lean4export af5aa64bb914c3c2c781f378088dbd38acf4f804, and landrun 5ed4a3db3a4ad930d577215c6b9abaa19df7f99f. Solution.lean is copied byte-for-byte from the frozen MathOS release replay member; the Pilot A challenge is repository-owned source. ## Risk and recovery Known limitations: this PR prepares package inputs only. It does not establish challenge/solution equivalence, run the real Linux sandbox, ingest Comparator evidence, change research status, or complete Pilot C. Rollback or recovery plan: revert the implementation commit and publication workflow addition. Existing release, corpus, and RL artifact identities remain independently bound and valid; no schema migration or database write is introduced. Follow-up work: after merged-tree protected artifact audit, implement real pinned Linux Comparator execution and controlled evidence ingestion, then continue the BH Pilot C lifecycle. ## Review readiness - [x] The branch is current with main - [x] The pull request addresses one coherent concern - [x] Required checks pass - [x] Review threads are resolved - [x] I have not represented generated output as independently verified evidence

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

Review Change Stack

📝 Walkthrough

Walkthrough

This change adds Comparator-ready package contracts, deterministic five-file export and verification, CLI commands, Pilot A automation, a Lean challenge fixture, schemas, tests, and documentation describing the ready-state trust boundary.

Changes

Comparator package workflow

Layer / File(s) Summary
Package contracts and trust boundary
src/domain/comparator.rs, schemas/release/*, fixtures/comparator/pilot-a/Challenge.lean, docs/trust/*, docs/decisions/*, src/domain/mod.rs
Defines closed plan and verification contracts, generated schemas, validation rules, fixed tool pins, the Pilot A challenge, and ready packages with both authority flags false.
Deterministic export and verification
src/comparator_export.rs, src/lib.rs
Builds and verifies deterministic five-file packages from trusted frozen releases, enforcing canonical JSON, exact inventories, hashes, bindings, safe paths, and byte-identical reprojection.
CLI and Pilot A integration
src/cli/mod.rs, scripts/release-pilot-a.sh, .github/workflows/publication.yml, tests/phase1_cli.rs
Adds export and verification commands, integrates Comparator package generation into Pilot A, uploads the package artifact, and tests failure behavior without an instance root.
Implementation status and release records
docs/implementation/RELEASE_CHECKLIST.md, docs/implementation/STATUS.md
Updates Phase 6d checklist, implementation status, validation evidence, and remaining Comparator verification criteria.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related issues

  • Mnehmos/MathOS issue 60 — Directly covers the deterministic Comparator-ready package boundary and Pilot A integration implemented here.
  • Mnehmos/MathOS issue 50 — Provides the portable release bundle and offline replay artifacts consumed by this package pipeline.

Possibly related PRs

  • Mnehmos/MathOS#58 — Shares the Pilot A release-script and publication workflow integration points extended by this Comparator package work.

Sequence Diagram(s)

sequenceDiagram
  participant PilotA
  participant MCL
  participant FrozenRelease
  participant ComparatorPackage
  PilotA->>MCL: export-comparator
  MCL->>FrozenRelease: load and verify release
  FrozenRelease-->>MCL: verified release members
  MCL->>ComparatorPackage: write deterministic five-file package
  PilotA->>MCL: verify-comparator-package
  MCL->>ComparatorPackage: verify hashes and inventory
  MCL->>FrozenRelease: reproject package inputs
  MCL-->>PilotA: verification report
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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 clearly names the main change: adding a deterministic Comparator-ready package boundary.
Description check ✅ Passed The description covers the required template sections and includes summary, evidence, provenance, risks, and review readiness.
✨ 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 feat/60-comparator-package

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 22, 2026 05:04
@Mnehmos
Mnehmos merged commit 2fe5d00 into main Jul 22, 2026
6 checks passed
@Mnehmos
Mnehmos deleted the feat/60-comparator-package branch July 22, 2026 05:22
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