8000 Rebuild MathOS against the binding 1.0 specification by Mnehmos · Pull Request #11 · Mnehmos/MathOS · GitHub
[go: up one dir, main page]

Skip to content

Rebuild MathOS against the binding 1.0 specification - #11

Merged
Mnehmos merged 32 commits into
mainfrom
feat/spec-driven-rust-rebuild
Jul 19, 2026
Merged

Mnehmos merged 32 commits into
mainfrom
feat/spec-driven-rust-rebuild

Conversation

@Mnehmos
@Mnehmos Mnehmos commented Jul 19, 2026
Copy link
Copy Markdown
Owner

Product outcome

Replace the falsely completed finite Python slice with the governed Rust foundation required by the binding root SPEC.md.

Included controlled slices

  • binding product contract and honest pre-1.0 release ledger;
  • local-first Rust binary, SQLite WAL storage, CAS artifacts, health and doctor checks;
  • RFC 8785 canonical JSON and immutable UUIDv7 record versions;
  • typed, exact-version graph edges and hard-prerequisite cycle controls;
  • append-only anchored hash-chained run events;
  • deterministic bounded graph traversal;
  • enforced closed source and claim schemas;
  • GPT-5.6 Sol build-in-public development diary.

Local evidence

  • cargo fmt --check: passed
  • warnings-denied Clippy: passed
  • Rust unit tests: 41 passed
  • Rust CLI integration tests: 4 passed
  • legacy Python regression tests: 39 passed
  • manual initialization: migration 5, WAL, exit 0
  • manual health: healthy, exit 0

Remote preservation

The nine local commits were replayed through the GitHub Git-object API because authenticated git push was unavailable. The remote head tree hash and local HEAD tree hash are both:

d7a52ddb187594eec32feea53b587f5feaca4172

This proves the remote branch contains the exact tracked workspace snapshot.

Honest release status

MathOS 1.0 is not complete. Lean authority, evidence derivation, shared CLI/MCP capability paths, research jobs, pedagogy, releases, exports, migrations, four product pilots, and complete acceptance remain open.

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

Important

Review skipped

Too many files!

This PR contains 120 files, which is 20 over the limit of 100.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

Upgrade to a paid plan to raise the limit.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a816ae66-f258-4081-b823-16f4859e8a83

📥 Commits

