feat(counterfactual): traceClaimDependencies — structural deltas with derivations (26 CF.1)#174
Closed
bryanmatthewsimonson wants to merge 1 commit into
Conversation
bryanmatthewsimonson
force-pushed
the
claude/phase-26-cf1-counterfactual
branch
from
July 16, 2026 17:06
9918244 to
aa6001f
Compare
… 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
force-pushed
the
claude/phase-26-cf1-counterfactual
branch
from
July 16, 2026 17:20
aa6001f to
950afbb
Compare
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ondataanddata-without-the-claim:links.relatedfamily 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.The §4 red line, machine-checked
The guard test walks both modes' full output: no
probability/likelihood/confidence/score/weightkey anywhere, and every numeric leaf sits beside aderivation— 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