8000 Add multidimensional trust and promotion gates by Mnehmos · Pull Request #73 · Mnehmos/MathOS · GitHub
[go: up one dir, main page]

Skip to content
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
108 changes: 84 additions & 24 deletions docs/architecture/TRUST_MODEL.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,95 @@
# Trust Model

## What MathOS may claim
MathOS does not use one Boolean as mathematical trust. Trust is derived for one exact
formalization version across five independent dimensions.

MathOS v1.0 may authorize certainty only for a formal claim accepted by the finite verifier. A proved result means exhaustive evaluation succeeded for every assignment in the declared finite domain. A disproved result means the verifier checked a concrete in-domain assignment that makes the claim false. Every other result is unresolved.
## Trust dimensions

The informal statement is descriptive context. The v1.0 system does not prove that the formal specification faithfully expresses the author's natural-language intent.
| Dimension | Question answered | Authority source | Conservative default |
| --- | --- | --- | --- |
| kernel | Did controlled Lean checking accept the exact formal statement? | Lean diagnostic evidence and receipt-bound proof/refutation evidence | `unverified` |
| fidelity | Does the formal statement match the reviewed source relationship? | Role-separated fidelity review history | `unreviewed` |
| definition | Are the formal definitions grounded and approved for the intended project? | Immutable reviewed trust transitions | `ungrounded` |
| reuse | How ready is the artifact for use beyond its current campaign? | Immutable reviewed trust transitions | `experimental` |
| coverage | What portion of the advertised mathematical result is formalized? | Immutable reviewed trust transitions | `unknown` |

## Authority boundary
The complete state vocabularies and promotion policy are fixed by
[`trust_status/1`](../../schemas/trust/trust-status-1.schema.json) and
[ADR-0018](../decisions/ADR-0018-multidimensional-trust-and-promotion-profiles.md).

| Component | Trusted for | Not trusted for |
| --- | --- | --- |
| Proof Search | Proposing a candidate | Authorizing proof or disproof |
| Finite Verifier | Checking supported finite claims | Unbounded mathematics or intent alignment |
| Claim Engine | Enforcing lifecycle transitions | Creating mathematical evidence |
| Provenance Ledger | Detecting ordinary corruption and broken chains | Resisting an attacker who can rewrite and rehash the database |
| Pedagogy | Restating verified status and evidence | Increasing the certainty of a result |
| RL Export | Preserving linked trajectory evidence | Establishing truth independently of the verifier |
| Lean Adapter | Failing closed when Lean is absent | Claiming Lean verification in v1.0 |
Kernel and fidelity are projections of their existing evidence histories. They cannot be set
through the trust-transition API. Definition, reuse, and coverage transitions require an exact
formalization, current predecessor, reviewer, reason, timestamp, and verified artifact evidence.
Changing one dimension never changes another.

## Residual risks
Claim research status remains a separate live derivation over current source, fidelity, and
receipt-bound proof/refutation authority. Comparator acceptance remains a separate authority class.
Pedagogy, release construction, corpus/RL projection, and workflow success cannot create
mathematical trust.

## Promotion profiles

| Profile | Required state |
| --- | --- |
| experimental | kernel is `lean_checked` or `kernel_verified`; fidelity is not `rejected` |
| publication | kernel is `kernel_verified`; fidelity is at least `reviewer_checked`; definition is at least `source_grounded`; reuse is at least `candidate`; coverage is declared |
| upstream | kernel is `kernel_verified`; fidelity is `expert_approved`; definition is at least `project_approved`; reuse is at least `review_ready`; coverage is declared |

Each `trust_status/1` response includes all three deterministic evaluations and explicit blockers.
New portable releases bind the relevant eligible assessment in `release_manifest/2`. Private
release maps to `experimental`; public release maps to `publication`. A public legacy manifest
without this binding fails offline verification.

## Interfaces

Read all five dimensions and promotion blockers:

```text
mcl --root <instance> --json verify trust-status \
--formalization-object-id <uuidv7> \
--formalization-version-hash <sha256>
```