Reviewing files that changed from the base of the PR and between 49b8657 and bb9cff8.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (120)
  • .github/workflows/ci.yml
  • .gitignore
  • CHANGELOG.md
  • Cargo.toml
  • README.md
  • SPEC.md
  • docs/architecture/adr/0001-finite-verifier-first.md
  • docs/decisions/ADR-0001-local-first-modular-monolith.md
  • docs/decisions/ADR-0002-rfc8785-canonical-json.md
  • docs/decisions/ADR-0003-hash-chained-run-events.md
  • docs/decisions/ADR-0004-mcp-stdio-and-official-rust-sdk.md
  • docs/decisions/ADR-0005-contained-local-lean-execution.md
  • docs/decisions/ADR-0006-oidc-attested-publication-authority.md
  • docs/dev-diary/0004-the-name-of-done.md
  • docs/dev-diary/0005-the-contract-before-the-claim.md
  • docs/dev-diary/0006-the-right-to-remain-the-same.md
  • docs/dev-diary/0007-the-trace-remembers.md
  • docs/dev-diary/0008-a-path-is-not-a-proof.md
  • docs/dev-diary/0009-the-original-and-the-claim.md
  • docs/dev-diary/0010-an-interpretation-is-not-a-verdict.md
  • docs/dev-diary/0011-one-door-many-entrances.md
  • docs/dev-diary/0012-the-retry-is-a-memory.md
  • docs/dev-diary/0013-the-shape-of-a-promise.md
  • docs/dev-diary/0014-the-interface-is-not-the-mind.md
  • docs/dev-diary/0015-a-bridge-must-carry-the-same-weight.md
  • docs/dev-diary/0016-a-mutation-must-introduce-itself.md
  • docs/dev-diary/0017-the-world-around-a-proof.md
  • docs/dev-diary/0018-a-name-must-lead-somewhere.md
  • docs/dev-diary/0019-nothing-exists-until-it-can-be-retrieved.md
  • docs/dev-diary/0020-the-orphan-is-not-a-ghost.md
  • docs/dev-diary/0021-a-process-must-be-expected.md
  • docs/dev-diary/0022-success-must-name-its-kind.md
  • docs/dev-diary/0023-the-directory-was-part-of-the-proof.md
  • docs/dev-diary/0024-evidence-needs-a-subject.md
  • docs/dev-diary/0025-a-report-cannot-promote-itself.md
  • docs/dev-diary/0026-the-proof-brings-its-ancestors.md
  • docs/dev-diary/0027-a-correct-theorem-can-mean-the-wrong-thing.md
  • docs/dev-diary/0028-disagreement-needs-an-address.md
  • docs/dev-diary/0029-authority-needs-a-witness-outside-itself.md
  • docs/dev-diary/README.md
  • docs/implementation/0001-zero-to-one-evidence.md
  • docs/implementation/BLOCKERS.md
  • docs/implementation/RELEASE_CHECKLIST.md
  • docs/implementation/STATUS.md
  • docs/product/SPEC.md
  • docs/product/ZERO_TO_ONE_DOD.md
  • docs/trust/ARTIFACTS.md
  • docs/trust/AUDITS.md
  • docs/trust/ENVIRONMENTS.md
  • docs/trust/EVIDENCE.md
  • docs/trust/FIDELITY.md
  • docs/trust/PUBLICATION_AUTHORITY.md
  • docs/trust/VERIFIER_JOBS.md
  • fixtures/cli/edge-mutation.json
  • fixtures/cli/record-mutation.json
  • fixtures/cli/run-chain-report.json
  • fixtures/environment/lean-4.32-local.json
  • fixtures/environment/lean-4.32-local.sha256
  • lean-toolchain
  • mcl.toml.example
  • migrations/0001_initial.sql
  • migrations/0002_idempotency.sql
  • migrations/0003_record_invariants.sql
  • migrations/0004_edge_invariants.sql
  • migrations/0005_run_event_invariants.sql
  • migrations/0006_environment_invariants.sql
  • migrations/0007_artifact_invariants.sql
  • migrations/0008_verifier_jobs.sql
  • migrations/0009_evidence_invariants.sql
  • policies/lean-local-audit-1.json
  • policies/lean-publication-1.json
  • policies/lean-publication-1.sha256
  • pyproject.toml
  • rust-toolchain.toml
  • schemas/artifact/artifact-metadata-1.schema.json
  • schemas/audit/audit-policy-1.schema.json
  • schemas/audit/audit-report-1.schema.json
  • schemas/audit/audit-request-1.schema.json
  • schemas/claim/claim-1.schema.json
  • schemas/concept/concept-1.schema.json
  • schemas/environment/environment-1.schema.json
  • schemas/evidence/evidence-1.schema.json
  • schemas/fidelity/fidelity-review-report-1.schema.json
  • schemas/fidelity/fidelity-review-request-1.schema.json
  • schemas/formalization/formalization-1.schema.json
  • schemas/publication/publication-policy-1.schema.json
  • schemas/publication/publication-report-1.schema.json
  • schemas/publication/publication-request-1.schema.json
  • schemas/source/source-1.schema.json
  • schemas/verifier/verifier-execution-report-1.schema.json
  • schemas/verifier/verifier-request-1.schema.json
  • src/app.rs
  • src/artifacts/mod.rs
  • src/canonical.rs
  • src/cli/mod.rs
  • src/config.rs
  • src/domain/artifact.rs
  • src/domain/audit.rs
  • src/domain/environment.rs
  • src/domain/evidence.rs
  • src/domain/fidelity.rs
  • src/domain/mod.rs
  • src/domain/publication.rs
  • src/domain/schemas.rs
  • src/domain/verifier.rs
  • src/error.rs
  • src/lib.rs
  • src/main.rs
  • src/mathos/__init__.py
  • src/mathos/lean.py
  • src/mcp/mod.rs
  • src/store/graph.rs
  • src/store/mod.rs
  • src/store/runs.rs
  • src/verifier/mod.rs
  • tests/lean_worker.rs
  • tests/mcp_stdio.rs
  • tests/phase1_cli.rs
  • tests/test_cli.py
  • tests/test_mcp.py

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Review on demand using usage pricing
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/spec-driven-rust-rebuild

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 commented Jul 19, 2026
Copy link
Copy Markdown
Owner Author

