8000 Derive live claim research status by Mnehmos · Pull Request #39 · Mnehmos/MathOS · GitHub
[go: up one dir, main page]

Skip to content

Derive live claim research status - #39

Merged
Mnehmos merged 3 commits into
mainfrom
feat/issue-38-derived-claim-status
Jul 21, 2026
Merged

Mnehmos merged 3 commits into
mainfrom
feat/issue-38-derived-claim-status

Conversation

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

Outcome

Derive one exact claim version's live research status from independently revalidated statement fidelity and protected formal authority. No caller can set or persist proved/disproved.

Trust boundary

  • preserves fidelity v1 bytes and hashes
  • adds closed polarity-aware fidelity request/report v2
  • enumerates every current formalization automatically
  • rehashes exact source, claim, formalization, fidelity CAS, and receipt-bound authority closure
  • captures and rechecks relevant Store identities to reject mixed-time reads
  • exposes the same read through CLI claim-status and MCP claim_status with no evidence/status selectors
  • retains protected-main CLI evidence before and after role-separated fidelity

Local evidence

  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test --workspace --all-targets: 148 tests passed
  • real pinned Lean integration passed with Lean 4.32.0
  • python -m pytest: 39 passed
  • normalized Bash syntax passed
  • actionlint 1.7.12 passed
  • cargo fmt check and git diff check passed
  • fresh migration-11 Windows CLI playtest moved not_started -> open/no_current_verified_fidelity -> open/no_current_authoritative_evidence; repeat reads were byte-identical and read-only

Remaining protected gate

After merge, the protected publication workflow must retain a real open status after authority and a proved/disproved status only after a separate verified v2 fidelity review. Issue #38 remains open until that exact merged-tree artifact is independently audited.

Refs #38

Summary by CodeRabbit

  • New Features

    • Added read-only claim research status verification through both CLI and MCP interfaces.
    • Added polarity-aware fidelity review support for claims and logical negations.
    • Added status reporting with proof/refutation witnesses and detailed nonqualification reasons.
    • Added strict validation for versioned fidelity requests, reports, and claim-status responses.
    • Publication ingestion now verifies status before and after protected fidelity review.
  • Documentation

    • Updated trust, implementation, release checklist, and development diary documentation for derived claim status and fidelity workflows.

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

Review Change Stack

📝 Walkthrough

Walkthrough

Adds versioned polarity-aware fidelity contracts and a live, integrity-checked claim research status read model. The status is exposed through shared CLI and MCP verification paths, with protected publication-ingestion validation and updated schemas, tests, and implementation documentation.

Changes

Claim research status

