Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9955de5
feat: derive scope-bound hard and soft negative insights
TheDarkLightX Nov 15, 2026
6092679
feat: type explanatory soft negatives independently of checker receipts
TheDarkLightX Nov 15, 2026
ea51bce
feat: strict admission for structured soft negatives
TheDarkLightX Nov 15, 2026
170fa16
feat: append soft negative records and require dependency review
TheDarkLightX Nov 15, 2026
e7e8773
feat: MCP tools for structured negative logging and maximal-informati…
TheDarkLightX Nov 15, 2026
6a0614e
test: scope-bound negativity, checked provenance, soft nonauthority, …
TheDarkLightX Nov 15, 2026
ecb3681
test: MCP soft-negative input validation, read filtering and authorit…
TheDarkLightX Nov 15, 2026
47378e3
fix: cover negative-memory in functional-core source pin
TheDarkLightX Nov 15, 2026
27fbe70
chore: regenerate exact functional-core pin for typed negativity
TheDarkLightX Nov 15, 2026
3d3ea11
docs: scope, proof obligations and maximal-informativeness contract
TheDarkLightX Nov 15, 2026
31c0823
docs: explain typed negatives and bounded information reuse
TheDarkLightX Nov 15, 2026
4b5f05e
docs: explain typed negatives and bounded information reuse
TheDarkLightX Nov 15, 2026
1187324
feat(python): preserve structured failed approaches without invented …
TheDarkLightX Nov 15, 2026
1598635
feat(python): expose typed soft-negative record and retrieval MCP tools
TheDarkLightX Nov 15, 2026
6caf6b3
test(python): soft record retrieval, no hard authority and legacy cou…
TheDarkLightX Nov 15, 2026
431e6b0
ui: show checked versus reported failures and reopening triggers
TheDarkLightX Nov 15, 2026
d52b463
docs: clarify Python stdio soft negatives and hosted checked boundary
TheDarkLightX Nov 15, 2026
5c34e89
docs: clarify Python stdio soft negatives and hosted checked boundary
TheDarkLightX Nov 15, 2026
5716c3c
fix: search all historical negative memory before ranking and limiting
TheDarkLightX Nov 15, 2026
b209de8
test: prevent 1000 unrelated newer risks from hiding historical negat…
TheDarkLightX Nov 15, 2026
17272e4
fix(hosted): apply 256-bit arithmetic bound symmetrically to magnitudes
TheDarkLightX Nov 15, 2026
66a2cfb
fix(hosted): allow role updates for existing invitations at 30-accoun…
TheDarkLightX Nov 15, 2026
8c63746
test(hosted): signed 256-bit boundary and invitation replacement at c…
TheDarkLightX Nov 15, 2026
3860dd9
chore: pin exact checker after review fixes
TheDarkLightX Nov 15, 2026
e77efa9
chore: pin exact functional core after review fixes
TheDarkLightX Nov 15, 2026
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ The MCP exposes the compact tool surface from the design spec:
support evidence, a refutation attempt, dependencies, provenance, contradiction
search, replay evidence when required, and a rationale.

The hosted companion adds structured **negative discovery memory**: hard negatives are derived only from source-pinned bounded checker counterexamples for the exact tested recipe and original revision; soft negatives preserve attempted approaches, root causes, representation changes and conditions for revisiting them. `rk_negative_record` never grants proof authority. Its read path, `rk_negative_memory`, returns both with deterministic information-completeness triage and explicit generalization obligations. See [docs/NEGATIVE_MEMORY_CONTRACT.md](docs/NEGATIVE_MEMORY_CONTRACT.md). The Python stdio MCP also exposes `rk_negative_record` and `rk_negative_memory`, using the same soft-negative discovery fields. It has no independently trusted bounded-check receipt verifier, so even a user-asserted `rk_refute(counterexample_is_actual=true)` is **soft** for negative-memory reuse; the legacy refutation status and promotion rules are unchanged. This feature does not silently grant the Python kernel new proof authority.

The Python server now also exposes `rk_negative_record` (reasoned failure, scope, assumptions, reported witness, possible generalization, alternative representation, revisit conditions) and `rk_negative_memory` (historical retrieval and next validation action). Both are advisory; no proof certificate or pruning power is inferred.