Remote preservation map for the ephemeral checkout:

Local commit Durable GitHub commit
3f7a94f b74f901
a0565f3 a917061
c8bbe2d d69f13d
16a02c3 c7e2c11
8bee050 db9d888
30d6d66 b65333b
655fa33 6027f55
5e8fcaa d618c1a
ae88731 32c6da6

Both heads have the same tree hash: d7a52ddb187594eec32feea53b587f5feaca4172.

Copy link
Copy Markdown
Owner Author

CI repair published: local a30686c maps to durable remote commit 2b49d13. Both have tree 1c6246e5ef34043cc16f0da05953812e3e040175. The fix replaces the premature Lake-project action with a checksum-verified Elan v4.2.3 install and exact Lean 4.32.0 assertion. Issue #12 tracks the defect and evidence.

Mnehmos commented Jul 19, 2026
Copy link
Copy Markdown
Owner Author

Checkpoint 0010 published: commit b96cd2dbf032b25197fd16ae1f4e537d3fe0d3d6.

The remote tree exactly matches the fully tested local tree: 360479e30974be4d8e13f0fce42c1ca4604777de.

This slice keeps concepts, claims, formalizations, and verdicts separate. Exactness is now preserved without being mistaken for truth. Issue #10 stays open until this head is green in CI. MathOS 1.0 remains overwhelmingly incomplete.

Mnehmos commented Jul 19, 2026
Copy link
Copy Markdown
Owner Author

GPT-5.6 Sol Dev Diary checkpoint 0011 is durable in d3d6856: one door, many entrances.

The CLI now reaches canonical entities through the application service rather than becoming a second domain implementation. This is only the first issue #13 slice. Research runs and graph operations have not crossed the bridge yet, MCP remains absent from the Rust product, and MathOS 1.0 remains overwhelmingly incomplete.

Mnehmos commented Jul 19, 2026
Copy link
Copy Markdown
Owner Author

GPT-5.6 Sol Dev Diary checkpoint 0012 is durable in 4b0d76e: the retry is a memory.

Research traces and the graph now cross the same application boundary as canonical entities. The playtest exposed a validation-order bug that would have broken idempotent retries; it was fixed before publication. These traces remain non-authoritative, MCP still does not exist in Rust, and 1.0 remains far away.

Mnehmos commented Jul 19, 2026
Copy link
Copy Markdown
Owner Author

GPT-5.6 Sol Dev Diary checkpoint 0013 is durable in c9c7de8: the shape of a promise.

Representative application-service responses are now frozen as golden contracts, and the exposed CLI contains no route to mark proof, fidelity, novelty, or certification. Fresh CI is the remaining gate for issue #13. This is still foundation, not MathOS 1.0.

Mnehmos commented Jul 19, 2026
Copy link
Copy Markdown
Owner Author

GPT-5.6 Sol Dev Diary checkpoint 0017 is published.

MathOS can now name the world around a future proof with a canonical environment identity. It still cannot claim that any proof has been checked.

Remote commit: 9c8d2c9886a2c7cc8b64d62a00c9c0eb3fdc7f77
Exact local and remote tree: 5d0a883dcd02ac5676a645cff66af814572488b5

The same branch state also contains the literal unknown-action MCP regression required before issue #14 can close again.

Mnehmos commented Jul 19, 2026
Copy link
Copy Markdown
Owner Author

GPT-5.6 Sol Dev Diary checkpoint 0018 is published.

An environment hash must now resolve to immutable, inspectable state before a formalization can cite it. Persistence does not make it proof evidence, but it removes one category of hidden context.

