Repository navigation
fix(explore): search a feature description that mentions changes when nothing changed - #536
Conversation
|
@coderabbitai full review |
There was a problem hiding this comment.
bompus has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 5 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
Review: #536 (review) |
…mchenry#2655) A Go struct referenced nothing through its fields: etcd's `type PutResponse struct { Header *ResponseHeader }` or gin's `type Context struct { handlers HandlersChain }` had no `references` edge to those types, so impact on `ResponseHeader` or `HandlersChain` missed every struct holding one, and their users. Main had 0 such edges on gin, etcd, prometheus and kubernetes; only embedded fields were read (`extends`). TS extractor and Rust kernel, mirrored: - goStructFieldTypeNames / struct_field_type_names walk each named field's type and push a `references` ref per type name from the struct, on the name. Fields mint no nodes: impact never climbs `contains` upward (#536), so a field node would stop impact short of the struct; Dart attributes field types to the class too (colbymchenry#2327). - colbymchenry#2441's alias walk is factored into collectGoTypeNames / collect_type_names + goDeclaredNames / declared_names, so struct fields skip what aliases skip: predeclared types and, written bare, the declaration's own type parameters and its own name (no self-edge, no failed row for `next *node`). - An embedded field stays `extends`; an embedded generic's type arguments are references (client-go's `listers.ResourceIndexer[*v1.Pod]`: 651 such fields in kubernetes). Resolver: gateTargetKind's unknown-qualifier rule (colbymchenry#2417) now covers every Go type declaration (GO_TYPE_KINDS). Without it, a field `op clientv3.Op` under an unaliased go.etcd.io/etcd/client/v3 import bound to the same file's own `Op`. Explore: a `references` edge whose ends are both type declarations no longer makes either end connected to an entry. With the new edges alone the colbymchenry#1500 CG-10 gate failed: payroll's 8-line `RunResult` (holding a `[]Payslip`) became connected and displaced the 51-line runPayrollCycleAll body. The rule alone changes no rendered symbol on gin, etcd, prometheus, kubernetes, bloc, bulletproof or refine-examples. Validation (main de3eb71, site-keyed A/B, every added edge judged against real package clauses): gin +41, etcd +1006, prometheus +1637, kubernetes +20203, all correct; 0 dropped/retargeted/metadata-only; no node changes or self-loops; kernel == wasm. Index time within noise, DB +0.4-1.4%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Asking
codegraph_exploreabout a feature whose description happens to contain "working tree changes" (or "my changes", "this branch") no longer returns an empty answer when nothing has changed.Before this change, any query with a change phrase was answered from the diff, and only the code-like tokens of the rest of the question (camelCase names, paths, calls) were searched. A plain-English feature question on a clean tree, such as "the thread details panel shows the working tree changes with additions and deletions", had no such tokens and an empty diff, so explore printed the "Changes — none" heading and nothing else.
Now, when the diff is empty and at least three words remain beside the change phrase, the rest of the question is searched in full, like any other question. A bare "review my changes" and short questions such as "pricing my changes" still get only the empty-diff answer, and a dirty tree still answers from the diff whatever the question says.
Evidence
__tests__/explore-changes.test.ts: the new feature-description test fails onfork/consolidatedand passes here. Two more cases pin the guards: removing the three-word floor fails one, and removing the empty-diff check fails the other.2725f1a9vs this branch: 66 answers identical. The one changed answer (t3codeq-7907bc7a05, the question quoted above) grew from 514 to 23,834 characters and now includesapps/web/src/components/chat/ThreadDetailsPanel.tsx, the file the agent was looking for.explore-changes.test.tspasses 9 of 9 on the pushed head.README rows checked: none apply (no command, tool, language or measured number changes). The unreleased CHANGELOG bullet for change questions gains one sentence.
Not covered: on a dirty tree, a long feature question that contains a change phrase is still answered from the diff only.
Summary by cubic
Fixes
codegraph_explorereturning an empty answer when a question describes a feature using a change phrase ("working tree changes", "my changes") while nothing has changed.Previously, any query containing a change phrase was answered from the diff, and only the code-like tokens of the rest of the question were searched. On a clean tree a plain-English description such as "the panel shows the working tree changes with additions and deletions" had no code tokens and an empty diff, so the tool printed the empty-changes heading and nothing else.
Now, when the diff is empty and three or more words remain alongside the change phrase, the rest of the question is searched in full. Bare "review my changes" and shorter questions still get only the empty-diff answer, and a dirty tree still answers from the diff regardless of wording.
Written for commit 96cb26f. Summary will update on new commits.