`rk_refute` treats `counterexample` text as planning context unless
`counterexample_is_actual=true` is set. Actual counterexamples create a
`COUNTEREXAMPLE` atom, add a `REFUTES` edge, and mark the target `REFUTED`.
Expand Down
145 changes: 145 additions & 0 deletions docs/NEGATIVE_MEMORY_CONTRACT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# Typed negative memory and maximally informative failures

This contract is an **additive research feature**, not an independent mathematical proof
engine. The Python stdio kernel and the hosted companion have distinct trust boundaries.
This document describes the hosted companion's authoritative behavior.

## Two kinds of negative memory

| Class | Origin | Authority | Sound automatic exclusion |
| --- | --- | --- | --- |
| **Hard** | A stored `integer-grid/v1` receipt with `outcome=counterexample` and the exact source/revision/transcript pins | `bounded-check-only` | **Only the exact checked equation/recipe at that revision and on the specified finite grid**, assuming the pinned checker is trusted |
| **Soft** | A structured `rk_negative_record` or legacy user-supplied negative evidence | `unverified` | **None**; may request review or guide the next experiment |

A manually typed proof, a claimed impossibility, an LLM inference, a source quotation,
and a witness **not yet replayed by the checker** are all soft. This also applies
to evidence carrying an artifact hash. Hashes establish byte identity, not truth.

Hard negativity is derivable from a receipt
`r=(revision, recipe, checker, transcript, witness, environment)`:

```text
r.outcome = counterexample
=> exists x in the checked grid: eval(left,x) != eval(right,x)
```

This cannot be promoted to a theorem about an unbounded domain, to a
candidate family, or to another encoding or revision without a **separate proof**.

The original revision and scope remain in the evidence history. A corrected
revision can pass while its historical hard/soft negatives remain queryable.

## What makes a failed attempt maximally informative?

The goal is to extract as much **sound, reusable information** from failure as
possible, *not* to maximize the number of candidates speculatively rejected.

Every proposed negative lesson should answer:

1. **What was tried?** Exact candidate, language/representation and selection criterion.
2. **Under which assumptions/domain?** Record the original version and scope.
3. **What failed, exactly?** Root cause or an honest unresolved hypothesis.
4. **What was observed?** Reproducible input/output witness, trace, or reason to doubt the attempt.
5. **What follows deductively?** Explicitly separate checked exclusion from unproved extrapolation.
6. **Could it generalize?** Specify the candidate family and *new proof obligation* (e.g. SMT unsat core, interpolation, quantified lemma, verified reduction).
7. **When should it be reopened?** Changed assumptions, improved representations, new solvers, stronger oracles.
8. **How would the next test increase knowledge?** Witness minimization, stronger lemma, counterexample search, or a representation shift.

In particular, a single failing program `p` at input `x` never entails
`forall q in C: q fails`. A family-level exclusion requires a checked proof
that each `q in C` fails **within the same declared scope**, with its own
evidence and dependency lineage.

The hosted `rk_negative_memory` tool now returns `insights` sorted by a
deterministic **information-completeness triage rank** (checked receipt first,
then documented fields). It also returns `missing` fields and a
`nextBestAction`. The rank is *not* proof strength, measured Shannon
information, scientific truth, or a guarantee of an optimal lesson.

## Example: missing cross term

For a checked finite-grid equation

```
(x+y)^2 == x^2+y^2
```

the checker finds a mismatching pair such as `x=-5, y=-5`. It supports a
hard exclusion of that exact checked recipe on the finite grid. It does **not**
establish that every additive-only model is impossible.

Separately, the researcher can record a soft hypothesis that "the language is
missing an interaction feature", propose the alternative representation `x*y`,
and specify the trigger "revisit after adding product terms". The same
observation becomes actionable **without** impersonating a proof.

## API

`rk_negative_record` is a version-checked, append-only mutation bound to a
claim's **current** revision hash. It takes a `record` object:

```json
{
"attempt": "Try eliminating the cross term",
"failureReason": "The expression disagrees on mixed-sign inputs",
"scope": "Two-variable additive-only feature language",
"assumptions": "Integer inputs; no products",
"observedCounterexample": "A reported input pair (unverified)",
"candidateGeneralization": "All additive-only encodings may fail (unproved)",
"alternativeRepresentation": "Introduce x*y",
"revisitWhen": ["When the feature language permits products"]
}
```