Remote commit: 4db8c533c10dbb8ce940689659244b9279a0df71
Exact local and remote tree: 2e25c4288b3c156c7d3c9d0f0dbb21c355a5e77b

Fresh CI is the remaining gate for issue #15 and contains the explicit unknown-action regression required to close issue #14 honestly.

Mnehmos commented Jul 19, 2026
Copy link
Copy Markdown
Owner Author

Checkpoint 0019 is published.

A formalization module hash must now resolve to immutable CAS bytes plus closed, licensed metadata before canonical creation. The CLI supports dry-run ingest, exact lookup, bounded listing, and byte verification. Doctor reports crash-window orphans without treating them as state. Temporary materialization rejects path escape and overwrite.

Local validation passed:

  • formatting and warnings-denied Clippy
  • 59 Rust unit tests
  • 8 real CLI subprocess integration tests
  • 3 real MCP subprocess integration tests
  • 39 legacy Python regression tests
  • patch whitespace validation

Remote commit: e94d2dacf0755a54f7ec874a10e6d44bbbf7b458
Exact local and remote tree: fc4fda32d6c6ca50634b80f1b7f8f19c13da8caa

This establishes artifact identity and availability only. Lean execution, verifier evidence, derived truth, all pilots, releases, and 1.0 acceptance remain open. Issue #16 awaits fresh Linux and Windows CI.

Mnehmos commented Jul 19, 2026
Copy link
Copy Markdown
Owner Author

Checkpoint 0021 is published.

Before Lean execution, verifier intent is now durable and typed. Exact environment and Lean source hashes plus a bounded declaration name can be dry-run validated, idempotently queued, inspected after restart, transactionally leased, and safely requeued after lease expiry. Database triggers reject identity rewrites, illegal state jumps, forged attempt counts, invalid lease/result shapes, terminal rewrites, and deletion.

Local validation passed:

  • formatting and warnings-denied Clippy
  • 63 Rust unit tests
  • 9 real CLI subprocess integration tests
  • 3 real MCP subprocess integration tests
  • 39 legacy Python regression tests
  • patch whitespace validation

Remote commit: f0ee1e0a032f2afd815c136cca149893c8ca1850
Exact local and remote tree: d3402c341d0665c593a4a7e75dfbc01f84e369a6

This slice does not execute Lean and creates no evidence or mathematical status. Issue #17 remains open for contained execution, diagnostics, audits, and real Lean integration.

Mnehmos commented Jul 19, 2026
Copy link
Copy Markdown
Owner Author

Checkpoint 0022 is preserved on GitHub at remote commit c74376f411f7120dac9a9ac5033916b87484493b, exact tree 593213d93c0b68d30169a585167cb93913b0b337.

This slice adds the contained local Lean worker, bounded process capture, conservative source rejection, immutable private diagnostic and execution-report artifacts, terminal job recording, a real pinned-Lean CI test for accepted and rejected modules, ADR-0005, trust documentation, and the GPT-5.6 Sol dev diary entry “Success Must Name Its Kind.”

Local validation: formatting and warnings-denied Clippy passed; 65 Rust unit tests, 9 CLI subprocess tests, 3 MCP subprocess tests, and 39 legacy Python regression tests passed. The unsafe-source CLI path, timeout, output exhaustion, restart, idempotency, and artifact persistence are exercised locally.

Every execution report has authoritative: false. Local memory enforcement and network isolation are reported false. Publication-profile execution is refused. This is elaboration infrastructure, not proof authority, and issue #17 remains open while remote real-Lean CI and later proof-closure evidence are pending.

Mnehmos commented Jul 19, 2026
Copy link
Copy Markdown
Owner Author

CI repair checkpoint: run 29701667356 correctly failed the real Lean job because the fresh workspace removed Elan's implicit path to the repository lean-toolchain file. Remote commit 8cf576f4de7d17f39639e462a6d5b6a4bab0b000, exact tree 724cbd2332c988c874462ea6d825fd93b2c4d809, now sets worker-controlled ELAN_TOOLCHAIN from the already validated environment manifest. It also tests that the typed value reaches the process, non-allowlisted parent environment does not, and a fake wrong-version Lean is classified as toolchain_mismatch with a failed operational job and non-authoritative report. Local formatting, warnings-denied Clippy, and all Rust tests pass. Fresh GitHub CI is pending.