Layer / File(s) Summary
Versioned fidelity and status contracts
src/domain/fidelity.rs, src/domain/research_status.rs, schemas/fidelity/*, schemas/research/*, docs/decisions/*, docs/trust/FIDELITY.md
Adds fidelity request/report v2 models, polarity binding, versioned wrappers, research-status snapshots, validation, and JSON schemas.
Integrity-checked status derivation
src/store/mod.rs, src/app.rs
Captures bounded current lineage and evidence, replays fidelity and authority records, validates canonical artifacts, rechecks read bases, and derives witnesses and status values.
CLI and MCP read-only surfaces
src/cli/mod.rs, src/mcp/mod.rs, tests/mcp_stdio.rs, tests/phase1_cli.rs
Adds claim-status and claim_status, versioned fidelity parsing, strict field-presence handling, capability metadata, and parity/error coverage.
Protected publication workflow
scripts/publication-ingest.sh
Runs claim-status before and after protected fidelity review and validates the resulting status, witness, evidence, and receipt hashes.
Implementation records
docs/implementation/*, docs/dev-diary/*
Updates Phase 3 status and release records and adds the “Truth Is the Intersection” diary entry.

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

Possibly related issues

Possibly related PRs

  • Mnehmos/MathOS#34 — Extends the protected publication-ingestion workflow introduced there with fidelity review and post-fidelity claim-status validation.

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant MCP
  participant Application
  participant Store
  participant CAS
  CLI->>Application: Request claim status by exact claim identity
  MCP->>Application: Request claim_status by exact claim identity
  Application->>Store: Capture current claim and evidence basis
  Store->>CAS: Read and validate canonical artifacts
  CAS-->>Store: Fidelity and authority artifacts
  Store-->>Application: Bounded replay basis
  Application->>Store: Recheck basis
  Store-->>Application: Stable basis or integrity error
  Application-->>CLI: Research status snapshot
  Application-->>MCP: Research status snapshot
Loading
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 29.93% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description covers outcome and evidence, but it omits most required template sections like Summary, Change class, TDD, verification, provenance, risk, and review readiness. Rewrite the description using the repository template and fill in all required sections, especially change class, TDD evidence, verification, provenance, risk, and review readiness.
✅ Passed checks (3 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 is concise and accurately describes the main change: deriving live claim research status.
✨ 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/issue-38-derived-claim-status

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 18:00
@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: b80a702902

ℹ️ 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 src/app.rs Resolved
@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.

🧹 Nitpick comments (1)
src/domain/fidelity.rs (1)

155-171: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Add an exact-match parser test for VersionedFidelityReviewReport #[serde(untagged)] relies on the v1 structs’ #[serde(deny_unknown_fields)] to keep v2-shaped payloads from falling back to v1 and dropping reviewed_source_relation. The request wrapper already has this invariant covered; the report wrapper should too.

🤖 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 `@src/domain/fidelity.rs` around lines 155 - 171, The report wrapper lacks
coverage ensuring v2-shaped JSON is parsed as VersionedFidelityReviewReport::V2
rather than falling back to V1 and dropping reviewed_source_relation. Add an
exact-match parser test for VersionedFidelityReviewReport using a v2 payload,
and assert the parsed value equals the expected V2 report; follow the existing
request-wrapper invariant test.
🤖 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.

Nitpick comments:
In `@src/domain/fidelity.rs`:
- Around line 155-171: The report wrapper lacks coverage ensuring v2-shaped JSON
is parsed as VersionedFidelityReviewReport::V2 rather than falling back to V1
and dropping reviewed_source_relation. Add an exact-match parser test for
VersionedFidelityReviewReport using a v2 payload, and assert the parsed value
equals the expected V2 report; follow the existing request-wrapper invariant
test.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 44cb1080-f81e-4a06-839b-05f79d8299e3

📥 Commits

Reviewing files that changed from the base of the PR and between fe60adf and b80a702.

📒 Files selected for processing (19)
  • docs/decisions/ADR-0008-live-polarity-aware-claim-research-status.md
  • docs/dev-diary/0036-truth-is-the-intersection.md
  • docs/dev-diary/README.md
  • docs/implementation/RELEASE_CHECKLIST.md
  • docs/implementation/STATUS.md
  • docs/trust/FIDELITY.md
  • schemas/fidelity/fidelity-review-report-2.schema.json
  • schemas/fidelity/fidelity-review-request-2.schema.json
  • schemas/research/claim-research-status-1.schema.json
  • scripts/publication-ingest.sh
  • src/app.rs
  • src/cli/mod.rs
  • src/domain/fidelity.rs
  • src/domain/mod.rs
  • src/domain/research_status.rs
  • src/mcp/mod.rs
  • src/store/mod.rs
  • tests/mcp_stdio.rs
  • tests/phase1_cli.rs

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

Addressed the CodeRabbit parser-coverage note in 849dce0. The versioned parser test now constructs a complete fidelity_review_report/2 value, parses it through VersionedFidelityReviewReport, and asserts exact equality with the V2 variant, preventing any silent fallback to V1. The targeted regression test passes locally.

@Mnehmos
Mnehmos merged commit 8e65549 into main Jul 21, 2026
6 checks passed
@Mnehmos
Mnehmos deleted the feat/issue-38-derived-claim-status branch July 21, 2026 18:18
@coderabbitai coderabbitai Bot mentioned this pull request Jul 21, 2026
20 of 27 tasks
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