It also requires the standard `workspaceId`, `expectedRevision`,
`requestId`, `claimId`, `expectedHash`, `uri` (possibly empty), and
`artifactHash` (possibly null). The server **always** records this as
`classification=soft`, `authority=unverified`; it cannot accept a
caller-declared hard classification.

`rk_negative_memory(workspaceId, query?, classification?)` returns previous
`claims`, `counterexamples`, `negativeEvidence` fields for compatibility,
plus `insights` containing exact historical scope, both soft/hard classes,
evidence provenance, safe exclusion boundary, information gaps, potential
representation shifts and revisitation conditions.
`classification` is `all` (default), `hard`, or `soft`.

Legacy negative evidence with only a summary remains searchable as **soft**.
Unverified negative records request transitive dependent review, as before,
but never change a source claim's bounded-check status or synthesize a proof.
The snapshot and event journal preserve the original append-only evidence.

## Python stdio MCP compatibility

The Python stdio kernel also exposes `rk_negative_record` and
`rk_negative_memory`. Its typed soft record is stored as a `RISK` atom
with `negative_memory/v1` metadata, linked through `TESTS`, and does not
refute its target. Existing `rk_refute` calls are retained without changing
their historical status transitions.

Unlike the hosted checker, the Python kernel has **no machine-validated
counterexample receipt in this interface**. Therefore even an old
`counterexample_is_actual=true` entry remains a reported **soft** negative
for retrieval; querying for `hard` there returns no results. The caller's
flag cannot turn an assertion into a theorem.

The two interfaces use different storage, version guards, and schemas.
They do not sync automatically. Both preserve the difference between
unverified hypotheses and checked evidence.

## Limitations and next research steps

- The integer-grid checker reports a **deterministic first mismatch**, not a
minimum-size witness; minimization is a separate task.
- No automatic SMT/Lean certificate for class-wide impossibility exists in
this pilot. Such an extension must verify proofs before widening pruning.
- No automatic proof that a negative result transfers through an abstraction,
encoding, or representation shift is provided.
- No correctness guarantee is attached to the triage rank or a suggested
scientific next step.
- The functional-core source pin includes the negative-memory evaluator.
Previously stored journals require their exact original source version for
replay; the new pin does not retroactively verify older journals.

See the hosted regression tests for old revision retention, strict soft
admission, lack of authority escalation, and bounded checker provenance.
3 changes: 2 additions & 1 deletion hosted/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ Private, Site-hosted scientific memory, implemented using functional core / impe
- Transitive review flags after dependency revision, checker failure or a current-revision negative evidence assertion. An unverified objection requests review without changing its source claim’s checker verdict. Old receipts remain tied to their original revisions.
- Owner-selected CC BY 4.0 packages with canonical digests. Catalog access follows the Site audience. Exporting a package makes an intentionally shareable file; withdrawing cannot recall previously exported copies.
- Failure memory searches every claim revision, scope and negative evidence summary. Corrected claims retain earlier counterexamples with the original recipe, assumptions and receipt; old failures do not determine the current revision’s status.
- Two typed negative-memory views: hard negatives derived only from pinned checker counterexamples for the exact tested recipe; soft negatives record failed approaches, root causes, original assumptions, hypotheses about broader failure, alternative representations and reopen triggers. `rk_negative_record` stores soft lessons; `rk_negative_memory` reports both and recommends the next validation action without authorizing general pruning. See [negative-memory contract](../docs/NEGATIVE_MEMORY_CONTRACT.md).
- Imported claims start unverified; external receipts never become local checker authority.
- A non-transferable, non-monetary contribution ledger. The first pass or counterexample for a recipe/checker/outcome gets one point per workspace. Identical replays receive no additional points. Usage counts prepare a hosted service for future billing; this pilot charges nothing.
- Owner-only private snapshot/journal exports and exact pinned-core replay checks. Exported backups include identities and must remain private.
- 17 stateless Streamable HTTP MCP tools at POST /mcp, plus a MCP App resource with sidebar and conversation-panel entrypoints. Browser WebMCP adapters use the same operations.
- 18 stateless Streamable HTTP MCP tools at POST /mcp, plus a MCP App resource with sidebar and conversation-panel entrypoints. Browser WebMCP adapters use the same operations.