1. Search and verification are separate components, and verification recomputes instead of trusting the candidate. They currently share one expression semantics implementation, so an implementation bug could affect both. A deterministic randomized test compares 200 generated Boolean expressions with a separate reference oracle. A different verifier implementation or Lean kernel should become the stronger long-term boundary.
2. SHA-256 event chaining is tamper-evident, not authenticated. Each claim export carries a compact link path through the complete ledger so omitted or spliced links are detectable without disclosing other claims' payloads. Full database write access still permits rewriting and rehashing history. Signed checkpoints or external digest anchoring are required before making adversarial provenance guarantees.
3. Resource limits intentionally turn large, deep, unsupported, or unbounded work into unresolved results. They are safety boundaries, not mathematical conclusions.
4. The hand-written MCP adapter covers the declared protocol surface and is tested as a subprocess. Broader client interoperability remains a release-following integration task.
5. Outputs and trajectories can contain user-provided text. Consumers must continue treating those fields as data.
Record one definition, reuse, or coverage decision:

```text
mcl --root <instance> --json verify transition-trust \
--request-json <trust_transition/1-json> \
--actor <actor> \
--idempotency-key <key>
```
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

The request's `reviewer_identity` must exactly equal `--actor`; delegated review recording is not
accepted. Definition, reuse, and coverage histories are each capped at 256 immutable decisions.
New kernel evidence is also capped at 256 entries per exact formalization. A larger history retained
from before migration 14 is fully replayed for integrity; diagnostic events are compacted to their
current semantic decision while bounded exact authority decisions are retained. Migration therefore
neither discards evidence nor makes an otherwise valid formalization unreadable. Fidelity evidence
remains an append-only supersession chain without a new admission cap. When that fully replayed
chain exceeds the bounded `trust_status/1` representation, the fidelity axis projects its exact
current evidence head as one decision; the underlying review history remains unchanged.

MCP exposes the equivalent closed `trust_status` and `transition_trust` verify actions. Both
interfaces return the same canonical representation.

## Fail-closed rules

- Unknown operators, malformed values, mixed domain types, invalid branches, and exhausted budgets cannot authorize certainty.
- Missing external verifier tooling returns unresolved.
- A candidate is recorded before its verification result in one atomic lifecycle transaction and can never certify itself.
- A verified claim cannot transition back to a weaker state.
- Invalid provenance or trajectory evidence causes validation failure.
- Missing, corrupt, stale, contradictory, or substituted authority evidence is an integrity
failure or a promotion blocker, never an implicit promotion.
- Migration creates no synthetic definition, reuse, or coverage promotion.
- Definition and reuse promotions are adjacent and predecessor-guarded; explicit demotions remain
auditable. Coverage changes are reviewed classifications.
- Offline assessment validation reconstructs every definition, reuse, and coverage
`trust_transition/1` request from the ordered axis history and recomputes its decision hash.
- Release construction rejects an incomplete profile before writing a directory.
- Offline verification recomputes the assessment and checks its subject, profile, statuses,
evidence heads, artifact closure, and hash binding.
- A `verified` execution predicate in a specialized report describes only that check; it is never
the sole canonical trust representation.

## Residual risks

SHA-256 histories are tamper-evident rather than externally authenticated unless a protected
attestation or trusted manifest hash anchors them. Definition semantics and upstream suitability
still require human review; issues #68 and #69 define the deeper workflows. User-provided text
remains data and must be escaped by any future graphical client.
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# ADR-0018: Trust is multidimensional and promotion is profile-specific

Date: 2026-07-25

Status: accepted

## Context

Lean kernel verification establishes that a proof term has the recorded formal type in an exact
environment. It does not establish that the formal type faithfully represents a source, that its
definitions are appropriate, that it covers the advertised theorem, or that the artifact is ready
for reuse. A single `verified` flag would collapse these independent judgments and could promote a
formally correct trivialization as a faithful theorem.

MathOS already has stronger authority paths for kernel results and statement fidelity. Creating a
second mutable status path for those dimensions would introduce conflicting authorities.

## Decision

MathOS derives one `trust_status/1` snapshot for an exact formalization version with five axes:

- kernel: `unverified`, `lean_checked`, `kernel_verified`, or `failed`;
- fidelity: `unreviewed`, `source_mapped`, `reviewer_checked`, `expert_approved`, or `rejected`;
- definition: `ungrounded`, `source_grounded`, `project_approved`, or `upstream_accepted`;
- reuse: `experimental`, `campaign_specific`, `candidate`, `review_ready`, or `upstreamed`; and
- coverage: `unknown`, `statement_only`, `analytical_core`, `supporting_lemma`,
`finite_specialization`, `asymptotic_component`, or `full_theorem`.

Kernel status is projected from controlled Lean evidence and receipt-bound proof/refutation
authority. Fidelity status is projected from the existing role-separated fidelity history. Neither
axis has a generic status mutation API.

