Skip to content

review: honor KAI_GRAPH=off; experimental callers-of-changed-code block - #218

Draft
jschatz1 wants to merge 1 commit into
mainfrom
feat/symbol-call-edges
Draft

jschatz1 wants to merge 1 commit into
mainfrom
feat/symbol-call-edges

Conversation

@jschatz1

Copy link
Copy Markdown
Member

Why

Part of the symbol-level call graph work (kaicontext/kai-core#9 → kaicontext/kai-engine#128). Two review-side pieces:

  1. KAI_GRAPH=off now also skips the turn-0 planner injection, so with the engine's gates a run gets no graph tools, no symbol grep and no graph context. That's how the graph-on vs graph-off benchmark is run with one binary. Not for production.
  2. KAI_REVIEW_BLAST_CONTEXT=1 (default off): before the review, every function whose range overlaps a changed line gets its callers listed in the first message, from the symbol-level graph. Today the blast radius is computed after the review as a panel, and the reviewer sees callers only if it calls kai_callers — in the smoke run it did so once in two reviews, and the CHANGED SYMBOLS block tells it not to search the graph for changed names. The block says outright that a missing caller is not proof of none.

Status — draft until

  • kai-engine#128 is released; this branch then needs the go.mod bump (it won't compile against v0.6.86: graph.Disabled, SymbolNodesScoped, HasCallGraph).
  • The benchmark arms finish (graph-on / graph-off ×2, blast-context ×1, Martian 50 PRs, local runner). Whether KAI_REVIEW_BLAST_CONTEXT ever defaults on depends on those numbers.

Tests

go test ./cmd/kai green against the local engine/core. New: TestRCChangedLines, TestRCBlastContextListsCallersOfChangedFunction (real capture: changed Charge lists its two callers; an uncalled function yields no block).

🤖 Generated with Claude Code

- The turn-0 planner injection respects graph.Disabled(), so a
  KAI_GRAPH=off run withholds every graph contribution (with the
  engine's tool and context gates) and the graph's effect on review can
  be measured with one binary.
- KAI_REVIEW_BLAST_CONTEXT=1 (default off): before the review starts,
  find every function whose range overlaps a changed line and list its
  callers from the symbol-level call graph in the first message. The
  blast radius was only computed after the review, as a panel; the
  reviewer saw callers only if it called kai_callers, which it rarely
  does. Missing callers are stated as "not proof there is none".

Needs kai-engine with symbol-level CALLS (graph.Disabled,
SymbolNodesScoped, HasCallGraph).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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