## FCIS boundary

Expand Down
21 changes: 21 additions & 0 deletions hosted/components/research/claim-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ArrowLeft, ArrowUpRight, Check, Circle, GitBranch, History, Play, Plus,
import { Button } from "@/components/ui/button";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { current, claimStatus, hasFailureHistory, hasNegativeEvidence, type Claim, type Receipt, type Workspace } from "@/lib/core/model";
import { negativeInsights } from "@/lib/core/negative-memory";

export const kindNames = { hypothesis: "Hypothesis", literature: "Literature assertion", experiment: "Experimental result", formal: "Formal proof claim", bounded: "Bounded integer claim" };
const statusNames = { unverified: "Unverified", "bounded-checked": "Bounded check passed", counterexample: "Counterexample", "needs-review": "Needs review" };
Expand Down Expand Up @@ -31,6 +32,7 @@ export function ClaimDetail({ workspace, claim, canWrite = false, owner = false,
const receipts = workspace.receipts.filter(r => r.claimId === claim.id && r.claimRevision === revision.hash);
const evidence = workspace.evidence.filter(e => e.claimId === claim.id && e.revisionHash === revision.hash);
const status = claimStatus(workspace, claim);
const negativeLessons = negativeInsights(workspace).filter(i => i.claimId === claim.id);
return <section className="claim-detail" aria-label="Claim inspector">
<div className="inspector-heading"><Button className="back-to-list" variant="ghost" size="sm" onClick={() => { onBack(); requestAnimationFrame(() => document.getElementById("claim-" + claim.id)?.focus({ preventScroll: true })); }}><ArrowLeft />Back to claims</Button><span>{kindNames[revision.kind]}</span><span className="mono">r{revision.number}</span></div>
<div className="inspector-title"><h2 ref={headingRef} tabIndex={-1}>{revision.title}</h2><div className="toolbar"><Status value={status} />{hasFailureHistory(workspace, claim) && <span className="history-note"><History size={13} />Failure history retained</span>}</div>
Expand All @@ -54,6 +56,25 @@ export function ClaimDetail({ workspace, claim, canWrite = false, owner = false,
</TabsContent>
<TabsContent value="history" className="inspector-content">
<p className="muted-copy history-intro">Earlier failures stay with the revision they tested. They do not determine the current revision’s status.</p>
{negativeLessons.length > 0 && <section className="record-section" aria-label="Reusable negative lessons">
<h3>Reusable negative lessons <span>{negativeLessons.length}</span></h3>
{negativeLessons.map(n => <article className="evidence" key={n.id}>
<span className="badge">{n.classification === "hard" ? "Hard · checked finite witness" : "Soft · unverified explanation"}</span>
<p>{n.failureReason}</p>
<p className="muted-copy">Original scope: {n.originalScope}</p>
<p className="muted-copy">Pruning: {n.exclusion.safeToPrune ? "Only the exact checked recipe" : "Not authorized"}. Never generalized automatically.</p>
<details className="disclosure"><summary>Discovery value & conditions for reuse</summary>
<p>Attempt: {n.attempt}</p><p>Assumptions: {n.assumptions || "Not specified"}</p>
{n.checkedWitness && <p>Checked witness: {JSON.stringify(n.checkedWitness)}</p>}
{n.reportedWitness && <p>Reported witness (unverified): {n.reportedWitness}</p>}
{n.candidateGeneralization && <p>Unproved generalization: {n.candidateGeneralization}</p>}
{n.alternativeRepresentation && <p>Alternative representation: {n.alternativeRepresentation}</p>}
{n.revisitWhen.length > 0 && <p>Revisit when: {n.revisitWhen.join("; ")}</p>}
<p>Next research action: {n.information.nextBestAction}</p>
<p className="form-hint">Information rank is discovery triage, not a truth score.</p>
</details>
</article>)}
</section>}
<div className="timeline">{claim.revisions.slice().reverse().map(r => <article className="timeline-item" key={r.hash}><div className="timeline-heading"><h3>Revision {r.number}</h3>{r.number === revision.number && <span className="badge">Current</span>}<time>{r.createdAt.slice(0, 10)}</time></div><p className="detail-text">{r.statement}</p><details className="disclosure"><summary>Scope, assumptions & recipe</summary><p>Scope: {r.scope}</p><p>Assumptions: {r.assumptions || "None recorded"}</p>{r.recipe && <pre>{JSON.stringify(r.recipe, null, 2)}</pre>}<code>{r.hash}</code></details>{workspace.receipts.filter(v => v.claimId === claim.id && v.claimRevision === r.hash).map(receipt => <ReceiptCard key={receipt.id} receipt={receipt} />)}{workspace.evidence.filter(e => e.claimId === claim.id && e.revisionHash === r.hash).map(e => <div className="evidence" key={e.id}><span className="badge">{e.kind} · unverified</span><p>{e.summary}</p><code>{e.uri}</code></div>)}</article>)}</div>
</TabsContent>
</Tabs>
Expand Down
2 changes: 1 addition & 1 deletion hosted/lib/checker-pin.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Generated from exact checker source bytes.
export const CHECKER_SOURCE_SHA256 = "9fc12f8d3e7fc5f353f40dc8cc3b30a46fb778a02c5e25fdd693bb070bbf0c09";
export const CHECKER_SOURCE_SHA256 = "fd1ef0a3eff34d5f1d62bba076d62e93c834649b98d339a3013037f1549cc1be";
4 changes: 3 additions & 1 deletion hosted/lib/core/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ function evaluate(e: Expr, inputs: Record<string, number>): bigint {
case "^": if (b < 0n || b > 8n) throw new Error("Exponent must be in 0..8."); r = a ** b; break;
default: throw new Error("Unsupported operator.");
}
if (r.toString(2).length > 256) throw new Error("Arithmetic exceeds the 256-bit bound.");
// Count magnitude bits, not the '-' sign. A negative value of magnitude
// exactly 256 bits must obey the same bound as its positive counterpart.
if ((r < 0n ? -r : r).toString(2).length > 256) throw new Error("Arithmetic exceeds the 256-bit bound.");
return r;
}
export function checkRecipe(recipe: Recipe, hash: (value: string) => string): CheckResult {
Expand Down
9 changes: 8 additions & 1 deletion hosted/lib/core/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ export type ClaimRevision = ClaimInput & {
dependencyHashes: Record<string, string>;
};
export type Claim = { id: string; revisions: ClaimRevision[]; needsReview: boolean; importedFrom: string | null };
export type Evidence = { id: string; claimId: string; revisionHash: string; kind: "source" | "experiment" | "formal" | "negative"; uri: string; summary: string; artifactHash: string | null; author: string; createdAt: string; authority: "unverified" };
// Explanatory, non-authoritative failure records: checkable conclusions must come from receipts.
export type SoftNegative = {
attempt: string; failureReason: string; scope: string; assumptions: string;
observedCounterexample: string; candidateGeneralization: string;
alternativeRepresentation: string; revisitWhen: string[];
};
export type Evidence = { id: string; claimId: string; revisionHash: string; kind: "source" | "experiment" | "formal" | "negative"; uri: string; summary: string; artifactHash: string | null; author: string; createdAt: string; authority: "unverified"; negative?: SoftNegative };
export type Receipt = {
id: string; claimId: string; claimRevision: string; recipeHash: string;
checker: string; checkerSourceHash: string; transcriptHash: string;
Expand All @@ -36,6 +42,7 @@ export type Command =
| { type: "addClaim"; claim: ClaimInput }
| { type: "reviseClaim"; claimId: string; expectedHash: string; claim: ClaimInput }
| { type: "attachEvidence"; claimId: string; expectedHash: string; kind: Evidence["kind"]; uri: string; summary: string; artifactHash: string | null }
| { type: "recordNegative"; claimId: string; expectedHash: string; record: SoftNegative; uri: string; artifactHash: string | null }
| { type: "checkClaim"; claimId: string; expectedHash: string }
| { type: "publishClaim"; claimId: string; expectedHash: string }
| { type: "revokePublication"; publicationId: string }
Expand Down
Loading
Loading