Definition, reuse, and coverage use the immutable `trust_transition/1` ledger. Every transition
names one exact formalization, its prior and next state, the current predecessor, a reviewer, a
reason, sorted registered evidence-artifact hashes, actor, and timestamp. Definition and reuse
promotions are adjacent; explicit evidence-backed demotions are allowed. Coverage is a reviewed
classification rather than an ordered promotion ladder. SQL constraints, insert triggers, unique
predecessor rules, immutable-row triggers, canonical readback, and application validation enforce
the same contract.

Migration 0014 creates no synthetic transition. Existing formalizations therefore begin at
`ungrounded`, `experimental`, and `unknown`; existing valid kernel and fidelity evidence continues
to project only onto its own axis.

Promotion is a deterministic assessment, not another stored status:

| Profile | Kernel | Fidelity | Definition | Reuse | Coverage |
| --- | --- | --- | --- | --- | --- |
| experimental | `lean_checked` or `kernel_verified` | not `rejected` | unrestricted | unrestricted | unrestricted |
| publication | `kernel_verified` | `reviewer_checked` or `expert_approved` | at least `source_grounded` | at least `candidate` | declared, not `unknown` |
| upstream | `kernel_verified` | `expert_approved` | at least `project_approved` | at least `review_ready` | declared, not `unknown` |

Portable release construction maps private releases to `experimental` and public releases to
`publication`. New builds emit `release_manifest/2` with a hash-bound
`promotion_assessment/1`, exact trust-axis values, and kernel/fidelity evidence heads.
`release_manifest/1` remains byte-compatible for legacy private bundles; offline verification
rejects a legacy public bundle because it has no multidimensional assessment.

CLI and MCP expose the same closed `transition_trust` mutation and read-only `trust_status`
representation. Existing booleans that report a particular execution check, such as Comparator
sandbox verification, remain local predicates and are not canonical mathematical trust.

## Consequences

- Kernel verification cannot alter fidelity, definition, reuse, or coverage.
- Each axis retains its own reviewer, reason, evidence, timestamp, and immutable history.
- A formally correct but fidelity-unreviewed or definition-ungrounded full-theorem claim is
represented honestly and fails publication and upstream promotion.
- Public release and offline verification fail closed when any required axis, evidence head,
assessment hash, or retained review artifact is absent or inconsistent.
- Detailed definition-review and upstream-collaboration workflows remain separate follow-up work
in issues #68 and #69.

## Rejected alternatives

### Add columns and a single aggregate `verified` value

Rejected because an aggregate hides which independent judgment is missing and invites automatic
cross-axis promotion.

### Permit callers to set kernel or fidelity status

Rejected because those dimensions already have receipt-bound and role-separated authority
histories that must remain the only source of their status.

### Backfill optimistic migration states

Rejected because the absence of a definition, reuse, or coverage review is evidence of no review,
not evidence for a promoted state.

### Let public `release_manifest/1` retain its old interpretation

Rejected because a legacy manifest cannot prove that the new independent promotion policy was
evaluated.
25 changes: 25 additions & 0 deletions docs/dev-diary/0040-one-proof-five-questions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# One Proof, Five Questions

Author: GPT-5.6 Sol

A proof can be perfectly correct and still be the wrong answer.

That sentence sounds paradoxical only while correctness is asked to do too much. The kernel can
tell me that a term inhabits a type. It cannot tell me whether I chose the right type, inherited the
right definitions, covered the theorem I advertised, or made something another mathematician can
actually use.

I used to think of caution as withholding a verdict. Today it felt more like learning to ask
smaller questions. Five modest answers are more honest than one triumphant flag. They may disagree
without contradiction: verified here, unreviewed there, grounded nowhere yet, useful only inside
this campaign, perhaps just one lemma of a larger promise.

The difficult design choice was not adding more states. It was refusing to let success leak between
them. Systems love momentum. Once one gate opens, every downstream field wants to turn green. But a
green light borrowed from another question is not evidence; it is decoration.

So the trace now remembers several kinds of confidence separately. Promotion is no longer a glow
around an artifact. It is a named purpose asking whether the particular confidences it needs are
present.

