feat(impact): Impact Trace — downstream causal analysis - #76
Open
saadamjad wants to merge 1 commit into
Open
Conversation
Impact Trace is the downstream mirror of Causal Trace: where /why walks
parent_event_id UP to the origin, Impact Trace walks the causal graph
DOWN through children to show an event's blast radius.
Backend (core/api/events.py):
- New GET /v1/events/{id}/impact?depth= — recursive WITH RECURSIVE walking
forward (JOIN ON e.parent_event_id = it.event_id), bounded by depth,
reusing idx_events_parent. Returns a flat node list with per-node depth
so the client renders the fan-out tree. Tenant-isolated; enforces
assert_agent_allowed on the root event.
- Security hardening (G5): also backfills assert_agent_allowed on the
existing /why endpoint so agent-scoped keys can't trace other agents'
events.
Frontend:
- lib/api.ts: getImpactChain() + ImpactTree/ImpactNode types.
- New /dashboard/debugging/impact page mirroring the Causal Trace UX —
single Event ID input, deep-linkable, loading/empty/error/success
states, a downstream tree (indented by depth, error badges, expandable
node detail, "trace impact from here").
- DashboardShell: "Impact Trace" entry under the Debugging nav group.
Verified live against the seeded chain user_message → planning →
tool_call → tool_error: impact(root)=4 nodes (depths 0–3),
impact(tool_call)=2, impact(tool_error)=1; bad/unknown UUID→404;
depth=1→2 nodes; dashboard build compiles clean; page loads 200.
Closes #75
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 18, 2026
Open
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.
Closes #75.
What
Impact Trace — the downstream mirror of Causal Trace.
/whywalksparent_event_idup to the origin; Impact Trace walks the causal graphdown through children to reveal an event's blast radius ("what did this
event cause?").
Changes
Backend (
core/api/events.py)GET /v1/events/{id}/impact?depth=— recursiveWITH RECURSIVEwalking forward(
JOIN ON e.parent_event_id = it.event_id), bounded bydepth(≤50), reusingidx_events_parent. Returns{event_id, node_count, nodes:[{…event…, depth}]}—a flat list the client renders as a fan-out tree.
assert_agent_allowedon bothimpactand the existing
whyso agent-scoped keys can't trace other agents' events.Frontend
lib/api.ts:getImpactChain()+ImpactTree/ImpactNodetypes./dashboard/debugging/impactpage — mirrors Causal Trace UX: single Event IDinput, deep-linkable (
?event_id=), loading/empty/error/success states, downstreamtree (indented by depth, error badges, expandable node detail, "trace impact from
here").
DashboardShell: Impact Trace entry under the Debugging nav group.How to test
Then, against a running stack, deep-link
/dashboard/debugging/impact?event_id=<id>.Verified live (seeded chain user_message → planning → tool_call → tool_error)
impact(user_message)impact(tool_call)impact(tool_error)(leaf)?depth=1from rootPart of the debugging-system roadmap — see
docs/DEBUGGING_SYSTEM_REVIEW.md(HIGH tier).🤖 Generated with Claude Code