Skip to main content

Module evidence_diff

Module evidence_diff 

Source
Expand description

Evidence Diff: the before/after lens over a claim’s state.

Two derived projections, both read-only over the accepted event log — they never write, never store, and mint no new event kinds:

  • state_cell — the Claim-State Cell (STATE_PLANE_MEMO §7.1): claim, context, Belnap-style status, status provenance (support/refute id sets), supersession, dependencies, open obligations, priority. This is the pure core relocated out of the CLI so the hub can compute the identical cell.
  • claim_state_delta — applies one pending proposal in-memory (the same apply_proposal the preview uses, never saved) and reports the target claim’s state before and after, plus the downstream claims whose status letter flips as a result. This is the integrating lens behind the Evidence Diff page: “what changed, what broke, what should be reviewed next.”

The Engine verdict (“what would CI say if accepted?”) is deliberately NOT computed here: evidence_ci::run_project needs a frontier path (policy docs, artifact files), which the hub’s Postgres-materialized project does not have. The CLI caller, which holds the path, merges in proposals::preview_engine_verdict; the hub renders engine as absent (the real strict gate runs at accept time and returns 422 on refusal).

Functions§

claim_state_delta
The integrating Evidence-Diff lens: apply one pending proposal in-memory (never saved) and report the target claim’s state cell before and after, plus the downstream claims whose status letter flips as a result.
derive_status_provenance
Gap 2: derive the support/refute provenance sets for a finding from its event history — a READ-SIDE projection, computed at projection time and never stored. Zero reducer or state changes.
derive_status_provenance_tiered
Visibility-aware derive_status_provenance: every support/refute variable is tagged with tier (the access tier of the finding whose status this is), so StatusProvenance::derive_public_support(clearance) can later project out the private derivations. tier = Public leaves variables bare and is byte-identical to the untagged path (so the canonical finding-effects digest and every cross-impl fixture are unaffected — visibility lives only in the derived projection, never in stored state). This is how “private memory is not public truth” becomes enforced rather than assumed.
find_priority_registration
The priority registration for a finding (gap 5). Prefers the exact finding-to-registration edge (payload.finding_id, stored on StatementRegistration.finding_id); falls back to the original heuristic (statement hash equals the claim digest, or the informal_ref names the finding id) for registrations that predate the edge. Returns the registration plus how it matched.
matched_attachments
The verifier attachments bound to this finding’s CURRENT claim. Cloned (owned) to match derive_gate_status’s &[VerifierAttachment].
state_cell
Derive the Claim-State Cell — a projection over the event log, never a stored object. (STATE_PLANE_MEMO §7.1.)