evidence

Record one supporting or refuting observation against a belief. Mneva runs sequential probability ratio testing (SPRT) on the accumulated evidence — when the log-likelihood crosses the promote or demote threshold, confidence shifts and sprt_status flips.

This is how a belief earns its place over time. See Evidence (SPRT) for the math behind the thresholds.

Signature

evidence({
  belief_id: number,
  kind: 'supporting' | 'refuting',
  strength: number,           // 0.1..0.9 (clamped)
  note?: string
}) → {
  evidence_id: number,
  belief_id: number,
  kind: string,
  strength: number,
  log_likelihood: number,
  new_log_ratio: number,
  new_confidence: number,
  confidence_delta: number,
  status: 'accumulating' | 'promoted' | 'demoted',
  boundaries: { promote: number, demote: number }
}
ParamTypeRequiredDescription
belief_idintyesId of the belief.
kindenumyessupporting or refuting.
strengthnumber 0.1..0.9yesHow probative is the evidence. 0.1 weak, 0.5 moderate, 0.9 strong. Clamped to the range.
notestringnoWhat was observed. Optional but useful in the audit trail.

Example

Belief #1 is "the worker pool should be sized at 4 threads", confidence 0.6.

curl -X POST https://mneva.dev/v1/evidence \
  -H "x-mneva-key: $MNEVA_KEY" \
  -H "content-type: application/json" \
  -d '{
    "belief_id": 1,
    "kind": "refuting",
    "strength": 0.85,
    "note": "production needed 8 threads under load"
  }'

Response:

{
  "evidence_id": 2,
  "belief_id": 1,
  "kind": "refuting",
  "strength": 0.85,
  "log_likelihood": -1.7346,
  "new_log_ratio": -3.4692,
  "new_confidence": 0.4,
  "confidence_delta": -0.2,
  "status": "demoted",
  "boundaries": { "promote": 2.89, "demote": -2.25 }
}

This was the second refuting observation at strength 0.85. Each contributed ln(0.15/0.85) ≈ -1.735. Cumulative ratio is now -3.47, past the demote boundary (-2.25). Status flipped to demoted, confidence dropped by 0.20 (down to 0.40).

What the response means

  • log_likelihood — the contribution this evidence added to the SPRT accumulator.
  • new_log_ratio — the cumulative log ratio across all evidence on this belief.
  • confidence_delta — how much confidence moved on this call (0 if no boundary was crossed, +0.10 on promote, -0.20 on demote).
  • statusaccumulating (still between boundaries), promoted (past +2.89), or demoted (past -2.25).

Status only flips once per direction. The second demote-crossing evidence doesn't double-penalize; the audit trail in evidence_for still records every event.

See also

Was this page helpful?