Skip to content

feat(counterfactual): traceClaimDependencies — structural deltas with derivations (26 CF.1)#174

Closed
bryanmatthewsimonson wants to merge 1 commit into
claude/phase-26-h4-llm-edge-suggestfrom
claude/phase-26-cf1-counterfactual
Closed

feat(counterfactual): traceClaimDependencies — structural deltas with derivations (26 CF.1)#174
bryanmatthewsimonson wants to merge 1 commit into
claude/phase-26-h4-llm-edge-suggestfrom
claude/phase-26-cf1-counterfactual

Conversation

@bryanmatthewsimonson

Copy link
Copy Markdown
Owner

Summary

Phase-26 slice CF.1 (COUNTERFACTUAL_DESIGN.md §2–§3): the maintainer's "Monte Carlo" ask reframed as a structural measurement — what depends on this claim, as counts that show their derivation, never probabilities. Stacked on #173; merge in order.

What it computes

traceClaimDependencies(data, claimRef, { mode: 'remove' | 'negate', hypothesisEdges? }) — a pure diff over the same exported builders the dossier renders from, run on data and data-without-the-claim:

  • Knots — dissolved / split / shrunk, with surviving fragments and the removed (or, on negate, flipped-to-concordance) edge ids on the face.
  • Support — the links.related family is new in the collector (every supports/updates/duplicates link with an orbit endpoint — a gap the dossier never covered); reports links removed + claims losing their only incoming support.
  • Propositions — the claim's own propositions with verdict-chain lengths as context (no verdict recomputed — truth stays with the verdict layer), plus attestation-convergence deltas over the order-preserved list: removing the earliest origin honestly promotes the next-oldest to baseline.
  • Entities / timeline — who loses their only claim in the case; which events and axes empty. Negate reports true zeros here — the claim still exists.
  • Hypothesis map — per hypothesis: edges removed (remove) or supports↔undermines role-flipped (negate).

The §4 red line, machine-checked

The guard test walks both modes' full output: no probability/likelihood/confidence/score/weight key anywhere, and every numeric leaf sits beside a derivation — a number with no derivation is a bug. The probabilistic Monte Carlo remains refused per the approved design.

Tests: 1,780 green (14 new) · build clean · lint 0 errors.

Next

CF.2 — the inline "Trace dependencies" per-claim expander in the case view — is the final slice.

🤖 Generated with Claude Code

… derivations (26 CF.1)

Phase 26 slice CF.1 (docs/COUNTERFACTUAL_DESIGN.md §2–§3): what in the
case graph structurally changes if one claim is removed or negated —
counts that show their derivation, never probabilities. A pure diff
over the SAME exported builders the dossier renders from (buildKnots,
buildTimelineEvents, buildEntitiesInvolved, attestationConvergence)
run on data and data-without-the-claim. No LLM, no persistence, no
wire kind.

- collectCaseDossierData gains links.related — EVERY supports/updates/
  duplicates link with an orbit endpoint (the family the dossier never
  collected; supports-with-attestation rides here too, the
  attestations family stays the §3.2-filtered view). Canonicalize-and-
  stamp pattern, id order, noise-exclusion tested.
- src/shared/case-counterfactual.js traceClaimDependencies(data, ref,
  {mode: remove|negate, hypothesisEdges?}):
  · knots — per affected knot: dissolved/split/shrunk, surviving
    fragments, removed (or flipped-to-concordance) edge ids;
  · support — links removed + claims losing their ONLY incoming
    support, each with the removed link id;
  · propositions — the claim's own propositions (chain lengths as
    context; no verdict recomputed — truth stays with the verdict
    layer) + per-proposition attestation-convergence deltas over the
    order-preserved list (removing the earliest origin honestly
    promotes the next-oldest to baseline);
  · entities losing their only claim; timeline events removed + axes
    emptied (remove mode; negate reports TRUE zeros — the claim still
    exists);
  · hypothesis-map joins: per hypothesis, edges removed (remove) or
    role-flipped (negate).
- 13 tests incl. the §4 guard: banned keys nowhere AND every numeric
  sits beside a derivation (a number with no derivation is a bug);
  determinism; off-graph claim yields zeros, not errors.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@bryanmatthewsimonson
bryanmatthewsimonson force-pushed the claude/phase-26-cf1-counterfactual branch from aa6001f to 950afbb Compare July 16, 2026 17:20
@bryanmatthewsimonson
bryanmatthewsimonson deleted the branch claude/phase-26-h4-llm-edge-suggest July 18, 2026 05:09
@bryanmatthewsimonson

Copy link
Copy Markdown
Owner Author

Landed on main via the #183 consolidation merge — this PR was auto-closed by the base-branch deletion cascade, but its commits are all in main.

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