Mnehmos commented Jul 19, 2026
Copy link
Copy Markdown
Owner Author

Checkpoint 0024 is preserved at remote commit 33811e0f73ee37f611666e3eb3decc0f28647f5c, exact tree dd31042648fa46533227215efc91a991964e979e. This first issue #18 slice adds the closed evidence/1 Rust contract and schema, exhaustive evidence kinds, explicit diagnostic-to-authoritative classes, deterministic evidence identity, migration 0009, and database enforcement against subject/version mismatch, update, and deletion. Local formatting, warnings-denied Clippy, 67 Rust unit tests, 9 CLI tests, 3 MCP tests, and 39 legacy regressions pass. No application promotion path exists yet, no authoritative evidence can be created, and no mathematical status changes.

Mnehmos commented Jul 19, 2026
Copy link
Copy Markdown
Owner Author

Checkpoint published: exact diagnostic evidence promotion is now on feat/spec-driven-rust-rebuild at commit c71983a65b2b3f6cabfd560b54a843ace188cc01.

The remote tree 7622bf7c2408061104f2b27fcca0fb451d4653a2 exactly matches local commit 4869904ddd70ecaed8f44cc346be4ad9fb5113ce.

Implemented:

  • application-derived, immutable lean_elaboration diagnostic evidence
  • exact formalization, environment, module, declaration, job, and report binding
  • CAS report revalidation plus controlled private verifier provenance
  • idempotent create, restart retrieval, deterministic listing, and corruption detection
  • public artifact ingestion cannot forge system creation provenance
  • no authority or mathematical-status path

Adversarial coverage includes mismatched targets, cross-object versions, forged report provenance after database-guard bypass, corrupted report bytes, retry, deletion, restart, and projection corruption.

Local validation passed: formatting, warnings-denied Clippy, 69 Rust unit tests, 9 CLI tests, 3 MCP subprocess tests, Lean worker integration, 39 legacy Python tests, and git diff --check.

Issue closure remains blocked on fresh Linux and Windows CI for this exact remote tree.

Add closed audit policy and schemas, durable exact audit jobs, verifier-controlled source and transitive axiom checks, atomic diagnostic evidence promotion, adversarial tests, trust documentation, and GPT-5.6 Sol diary checkpoint 26.
Mnehmos commented Jul 19, 2026
Copy link
Copy Markdown
Owner Author

GPT-5.6 Sol checkpoint 26: The Proof Brings Its Ancestors

Issue #19 is complete on published commit f5d4eddfff1445521652c4d05343924938cad54d.

MathOS can now run a verifier-controlled proof-closure and transitive axiom audit for one exact formalization, preserve the private diagnostic artifacts, recompute the committed policy decision, and atomically promote diagnostic proof-closure and axiom-audit evidence. It still cannot call the theorem proved.

Local and GitHub trees are identical at 30d55d6e2ce7b0de2d921cff3e1368124fd9f66f. CI run 29704542965 passed all five jobs, including real pinned Lean, Ubuntu, and Windows.

Next: issue #20, role-separated statement fidelity evidence. Kernel correctness and faithfulness remain independent questions.

Mnehmos added 3 commits July 19, 2026 14:38
Record the green exact-tree audit evidence, close issue #19 in repository memory, and make role-separated fidelity issue #20 the active criterion.
Add exact-version request and report contracts, all required review levels, semantic verdict constraints, reviewer separation, committed schemas, adversarial tests, and GPT-5.6 Sol diary checkpoint 27.
Persist controlled human-review reports and immutable exact-version evidence, derive one compare-and-swap fidelity head with visible supersession history, expose the shared path through CLI and MCP, and fail closed on attribution, lineage, ambiguity, stale writes, forged provenance, and corruption.
Mnehmos commented Jul 19, 2026
Copy link
Copy Markdown
Owner Author

Issue #20 implementation is now published on the draft branch.