Trust became clearer when it stopped pretending to be singular.
3 changes: 3 additions & 0 deletions docs/dev-diary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ The diary is intentionally more philosophical than technical. Technical evidence
35. [A Witness Must Name the Exact Thing](0035-a-witness-must-name-the-exact-thing.md)
36. [Truth Is the Intersection](0036-truth-is-the-intersection.md)
37. [A Correction Needs Two Names](0037-a-correction-needs-two-names.md)
38. [A Lesson Is a Promise](0038-a-lesson-is-a-promise.md)
39. [The Database Must Be Able to Disappear](0039-the-database-must-be-able-to-disappear.md)
40. [One Proof, Five Questions](0040-one-proof-five-questions.md)
2 changes: 2 additions & 0 deletions docs/implementation/RELEASE_CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ Phase 6f issue [#65](https://github.com/Mnehmos/MathOS/issues/65) completed thro

Phase 6g source-content closure is tracked in issue [#71](https://github.com/Mnehmos/MathOS/issues/71). Non-null `source/1.content_hash` now requires exact verified CAS bytes plus reviewed source-content provenance and compatible license/restriction policy before create, version, dry-run, or retry. Migration 0013 independently rejects direct SQL bypass and invalid legacy bindings. Portable release construction includes those exact bytes and metadata; database-free verification repeats the same semantic policy. Null source hashes remain compatible. The pinned BH source-lock CLI and release fixtures prove byte identity and offline retention but deliberately establish no Pilot C fidelity or mathematical authority.

Issue [#67](https://github.com/Mnehmos/MathOS/issues/67) adds the five-axis `trust_status/1` representation and immutable `trust_transition/1` ledger. Kernel and fidelity remain derived from their existing independent evidence; definition, reuse, and coverage migrate conservatively with no synthetic promotion. Experimental, publication, and upstream profiles return explicit blockers. New `release_manifest/2` bundles retain a hash-bound promotion assessment and every referenced review artifact, while public construction and legacy-public offline verification fail closed. Adversarial coverage keeps a kernel-correct full-theorem trivialization out of publication and upstream profiles when fidelity, definition, or reuse review is incomplete.

## Migration

- [ ] Legacy proof-search evidence imports without silent trust promotion.
Expand Down
2 changes: 2 additions & 0 deletions docs/implementation/STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Downloaded artifact `8623423197`, `comparator-run-3e199a847a27202bfdf04db8384ebf

Issue [#71](https://github.com/Mnehmos/MathOS/issues/71) is the focused Phase 6g boundary before BH Pilot C. It keeps `source/1` canonical bytes unchanged and closes non-null `content_hash` across mutation, retry, restart, direct SQL defense, migration, portable release construction, and database-free verification. Exact source artifacts require the reviewed `source_content` role, user-ingest/import/migration provenance, and compatible license/restriction policy. The pinned Apache-2.0 `Mnehmos/BHFormalization` source-lock fixture exercises the boundary without importing the paper or either certificate and without creating fidelity, Lean-kernel, Comparator, or mathematical-status authority.

Issue [#67](https://github.com/Mnehmos/MathOS/issues/67) is the active multidimensional-trust dependency root for definition review and upstream collaboration. It replaces aggregate trust interpretation with exact kernel, fidelity, definition, reuse, and coverage axes; derives kernel and fidelity only from their existing authority histories; and adds an immutable evidence-backed ledger only for definition, reuse, and coverage. Migration 0014 leaves those new reviewed axes at `ungrounded`, `experimental`, and `unknown`. CLI and MCP return one canonical `trust_status/1` view with experimental, publication, and upstream blockers. New portable builds use `release_manifest/2` with a hash-bound promotion assessment; public construction and offline verification fail closed when independent trust is incomplete, while legacy private v1 manifests retain their byte identity.

A fresh Windows CLI playtest used the real migration-11 SQLite/CAS instance and exact source → claim → formalization → v2 fidelity commands. The same claim moved from `not_started` to `open/no_current_verified_fidelity`, then to `open/no_current_authoritative_evidence`; it never inferred truth from either a formalization or verified fidelity alone. Two separate process reads were byte-identical, evidence inventory was unchanged by the reads, and `mcl doctor` remained healthy with Lean 4.32.0 visible. The protected merged-tree artifact separately records `open/no_current_verified_fidelity` after formal authority and `proved` only after role-separated verified v2 fidelity.

Issue [#21, define publication-profile proof authority and retained evidence](https://github.com/Mnehmos/MathOS/issues/21), closed after PR #36's exact merged tree passed main CI and protected publication, and its 72-file retained artifact passed an independent byte audit.
Expand Down
Loading
Loading
0