Repository navigation
Conversation
A named lookup can return a short forwarding function and its tests while the implementation is in a separate definition. Reuse the source and call-edge checks from grep to provide that implementation at the same revision. Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
A default argument can share the return call line. Reject competing syntax, and accept a parser-proven alias when the graph agrees on its target. Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
A module may rebind an alias after import even when the parser retained a high-confidence edge. Require a same-name call witness before serving the target body. Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
This branch has not been deployed
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.
Changelog category
Changelog entry
code.edit_contextincludes the implementation behind a verified Python forwarding definition when the index holds both at the same revision.Why
An edit lookup can reach a short public entry point whose implementation lives in another definition. The caller and the implementation belong in one response when the retained source and call edge prove the forwarding relationship.
Scope and risk
The edit lookup reuses the source and graph checks from
code.grep. A complete wrapper must contain one forwarding call. The graph must resolve that call to one target and the index must retain the full target at the wrapper's revision. A call in a default argument can share that line, so the handler checks the entire definition for competing calls. The written callee must match the indexed target name. For a bare call, the indexed Git blob must provide one unconditional lexical binding without a competing binding in the source file. The response's primary definition and its test examples keep their existing roles. The additional block uses the existing enrichment deadline and its tokens count toward the trace.Compatibility, rollout and rollback
forwarded_definitionis an optionalcode.edit_contextresponse field with the target name, path, line span, and body.Tests
pytest -q tests/integration/test_code_plane.py -k verified_forwarded_implementationpassed six fixtures against a private index covering a direct target, a different revision, mismatched names, a rebound name, and a competing call in a default argument.make format-check,make lint, andmake typecheckpassed. The standalone replay and the focused integration check cover the changed read path.AI assistance in the code
Checklist
Note
Medium Risk
Adds optional enrichment on a core read path with AST, blob, and graph checks; failures are silent omissions but wrong verification could leak misleading bodies.
Overview
code.edit_contextcan now return an optionalforwarded_definition(GrepDependency) alongside the resolved wrapper when the index proves a single Python forwarding call to one callee at the same revision.Verification reuses the grep dependency machinery: the wrapper must be a one-statement
def/async defwith one call on that line (no default-arg collisions), the served body must match the indexed revision, bare calls need a unique module-level binding without shadowing, and the call graph must resolve to exactly one target.code.symboland other routes omit the field; serialization drops it when empty. Tokens count toward the edit-context budget and trace route.SDKs (Python/TypeScript/Rust contracts), ops reference, and MCP descriptions document the new wire field. Integration and unit tests cover direct forwarding plus negative cases (revision skew, aliases, shadowing, rebound names, signature/default-arg noise).
Reviewed by Cursor Bugbot for commit e6f473a. Bugbot is set up for automated code reviews on this repo. Configure here.