Product outcome:

  • role-separated fidelity review is an independent evidence axis from Lean verification;
  • one exact source, claim, formalization, and run lineage is enforced;
  • MathOS creates a private canonical report with controlled human-review provenance;
  • derived status follows one compare-and-swap evidence head while superseded reviews remain visible;
  • CLI and MCP use the same application path;
  • self-verification, missing artifacts, substituted lineage, erased ambiguity, stale writes, forged report reuse, report corruption, and mutation after corruption fail closed;
  • no proof, disproof, novelty, or publication authority is granted.

Local validation:

  • warnings-denied Clippy passed;
  • 76 Rust unit tests passed;
  • 1 pinned Lean integration test passed;
  • 9 CLI and 3 MCP subprocess integration tests passed;
  • 39 legacy Python regressions passed;
  • formatting and patch checks passed.

Remote preservation:

  • commit: dbcb67ae4a4ded05adb92c32289d669de4485b69
  • exact tree: 80b1d2e92e81192a2863bb445a7bef872fc21b72
  • local and GitHub tree identities match.

Fresh GitHub Actions evidence is pending. The issue will remain open until every required job passes on this exact tree.

Mnehmos commented Jul 19, 2026
Copy link
Copy Markdown
Owner Author

Issue #20 is complete.

GitHub Actions run 29706138708 passed all five jobs on exact tree 80b1d2e92e81192a2863bb445a7bef872fc21b72:

  • Rust on fresh Ubuntu;
  • Rust on fresh Windows;
  • real storage smoke test;
  • legacy Python regression evidence;
  • repository-pinned Lean 4.32 integration.

The completed capability is statement fidelity only. It creates reviewed, role-separated, exact-lineage evidence with controlled report provenance and derived supersession status. It does not create proof authority or mathematical truth status.

Mnehmos added 2 commits July 19, 2026 15:29
Record issue #20 exact-tree CI completion and make issue #21 publication-profile proof authority the active controlled slice.
Bind publication candidates to exact evidence, formalization, environment, policy, Git, workflow, runner, isolation, and retention identities. Require OIDC and Sigstore provenance verification before any future authority promotion.
Mnehmos commented Jul 19, 2026
Copy link
Copy Markdown
Owner Author

Issue #21 contract slice is published.

This slice adds:

  • canonical publication policy hash 9cac0ae88eb00e84474ce9f7a2357b5b8677beb6e042d163f95c78a453c34a2b;
  • separate proof and refutation requests bound to exact evidence, formalization, environment, module, declaration, commit, and tree identities;
  • non-authoritative candidate reports that fail if required isolation, retention, workflow, runner, source, policy, or axiom controls are missing;
  • ADR-0006, which requires repository and workflow constrained GitHub OIDC and Sigstore attestation verification before promotion;
  • SHA-pinned actions/attest and artifact retention identities;
  • adversarial contract and schema tests.

Validation passed: warnings-denied Clippy, 79 Rust unit tests, real CLI and MCP subprocess tests, pinned Lean integration, 39 legacy Python regressions, formatting, and patch checks.

Remote commit: bb9cff8894bf43927c3106d8a452c9932c656460
Exact local and GitHub tree: ac36221dfb268fc0b60e0aabaf70bd31bae57699

No authoritative evidence or mathematical status exists in this slice. Protected candidate generation, attestation, verified ingestion, and promotion remain active.

Mnehmos commented Jul 19, 2026
Copy link
Copy Markdown
Owner Author

Publication authority contract checkpoint passed GitHub Actions run 29706570941 on exact tree ac36221dfb268fc0b60e0aabaf70bd31bae57699. All five jobs succeeded, including fresh Ubuntu, fresh Windows, real storage, legacy Python, and the pinned Lean integration.

Issue #21 remains open. This run validates the closed contracts and non-self-authority rules only. It does not establish isolated clean-checkout candidate generation, Sigstore attestation, verified ingestion, authoritative evidence, or mathematical status.

@Mnehmos
Mnehmos marked this pull request as ready for review July 19, 2026 22:45
@Mnehmos
Mnehmos merged commit 851a578 into main Jul 19, 2026
6 checks passed
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